diff options
author | László Németh <nemeth@numbertext.org> | 2020-09-15 16:13:34 +0200 |
---|---|---|
committer | László Németh <nemeth@numbertext.org> | 2020-09-16 09:31:10 +0200 |
commit | c04ee66c7cfeb725d637b0f9ec3e3b1f8776bfe9 (patch) | |
tree | 6082fa482a1ea2bc574887a1cede6251d86c58de /writerfilter | |
parent | f19381e46930bb496e7331754843920933fb4be2 (diff) |
tdf#134784 DOCX import: fix shape paragraph margins
based on bad style inheritance.
Regression from commit dc0300eac3b755bc207cd1fe87217f4ebaeb9f58
(tdf#118521 DOCX import: fix paragraph margin from paragraph style),
revealing the problematic m_sCurrentParaStyleName, see also
commit 8920d865ee148518bf71f71ce1866b24cc17c07e for more information.
Change-Id: Icc7f70452d946d56dc840d39545d850f74f97ebc
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/102774
Tested-by: László Németh <nemeth@numbertext.org>
Reviewed-by: László Németh <nemeth@numbertext.org>
Diffstat (limited to 'writerfilter')
-rw-r--r-- | writerfilter/source/dmapper/DomainMapper_Impl.cxx | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/writerfilter/source/dmapper/DomainMapper_Impl.cxx b/writerfilter/source/dmapper/DomainMapper_Impl.cxx index 25030cbff4b6..b0facd429e0e 100644 --- a/writerfilter/source/dmapper/DomainMapper_Impl.cxx +++ b/writerfilter/source/dmapper/DomainMapper_Impl.cxx @@ -780,8 +780,13 @@ uno::Sequence< style::TabStop > DomainMapper_Impl::GetCurrentTabStopAndClear() OUString DomainMapper_Impl::GetCurrentParaStyleName() { + OUString sName; // use saved currParaStyleName as a fallback, in case no particular para style name applied. - OUString sName = m_sCurrentParaStyleName; + // tdf#134784 except in the case of first paragraph of shapes to avoid bad fallback. + // TODO fix this "highly inaccurate" m_sCurrentParaStyleName + if ( !m_bIsFirstParaInShape ) + sName = m_sCurrentParaStyleName; + PropertyMapPtr pParaContext = GetTopContextOfType(CONTEXT_PARAGRAPH); if ( pParaContext && pParaContext->isSet(PROP_PARA_STYLE_NAME) ) pParaContext->getProperty(PROP_PARA_STYLE_NAME)->second >>= sName; |