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

Luboš Luňák l.lunak at collabora.com
Thu Mar 27 13:46:17 PDT 2014


 dev/null                                                 |binary
 sw/qa/extras/ooxmlimport/ooxmlimport.cxx                 |   16 ----------
 writerfilter/source/dmapper/DomainMapperTableHandler.cxx |   24 +++++++--------
 writerfilter/source/dmapper/TablePropertiesHandler.cxx   |    4 +-
 4 files changed, 14 insertions(+), 30 deletions(-)

New commits:
commit cc6f1c8e972687bd43f0fab083a4aae6de6b0e0d
Author: Luboš Luňák <l.lunak at collabora.com>
Date:   Wed Mar 26 17:39:25 2014 +0100

    Revert "rhbz#1075124: writerfilter: fix tables with negative left margin"
    
    It appears that this was just a workaround that incidentally worked.
    Making the negative value even larger (in abs value) doesn't seem to make
    a difference for MSO, but LO fails again. A proper fix (better workaround?)
    will follow.
    
    This reverts commit 2e558f32ef79948858723b9781fbd388850b462b.
    
    Change-Id: I56fd5e9d7ce9aa178f7e508f8e7ac3bc0ff2b971
    Reviewed-on: https://gerrit.libreoffice.org/8763
    Reviewed-by: Tor Lillqvist <tml at collabora.com>
    Reviewed-by: Miklos Vajna <vmiklos at collabora.co.uk>
    Tested-by: Miklos Vajna <vmiklos at collabora.co.uk>

diff --git a/sw/qa/extras/ooxmlimport/data/rhbz1075124.docx b/sw/qa/extras/ooxmlimport/data/rhbz1075124.docx
deleted file mode 100644
index 3b31701..0000000
Binary files a/sw/qa/extras/ooxmlimport/data/rhbz1075124.docx and /dev/null differ
diff --git a/sw/qa/extras/ooxmlimport/ooxmlimport.cxx b/sw/qa/extras/ooxmlimport/ooxmlimport.cxx
index ab7404f..1c8665b 100644
--- a/sw/qa/extras/ooxmlimport/ooxmlimport.cxx
+++ b/sw/qa/extras/ooxmlimport/ooxmlimport.cxx
@@ -40,7 +40,6 @@
 #include <com/sun/star/view/XFormLayerAccess.hpp>
 #include <com/sun/star/table/BorderLine2.hpp>
 #include <com/sun/star/table/TableBorder2.hpp>
-#include <com/sun/star/table/TableBorderDistances.hpp>
 #include <com/sun/star/text/SizeType.hpp>
 #include <com/sun/star/xml/dom/XDocument.hpp>
 
@@ -202,21 +201,6 @@ DECLARE_OOXMLIMPORT_TEST(testRhbz988516, "rhbz988516.docx")
             getProperty<OUString>(getParagraph(3), "NumberingStyleName"));
 }
 
