diff options
author | Luboš Luňák <l.lunak@suse.cz> | 2012-07-13 18:22:27 +0200 |
---|---|---|
committer | Luboš Luňák <l.lunak@suse.cz> | 2012-07-13 18:27:14 +0200 |
commit | 15af925c254f27046427de70a59011e2ac3d6bdb (patch) | |
tree | a3acfc7f2ef7541cc47c9f9dfc38e79ff4443ff4 | |
parent | 7e9e8834b52b684262262b02a86d6a4d5ce07b9c (diff) |
do not write default tab stop into the default style in .docx
Use w:defaultTabStop in w:settings instead.
Change-Id: I7056ff0ee8574fd942e2f330a1f76bae657a825e
-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 4d14585c9d58..773078c8c43f 100644 --- a/sw/source/filter/ww8/docxattributeoutput.cxx +++ b/sw/source/filter/ww8/docxattributeoutput.cxx @@ -3757,7 +3757,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 b6dde35578be..94dd34fd9fec 100644 --- a/sw/source/filter/ww8/docxexport.cxx +++ b/sw/source/filter/ww8/docxexport.cxx @@ -678,6 +678,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 ); @@ -824,6 +827,7 @@ DocxExport::~DocxExport() DocxSettingsData::DocxSettingsData() : evenAndOddHeaders( false ) +, defaultTabStop( 0 ) { } @@ -831,6 +835,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 e71896b4e36a..56399e68a232 100644 --- a/sw/source/filter/ww8/docxexport.hxx +++ b/sw/source/filter/ww8/docxexport.hxx @@ -53,6 +53,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. @@ -217,8 +218,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. |