DOC export: restore quotation of SEQ field names

Commit d738b06313 (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
This commit is contained in:
Miklos Vajna
2014-02-14 10:28:41 +01:00
parent d738b06313
commit c35d7018cf
4 changed files with 12 additions and 1 deletions

View File

@@ -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).

View File

@@ -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 );

View File

@@ -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();

View File

@@ -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);
}