diff options
-rw-r--r-- | sw/qa/extras/ooxmlexport/data/tdf117504_numberingIndent.docx | bin | 0 -> 17711 bytes | |||
-rw-r--r-- | sw/qa/extras/ooxmlexport/ooxmlexport12.cxx | 6 | ||||
-rw-r--r-- | writerfilter/source/dmapper/DomainMapper_Impl.cxx | 11 | ||||
-rw-r--r-- | writerfilter/source/dmapper/DomainMapper_Impl.hxx | 4 |
4 files changed, 19 insertions, 2 deletions
diff --git a/sw/qa/extras/ooxmlexport/data/tdf117504_numberingIndent.docx b/sw/qa/extras/ooxmlexport/data/tdf117504_numberingIndent.docx Binary files differnew file mode 100644 index 000000000000..091718984540 --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/tdf117504_numberingIndent.docx diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport12.cxx b/sw/qa/extras/ooxmlexport/ooxmlexport12.cxx index 878fd2ebf0de..4fda4e47a930 100644 --- a/sw/qa/extras/ooxmlexport/ooxmlexport12.cxx +++ b/sw/qa/extras/ooxmlexport/ooxmlexport12.cxx @@ -725,6 +725,12 @@ DECLARE_OOXMLEXPORT_TEST(testObjectCrossReference, "object_cross_reference.odt") CPPUNIT_ASSERT_EQUAL(sal_uInt16(21), nIndex); } +DECLARE_OOXMLEXPORT_TEST(testTdf117504_numberingIndent, "tdf117504_numberingIndent.docx") +{ + OUString sName = getProperty<OUString>(getParagraph(1), "NumberingStyleName"); + CPPUNIT_ASSERT_MESSAGE("Paragraph has numbering style", !sName.isEmpty()); +} + DECLARE_OOXMLEXPORT_TEST(testWatermark, "watermark.docx") { uno::Reference<drawing::XShape> xShape(getShape(1), uno::UNO_QUERY); diff --git a/writerfilter/source/dmapper/DomainMapper_Impl.cxx b/writerfilter/source/dmapper/DomainMapper_Impl.cxx index 3cd7492538a5..f2274f0c646a 100644 --- a/writerfilter/source/dmapper/DomainMapper_Impl.cxx +++ b/writerfilter/source/dmapper/DomainMapper_Impl.cxx @@ -647,6 +647,17 @@ uno::Sequence< style::TabStop > DomainMapper_Impl::GetCurrentTabStopAndClear() return comphelper::containerToSequence(aRet); } +const OUString DomainMapper_Impl::GetCurrentParaStyleName() +{ + // use saved currParaStyleName as a fallback, in case no particular para style name applied. + OUString sName = m_sCurrentParaStyleName; + PropertyMapPtr pParaContext = GetTopContextOfType(CONTEXT_PARAGRAPH); + if ( pParaContext && pParaContext->isSet(PROP_PARA_STYLE_NAME) ) + pParaContext->getProperty(PROP_PARA_STYLE_NAME)->second >>= sName; + + return sName; +} + /*------------------------------------------------------------------------- returns a the value from the current paragraph style - if available TODO: What about parent styles? diff --git a/writerfilter/source/dmapper/DomainMapper_Impl.hxx b/writerfilter/source/dmapper/DomainMapper_Impl.hxx index 482300c13a4c..dc229c28b614 100644 --- a/writerfilter/source/dmapper/DomainMapper_Impl.hxx +++ b/writerfilter/source/dmapper/DomainMapper_Impl.hxx @@ -474,7 +474,7 @@ private: PropertyMapPtr m_pLastCharacterContext; ::std::vector<DeletableTabStop> m_aCurrentTabStops; - OUString m_sCurrentParaStyleName; + OUString m_sCurrentParaStyleName; //highly inaccurate. Overwritten by "overlapping" paragraphs like comments, flys. bool m_bInStyleSheetImport; //in import of fonts, styles, lists or lfos bool m_bInAnyTableImport; //in import of fonts, styles, lists or lfos bool m_bInHeaderFooterImport; @@ -693,7 +693,7 @@ public: css::uno::Sequence<css::style::TabStop> GetCurrentTabStopAndClear(); void SetCurrentParaStyleName(const OUString& sStringValue) {m_sCurrentParaStyleName = sStringValue;} - const OUString& GetCurrentParaStyleName() const {return m_sCurrentParaStyleName;} + const OUString GetCurrentParaStyleName(); css::uno::Any GetPropertyFromStyleSheet(PropertyIds eId); void SetStyleSheetImport( bool bSet ) { m_bInStyleSheetImport = bSet;} |