From e030fbbf67a2490c4e734583d9f987c27506179e Mon Sep 17 00:00:00 2001 From: Tomaž Vajngerl Date: Tue, 6 Mar 2018 18:29:40 +0900 Subject: oox: remove property FillBitmapURL, BackGraphicURL and GraphicURL MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Change-Id: I1f75b1775fec4b47ad78a32724785333a90d3baf Reviewed-on: https://gerrit.libreoffice.org/50809 Tested-by: Jenkins Reviewed-by: Tomaž Vajngerl --- oox/source/drawingml/shapepropertymap.cxx | 2 +- oox/source/export/drawingml.cxx | 28 +++++++--------------------- oox/source/token/properties.txt | 3 --- sc/source/filter/inc/pagesettings.hxx | 2 +- sc/source/filter/oox/pagesettings.cxx | 14 ++++++++------ 5 files changed, 17 insertions(+), 32 deletions(-) diff --git a/oox/source/drawingml/shapepropertymap.cxx b/oox/source/drawingml/shapepropertymap.cxx index c0704381b19c..6d487f51c2ed 100644 --- a/oox/source/drawingml/shapepropertymap.cxx +++ b/oox/source/drawingml/shapepropertymap.cxx @@ -43,7 +43,7 @@ static const ShapePropertyIds spnDefaultShapeIds = PROP_LineStyle, PROP_LineWidth, PROP_LineColor, PROP_LineTransparence, PROP_LineDash, PROP_LineJoint, PROP_LineStartName, PROP_LineStartWidth, PROP_LineStartCenter, PROP_LineEndName, PROP_LineEndWidth, PROP_LineEndCenter, PROP_FillStyle, PROP_FillColor, PROP_FillTransparence, PROP_FillTransparenceGradientName, PROP_FillGradient, - PROP_FillBitmapURL, PROP_FillBitmapMode, PROP_FillBitmapSizeX, PROP_FillBitmapSizeY, + PROP_FillBitmap, PROP_FillBitmapMode, PROP_FillBitmapSizeX, PROP_FillBitmapSizeY, PROP_FillBitmapPositionOffsetX, PROP_FillBitmapPositionOffsetY, PROP_FillBitmapRectanglePoint, PROP_FillHatch, PROP_ShadowXDistance, diff --git a/oox/source/export/drawingml.cxx b/oox/source/export/drawingml.cxx index d3ccf3d81223..ca7c303acd6e 100644 --- a/oox/source/export/drawingml.cxx +++ b/oox/source/export/drawingml.cxx @@ -1220,39 +1220,25 @@ void DrawingML::WriteBlipFill( const Reference< XPropertySet >& rXPropSet, const { if ( GetProperty( rXPropSet, sURLPropName ) ) { + uno::Reference xGraphic; if (mAny.has>()) { uno::Reference xBitmap; xBitmap = mAny.get>(); - uno::Reference xGraphic(xBitmap, uno::UNO_QUERY); - if (xBitmap.is() && xGraphic.is()) - { - bool bWriteMode = false; - if (sURLPropName == "FillBitmap" || sURLPropName == "BackGraphic") - bWriteMode = true; - WriteXGraphicBlipFill(rXPropSet, xGraphic, nXmlNamespace, bWriteMode); - } + if (xBitmap.is()) + xGraphic.set(xBitmap, uno::UNO_QUERY); } else if (mAny.has>()) { - uno::Reference xGraphic; xGraphic = mAny.get>(); - if (xGraphic.is()) - { - bool bWriteMode = false; - if (sURLPropName == "FillBitmap" || sURLPropName == "BackGraphic") - bWriteMode = true; - WriteXGraphicBlipFill(rXPropSet, xGraphic, nXmlNamespace, bWriteMode); - } } - else + + if (xGraphic.is()) { - OUString aURL; - mAny >>= aURL; bool bWriteMode = false; - if( sURLPropName == "FillBitmapURL" || sURLPropName == "BackGraphicURL") + if (sURLPropName == "FillBitmap" || sURLPropName == "BackGraphic") bWriteMode = true; - WriteBlipFill( rXPropSet, aURL, nXmlNamespace, bWriteMode ); + WriteXGraphicBlipFill(rXPropSet, xGraphic, nXmlNamespace, bWriteMode); } } } diff --git a/oox/source/token/properties.txt b/oox/source/token/properties.txt index 6754ee58558c..86dd843d12b7 100644 --- a/oox/source/token/properties.txt +++ b/oox/source/token/properties.txt @@ -22,7 +22,6 @@ BackColor BackColorTransparency BackGraphicLocation BackGraphic -BackGraphicURL Background BackgroundColor BasicLibraries @@ -167,7 +166,6 @@ FillBitmapPositionOffsetY FillBitmapRectanglePoint FillBitmapSizeX FillBitmapSizeY -FillBitmapURL FillBitmap FillColor FillGradient @@ -209,7 +207,6 @@ GraphicBitmap GraphicColorMode GraphicCrop GraphicSize -GraphicURL GridColor GroupInfo GroupName diff --git a/sc/source/filter/inc/pagesettings.hxx b/sc/source/filter/inc/pagesettings.hxx index 03a0c8d32e36..2868d8eac4ad 100644 --- a/sc/source/filter/inc/pagesettings.hxx +++ b/sc/source/filter/inc/pagesettings.hxx @@ -34,7 +34,7 @@ class HeaderFooterParser; /** Holds page style data for a single sheet. */ struct PageSettingsModel { - OUString maGraphicUrl; /// URL of the graphic object. + css::uno::Reference mxGraphic; /// Background Graphic OUString maBinSettPath; /// Relation identifier of binary printer settings. OUString maOddHeader; /// Header string for odd pages. OUString maOddFooter; /// Footer string for odd pages. diff --git a/sc/source/filter/oox/pagesettings.cxx b/sc/source/filter/oox/pagesettings.cxx index 19aad8e64093..7dee9ab6d944 100644 --- a/sc/source/filter/oox/pagesettings.cxx +++ b/sc/source/filter/oox/pagesettings.cxx @@ -334,9 +334,11 @@ void PageSettings::finalizeImport() void PageSettings::importPictureData( const Relations& rRelations, const OUString& rRelId ) { - OUString aPicturePath = rRelations.getFragmentPathFromRelId( rRelId ); - if( !aPicturePath.isEmpty() ) - maModel.maGraphicUrl = getBaseFilter().getGraphicHelper().importEmbeddedGraphicObject( aPicturePath ); + OUString aPicturePath = rRelations.getFragmentPathFromRelId(rRelId); + if (!aPicturePath.isEmpty()) + { + maModel.mxGraphic = getBaseFilter().getGraphicHelper().importEmbeddedGraphic(aPicturePath); + } } enum HFPortionId @@ -979,10 +981,10 @@ void PageSettingsConverter::writePageSettingsProperties( aPropMap.setProperty( PROP_FooterHeight, maFooterData.mnHeight); aPropMap.setProperty( PROP_FooterBodyDistance, maFooterData.mnBodyDist); // background image - if( !rModel.maGraphicUrl.isEmpty() ) + if (rModel.mxGraphic.is()) { - aPropMap.setProperty( PROP_BackGraphicURL, rModel.maGraphicUrl); - aPropMap.setProperty( PROP_BackGraphicLocation, css::style::GraphicLocation_TILED); + aPropMap.setProperty(PROP_BackGraphic, rModel.mxGraphic); + aPropMap.setProperty(PROP_BackGraphicLocation, css::style::GraphicLocation_TILED); } rPropSet.setProperties( aPropMap ); -- cgit