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

Charu Tyagi charu.tyagi at ericsson.com
Sun Jan 4 03:07:36 PST 2015


 sw/qa/extras/ooxmlimport/data/fdo79738.docx       |binary
 sw/qa/extras/ooxmlimport/ooxmlimport.cxx          |   11 +++++++
 writerfilter/source/dmapper/DomainMapper_Impl.cxx |   32 ++++++++++++++++++++++
 3 files changed, 43 insertions(+)

New commits:
commit 799e07f02dbca97f4dd9cff5b779392b13b9021c
Author: Charu Tyagi <charu.tyagi at ericsson.com>
Date:   Fri Dec 19 13:56:26 2014 +0530

    fdo#79738: Test case for patch that fixes 79738
    
    Reviewed on:
    	https://gerrit.libreoffice.org/13541
    
    Change-Id: I40ba14503ad9f5458d8326741a4fe7a13653b05a

diff --git a/sw/qa/extras/ooxmlimport/ooxmlimport.cxx b/sw/qa/extras/ooxmlimport/ooxmlimport.cxx
index a9f0d24..5bec69c 100644
--- a/sw/qa/extras/ooxmlimport/ooxmlimport.cxx
+++ b/sw/qa/extras/ooxmlimport/ooxmlimport.cxx
@@ -242,6 +242,17 @@ DECLARE_OOXMLIMPORT_TEST(testFdo81486, "fdo81486.docx")
     CPPUNIT_ASSERT_EQUAL(text->getString(),OUString("CustomTitle"));
 }
 
+DECLARE_OOXMLIMPORT_TEST(testFdo79738, "fdo79738.docx")
+{
+    uno::Reference< style::XStyleFamiliesSupplier > xStylesSupplier( mxComponent, uno::UNO_QUERY_THROW );
+    uno::Reference< container::XNameAccess > xStyleFamilies = xStylesSupplier->getStyleFamilies();
+    uno::Reference<container::XNameContainer> xStyles;
+    xStyleFamilies->getByName("ParagraphStyles") >>= xStyles;
+    uno::Reference<beans::XPropertySet> xPropertySetHeader( xStyles->getByName("Header"), uno::UNO_QUERY );
+    CPPUNIT_ASSERT_EQUAL(false, xPropertySetHeader->getPropertyValue("ParaLineNumberCount").get<bool>());
+    uno::Reference<beans::XPropertySet> xPropertySetFooter( xStyles->getByName("Footer"), uno::UNO_QUERY );
+    CPPUNIT_ASSERT_EQUAL(false, xPropertySetFooter->getPropertyValue("ParaLineNumberCount").get<bool>());
+}
 
 DECLARE_OOXMLIMPORT_TEST(testN751077, "n751077.docx")
 {
commit e1c45f55cde70d71154fa12b2449b20a256d3a26
Author: Charu Tyagi <charu.tyagi at ericsson.com>
Date:   Fri Dec 19 14:05:49 2014 +0530

    fdo#79738: test document for patch that that fixes 79738
    
    Reviewed on:
    	https://gerrit.libreoffice.org/13542
    
    Change-Id: I8d6289b814a063ba8037d07a7600a44fa77f860d

diff --git a/sw/qa/extras/ooxmlimport/data/fdo79738.docx b/sw/qa/extras/ooxmlimport/data/fdo79738.docx
new file mode 100644
index 0000000..e6873e7
Binary files /dev/null and b/sw/qa/extras/ooxmlimport/data/fdo79738.docx differ
commit 5b743ccf8b5bb51b4d390e64f2916ac1759419a1
Author: Charu Tyagi <charu.tyagi at ericsson.com>
Date:   Fri Dec 19 11:10:23 2014 +0530

    fdo#79738: FILEOPEN: Number lines in footer not compatible with MSO
    
    Reviewed on:
    	https://gerrit.libreoffice.org/13539
    
    Change-Id: I309f9cfc31420e350acc05be7ff422c8aefad782

diff --git a/writerfilter/source/dmapper/DomainMapper_Impl.cxx b/writerfilter/source/dmapper/DomainMapper_Impl.cxx
index 678b19e..b903c51 100644
--- a/writerfilter/source/dmapper/DomainMapper_Impl.cxx
+++ b/writerfilter/source/dmapper/DomainMapper_Impl.cxx
@@ -42,6 +42,7 @@
 #include <com/sun/star/text/SetVariableType.hpp>
 #include <com/sun/star/text/XFootnote.hpp>
 #include <com/sun/star/text/XLineNumberingProperties.hpp>
+#include <com/sun/star/style/XStyle.hpp>
 #include <com/sun/star/text/PageNumberType.hpp>
 #include <com/sun/star/text/HoriOrientation.hpp>
 #include <com/sun/star/text/VertOrientation.hpp>
@@ -88,6 +89,30 @@ using namespace oox;
 namespace writerfilter {
 namespace dmapper{
 
+//line numbering for header/footer
+void lcl_linenumberingHeaderFooter( PropertyNameSupplier& rPropNameSupplier, uno::Reference<container::XNameContainer> xStyles, OUString rname, DomainMapper_Impl* dmapper )
+{
+    const StyleSheetEntryPtr pEntry = dmapper->GetStyleSheetTable()->FindStyleSheetByISTD( rname );
+    if (!pEntry)
+        return;
+    const StyleSheetPropertyMap* pStyleSheetProperties = dynamic_cast<const StyleSheetPropertyMap*>( pEntry->pProperties.get() );
+    if ( !pStyleSheetProperties )
+        return;
+    sal_Int32 nListId = pStyleSheetProperties->GetListId();
+    if( xStyles.is() )
+    {
+        if( xStyles->hasByName( rname ) )
+        {
+            uno::Reference< style::XStyle > xStyle;
+            xStyles->getByName( rname ) >>= xStyle;
+            if( !xStyle.is() )
+                return;
+            uno::Reference<beans::XPropertySet> xPropertySet( xStyle, uno::UNO_QUERY );
+            xPropertySet->setPropertyValue( rPropNameSupplier.GetName( PROP_PARA_LINE_NUMBER_COUNT ), uno::makeAny( ( bool )( nListId >= 0 ) ) );
+        }
+    }
+}
+
 // Populate Dropdown Field properties from FFData structure
 void lcl_handleDropdownField( const uno::Reference< beans::XPropertySet >& rxFieldProps, FFDataHandler::Pointer_t pFFDataHandler )
 {
@@ -4654,6 +4679,13 @@ void DomainMapper_Impl::SetLineNumbering( sal_Int32 nLnnMod, sal_uInt32 nLnc, sa
         {}
     }
     m_bLineNumberingSet = true;
+    PropertyNameSupplier& rPropNameSupplier = PropertyNameSupplier::GetPropertyNameSupplier();
+    uno::Reference< style::XStyleFamiliesSupplier > xStylesSupplier( GetTextDocument(), uno::UNO_QUERY_THROW );
+    uno::Reference< container::XNameAccess > xStyleFamilies = xStylesSupplier->getStyleFamilies();
+    uno::Reference<container::XNameContainer> xStyles;
+    xStyleFamilies->getByName(rPropNameSupplier.GetName( PROP_PARAGRAPH_STYLES )) >>= xStyles;
+    lcl_linenumberingHeaderFooter( rPropNameSupplier, xStyles, "Header", this );
+    lcl_linenumberingHeaderFooter( rPropNameSupplier, xStyles, "Footer", this );
 }
 
 


More information about the Libreoffice-commits mailing list