diff options
author | Miklos Vajna <vmiklos@collabora.co.uk> | 2014-12-11 11:13:13 +0100 |
---|---|---|
committer | Miklos Vajna <vmiklos@collabora.co.uk> | 2014-12-11 17:03:28 +0100 |
commit | 19762e8b96f16504e6e7607f96ff9c5c62e9e35c (patch) | |
tree | 2c9951ad0e1dec45bde1d7260cdb40cc1eff8d6f /sw | |
parent | 18101d292f6a8de2ae45b49193b4c6e3c99a332f (diff) |
DOCX export: don't write w:suppressAutoHyphens unconditionally
Change-Id: I0e716f1c6d5034774247264cd098ede14601f751
Diffstat (limited to 'sw')
-rw-r--r-- | sw/qa/extras/ooxmlexport/ooxmlexport3.cxx | 3 | ||||
-rw-r--r-- | sw/source/filter/ww8/docxexport.cxx | 6 | ||||
-rw-r--r-- | sw/source/filter/ww8/docxexport.hxx | 2 | ||||
-rw-r--r-- | sw/source/filter/ww8/wrtw8sty.cxx | 2 | ||||
-rw-r--r-- | sw/source/filter/ww8/wrtww8.hxx | 2 |
5 files changed, 10 insertions, 5 deletions
diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport3.cxx b/sw/qa/extras/ooxmlexport/ooxmlexport3.cxx index 7b0edaf18551..b411a4c6e331 100644 --- a/sw/qa/extras/ooxmlexport/ooxmlexport3.cxx +++ b/sw/qa/extras/ooxmlexport/ooxmlexport3.cxx @@ -262,6 +262,9 @@ DECLARE_OOXMLEXPORT_TEST(testStyleInheritance, "style-inheritance.docx") // Finally check the same for numbering styles. assertXPath(pXmlStyles, "/w:styles/w:style[@w:styleId='NoList']", "default", "1"); + + // This was 1, the default style had <w:suppressAutoHyphens w:val="true"/> even for a default style having no RES_PARATR_HYPHENZONE set. + assertXPath(pXmlStyles, "/w:styles/w:style[@w:styleId='Normal']/w:pPr/w:suppressAutoHyphens", 0); } DECLARE_OOXMLEXPORT_TEST(testCalendar1, "calendar1.docx") diff --git a/sw/source/filter/ww8/docxexport.cxx b/sw/source/filter/ww8/docxexport.cxx index 197eac9a1bcc..6cb7d80adebd 100644 --- a/sw/source/filter/ww8/docxexport.cxx +++ b/sw/source/filter/ww8/docxexport.cxx @@ -1348,11 +1348,13 @@ XFastAttributeListRef DocxExport::MainXmlNamespaces( FSHelperPtr serializer ) return XFastAttributeListRef( pAttr ); } -bool DocxExport::ignoreAttributeForStyles( sal_uInt16 nWhich ) const +bool DocxExport::ignoreAttributeForStyleDefaults( sal_uInt16 nWhich ) const { if( nWhich == RES_TEXTGRID ) return true; // w:docGrid is written only to document.xml, not to styles.xml - return MSWordExportBase::ignoreAttributeForStyles( nWhich ); + if (nWhich == RES_PARATR_HYPHENZONE) + return true; // w:suppressAutoHyphens is only a formatting exception, not a default + return MSWordExportBase::ignoreAttributeForStyleDefaults( nWhich ); } void DocxExport::WriteOutliner(const OutlinerParaObject& rParaObj, sal_uInt8 nTyp) diff --git a/sw/source/filter/ww8/docxexport.hxx b/sw/source/filter/ww8/docxexport.hxx index 3c4e708478c5..f2a320e04eee 100644 --- a/sw/source/filter/ww8/docxexport.hxx +++ b/sw/source/filter/ww8/docxexport.hxx @@ -125,7 +125,7 @@ public: virtual bool AddSectionBreaksForTOX() const SAL_OVERRIDE { return true; } - virtual bool ignoreAttributeForStyles( sal_uInt16 nWhich ) const SAL_OVERRIDE; + virtual bool ignoreAttributeForStyleDefaults( sal_uInt16 nWhich ) const SAL_OVERRIDE; virtual bool PreferPageBreakBefore() const SAL_OVERRIDE { return false; } diff --git a/sw/source/filter/ww8/wrtw8sty.cxx b/sw/source/filter/ww8/wrtw8sty.cxx index ae6fafe5640e..3c84833e5ef5 100644 --- a/sw/source/filter/ww8/wrtw8sty.cxx +++ b/sw/source/filter/ww8/wrtw8sty.cxx @@ -473,7 +473,7 @@ 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 && !m_rExport.ignoreAttributeForStyles( n ) + if ( *pFlags && !m_rExport.ignoreAttributeForStyleDefaults( n ) && SfxItemState::SET != rFmt.GetItemState(n, false)) { //If we are a character property then see if it is one of the diff --git a/sw/source/filter/ww8/wrtww8.hxx b/sw/source/filter/ww8/wrtww8.hxx index c72584787293..09dd0dca96bd 100644 --- a/sw/source/filter/ww8/wrtww8.hxx +++ b/sw/source/filter/ww8/wrtww8.hxx @@ -655,7 +655,7 @@ public: virtual bool AddSectionBreaksForTOX() const = 0; /// Used to filter out attributes that can be e.g. written to .doc but not to .docx - virtual bool ignoreAttributeForStyles( sal_uInt16 /*nWhich*/ ) const { return false; } + virtual bool ignoreAttributeForStyleDefaults( sal_uInt16 /*nWhich*/ ) const { return false; } /// If saving page break is preferred as a paragraph attribute (yes) or as a special character (no). virtual bool PreferPageBreakBefore() const = 0; |