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

Aron Budea aron.budea at collabora.com
Wed May 31 11:47:03 UTC 2017


 sw/qa/extras/ww8export/data/tdf108072.doc |binary
 sw/qa/extras/ww8export/ww8export2.cxx     |   14 ++++++++++++++
 sw/source/filter/ww8/wrtww8.cxx           |    4 ++--
 sw/source/filter/ww8/ww8par2.cxx          |    2 +-
 sw/source/filter/ww8/ww8par6.cxx          |    8 ++++----
 sw/source/filter/ww8/ww8scan.cxx          |    4 ++--
 6 files changed, 23 insertions(+), 9 deletions(-)

New commits:
commit e0e12738449063abd9aad34ef78d26183ff11d6a
Author: Aron Budea <aron.budea at collabora.com>
Date:   Sun May 28 23:16:24 2017 +0200

    tdf#108072: match sprmTFCantSplit with its correct id
    
    The behavior was adjusted with
    72ef0d88e916b320de85fe2ebf08cb7aea28ca08 , but the ids
    for sprmTFCantSplit90 and sprmTFCantSplit remained mixed up.
    
    Change-Id: Ic97224a3af39e5df707a6dba59b785580c17b739
    Reviewed-on: https://gerrit.libreoffice.org/38117
    Tested-by: Jenkins <ci at libreoffice.org>
    Reviewed-by: Miklos Vajna <vmiklos at collabora.co.uk>

diff --git a/sw/qa/extras/ww8export/data/tdf108072.doc b/sw/qa/extras/ww8export/data/tdf108072.doc
new file mode 100644
index 000000000000..03e8b2a532dc
Binary files /dev/null and b/sw/qa/extras/ww8export/data/tdf108072.doc differ
diff --git a/sw/qa/extras/ww8export/ww8export2.cxx b/sw/qa/extras/ww8export/ww8export2.cxx
index 98116014f8d4..0412f1f69207 100644
--- a/sw/qa/extras/ww8export/ww8export2.cxx
+++ b/sw/qa/extras/ww8export/ww8export2.cxx
@@ -11,7 +11,9 @@
 
 #include <com/sun/star/graphic/XGraphic.hpp>
 #include <com/sun/star/beans/XPropertySet.hpp>
+#include <com/sun/star/container/XIndexAccess.hpp>
 #include <com/sun/star/text/XTextFramesSupplier.hpp>
+#include <com/sun/star/text/XTextTable.hpp>
 #include <com/sun/star/text/XTextTablesSupplier.hpp>
 #include <pagedesc.hxx>
 
@@ -119,6 +121,18 @@ DECLARE_WW8EXPORT_TEST(testTdf104334, "tdf104334.doc")
     CPPUNIT_ASSERT_EQUAL(OUString("1"), getRun(getParagraph(2), 3)->getString());
 }
 
+DECLARE_WW8EXPORT_TEST(testTdf108072, "tdf108072.doc")
+{
+    // The property IsSplitAllowed was imported from an obsolete property, sprmTFCantSplit90
+    // instead of sprmTFCantSplit. sprmTFCantSplit90 is set to true for merged rows, so
+    // for merged rows incorrect settings were imported, which prevented them from breaking over pages.
+    uno::Reference<text::XTextTablesSupplier> xTextTablesSupplier(mxComponent, uno::UNO_QUERY);
+    uno::Reference<container::XIndexAccess> xTables(xTextTablesSupplier->getTextTables(), uno::UNO_QUERY);
+    uno::Reference<text::XTextTable> xTable(xTables->getByIndex(0), uno::UNO_QUERY);
+    uno::Reference<container::XIndexAccess> xTableRows(xTable->getRows(), uno::UNO_QUERY);
+    CPPUNIT_ASSERT_EQUAL(true, getProperty<bool>(xTableRows->getByIndex(0), "IsSplitAllowed"));
+}
+
 CPPUNIT_PLUGIN_IMPLEMENT();
 
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/filter/ww8/wrtww8.cxx b/sw/source/filter/ww8/wrtww8.cxx
index 35433cd7d119..dcd2a65c9579 100644
--- a/sw/source/filter/ww8/wrtww8.cxx
+++ b/sw/source/filter/ww8/wrtww8.cxx
@@ -2145,9 +2145,9 @@ void WW8AttributeOutput::TableCanSplit( ww8::WW8TableNodeInfoInner::Pointer_t pT
 
     const SwFormatRowSplit& rSplittable = pLineFormat->GetRowSplit();
     sal_uInt8 nCantSplit = (!rSplittable.GetValue()) ? 1 : 0;
-    m_rWW8Export.InsUInt16( NS_sprm::sprmTFCantSplit90 );
+    m_rWW8Export.InsUInt16( NS_sprm::sprmTFCantSplit );
     m_rWW8Export.pO->push_back( nCantSplit );
-    m_rWW8Export.InsUInt16( NS_sprm::sprmTFCantSplit ); // also write fCantSplit90
+    m_rWW8Export.InsUInt16( NS_sprm::sprmTFCantSplit90 ); // also write fCantSplit90
     m_rWW8Export.pO->push_back( nCantSplit );
 }
 
