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

Libreoffice Gerrit user logerrit at kemper.freedesktop.org
Fri Sep 21 06:14:41 PDT 2012


 sw/qa/extras/ooxmlimport/data/fdo55187.docx  |binary
 sw/qa/extras/ooxmlimport/ooxmlimport.cxx     |    9 +++++++++
 writerfilter/source/dmapper/DomainMapper.cxx |    3 +--
 3 files changed, 10 insertions(+), 2 deletions(-)

New commits:
commit b3603e0e0e5dbfbeaa2426c499e8f64be2d15765
Author: Miklos Vajna <vmiklos at suse.cz>
Date:   Fri Sep 21 14:57:26 2012 +0200

    fdo#55187 fix DOCX import of unicode 0xNN0d when it's a separate run
    
    E.g. 0x010d was parsed as a newline character... This also makes the RTF
    workaround from fdo#39856 unnecessary.
    
    Change-Id: I5e4a95b4436e1492b64961820702caace0a33e4b

diff --git a/sw/qa/extras/ooxmlimport/data/fdo55187.docx b/sw/qa/extras/ooxmlimport/data/fdo55187.docx
new file mode 100644
index 0000000..59cd0a8
Binary files /dev/null and b/sw/qa/extras/ooxmlimport/data/fdo55187.docx differ
diff --git a/sw/qa/extras/ooxmlimport/ooxmlimport.cxx b/sw/qa/extras/ooxmlimport/ooxmlimport.cxx
index 6216502..6b1c425 100644
--- a/sw/qa/extras/ooxmlimport/ooxmlimport.cxx
+++ b/sw/qa/extras/ooxmlimport/ooxmlimport.cxx
@@ -91,6 +91,7 @@ public:
     void testInk();
     void testN779834();
     void testN779627();
+    void testFdo55187();
 
     CPPUNIT_TEST_SUITE(Test);
 #if !defined(MACOSX) && !defined(WNT)
@@ -128,6 +129,7 @@ public:
     CPPUNIT_TEST(testInk);
     CPPUNIT_TEST(testN779834);
     CPPUNIT_TEST(testN779627);
+    CPPUNIT_TEST(testFdo55187);
 #endif
     CPPUNIT_TEST_SUITE_END();
 
@@ -885,6 +887,13 @@ void Test::testN779627()
     CPPUNIT_ASSERT_EQUAL(sal_Int32(0), nLeftMargin);
 }
 
+void Test::testFdo55187()
+{
+    // 0x010d was imported as a newline.
+    load("fdo55187.docx");
+    getParagraph(1, OUString("lupčka", 7, RTL_TEXTENCODING_UTF8));
+}
+
 CPPUNIT_TEST_SUITE_REGISTRATION(Test);
 
 CPPUNIT_PLUGIN_IMPLEMENT();
diff --git a/writerfilter/source/dmapper/DomainMapper.cxx b/writerfilter/source/dmapper/DomainMapper.cxx
index 0736d69..38a9961 100644
--- a/writerfilter/source/dmapper/DomainMapper.cxx
+++ b/writerfilter/source/dmapper/DomainMapper.cxx
@@ -3523,8 +3523,7 @@ void DomainMapper::lcl_utext(const sal_uInt8 * data_, size_t len)
     {
         m_pImpl->getTableManager().utext(data_, len);
 
-        // RTF always uses text() instead of utext() for run break
-        if(len == 1 && ((*data_) == 0x0d || (*data_) == 0x07) && !IsRTFImport())
+        if(len == 1 && (sText[0] == 0x0d || sText[0] == 0x07))
         {
             bool bSingleParagraph = m_pImpl->GetIsFirstParagraphInSection() && m_pImpl->GetIsLastParagraphInSection();
             // If the paragraph contains only the section properties and it has


More information about the Libreoffice-commits mailing list