[Libreoffice-commits] core.git: Branch 'libreoffice-6-1' - sw/qa sw/source writerfilter/source

Libreoffice Gerrit user logerrit at kemper.freedesktop.org
Thu Jul 26 11:43:18 UTC 2018


 sw/qa/extras/ooxmlexport/data/tdf63561_clearTabs2.docx |binary
 sw/qa/extras/ooxmlexport/ooxmlexport11.cxx             |    8 +++++++-
 sw/source/filter/ww8/docxattributeoutput.cxx           |    6 +++++-
 writerfilter/source/dmapper/DomainMapper.cxx           |    2 +-
 4 files changed, 13 insertions(+), 3 deletions(-)

New commits:
commit 971a82bab0cd1381fc5623c2ead3e72580c5006f
Author:     Justin Luth <justin.luth at collabora.com>
AuthorDate: Wed Jul 11 17:21:51 2018 +0300
Commit:     Miklos Vajna <vmiklos at collabora.co.uk>
CommitDate: Thu Jul 26 13:42:54 2018 +0200

    related tdf#63561 docx: styles inherit tabstops too
    
    Add import and export support for style-parent
    tabstop inheritance.
    
    This patch is dependent on GetPropertyFromStyleSheet
    commit 39171b82b245a7589b9258337a18d6dd281f8ed2
    
    Change-Id: I0245d0e08f140b6cb473c96cffa6f5a4ceff8944
    Reviewed-on: https://gerrit.libreoffice.org/57278
    Tested-by: Jenkins
    Reviewed-by: Justin Luth <justin_luth at sil.org>
    Reviewed-on: https://gerrit.libreoffice.org/57759
    Reviewed-by: Miklos Vajna <vmiklos at collabora.co.uk>

diff --git a/sw/qa/extras/ooxmlexport/data/tdf63561_clearTabs2.docx b/sw/qa/extras/ooxmlexport/data/tdf63561_clearTabs2.docx
new file mode 100644
index 000000000000..cf674f3c460f
Binary files /dev/null and b/sw/qa/extras/ooxmlexport/data/tdf63561_clearTabs2.docx differ
diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport11.cxx b/sw/qa/extras/ooxmlexport/ooxmlexport11.cxx
index 6249547816df..a34efcdd9e2f 100644
--- a/sw/qa/extras/ooxmlexport/ooxmlexport11.cxx
+++ b/sw/qa/extras/ooxmlexport/ooxmlexport11.cxx
@@ -58,7 +58,13 @@ DECLARE_OOXMLEXPORT_TEST(testTdf46938_clearTabStop, "tdf46938_clearTabStop.docx"
 
 DECLARE_OOXMLEXPORT_TEST(testTdf63561_clearTabs, "tdf63561_clearTabs.docx")
 {
-    // MSO2013 gives 5,7, and 4 respectively
+    CPPUNIT_ASSERT_EQUAL(sal_Int32(5), getProperty< uno::Sequence<style::TabStop> >(getParagraph(1), "ParaTabStops").getLength());
+    CPPUNIT_ASSERT_EQUAL(sal_Int32(7), getProperty< uno::Sequence<style::TabStop> >(getParagraph(3), "ParaTabStops").getLength());
+    CPPUNIT_ASSERT_EQUAL(sal_Int32(4), getProperty< uno::Sequence<style::TabStop> >(getParagraph(4), "ParaTabStops").getLength());
+}
+
+DECLARE_OOXMLEXPORT_TEST(testTdf63561_clearTabs2, "tdf63561_clearTabs2.docx")
+{
     CPPUNIT_ASSERT_EQUAL(sal_Int32(1), getProperty< uno::Sequence<style::TabStop> >(getParagraph(1), "ParaTabStops").getLength());
     CPPUNIT_ASSERT_EQUAL(sal_Int32(3), getProperty< uno::Sequence<style::TabStop> >(getParagraph(3), "ParaTabStops").getLength());
     CPPUNIT_ASSERT_EQUAL(sal_Int32(4), getProperty< uno::Sequence<style::TabStop> >(getParagraph(4), "ParaTabStops").getLength());
diff --git a/sw/source/filter/ww8/docxattributeoutput.cxx b/sw/source/filter/ww8/docxattributeoutput.cxx
index 95de428c320c..c22ff5cdec4c 100644
--- a/sw/source/filter/ww8/docxattributeoutput.cxx
+++ b/sw/source/filter/ww8/docxattributeoutput.cxx
@@ -7711,7 +7711,11 @@ static void impl_WriteTabElement( FSHelperPtr const & pSerializer,
 
 void DocxAttributeOutput::ParaTabStop( const SvxTabStopItem& rTabStop )
 {
-    const SvxTabStopItem* pInheritedTabs = GetExport().m_pStyAttr ? GetExport().m_pStyAttr->GetItem<SvxTabStopItem>(RES_PARATR_TABSTOP) : nullptr;
+    const SvxTabStopItem* pInheritedTabs = nullptr;
+    if ( GetExport().m_pStyAttr )
+        pInheritedTabs = GetExport().m_pStyAttr->GetItem<SvxTabStopItem>(RES_PARATR_TABSTOP);
+    else if ( GetExport().m_pCurrentStyle && GetExport().m_pCurrentStyle->DerivedFrom() )
+        pInheritedTabs = GetExport().m_pCurrentStyle->DerivedFrom()->GetAttrSet().GetItem<SvxTabStopItem>(RES_PARATR_TABSTOP);
     const sal_uInt16 nInheritedTabCount = pInheritedTabs ? pInheritedTabs->Count() : 0;
     const sal_uInt16 nCount = rTabStop.Count();
 
diff --git a/writerfilter/source/dmapper/DomainMapper.cxx b/writerfilter/source/dmapper/DomainMapper.cxx
index 9eab98638e99..07400a945856 100644
--- a/writerfilter/source/dmapper/DomainMapper.cxx
+++ b/writerfilter/source/dmapper/DomainMapper.cxx
@@ -1849,7 +1849,7 @@ void DomainMapper::sprmWithProps( Sprm& rSprm, const PropertyMapPtr& rContext )
         // fdo#81033: for RTF, a tab stop is inherited from the style if it
         // is also applied to the paragraph directly, and cleared if it is
         // not applied to the paragraph directly => don't InitTabStopFromStyle
-        if (!IsStyleSheetImport() && !IsRTFImport())
+        if ( !IsRTFImport() )
         {
             uno::Any aValue = m_pImpl->GetPropertyFromStyleSheet(PROP_PARA_TAB_STOPS);
             uno::Sequence< style::TabStop > aStyleTabStops;


More information about the Libreoffice-commits mailing list