summaryrefslogtreecommitdiff
path: root/sw/source/filter
diff options
context:
space:
mode:
authorLuboš Luňák <l.lunak@suse.cz>2012-07-13 18:22:27 +0200
committerCaolán McNamara <caolanm@redhat.com>2012-07-13 20:45:52 +0100
commitd34d2c1a026ce99c3f6e2730efbf8c41dcbcd3e1 (patch)
tree15a816847a0c2fcde031665fe90a854f8c3b432d /sw/source/filter
parent1d5c3861ba788042eecef7610f58956cdf56cb83 (diff)
do not write default tab stop into the default style in .docx
Use w:defaultTabStop in w:settings instead. Change-Id: I7056ff0ee8574fd942e2f330a1f76bae657a825e (cherry picked from commit 15af925c254f27046427de70a59011e2ac3d6bdb) Signed-off-by: Caolán McNamara <caolanm@redhat.com>
Diffstat (limited to 'sw/source/filter')
-rw-r--r--sw/source/filter/ww8/docxattributeoutput.cxx7
-rw-r--r--sw/source/filter/ww8/docxexport.cxx6
-rw-r--r--sw/source/filter/ww8/docxexport.hxx5
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.