Kaydet (Commit) 15af925c authored tarafından Luboš Luňák's avatar Luboš Luňák

do not write default tab stop into the default style in .docx

Use w:defaultTabStop in w:settings instead.

Change-Id: I7056ff0ee8574fd942e2f330a1f76bae657a825e
üst 7e9e8834
......@@ -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 );
}
......
......@@ -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;
}
......
......@@ -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.
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment