[Libreoffice-commits] core.git: sw/qa writerfilter/source

Justin Luth justin_luth at sil.org
Sat Jul 8 10:36:14 UTC 2017


 sw/qa/extras/ooxmlexport/data/tdf108973_backgroundTextbox.docx |binary
 sw/qa/extras/ooxmlexport/data/tdf108973_foregroundTextbox.docx |binary
 sw/qa/extras/ooxmlexport/ooxmlexport7.cxx                      |   10 ++++++++++
 writerfilter/source/dmapper/DomainMapper_Impl.cxx              |    1 +
 4 files changed, 11 insertions(+)

New commits:
commit bbfdd03460ddf5e33f5fda000df9e6f6ce458288
Author: Justin Luth <justin_luth at sil.org>
Date:   Thu Jul 6 10:20:29 2017 -0400

    tdf#108973 writerfilter: allow textboxes to be in the background
    
    Word appears to use negative z-indexes to indicate behind-text
    zordering and positive numbers for in-front placement. This
    was added for shapes in LO4.3, now applying to textboxes also.
    
    Change-Id: I3b06fb231329f151ca978f3a68b4d4e89bc28515
    Reviewed-on: https://gerrit.libreoffice.org/39671
    Tested-by: Jenkins <ci at libreoffice.org>
    Reviewed-by: Justin Luth <justin_luth at sil.org>

diff --git a/sw/qa/extras/ooxmlexport/data/tdf108973_backgroundTextbox.docx b/sw/qa/extras/ooxmlexport/data/tdf108973_backgroundTextbox.docx
new file mode 100644
index 000000000000..177cb5b7797d
Binary files /dev/null and b/sw/qa/extras/ooxmlexport/data/tdf108973_backgroundTextbox.docx differ
diff --git a/sw/qa/extras/ooxmlexport/data/tdf108973_foregroundTextbox.docx b/sw/qa/extras/ooxmlexport/data/tdf108973_foregroundTextbox.docx
new file mode 100644
index 000000000000..fb81047c392a
Binary files /dev/null and b/sw/qa/extras/ooxmlexport/data/tdf108973_foregroundTextbox.docx differ
diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport7.cxx b/sw/qa/extras/ooxmlexport/ooxmlexport7.cxx
index 0957e02eb313..b1ba0db8cfc0 100644
--- a/sw/qa/extras/ooxmlexport/ooxmlexport7.cxx
+++ b/sw/qa/extras/ooxmlexport/ooxmlexport7.cxx
@@ -641,6 +641,16 @@ DECLARE_OOXMLEXPORT_TEST(testTdf77219_foregroundShape, "tdf77219_foregroundShape
     CPPUNIT_ASSERT_EQUAL_MESSAGE("Shape is in front of the paragraph", true, bool(getProperty<bool>(getShape(1), "Opaque")));
 }
 
+DECLARE_OOXMLEXPORT_TEST(testTdf108973_backgroundTextbox, "tdf108973_backgroundTextbox.docx")
+{
+    CPPUNIT_ASSERT_EQUAL_MESSAGE("Textbox is in front of the paragraph", false, bool(getProperty<bool>(getShape(1), "Opaque")));
+}
+
+DECLARE_OOXMLEXPORT_TEST(testTdf108973_foregroundTextbox, "tdf108973_foregroundTextbox.docx")
+{
+    CPPUNIT_ASSERT_EQUAL_MESSAGE("Textbox is in front of the paragraph", true, bool(getProperty<bool>(getShape(1), "Opaque")));
+}
+
 DECLARE_OOXMLEXPORT_TEST(testPresetShape, "preset-shape.docx")
 {
     // Document contains a flowChartMultidocument preset shape, our date for that shape wasn't correct.
diff --git a/writerfilter/source/dmapper/DomainMapper_Impl.cxx b/writerfilter/source/dmapper/DomainMapper_Impl.cxx
index e7cd1f8c51f7..584368f5199f 100644
--- a/writerfilter/source/dmapper/DomainMapper_Impl.cxx
+++ b/writerfilter/source/dmapper/DomainMapper_Impl.cxx
@@ -2039,6 +2039,7 @@ void DomainMapper_Impl::PushShapeContext( const uno::Reference< drawing::XShape
                         aGrabBag[i].Value >>= zOrder;
                         xShapePropertySet->setPropertyValue( "ZOrder", uno::makeAny(pZOrderHelper->findZOrder(zOrder)));
                         pZOrderHelper->addItem(xShapePropertySet, zOrder);
+                        xShapePropertySet->setPropertyValue(getPropertyName( PROP_OPAQUE ), uno::makeAny( zOrder >= 0 ) );
                         checkZOrderStatus = true;
                     }
                     if(checkBtLrStatus && checkZOrderStatus)


More information about the Libreoffice-commits mailing list