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

Miklos Vajna vmiklos at collabora.co.uk
Thu Jun 11 04:13:36 PDT 2015


 sw/qa/extras/rtfimport/data/tdf90315.rtf             |    4 ++++
 sw/qa/extras/rtfimport/rtfimport.cxx                 |    9 +++++++++
 writerfilter/source/dmapper/SectionColumnHandler.cxx |    2 +-
 3 files changed, 14 insertions(+), 1 deletion(-)

New commits:
commit 065a4d93287c0c3f16c516004c078fca948e3fc4
Author: Miklos Vajna <vmiklos at collabora.co.uk>
Date:   Sat May 23 19:23:05 2015 +0100

    tdf#90315 RTF import: fix \colsx default value
    
    See SectPageInformation::mnColsx on the libreoffice-3-6 branch + the
    spec agrees, too.
    
    Change-Id: I6f70a125f8d962621f319e3e75e2865e5f126859
    (cherry picked from commit e18adb7369d140f33b947668a69da2fa78738e7b)
    Reviewed-on: https://gerrit.libreoffice.org/16225
    Reviewed-by: Michael Stahl <mstahl at redhat.com>
    Tested-by: Michael Stahl <mstahl at redhat.com>

diff --git a/sw/qa/extras/rtfimport/data/tdf90315.rtf b/sw/qa/extras/rtfimport/data/tdf90315.rtf
new file mode 100644
index 0000000..df99754
--- /dev/null
+++ b/sw/qa/extras/rtfimport/data/tdf90315.rtf
@@ -0,0 +1,4 @@
+{\rtf1\cols2
+foo\par
+bar\par
+}
diff --git a/sw/qa/extras/rtfimport/rtfimport.cxx b/sw/qa/extras/rtfimport/rtfimport.cxx
index 66f04e7..f7fa4de 100644
--- a/sw/qa/extras/rtfimport/rtfimport.cxx
+++ b/sw/qa/extras/rtfimport/rtfimport.cxx
@@ -2300,6 +2300,15 @@ DECLARE_RTFIMPORT_TEST(testTdf86814, "tdf86814.rtf")
     CPPUNIT_ASSERT_EQUAL(awt::FontWeight::BOLD, getProperty<float>(getRun(getParagraph(1), 1), "CharWeight"));
 }
 
+DECLARE_RTFIMPORT_TEST(testTdf90315, "tdf90315.rtf")
+{
+    uno::Reference<text::XTextSectionsSupplier> xTextSectionsSupplier(mxComponent, uno::UNO_QUERY);
+    uno::Reference<container::XIndexAccess> xTextSections(xTextSectionsSupplier->getTextSections(), uno::UNO_QUERY);
+    uno::Reference<beans::XPropertySet> xTextSection(xTextSections->getByIndex(0), uno::UNO_QUERY);
+    // This was 0, but default should be 720 twips.
+    CPPUNIT_ASSERT_EQUAL(static_cast<sal_Int32>(1270), getProperty<sal_Int32>(xTextSection->getPropertyValue("TextColumns"), "AutomaticDistance"));
+}
+
 CPPUNIT_PLUGIN_IMPLEMENT();
 
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/writerfilter/source/dmapper/SectionColumnHandler.cxx b/writerfilter/source/dmapper/SectionColumnHandler.cxx
index dbc5ac9..c5d971d 100644
--- a/writerfilter/source/dmapper/SectionColumnHandler.cxx
+++ b/writerfilter/source/dmapper/SectionColumnHandler.cxx
@@ -33,7 +33,7 @@ using namespace ::com::sun::star;
 SectionColumnHandler::SectionColumnHandler()
     : LoggedProperties(dmapper_logger, "SectionColumnHandler")
     , bEqualWidth(false)
-    , nSpace(0)
+    , nSpace(1270) // 720 twips
     , nNum(0)
     , bSep(false)
 {


More information about the Libreoffice-commits mailing list