[Libreoffice-commits] .: 2 commits - sw/source
Lubos Lunak
llunak at kemper.freedesktop.org
Fri Jul 13 09:27:38 PDT 2012
sw/source/filter/ww8/docxattributeoutput.cxx | 7 ++++++-
sw/source/filter/ww8/docxexport.cxx | 6 ++++++
sw/source/filter/ww8/docxexport.hxx | 5 +++--
sw/source/filter/ww8/wrtww8.hxx | 2 +-
sw/source/filter/ww8/ww8atr.cxx | 2 +-
5 files changed, 17 insertions(+), 5 deletions(-)
New commits:
commit 15af925c254f27046427de70a59011e2ac3d6bdb
Author: LuboÅ¡ LuÅák <l.lunak at suse.cz>
Date: Fri Jul 13 18:22:27 2012 +0200
do not write default tab stop into the default style in .docx
Use w:defaultTabStop in w:settings instead.
Change-Id: I7056ff0ee8574fd942e2f330a1f76bae657a825e
diff --git a/sw/source/filter/ww8/docxattributeoutput.cxx b/sw/source/filter/ww8/docxattributeoutput.cxx
index 4d14585..773078c 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 b6dde35..94dd34f 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 e71896b..56399e6 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.
commit 7e9e8834b52b684262262b02a86d6a4d5ce07b9c
Author: LuboÅ¡ LuÅák <l.lunak at suse.cz>
Date: Fri Jul 13 16:52:51 2012 +0200
add const
Change-Id: I5c7c88e0359dae9691f4cb70e2ad9a139618e701
diff --git a/sw/source/filter/ww8/wrtww8.hxx b/sw/source/filter/ww8/wrtww8.hxx
index 830aebe..28cda40 100644
--- a/sw/source/filter/ww8/wrtww8.hxx
+++ b/sw/source/filter/ww8/wrtww8.hxx
@@ -1523,7 +1523,7 @@ public:
/// Get id of the style (rFmt).
sal_uInt16 GetSlot( const SwFmt& rFmt ) const;
- SwFmt* GetSwFmt() { return (*pFmtA); }
+ const SwFmt* GetSwFmt() const { return (*pFmtA); }
};
sal_Int16 GetWordFirstLineOffset(const SwNumFmt &rFmt);
diff --git a/sw/source/filter/ww8/ww8atr.cxx b/sw/source/filter/ww8/ww8atr.cxx
index f00e784..900900e 100644
--- a/sw/source/filter/ww8/ww8atr.cxx
+++ b/sw/source/filter/ww8/ww8atr.cxx
@@ -3650,7 +3650,7 @@ void WW8AttributeOutput::SectionBreak( sal_uInt8 nC, const WW8_SepInfo* /*pSecti
sal_uInt32 AttributeOutputBase::GridCharacterPitch( const SwTextGridItem& rGrid ) const
{
MSWordStyles * pStyles = GetExport().pStyles;
- SwFmt * pSwFmt = pStyles->GetSwFmt();
+ const SwFmt * pSwFmt = pStyles->GetSwFmt();
sal_uInt32 nPageCharSize = 0;
More information about the Libreoffice-commits
mailing list