diff options
author | Luboš Luňák <l.lunak@suse.cz> | 2012-08-06 11:43:44 +0200 |
---|---|---|
committer | Luboš Luňák <l.lunak@suse.cz> | 2012-08-08 16:32:55 +0200 |
commit | 2f8f63f15a5a93781e4feceddeee18df74dc326a (patch) | |
tree | 3c6a9da0a8fe25693ddcea25a0cd44f97cfb917f /sw/source | |
parent | 0633acb6512debb4a7af8ae2d249bfb8b2551c8b (diff) |
don't write out empty <w:tabs>, not allowed by the .docx spec
Change-Id: I30a24da0e6a568ed57d936fe769d47ea8465096d
Diffstat (limited to 'sw/source')
-rw-r--r-- | sw/source/filter/ww8/docxattributeoutput.cxx | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/sw/source/filter/ww8/docxattributeoutput.cxx b/sw/source/filter/ww8/docxattributeoutput.cxx index 3cb9d85e469f..8a93e1d0b6ee 100644 --- a/sw/source/filter/ww8/docxattributeoutput.cxx +++ b/sw/source/filter/ww8/docxattributeoutput.cxx @@ -3752,9 +3752,19 @@ void DocxAttributeOutput::ParaTabStop( const SvxTabStopItem& rTabStop ) const SfxPoolItem* pLR = m_rExport.HasItem( RES_LR_SPACE ); long nCurrentLeft = pLR ? ((const SvxLRSpaceItem*)pLR)->GetTxtLeft() : 0; + sal_uInt16 nCount = rTabStop.Count(); + + // <w:tabs> must contain at least one <w:tab>, so don't write it empty + if( nCount == 0 ) + return; + if( nCount == 1 && rTabStop[ 0 ].GetAdjustment() == SVX_TAB_ADJUST_DEFAULT ) + { + GetExport().setDefaultTabStop( rTabStop[ 0 ].GetTabPos()); + return; + } + m_pSerializer->startElementNS( XML_w, XML_tabs, FSEND ); - sal_uInt16 nCount = rTabStop.Count(); for (sal_uInt16 i = 0; i < nCount; i++ ) { if( rTabStop[i].GetAdjustment() != SVX_TAB_ADJUST_DEFAULT ) |