diff --git a/sw/source/filter/ww8/ww8par2.cxx b/sw/source/filter/ww8/ww8par2.cxx
index ecd8f93978fc..99feec026987 100644
--- a/sw/source/filter/ww8/ww8par2.cxx
+++ b/sw/source/filter/ww8/ww8par2.cxx
@@ -1730,7 +1730,7 @@ wwTableSprm GetTableSprm(sal_uInt16 nId, ww::WordVersion eVer)
                     return sprmTTextFlow;
                 case NS_sprm::sprmTTableHeader:
                     return sprmTTableHeader;
-                case NS_sprm::sprmTFCantSplit90:
+                case NS_sprm::sprmTFCantSplit:
                     return sprmTFCantSplit;
                 case NS_sprm::sprmTJc90:
                     return sprmTJc;
diff --git a/sw/source/filter/ww8/ww8par6.cxx b/sw/source/filter/ww8/ww8par6.cxx
index e0af6f6d076b..f23c8da661e4 100644
--- a/sw/source/filter/ww8/ww8par6.cxx
+++ b/sw/source/filter/ww8/ww8par6.cxx
@@ -6179,12 +6179,12 @@ const wwSprmDispatcher *GetWW8SprmDispatcher()
         {0x9602, nullptr},                                 //"sprmTDxaGapHalf"
                                                      //tap.dxaGapHalf,
                                                      //tap.rgdxaCenter; dxa; word;
-        {0x3403, nullptr},                                 //"sprmTFCantSplit"
-                                                     //tap.fCantSplit;1 or 0;byte;
+        {0x3403, nullptr},                                 //"sprmTFCantSplit90"
+                                                     //tap.fCantSplit90;1 or 0;byte;
         {0x3404, nullptr},                                 //"sprmTTableHeader"
                                                      //tap.fTableHeader;1 or 0;byte;
-        {0x3466, nullptr},                                 //"sprmTFCantSplit90"
-                                                     //tap.fCantSplit90;1 or 0;byte;
+        {0x3466, nullptr},                                 //"sprmTFCantSplit"
+                                                     //tap.fCantSplit;1 or 0;byte;
         {0xD605, nullptr},                                 //"sprmTTableBorders80"
                                                      //tap.rgbrcTable;complex;
                                                      //24 bytes;
diff --git a/sw/source/filter/ww8/ww8scan.cxx b/sw/source/filter/ww8/ww8scan.cxx
index 640cff74020f..2f28c36a2f22 100644
--- a/sw/source/filter/ww8/ww8scan.cxx
+++ b/sw/source/filter/ww8/ww8scan.cxx
@@ -694,9 +694,9 @@ const wwSprmSearcher *wwSprmParser::GetWW8SprmSearcher()
         {0x9601, { 2, L_FIX} }, // "sprmTDxaLeft" tap.rgdxaCenter
         {0x9602, { 2, L_FIX} }, // "sprmTDxaGapHalf" tap.dxaGapHalf,
                             // tap.rgdxaCenter
-        {0x3403, { 1, L_FIX} }, // "sprmTFCantSplit" tap.fCantSplit;1 or 0;byte;
+        {0x3403, { 1, L_FIX} }, // "sprmTFCantSplit90" tap.fCantSplit90;1 or 0;byte;
         {0x3404, { 1, L_FIX} }, // "sprmTTableHeader" tap.fTableHeader;1 or 0;byte;
-        {0x3466, { 1, L_FIX} }, // "sprmTFCantSplit90" tap.fCantSplit90;1 or 0;byte;
+        {0x3466, { 1, L_FIX} }, // "sprmTFCantSplit" tap.fCantSplit;1 or 0;byte;
         {0xD605, { 0, L_VAR} }, // "sprmTTableBorders80" tap.rgbrcTable;complex
         {NS_sprm::LN_TDefTable10, { 0, L_VAR} }, // "sprmTDefTable10" tap.rgdxaCenter,
                             // tap.rgtc;complex


More information about the Libreoffice-commits mailing list