sw/qa/extras/ww8export/ww8export.cxx | 11 ++++++++++- sw/source/filter/ww8/ww8par6.cxx | 2 +- 2 files changed, 11 insertions(+), 2 deletions(-)
New commits: commit 018daed42eb3b69b7566348849aa2a13fd288f4a Author: Justin Luth <justin.l...@collabora.com> AuthorDate: Thu Feb 20 19:59:16 2025 -0500 Commit: Justin Luth <justin.l...@collabora.com> CommitDate: Fri Feb 21 12:21:54 2025 +0100 tdf#164845 doc import: read_tabs for sprmPChgTabs I'm not sure how we possibly got away with not reading so many tabstops in styles. Change-Id: I66f66c94f70423db866de10945429444a4906027 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/181979 Reviewed-by: Justin Luth <jl...@mail.com> Tested-by: Jenkins diff --git a/sw/qa/extras/ww8export/ww8export.cxx b/sw/qa/extras/ww8export/ww8export.cxx index acfc4b674bc5..16eff873137a 100644 --- a/sw/qa/extras/ww8export/ww8export.cxx +++ b/sw/qa/extras/ww8export/ww8export.cxx @@ -22,6 +22,7 @@ #include <com/sun/star/drawing/TextVerticalAdjust.hpp> #include <com/sun/star/drawing/XControlShape.hpp> #include <com/sun/star/beans/XPropertySet.hpp> +#include <com/sun/star/style/TabStop.hpp> #include <com/sun/star/view/XViewSettingsSupplier.hpp> #include <com/sun/star/table/BorderLine2.hpp> #include <com/sun/star/table/ShadowFormat.hpp> @@ -257,7 +258,15 @@ DECLARE_WW8EXPORT_TEST(testN823651, "n823651.doc") // Character height was 10pt instead of 7.5pt in the header. uno::Reference<beans::XPropertySet> xStyle(getStyles(u"PageStyles"_ustr)->getByName(u"Standard"_ustr), uno::UNO_QUERY); uno::Reference<text::XText> xText = getProperty< uno::Reference<text::XTextRange> >(xStyle, u"HeaderTextFirst"_ustr)->getText(); - CPPUNIT_ASSERT_EQUAL(7.5f, getProperty<float>(getParagraphOfText(1, xText), u"CharHeight"_ustr)); + uno::Reference<text::XTextRange> xHeaderParagraph = getParagraphOfText(1, xText, ""); + CPPUNIT_ASSERT_EQUAL(7.5f, getProperty<float>(xHeaderParagraph, u"CharHeight"_ustr)); + + // tdf#164845 - inherit the two tab stops from the "Header" paragraph style + auto aTabStops + = getProperty<uno::Sequence<style::TabStop>>(xHeaderParagraph, u"ParaTabStops"_ustr); + CPPUNIT_ASSERT_EQUAL(static_cast<sal_uInt32>(2), aTabStops.size()); + CPPUNIT_ASSERT_EQUAL(static_cast<sal_Int32>(7620), aTabStops[0].Position); // 7.62cm + CPPUNIT_ASSERT_EQUAL(static_cast<sal_Int32>(15240), aTabStops[1].Position); // 15.24 cm } DECLARE_WW8EXPORT_TEST(testFdo36868, "fdo36868.doc") diff --git a/sw/source/filter/ww8/ww8par6.cxx b/sw/source/filter/ww8/ww8par6.cxx index 44c8024d8c51..5a7586eae3b3 100644 --- a/sw/source/filter/ww8/ww8par6.cxx +++ b/sw/source/filter/ww8/ww8par6.cxx @@ -5888,7 +5888,7 @@ static const wwSprmDispatcher *GetWW8SprmDispatcher() // of fMultLinespace;long; {NS_sprm::PDyaBefore::val, &SwWW8ImplReader::Read_UL}, // pap.dyaBefore;dya;word; {NS_sprm::PDyaAfter::val, &SwWW8ImplReader::Read_UL}, // pap.dyaAfter;dya;word; - {NS_sprm::PChgTabs::val, nullptr}, // pap.itbdMac, pap.rgdxaTab, pap.rgtbd; + {NS_sprm::PChgTabs::val, &SwWW8ImplReader::Read_Tab}, // pap.itbdMac, pap.rgdxaTab, pap.rgtbd; // complex;variable length; {NS_sprm::PFInTable::val, nullptr}, // pap.fInTable;0 or 1;byte; {NS_sprm::PFTtp::val, &SwWW8ImplReader::Read_TabRowEnd}, // pap.fTtp;0 or 1;byte;