From 254c80037a3939c110d5c66fef6c28caf47625e5 Mon Sep 17 00:00:00 2001 From: Justin Luth Date: Wed, 17 Jan 2018 16:25:56 +0300 Subject: writerfilter: move TopContextType==Para requirement This is prep work for tdf#95377. I need this function to run when there is no TopContext. This function doesn't do anything with the context, so in that regard I wonder if it is even necessary? My guess would be that it is a leftover piece from discovering the fix for n75883. However, to avoid causing a regression, I'm just pulling this test into the calling functions. (Of the three instances calling this function, two need to be contextless..) This is not truly NFC because if the followup patch is reverted, then this one will cause a change. But that is actually OK, because if my follow-up patch breaks because of these two functions changing to become contextless, then I'll be better able to pin-point the reason for the regression. Original commit adding this function was commit 2123ede032ca64f696ef54af4ad3238974ca2b5d Change-Id: I471aa852aa48527d69e0343a2ac28fa6e8acb209 Reviewed-on: https://gerrit.libreoffice.org/48062 Reviewed-by: Justin Luth Tested-by: Justin Luth --- writerfilter/source/dmapper/DomainMapper_Impl.cxx | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'writerfilter') diff --git a/writerfilter/source/dmapper/DomainMapper_Impl.cxx b/writerfilter/source/dmapper/DomainMapper_Impl.cxx index ee3533bc134e..c66b087eca67 100644 --- a/writerfilter/source/dmapper/DomainMapper_Impl.cxx +++ b/writerfilter/source/dmapper/DomainMapper_Impl.cxx @@ -5409,7 +5409,7 @@ uno::Reference DomainMapper_Impl::GetCurrentNumberingRu try { OUString aStyle = GetCurrentParaStyleId(); - if (aStyle.isEmpty() || GetTopContextType() != CONTEXT_PARAGRAPH) + if (aStyle.isEmpty()) return xRet; const StyleSheetEntryPtr pEntry = GetStyleSheetTable()->FindStyleSheetByISTD(aStyle); if (!pEntry) @@ -5446,7 +5446,9 @@ uno::Reference DomainMapper_Impl::GetCurrentNumberingCharSt try { sal_Int32 nListLevel = -1; - uno::Reference xLevels = GetCurrentNumberingRules(&nListLevel); + uno::Reference xLevels; + if ( GetTopContextType() == CONTEXT_PARAGRAPH ) + xLevels = GetCurrentNumberingRules(&nListLevel); if (!xLevels.is()) { PropertyMapPtr pContext = m_pTopContext; -- cgit