diff options
5 files changed, 20 insertions, 0 deletions
diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport.cxx b/sw/qa/extras/ooxmlexport/ooxmlexport.cxx index 42f250c12fc7..5a3a554ecf0c 100644 --- a/sw/qa/extras/ooxmlexport/ooxmlexport.cxx +++ b/sw/qa/extras/ooxmlexport/ooxmlexport.cxx @@ -1395,6 +1395,9 @@ DECLARE_OOXMLEXPORT_TEST(testCalendar2, "calendar2.docx") uno::Reference<text::XTextTable> xTable(getParagraphOrTable(1), uno::UNO_QUERY); uno::Reference<text::XTextRange> xCell(xTable->getCellByName("A1"), uno::UNO_QUERY); CPPUNIT_ASSERT_EQUAL(style::CaseMap::UPPERCASE, getProperty<sal_Int16>(getRun(getParagraphOfText(1, xCell->getText()), 1), "CharCaseMap")); + // Font size in the second row was 11. + xCell.set(xTable->getCellByName("A2"), uno::UNO_QUERY); + CPPUNIT_ASSERT_EQUAL(16.f, getProperty<float>(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/DomainMapperTableHandler.cxx b/writerfilter/source/dmapper/DomainMapperTableHandler.cxx index a8e51b079cb5..1a9ad2d063dc 100644 --- a/writerfilter/source/dmapper/DomainMapperTableHandler.cxx +++ b/writerfilter/source/dmapper/DomainMapperTableHandler.cxx @@ -562,6 +562,7 @@ CellPropertyValuesSeq_t DomainMapperTableHandler::endTableGetCellProperties(Tabl //it's a uno::Sequence< beans::PropertyValues >* RowPropertyValuesSeq_t* pCellProperties = aCellProperties.getArray(); + PropertyMapVector1::const_iterator aRowIter = m_aRowProperties.begin(); while( aRowOfCellsIterator != aRowOfCellsIteratorEnd ) { //aRowOfCellsIterator points to a vector of PropertyMapPtr @@ -580,6 +581,8 @@ CellPropertyValuesSeq_t DomainMapperTableHandler::endTableGetCellProperties(Tabl if(rInfo.nTblLook&0x40) nRowStyleMask |= CNF_LAST_ROW; // last row style used } + else if (aRowIter->get() && aRowIter->get()->find(PROP_TBL_HEADER) != aRowIter->get()->end()) + nRowStyleMask |= CNF_FIRST_ROW; // table header implies first row if(!nRowStyleMask) // if no row style used yet { // banding used only if not first and or last row style used @@ -729,6 +732,7 @@ CellPropertyValuesSeq_t DomainMapperTableHandler::endTableGetCellProperties(Tabl #endif ++nRow; ++aRowOfCellsIterator; + ++aRowIter; } #ifdef DEBUG_DMAPPER_TABLE_HANDLER @@ -758,6 +762,10 @@ RowPropertyValuesSeq_t DomainMapperTableHandler::endTableGetRowProperties() //set default to 'break across pages" if( aRowIter->get()->find(PROP_IS_SPLIT_ALLOWED) == aRowIter->get()->end()) aRowIter->get()->Insert( PROP_IS_SPLIT_ALLOWED, uno::makeAny(sal_True ) ); + // tblHeader is only our property, remove before the property map hits UNO + PropertyMap::const_iterator aIter = aRowIter->get()->find(PROP_TBL_HEADER); + if (aIter != aRowIter->get()->end()) + aRowIter->get()->erase(aIter); aRowProperties[nRow] = (*aRowIter)->GetPropertyValues(); #ifdef DEBUG_DMAPPER_TABLE_HANDLER diff --git a/writerfilter/source/dmapper/DomainMapperTableManager.cxx b/writerfilter/source/dmapper/DomainMapperTableManager.cxx index ac75e073fc85..7db941d07ad8 100644 --- a/writerfilter/source/dmapper/DomainMapperTableManager.cxx +++ b/writerfilter/source/dmapper/DomainMapperTableManager.cxx @@ -201,6 +201,13 @@ bool DomainMapperTableManager::sprm(Sprm & rSprm) } else m_nHeaderRepeat = -1; + if (nIntValue) + { + // Store the info that this is a header, we'll need that when we apply table styles. + TablePropertyMapPtr pPropMap( new TablePropertyMap ); + pPropMap->Insert( PROP_TBL_HEADER, uno::makeAny(nIntValue)); + insertRowProps(pPropMap); + } break; case 0xd608: // TDefTable { diff --git a/writerfilter/source/dmapper/PropertyIds.cxx b/writerfilter/source/dmapper/PropertyIds.cxx index b2848552308a..4b05efae8419 100644 --- a/writerfilter/source/dmapper/PropertyIds.cxx +++ b/writerfilter/source/dmapper/PropertyIds.cxx @@ -344,6 +344,7 @@ const OUString& PropertyNameSupplier::GetName( PropertyIds eId ) const case PROP_SURROUND_TEXT_WRAP_SMALL: sName = "SurroundTextWrapSmall"; break; case PROP_PARA_SHADOW_FORMAT: sName = "ParaShadowFormat"; break; case PROP_FOOTNOTE_LINE_RELATIVE_WIDTH: sName = "FootnoteLineRelativeWidth"; break; + case PROP_TBL_HEADER: sName = "TblHeader"; break; } ::std::pair<PropertyNameMap_t::iterator,bool> aInsertIt = m_pImpl->aNameMap.insert( PropertyNameMap_t::value_type( eId, sName )); diff --git a/writerfilter/source/dmapper/PropertyIds.hxx b/writerfilter/source/dmapper/PropertyIds.hxx index ee5045db6b3a..0de35ceea569 100644 --- a/writerfilter/source/dmapper/PropertyIds.hxx +++ b/writerfilter/source/dmapper/PropertyIds.hxx @@ -315,6 +315,7 @@ enum PropertyIds ,PROP_FOOTNOTE_LINE_RELATIVE_WIDTH ,PROP_PARA_TOP_MARGIN_BEFORE_AUTO_SPACING ,PROP_PARA_BOTTOM_MARGIN_AFTER_AUTO_SPACING + ,PROP_TBL_HEADER }; struct PropertyNameSupplier_Impl; class PropertyNameSupplier |