summaryrefslogtreecommitdiff
path: root/writerfilter/source/dmapper/DomainMapper_Impl.cxx
diff options
context:
space:
mode:
authorMichael Stahl <michael.stahl@allotropia.de>2024-01-31 15:37:03 +0100
committerMichael Stahl <michael.stahl@allotropia.de>2024-02-01 09:34:55 +0100
commit992f7114ab8645fb5b7a22b5f974a95fe7be7712 (patch)
treea792f70467ddf568af28fcdd368634b8291ced4d /writerfilter/source/dmapper/DomainMapper_Impl.cxx
parent30323c813977eb0127251848fecd2532dce75749 (diff)
writerfilter: replace members w/ SubstreamContext::eSubstreamType
This should not change any behaviour. Change-Id: Ic970f0e1b6401119d875c9e811589b9c210e0c34 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/162842 Tested-by: Jenkins Reviewed-by: Michael Stahl <michael.stahl@allotropia.de>
Diffstat (limited to 'writerfilter/source/dmapper/DomainMapper_Impl.cxx')
-rw-r--r--writerfilter/source/dmapper/DomainMapper_Impl.cxx32
1 files changed, 14 insertions, 18 deletions
diff --git a/writerfilter/source/dmapper/DomainMapper_Impl.cxx b/writerfilter/source/dmapper/DomainMapper_Impl.cxx
index 08e81899b94f..633296ce69e1 100644
--- a/writerfilter/source/dmapper/DomainMapper_Impl.cxx
+++ b/writerfilter/source/dmapper/DomainMapper_Impl.cxx
@@ -356,10 +356,7 @@ DomainMapper_Impl::DomainMapper_Impl(
m_bInStyleSheetImport( false ),
m_bInNumberingImport(false),
m_bInAnyTableImport( false ),
- m_eInHeaderFooterImport( HeaderFooterImportState::none ),
m_bDiscardHeaderFooter( false ),
- m_bInFootOrEndnote(false),
- m_bInFootnote(false),
m_bHasFootnoteStyle(false),
m_bCheckFootnoteStyle(false),
m_eSkipFootnoteState(SkipFootnoteSeparator::OFF),
@@ -380,7 +377,6 @@ DomainMapper_Impl::DomainMapper_Impl(
m_bIsPreviousParagraphFramed( false ),
m_bIsLastParaInSection( false ),
m_bIsLastSectionGroup( false ),
- m_bIsInComments( false ),
m_bParaSectpr( false ),
m_bUsingEnhancedFields( false ),
m_bSdt(false),
@@ -959,7 +955,7 @@ bool DomainMapper_Impl::GetIsFirstParagraphInSection( bool bAfterRedline ) const
// and none of them should be considered the first para in section.
return ( bAfterRedline ? m_bIsFirstParaInSectionAfterRedline : m_bIsFirstParaInSection )
&& !IsInShape()
- && !m_bIsInComments
+ && !IsInComments()
&& !IsInFootOrEndnote();
}
@@ -2611,7 +2607,7 @@ void DomainMapper_Impl::finishParagraph( const PropertyMapPtr& pPropertyMap, con
{
uno::Reference<text::XTextCursor> xCursor;
if (m_StreamStateStack.top().bParaHadField
- && !m_bIsInComments && !m_xTOCMarkerCursor.is())
+ && !IsInComments() && !m_xTOCMarkerCursor.is())
{
// Workaround to make sure char props of the field are not lost.
// Not relevant for editeng-based comments.
@@ -2840,7 +2836,7 @@ void DomainMapper_Impl::finishParagraph( const PropertyMapPtr& pPropertyMap, con
css::uno::Reference<css::beans::XPropertySet> xParaProps(xTextRange, uno::UNO_QUERY);
// table style precedence and not hidden shapes anchored to hidden empty table paragraphs
- if (xParaProps && !m_bIsInComments
+ if (xParaProps && !IsInComments()
&& (0 < m_StreamStateStack.top().nTableDepth
|| !m_aAnchoredObjectAnchors.empty()))
{
@@ -2992,7 +2988,7 @@ void DomainMapper_Impl::finishParagraph( const PropertyMapPtr& pPropertyMap, con
m_previousRedline.clear();
m_bParaChanged = false;
- if (m_bIsInComments && pParaContext)
+ if (IsInComments() && pParaContext)
{
if (const OUString sParaId = pParaContext->props().GetParaId(); !sParaId.isEmpty())
{
@@ -3021,7 +3017,7 @@ void DomainMapper_Impl::finishParagraph( const PropertyMapPtr& pPropertyMap, con
// and in text boxes anchored to the first paragraph of table cells
if (0 < m_StreamStateStack.top().nTableDepth
&& m_StreamStateStack.top().nTableDepth == m_nTableCellDepth
- && !IsInShape() && !m_bIsInComments)
+ && !IsInShape() && !IsInComments())
{
m_StreamStateStack.top().bFirstParagraphInCell = false;
}
@@ -3195,7 +3191,7 @@ void DomainMapper_Impl::applyToggleAttributes(const PropertyMapPtr& pPropertyMap
{
applyToggleAttributes(pPropertyMap);
// If we are in comments, then disable CharGrabBag, comment text doesn't support that.
- uno::Sequence< beans::PropertyValue > aValues = pPropertyMap->GetPropertyValues(/*bCharGrabBag=*/!m_bIsInComments);
+ uno::Sequence<beans::PropertyValue> aValues = pPropertyMap->GetPropertyValues(/*bCharGrabBag=*/!IsInComments());
if (IsInTOC() || m_bStartIndex || m_bStartBibliography)
for( auto& rValue : asNonConstRange(aValues) )
@@ -3796,7 +3792,7 @@ void DomainMapper_Impl::PushPageHeaderFooter(PagePartType ePagePartType, PageTyp
const PropertyIds ePropTextRight = bHeader ? PROP_HEADER_TEXT: PROP_FOOTER_TEXT;
m_bDiscardHeaderFooter = true;
- m_eInHeaderFooterImport = bHeader ? HeaderFooterImportState::header : HeaderFooterImportState::footer;
+ m_StreamStateStack.top().eSubstreamType = bHeader ? SubstreamType::Header : SubstreamType::Footer;
//get the section context
SectionPropertyMap* pSectionContext = GetSectionContext();;
@@ -3945,14 +3941,12 @@ void DomainMapper_Impl::PopPageHeaderFooter(PagePartType ePagePartType, PageType
}
m_bDiscardHeaderFooter = false;
}
- m_eInHeaderFooterImport = HeaderFooterImportState::none;
}
void DomainMapper_Impl::PushFootOrEndnote( bool bIsFootnote )
{
- SAL_WARN_IF(m_bInFootOrEndnote, "writerfilter.dmapper", "PushFootOrEndnote() is called from another foot or endnote");
- m_bInFootOrEndnote = true;
- m_bInFootnote = bIsFootnote;
+ SAL_WARN_IF(m_StreamStateStack.top().eSubstreamType != SubstreamType::Body, "writerfilter.dmapper", "PushFootOrEndnote() is called from another foot or endnote");
+ m_StreamStateStack.top().eSubstreamType = bIsFootnote ? SubstreamType::Footnote : SubstreamType::Endnote;
m_bCheckFirstFootnoteTab = true;
try
{
@@ -4218,7 +4212,7 @@ void DomainMapper_Impl::PushAnnotation()
{
try
{
- m_bIsInComments = true;
+ m_StreamStateStack.top().eSubstreamType = SubstreamType::Annotation;
if (!GetTextFactory().is())
return;
m_xAnnotationField.set( GetTextFactory()->createInstance( "com.sun.star.text.TextField.Annotation" ),
@@ -4480,7 +4474,6 @@ void DomainMapper_Impl::PopFootOrEndnote()
}
m_aRedlines.pop();
m_eSkipFootnoteState = SkipFootnoteSeparator::OFF;
- m_bInFootOrEndnote = m_bInFootnote = false;
m_pFootnoteContext = nullptr;
}
@@ -4488,7 +4481,6 @@ void DomainMapper_Impl::PopAnnotation()
{
RemoveLastParagraph();
- m_bIsInComments = false;
m_aTextAppendStack.pop();
try
@@ -9779,8 +9771,12 @@ void DomainMapper_Impl::substream(Id rName,
case NS_ooxml::LN_annotation :
PushAnnotation();
break;
+ default:
+ assert(false); // unexpected?
}
+ assert(m_StreamStateStack.top().eSubstreamType != SubstreamType::Body);
+
try
{
ref->resolve(m_rDMapper);