summaryrefslogtreecommitdiff
path: root/writerfilter
diff options
context:
space:
mode:
authorJustin Luth <justin.luth@collabora.com>2020-12-15 10:01:03 +0300
committerJustin Luth <justin_luth@sil.org>2020-12-16 06:43:38 +0100
commite901ffcb93d217f2cc09021a3b2fecb36f9884f6 (patch)
tree10a5c9b71145e86d0c6da3257f84c51c7b7ce378 /writerfilter
parent0932a7a2c3b64a30f6928007a7d60a2073660f40 (diff)
tdf#138892 writerfilter: cancel style list if bNoNumbering
This fixes 6.1 regression e24e2d2fb02239753c1520a0458b44683ea4cc2e. Starting in 7.0 (tdf#131321), paragraph styles kept their numbering property. But even before that, non-paragraphs marked by bNoNumbering we having their direct numbering removed, and then finishParagraph applied para-style numbering since there was no direct numbering. So, we need to pass the bNoNumbering to finishParagraph so that it can cancel out a style-assigned numbering. Change-Id: I0c24af4e9bd0ea3712179a47ed3550f91c8f44b7 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/107738 Tested-by: Jenkins Reviewed-by: Justin Luth <justin_luth@sil.org> (cherry picked from commit bfcd952dc7820c4cf8761c4222d29ede039391dc) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/107795
Diffstat (limited to 'writerfilter')
-rw-r--r--writerfilter/source/dmapper/DomainMapper.cxx6
-rw-r--r--writerfilter/source/dmapper/DomainMapper.hxx2
-rw-r--r--writerfilter/source/dmapper/DomainMapper_Impl.cxx8
-rw-r--r--writerfilter/source/dmapper/DomainMapper_Impl.hxx2
4 files changed, 10 insertions, 8 deletions
diff --git a/writerfilter/source/dmapper/DomainMapper.cxx b/writerfilter/source/dmapper/DomainMapper.cxx
index aac420a97500..ec93ba4acdb3 100644
--- a/writerfilter/source/dmapper/DomainMapper.cxx
+++ b/writerfilter/source/dmapper/DomainMapper.cxx
@@ -3572,7 +3572,7 @@ void DomainMapper::lcl_utext(const sal_uInt8 * data_, size_t len)
xContext->Erase(PROP_NUMBERING_LEVEL);
}
m_pImpl->SetParaSectpr(false);
- finishParagraph(bRemove);
+ finishParagraph(bRemove, bNoNumbering);
if (bRemove)
m_pImpl->RemoveLastParagraph();
}
@@ -4058,11 +4058,11 @@ void DomainMapper::HandleRedline( Sprm& rSprm )
m_pImpl->SetCurrentRedlineIsRead();
}
-void DomainMapper::finishParagraph(const bool bRemove)
+void DomainMapper::finishParagraph(const bool bRemove, const bool bNoNumbering)
{
if (m_pImpl->m_pSdtHelper->validateDateFormat())
m_pImpl->m_pSdtHelper->createDateContentControl();
- m_pImpl->finishParagraph(m_pImpl->GetTopContextOfType(CONTEXT_PARAGRAPH), bRemove);
+ m_pImpl->finishParagraph(m_pImpl->GetTopContextOfType(CONTEXT_PARAGRAPH), bRemove, bNoNumbering);
}
} //namespace writerfilter
diff --git a/writerfilter/source/dmapper/DomainMapper.hxx b/writerfilter/source/dmapper/DomainMapper.hxx
index 9cc196621083..d2e08a0041aa 100644
--- a/writerfilter/source/dmapper/DomainMapper.hxx
+++ b/writerfilter/source/dmapper/DomainMapper.hxx
@@ -161,7 +161,7 @@ private:
// Table
virtual void lcl_entry(writerfilter::Reference<Properties>::Pointer_t ref) override;
- void finishParagraph(const bool bRemove = false);
+ void finishParagraph(const bool bRemove = false, const bool bNoNumbering = false);
static void handleUnderlineType(const Id nId, const ::tools::SvRef<PropertyMap>& rContext);
void handleParaJustification(const sal_Int32 nIntValue, const ::tools::SvRef<PropertyMap>& rContext, const bool bExchangeLeftRight);
diff --git a/writerfilter/source/dmapper/DomainMapper_Impl.cxx b/writerfilter/source/dmapper/DomainMapper_Impl.cxx
index 86dcf63416fc..e8a45ef3b5c0 100644
--- a/writerfilter/source/dmapper/DomainMapper_Impl.cxx
+++ b/writerfilter/source/dmapper/DomainMapper_Impl.cxx
@@ -1393,7 +1393,7 @@ static sal_Int32 lcl_getListId(const StyleSheetEntryPtr& rEntry, const StyleShee
return lcl_getListId(pParent, rStyleTable, rNumberingFromBaseStyle);
}
-void DomainMapper_Impl::finishParagraph( const PropertyMapPtr& pPropertyMap, const bool bRemove )
+void DomainMapper_Impl::finishParagraph( const PropertyMapPtr& pPropertyMap, const bool bRemove, const bool bNoNumbering )
{
if (m_bDiscardHeaderFooter)
return;
@@ -1448,7 +1448,7 @@ void DomainMapper_Impl::finishParagraph( const PropertyMapPtr& pPropertyMap, con
//apply numbering level/style to paragraph if it was set at the style, but only if the paragraph itself
//does not specify the numbering
const sal_Int16 nListLevel = pStyleSheetProperties->GetListLevel();
- if ( !isNumberingViaRule && nListLevel >= 0 )
+ if ( !bNoNumbering && !isNumberingViaRule && nListLevel >= 0 )
pParaContext->Insert( PROP_NUMBERING_LEVEL, uno::makeAny(nListLevel), false );
bool bNumberingFromBaseStyle = false;
@@ -1456,7 +1456,9 @@ void DomainMapper_Impl::finishParagraph( const PropertyMapPtr& pPropertyMap, con
auto const pList(GetListTable()->GetList(nListId));
if (pList && nListId >= 0 && !pParaContext->isSet(PROP_NUMBERING_STYLE_NAME))
{
- if ( !isNumberingViaRule )
+ if ( bNoNumbering )
+ pParaContext->Insert( PROP_NUMBERING_STYLE_NAME, uno::makeAny(OUString()) );
+ else if ( !isNumberingViaRule )
{
isNumberingViaStyle = true;
// Since LO7.0/tdf#131321 fixed the loss of numbering in styles, this OUGHT to be obsolete,
diff --git a/writerfilter/source/dmapper/DomainMapper_Impl.hxx b/writerfilter/source/dmapper/DomainMapper_Impl.hxx
index e3501da2d342..b6c1cc1a8a7f 100644
--- a/writerfilter/source/dmapper/DomainMapper_Impl.hxx
+++ b/writerfilter/source/dmapper/DomainMapper_Impl.hxx
@@ -681,7 +681,7 @@ public:
void setParaSdtEndDeferred(bool bParaSdtEndDeferred);
bool isParaSdtEndDeferred() const;
- void finishParagraph( const PropertyMapPtr& pPropertyMap, const bool bRemove = false);
+ void finishParagraph( const PropertyMapPtr& pPropertyMap, const bool bRemove = false, const bool bNoNumbering = false);
void appendTextPortion( const OUString& rString, const PropertyMapPtr& pPropertyMap );
void appendTextContent(const css::uno::Reference<css::text::XTextContent>&, const css::uno::Sequence<css::beans::PropertyValue>&);
void appendOLE( const OUString& rStreamName, const std::shared_ptr<OLEHandler>& pOleHandler );