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

Miklos Vajna vmiklos at collabora.co.uk
Thu Nov 6 06:57:06 PST 2014


 sw/qa/extras/ooxmlimport/data/table-auto-column-fixed-size2.docx |binary
 sw/qa/extras/ooxmlimport/ooxmlimport.cxx                         |    9 ++++++++
 sw/source/core/docnode/nodedump.cxx                              |    3 +-
 writerfilter/source/dmapper/DomainMapperTableManager.cxx         |   11 ----------
 4 files changed, 12 insertions(+), 11 deletions(-)

New commits:
commit cbd0fbc287051f918e4adb32b3e9b58dfbf8059d
Author: Miklos Vajna <vmiklos at collabora.co.uk>
Date:   Thu Nov 6 15:15:29 2014 +0100

    DOCX import: fix <w:tblW w:type="auto"/> handling when cells have fixed widths
    
    Commit 74c5ed19f430327988194cdcd6bdff09591a93fa (DOCX import fix for
    table with auto size, 2013-06-26) correctly recognized that in case the
    width type is auto, that doesn't always mean text::SizeType::VARIABLE.
    
    However, when the size is fixed, then we should simply not do anything,
    and that'll lead to the right behavior (by setting the column separators
    on each row), don't try to be smart and try to set
    TablePropertyMap::TABLE_WIDTH here.
    
    Change-Id: I997b88e5fa34bbabe7c6940879c81a1d62d69043

diff --git a/sw/qa/extras/ooxmlimport/data/table-auto-column-fixed-size2.docx b/sw/qa/extras/ooxmlimport/data/table-auto-column-fixed-size2.docx
new file mode 100644
index 0000000..2125f09
Binary files /dev/null and b/sw/qa/extras/ooxmlimport/data/table-auto-column-fixed-size2.docx differ
diff --git a/sw/qa/extras/ooxmlimport/ooxmlimport.cxx b/sw/qa/extras/ooxmlimport/ooxmlimport.cxx
index 3992564..d4d1766 100644
--- a/sw/qa/extras/ooxmlimport/ooxmlimport.cxx
+++ b/sw/qa/extras/ooxmlimport/ooxmlimport.cxx
@@ -1393,6 +1393,15 @@ DECLARE_OOXMLIMPORT_TEST(testTableAutoColumnFixedSize, "table-auto-column-fixed-
     CPPUNIT_ASSERT_EQUAL(sal_Int32(convertTwipToMm100(3996)), getProperty<sal_Int32>(xTextTable, "Width"));
 }
 
+DECLARE_OOXMLIMPORT_TEST(testTableAutoColumnFixedSize2, "table-auto-column-fixed-size2.docx")
+{
+    uno::Reference<text::XTextTablesSupplier> xTablesSupplier(mxComponent, uno::UNO_QUERY);
+    uno::Reference<container::XIndexAccess> xTables(xTablesSupplier->getTextTables(), uno::UNO_QUERY);
+    uno::Reference<text::XTextTable> xTextTable(xTables->getByIndex(0), uno::UNO_QUERY);
+    // This was 17907, i.e. the sum of the width of the 3 cells (10152 twips each), which is too wide.
+    CPPUNIT_ASSERT_EQUAL(sal_Int32(16891), getProperty<sal_Int32>(xTextTable, "Width"));
+}
+
 DECLARE_OOXMLIMPORT_TEST(testFdo46361, "fdo46361.docx")
 {
     uno::Reference<container::XIndexAccess> xGroupShape(getShape(1), uno::UNO_QUERY);
diff --git a/writerfilter/source/dmapper/DomainMapperTableManager.cxx b/writerfilter/source/dmapper/DomainMapperTableManager.cxx
index cad79e9..0caba65 100644
--- a/writerfilter/source/dmapper/DomainMapperTableManager.cxx
+++ b/writerfilter/source/dmapper/DomainMapperTableManager.cxx
@@ -202,16 +202,7 @@ bool DomainMapperTableManager::sprm(Sprm & rSprm)
                             }
 
                             // Check whether the total width of given row is compared with the maximum value of rows (m_nMaxFixedWidth).
-                            if (bFixed )
-                            {
-                                // Check if total width
-                                if (m_nMaxFixedWidth < nRowFixedWidth)
-                                    m_nMaxFixedWidth = nRowFixedWidth;
-
-                                pPropMap->setValue( TablePropertyMap::TABLE_WIDTH_TYPE, text::SizeType::FIX );
-                                pPropMap->setValue( TablePropertyMap::TABLE_WIDTH, m_nMaxFixedWidth );
-                            }
-                            else
+                            if (!bFixed)
                             {
                                 // Set the width type of table with 'Auto' and set the width value to 100(%)
                                 pPropMap->setValue( TablePropertyMap::TABLE_WIDTH_TYPE, text::SizeType::VARIABLE );
commit f355bad3a055c6369d1cae4afd0c02d181584b09
Author: Miklos Vajna <vmiklos at collabora.co.uk>
Date:   Thu Nov 6 15:14:28 2014 +0100

    sw doc model dump: extend SwFmtFrmSize handling
    
    Change-Id: I8b246e198f3b19e65feffb196afdecb1755a0581

diff --git a/sw/source/core/docnode/nodedump.cxx b/sw/source/core/docnode/nodedump.cxx
index 90e356b..5ccf26b 100644
--- a/sw/source/core/docnode/nodedump.cxx
+++ b/sw/source/core/docnode/nodedump.cxx
@@ -478,7 +478,8 @@ void lcl_dumpSfxItemSet(WriterHelper& writer, const SfxItemSet* pSet)
             {
                 pWhich = "frame size";
                 const SwFmtFrmSize* pSize = static_cast<const SwFmtFrmSize*>(pItem);
-                oValue = "height size type: " + OString::number(pSize->GetHeightSizeType()) + ", width size type: " + OString::number(pSize->GetWidthSizeType());
+                oValue = "height size type: " + OString::number(pSize->GetHeightSizeType()) + ", height: " + OString::number(pSize->GetHeight())
+                    + ", width size type: " + OString::number(pSize->GetWidthSizeType()) + ", width: " + OString::number(pSize->GetWidth());
                 break;
             }
             case RES_VERT_ORIENT:


More information about the Libreoffice-commits mailing list