[Libreoffice-commits] core.git: Branch 'private/Rosemary/change-tracking' - 2 commits - sw/qa sw/source

Rosemary Sebastian rosemary.seb8 at gmail.com
Mon Aug 14 08:41:35 UTC 2017


 sw/qa/extras/odfexport/odfexport.cxx |   47 -----------------------------------
 sw/source/filter/xml/xmlexp.cxx      |   10 +++----
 2 files changed, 5 insertions(+), 52 deletions(-)

New commits:
commit 1ee4bf39db36caa805f0c2dc1ad0dd0f5db78809
Author: Rosemary Sebastian <rosemary.seb8 at gmail.com>
Date:   Mon Aug 14 13:54:00 2017 +0530

    Remove redline import tests for now
    
    This patch should be reverted after change-tracking import is implemented
    
    Change-Id: I9443bc6bba39556aa92706ee02d6fff547133de1

diff --git a/sw/qa/extras/odfexport/odfexport.cxx b/sw/qa/extras/odfexport/odfexport.cxx
index bbebd6b24afc..bf2c823368da 100644
--- a/sw/qa/extras/odfexport/odfexport.cxx
+++ b/sw/qa/extras/odfexport/odfexport.cxx
@@ -304,15 +304,6 @@ DECLARE_ODFEXPORT_TEST(testOOoxmlEmbedded, "oooxml_embedded.sxw")
     CPPUNIT_ASSERT_EQUAL(sal_Int32(SOFFICE_FILEFORMAT_8), comphelper::OStorageHelper::GetXStorageFormat(xStorage4));
 }
 
