[Libreoffice-commits] core.git: Branch 'libreoffice-4-2' - svx/source

Caolán McNamara caolanm at redhat.com
Fri Jan 10 09:41:24 PST 2014


 svx/source/svdraw/svdotextdecomposition.cxx |   35 +++++++++++++++++++++++++++-
 1 file changed, 34 insertions(+), 1 deletion(-)

New commits:
commit b72f3f40828cf6761a8a3cee0dfe2f8a9d4e4a21
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Fri Jan 10 16:49:19 2014 +0000

    Resolves: fdo#35779 set the bg color of the editeng from the text shape
    
    Change-Id: I75feaea2dbd6c703cb3093c119a69985ecd89419
    (cherry picked from commit 76a0b3170664b19c3eb66edc8fccb04dc5485387)
    Reviewed-on: https://gerrit.libreoffice.org/7380
    Reviewed-by: Eike Rathke <erack at redhat.com>
    Tested-by: Eike Rathke <erack at redhat.com>

diff --git a/svx/source/svdraw/svdotextdecomposition.cxx b/svx/source/svdraw/svdotextdecomposition.cxx
index 970ddf8..b01aab4 100644
--- a/svx/source/svdraw/svdotextdecomposition.cxx
+++ b/svx/source/svdraw/svdotextdecomposition.cxx
@@ -18,8 +18,10 @@
  */
 
 
-#include <svx/svdotext.hxx>
+#include <svx/svdetc.hxx>
 #include <svx/svdoutl.hxx>
+#include <svx/svdpage.hxx>
+#include <svx/svdotext.hxx>
 #include <basegfx/vector/b2dvector.hxx>
 #include <svx/sdr/primitive2d/sdrtextprimitive2d.hxx>
 #include <drawinglayer/primitive2d/textprimitive2d.hxx>
@@ -882,6 +884,36 @@ void SdrTextObj::impDecomposeBlockTextPrimitive(
     rOutliner.SetMinAutoPaperSize(aNullSize);
     rOutliner.SetMaxAutoPaperSize(Size(1000000,1000000));
 
+    // Resolves: fdo#35779 set background color of this shape as the editeng background if there
+    // is one. Check the shape itself, then the host page, then that page's master page.
+    // That color needs to be restored on leaving this method
+    Color aOriginalBackColor(rOutliner.GetBackgroundColor());
+    const SfxItemSet* pBackgroundFillSet = &GetObjectItemSet();
+
+    if (XFILL_NONE == ((const XFillStyleItem&)pBackgroundFillSet->Get(XATTR_FILLSTYLE)).GetValue())
+    {
+        SdrPage *pOwnerPage = GetPage();
+        if (pOwnerPage)
+        {
+            pBackgroundFillSet = &pOwnerPage->getSdrPageProperties().GetItemSet();
+
+            if (XFILL_NONE == ((const XFillStyleItem&)pBackgroundFillSet->Get(XATTR_FILLSTYLE)).GetValue())
+            {
+                if (!pOwnerPage->IsMasterPage() && pOwnerPage->TRG_HasMasterPage())
+                {
+                    pBackgroundFillSet = &pOwnerPage->TRG_GetMasterPage().getSdrPageProperties().GetItemSet();
+                }
+            }
+        }
+    }
+
+    if (XFILL_NONE != ((const XFillStyleItem&)pBackgroundFillSet->Get(XATTR_FILLSTYLE)).GetValue())
+    {
+        Color aColor(rOutliner.GetBackgroundColor());
+        GetDraftFillColor(*pBackgroundFillSet, aColor);
+        rOutliner.SetBackgroundColor(aColor);
+    }
+
     // add one to rage sizes to get back to the old Rectangle and outliner measurements
     const sal_uInt32 nAnchorTextWidth(FRound(aAnchorTextRange.getWidth() + 1L));
     const sal_uInt32 nAnchorTextHeight(FRound(aAnchorTextRange.getHeight() + 1L));
@@ -1058,6 +1090,7 @@ void SdrTextObj::impDecomposeBlockTextPrimitive(
     aConverter.decomposeBlockTextPrimitive(aNewTransformA, aNewTransformB, aClipRange);
 
     // cleanup outliner
+    rOutliner.SetBackgroundColor(aOriginalBackColor);
     rOutliner.Clear();
     rOutliner.setVisualizedPage(0);
 


More information about the Libreoffice-commits mailing list