DOCX import: fix import of font size in table styles

Change-Id: I2c7ea83fb910b57d78fda620bc42b90e55de3719
This commit is contained in:
Miklos Vajna
2013-03-04 13:08:28 +01:00
parent 4aab4a8793
commit 23b67c5365
5 changed files with 16 additions and 2 deletions

View File

@@ -117,6 +117,7 @@ public:
*/
void processDeferredCharacterProperties(
const std::map< sal_Int32, com::sun::star::uno::Any >& deferredCharacterProperties );
void setInTableStyleRunProps(bool bInTableStyleRunProps);
private:
// Stream

View File

@@ -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 )
{

View File

@@ -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();

View File

@@ -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

View File

@@ -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);