summaryrefslogtreecommitdiff
path: root/sw
diff options
context:
space:
mode:
authorPierre-Eric Pelloux-Prayer <pierre-eric@lanedo.com>2013-08-28 15:28:38 +0200
committerCaolán McNamara <caolanm@redhat.com>2013-09-01 13:46:09 +0000
commit35657f636580227e364ccf089ef434d3dbeee6ba (patch)
tree9ca12939a9b9df61e5a51f0d7991241265672978 /sw
parent91455ec39fef5b16fc6873a51d3963941a952347 (diff)
docx export: simplify pgBorders handling, and fix pgSz bug
If a document had page borders, pgSz was wrongly exported as a child of pgBorders. Change-Id: Ibd47d3efd387f942274c0162fd0cbc46662348d5 Reviewed-on: https://gerrit.libreoffice.org/5664 Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
Diffstat (limited to 'sw')
-rw-r--r--sw/source/filter/ww8/docxattributeoutput.cxx32
-rw-r--r--sw/source/filter/ww8/wrtw8sty.cxx3
2 files changed, 16 insertions, 19 deletions
diff --git a/sw/source/filter/ww8/docxattributeoutput.cxx b/sw/source/filter/ww8/docxattributeoutput.cxx
index 2cf7058cabe3..342bd750215e 100644
--- a/sw/source/filter/ww8/docxattributeoutput.cxx
+++ b/sw/source/filter/ww8/docxattributeoutput.cxx
@@ -3230,10 +3230,22 @@ void DocxAttributeOutput::SectionPageBorders( const SwFrmFmt* pFmt, const SwFrmF
FSNS( XML_w, XML_offsetFrom ), bExportDistanceFromPageEdge ? "page" : "text",
FSEND );
- m_pSerializer->mark();
+ OutputBorderOptions aOutputBorderOptions = lcl_getBoxBorderOptions();
+
+ // Check if the distance is larger than 31 points
+ aOutputBorderOptions.bCheckDistanceSize = true;
+
+ // Check if there is a shadow item
+ const SfxPoolItem* pItem = GetExport().HasItem( RES_SHADOW );
+ if ( pItem )
+ {
+ const SvxShadowItem* pShadowItem = (const SvxShadowItem*)pItem;
+ aOutputBorderOptions.aShadowLocation = pShadowItem->GetLocation();
+ }
+
+ impl_borders( m_pSerializer, rBox, aOutputBorderOptions, &m_pageMargins );
m_pSerializer->endElementNS( XML_w, XML_pgBorders );
- m_pSerializer->mark();
}
}
@@ -5177,21 +5189,7 @@ void DocxAttributeOutput::FormatBox( const SvxBoxItem& rBox )
aOutputBorderOptions.aShadowLocation = pShadowItem->GetLocation();
}
-
- if ( m_bOpenedSectPr && GetWritingHeaderFooter() == false)
- {
- // Inside a section
-
- // Check if the distance is larger than 31 points
- aOutputBorderOptions.bCheckDistanceSize = true;
-
- impl_borders( m_pSerializer, rBox, aOutputBorderOptions, &m_pageMargins );
-
- // Special handling for pgBorder
- m_pSerializer->mergeTopMarks( sax_fastparser::MERGE_MARKS_PREPEND );
- m_pSerializer->mergeTopMarks( );
- }
- else
+ if ( !m_bOpenedSectPr || GetWritingHeaderFooter())
{
// Not inside a section
diff --git a/sw/source/filter/ww8/wrtw8sty.cxx b/sw/source/filter/ww8/wrtw8sty.cxx
index 9f29d9132281..573e98a1bdcb 100644
--- a/sw/source/filter/ww8/wrtw8sty.cxx
+++ b/sw/source/filter/ww8/wrtw8sty.cxx
@@ -1664,8 +1664,6 @@ void MSWordExportBase::SectionProperties( const WW8_SepInfo& rSepInfo, WW8_PdAtt
const SfxItemSet* pOldI = pISet;
- AttrOutput().SectionPageBorders( pPdFmt, pPdFirstPgFmt );
-
const SfxPoolItem* pItem;
if ( titlePage && SFX_ITEM_SET ==
pPdFirstPgFmt->GetItemState( RES_PAPER_BIN, true, &pItem ) )
@@ -1700,6 +1698,7 @@ void MSWordExportBase::SectionProperties( const WW8_SepInfo& rSepInfo, WW8_PdAtt
pISet = &pPdFmt->GetAttrSet();
AttrOutput().OutputStyleItemSet( pPdFmt->GetAttrSet(), true, false );
+ AttrOutput().SectionPageBorders( pPdFmt, pPdFirstPgFmt );
pISet = pOldI;
// then the rest of the settings from PageDesc