summaryrefslogtreecommitdiff
path: root/sw/source/filter
diff options
context:
space:
mode:
authorJustin Luth <justin.luth@collabora.com>2018-08-25 22:22:55 +0300
committerMiklos Vajna <vmiklos@collabora.co.uk>2018-08-31 17:58:52 +0200
commitcecf71c18da5430c10daa8522d38d5144edefc14 (patch)
treee5598e6c79c880a6a81ad4944c7198c05d6a9be1 /sw/source/filter
parent347a86962bffeaf7420c390a733d2ddd1d78efeb (diff)
tdf#82177 docx export: no inside borders on outside cells
Well, not on the bottom or right outside cells. Obviously the presence of a bottom or a right in those cases doesn't indicate an inside line. Change-Id: I5d0661fd60f478a392b12fe9093c2e47e130631b Reviewed-on: https://gerrit.libreoffice.org/59600 Tested-by: Jenkins Reviewed-by: Justin Luth <justin_luth@sil.org> Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk>
Diffstat (limited to 'sw/source/filter')
-rw-r--r--sw/source/filter/ww8/WW8TableInfo.cxx4
-rw-r--r--sw/source/filter/ww8/WW8TableInfo.hxx1
-rw-r--r--sw/source/filter/ww8/docxattributeoutput.cxx17
3 files changed, 17 insertions, 5 deletions
diff --git a/sw/source/filter/ww8/WW8TableInfo.cxx b/sw/source/filter/ww8/WW8TableInfo.cxx
index 9713931d1e65..b41639243669 100644
--- a/sw/source/filter/ww8/WW8TableInfo.cxx
+++ b/sw/source/filter/ww8/WW8TableInfo.cxx
@@ -120,6 +120,10 @@ void WW8TableNodeInfoInner::setRect(const SwRect & rRect)
maRect = rRect;
}
+bool WW8TableNodeInfoInner::isFinalRow() const
+{
+ return mpTable && mpTable->GetTabLines().size() - 1 == mnRow;
+}
const SwNode * WW8TableNodeInfoInner::getNode() const
{
diff --git a/sw/source/filter/ww8/WW8TableInfo.hxx b/sw/source/filter/ww8/WW8TableInfo.hxx
index a3b6df799180..f2a2db21806a 100644
--- a/sw/source/filter/ww8/WW8TableInfo.hxx
+++ b/sw/source/filter/ww8/WW8TableInfo.hxx
@@ -94,6 +94,7 @@ 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 77101984d429..adb5e65d913b 100644
--- a/sw/source/filter/ww8/docxattributeoutput.cxx
+++ b/sw/source/filter/ww8/docxattributeoutput.cxx
@@ -3063,8 +3063,13 @@ static OutputBorderOptions lcl_getBoxBorderOptions()
return rOptions;
}
-static void impl_borders( FSHelperPtr const & pSerializer, const SvxBoxItem& rBox, const OutputBorderOptions& rOptions,
- std::map<SvxBoxItemLine, css::table::BorderLine2> &rTableStyleConf )
+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 )
{
static const SvxBoxItemLine aBorders[] =
{
@@ -3156,14 +3161,14 @@ static void impl_borders( FSHelperPtr const & pSerializer, const SvxBoxItem& rBo
bWriteInsideV = true;
}
}
- if (bWriteInsideH)
+ if (bWriteInsideH && !bIsLastRow)
{
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)
+ if (bWriteInsideV && !bIsLastColumn)
{
const table::BorderLine2 *aStyleProps = nullptr;
if( rTableStyleConf.find( SvxBoxItemLine::RIGHT ) != rTableStyleConf.end() )
@@ -3232,6 +3237,8 @@ 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 );
@@ -3291,7 +3298,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 );
+ impl_borders( m_pSerializer, rBox, lcl_getTableCellBorderOptions(bEcma), m_aTableStyleConf, bIsLastColumn, bIsLastRow );
}
TableBackgrounds( pTableTextNodeInfoInner );