[Libreoffice-commits] core.git: oox/inc oox/source

Tomaž Vajngerl tomaz.vajngerl at collabora.co.uk
Wed Mar 7 10:05:56 UTC 2018


 oox/inc/drawingml/fillproperties.hxx                    |    3 --
 oox/source/drawingml/fillproperties.cxx                 |   19 +++++++---------
 oox/source/drawingml/misccontexts.cxx                   |    6 ++---
 oox/source/drawingml/textparagraphpropertiescontext.cxx |    4 +--
 oox/source/vml/vmlformatting.cxx                        |    4 +--
 5 files changed, 17 insertions(+), 19 deletions(-)

New commits:
commit 584454cedc57efc98a386dffa2ebae30c0625b8a
Author: Tomaž Vajngerl <tomaz.vajngerl at collabora.co.uk>
Date:   Wed Mar 7 16:37:26 2018 +0900

    oox: BlipFillProperties rename mxGraphic to mxFillGraphic
    
    Change-Id: Iea4b48e79c7c727bbd7dafd816538f6c1dd25bf8
    Reviewed-on: https://gerrit.libreoffice.org/50868
    Tested-by: Jenkins <ci at libreoffice.org>
    Reviewed-by: Tomaž Vajngerl <quikee at gmail.com>

diff --git a/oox/inc/drawingml/fillproperties.hxx b/oox/inc/drawingml/fillproperties.hxx
index 7fe1a3f6033d..45f5c4b40272 100644
--- a/oox/inc/drawingml/fillproperties.hxx
+++ b/oox/inc/drawingml/fillproperties.hxx
@@ -98,8 +98,7 @@ struct ArtisticEffectProperties
 
 struct BlipFillProperties
 {
-    css::uno::Reference< css::graphic::XGraphic >
-                          mxGraphic;              /// The fill graphic.
+    css::uno::Reference<css::graphic::XGraphic> mxFillGraphic; /// The fill graphic.
     OptValue< sal_Int32 > moBitmapMode;         /// Bitmap tile or stretch.
     OptValue< css::geometry::IntegerRectangle2D >
                           moFillRect;             /// Stretch fill offsets.
diff --git a/oox/source/drawingml/fillproperties.cxx b/oox/source/drawingml/fillproperties.cxx
index 9ba7e46ac215..e7b16553c622 100644
--- a/oox/source/drawingml/fillproperties.cxx
+++ b/oox/source/drawingml/fillproperties.cxx
@@ -68,7 +68,7 @@ Reference< XGraphic > lclCheckAndApplyDuotoneTransform( const BlipFillProperties
         ::Color nColor2 = aBlipProps.maDuotoneColors[1].getColor( rGraphicHelper, nPhClr );
         try
         {
-            Reference< XGraphicTransformer > xTransformer( aBlipProps.mxGraphic, UNO_QUERY_THROW );
+            Reference< XGraphicTransformer > xTransformer( aBlipProps.mxFillGraphic, UNO_QUERY_THROW );
             return xTransformer->applyDuotone( xGraphic, sal_Int32(nColor1), sal_Int32(nColor2) );
         }
         catch( Exception& )
@@ -89,7 +89,7 @@ Reference< XGraphic > lclCheckAndApplyChangeColorTransform( const BlipFillProper
         {
             sal_Int16 nToTransparence = aBlipProps.maColorChangeTo.getTransparency();
             sal_Int8 nToAlpha = static_cast< sal_Int8 >( (100 - nToTransparence) * 2.55 );
-            Reference< XGraphicTransformer > xTransformer( aBlipProps.mxGraphic, UNO_QUERY_THROW );
+            Reference< XGraphicTransformer > xTransformer( aBlipProps.mxFillGraphic, UNO_QUERY_THROW );
             return xTransformer->colorChange( xGraphic, sal_Int32(nFromColor), 9, sal_Int32(nToColor), nToAlpha );
         }
         catch( Exception& )
@@ -187,8 +187,8 @@ void PatternFillProperties::assignUsed( const PatternFillProperties& rSourceProp
 
 void BlipFillProperties::assignUsed( const BlipFillProperties& rSourceProps )
 {
-    if( rSourceProps.mxGraphic.is() )
-        mxGraphic = rSourceProps.mxGraphic;
+    if(rSourceProps.mxFillGraphic.is())
+        mxFillGraphic = rSourceProps.mxFillGraphic;
     moBitmapMode.assignIfUsed( rSourceProps.moBitmapMode );
     moFillRect.assignIfUsed( rSourceProps.moFillRect );
     moTileOffsetX.assignIfUsed( rSourceProps.moTileOffsetX );
@@ -598,10 +598,9 @@ void FillProperties::pushToPropMap( ShapePropertyMap& rPropMap,
 
             case XML_blipFill:
                 // do not start complex graphic transformation if property is not supported...
-                if (maBlipProps.mxGraphic.is() && rPropMap.supportsProperty(ShapeProperty::FillBitmap))
+                if (maBlipProps.mxFillGraphic.is() && rPropMap.supportsProperty(ShapeProperty::FillBitmap))
                 {
-                    Reference< XGraphic > xGraphic = lclCheckAndApplyDuotoneTransform( maBlipProps, maBlipProps.mxGraphic, rGraphicHelper, nPhClr );
-                    uno::Reference<awt::XBitmap> xBitmap(xGraphic, uno::UNO_QUERY);
+                    uno::Reference<graphic::XGraphic> xGraphic = lclCheckAndApplyDuotoneTransform(maBlipProps, maBlipProps.mxFillGraphic, rGraphicHelper, nPhClr);
                     // TODO: "rotate with shape" is not possible with our current core
 
                     if (xGraphic.is())
@@ -631,7 +630,7 @@ void FillProperties::pushToPropMap( ShapePropertyMap& rPropMap,
                             RectanglePoint eRectPoint = lclGetRectanglePoint( maBlipProps.moTileAlign.get( XML_tl ) );
                             rPropMap.setProperty( ShapeProperty::FillBitmapRectanglePoint, eRectPoint );
 
-                            awt::Size aOriginalSize = lclGetOriginalSize( rGraphicHelper, maBlipProps.mxGraphic );
+                            awt::Size aOriginalSize = lclGetOriginalSize(rGraphicHelper, maBlipProps.mxFillGraphic);
                             if( (aOriginalSize.Width > 0) && (aOriginalSize.Height > 0) )
                             {
                                 // size of one bitmap tile (given as 1/1000 percent of bitmap size), convert to 1/100 mm
@@ -726,10 +725,10 @@ void GraphicProperties::pushToPropMap( PropertyMap& rPropMap, const GraphicHelpe
         case XML_grayscl:   eColorMode = ColorMode_GREYS;   break;
     }
 
-    if( maBlipProps.mxGraphic.is() )
+    if (maBlipProps.mxFillGraphic.is())
     {
         // created transformed graphic
-        Reference< XGraphic > xGraphic = lclCheckAndApplyChangeColorTransform(maBlipProps, maBlipProps.mxGraphic, rGraphicHelper, API_RGB_TRANSPARENT);
+        uno::Reference<graphic::XGraphic> xGraphic = lclCheckAndApplyChangeColorTransform(maBlipProps, maBlipProps.mxFillGraphic, rGraphicHelper, API_RGB_TRANSPARENT);
         xGraphic = lclCheckAndApplyDuotoneTransform(maBlipProps, xGraphic, rGraphicHelper, API_RGB_TRANSPARENT);
 
         if (eColorMode == ColorMode_STANDARD && nBrightness == 70 && nContrast == -70)
diff --git a/oox/source/drawingml/misccontexts.cxx b/oox/source/drawingml/misccontexts.cxx
index 87c7fd5c5b86..a3ab1140a804 100644
--- a/oox/source/drawingml/misccontexts.cxx
+++ b/oox/source/drawingml/misccontexts.cxx
@@ -148,8 +148,8 @@ BlipContext::BlipContext( ContextHandler2Helper const & rParent,
     {
         // internal picture URL
         OUString aFragmentPath = getFragmentPathFromRelId( rAttribs.getString( R_TOKEN( embed ), OUString() ) );
-        if( !aFragmentPath.isEmpty() )
-            mrBlipProps.mxGraphic = getFilter().getGraphicHelper().importEmbeddedGraphic( aFragmentPath );
+        if (!aFragmentPath.isEmpty())
+            mrBlipProps.mxFillGraphic = getFilter().getGraphicHelper().importEmbeddedGraphic( aFragmentPath );
     }
     else if( rAttribs.hasAttribute( R_TOKEN( link ) ) )
     {
@@ -164,7 +164,7 @@ BlipContext::BlipContext( ContextHandler2Helper const & rParent,
         aMed.Download();
         Reference< io::XInputStream > xInStrm = aMed.GetInputStream();
         if ( xInStrm.is() )
-            mrBlipProps.mxGraphic = getFilter().getGraphicHelper().importGraphic( xInStrm );
+            mrBlipProps.mxFillGraphic = getFilter().getGraphicHelper().importGraphic( xInStrm );
     }
 }
 
diff --git a/oox/source/drawingml/textparagraphpropertiescontext.cxx b/oox/source/drawingml/textparagraphpropertiescontext.cxx
index 5cf1750dec4e..8b7cdae07805 100644
--- a/oox/source/drawingml/textparagraphpropertiescontext.cxx
+++ b/oox/source/drawingml/textparagraphpropertiescontext.cxx
@@ -148,8 +148,8 @@ TextParagraphPropertiesContext::~TextParagraphPropertiesContext()
         rPropertyMap.setProperty( PROP_ParaTabStops, aSeq);
     }
 
-    if ( mxBlipProps.get() && mxBlipProps->mxGraphic.is() )
-        mrBulletList.setGraphic( mxBlipProps->mxGraphic );
+    if (mxBlipProps.get() && mxBlipProps->mxFillGraphic.is())
+        mrBulletList.setGraphic(mxBlipProps->mxFillGraphic);
 
     if( mrBulletList.is() )
         rPropertyMap.setProperty( PROP_IsNumbering, true);
diff --git a/oox/source/vml/vmlformatting.cxx b/oox/source/vml/vmlformatting.cxx
index 061841408e48..1e8c1318f832 100644
--- a/oox/source/vml/vmlformatting.cxx
+++ b/oox/source/vml/vmlformatting.cxx
@@ -819,8 +819,8 @@ void FillModel::pushToPropMap( ShapePropertyMap& rPropMap, const GraphicHelper&
             {
                 if( moBitmapPath.has() && !moBitmapPath.get().isEmpty() )
                 {
-                    aFillProps.maBlipProps.mxGraphic = rGraphicHelper.importEmbeddedGraphic( moBitmapPath.get() );
-                    if( aFillProps.maBlipProps.mxGraphic.is() )
+                    aFillProps.maBlipProps.mxFillGraphic = rGraphicHelper.importEmbeddedGraphic(moBitmapPath.get());
+                    if (aFillProps.maBlipProps.mxFillGraphic.is())
                     {
                         aFillProps.moFillType = XML_blipFill;
                         aFillProps.maBlipProps.moBitmapMode = (nFillType == XML_frame) ? XML_stretch : XML_tile;


More information about the Libreoffice-commits mailing list