diff options
Diffstat (limited to 'writerfilter/source/dmapper/DomainMapper_Impl.cxx')
-rw-r--r-- | writerfilter/source/dmapper/DomainMapper_Impl.cxx | 20 |
1 files changed, 7 insertions, 13 deletions
diff --git a/writerfilter/source/dmapper/DomainMapper_Impl.cxx b/writerfilter/source/dmapper/DomainMapper_Impl.cxx index b62f83c9b8c6..10f587bb750c 100644 --- a/writerfilter/source/dmapper/DomainMapper_Impl.cxx +++ b/writerfilter/source/dmapper/DomainMapper_Impl.cxx @@ -1799,26 +1799,20 @@ void DomainMapper_Impl::finishParagraph( const PropertyMapPtr& pPropertyMap, con } // fix table paragraph properties - if ( xParaProps && m_nTableDepth > 0 ) + if ( xTextRange.is() && xParaProps && m_nTableDepth > 0 ) { uno::Sequence< beans::PropertyValue > aParaProps = pParaContext->GetPropertyValues(false); - + uno::Reference<text::XTextCursor> xCur = xTextRange->getText()->createTextCursorByRange(xTextRange); + uno::Reference< beans::XPropertyState > xRunProperties( xCur, uno::UNO_QUERY_THROW ); // tdf#90069 in tables, apply paragraph level character style also on // paragraph level to support its copy during insertion of new table rows for( const auto& rParaProp : std::as_const(aParaProps) ) { - if ( m_pLastCharacterContext.get() && rParaProp.Name.startsWith("Char") && rParaProp.Name != "CharStyleName" && rParaProp.Name != "CharInteropGrabBag" ) + if ( rParaProp.Name.startsWith("Char") && rParaProp.Name != "CharStyleName" && rParaProp.Name != "CharInteropGrabBag" && + // all text portions contain the same value, so next setPropertyValue() won't overwrite part of them + xRunProperties->getPropertyState(rParaProp.Name) == css::beans::PropertyState_DIRECT_VALUE ) { - const uno::Sequence< beans::PropertyValue > aLastCharProps = m_pLastCharacterContext->GetPropertyValues( ); - - for( const auto& rLastCharProp : std::as_const(aLastCharProps) ) - { - if ( rLastCharProp == rParaProp ) - { - xParaProps->setPropertyValue( rParaProp.Name, rParaProp.Value ); - break; - } - } + xParaProps->setPropertyValue( rParaProp.Name, rParaProp.Value ); } } |