tdf#82177 ooxmlimport: ignore direct insideV/H cell borders
17.4.25 insideV (Table Cell Inside Vertical Edges Border)
This element specifies the border which shall be displayed on
all interior vertical edges of the current group of table cells.
[Note: Although individual table cells have no concept
of n internal edge, which would render this property useless
in most cases, it is used to determine the cell borders to
apply to a specific group of cells as part of table
conditional formatting in a table style, for example, the
inside vertical edges on the set of cells in the header row.
end note]
So, I interpret this as insideV/H having meaning only within table
styles, and not when directly applied to a cell. The only
documents I've seen with insideV/H directly applied to a cell seem to
have been created by LO - which dumps them everywhere, redundantly.
Change-Id: Ie76e9af6845cc87b0b847050b031e57d95b1a31b
Reviewed-on: https://gerrit.libreoffice.org/59674
Tested-by: Jenkins
Reviewed-by: Justin Luth <justin_luth@sil.org>
Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk>
diff --git a/sw/qa/extras/ooxmlexport/data/tdf82177_insideCellBorders.docx b/sw/qa/extras/ooxmlexport/data/tdf82177_insideCellBorders.docx
new file mode 100644
index 0000000..f1f0d27
--- /dev/null
+++ b/sw/qa/extras/ooxmlexport/data/tdf82177_insideCellBorders.docx
Binary files differ
diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport11.cxx b/sw/qa/extras/ooxmlexport/ooxmlexport11.cxx
index e5ef60d..3365037 100644
--- a/sw/qa/extras/ooxmlexport/ooxmlexport11.cxx
+++ b/sw/qa/extras/ooxmlexport/ooxmlexport11.cxx
@@ -485,6 +485,16 @@ DECLARE_OOXMLEXPORT_TEST(testTdf82177_outsideCellBorders, "tdf82177_outsideCellB
CPPUNIT_ASSERT_EQUAL(static_cast<sal_uInt32>(0), getProperty<table::BorderLine2>(xCell, "LeftBorder").LineWidth);
}
DECLARE_OOXMLEXPORT_TEST(testTdf82177_insideCellBorders, "tdf82177_insideCellBorders.docx")
{
uno::Reference<text::XTextTablesSupplier> xTablesSupplier(mxComponent, uno::UNO_QUERY);
uno::Reference<container::XIndexAccess> xTables(xTablesSupplier->getTextTables(), uno::UNO_QUERY);
uno::Reference< text::XTextTable > xTable( xTables->getByIndex(0), uno::UNO_QUERY );
uno::Reference< table::XCell > xCell = xTable->getCellByName( "E4" );
CPPUNIT_ASSERT_EQUAL(static_cast<sal_uInt32>(0), getProperty<table::BorderLine2>(xCell, "TopBorder").LineWidth);
CPPUNIT_ASSERT_EQUAL(static_cast<sal_uInt32>(0), getProperty<table::BorderLine2>(xCell, "LeftBorder").LineWidth);
}
DECLARE_OOXMLEXPORT_TEST(testTdf116976, "tdf116976.docx")
{
// This was 0, relative size of shape after bitmap was ignored.
diff --git a/writerfilter/source/dmapper/DomainMapperTableHandler.cxx b/writerfilter/source/dmapper/DomainMapperTableHandler.cxx
index 94861a7..bf9421c 100644
--- a/writerfilter/source/dmapper/DomainMapperTableHandler.cxx
+++ b/writerfilter/source/dmapper/DomainMapperTableHandler.cxx
@@ -669,6 +669,10 @@ CellPropertyValuesSeq_t DomainMapperTableHandler::endTableGetCellProperties(Tabl
//aCellIterator points to a PropertyMapPtr;
if( *aCellIterator )
{
// remove directly applied insideV/H borders since they are meaningless without a context (tdf#82177)
(*aCellIterator)->Erase(META_PROP_VERTICAL_BORDER);
(*aCellIterator)->Erase(META_PROP_HORIZONTAL_BORDER);
pAllCellProps->InsertProps(rInfo.pTableDefaults);
sal_Int32 nCellStyleMask = 0;