[Libreoffice-commits] core.git: Branch 'libreoffice-5-3' - sw/qa sw/source

Justin Luth justin_luth at sil.org
Wed Nov 8 08:20:38 UTC 2017


 sw/qa/extras/uiwriter/data/tdf103978_backgroundTextShape.docx |binary
 sw/qa/extras/uiwriter/uiwriter.cxx                            |   21 ++++++++++
 sw/source/core/doc/textboxhelper.cxx                          |    3 +
 3 files changed, 24 insertions(+)

New commits:
commit d71ac6936bd47e4e19d25c2c10c51d41ae759991
Author: Justin Luth <justin_luth at sil.org>
Date:   Thu Jul 6 14:54:27 2017 -0400

    tdf#103978 textboxhelper: syncProperty OPAQUE (wrap in background)
    
    Although the containing shape is in the background (and thus the
    normal paragraph text is still visible), the shape's text
    was still painting over top of the normal paragraph text because
    the textbox was set as opaque and not transparent.
    
    Setting the textbox to sync the opacity value of its containing shape.
    
    Change-Id: I02477e2fa7def1f13590afcaa7c6564dd79d6406
    Reviewed-on: https://gerrit.libreoffice.org/39672
    Tested-by: Jenkins <ci at libreoffice.org>
    Reviewed-by: Justin Luth <justin_luth at sil.org>
    (cherry picked from commit cc438f60d6ad0855f754dd32da9c9a80c7cabf92)
    Reviewed-on: https://gerrit.libreoffice.org/44431
    Reviewed-by: Andras Timar <andras.timar at collabora.com>

diff --git a/sw/qa/extras/uiwriter/data/tdf103978_backgroundTextShape.docx b/sw/qa/extras/uiwriter/data/tdf103978_backgroundTextShape.docx
new file mode 100644
index 000000000000..b99b65e47630
Binary files /dev/null and b/sw/qa/extras/uiwriter/data/tdf103978_backgroundTextShape.docx differ
diff --git a/sw/qa/extras/uiwriter/uiwriter.cxx b/sw/qa/extras/uiwriter/uiwriter.cxx
index 7803895f2fba..c568cb420f40 100644
--- a/sw/qa/extras/uiwriter/uiwriter.cxx
+++ b/sw/qa/extras/uiwriter/uiwriter.cxx
@@ -198,6 +198,7 @@ public:
     void testTdf87922();
     void testTdf77014();
     void testTdf92648();
+    void testTdf103978_backgroundTextShape();
     void testTdf96515();
     void testTdf96943();
     void testTdf96536();
@@ -314,6 +315,7 @@ public:
     CPPUNIT_TEST(testTdf87922);
     CPPUNIT_TEST(testTdf77014);
     CPPUNIT_TEST(testTdf92648);
+    CPPUNIT_TEST(testTdf103978_backgroundTextShape);
     CPPUNIT_TEST(testTdf96515);
     CPPUNIT_TEST(testTdf96943);
     CPPUNIT_TEST(testTdf96536);
@@ -3636,6 +3638,25 @@ void SwUiWriterTest::testTdf92648()
     CPPUNIT_ASSERT_EQUAL(sal_Int32(5), nCount);
 }
 
+void SwUiWriterTest::testTdf103978_backgroundTextShape()
+{
+    SwDoc* pDoc = createDoc("tdf103978_backgroundTextShape.docx");
+
+    // there is only one shape. It has an attached textbox
+    bool bShapeIsOpaque = getProperty<bool>(getShape(1), "Opaque");
+    CPPUNIT_ASSERT_EQUAL_MESSAGE("Shape is in the foreground", false, bShapeIsOpaque );
+    sal_Int32 nCount = 0;
+    for (const SwFrameFormat* pFormat : *pDoc->GetSpzFrameFormats())
+    {
+        if (!SwTextBoxHelper::isTextBox(pFormat, RES_FLYFRMFMT))
+            continue;
+        CPPUNIT_ASSERT_EQUAL_MESSAGE("Textbox syncs the shape's transparency", bShapeIsOpaque, pFormat->GetOpaque().GetValue() );
+        ++nCount;
+    }
+    //ensure that we don't skip the for loop without an error
+    CPPUNIT_ASSERT_EQUAL_MESSAGE("Number of TextBoxes", sal_Int32(1), nCount);
+}
+
 void SwUiWriterTest::testTdf96515()
 {
     // Enable hide whitespace mode.
diff --git a/sw/source/core/doc/textboxhelper.cxx b/sw/source/core/doc/textboxhelper.cxx
index bfa3d3a1836d..bead3f97bd8a 100644
--- a/sw/source/core/doc/textboxhelper.cxx
+++ b/sw/source/core/doc/textboxhelper.cxx
@@ -517,6 +517,9 @@ void SwTextBoxHelper::syncProperty(SwFrameFormat* pShape, sal_uInt16 nWID, sal_u
                 break;
             }
             break;
+        case RES_OPAQUE:
+            aPropertyName = UNO_NAME_OPAQUE;
+            break;
         }
 
         if (!aPropertyName.isEmpty())


More information about the Libreoffice-commits mailing list