diff --git a/sw/source/filter/ww8/docxexport.hxx b/sw/source/filter/ww8/docxexport.hxx index 99b7ee7542f5..d058302d34a3 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 d801db4b6fbd..21a44159a8c4 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 55ae63629306..755e36e5217f 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 79d9f6aeb406..b7ae6402234a 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); }