diff options
-rw-r--r-- | sw/qa/extras/ooxmlexport/ooxmlexport5.cxx | 9 | ||||
-rw-r--r-- | writerfilter/source/dmapper/DomainMapperTableHandler.cxx | 8 | ||||
-rw-r--r-- | writerfilter/source/dmapper/TblStylePrHandler.cxx | 15 |
3 files changed, 32 insertions, 0 deletions
diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport5.cxx b/sw/qa/extras/ooxmlexport/ooxmlexport5.cxx index 3eac4838f146..c6ae77a1a512 100644 --- a/sw/qa/extras/ooxmlexport/ooxmlexport5.cxx +++ b/sw/qa/extras/ooxmlexport/ooxmlexport5.cxx @@ -235,6 +235,15 @@ DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testTdf131819, "NumberedList.docx") assertXPath(pXmlDoc, "/w:document/w:body/w:tbl/w:tr[1]/w:tc[1]/w:tbl/w:tblGrid/w:gridCol[2]", "w", "4049"); } +DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testTdf131959, "NumberedList.docx") +{ + // import tblInd from table style + xmlDocPtr pXmlDoc = parseExport("word/document.xml"); + // These were 0. + assertXPath(pXmlDoc, "/w:document/w:body/w:tbl/w:tblPr/w:tblInd", "w", "360"); + assertXPath(pXmlDoc, "/w:document/w:body/w:tbl/w:tr[1]/w:tc[1]/w:tbl/w:tblPr/w:tblInd", "w", "360"); +} + DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testFDO76597, "fdo76597.docx") { // check XML diff --git a/writerfilter/source/dmapper/DomainMapperTableHandler.cxx b/writerfilter/source/dmapper/DomainMapperTableHandler.cxx index b7151f26cb9f..0c73bb60f23a 100644 --- a/writerfilter/source/dmapper/DomainMapperTableHandler.cxx +++ b/writerfilter/source/dmapper/DomainMapperTableHandler.cxx @@ -514,6 +514,14 @@ TableStyleSheetEntry * DomainMapperTableHandler::endTableGetTableStyle(TableInfo } m_aTableProperties->getValue( TablePropertyMap::GAP_HALF, nGapHalf ); + + std::optional<PropertyMap::Property> oLeftMarginFromStyle = m_aTableProperties->getProperty(PROP_LEFT_MARGIN); + if (oLeftMarginFromStyle) + { + oLeftMarginFromStyle->second >>= nLeftMargin; + // don't need to erase, we will push back the adjusted value + // of this (or the direct formatting, if that exists) later + } m_aTableProperties->getValue( TablePropertyMap::LEFT_MARGIN, nLeftMargin ); m_aTableProperties->getValue( TablePropertyMap::CELL_MAR_LEFT, diff --git a/writerfilter/source/dmapper/TblStylePrHandler.cxx b/writerfilter/source/dmapper/TblStylePrHandler.cxx index 22a790644ebe..21dd6f619894 100644 --- a/writerfilter/source/dmapper/TblStylePrHandler.cxx +++ b/writerfilter/source/dmapper/TblStylePrHandler.cxx @@ -21,6 +21,7 @@ #include "TagLogger.hxx" #include "CellMarginHandler.hxx" #include "PropertyMap.hxx" +#include "MeasureHandler.hxx" #include <ooxml/resourceids.hxx> #include <comphelper/sequence.hxx> @@ -169,6 +170,20 @@ void TblStylePrHandler::lcl_sprm(Sprm & rSprm) m_aInteropGrabBag.push_back(aValue); } break; + case NS_ooxml::LN_CT_TblPrBase_tblInd: + { + //contains unit and value + writerfilter::Reference<Properties>::Pointer_t pProperties = rSprm.getProps(); + if( pProperties.get()) + { + MeasureHandlerPtr pMeasureHandler( new MeasureHandler ); + pProperties->resolve(*pMeasureHandler); + TablePropertyMapPtr pPropMap( new TablePropertyMap ); + pPropMap->setValue( TablePropertyMap::LEFT_MARGIN, pMeasureHandler->getMeasureValue() ); + m_pProperties->Insert( PROP_LEFT_MARGIN, uno::makeAny(pMeasureHandler->getMeasureValue()) ); + } + } + break; case NS_ooxml::LN_CT_TblPrBase_tblCellMar: { writerfilter::Reference<Properties>::Pointer_t pProperties = rSprm.getProps(); |