summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPierre-Eric Pelloux-Prayer <pierre-eric@lanedo.com>2012-10-25 14:47:30 +0200
committerMiklos Vajna <vmiklos@suse.cz>2012-10-29 16:47:28 +0000
commit78a5ce35db4cc762bbbc68e39dba1f73367ec520 (patch)
tree65965239721531aaf2430a1ba095eb876e487bee
parent69299e517b8f87089339c2b674be174a3f8b69be (diff)
docx export: explicitely use 'none' type for disabled cell borders
Otherwise, the table default borders will be used. Change-Id: Iebab1204dc40f79e10164e4815bbdbbe054ef144 Reviewed-on: https://gerrit.libreoffice.org/909 Reviewed-by: Miklos Vajna <vmiklos@suse.cz> Tested-by: Miklos Vajna <vmiklos@suse.cz>
-rw-r--r--sw/source/filter/ww8/docxattributeoutput.cxx41
1 files changed, 19 insertions, 22 deletions
diff --git a/sw/source/filter/ww8/docxattributeoutput.cxx b/sw/source/filter/ww8/docxattributeoutput.cxx
index 5ccf51dde312..5a91c4354fbf 100644
--- a/sw/source/filter/ww8/docxattributeoutput.cxx
+++ b/sw/source/filter/ww8/docxattributeoutput.cxx
@@ -1349,7 +1349,7 @@ static void impl_borderLine( FSHelperPtr pSerializer, sal_Int32 elementToken, co
// thickThinMediumGap, thickThinLargeGap, thickThinSmallGap
// thinThickLargeGap, thinThickMediumGap, thinThickSmallGap
const char* pVal = "none";
- if ( !pBorderLine->isEmpty( ) )
+ if ( pBorderLine && !pBorderLine->isEmpty( ) )
{
switch (pBorderLine->GetBorderLineStyle())
{
@@ -1403,7 +1403,7 @@ static void impl_borderLine( FSHelperPtr pSerializer, sal_Int32 elementToken, co
pAttr->add( FSNS( XML_w, XML_val ), OString( pVal ) );
- if ( !pBorderLine->isEmpty() )
+ if ( pBorderLine && !pBorderLine->isEmpty() )
{
// Compute the sz attribute
@@ -1452,32 +1452,29 @@ static void impl_pageBorders( FSHelperPtr pSerializer, const SvxBoxItem& rBox, s
for( int i = 0; i < 4; ++i, ++pBrd )
{
const SvxBorderLine* pLn = rBox.GetLine( *pBrd );
- if ( pLn )
+ if ( pDefaultBorders && pLn )
{
- if ( pDefaultBorders )
- {
- const SvxBorderLine* pRefLn = pDefaultBorders->GetLine( *pBrd );
+ const SvxBorderLine* pRefLn = pDefaultBorders->GetLine( *pBrd );
- // If border is equal to default border: do not output
- if ( pRefLn && *pLn == *pRefLn) {
- continue;
- }
+ // If border is equal to default border: do not output
+ if ( pRefLn && *pLn == *pRefLn) {
+ continue;
}
+ }
- if (!tagWritten && bWriteTag) {
- pSerializer->startElementNS( XML_w, tag, FSEND );
- tagWritten = true;
- }
+ if (!tagWritten && bWriteTag) {
+ pSerializer->startElementNS( XML_w, tag, FSEND );
+ tagWritten = true;
+ }
- impl_borderLine( pSerializer, aXmlElements[i], pLn, 0 );
+ impl_borderLine( pSerializer, aXmlElements[i], pLn, 0 );
- // When exporting default borders, we need to export these 2 attr
- if ( pDefaultBorders == 0 ) {
- if ( i == 2 )
- impl_borderLine( pSerializer, XML_insideH, pLn, 0 );
- else if ( i == 3 )
- impl_borderLine( pSerializer, XML_insideV, pLn, 0 );
- }
+ // When exporting default borders, we need to export these 2 attr
+ if ( pDefaultBorders == 0 ) {
+ if ( i == 2 )
+ impl_borderLine( pSerializer, XML_insideH, pLn, 0 );
+ else if ( i == 3 )
+ impl_borderLine( pSerializer, XML_insideV, pLn, 0 );
}
}
if (tagWritten && bWriteTag) {