diff options
Diffstat (limited to 'oox/source/export/drawingml.cxx')
-rw-r--r-- | oox/source/export/drawingml.cxx | 142 |
1 files changed, 0 insertions, 142 deletions
diff --git a/oox/source/export/drawingml.cxx b/oox/source/export/drawingml.cxx index 0a41a7ddfd4a..0398ce49ea78 100644 --- a/oox/source/export/drawingml.cxx +++ b/oox/source/export/drawingml.cxx @@ -794,37 +794,6 @@ void DrawingML::WriteOutline( const Reference<XPropertySet>& rXPropSet ) mpFS->endElementNS( XML_a, XML_ln ); } -bool lcl_URLToGraphic(const OUString& rURL, Graphic& rGraphic) -{ - OString aURLBS(OUStringToOString(rURL, RTL_TEXTENCODING_UTF8)); - - const char aURLBegin[] = "vnd.sun.star.GraphicObject:"; - sal_Int32 index = aURLBS.indexOf(aURLBegin); - - if ( index != -1 ) - { - rGraphic = GraphicObject(aURLBS.copy(RTL_CONSTASCII_LENGTH(aURLBegin))).GetTransformedGraphic(); - return true; - } - - return false; -} - -OUString DrawingML::WriteImage( const OUString& rURL, bool bRelPathToMedia ) -{ - Graphic aGraphic; - if (lcl_URLToGraphic(rURL, aGraphic)) - { - return WriteImage( aGraphic , bRelPathToMedia ); - } - else - { - // add link to relations - } - - return OUString(); -} - const char* DrawingML::GetComponentDir() { switch ( meDocumentType ) @@ -1086,39 +1055,6 @@ void DrawingML::WriteImageBrightnessContrastTransparence(uno::Reference<beans::X } } -OUString DrawingML::WriteBlip( const Reference< XPropertySet >& rXPropSet, const OUString& rURL, bool bRelPathToMedia ) -{ - OUString sRelId; - BitmapChecksum nChecksum = 0; - if (!rURL.isEmpty() && mpTextExport) - { - Graphic aGraphic; - if (lcl_URLToGraphic(rURL, aGraphic)) - { - nChecksum = aGraphic.GetChecksum(); - sRelId = mpTextExport->FindRelId(nChecksum); - } - } - if (sRelId.isEmpty()) - { - sRelId = WriteImage( rURL, bRelPathToMedia ); - if (!rURL.isEmpty() && mpTextExport) - mpTextExport->CacheRelId(nChecksum, sRelId); - } - - mpFS->startElementNS( XML_a, XML_blip, - FSNS( XML_r, XML_embed), sRelId.toUtf8().getStr(), - FSEND ); - - WriteImageBrightnessContrastTransparence(rXPropSet); - - WriteArtisticEffect( rXPropSet ); - - mpFS->endElementNS( XML_a, XML_blip ); - - return sRelId; -} - OUString DrawingML::WriteXGraphicBlip(uno::Reference<beans::XPropertySet> const & rXPropSet, uno::Reference<graphic::XGraphic> const & rxGraphic, bool bRelPathToMedia) @@ -1157,27 +1093,6 @@ OUString DrawingML::WriteXGraphicBlip(uno::Reference<beans::XPropertySet> const return sRelId; } -void DrawingML::WriteBlipMode( const Reference< XPropertySet >& rXPropSet, const OUString& rURL ) -{ - BitmapMode eBitmapMode( BitmapMode_NO_REPEAT ); - if (GetProperty( rXPropSet, "FillBitmapMode" ) ) - mAny >>= eBitmapMode; - - SAL_INFO("oox.shape", "fill bitmap mode: " << int(eBitmapMode)); - - switch (eBitmapMode) - { - case BitmapMode_REPEAT: - mpFS->singleElementNS( XML_a, XML_tile, FSEND ); - break; - case BitmapMode_STRETCH: - WriteStretch( rXPropSet, rURL ); - break; - default: - break; - } -} - void DrawingML::WriteXGraphicBlipMode(uno::Reference<beans::XPropertySet> const & rXPropSet, uno::Reference<graphic::XGraphic> const & rxGraphic) { @@ -1243,32 +1158,6 @@ void DrawingML::WriteBlipFill( const Reference< XPropertySet >& rXPropSet, const } } -void DrawingML::WriteBlipFill( const Reference< XPropertySet >& rXPropSet, const OUString& sBitmapURL, sal_Int32 nXmlNamespace, bool bWriteMode, bool bRelPathToMedia ) -{ - if ( !sBitmapURL.isEmpty() ) - { - SAL_INFO("oox.shape", "URL: " << sBitmapURL); - - mpFS->startElementNS( nXmlNamespace , XML_blipFill, XML_rotWithShape, "0", FSEND ); - - WriteBlip( rXPropSet, sBitmapURL, bRelPathToMedia ); - - if( bWriteMode ) - { - WriteBlipMode( rXPropSet, sBitmapURL ); - } - else if( GetProperty( rXPropSet, "FillBitmapStretch" ) ) - { - bool bStretch = false; - mAny >>= bStretch; - - if( bStretch ) - WriteStretch( rXPropSet, sBitmapURL ); - } - mpFS->endElementNS( nXmlNamespace, XML_blipFill ); - } -} - void DrawingML::WriteXGraphicBlipFill(uno::Reference<beans::XPropertySet> const & rXPropSet, uno::Reference<graphic::XGraphic> const & rxGraphic, sal_Int32 nXmlNamespace, bool bWriteMode, bool bRelPathToMedia) @@ -1373,37 +1262,6 @@ void DrawingML::WriteSrcRectXGraphic(uno::Reference<beans::XPropertySet> const & WriteGraphicCropProperties(rxPropertySet, aOriginalSize, rMapMode); } -void DrawingML::WriteStretch( const css::uno::Reference< css::beans::XPropertySet >& rXPropSet, const OUString& rURL ) -{ - mpFS->startElementNS( XML_a, XML_stretch, FSEND ); - - bool bCrop = false; - if ( GetProperty( rXPropSet, "GraphicCrop" ) ) - { - css::text::GraphicCrop aGraphicCropStruct; - mAny >>= aGraphicCropStruct; - - if ( (0 != aGraphicCropStruct.Left) || (0 != aGraphicCropStruct.Top) || (0 != aGraphicCropStruct.Right) || (0 != aGraphicCropStruct.Bottom) ) - { - Size aOriginalSize( GraphicObject::CreateGraphicObjectFromURL( rURL ).GetPrefSize() ); - mpFS->singleElementNS( XML_a, XML_fillRect, - XML_l, I32S(((aGraphicCropStruct.Left) * 100000)/aOriginalSize.Width()), - XML_t, I32S(((aGraphicCropStruct.Top) * 100000)/aOriginalSize.Height()), - XML_r, I32S(((aGraphicCropStruct.Right) * 100000)/aOriginalSize.Width()), - XML_b, I32S(((aGraphicCropStruct.Bottom) * 100000)/aOriginalSize.Height()), - FSEND ); - bCrop = true; - } - } - - if( !bCrop ) - { - mpFS->singleElementNS( XML_a, XML_fillRect, FSEND ); - } - - mpFS->endElementNS( XML_a, XML_stretch ); -} - void DrawingML::WriteXGraphicStretch(uno::Reference<beans::XPropertySet> const & rXPropSet, uno::Reference<graphic::XGraphic> const & rxGraphic) { |