path: root/writerfilter/source/dmapper/DomainMapper_Impl.cxx
diff options
authorJustin Luth <>2018-05-10 15:36:11 +0300
committerMiklos Vajna <>2018-05-16 11:24:47 +0200
commit8920d865ee148518bf71f71ce1866b24cc17c07e (patch)
treec968259350ad10d6c1e17cf5eadfda5bfefa7cbe /writerfilter/source/dmapper/DomainMapper_Impl.cxx
parentea19b96b6beb0ce2f25705339d1d6342dc38b283 (diff)
tdf#117504 ooxmlimport: check paragraph props for actual style
m_sCurrentParaStyleName sounds like a nice idea, and has been around since the initial fork, but by the time finishParagraph() rolls around, the chances that it is still accurate are rather low. Anything that contains a paragraph (like comments, textboxes, shapes, tables, flys etc) might have modified that value. This fix queries the current paragraph itself to see if PROP_PARA_STYLE_NAME is set, which it typically is by lcl_startParagraphGroup() except when IsInShape(). If it isn't specified, then fallback to the previous result, which still may not be accurate, but at least it won't be a regression. It is too late in the development cycle to look into fully eliminating m_sCurrentParaStyleName. I hope to investigate that in the 6.2 development cycle. Change-Id: I124688d864f553dd5778b3593f511cc41d31c262 Reviewed-on: Tested-by: Jenkins <> Reviewed-by: Justin Luth <> Reviewed-by: Miklos Vajna <>
Diffstat (limited to 'writerfilter/source/dmapper/DomainMapper_Impl.cxx')
1 files changed, 11 insertions, 0 deletions
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?