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

Libreoffice Gerrit user logerrit at kemper.freedesktop.org
Mon Sep 24 01:41:42 PDT 2012


 sw/qa/extras/rtfimport/data/fdo49655.rtf       |    5 +++++
 sw/qa/extras/rtfimport/rtfimport.cxx           |   15 +++++++++++++++
 writerfilter/source/dmapper/PropertyMap.cxx    |    2 ++
 writerfilter/source/rtftok/rtfdocumentimpl.cxx |    8 ++++++++
 4 files changed, 30 insertions(+)

New commits:
commit af6b7d8ba30d395e5f4a17876526434cf0a06005
Author: Miklos Vajna <vmiklos at suse.cz>
Date:   Mon Sep 24 09:41:02 2012 +0100

    fdo#49655 fix RTF import of text in the middle of table definition
    
    Usually table text comes after the \intbl control word, but it turns out
    text is allowed earlier. Make sure such text is buffered, otherwise
    we'll send paragraph / run properties to the dmapper in the middle of
    table properties, which is obviously not allowed.
    
    Change-Id: I34f1df7e171316a7d926179689627301860d492f

diff --git a/sw/qa/extras/rtfimport/data/fdo49655.rtf b/sw/qa/extras/rtfimport/data/fdo49655.rtf
new file mode 100644
index 0000000..60f90fc
--- /dev/null
+++ b/sw/qa/extras/rtfimport/data/fdo49655.rtf
@@ -0,0 +1,5 @@
+{\rtf1
+{\colortbl \red0\green0\blue0;\red128\green128\blue128;\red255\green255\blue255;}
+\trowd \clvertalt \clbrdrt\brdrw15\brdrs \clbrdrl\brdrw15\brdrs  \clbrdrb\brdrw15\brdrs \clbrdrr\brdrw15\brdrs \clcbpat1\cellx9600 \intbl\qc\cf2\b Travaux Exceptionnels de Jardinage N° 12.03.0005.TEJ \b0\cell \row
+}
+\pard\par
diff --git a/sw/qa/extras/rtfimport/rtfimport.cxx b/sw/qa/extras/rtfimport/rtfimport.cxx
index 9d56761..873213b 100644
--- a/sw/qa/extras/rtfimport/rtfimport.cxx
+++ b/sw/qa/extras/rtfimport/rtfimport.cxx
@@ -111,6 +111,7 @@ public:
     void testFdo52052();
     void testInk();
     void testFdo52389();
+    void testFdo49655();
 
     CPPUNIT_TEST_SUITE(Test);
 #if !defined(MACOSX) && !defined(WNT)
@@ -161,6 +162,7 @@ public:
     CPPUNIT_TEST(testFdo52052);
     CPPUNIT_TEST(testInk);
     CPPUNIT_TEST(testFdo52389);
+    CPPUNIT_TEST(testFdo49655);
 #endif
     CPPUNIT_TEST_SUITE_END();
 
@@ -970,6 +972,19 @@ void Test::testFdo52389()
     CPPUNIT_ASSERT_EQUAL(6, getLength());
 }
 
+void Test::testFdo49655()
+{
+    /*
+     * The problem was that the table was not imported due to the '  ' string in the middle of the table definition.
+     *
+     * xray ThisComponent.TextTables.Count 'was 0
+     */
+    load("fdo49655.rtf");
+    uno::Reference<text::XTextTablesSupplier> xTextTablesSupplier(mxComponent, uno::UNO_QUERY);
+    uno::Reference<container::XIndexAccess> xIndexAccess(xTextTablesSupplier->getTextTables(), uno::UNO_QUERY);
+    CPPUNIT_ASSERT_EQUAL(sal_Int32(1), xIndexAccess->getCount());
+}
+
 CPPUNIT_TEST_SUITE_REGISTRATION(Test);
 
 CPPUNIT_PLUGIN_IMPLEMENT();
diff --git a/writerfilter/source/rtftok/rtfdocumentimpl.cxx b/writerfilter/source/rtftok/rtfdocumentimpl.cxx
index f8200ff..5e33654 100644
--- a/writerfilter/source/rtftok/rtfdocumentimpl.cxx
+++ b/writerfilter/source/rtftok/rtfdocumentimpl.cxx
@@ -1006,6 +1006,14 @@ void RTFDocumentImpl::text(OUString& rString)
         return;
     }
 
+    // Are we in the middle of the table definition? (No cell defs yet, but we already have some cell props.)
+    if (m_aStates.top().aTableCellSprms.find(NS_ooxml::LN_CT_TcPrBase_vAlign).get() &&
+        m_aStates.top().nCells == 0)
+    {
+        m_aTableBuffer.push_back(make_pair(BUFFER_UTEXT, RTFValue::Pointer_t(new RTFValue(rString))));
+        return;
+    }
+
     checkFirstRun();
     checkNeedPap();
 
commit da9acd209918ac26b44bddcf7b38b8887d23bfef
Author: Miklos Vajna <vmiklos at suse.cz>
Date:   Mon Sep 24 09:40:30 2012 +0100

    fdo#49655 dmapper: fix default page style layout
    
    The default in Writer is mirrored, but in Word it's left and right.
    
    Change-Id: I8c615a3a18ad7493deb2a3a9369c13f3e4d5799d

diff --git a/writerfilter/source/dmapper/PropertyMap.cxx b/writerfilter/source/dmapper/PropertyMap.cxx
index d271299..8a0ece4 100644
--- a/writerfilter/source/dmapper/PropertyMap.cxx
+++ b/writerfilter/source/dmapper/PropertyMap.cxx
@@ -303,6 +303,8 @@ SectionPropertyMap::SectionPropertyMap(bool bIsFirstSection) :
     Insert( PROP_TOP_MARGIN, false, uno::makeAny( (sal_Int32)2540 ) );
     //page bottom margin, default 0x5a0 (1440) twip -> 2540 1/100 mm
     Insert( PROP_BOTTOM_MARGIN, false, uno::makeAny( (sal_Int32) 2540 ) );
+    //page style layout
+    Insert(PROP_PAGE_STYLE_LAYOUT, false, uno::makeAny(style::PageStyleLayout::PageStyleLayout_ALL));
     uno::Any aFalse( ::uno::makeAny( false ) );
     Insert( PROP_GRID_DISPLAY, false, aFalse);
     Insert( PROP_GRID_PRINT, false, aFalse);


More information about the Libreoffice-commits mailing list