-DECLARE_OOXMLIMPORT_TEST(testRhbz1075124, "rhbz1075124.docx")
-{
-    // negative left margin on table wrapped around to 64k unsigned
-    uno::Reference<text::XTextTablesSupplier> xTablesSupplier(mxComponent,
-            uno::UNO_QUERY);
-    uno::Reference<container::XIndexAccess> xTables(
-            xTablesSupplier->getTextTables(), uno::UNO_QUERY);
-    CPPUNIT_ASSERT_EQUAL(sal_Int32(-243),
-            getProperty<sal_Int32>(xTables->getByIndex(0), "LeftMargin"));
-    table::TableBorderDistances dists(
-            getProperty<table::TableBorderDistances>(xTables->getByIndex(0),
-                "TableBorderDistances"));
-    CPPUNIT_ASSERT_EQUAL(sal_Int16(26), dists.LeftDistance);
-}
-
 DECLARE_OOXMLIMPORT_TEST(testFdo49940, "fdo49940.docx")
 {
     uno::Reference<text::XTextDocument> xTextDocument(mxComponent, uno::UNO_QUERY);
diff --git a/writerfilter/source/dmapper/DomainMapperTableHandler.cxx b/writerfilter/source/dmapper/DomainMapperTableHandler.cxx
index 64289c4..0827cc9 100644
--- a/writerfilter/source/dmapper/DomainMapperTableHandler.cxx
+++ b/writerfilter/source/dmapper/DomainMapperTableHandler.cxx
@@ -406,6 +406,18 @@ TableStyleSheetEntry * DomainMapperTableHandler::endTableGetTableStyle(TableInfo
         m_aTableProperties->getValue( TablePropertyMap::CELL_MAR_BOTTOM,
                                      rInfo.nBottomBorderDistance );
 
+        table::TableBorderDistances aDistances;
+        aDistances.IsTopDistanceValid =
+        aDistances.IsBottomDistanceValid =
+        aDistances.IsLeftDistanceValid =
+        aDistances.IsRightDistanceValid = sal_True;
+        aDistances.TopDistance = static_cast<sal_Int16>( rInfo.nTopBorderDistance );
+        aDistances.BottomDistance = static_cast<sal_Int16>( rInfo.nBottomBorderDistance );
+        aDistances.LeftDistance = static_cast<sal_Int16>( rInfo.nLeftBorderDistance );
+        aDistances.RightDistance = static_cast<sal_Int16>( rInfo.nRightBorderDistance );
+
+        m_aTableProperties->Insert( PROP_TABLE_BORDER_DISTANCES, uno::makeAny( aDistances ) );
+
         if (rFrameProperties.hasElements())
             lcl_DecrementHoriOrientPosition(rFrameProperties, rInfo.nLeftBorderDistance);
 
@@ -465,18 +477,6 @@ TableStyleSheetEntry * DomainMapperTableHandler::endTableGetTableStyle(TableInfo
         lcl_debug_TableBorder(aTableBorder);
 #endif
 
-        table::TableBorderDistances aDistances;
-        aDistances.IsTopDistanceValid =
-        aDistances.IsBottomDistanceValid =
-        aDistances.IsLeftDistanceValid =
-        aDistances.IsRightDistanceValid = sal_True;
-        aDistances.TopDistance = static_cast<sal_Int16>( rInfo.nTopBorderDistance );
-        aDistances.BottomDistance = static_cast<sal_Int16>( rInfo.nBottomBorderDistance );
-        aDistances.LeftDistance = static_cast<sal_Int16>( rInfo.nLeftBorderDistance );
-        aDistances.RightDistance = static_cast<sal_Int16>( rInfo.nRightBorderDistance );
-
-        m_aTableProperties->Insert( PROP_TABLE_BORDER_DISTANCES, uno::makeAny( aDistances ) );
-
         // Table position in Office is computed in 2 different ways :
         // - top level tables: the goal is to have in-cell text starting at table indent pos (tblInd),
         //   so table's position depends on table's cells margin
diff --git a/writerfilter/source/dmapper/TablePropertiesHandler.cxx b/writerfilter/source/dmapper/TablePropertiesHandler.cxx
index 0595a85..b54b262 100644
--- a/writerfilter/source/dmapper/TablePropertiesHandler.cxx
+++ b/writerfilter/source/dmapper/TablePropertiesHandler.cxx
@@ -311,8 +311,8 @@ namespace dmapper {
                    if (m_pCurrentInteropGrabBag)
                        m_pCurrentInteropGrabBag->push_back(pHandler->getInteropGrabBag());
                    TablePropertyMapPtr pTblIndMap(new TablePropertyMap);
-                   sal_Int32 nTblInd = pHandler->getMeasureValue();
-                   pTblIndMap->setValue(TablePropertyMap::LEFT_MARGIN, nTblInd);
+                   sal_uInt32 nTblInd = pHandler->getMeasureValue();
+                   pTblIndMap->setValue( TablePropertyMap::LEFT_MARGIN, nTblInd);
                    insertTableProps(pTblIndMap);
                }
            }


More information about the Libreoffice-commits mailing list