[Libreoffice-commits] core.git: writerfilter/inc writerfilter/source
Adam Co
rattles2013 at gmail.com
Tue Feb 11 05:52:12 PST 2014
writerfilter/inc/dmapper/DomainMapper.hxx | 2
writerfilter/source/dmapper/DomainMapper.cxx | 57 +++++++++++++++++----------
2 files changed, 39 insertions(+), 20 deletions(-)
New commits:
commit af84f04c10724fdeecfc25de46fa1d54cf905bd2
Author: Adam Co <rattles2013 at gmail.com>
Date: Mon Feb 3 14:13:37 2014 +0200
Refactor some code for handling redline in DOCX importer
Change-Id: Id5d0814c1ebbcd85507d11cf562d394a748773a6
Reviewed-on: https://gerrit.libreoffice.org/7807
Reviewed-by: Miklos Vajna <vmiklos at collabora.co.uk>
Tested-by: Miklos Vajna <vmiklos at collabora.co.uk>
diff --git a/writerfilter/inc/dmapper/DomainMapper.hxx b/writerfilter/inc/dmapper/DomainMapper.hxx
index f7d6fcb..ce30d69 100644
--- a/writerfilter/inc/dmapper/DomainMapper.hxx
+++ b/writerfilter/inc/dmapper/DomainMapper.hxx
@@ -129,6 +129,8 @@ public:
uno::Sequence<beans::PropertyValue> GetThemeFontLangProperties() const;
+ void HandleRedline( Sprm& rSprm );
+
private:
// Stream
virtual void lcl_startSectionGroup();
diff --git a/writerfilter/source/dmapper/DomainMapper.cxx b/writerfilter/source/dmapper/DomainMapper.cxx
index bd8e6fd..5751e33 100644
--- a/writerfilter/source/dmapper/DomainMapper.cxx
+++ b/writerfilter/source/dmapper/DomainMapper.cxx
@@ -2224,26 +2224,7 @@ void DomainMapper::sprmWithProps( Sprm& rSprm, PropertyMapPtr rContext, SprmType
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();
- switch( nToken & 0xffff )
- {
- 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" );
- }
- m_pImpl->EndParaMarkerChange( );
+ HandleRedline( rSprm );
}
break;
case NS_ooxml::LN_endtrackchange:
@@ -3190,6 +3171,42 @@ uno::Sequence<beans::PropertyValue> DomainMapper::GetThemeFontLangProperties() c
return m_pImpl->GetSettingsTable()->GetThemeFontLangProperties();
}
+void DomainMapper::HandleRedline( Sprm& rSprm )
+{
+ sal_uInt32 nSprmId = rSprm.getId();
+
+ m_pImpl->AddNewRedline( );
+
+ if (nSprmId == NS_ooxml::LN_CT_PPr_pPrChange)
+ {
+ m_pImpl->SetCurrentRedlineToken( ooxml::OOXML_ParagraphFormat );
+ }
+ else if (nSprmId == NS_ooxml::LN_CT_TrPr_ins)
+ {
+ m_pImpl->SetCurrentRedlineToken( ooxml::OOXML_tableRowInsert );
+ }
+ else if (nSprmId == NS_ooxml::LN_CT_TrPr_del)
+ {
+ m_pImpl->SetCurrentRedlineToken( ooxml::OOXML_tableRowDelete );
+ }
+
+ resolveSprmProps(*this, rSprm );
+ // now the properties author, date and id should be available
+ sal_Int32 nToken = m_pImpl->GetCurrentRedlineToken();
+ switch( nToken & 0xffff )
+ {
+ case ooxml::OOXML_mod :
+ case ooxml::OOXML_ins :
+ case ooxml::OOXML_del :
+ case ooxml::OOXML_ParagraphFormat :
+ case ooxml::OOXML_tableRowInsert:
+ case ooxml::OOXML_tableRowDelete:
+ break;
+ default: OSL_FAIL( "redline token other than mod, ins, del or table row" ); break;
+ }
+ m_pImpl->EndParaMarkerChange( );
+}
+
} //namespace dmapper
} //namespace writerfilter
More information about the Libreoffice-commits
mailing list