From cc6f1c8e972687bd43f0fab083a4aae6de6b0e0d Mon Sep 17 00:00:00 2001 From: Luboš Luňák Date: Wed, 26 Mar 2014 17:39:25 +0100 Subject: Revert "rhbz#1075124: writerfilter: fix tables with negative left margin" It appears that this was just a workaround that incidentally worked. Making the negative value even larger (in abs value) doesn't seem to make a difference for MSO, but LO fails again. A proper fix (better workaround?) will follow. This reverts commit 2e558f32ef79948858723b9781fbd388850b462b. Change-Id: I56fd5e9d7ce9aa178f7e508f8e7ac3bc0ff2b971 Reviewed-on: https://gerrit.libreoffice.org/8763 Reviewed-by: Tor Lillqvist Reviewed-by: Miklos Vajna Tested-by: Miklos Vajna --- .../source/dmapper/DomainMapperTableHandler.cxx | 24 +++++++++++----------- .../source/dmapper/TablePropertiesHandler.cxx | 4 ++-- 2 files changed, 14 insertions(+), 14 deletions(-) (limited to 'writerfilter') diff --git a/writerfilter/source/dmapper/DomainMapperTableHandler.cxx b/writerfilter/source/dmapper/DomainMapperTableHandler.cxx index 64289c417483..0827cc919968 100644 --- a/writerfilter/source/dmapper/DomainMapperTableHandler.cxx +++ b/writerfilter/source/dmapper/DomainMapperTableHandler.cxx @@ -406,6 +406,18 @@ TableStyleSheetEntry * DomainMapperTableHandler::endTableGetTableStyle(TableInfo m_aTableProperties->getValue( TablePropertyMap::CELL_MAR_BOTTOM, rInfo.nBottomBorderDistance ); + table::TableBorderDistances aDistances; + aDistances.IsTopDistanceValid = + aDistances.IsBottomDistanceValid = + aDistances.IsLeftDistanceValid = + aDistances.IsRightDistanceValid = sal_True; + aDistances.TopDistance = static_cast( rInfo.nTopBorderDistance ); + aDistances.BottomDistance = static_cast( rInfo.nBottomBorderDistance ); + aDistances.LeftDistance = static_cast( rInfo.nLeftBorderDistance ); + aDistances.RightDistance = static_cast( rInfo.nRightBorderDistance ); + + m_aTableProperties->Insert( PROP_TABLE_BORDER_DISTANCES, uno::makeAny( aDistances ) ); + if (rFrameProperties.hasElements()) lcl_DecrementHoriOrientPosition(rFrameProperties, rInfo.nLeftBorderDistance); @@ -465,18 +477,6 @@ TableStyleSheetEntry * DomainMapperTableHandler::endTableGetTableStyle(TableInfo lcl_debug_TableBorder(aTableBorder); #endif - table::TableBorderDistances aDistances; - aDistances.IsTopDistanceValid = - aDistances.IsBottomDistanceValid = - aDistances.IsLeftDistanceValid = - aDistances.IsRightDistanceValid = sal_True; - aDistances.TopDistance = static_cast( rInfo.nTopBorderDistance ); - aDistances.BottomDistance = static_cast( rInfo.nBottomBorderDistance ); - aDistances.LeftDistance = static_cast( rInfo.nLeftBorderDistance ); - aDistances.RightDistance = static_cast( rInfo.nRightBorderDistance ); - - m_aTableProperties->Insert( PROP_TABLE_BORDER_DISTANCES, uno::makeAny( aDistances ) ); - // Table position in Office is computed in 2 different ways : // - top level tables: the goal is to have in-cell text starting at table indent pos (tblInd), // so table's position depends on table's cells margin diff --git a/writerfilter/source/dmapper/TablePropertiesHandler.cxx b/writerfilter/source/dmapper/TablePropertiesHandler.cxx index 0595a853ffa2..b54b2628407e 100644 --- a/writerfilter/source/dmapper/TablePropertiesHandler.cxx +++ b/writerfilter/source/dmapper/TablePropertiesHandler.cxx @@ -311,8 +311,8 @@ namespace dmapper { if (m_pCurrentInteropGrabBag) m_pCurrentInteropGrabBag->push_back(pHandler->getInteropGrabBag()); TablePropertyMapPtr pTblIndMap(new TablePropertyMap); - sal_Int32 nTblInd = pHandler->getMeasureValue(); - pTblIndMap->setValue(TablePropertyMap::LEFT_MARGIN, nTblInd); + sal_uInt32 nTblInd = pHandler->getMeasureValue(); + pTblIndMap->setValue( TablePropertyMap::LEFT_MARGIN, nTblInd); insertTableProps(pTblIndMap); } } -- cgit v1.2.3