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

Tushar Bende tushar.bende at synerzip.com
Mon Mar 10 13:45:19 PDT 2014


 sw/qa/extras/ooxmlexport/data/1_page.docx |binary
 sw/qa/extras/ooxmlexport/ooxmlexport.cxx  |   12 ++++++++++++
 sw/source/filter/ww8/wrtww8.cxx           |    2 +-
 3 files changed, 13 insertions(+), 1 deletion(-)

New commits:
commit 1b2cf579105d8a1e44b5e2a8aafb79c274fc8455
Author: Tushar Bende <tushar.bende at synerzip.com>
Date:   Tue Nov 26 16:38:31 2013 +0530

    fdo#71784: Invalid Sections getting added to the document after RT
    
    Description: There was a problem for some documents, during export Invalid sectPr were getting added.
    The root cause was faulty calculation of PageDesc value.
    This was the reason for increasing number of pages in RT doc.
    
    Conflicts:
    	sw/qa/extras/ooxmlexport/ooxmlexport.cxx
    
    Reviewed-on: https://gerrit.libreoffice.org/6813
    Reviewed-by: Caolán McNamara <caolanm at redhat.com>
    Tested-by: Caolán McNamara <caolanm at redhat.com>
    
    This fixes crash on export to DOCX too for the bugdoc on rhbz#1074205
    
    (cherry picked from commit 9a37ce189881f12d678fdb054219b13c3e4c7e40)
    Signed-off-by: Miklos Vajna <vmiklos at collabora.co.uk>
    
    Change-Id: I0700c735545614730d26be187d9047fd20ebf134

diff --git a/sw/qa/extras/ooxmlexport/data/1_page.docx b/sw/qa/extras/ooxmlexport/data/1_page.docx
new file mode 100644
index 0000000..9b8638d
Binary files /dev/null and b/sw/qa/extras/ooxmlexport/data/1_page.docx differ
diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport.cxx b/sw/qa/extras/ooxmlexport/ooxmlexport.cxx
index 88e6811..b8b104b 100644
--- a/sw/qa/extras/ooxmlexport/ooxmlexport.cxx
+++ b/sw/qa/extras/ooxmlexport/ooxmlexport.cxx
@@ -2030,6 +2030,18 @@ DECLARE_OOXMLEXPORT_TEST(testFileOpenInputOutputError,"floatingtbl_with_formula.
       assertXPath(pXmlDoc, "/w:document/w:body/w:p[1]/w:pPr/w:pStyle", "val", "Normal");
 }
 
+DECLARE_OOXMLEXPORT_TEST(testExtraSectionBreak, "1_page.docx")
+{
+    // There was a problem for some documents during export.Invalid sectPr getting added
+    // because of faulty calculation of PageDesc value
+    // This was the reason for increasing number of pages after RT
+    uno::Reference<frame::XModel> xModel(mxComponent, uno::UNO_QUERY);
+    uno::Reference<text::XTextViewCursorSupplier> xTextViewCursorSupplier(xModel->getCurrentController(), uno::UNO_QUERY);
+    uno::Reference<text::XPageCursor> xCursor(xTextViewCursorSupplier->getViewCursor(), uno::UNO_QUERY);
+    xCursor->jumpToLastPage();
+    CPPUNIT_ASSERT_EQUAL(sal_Int16(1), xCursor->getPage());
+}
+
 #endif
 
 CPPUNIT_PLUGIN_IMPLEMENT();
diff --git a/sw/source/filter/ww8/wrtww8.cxx b/sw/source/filter/ww8/wrtww8.cxx
index 2716a79..7530668 100644
--- a/sw/source/filter/ww8/wrtww8.cxx
+++ b/sw/source/filter/ww8/wrtww8.cxx
@@ -2511,7 +2511,7 @@ void MSWordExportBase::WriteText()
         {
             SwCntntNode* pCNd = (SwCntntNode*)pNd;
 
-            const SwPageDesc* pTemp = pCNd->GetSwAttrSet().GetPageDesc().GetPageDesc();
+            const SwPageDesc* pTemp = pNd->FindPageDesc(sal_False);
             if ( pTemp )
                 pAktPageDesc = pTemp;
 


More information about the Libreoffice-commits mailing list