[Libreoffice-commits] .: 2 commits - sw/source
Lubos Lunak
llunak at kemper.freedesktop.org
Thu Jan 13 09:34:17 PST 2011
sw/source/filter/ww8/docxattributeoutput.cxx | 10 +++++-----
sw/source/filter/ww8/docxexport.cxx | 7 +++++++
sw/source/filter/ww8/docxexport.hxx | 2 ++
sw/source/filter/ww8/wrtw8sty.cxx | 3 ++-
sw/source/filter/ww8/wrtww8.hxx | 3 +++
5 files changed, 19 insertions(+), 6 deletions(-)
New commits:
commit b9f3c7b481236d2443e2baa41e8e5ef84378cb00
Author: LuboÅ¡ LuÅák <l.lunak at suse.cz>
Date: Tue Jan 11 16:55:30 2011 +0100
do not write w:docGrid to styles.xml
diff --git a/sw/source/filter/ww8/docxexport.cxx b/sw/source/filter/ww8/docxexport.cxx
index ad916cd..c8bd1c8 100644
--- a/sw/source/filter/ww8/docxexport.cxx
+++ b/sw/source/filter/ww8/docxexport.cxx
@@ -680,6 +680,13 @@ XFastAttributeListRef DocxExport::MainXmlNamespaces( FSHelperPtr serializer )
return XFastAttributeListRef( pAttr );
}
+bool DocxExport::ignoreAttributeForStyles( USHORT nWhich ) const
+{
+ if( nWhich == RES_TEXTGRID )
+ return true; // w:docGrid is written only to document.xml, not to styles.xml
+ return MSWordExportBase::ignoreAttributeForStyles( nWhich );
+}
+
DocxExport::DocxExport( DocxExportFilter *pFilter, SwDoc *pDocument, SwPaM *pCurrentPam, SwPaM *pOriginalPam )
: MSWordExportBase( pDocument, pCurrentPam, pOriginalPam ),
m_pFilter( pFilter ),
diff --git a/sw/source/filter/ww8/docxexport.hxx b/sw/source/filter/ww8/docxexport.hxx
index 1daeebc..6d1a056 100644
--- a/sw/source/filter/ww8/docxexport.hxx
+++ b/sw/source/filter/ww8/docxexport.hxx
@@ -99,6 +99,8 @@ public:
/// FIXME remove it when possible.
virtual bool HackIsWW8OrHigher() const { return true; }
+ virtual bool ignoreAttributeForStyles( USHORT nWhich ) const;
+
/// Guess the script (asian/western).
virtual bool CollapseScriptsforWordOk( USHORT nScript, USHORT nWhich );
diff --git a/sw/source/filter/ww8/wrtw8sty.cxx b/sw/source/filter/ww8/wrtw8sty.cxx
index 77d31da..5540a41 100644
--- a/sw/source/filter/ww8/wrtw8sty.cxx
+++ b/sw/source/filter/ww8/wrtw8sty.cxx
@@ -387,7 +387,8 @@ void MSWordStyles::SetStyleDefaults( const SwFmt& rFmt, bool bPap )
const bool* pFlags = aFlags + ( nStt - RES_CHRATR_BEGIN );
for ( n = nStt; n < nEnd; ++n, ++pFlags )
{
- if ( *pFlags && SFX_ITEM_SET != rFmt.GetItemState(n, false))
+ if ( *pFlags && !m_rExport.ignoreAttributeForStyles( n )
+ && SFX_ITEM_SET != rFmt.GetItemState(n, false))
{
//If we are a character property then see if it is one of the
//western/asian ones that must be collapsed together for export to
diff --git a/sw/source/filter/ww8/wrtww8.hxx b/sw/source/filter/ww8/wrtww8.hxx
index 4af4bb1..5d47b4d 100644
--- a/sw/source/filter/ww8/wrtww8.hxx
+++ b/sw/source/filter/ww8/wrtww8.hxx
@@ -623,6 +623,9 @@ public:
/// FIXME remove it when possible.
virtual bool HackIsWW8OrHigher() const = 0;
+ /// Used to filter out attributes that can be e.g. written to .doc but not to .docx
+ virtual bool ignoreAttributeForStyles( USHORT /*nWhich*/ ) const { return false; }
+
/// Guess the script (asian/western).
///
/// Sadly word does not have two different sizes for asian font size and
commit d9c32b83ba507c91b6f2a6283bbdeac9ee38e129
Author: LuboÅ¡ LuÅák <l.lunak at suse.cz>
Date: Tue Jan 11 13:49:11 2011 +0100
fix incorrect indentation level
diff --git a/sw/source/filter/ww8/docxattributeoutput.cxx b/sw/source/filter/ww8/docxattributeoutput.cxx
index c0753d4..9079877 100644
--- a/sw/source/filter/ww8/docxattributeoutput.cxx
+++ b/sw/source/filter/ww8/docxattributeoutput.cxx
@@ -1583,11 +1583,11 @@ void DocxAttributeOutput::TableBackgrounds( ww8::WW8TableNodeInfoInner::Pointer_
else
aColor = COL_AUTO;
- OString sColor = impl_ConvertColor( aColor );
- m_pSerializer->singleElementNS( XML_w, XML_shd,
- FSNS( XML_w, XML_fill ), sColor.getStr( ),
- FSNS( XML_w, XML_val ), "clear",
- FSEND );
+ OString sColor = impl_ConvertColor( aColor );
+ m_pSerializer->singleElementNS( XML_w, XML_shd,
+ FSNS( XML_w, XML_fill ), sColor.getStr( ),
+ FSNS( XML_w, XML_val ), "clear",
+ FSEND );
}
void DocxAttributeOutput::TableHeight( ww8::WW8TableNodeInfoInner::Pointer_t pTableTextNodeInfoInner )
More information about the Libreoffice-commits
mailing list