[Libreoffice-commits] core.git: sw/source

Miklos Vajna vmiklos at collabora.co.uk
Thu Mar 20 04:48:17 PDT 2014


 sw/source/filter/ww8/docxattributeoutput.cxx |    2 +-
 sw/source/filter/ww8/wrtw8sty.cxx            |    2 --
 sw/source/filter/ww8/wrtww8.hxx              |    2 ++
 3 files changed, 3 insertions(+), 3 deletions(-)

New commits:
commit 56dd3c277ab342edf08f1f01955ca2a84f7112b1
Author: Miklos Vajna <vmiklos at collabora.co.uk>
Date:   Thu Mar 20 12:37:32 2014 +0100

    DocxAttributeOutput::EndStyles: avoid hardwired 4091
    
    Change-Id: I637cec62eb6cf951cb3d7c9e83c896494d6e1701

diff --git a/sw/source/filter/ww8/docxattributeoutput.cxx b/sw/source/filter/ww8/docxattributeoutput.cxx
index e0dc997..69d4759 100644
--- a/sw/source/filter/ww8/docxattributeoutput.cxx
+++ b/sw/source/filter/ww8/docxattributeoutput.cxx
@@ -3320,7 +3320,7 @@ void DocxAttributeOutput::EndStyles( sal_uInt16 nNumberOfStyles )
     // Ms Office seems to have an internal limitation of 4091 styles
     // and refuses to load .docx with more, even though the spec seems to allow that;
     // so simply if there are more styles, don't export those
-    sal_uInt16 nCountStylesToWrite =  (4091 == nNumberOfStyles) ? 0 : (4091 - nNumberOfStyles);
+    sal_uInt16 nCountStylesToWrite = MSWORD_MAX_STYLES_LIMIT - nNumberOfStyles;
     m_pTableStyleExport->TableStyles(nCountStylesToWrite);
     m_pSerializer->endElementNS( XML_w, XML_styles );
 }
diff --git a/sw/source/filter/ww8/wrtw8sty.cxx b/sw/source/filter/ww8/wrtw8sty.cxx
index c1acb3b..271d118 100644
--- a/sw/source/filter/ww8/wrtw8sty.cxx
+++ b/sw/source/filter/ww8/wrtw8sty.cxx
@@ -692,8 +692,6 @@ void WW8AttributeOutput::EndStyles( sal_uInt16 nNumberOfStyles )
     SwWW8Writer::WriteShort( *m_rWW8Export.pTableStrm, m_nStyAnzPos, nNumberOfStyles );
 }
 
-#define MSWORD_MAX_STYLES_LIMIT 4091;
-
 void MSWordStyles::OutputStylesTable()
 {
     m_rExport.bStyDef = true;
diff --git a/sw/source/filter/ww8/wrtww8.hxx b/sw/source/filter/ww8/wrtww8.hxx
index 9a1d7b5..883d1e3 100644
--- a/sw/source/filter/ww8/wrtww8.hxx
+++ b/sw/source/filter/ww8/wrtww8.hxx
@@ -1601,6 +1601,8 @@ public:
     const SwNumRule* GetSwNumRule(sal_uInt16 nId) const;
 };
 
+#define MSWORD_MAX_STYLES_LIMIT 4091
+
 sal_Int16 GetWordFirstLineOffset(const SwNumFmt &rFmt);
 // A bit of a bag on the side for now
 OUString FieldString(ww::eField eIndex);


More information about the Libreoffice-commits mailing list