diff options
author | Miklos Vajna <vmiklos@suse.cz> | 2013-03-04 13:08:28 +0100 |
---|---|---|
committer | Miklos Vajna <vmiklos@suse.cz> | 2013-03-04 13:18:52 +0100 |
commit | 23b67c536537c91020cf5a45ab5cb36d7316ed89 (patch) | |
tree | c608a21fc80074e65ab75e9138d87479a1b4bc38 /writerfilter | |
parent | 4aab4a879390c272cb95600156b4b14a7a29d6ea (diff) |
DOCX import: fix import of font size in table styles
Change-Id: I2c7ea83fb910b57d78fda620bc42b90e55de3719
Diffstat (limited to 'writerfilter')
-rw-r--r-- | writerfilter/inc/dmapper/DomainMapper.hxx | 1 | ||||
-rw-r--r-- | writerfilter/source/dmapper/DomainMapper.cxx | 6 | ||||
-rw-r--r-- | writerfilter/source/dmapper/DomainMapper_Impl.cxx | 3 | ||||
-rw-r--r-- | writerfilter/source/dmapper/DomainMapper_Impl.hxx | 3 | ||||
-rw-r--r-- | writerfilter/source/dmapper/StyleSheetTable.cxx | 5 |
5 files changed, 16 insertions, 2 deletions
diff --git a/writerfilter/inc/dmapper/DomainMapper.hxx b/writerfilter/inc/dmapper/DomainMapper.hxx index 26654d728c0f..519367bf779a 100644 --- a/writerfilter/inc/dmapper/DomainMapper.hxx +++ b/writerfilter/inc/dmapper/DomainMapper.hxx @@ -117,6 +117,7 @@ public: */ void processDeferredCharacterProperties( const std::map< sal_Int32, com::sun::star::uno::Any >& deferredCharacterProperties ); + void setInTableStyleRunProps(bool bInTableStyleRunProps); private: // Stream diff --git a/writerfilter/source/dmapper/DomainMapper.cxx b/writerfilter/source/dmapper/DomainMapper.cxx index 6892f8289671..a4d1e0355b8e 100644 --- a/writerfilter/source/dmapper/DomainMapper.cxx +++ b/writerfilter/source/dmapper/DomainMapper.cxx @@ -2136,7 +2136,7 @@ void DomainMapper::sprmWithProps( Sprm& rSprm, PropertyMapPtr rContext, SprmType { rContext->Insert( PROP_CHAR_HEIGHT_COMPLEX, true, aVal ); } - else + else if (!m_pImpl->m_bInTableStyleRunProps) { //Asian get the same value as Western rContext->Insert( PROP_CHAR_HEIGHT, true, aVal ); @@ -3294,6 +3294,10 @@ void DomainMapper::sprmWithProps( Sprm& rSprm, PropertyMapPtr rContext, SprmType } } +void DomainMapper::setInTableStyleRunProps(bool bInTableStyleRunProps) +{ + m_pImpl->m_bInTableStyleRunProps = bInTableStyleRunProps; +} void DomainMapper::processDeferredCharacterProperties( const std::map< sal_Int32, uno::Any >& deferredCharacterProperties ) { diff --git a/writerfilter/source/dmapper/DomainMapper_Impl.cxx b/writerfilter/source/dmapper/DomainMapper_Impl.cxx index 28ad15496e50..383681d66f5d 100644 --- a/writerfilter/source/dmapper/DomainMapper_Impl.cxx +++ b/writerfilter/source/dmapper/DomainMapper_Impl.cxx @@ -186,7 +186,8 @@ DomainMapper_Impl::DomainMapper_Impl( m_bUsingEnhancedFields( false ), m_bSdt(false), m_xInsertTextRange(xInsertTextRange), - m_bIsNewDoc(bIsNewDoc) + m_bIsNewDoc(bIsNewDoc), + m_bInTableStyleRunProps(false) { appendTableManager( ); GetBodyText(); diff --git a/writerfilter/source/dmapper/DomainMapper_Impl.hxx b/writerfilter/source/dmapper/DomainMapper_Impl.hxx index c8860f66ad84..d59ffd9f4e57 100644 --- a/writerfilter/source/dmapper/DomainMapper_Impl.hxx +++ b/writerfilter/source/dmapper/DomainMapper_Impl.hxx @@ -670,6 +670,9 @@ public: /// If we're importing into a new document, or just pasting to an existing one. bool IsNewDoc(); + + /// If we're inside <w:rPr>, inside <w:style w:type="table"> + bool m_bInTableStyleRunProps; }; } //namespace dmapper } //namespace writerfilter diff --git a/writerfilter/source/dmapper/StyleSheetTable.cxx b/writerfilter/source/dmapper/StyleSheetTable.cxx index b5413b8973bb..6e3867384c12 100644 --- a/writerfilter/source/dmapper/StyleSheetTable.cxx +++ b/writerfilter/source/dmapper/StyleSheetTable.cxx @@ -594,7 +594,12 @@ void StyleSheetTable::lcl_sprm(Sprm & rSprm) m_pImpl->m_rDMapper.PushStyleSheetProperties( m_pImpl->m_pCurrentEntry->pProperties ); PropertyMapPtr pProps(new PropertyMap()); + bool bTableStyleRunProps = m_pImpl->m_pCurrentEntry->nStyleTypeCode == STYLE_TYPE_TABLE && nSprmId == NS_ooxml::LN_CT_Style_rPr; + if (bTableStyleRunProps) + m_pImpl->m_rDMapper.setInTableStyleRunProps(true); m_pImpl->m_rDMapper.sprmWithProps( rSprm, pProps ); + if (bTableStyleRunProps) + m_pImpl->m_rDMapper.setInTableStyleRunProps(false); m_pImpl->m_pCurrentEntry->pProperties->InsertProps(pProps); |