diff options
-rw-r--r-- | oox/source/token/tokens.txt | 1 | ||||
-rw-r--r-- | writerfilter/source/dmapper/DomainMapper.cxx | 28 | ||||
-rw-r--r-- | writerfilter/source/dmapper/DomainMapper_Impl.cxx | 6 | ||||
-rw-r--r-- | writerfilter/source/dmapper/PropertyIds.cxx | 1 | ||||
-rw-r--r-- | writerfilter/source/dmapper/PropertyIds.hxx | 1 |
5 files changed, 36 insertions, 1 deletions
diff --git a/oox/source/token/tokens.txt b/oox/source/token/tokens.txt index fbdd2fca8192..ca7f69e569ba 100644 --- a/oox/source/token/tokens.txt +++ b/oox/source/token/tokens.txt @@ -280,6 +280,7 @@ Override Page Pages ParagraphAlign +ParagraphFormat Paragraphs PartName PasswordChar diff --git a/writerfilter/source/dmapper/DomainMapper.cxx b/writerfilter/source/dmapper/DomainMapper.cxx index ff90bc55927d..5b38153e22c9 100644 --- a/writerfilter/source/dmapper/DomainMapper.cxx +++ b/writerfilter/source/dmapper/DomainMapper.cxx @@ -3454,10 +3454,17 @@ void DomainMapper::sprmWithProps( Sprm& rSprm, PropertyMapPtr rContext, SprmType break; case NS_ooxml::LN_paratrackchange: m_pImpl->StartParaMarkerChange( ); + case NS_ooxml::LN_CT_PPr_pPrChange: case NS_ooxml::LN_trackchange: case NS_ooxml::LN_EG_RPrContent_rPrChange: { m_pImpl->AddNewRedline( ); + + if (nSprmId == NS_ooxml::LN_CT_PPr_pPrChange) + { + m_pImpl->SetCurrentRedlineToken( ooxml::OOXML_ParagraphFormat ); + } + resolveSprmProps(*this, rSprm ); // now the properties author, date and id should be available sal_Int32 nToken = m_pImpl->GetCurrentRedlineToken(); @@ -3466,6 +3473,7 @@ void DomainMapper::sprmWithProps( Sprm& rSprm, PropertyMapPtr rContext, SprmType case ooxml::OOXML_mod : case ooxml::OOXML_ins : case ooxml::OOXML_del : + case ooxml::OOXML_ParagraphFormat : break; default: OSL_FAIL( "redline token other than mod, ins or del" ); } @@ -3495,6 +3503,26 @@ void DomainMapper::sprmWithProps( Sprm& rSprm, PropertyMapPtr rContext, SprmType // Pop back out the character properties that were on the run m_pImpl->PopProperties(CONTEXT_CHARACTER); break; + case NS_ooxml::LN_CT_PPrChange_pPr: + // Push all the current 'Paragraph' properties to the stack, so that we don't store them + // as 'tracked changes' by mistake + m_pImpl->PushProperties(CONTEXT_PARAGRAPH); + + // Resolve all the properties that are under the 'pPrChange'->'pPr' XML node + resolveSprmProps(*this, rSprm ); + + if (m_pImpl->GetTopContext()) + { + // Get all the properties that were processed in the 'pPrChange'->'pPr' XML node + uno::Sequence< beans::PropertyValue > currentRedlineRevertProperties = m_pImpl->GetTopContext()->GetPropertyValues(); + + // Store these properties in the current redline object + m_pImpl->SetCurrentRedlineRevertProperties( currentRedlineRevertProperties ); + } + + // Pop back out the character properties that were on the run + m_pImpl->PopProperties(CONTEXT_PARAGRAPH); + break; case NS_ooxml::LN_object: { writerfilter::Reference<Properties>::Pointer_t pProperties = rSprm.getProps(); diff --git a/writerfilter/source/dmapper/DomainMapper_Impl.cxx b/writerfilter/source/dmapper/DomainMapper_Impl.cxx index 07d7df2e1093..f726ed0d4aed 100644 --- a/writerfilter/source/dmapper/DomainMapper_Impl.cxx +++ b/writerfilter/source/dmapper/DomainMapper_Impl.cxx @@ -1564,6 +1564,9 @@ void DomainMapper_Impl::CreateRedline( uno::Reference< text::XTextRange > xRange case ooxml::OOXML_del: sType = rPropNameSupplier.GetName( PROP_DELETE ); break; + case ooxml::OOXML_ParagraphFormat: + sType = rPropNameSupplier.GetName( PROP_PARAGRAPH_FORMAT ); + break; } uno::Reference < text::XRedline > xRedline( xRange, uno::UNO_QUERY_THROW ); beans::PropertyValues aRedlineProperties( 3 ); @@ -1602,8 +1605,9 @@ void DomainMapper_Impl::CheckRedline( uno::Reference< text::XTextRange > xRange CreateRedline( xRange, *pIt ); // Adding the non-mod redlines to the temporary vector - if ( pIt->get( ) && ( ( *pIt )->m_nToken & 0xffff ) != ooxml::OOXML_mod ) + if ( pIt->get( ) ) { + if ( ( ( *pIt )->m_nToken & 0xffff ) != ooxml::OOXML_mod && ( ( *pIt )->m_nToken & 0xffff ) != ooxml::OOXML_ParagraphFormat) aCleaned.push_back( *pIt ); } } diff --git a/writerfilter/source/dmapper/PropertyIds.cxx b/writerfilter/source/dmapper/PropertyIds.cxx index 52d34c4c3a96..09d8710b575b 100644 --- a/writerfilter/source/dmapper/PropertyIds.cxx +++ b/writerfilter/source/dmapper/PropertyIds.cxx @@ -313,6 +313,7 @@ const OUString& PropertyNameSupplier::GetName( PropertyIds eId ) const case PROP_FORMAT : sName = "Format"; break; case PROP_INSERT : sName = "Insert"; break; case PROP_DELETE : sName = "Delete"; break; + case PROP_PARAGRAPH_FORMAT : sName = "ParagraphFormat"; break; case PROP_STREAM_NAME: sName = "StreamName"; break; case PROP_BITMAP : sName = "Bitmap"; break; case PROP_IS_DATE : sName = "IsDate"; break; diff --git a/writerfilter/source/dmapper/PropertyIds.hxx b/writerfilter/source/dmapper/PropertyIds.hxx index 5d92480d8bbd..55b8a48c2bf6 100644 --- a/writerfilter/source/dmapper/PropertyIds.hxx +++ b/writerfilter/source/dmapper/PropertyIds.hxx @@ -210,6 +210,7 @@ enum PropertyIds ,PROP_PAGE_DESC_NAME ,PROP_PAGE_NUMBER_OFFSET ,PROP_PAGE_TOGGLE + ,PROP_PARAGRAPH_FORMAT ,PROP_PARAGRAPH_STYLES ,PROP_PARAGRAPH_STYLE_NAME ,PROP_PARA_ADJUST |