summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--sw/qa/extras/ooxmlexport/data/tdf82177_tblBorders.docxbin0 -> 9673 bytes
-rw-r--r--sw/qa/extras/ooxmlexport/ooxmlexport11.cxx10
-rw-r--r--sw/qa/extras/ooxmlexport/ooxmlexport2.cxx11
-rw-r--r--sw/qa/extras/ooxmlexport/ooxmlexport5.cxx10
-rw-r--r--sw/qa/extras/ooxmlexport/ooxmlexport9.cxx10
-rw-r--r--sw/source/filter/ww8/docxattributeoutput.cxx27
-rw-r--r--sw/source/filter/ww8/docxattributeoutput.hxx1
7 files changed, 20 insertions, 49 deletions
diff --git a/sw/qa/extras/ooxmlexport/data/tdf82177_tblBorders.docx b/sw/qa/extras/ooxmlexport/data/tdf82177_tblBorders.docx
new file mode 100644
index 000000000000..88a237cf69c2
--- /dev/null
+++ b/sw/qa/extras/ooxmlexport/data/tdf82177_tblBorders.docx
Binary files differ
diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport11.cxx b/sw/qa/extras/ooxmlexport/ooxmlexport11.cxx
index 35209c0cecc3..c7400b974394 100644
--- a/sw/qa/extras/ooxmlexport/ooxmlexport11.cxx
+++ b/sw/qa/extras/ooxmlexport/ooxmlexport11.cxx
@@ -527,6 +527,16 @@ DECLARE_OOXMLEXPORT_TEST(testTdf82177_insideCellBorders, "tdf82177_insideCellBor
CPPUNIT_ASSERT_EQUAL(static_cast<sal_uInt32>(0), getProperty<table::BorderLine2>(xCell, "LeftBorder").LineWidth);
}
+DECLARE_OOXMLEXPORT_TEST(testTdf82177_tblBorders, "tdf82177_tblBorders.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( "E5" );
+ 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/sw/qa/extras/ooxmlexport/ooxmlexport2.cxx b/sw/qa/extras/ooxmlexport/ooxmlexport2.cxx
index 6da4c52fb83d..5e1ce6a70ffe 100644
--- a/sw/qa/extras/ooxmlexport/ooxmlexport2.cxx
+++ b/sw/qa/extras/ooxmlexport/ooxmlexport2.cxx
@@ -345,17 +345,6 @@ DECLARE_OOXMLEXPORT_TEST(testMathVerticalStacks, "math-vertical_stacks.docx")
DECLARE_OOXMLEXPORT_TEST(testTable, "table.odt")
{
- // Validation test: order of elements were wrong.
- xmlDocPtr pXmlDoc = parseExport("word/document.xml");
- if (!pXmlDoc)
- return;
- // Order was: insideH, end, insideV.
- int nEnd = getXPathPosition(pXmlDoc, "/w:document/w:body/w:tbl/w:tblPr/w:tblBorders", "end");
- int nInsideH = getXPathPosition(pXmlDoc, "/w:document/w:body/w:tbl/w:tblPr/w:tblBorders", "insideH");
- int nInsideV = getXPathPosition(pXmlDoc, "/w:document/w:body/w:tbl/w:tblPr/w:tblBorders", "insideV");
- CPPUNIT_ASSERT(nEnd < nInsideH);
- CPPUNIT_ASSERT(nInsideH < nInsideV);
-
// Make sure we write qFormat for well-known style names.
assertXPath(parseExport("word/styles.xml"), "//w:style[@w:styleId='Normal']/w:qFormat", 1);
}
diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport5.cxx b/sw/qa/extras/ooxmlexport/ooxmlexport5.cxx
index 809ff6ecb88f..858f20d0e3b9 100644
--- a/sw/qa/extras/ooxmlexport/ooxmlexport5.cxx
+++ b/sw/qa/extras/ooxmlexport/ooxmlexport5.cxx
@@ -680,16 +680,6 @@ DECLARE_OOXMLEXPORT_TEST(testfdo80097, "fdo80097.docx")
assertXPath(pXmlDocument, "/w:document/w:body/w:tbl/w:tr[1]/w:tc[1]/w:tbl/w:tblPr/w:tblBorders/w:bottom[@w:space = 0]", 1);
assertXPath(pXmlDocument, "/w:document/w:body/w:tbl/w:tr[1]/w:tc[1]/w:tbl/w:tblPr/w:tblBorders/w:bottom[@w:color = '000000']", 1);
- assertXPath(pXmlDocument, "/w:document/w:body/w:tbl/w:tr[1]/w:tc[1]/w:tbl/w:tblPr/w:tblBorders/w:insideH[@w:val = 'single']",1);
- assertXPath(pXmlDocument, "/w:document/w:body/w:tbl/w:tr[1]/w:tc[1]/w:tbl/w:tblPr/w:tblBorders/w:insideH[@w:sz = 4]", 1);
- assertXPath(pXmlDocument, "/w:document/w:body/w:tbl/w:tr[1]/w:tc[1]/w:tbl/w:tblPr/w:tblBorders/w:insideH[@w:space = 0]", 1);
- assertXPath(pXmlDocument, "/w:document/w:body/w:tbl/w:tr[1]/w:tc[1]/w:tbl/w:tblPr/w:tblBorders/w:insideH[@w:color = '000000']", 1);
-
- assertXPath(pXmlDocument, "/w:document/w:body/w:tbl/w:tr[1]/w:tc[1]/w:tbl/w:tblPr/w:tblBorders/w:insideV[@w:val = 'single']",1);
- assertXPath(pXmlDocument, "/w:document/w:body/w:tbl/w:tr[1]/w:tc[1]/w:tbl/w:tblPr/w:tblBorders/w:insideV[@w:sz = 4]", 1);
- assertXPath(pXmlDocument, "/w:document/w:body/w:tbl/w:tr[1]/w:tc[1]/w:tbl/w:tblPr/w:tblBorders/w:insideV[@w:space = 0]", 1);
- assertXPath(pXmlDocument, "/w:document/w:body/w:tbl/w:tr[1]/w:tc[1]/w:tbl/w:tblPr/w:tblBorders/w:insideV[@w:color = '000000']", 1);
-
//Table Cell Borders
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:top[@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:top[@w:sz = 4]", 1);
diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport9.cxx b/sw/qa/extras/ooxmlexport/ooxmlexport9.cxx
index fbe0c2339b6b..750a3cc24e07 100644
--- a/sw/qa/extras/ooxmlexport/ooxmlexport9.cxx
+++ b/sw/qa/extras/ooxmlexport/ooxmlexport9.cxx
@@ -172,6 +172,16 @@ DECLARE_OOXMLEXPORT_TEST(testTdf79272_strictDxa, "tdf79272_strictDxa.docx")
uno::Reference<text::XTextTablesSupplier> xTablesSupplier(mxComponent, uno::UNO_QUERY);
uno::Reference<container::XIndexAccess> xTables(xTablesSupplier->getTextTables(), uno::UNO_QUERY);
CPPUNIT_ASSERT_EQUAL(sal_Int32(4318), getProperty<sal_Int32>(xTables->getByIndex(0), "Width"));
+
+ xmlDocPtr pXmlDoc = parseExport("word/styles.xml");
+ if (!pXmlDoc)
+ return;
+ // Validation test: order of elements was wrong. Order was: insideH, end, insideV.
+ int nEnd = getXPathPosition(pXmlDoc, "/w:styles/w:style[@w:styleId='TableGrid']/w:tblPr/w:tblBorders", "end");
+ int nInsideH = getXPathPosition(pXmlDoc, "/w:styles/w:style[@w:styleId='TableGrid']/w:tblPr/w:tblBorders", "insideH");
+ int nInsideV = getXPathPosition(pXmlDoc, "/w:styles/w:style[@w:styleId='TableGrid']/w:tblPr/w:tblBorders", "insideV");
+ CPPUNIT_ASSERT(nEnd < nInsideH);
+ CPPUNIT_ASSERT(nInsideH < nInsideV);
}
DECLARE_OOXMLEXPORT_TEST(testTdf109306, "tdf109306.docx")
diff --git a/sw/source/filter/ww8/docxattributeoutput.cxx b/sw/source/filter/ww8/docxattributeoutput.cxx
index 2d4816c50b66..505ea1b74f8a 100644
--- a/sw/source/filter/ww8/docxattributeoutput.cxx
+++ b/sw/source/filter/ww8/docxattributeoutput.cxx
@@ -3031,7 +3031,6 @@ static OutputBorderOptions lcl_getTableDefaultBorderOptions(bool bEcma)
rOptions.tag = XML_tblBorders;
rOptions.bUseStartEnd = !bEcma;
rOptions.bWriteTag = true;
- rOptions.bWriteInsideHV = true;
rOptions.bWriteDistance = false;
return rOptions;
@@ -3044,7 +3043,6 @@ static OutputBorderOptions lcl_getTableCellBorderOptions(bool bEcma)
rOptions.tag = XML_tcBorders;
rOptions.bUseStartEnd = !bEcma;
rOptions.bWriteTag = true;
- rOptions.bWriteInsideHV = false;
rOptions.bWriteDistance = false;
return rOptions;
@@ -3057,7 +3055,6 @@ static OutputBorderOptions lcl_getBoxBorderOptions()
rOptions.tag = XML_pBdr;
rOptions.bUseStartEnd = false;
rOptions.bWriteTag = false;
- rOptions.bWriteInsideHV = false;
rOptions.bWriteDistance = true;
return rOptions;
@@ -3084,8 +3081,6 @@ static void impl_borders( FSHelperPtr const & pSerializer,
bool tagWritten = false;
const SvxBoxItemLine* pBrd = aBorders;
- bool bWriteInsideH = false;
- bool bWriteInsideV = false;
for( int i = 0; i < 4; ++i, ++pBrd )
{
const SvxBorderLine* pLn = rBox.GetLine( *pBrd );
@@ -3150,28 +3145,6 @@ static void impl_borders( FSHelperPtr const & pSerializer,
}
impl_borderLine( pSerializer, aXmlElements[i], pLn, nDist, bWriteShadow, aStyleProps );
-
- // When exporting default borders, we need to export these 2 attr
- if ( rOptions.bWriteInsideHV) {
- if ( i == 2 )
- bWriteInsideH = true;
- else if ( i == 3 )
- bWriteInsideV = true;
- }
- }
- 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)
- {
- const table::BorderLine2 *aStyleProps = nullptr;
- if( rTableStyleConf.find( SvxBoxItemLine::RIGHT ) != rTableStyleConf.end() )
- aStyleProps = &rTableStyleConf[ SvxBoxItemLine::RIGHT ];
- impl_borderLine( pSerializer, XML_insideV, rBox.GetLine(SvxBoxItemLine::RIGHT), 0, false, aStyleProps );
}
if (tagWritten && rOptions.bWriteTag) {
pSerializer->endElementNS( XML_w, rOptions.tag );
diff --git a/sw/source/filter/ww8/docxattributeoutput.hxx b/sw/source/filter/ww8/docxattributeoutput.hxx
index 89263c239d6a..7f647ed52973 100644
--- a/sw/source/filter/ww8/docxattributeoutput.hxx
+++ b/sw/source/filter/ww8/docxattributeoutput.hxx
@@ -84,7 +84,6 @@ struct OutputBorderOptions
sal_Int32 tag = 0;
bool bUseStartEnd = false;
bool bWriteTag = true;
- bool bWriteInsideHV = false;
bool bWriteDistance = false;
SvxShadowLocation aShadowLocation = SvxShadowLocation::NONE;
std::shared_ptr<editeng::WordBorderDistances> pDistances;