DOCX import: fix import of font size in table styles
Change-Id: I2c7ea83fb910b57d78fda620bc42b90e55de3719
diff --git a/writerfilter/inc/dmapper/DomainMapper.hxx b/writerfilter/inc/dmapper/DomainMapper.hxx
index 26654d72..519367b 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 6892f82..a4d1e03 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 28ad154..383681d 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 c8860f6..d59ffd9 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 b5413b8..6e38673 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);