diff options
-rw-r--r-- | writerfilter/source/dmapper/DomainMapper.cxx | 10 | ||||
-rw-r--r-- | writerfilter/source/dmapper/DomainMapper_Impl.cxx | 10 | ||||
-rw-r--r-- | writerfilter/source/dmapper/DomainMapper_Impl.hxx | 6 | ||||
-rw-r--r-- | writerfilter/source/dmapper/PropertyIds.cxx | 1 | ||||
-rw-r--r-- | writerfilter/source/dmapper/PropertyIds.hxx | 1 |
5 files changed, 28 insertions, 0 deletions
diff --git a/writerfilter/source/dmapper/DomainMapper.cxx b/writerfilter/source/dmapper/DomainMapper.cxx index 98e14d7ee717..f6a91fbf8758 100644 --- a/writerfilter/source/dmapper/DomainMapper.cxx +++ b/writerfilter/source/dmapper/DomainMapper.cxx @@ -902,6 +902,11 @@ void DomainMapper::lcl_attribute(Id nName, Value & val) break; case NS_ooxml::LN_CT_SdtBlock_sdtEndContent: m_pImpl->SetSdt(false); + + // 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->getDropDownItems().empty()) m_pImpl->m_pSdtHelper->createDropDownControl(); break; @@ -2653,6 +2658,11 @@ void DomainMapper::lcl_startCharacterGroup() if (m_pImpl->m_bFrameBtLr) // No support for this in core, work around by char rotation, as we do so for table cells already. m_pImpl->GetTopContext()->Insert(PROP_CHAR_ROTATION, uno::makeAny(sal_Int16(900))); + if (m_pImpl->isSdtEndDeferred()) + { + m_pImpl->GetTopContext()->Insert(PROP_SDT_END_BEFORE, uno::makeAny(true), true, CHAR_GRAB_BAG); + m_pImpl->setSdtEndDeferred(false); + } } void DomainMapper::lcl_endCharacterGroup() diff --git a/writerfilter/source/dmapper/DomainMapper_Impl.cxx b/writerfilter/source/dmapper/DomainMapper_Impl.cxx index 9457568a6f8d..edd30e548b08 100644 --- a/writerfilter/source/dmapper/DomainMapper_Impl.cxx +++ b/writerfilter/source/dmapper/DomainMapper_Impl.cxx @@ -160,6 +160,7 @@ DomainMapper_Impl::DomainMapper_Impl( m_bIsFirstSection( true ), m_bIsColumnBreakDeferred( false ), m_bIsPageBreakDeferred( false ), + m_bSdtEndDeferred(false), m_bStartTOC(false), m_bStartTOCHeaderFooter(false), m_bStartedTOC(false), @@ -706,6 +707,15 @@ void DomainMapper_Impl::clearDeferredBreaks() m_bIsPageBreakDeferred = false; } +void DomainMapper_Impl::setSdtEndDeferred(bool bSdtEndDeferred) +{ + m_bSdtEndDeferred = bSdtEndDeferred; +} + +bool DomainMapper_Impl::isSdtEndDeferred() +{ + return m_bSdtEndDeferred; +} void lcl_MoveBorderPropertiesToFrame(comphelper::SequenceAsHashMap& rFrameProperties, uno::Reference<text::XTextRange> xStartTextRange, diff --git a/writerfilter/source/dmapper/DomainMapper_Impl.hxx b/writerfilter/source/dmapper/DomainMapper_Impl.hxx index 778d7b0a7804..43bedc8c1efc 100644 --- a/writerfilter/source/dmapper/DomainMapper_Impl.hxx +++ b/writerfilter/source/dmapper/DomainMapper_Impl.hxx @@ -319,6 +319,8 @@ private: bool m_bIsFirstSection; bool m_bIsColumnBreakDeferred; bool m_bIsPageBreakDeferred; + /// If we want to set "sdt end" on the next character contet. + bool m_bSdtEndDeferred; bool m_bStartTOC; bool m_bStartTOCHeaderFooter; /// If we got any text that is the pre-rendered result of the TOC field. @@ -489,6 +491,10 @@ public: bool isBreakDeferred( BreakType deferredBreakType ); void clearDeferredBreaks(); void clearDeferredBreak(BreakType deferredBreakType); + + void setSdtEndDeferred(bool bSdtEndDeferred); + bool isSdtEndDeferred(); + void finishParagraph( PropertyMapPtr pPropertyMap ); void appendTextPortion( const OUString& rString, PropertyMapPtr pPropertyMap ); void appendTextContent( const ::com::sun::star::uno::Reference< ::com::sun::star::text::XTextContent >, diff --git a/writerfilter/source/dmapper/PropertyIds.cxx b/writerfilter/source/dmapper/PropertyIds.cxx index e5b9918adfb1..8c1e42b68e29 100644 --- a/writerfilter/source/dmapper/PropertyIds.cxx +++ b/writerfilter/source/dmapper/PropertyIds.cxx @@ -393,6 +393,7 @@ OUString PropertyNameSupplier::GetName( PropertyIds eId ) const case PROP_TABLE_INTEROP_GRAB_BAG : sName = "TableInteropGrabBag"; break; 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; } ::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 f1543befba4f..635df35579af 100644 --- a/writerfilter/source/dmapper/PropertyIds.hxx +++ b/writerfilter/source/dmapper/PropertyIds.hxx @@ -365,6 +365,7 @@ enum PropertyIds ,PROP_INDEX_ENTRY_TYPE ,PROP_APPLY_PARAGRAPH_MARK_FORMAT_TO_NUMBERING ,PROP_CELL_DIRECTION + ,PROP_SDT_END_BEFORE }; struct PropertyNameSupplier_Impl; class PropertyNameSupplier |