-DECLARE_ODFEXPORT_TEST(testredlineTextFrame, "redlineTextFrame.odt")
-{
-    //Note this is for a crash test
-    //Counting the Number of Frames and checking with the expected count
-    uno::Reference<text::XTextFramesSupplier> xTextFramesSupplier(mxComponent, uno::UNO_QUERY);
-    uno::Reference<container::XIndexAccess> xIndexAccess(xTextFramesSupplier->getTextFrames(), uno::UNO_QUERY);
-    CPPUNIT_ASSERT_EQUAL(sal_Int32(1), xIndexAccess->getCount());
-}
-
 DECLARE_ODFEXPORT_TEST(testFdo38244, "fdo38244.odt")
 {
     // See ooxmlexport's testFdo38244().
@@ -1109,44 +1100,6 @@ DECLARE_ODFEXPORT_TEST(testWhitespace, "whitespace.odt")
     CPPUNIT_ASSERT_EQUAL(OUString(" X"), xPortion->getString());
     CPPUNIT_ASSERT(!xPortions->hasMoreElements());
 
-    xPara.set(getParagraphOrTable(17), uno::UNO_QUERY);
-    xPortions.set(xPara->createEnumeration());
-    xPortion.set(xPortions->nextElement(), uno::UNO_QUERY);
-    CPPUNIT_ASSERT_EQUAL(OUString("Text"), getProperty<OUString>(xPortion, "TextPortionType"));
-    CPPUNIT_ASSERT_EQUAL(OUString("X "), xPortion->getString());
-    xPortion.set(xPortions->nextElement(), uno::UNO_QUERY);
-    CPPUNIT_ASSERT_EQUAL(OUString("Redline"), getProperty<OUString>(xPortion, "TextPortionType"));
-    CPPUNIT_ASSERT(!getProperty<bool>(xPortion, "IsCollapsed"));
-    xPortion.set(xPortions->nextElement(), uno::UNO_QUERY);
-    CPPUNIT_ASSERT_EQUAL(OUString("Text"), getProperty<OUString>(xPortion, "TextPortionType"));
-    CPPUNIT_ASSERT_EQUAL(OUString(" "), xPortion->getString());
-    xPortion.set(xPortions->nextElement(), uno::UNO_QUERY);
-    CPPUNIT_ASSERT_EQUAL(OUString("Redline"), getProperty<OUString>(xPortion, "TextPortionType"));
-    CPPUNIT_ASSERT(!getProperty<bool>(xPortion, "IsCollapsed"));
-    xPortion.set(xPortions->nextElement(), uno::UNO_QUERY);
-    CPPUNIT_ASSERT_EQUAL(OUString("Text"), getProperty<OUString>(xPortion, "TextPortionType"));
-    CPPUNIT_ASSERT_EQUAL(OUString(" X"), xPortion->getString());
-    CPPUNIT_ASSERT(!xPortions->hasMoreElements());
-
-    xPara.set(getParagraphOrTable(18), uno::UNO_QUERY);
-    xPortions.set(xPara->createEnumeration());
-    xPortion.set(xPortions->nextElement(), uno::UNO_QUERY);
-    CPPUNIT_ASSERT_EQUAL(OUString("Text"), getProperty<OUString>(xPortion, "TextPortionType"));
-    CPPUNIT_ASSERT_EQUAL(OUString("X "), xPortion->getString());
-    xPortion.set(xPortions->nextElement(), uno::UNO_QUERY);
-    CPPUNIT_ASSERT_EQUAL(OUString("Redline"), getProperty<OUString>(xPortion, "TextPortionType"));
-    CPPUNIT_ASSERT(!getProperty<bool>(xPortion, "IsCollapsed"));
-    xPortion.set(xPortions->nextElement(), uno::UNO_QUERY);
-    CPPUNIT_ASSERT_EQUAL(OUString("Text"), getProperty<OUString>(xPortion, "TextPortionType"));
-    CPPUNIT_ASSERT_EQUAL(OUString(" "), xPortion->getString());
-    xPortion.set(xPortions->nextElement(), uno::UNO_QUERY);
-    CPPUNIT_ASSERT_EQUAL(OUString("Redline"), getProperty<OUString>(xPortion, "TextPortionType"));
-    CPPUNIT_ASSERT(!getProperty<bool>(xPortion, "IsCollapsed"));
-    xPortion.set(xPortions->nextElement(), uno::UNO_QUERY);
-    CPPUNIT_ASSERT_EQUAL(OUString("Text"), getProperty<OUString>(xPortion, "TextPortionType"));
-    CPPUNIT_ASSERT_EQUAL(OUString(" X"), xPortion->getString());
-    CPPUNIT_ASSERT(!xPortions->hasMoreElements());
-
     xPara.set(getParagraphOrTable(19), uno::UNO_QUERY);
     xPortions.set(xPara->createEnumeration());
     xPortion.set(xPortions->nextElement(), uno::UNO_QUERY);
commit bc6cfb9b2764a7a3b62b05c5507245c9295585bb
Author: Rosemary Sebastian <rosemaryseb8 at gmail.com>
Date:   Fri Jun 3 20:45:24 2016 +0530

    Save tracked changes in undo.xml
    
    Change-Id: I41326b89788ad85646b777d2a8df81f03619ae9f

diff --git a/sw/source/filter/xml/xmlexp.cxx b/sw/source/filter/xml/xmlexp.cxx
index cbeaacd86533..ea992ef726b3 100644
--- a/sw/source/filter/xml/xmlexp.cxx
+++ b/sw/source/filter/xml/xmlexp.cxx
@@ -127,7 +127,7 @@ ErrCode SwXMLExport::exportDoc( enum XMLTokenEnum eClass )
     SwDoc *pDoc = getDoc();
 
     if( getExportFlags() & (SvXMLExportFlags::FONTDECLS|SvXMLExportFlags::STYLES|
-                            SvXMLExportFlags::MASTERSTYLES|SvXMLExportFlags::CONTENT))
+                            SvXMLExportFlags::MASTERSTYLES|SvXMLExportFlags::CONTENT|SvXMLExportFlags::UNDO))
     {
         if( getDefaultVersion() > SvtSaveOptions::ODFVER_012 )
         {
@@ -263,7 +263,7 @@ ErrCode SwXMLExport::exportDoc( enum XMLTokenEnum eClass )
     // set redline mode if we export STYLES or CONTENT, unless redline
     // mode is taken care of outside (through info XPropertySet)
     bool bSaveRedline =
-        bool( getExportFlags() & (SvXMLExportFlags::CONTENT|SvXMLExportFlags::STYLES) );
+        bool( getExportFlags() & (SvXMLExportFlags::UNDO|SvXMLExportFlags::STYLES) );
     if( bSaveRedline )
     {
         // if the info property set has a ShowChanges property,
@@ -475,7 +475,6 @@ void SwXMLExport::ExportContent_()
         }
     }
 
-    GetTextParagraphExport()->exportTrackedChanges( false );
     GetTextParagraphExport()->exportTextDeclarations();
     Reference < XTextDocument > xTextDoc( GetModel(), UNO_QUERY );
     Reference < XText > xText = xTextDoc->getText();
@@ -488,6 +487,7 @@ void SwXMLExport::ExportUndo_()
 {
     SvXMLElementExport aElem( *this, XML_NAMESPACE_OFFICE, XML_UNDO,
                                 true, true );
+    GetTextParagraphExport()->exportTrackedChanges( false );
 }
 
 namespace
@@ -563,7 +563,7 @@ com_sun_star_comp_Writer_XMLUndoExporter_get_implementation(css::uno::XComponent
         css::uno::Sequence<css::uno::Any> const &)
 {
     return cppu::acquire(new SwXMLExport(context, OUString("com.sun.star.comp.Writer.XMLUndoExporter"),
-                SvXMLExportFlags::UNDO));
+                SvXMLExportFlags::UNDO | SvXMLExportFlags::AUTOSTYLES));
 }
 
 extern "C" SAL_DLLPUBLIC_EXPORT css::uno::XInterface* SAL_CALL
@@ -613,7 +613,7 @@ com_sun_star_comp_Writer_XMLOasisUndoExporter_get_implementation(css::uno::XComp
         css::uno::Sequence<css::uno::Any> const &)
 {
     return cppu::acquire(new SwXMLExport(context, OUString("com.sun.star.comp.Writer.XMLOasisUndoExporter"),
-                SvXMLExportFlags::UNDO | SvXMLExportFlags::OASIS));
+                SvXMLExportFlags::UNDO | SvXMLExportFlags::AUTOSTYLES | SvXMLExportFlags::OASIS));
 }
 
 extern "C" SAL_DLLPUBLIC_EXPORT css::uno::XInterface* SAL_CALL


More information about the Libreoffice-commits mailing list