summaryrefslogtreecommitdiff
path: root/writerfilter/source/dmapper
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:04:18 +0100
commitbfcd952dc7820c4cf8761c4222d29ede039391dc (patch)
treef58cfdecbf29ad46c8ad8af9be027e8319c5a94a /writerfilter/source/dmapper
parent59301a1cadd87a63276650975252d14e8477e632 (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>
Diffstat (limited to 'writerfilter/source/dmapper')
-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 aff86268b215..c3d246523a12 100644
--- a/writerfilter/source/dmapper/DomainMapper.cxx
+++ b/writerfilter/source/dmapper/DomainMapper.cxx
@@ -3580,7 +3580,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();
}
@@ -4067,11 +4067,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 8b030cf860f4..dfd398cbda37 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 4b08d13e9649..0a2b5cbd5e85 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 );