[Libreoffice-commits] core.git: 2 commits - svx/source writerfilter/source

Luboš Luňák l.lunak at collabora.com
Sun Apr 27 08:53:34 PDT 2014


 svx/source/sdr/primitive2d/sdrattributecreator.cxx   |   27 ++++++++++++++-----
 writerfilter/source/dmapper/TablePositionHandler.cxx |    4 ++
 2 files changed, 23 insertions(+), 8 deletions(-)

New commits:
commit 313b59d787357ef3da34e2833fefcf1143b09b5e
Author: Luboš Luňák <l.lunak at collabora.com>
Date:   Sun Apr 27 17:48:46 2014 +0200

    fix "transparency" of floating tables in docx import (fdo#77723)
    
    Normal tables do not have any fill background on their own, i.e. it's
    possible to see e.g. an image in the background, so if we put a table
    inside a frame in order to make it floating, make the frame transparent
    in order to achieve the same result.
    
    Change-Id: I77b1c8f847af5355c4238bfa089d760dd6121a69

diff --git a/writerfilter/source/dmapper/TablePositionHandler.cxx b/writerfilter/source/dmapper/TablePositionHandler.cxx
index 6909f71..ca20875 100644
--- a/writerfilter/source/dmapper/TablePositionHandler.cxx
+++ b/writerfilter/source/dmapper/TablePositionHandler.cxx
@@ -93,7 +93,7 @@ void TablePositionHandler::lcl_sprm(Sprm& /*rSprm*/)
 
 uno::Sequence<beans::PropertyValue> TablePositionHandler::getTablePosition() const
 {
-    uno::Sequence< beans::PropertyValue > aFrameProperties(18);
+    uno::Sequence< beans::PropertyValue > aFrameProperties(19);
     beans::PropertyValue* pFrameProperties = aFrameProperties.getArray();
 
     pFrameProperties[0].Name = "LeftBorderDistance";
@@ -178,6 +178,8 @@ uno::Sequence<beans::PropertyValue> TablePositionHandler::getTablePosition() con
     pFrameProperties[16].Value <<= nVertOrientRelation;
     pFrameProperties[17].Name = "VertOrientPosition";
     pFrameProperties[17].Value <<= ConversionHelper::convertTwipToMM100(m_nY);
+    pFrameProperties[18].Name = "FillTransparence";
+    pFrameProperties[18].Value <<= sal_Int32(100);
 
     return aFrameProperties;
 }
commit a55dac47b386cd5485ba1d828316e7695c34769b
Author: Luboš Luňák <l.lunak at collabora.com>
Date:   Sun Apr 27 17:33:07 2014 +0200

    fix drawing of 100% transparent frames (fdo#77723)
    
    Without this, the 100% transparent frame is actually drawn opaque.
    
    Change-Id: Ibaaeead7fe2379d48ea9680719a082e322b7b0c9

diff --git a/svx/source/sdr/primitive2d/sdrattributecreator.cxx b/svx/source/sdr/primitive2d/sdrattributecreator.cxx
index ea4bbb9..4726d06 100644
--- a/svx/source/sdr/primitive2d/sdrattributecreator.cxx
+++ b/svx/source/sdr/primitive2d/sdrattributecreator.cxx
@@ -383,15 +383,15 @@ namespace drawinglayer
         {
             const XFillStyle eStyle(((XFillStyleItem&)(rSet.Get(XATTR_FILLSTYLE))).GetValue());
 
-            if(XFILL_NONE != eStyle)
-            {
-                sal_uInt16 nTransparence(((const XFillTransparenceItem&)(rSet.Get(XATTR_FILLTRANSPARENCE))).GetValue());
+            sal_uInt16 nTransparence(((const XFillTransparenceItem&)(rSet.Get(XATTR_FILLTRANSPARENCE))).GetValue());
 
-                if(nTransparence > 100)
-                {
-                    nTransparence = 100;
-                }
+            if(nTransparence > 100)
+            {
+                nTransparence = 100;
+            }
 
+            if(XFILL_NONE != eStyle)
+            {
                 if(100 != nTransparence)
                 {
                     // need to check XFillFloatTransparence, object fill may still be completely transparent
@@ -494,6 +494,19 @@ namespace drawinglayer
                 }
             }
 
+            if(nTransparence == 100)
+            {
+                attribute::FillGradientAttribute aGradient;
+                attribute::FillHatchAttribute aHatch;
+                attribute::SdrFillGraphicAttribute aFillGraphic;
+                    return attribute::SdrFillAttribute(
+                        1,
+                        basegfx::BColor( 0, 0, 0 ),
+                        aGradient,
+                        aHatch,
+                        aFillGraphic);
+            }
+
             return attribute::SdrFillAttribute();
         }
 


More information about the Libreoffice-commits mailing list