diff options
author | Tomaž Vajngerl <tomaz.vajngerl@collabora.co.uk> | 2018-03-06 18:29:40 +0900 |
---|---|---|
committer | Tomaž Vajngerl <quikee@gmail.com> | 2018-03-07 03:23:00 +0100 |
commit | e030fbbf67a2490c4e734583d9f987c27506179e (patch) | |
tree | 653c775e39be54e36264ab8b543c1dffa506a5de | |
parent | d55a7fca9c1bb1989d5a70d2d9098a9156c82ac4 (diff) |
oox: remove property FillBitmapURL, BackGraphicURL and GraphicURL
Change-Id: I1f75b1775fec4b47ad78a32724785333a90d3baf
Reviewed-on: https://gerrit.libreoffice.org/50809
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Tomaž Vajngerl <quikee@gmail.com>
-rw-r--r-- | oox/source/drawingml/shapepropertymap.cxx | 2 | ||||
-rw-r--r-- | oox/source/export/drawingml.cxx | 28 | ||||
-rw-r--r-- | oox/source/token/properties.txt | 3 | ||||
-rw-r--r-- | sc/source/filter/inc/pagesettings.hxx | 2 | ||||
-rw-r--r-- | 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<graphic::XGraphic> xGraphic; if (mAny.has<uno::Reference<awt::XBitmap>>()) { uno::Reference<awt::XBitmap> xBitmap; xBitmap = mAny.get<uno::Reference<awt::XBitmap>>(); - uno::Reference<graphic::XGraphic> 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<graphic::XGraphic>>()) { - uno::Reference<graphic::XGraphic> xGraphic; xGraphic = mAny.get<uno::Reference<graphic::XGraphic>>(); - 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<css::graphic::XGraphic> 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 ); |