summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJustin Luth <justin_luth@sil.org>2018-09-08 12:11:01 +0300
committerAndras Timar <andras.timar@collabora.com>2018-09-12 10:19:54 +0200
commit713e8d6ebc5e25c287dcc645cc61b247d50edf3a (patch)
tree144fe2f1423363aecc6624b16b2f23439f315e8d
parent5506be988d157ba9c9448ab22bfcc2470dadd3b7 (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> (cherry picked from commit d934fe802c228d5478cea228b84ba56b6c9b9241)
-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 22ab51aff521..77953b1e6e40 100644
--- a/sw/qa/extras/ooxmlexport/ooxmlexport5.cxx
+++ b/sw/qa/extras/ooxmlexport/ooxmlexport5.cxx
@@ -687,15 +687,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 71fb8d1cd4d7..3339fbe2c599 100644
--- a/sw/source/filter/ww8/WW8TableInfo.cxx
+++ b/sw/source/filter/ww8/WW8TableInfo.cxx
@@ -119,11 +119,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 5ada807693dc..3afa61c66d6b 100644
--- a/sw/source/filter/ww8/docxattributeoutput.cxx
+++ b/sw/source/filter/ww8/docxattributeoutput.cxx
@@ -3025,7 +3025,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;
@@ -3048,9 +3048,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[] =
{
@@ -3142,14 +3140,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() )
@@ -3218,8 +3216,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 );
@@ -3279,7 +3275,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 );