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

Miklos Vajna vmiklos at collabora.co.uk
Fri Feb 14 10:34:03 CET 2014


 sw/source/filter/ww8/docxexport.hxx |    2 ++
 sw/source/filter/ww8/rtfexport.hxx  |    1 +
 sw/source/filter/ww8/wrtww8.hxx     |    4 ++++
 sw/source/filter/ww8/ww8atr.cxx     |    6 +++++-
 4 files changed, 12 insertions(+), 1 deletion(-)

New commits:
commit c35d7018cfe0ff3c8229d81058b298e67128ff0e
Author: Miklos Vajna <vmiklos at collabora.co.uk>
Date:   Fri Feb 14 10:28:41 2014 +0100

    DOC export: restore quotation of SEQ field names
    
    Commit d738b063134e97c780205f8baf138f291016ded4 (fdo#74431 : Captions'
    are preserved but remove a space, 2014-02-03) unconditionally removed
    quotes around SEQ field names, because the DOCX and RTF import leaves
    those quotes around during import time. However, the DOC import strips
    them away.
    
    So till all this is unified, at least make sure that on export DOC still
    quotes the field names, as it did since the initial import.
    
    Change-Id: I3478f736c2e17824f268f92580767b90d9fdd006

diff --git a/sw/source/filter/ww8/docxexport.hxx b/sw/source/filter/ww8/docxexport.hxx
index 99b7ee7..d058302 100644
--- a/sw/source/filter/ww8/docxexport.hxx
+++ b/sw/source/filter/ww8/docxexport.hxx
@@ -111,6 +111,8 @@ public:
 
     virtual bool SupportsOneColumnBreak() const { return true; }
 
+    virtual bool FieldsQuoted() const { return true; }
+
     virtual bool ignoreAttributeForStyles( sal_uInt16 nWhich ) const;
 
     /// Guess the script (asian/western).
diff --git a/sw/source/filter/ww8/rtfexport.hxx b/sw/source/filter/ww8/rtfexport.hxx
index d801db4..21a4415 100644
--- a/sw/source/filter/ww8/rtfexport.hxx
+++ b/sw/source/filter/ww8/rtfexport.hxx
@@ -64,6 +64,7 @@ public:
 
     virtual bool SupportsOneColumnBreak() const { return false; }
 
+    virtual bool FieldsQuoted() const { return true; }
     /// Guess the script (asian/western).
     virtual bool CollapseScriptsforWordOk( sal_uInt16 nScript, sal_uInt16 nWhich );
 
diff --git a/sw/source/filter/ww8/wrtww8.hxx b/sw/source/filter/ww8/wrtww8.hxx
index 55ae636..755e36e 100644
--- a/sw/source/filter/ww8/wrtww8.hxx
+++ b/sw/source/filter/ww8/wrtww8.hxx
@@ -636,6 +636,9 @@ public:
     /// Determines if column break with one column should be exported or not.
     virtual bool SupportsOneColumnBreak() const = 0;
 
+    /// Determines if the import filter already quoted fields or not.
+    virtual bool FieldsQuoted() 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; }
 
@@ -961,6 +964,7 @@ public:
 
     virtual bool SupportsOneColumnBreak() const { return false; }
 
+    virtual bool FieldsQuoted() const { return false; }
 private:
     /// Format-dependent part of the actual export.
     virtual void ExportDocument_Impl();
diff --git a/sw/source/filter/ww8/ww8atr.cxx b/sw/source/filter/ww8/ww8atr.cxx
index 79d9f6a..b7ae640 100644
--- a/sw/source/filter/ww8/ww8atr.cxx
+++ b/sw/source/filter/ww8/ww8atr.cxx
@@ -2579,7 +2579,11 @@ void AttributeOutputBase::TextField( const SwFmtFld& rField )
     case RES_SETEXPFLD:
         if (nsSwGetSetExpType::GSE_SEQ == nSubType)
         {
-            OUString sStr = FieldString(ww::eSEQ) +  pFld->GetTyp()->GetName() + " ";
+            OUString sStr;
+            if (GetExport().FieldsQuoted())
+                sStr = FieldString(ww::eSEQ) +  pFld->GetTyp()->GetName() + " ";
+            else
+                sStr = FieldString(ww::eSEQ) + "\"" + pFld->GetTyp()->GetName() +"\" ";
             GetNumberPara( sStr, *pFld );
             GetExport().OutputField(pFld, ww::eSEQ, sStr);
         }


More information about the Libreoffice-commits mailing list