diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport.cxx b/sw/qa/extras/ooxmlexport/ooxmlexport.cxx index 5a3a554ecf0c..8fa9ded37802 100644 --- a/sw/qa/extras/ooxmlexport/ooxmlexport.cxx +++ b/sw/qa/extras/ooxmlexport/ooxmlexport.cxx @@ -1398,6 +1398,9 @@ DECLARE_OOXMLEXPORT_TEST(testCalendar2, "calendar2.docx") // Font size in the second row was 11. xCell.set(xTable->getCellByName("A2"), uno::UNO_QUERY); CPPUNIT_ASSERT_EQUAL(16.f, getProperty(getRun(getParagraphOfText(1, xCell->getText()), 1), "CharHeight")); + // Font size in the third row was 11 as well. + xCell.set(xTable->getCellByName("A3"), uno::UNO_QUERY); + CPPUNIT_ASSERT_EQUAL(14.f, getProperty(getRun(getParagraphOfText(1, xCell->getText()), 1), "CharHeight")); // This paragraph property was missing in table style. xmlDocPtr pXmlStyles = parseExport("word/styles.xml"); diff --git a/writerfilter/source/dmapper/DomainMapper.cxx b/writerfilter/source/dmapper/DomainMapper.cxx index 9edb914b69f2..da510fdac558 100644 --- a/writerfilter/source/dmapper/DomainMapper.cxx +++ b/writerfilter/source/dmapper/DomainMapper.cxx @@ -2276,15 +2276,26 @@ void DomainMapper::sprmWithProps( Sprm& rSprm, PropertyMapPtr rContext, SprmType { rContext->Insert( PROP_CHAR_HEIGHT_COMPLEX, aVal ); } - else if (!m_pImpl->m_bInTableStyleRunProps) + else { - //Asian get the same value as Western - rContext->Insert( PROP_CHAR_HEIGHT, aVal ); - rContext->Insert( PROP_CHAR_HEIGHT_ASIAN, aVal ); + bool bIgnore = false; + if (m_pImpl->m_bInTableStyleRunProps) + { + // If the default para style contains PROP_CHAR_HEIGHT, that should have priority over the table style. + StyleSheetEntryPtr pTable = m_pImpl->GetStyleSheetTable()->FindDefaultParaStyle(); + if (pTable && pTable->pProperties->find(PROP_CHAR_HEIGHT) != pTable->pProperties->end()) + bIgnore = true; + } + if (!bIgnore) + { + //Asian get the same value as Western + rContext->Insert( PROP_CHAR_HEIGHT, aVal ); + rContext->Insert( PROP_CHAR_HEIGHT_ASIAN, aVal ); - uno::Reference xCharStyle(m_pImpl->GetCurrentNumberingCharStyle()); - if (xCharStyle.is()) - xCharStyle->setPropertyValue(rPropNameSupplier.GetName(PROP_CHAR_HEIGHT), aVal); + uno::Reference xCharStyle(m_pImpl->GetCurrentNumberingCharStyle()); + if (xCharStyle.is()) + xCharStyle->setPropertyValue(rPropNameSupplier.GetName(PROP_CHAR_HEIGHT), aVal); + } } // Make sure char sizes defined in the stylesheets don't affect char props from direct formatting. if (!m_pImpl->IsStyleSheetImport()) diff --git a/writerfilter/source/dmapper/StyleSheetTable.cxx b/writerfilter/source/dmapper/StyleSheetTable.cxx index 329cc639dff8..ec7816323b12 100644 --- a/writerfilter/source/dmapper/StyleSheetTable.cxx +++ b/writerfilter/source/dmapper/StyleSheetTable.cxx @@ -1293,6 +1293,20 @@ const StyleSheetEntryPtr StyleSheetTable::FindStyleSheetByConvertedStyleName(con } +const StyleSheetEntryPtr StyleSheetTable::FindDefaultParaStyle() +{ + StyleSheetEntryPtr pRet; + for (size_t i = 0; i < m_pImpl->m_aStyleSheetEntries.size(); ++i) + { + StyleSheetEntryPtr pEntry = m_pImpl->m_aStyleSheetEntries[i]; + if (pEntry->bIsDefaultStyle && pEntry->nStyleTypeCode == STYLE_TYPE_PARA) + { + pRet = pEntry; + break; + } + } + return pRet; +} const StyleSheetEntryPtr StyleSheetTable::FindParentStyleSheet(OUString sBaseStyle) { diff --git a/writerfilter/source/dmapper/StyleSheetTable.hxx b/writerfilter/source/dmapper/StyleSheetTable.hxx index d74eadfc83f3..0c1699b10eb8 100644 --- a/writerfilter/source/dmapper/StyleSheetTable.hxx +++ b/writerfilter/source/dmapper/StyleSheetTable.hxx @@ -97,6 +97,7 @@ public: const StyleSheetEntryPtr FindStyleSheetByISTD(const OUString& sIndex); const StyleSheetEntryPtr FindStyleSheetByStyleName(const OUString& rIndex); const StyleSheetEntryPtr FindStyleSheetByConvertedStyleName(const OUString& rIndex); + const StyleSheetEntryPtr FindDefaultParaStyle(); // returns the parent of the one with the given name - if empty the parent of the current style sheet is returned const StyleSheetEntryPtr FindParentStyleSheet(OUString sBaseStyle);