diff options
-rw-r--r-- | sw/source/filter/ww8/docxattributeoutput.cxx | 7 | ||||
-rw-r--r-- | sw/source/filter/ww8/docxexport.cxx | 6 | ||||
-rw-r--r-- | sw/source/filter/ww8/docxexport.hxx | 5 |
3 files changed, 15 insertions, 3 deletions
diff --git a/sw/source/filter/ww8/docxattributeoutput.cxx b/sw/source/filter/ww8/docxattributeoutput.cxx index 2d1bb23366a9..4737501a4961 100644 --- a/sw/source/filter/ww8/docxattributeoutput.cxx +++ b/sw/source/filter/ww8/docxattributeoutput.cxx @@ -3788,7 +3788,12 @@ void DocxAttributeOutput::ParaTabStop( const SvxTabStopItem& rTabStop ) sal_uInt16 nCount = rTabStop.Count(); for (sal_uInt16 i = 0; i < nCount; i++ ) - impl_WriteTabElement( m_pSerializer, rTabStop[i], nCurrentLeft ); + { + if( rTabStop[i].GetAdjustment() != SVX_TAB_ADJUST_DEFAULT ) + impl_WriteTabElement( m_pSerializer, rTabStop[i], nCurrentLeft ); + else + GetExport().setDefaultTabStop( rTabStop[i].GetTabPos()); + } m_pSerializer->endElementNS( XML_w, XML_tabs ); } diff --git a/sw/source/filter/ww8/docxexport.cxx b/sw/source/filter/ww8/docxexport.cxx index de50add01832..418589d99b7b 100644 --- a/sw/source/filter/ww8/docxexport.cxx +++ b/sw/source/filter/ww8/docxexport.cxx @@ -687,6 +687,9 @@ void DocxExport::WriteSettings() rtl::OString aZoom(rtl::OString::valueOf(sal_Int32(pViewShell->GetViewOptions()->GetZoom()))); pFS->singleElementNS(XML_w, XML_zoom, FSNS(XML_w, XML_percent), aZoom.getStr(), FSEND); + if( settings.defaultTabStop != 0 ) + pFS->singleElementNS( XML_w, XML_defaultTabStop, FSNS( XML_w, XML_val ), + rtl::OString::valueOf( sal_Int32( settings.defaultTabStop )).getStr(), FSEND ); if( settings.evenAndOddHeaders ) pFS->singleElementNS( XML_w, XML_evenAndOddHeaders, FSEND ); @@ -833,6 +836,7 @@ DocxExport::~DocxExport() DocxSettingsData::DocxSettingsData() : evenAndOddHeaders( false ) +, defaultTabStop( 0 ) { } @@ -840,6 +844,8 @@ bool DocxSettingsData::hasData() const { if( evenAndOddHeaders ) return true; + if( defaultTabStop != 0 ) + return true; return false; } diff --git a/sw/source/filter/ww8/docxexport.hxx b/sw/source/filter/ww8/docxexport.hxx index 8963cd368834..c89afc7acd42 100644 --- a/sw/source/filter/ww8/docxexport.hxx +++ b/sw/source/filter/ww8/docxexport.hxx @@ -64,6 +64,7 @@ struct DocxSettingsData DocxSettingsData(); bool hasData() const; /// returns true if there are any non-default settings (i.e. something to write) bool evenAndOddHeaders; + int defaultTabStop; }; /// The class that does all the actual DOCX export-related work. @@ -228,8 +229,8 @@ public: /// Reference to the VMLExport instance for the main document. oox::vml::VMLExport& VMLExporter(); - /// Data to be exported in the settings part of the document - DocxSettingsData& settingsData(); + /// Set the document default tab stop. + void setDefaultTabStop( int stop ) { settings.defaultTabStop = stop; } private: /// No copying. |