summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJustin Luth <justin_luth@sil.org>2018-09-08 12:11:01 +0300
committerMiklos Vajna <vmiklos@collabora.co.uk>2018-09-10 10:01:11 +0200
commitd934fe802c228d5478cea228b84ba56b6c9b9241 (patch)
treeba2c07b4325865fb2e566d634589a39126497422
parentcc7280efdbfefd96eb96b63dc8bd171d39704388 (diff)
tdf#82177 docx export: eliminate invalid tcPr insideV/H borders
better fix than cecf71c18da5430c10daa8522d38d5144edefc14 since: 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 an 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. Tablestyle cell groupings are handled elsewhere via grabbag dumps, so insideV/H borders can be eliminated from TableCellProperties. Change-Id: I128417f0a0b485c85ede463daacb8feabc457302 Reviewed-on: https://gerrit.libreoffice.org/60187 Tested-by: Jenkins Reviewed-by: Justin Luth <justin_luth@sil.org> Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk>
-rw-r--r--sw/qa/extras/ooxmlexport/ooxmlexport5.cxx11
-rw-r--r--sw/source/filter/ww8/WW8TableInfo.cxx5
-rw-r--r--sw/source/filter/ww8/WW8TableInfo.hxx1
-rw-r--r--sw/source/filter/ww8/docxattributeoutput.cxx14
4 files changed, 7 insertions, 24 deletions
diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport5.cxx b/sw/qa/extras/ooxmlexport/ooxmlexport5.cxx
index eba875d4cbe3..809ff6ecb88f 100644
--- a/sw/qa/extras/ooxmlexport/ooxmlexport5.cxx
+++ b/sw/qa/extras/ooxmlexport/ooxmlexport5.cxx
@@ -701,15 +701,8 @@ DECLARE_OOXMLEXPORT_TEST(testfdo80097, "fdo80097.docx")
assertXPath(pXmlDocument, "/w:document/w:body/w:tbl/w:tr[1]/w:tc[1]/w:tbl/w:tr[1]/w:tc[1]/w:tcPr/w:tcBorders/w:bottom[@w:space = 0]", 1);
assertXPath(pXmlDocument, "/w:document/w:body/w:tbl/w:tr[1]/w:tc[1]/w:tbl/w:tr[1]/w:tc[1]/w:tcPr/w:tcBorders/w:bottom[@w:color = '000000']", 1);
- assertXPath(pXmlDocument, "/w:document/w:body/w:tbl/w:tr[1]/w:tc[1]/w:tbl/w:tr[1]/w:tc[1]/w:tcPr/w:tcBorders/w:insideH[@w:val = 'single']",1);
- assertXPath(pXmlDocument, "/w:document/w:body/w:tbl/w:tr[1]/w:tc[1]/w:tbl/w:tr[1]/w:tc[1]/w:tcPr/w:tcBorders/w:insideH[@w:sz = 4]", 1);
- assertXPath(pXmlDocument, "/w:document/w:body/w:tbl/w:tr[1]/w:tc[1]/w:tbl/w:tr[1]/w:tc[1]/w:tcPr/w:tcBorders/w:insideH[@w:space = 0]", 1);
- assertXPath(pXmlDocument, "/w:document/w:body/w:tbl/w:tr[1]/w:tc[1]/w:tbl/w:tr[1]/w:tc[1]/w:tcPr/w:tcBorders/w:insideH[@w:color = '000000']", 1);
-
- assertXPath(pXmlDocument, "/w:document/w:body/w:tbl/w:tr[1]/w:tc[1]/w:tbl/w:tr[1]/w:tc[1]/w:tcPr/w:tcBorders/w:insideV[@w:val = 'single']",1);
- assertXPath(pXmlDocument, "/w:document/w:body/w:tbl/w:tr[1]/w:tc[1]/w:tbl/w:tr[1]/w:tc[1]/w:tcPr/w:tcBorders/w:insideV[@w:sz = 4]", 1);
- assertXPath(pXmlDocument, "/w:document/w:body/w:tbl/w:tr[1]/w:tc[1]/w:tbl/w:tr[1]/w:tc[1]/w:tcPr/w:tcBorders/w:insideV[@w:space = 0]", 1);
- assertXPath(pXmlDocument, "/w:document/w:body/w:tbl/w:tr[1]/w:tc[1]/w:tbl/w:tr[1]/w:tc[1]/w:tcPr/w:tcBorders/w:insideV[@w:color = '000000']", 1);
+ assertXPath(pXmlDocument, "/w:document/w:body/w:tbl/w:tr[1]/w:tc[1]/w:tbl/w:tr[1]/w:tc[1]/w:tcPr/w:tcBorders/w:insideH",0);
+ assertXPath(pXmlDocument, "/w:document/w:body/w:tbl/w:tr[1]/w:tc[1]/w:tbl/w:tr[1]/w:tc[1]/w:tcPr/w:tcBorders/w:insideV",0);
}
DECLARE_OOXMLEXPORT_TEST(testFdo77129, "fdo77129.docx")
diff --git a/sw/source/filter/ww8/WW8TableInfo.cxx b/sw/source/filter/ww8/WW8TableInfo.cxx
index b41639243669..e27e3393f3bd 100644
--- a/sw/source/filter/ww8/WW8TableInfo.cxx
+++ b/sw/source/filter/ww8/WW8TableInfo.cxx
@@ -120,11 +120,6 @@ void WW8TableNodeInfoInner::setRect(const SwRect & rRect)
maRect = rRect;
}
-bool WW8TableNodeInfoInner::isFinalRow() const
-{
- return mpTable && mpTable->GetTabLines().size() - 1 == mnRow;
-}
-
const SwNode * WW8TableNodeInfoInner::getNode() const
{
const SwNode * pResult = nullptr;
diff --git a/sw/source/filter/ww8/WW8TableInfo.hxx b/sw/source/filter/ww8/WW8TableInfo.hxx
index f2a2db21806a..a3b6df799180 100644
--- a/sw/source/filter/ww8/WW8TableInfo.hxx
+++ b/sw/source/filter/ww8/WW8TableInfo.hxx
@@ -94,7 +94,6 @@ public:
bool isEndOfCell() const { return mbEndOfCell;}
bool isEndOfLine() const { return mbEndOfLine;}
bool isFinalEndOfLine() const { return mbFinalEndOfLine;}
- bool isFinalRow() const;
bool isFirstInTable() const { return mbFirstInTable;}
const SwTableBox * getTableBox() const { return mpTableBox;}
const SwTable * getTable() const { return mpTable;}
diff --git a/sw/source/filter/ww8/docxattributeoutput.cxx b/sw/source/filter/ww8/docxattributeoutput.cxx
index af29b9fcd4e0..05e4dfdc7bb5 100644
--- a/sw/source/filter/ww8/docxattributeoutput.cxx
+++ b/sw/source/filter/ww8/docxattributeoutput.cxx
@@ -3044,7 +3044,7 @@ static OutputBorderOptions lcl_getTableCellBorderOptions(bool bEcma)
rOptions.tag = XML_tcBorders;
rOptions.bUseStartEnd = !bEcma;
rOptions.bWriteTag = true;
- rOptions.bWriteInsideHV = true;
+ rOptions.bWriteInsideHV = false;
rOptions.bWriteDistance = false;
return rOptions;
@@ -3067,9 +3067,7 @@ static void impl_borders( FSHelperPtr const & pSerializer,
const SvxBoxItem& rBox,
const OutputBorderOptions& rOptions,
std::map<SvxBoxItemLine,
- css::table::BorderLine2> &rTableStyleConf,
- const bool bIsLastColumn = false,
- const bool bIsLastRow = false )
+ css::table::BorderLine2> &rTableStyleConf )
{
static const SvxBoxItemLine aBorders[] =
{
@@ -3161,14 +3159,14 @@ static void impl_borders( FSHelperPtr const & pSerializer,
bWriteInsideV = true;
}
}
- if (bWriteInsideH && !bIsLastRow)
+ if (bWriteInsideH)
{
const table::BorderLine2 *aStyleProps = nullptr;
if( rTableStyleConf.find( SvxBoxItemLine::BOTTOM ) != rTableStyleConf.end() )
aStyleProps = &rTableStyleConf[ SvxBoxItemLine::BOTTOM ];
impl_borderLine( pSerializer, XML_insideH, rBox.GetLine(SvxBoxItemLine::BOTTOM), 0, false, aStyleProps );
}
- if (bWriteInsideV && !bIsLastColumn)
+ if (bWriteInsideV)
{
const table::BorderLine2 *aStyleProps = nullptr;
if( rTableStyleConf.find( SvxBoxItemLine::RIGHT ) != rTableStyleConf.end() )
@@ -3237,8 +3235,6 @@ void DocxAttributeOutput::TableCellProperties( ww8::WW8TableNodeInfoInner::Point
const SwTableBox *pTableBox = pTableTextNodeInfoInner->getTableBox( );
bool bEcma = GetExport().GetFilter().getVersion( ) == oox::core::ECMA_DIALECT;
- const bool bIsLastColumn = pTableTextNodeInfoInner->isEndOfLine();
- const bool bIsLastRow = pTableTextNodeInfoInner->isFinalRow();
// Output any table cell redlines if there are any attached to this specific cell
TableCellRedline( pTableTextNodeInfoInner );
@@ -3298,7 +3294,7 @@ void DocxAttributeOutput::TableCellProperties( ww8::WW8TableNodeInfoInner::Point
const SvxBoxItem& rDefaultBox = (*tableFirstCells.rbegin())->getTableBox( )->GetFrameFormat( )->GetBox( );
{
// The cell borders
- impl_borders( m_pSerializer, rBox, lcl_getTableCellBorderOptions(bEcma), m_aTableStyleConf, bIsLastColumn, bIsLastRow );
+ impl_borders( m_pSerializer, rBox, lcl_getTableCellBorderOptions(bEcma), m_aTableStyleConf );
}
TableBackgrounds( pTableTextNodeInfoInner );