[Libreoffice-commits] .: writerfilter/source

Cédric Bosdonnat cbosdo at kemper.freedesktop.org
Wed Dec 8 08:34:41 PST 2010


 writerfilter/source/dmapper/DomainMapper.cxx    |    6 ++++--
 writerfilter/source/dmapper/StyleSheetTable.cxx |   14 +++++---------
 2 files changed, 9 insertions(+), 11 deletions(-)

New commits:
commit a8dd8fada6f3adf1182e3011ce8c68288e4c8386
Author: Cédric Bosdonnat <cedricbosdo at openoffice.org>
Date:   Wed Dec 8 17:33:47 2010 +0100

    [Docx] fdo#32170: fixed the import of the document default formatting

diff --git a/writerfilter/source/dmapper/DomainMapper.cxx b/writerfilter/source/dmapper/DomainMapper.cxx
index 6865b5d..e2748ab 100644
--- a/writerfilter/source/dmapper/DomainMapper.cxx
+++ b/writerfilter/source/dmapper/DomainMapper.cxx
@@ -3013,6 +3013,10 @@ void DomainMapper::sprm( Sprm& rSprm, PropertyMapPtr rContext, SprmType eSprmTyp
     }
     break;
 
+    case NS_ooxml::LN_CT_DocDefaults_pPrDefault:
+    case NS_ooxml::LN_CT_DocDefaults_rPrDefault:
+        GetStyleSheetTable()->sprm( rSprm );
+    break;
     case NS_ooxml::LN_CT_PPr_sectPr:
     case NS_ooxml::LN_EG_RPrBase_color:
     case NS_ooxml::LN_EG_RPrBase_rFonts:
@@ -3024,8 +3028,6 @@ void DomainMapper::sprm( Sprm& rSprm, PropertyMapPtr rContext, SprmType eSprmTyp
     case NS_ooxml::LN_CT_PPrBase_ind:
     case NS_ooxml::LN_CT_RPrDefault_rPr:
     case NS_ooxml::LN_CT_PPrDefault_pPr:
-    case NS_ooxml::LN_CT_DocDefaults_pPrDefault:
-    case NS_ooxml::LN_CT_DocDefaults_rPrDefault:
     case NS_ooxml::LN_CT_Style_pPr:
     case NS_ooxml::LN_CT_Style_rPr:
     case NS_ooxml::LN_CT_PPr_rPr:
diff --git a/writerfilter/source/dmapper/StyleSheetTable.cxx b/writerfilter/source/dmapper/StyleSheetTable.cxx
index c82bb04..b275465 100644
--- a/writerfilter/source/dmapper/StyleSheetTable.cxx
+++ b/writerfilter/source/dmapper/StyleSheetTable.cxx
@@ -25,6 +25,7 @@
  * for a copy of the LGPLv3 License.
  *
  ************************************************************************/
+#include <resourcemodel/ResourceModelHelper.hxx>
 #include <StyleSheetTable.hxx>
 #include <dmapper/DomainMapper.hxx>
 #include <NumberingManager.hxx>
@@ -346,7 +347,6 @@ struct StyleSheetTable_Impl
     StringPairMap_t                         m_aStyleNameMap;
     ListCharStylePropertyVector_t           m_aListCharStylePropertyVector;
     
-    
     StyleSheetTable_Impl(DomainMapper& rDMapper, uno::Reference< text::XTextDocument> xTextDocument);
 
     ::rtl::OUString HasListCharStyle( const PropertyValueVector_t& rCharProperties );
@@ -496,11 +496,6 @@ void StyleSheetTable::attribute(Id Name, Value & val)
         break;
         case NS_ooxml::LN_CT_Style_type:
         {
-/*          defaults should be set at the service "com.sun.star.text.Defaults"          
-             if (nIntValue == 1)
-                *(m_pImpl->m_pCurrentEntry->pProperties) = *(m_pImpl->m_pDefaultParaProps);
-            else if (nIntValue == 2)
-                *(m_pImpl->m_pCurrentEntry->pProperties) = *(m_pImpl->m_pDefaultCharProps);*/
             StyleType nType = ( StyleType ) nIntValue;
             if ( nType == STYLE_TYPE_TABLE )
             {
@@ -588,7 +583,6 @@ void StyleSheetTable::sprm(Sprm & rSprm)
         break;
         case NS_ooxml::LN_CT_Style_tblPr: //contains table properties
         case NS_ooxml::LN_CT_Style_tblStylePr: //contains  to table properties
-        case NS_ooxml::LN_CT_DocDefaults_rPrDefault:
         case NS_ooxml::LN_CT_TblPrBase_tblInd: //table properties - at least width value and type
         case NS_ooxml::LN_EG_RPrBase_rFonts: //table fonts
         {
@@ -616,15 +610,17 @@ void StyleSheetTable::sprm(Sprm & rSprm)
             }
             break;
         }
+        case NS_ooxml::LN_CT_DocDefaults_pPrDefault:
         case NS_ooxml::LN_CT_PPrDefault_pPr:
             m_pImpl->m_rDMapper.PushStyleSheetProperties( m_pImpl->m_pDefaultParaProps );
-            m_pImpl->m_rDMapper.sprm( rSprm );
+            resourcemodel::resolveSprmProps( m_pImpl->m_rDMapper, rSprm );
             m_pImpl->m_rDMapper.PopStyleSheetProperties();
             applyDefaults( true );
         break;
+        case NS_ooxml::LN_CT_DocDefaults_rPrDefault:
         case NS_ooxml::LN_CT_RPrDefault_rPr:
             m_pImpl->m_rDMapper.PushStyleSheetProperties( m_pImpl->m_pDefaultCharProps );
-            m_pImpl->m_rDMapper.sprm( rSprm );
+            resourcemodel::resolveSprmProps( m_pImpl->m_rDMapper, rSprm );
             m_pImpl->m_rDMapper.PopStyleSheetProperties();
             applyDefaults( false );
         break;


More information about the Libreoffice-commits mailing list