summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--writerfilter/source/dmapper/DomainMapper.cxx9
-rw-r--r--writerfilter/source/dmapper/DomainMapper_Impl.cxx11
-rw-r--r--writerfilter/source/dmapper/DomainMapper_Impl.hxx6
-rw-r--r--writerfilter/source/dmapper/PropertyIds.cxx1
-rw-r--r--writerfilter/source/dmapper/PropertyIds.hxx1
5 files changed, 26 insertions, 2 deletions
diff --git a/writerfilter/source/dmapper/DomainMapper.cxx b/writerfilter/source/dmapper/DomainMapper.cxx
index b305afdd7af4..37af96b094b5 100644
--- a/writerfilter/source/dmapper/DomainMapper.cxx
+++ b/writerfilter/source/dmapper/DomainMapper.cxx
@@ -932,7 +932,10 @@ void DomainMapper::lcl_attribute(Id nName, Value & val)
// It's not possible to insert the relevant property to the character context here:
// the previous, already sent character context may be still active, so the property would be lost.
- m_pImpl->setSdtEndDeferred(true);
+ if (m_pImpl->m_pSdtHelper->isOutsideAParagraph())
+ m_pImpl->setParaSdtEndDeferred(true);
+ else
+ m_pImpl->setSdtEndDeferred(true);
if (!m_pImpl->m_pSdtHelper->getDropDownItems().empty())
m_pImpl->m_pSdtHelper->createDropDownControl();
@@ -2607,10 +2610,14 @@ void DomainMapper::lcl_startParagraphGroup()
m_pImpl->GetTopContext()->Insert( PROP_BREAK_TYPE, uno::makeAny( com::sun::star::style::BreakType_PAGE_BEFORE) );
else if (m_pImpl->isBreakDeferred(COLUMN_BREAK))
m_pImpl->GetTopContext()->Insert( PROP_BREAK_TYPE, uno::makeAny( com::sun::star::style::BreakType_COLUMN_BEFORE) );
+
+ if (m_pImpl->isParaSdtEndDeferred())
+ m_pImpl->GetTopContext()->Insert(PROP_PARA_SDT_END_BEFORE, uno::makeAny(true), true, PARA_GRAB_BAG);
}
m_pImpl->SetIsFirstRun(true);
m_pImpl->SetIsOutsideAParagraph(false);
m_pImpl->clearDeferredBreaks();
+ m_pImpl->setParaSdtEndDeferred(false);
}
void DomainMapper::lcl_endParagraphGroup()
diff --git a/writerfilter/source/dmapper/DomainMapper_Impl.cxx b/writerfilter/source/dmapper/DomainMapper_Impl.cxx
index dad72fa496e0..2f5b441c77a9 100644
--- a/writerfilter/source/dmapper/DomainMapper_Impl.cxx
+++ b/writerfilter/source/dmapper/DomainMapper_Impl.cxx
@@ -165,6 +165,7 @@ DomainMapper_Impl::DomainMapper_Impl(
m_bIsColumnBreakDeferred( false ),
m_bIsPageBreakDeferred( false ),
m_bSdtEndDeferred(false),
+ m_bParaSdtEndDeferred(false),
m_bStartTOC(false),
m_bStartTOCHeaderFooter(false),
m_bStartedTOC(false),
@@ -721,6 +722,16 @@ bool DomainMapper_Impl::isSdtEndDeferred()
return m_bSdtEndDeferred;
}
+void DomainMapper_Impl::setParaSdtEndDeferred(bool bParaSdtEndDeferred)
+{
+ m_bParaSdtEndDeferred = bParaSdtEndDeferred;
+}
+
+bool DomainMapper_Impl::isParaSdtEndDeferred()
+{
+ return m_bParaSdtEndDeferred;
+}
+
void lcl_MoveBorderPropertiesToFrame(comphelper::SequenceAsHashMap& rFrameProperties,
uno::Reference<text::XTextRange> const& xStartTextRange,
uno::Reference<text::XTextRange> const& xEndTextRange )
diff --git a/writerfilter/source/dmapper/DomainMapper_Impl.hxx b/writerfilter/source/dmapper/DomainMapper_Impl.hxx
index 21c66afd0f63..e0d825967b17 100644
--- a/writerfilter/source/dmapper/DomainMapper_Impl.hxx
+++ b/writerfilter/source/dmapper/DomainMapper_Impl.hxx
@@ -331,8 +331,10 @@ private:
bool m_bIsFirstSection;
bool m_bIsColumnBreakDeferred;
bool m_bIsPageBreakDeferred;
- /// If we want to set "sdt end" on the next character contet.
+ /// If we want to set "sdt end" on the next character context.
bool m_bSdtEndDeferred;
+ /// If we want to set "paragraph sdt end" on the next paragraph context.
+ bool m_bParaSdtEndDeferred;
bool m_bStartTOC;
bool m_bStartTOCHeaderFooter;
/// If we got any text that is the pre-rendered result of the TOC field.
@@ -505,6 +507,8 @@ public:
void setSdtEndDeferred(bool bSdtEndDeferred);
bool isSdtEndDeferred();
+ void setParaSdtEndDeferred(bool bParaSdtEndDeferred);
+ bool isParaSdtEndDeferred();
void finishParagraph( PropertyMapPtr pPropertyMap );
void appendTextPortion( const OUString& rString, PropertyMapPtr pPropertyMap );
diff --git a/writerfilter/source/dmapper/PropertyIds.cxx b/writerfilter/source/dmapper/PropertyIds.cxx
index 8c1e42b68e29..496ea9d5dd85 100644
--- a/writerfilter/source/dmapper/PropertyIds.cxx
+++ b/writerfilter/source/dmapper/PropertyIds.cxx
@@ -394,6 +394,7 @@ OUString PropertyNameSupplier::GetName( PropertyIds eId ) const
case PROP_APPLY_PARAGRAPH_MARK_FORMAT_TO_NUMBERING : sName = "ApplyParagraphMarkFormatToNumbering"; break;
case PROP_CELL_DIRECTION: sName = "CellDirection"; break;
case PROP_SDT_END_BEFORE: sName = "SdtEndBefore"; break;
+ case PROP_PARA_SDT_END_BEFORE: sName = "ParaSdtEndBefore"; break;
}
::std::pair<PropertyNameMap_t::iterator,bool> aInsertIt =
m_pImpl->aNameMap.insert( PropertyNameMap_t::value_type( eId, sName ));
diff --git a/writerfilter/source/dmapper/PropertyIds.hxx b/writerfilter/source/dmapper/PropertyIds.hxx
index 635df35579af..e7cb0e0c4cd6 100644
--- a/writerfilter/source/dmapper/PropertyIds.hxx
+++ b/writerfilter/source/dmapper/PropertyIds.hxx
@@ -366,6 +366,7 @@ enum PropertyIds
,PROP_APPLY_PARAGRAPH_MARK_FORMAT_TO_NUMBERING
,PROP_CELL_DIRECTION
,PROP_SDT_END_BEFORE
+ ,PROP_PARA_SDT_END_BEFORE
};
struct PropertyNameSupplier_Impl;
class PropertyNameSupplier