summaryrefslogtreecommitdiff
path: root/writerfilter/source/dmapper/DomainMapper_Impl.cxx
diff options
context:
space:
mode:
authorMichael Stahl <michael.stahl@allotropia.de>2024-01-31 15:03:32 +0100
committerMichael Stahl <michael.stahl@allotropia.de>2024-02-01 09:34:44 +0100
commit30323c813977eb0127251848fecd2532dce75749 (patch)
tree87e5ae939434b8703aaca114c64db24aa2121a2f /writerfilter/source/dmapper/DomainMapper_Impl.cxx
parent95b01848b18283fd2f903c982108ccdb8efee022 (diff)
writerfilter: move m_bFirstParagraphInCell to SubstreamContext
This is a change to set it for all substreams. Change-Id: I44ed9a5485000f40f8ccfe3ec885ef8f05f5aab2 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/162841 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.cxx20
1 files changed, 10 insertions, 10 deletions
diff --git a/writerfilter/source/dmapper/DomainMapper_Impl.cxx b/writerfilter/source/dmapper/DomainMapper_Impl.cxx
index be38c93cd628..08e81899b94f 100644
--- a/writerfilter/source/dmapper/DomainMapper_Impl.cxx
+++ b/writerfilter/source/dmapper/DomainMapper_Impl.cxx
@@ -402,8 +402,6 @@ DomainMapper_Impl::DomainMapper_Impl(
m_bIsSplitPara(false),
m_bIsActualParagraphFramed( false ),
m_bParaAutoBefore(false),
- m_bFirstParagraphInCell(true),
- m_bSaveFirstParagraphInCell(false),
m_bParaWithInlineObject(false),
m_bSaxError(false)
{
@@ -2357,7 +2355,7 @@ void DomainMapper_Impl::finishParagraph( const PropertyMapPtr& pPropertyMap, con
{
if ( GetIsFirstParagraphInShape() ||
(GetIsFirstParagraphInSection() && GetSectionContext() && GetSectionContext()->IsFirstSection()) ||
- (m_bFirstParagraphInCell
+ (m_StreamStateStack.top().bFirstParagraphInCell
&& 0 < m_StreamStateStack.top().nTableDepth
&& m_StreamStateStack.top().nTableDepth == m_nTableCellDepth))
{
@@ -2655,9 +2653,10 @@ void DomainMapper_Impl::finishParagraph( const PropertyMapPtr& pPropertyMap, con
TOOLS_WARN_EXCEPTION("writerfilter", "DomainMapper_Impl::finishParagraph NumberingRules");
}
}
- else if ( m_xPreviousParagraph->getPropertySetInfo()->hasPropertyByName("NumberingStyleName") &&
+ else if (m_xPreviousParagraph->getPropertySetInfo()->hasPropertyByName("NumberingStyleName")
// don't update before tables
- (m_StreamStateStack.top().nTableDepth == 0 || !m_bFirstParagraphInCell))
+ && (m_StreamStateStack.top().nTableDepth == 0
+ || !m_StreamStateStack.top().bFirstParagraphInCell))
{
aCurrentNumberingName = GetListStyleName(nListId);
m_xPreviousParagraph->getPropertyValue("NumberingStyleName") >>= aPreviousNumberingName;
@@ -3024,7 +3023,7 @@ void DomainMapper_Impl::finishParagraph( const PropertyMapPtr& pPropertyMap, con
&& m_StreamStateStack.top().nTableDepth == m_nTableCellDepth
&& !IsInShape() && !m_bIsInComments)
{
- m_bFirstParagraphInCell = false;
+ m_StreamStateStack.top().bFirstParagraphInCell = false;
}
m_bParaAutoBefore = false;
@@ -3955,7 +3954,6 @@ void DomainMapper_Impl::PushFootOrEndnote( bool bIsFootnote )
m_bInFootOrEndnote = true;
m_bInFootnote = bIsFootnote;
m_bCheckFirstFootnoteTab = true;
- m_bSaveFirstParagraphInCell = m_bFirstParagraphInCell;
try
{
// Redlines outside the footnote should not affect footnote content
@@ -4484,7 +4482,6 @@ void DomainMapper_Impl::PopFootOrEndnote()
m_eSkipFootnoteState = SkipFootnoteSeparator::OFF;
m_bInFootOrEndnote = m_bInFootnote = false;
m_pFootnoteContext = nullptr;
- m_bFirstParagraphInCell = m_bSaveFirstParagraphInCell;
}
void DomainMapper_Impl::PopAnnotation()
@@ -4973,7 +4970,7 @@ void DomainMapper_Impl::ClearPreviousParagraph()
m_xPreviousParagraph.clear();
// next table paragraph will be first paragraph in a cell
- m_bFirstParagraphInCell = true;
+ m_StreamStateStack.top().bFirstParagraphInCell = true;
}
void DomainMapper_Impl::HandleAltChunk(const OUString& rStreamName)
@@ -8900,8 +8897,11 @@ void DomainMapper_Impl::StartOrEndBookmark( const OUString& rId )
// keep bookmark range, if it doesn't exceed cell boundary
uno::Reference< text::XTextRange > xStart = xCursor->getStart();
xCursor->goLeft( 1, false );
- if (m_StreamStateStack.top().nTableDepth == 0 || !m_bFirstParagraphInCell)
+ if (m_StreamStateStack.top().nTableDepth == 0
+ || !m_StreamStateStack.top().bFirstParagraphInCell)
+ {
xCursor->gotoRange(xStart, true );
+ }
}
uno::Reference< container::XNamed > xBkmNamed( xBookmark, uno::UNO_QUERY_THROW );
SAL_WARN_IF(aBookmarkIter->second.m_sBookmarkName.isEmpty(), "writerfilter.dmapper", "anonymous bookmark");