summaryrefslogtreecommitdiff
path: root/writerfilter/source/dmapper/DomainMapper.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'writerfilter/source/dmapper/DomainMapper.cxx')
-rw-r--r--writerfilter/source/dmapper/DomainMapper.cxx84
1 files changed, 42 insertions, 42 deletions
diff --git a/writerfilter/source/dmapper/DomainMapper.cxx b/writerfilter/source/dmapper/DomainMapper.cxx
index adb2f8359662..cf515ae72669 100644
--- a/writerfilter/source/dmapper/DomainMapper.cxx
+++ b/writerfilter/source/dmapper/DomainMapper.cxx
@@ -2979,37 +2979,37 @@ void DomainMapper::lcl_startSectionGroup()
void DomainMapper::lcl_endSectionGroup()
{
- if (!m_pImpl->isInIndexContext() && !m_pImpl->isInBibliographyContext())
+ if (m_pImpl->isInIndexContext() || m_pImpl->isInBibliographyContext())
+ return;
+
+ m_pImpl->CheckUnregisteredFrameConversion();
+ m_pImpl->ExecuteFrameConversion();
+ // When pasting, it's fine to not have any paragraph inside the document at all.
+ if (m_pImpl->GetIsFirstParagraphInSection() && m_pImpl->IsNewDoc())
{
- m_pImpl->CheckUnregisteredFrameConversion();
- m_pImpl->ExecuteFrameConversion();
- // When pasting, it's fine to not have any paragraph inside the document at all.
- if (m_pImpl->GetIsFirstParagraphInSection() && m_pImpl->IsNewDoc())
- {
- // This section has no paragraph at all (e.g. they are all actually in a frame).
- // If this section has a page break, there would be nothing to apply to the page
- // style, so force a dummy paragraph.
- lcl_startParagraphGroup();
- lcl_startCharacterGroup();
- sal_uInt8 const sBreak[] = { 0xd };
- lcl_text(sBreak, 1);
- lcl_endCharacterGroup();
- lcl_endParagraphGroup();
- }
- PropertyMapPtr pContext = m_pImpl->GetTopContextOfType(CONTEXT_SECTION);
- SectionPropertyMap* pSectionContext = dynamic_cast< SectionPropertyMap* >( pContext.get() );
- OSL_ENSURE(pSectionContext, "SectionContext unavailable!");
- if(pSectionContext)
- {
- pSectionContext->CloseSectionGroup( *m_pImpl );
- // Remove the dummy paragraph if added for
- // handling the section properties if section starts with a table
- if (m_pImpl->GetIsDummyParaAddedForTableInSection())
- m_pImpl->RemoveDummyParaForTableInSection();
- }
- m_pImpl->SetIsTextFrameInserted( false );
- m_pImpl->PopProperties(CONTEXT_SECTION);
+ // This section has no paragraph at all (e.g. they are all actually in a frame).
+ // If this section has a page break, there would be nothing to apply to the page
+ // style, so force a dummy paragraph.
+ lcl_startParagraphGroup();
+ lcl_startCharacterGroup();
+ sal_uInt8 const sBreak[] = { 0xd };
+ lcl_text(sBreak, 1);
+ lcl_endCharacterGroup();
+ lcl_endParagraphGroup();
}
+ PropertyMapPtr pContext = m_pImpl->GetTopContextOfType(CONTEXT_SECTION);
+ SectionPropertyMap* pSectionContext = dynamic_cast< SectionPropertyMap* >( pContext.get() );
+ OSL_ENSURE(pSectionContext, "SectionContext unavailable!");
+ if(pSectionContext)
+ {
+ pSectionContext->CloseSectionGroup( *m_pImpl );
+ // Remove the dummy paragraph if added for
+ // handling the section properties if section starts with a table
+ if (m_pImpl->GetIsDummyParaAddedForTableInSection())
+ m_pImpl->RemoveDummyParaForTableInSection();
+ }
+ m_pImpl->SetIsTextFrameInserted( false );
+ m_pImpl->PopProperties(CONTEXT_SECTION);
}
void DomainMapper::lcl_startParagraphGroup()
@@ -3104,20 +3104,20 @@ void DomainMapper::lcl_startShape(uno::Reference<drawing::XShape> const& xShape)
void DomainMapper::lcl_endShape( )
{
- if (m_pImpl->GetTopContext())
- {
- // End the current table, if there are any. Otherwise the unavoidable
- // empty paragraph at the end of the shape text will cause problems: if
- // the shape text ends with a table, the extra paragraph will be
- // handled as an additional row of the ending table.
- if (m_pImpl->hasTableManager())
- m_pImpl->getTableManager().endTable();
+ if (!m_pImpl->GetTopContext())
+ return;
- lcl_endParagraphGroup();
- m_pImpl->PopShapeContext( );
- // A shape is always inside a paragraph (anchored or inline).
- m_pImpl->SetIsOutsideAParagraph(false);
- }
+ // End the current table, if there are any. Otherwise the unavoidable
+ // empty paragraph at the end of the shape text will cause problems: if
+ // the shape text ends with a table, the extra paragraph will be
+ // handled as an additional row of the ending table.
+ if (m_pImpl->hasTableManager())
+ m_pImpl->getTableManager().endTable();
+
+ lcl_endParagraphGroup();
+ m_pImpl->PopShapeContext( );
+ // A shape is always inside a paragraph (anchored or inline).
+ m_pImpl->SetIsOutsideAParagraph(false);
}
void DomainMapper::PushStyleSheetProperties( const PropertyMapPtr& pStyleProperties, bool bAffectTableMngr )