summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCédric Bosdonnat <cedricbosdo@openoffice.org>2010-12-08 17:33:47 +0100
committerCédric Bosdonnat <cedricbosdo@openoffice.org>2010-12-08 17:33:47 +0100
commita8dd8fada6f3adf1182e3011ce8c68288e4c8386 (patch)
tree60d2e541f345f9e635574e576cccd327db22e99b
parent8d55625c0734866ce3620d1c8469425cacb6e8f9 (diff)
[Docx] fdo#32170: fixed the import of the document default formatting
-rw-r--r--writerfilter/source/dmapper/DomainMapper.cxx6
-rw-r--r--writerfilter/source/dmapper/StyleSheetTable.cxx14
2 files changed, 9 insertions, 11 deletions
diff --git a/writerfilter/source/dmapper/DomainMapper.cxx b/writerfilter/source/dmapper/DomainMapper.cxx
index 6865b5de6..e2748abb6 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 c82bb04ed..b27546543 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;