diff options
Diffstat (limited to 'xmloff/source/text')
-rw-r--r-- | xmloff/source/text/txtflde.cxx | 32 | ||||
-rw-r--r-- | xmloff/source/text/txtfldi.cxx | 5 |
2 files changed, 37 insertions, 0 deletions
diff --git a/xmloff/source/text/txtflde.cxx b/xmloff/source/text/txtflde.cxx index 853df896f8c0..d27cb0e2f6a7 100644 --- a/xmloff/source/text/txtflde.cxx +++ b/xmloff/source/text/txtflde.cxx @@ -564,6 +564,9 @@ enum FieldIdEnum XMLTextFieldExport::MapFieldName( case ReferenceFieldSource::ENDNOTE: nToken = FIELD_ID_REF_ENDNOTE; break; + case ReferenceFieldSource::STYLE: + nToken = FIELD_ID_REF_STYLE; + break; default: nToken = FIELD_ID_UNKNOWN; break; @@ -704,6 +707,7 @@ bool XMLTextFieldExport::IsStringField( case FIELD_ID_REF_BOOKMARK: case FIELD_ID_REF_FOOTNOTE: case FIELD_ID_REF_ENDNOTE: + case FIELD_ID_REF_STYLE: case FIELD_ID_MACRO: case FIELD_ID_TEMPLATE_NAME: case FIELD_ID_CHAPTER: @@ -915,6 +919,7 @@ void XMLTextFieldExport::ExportFieldAutoStyle( case FIELD_ID_REF_BOOKMARK: case FIELD_ID_REF_FOOTNOTE: case FIELD_ID_REF_ENDNOTE: + case FIELD_ID_REF_STYLE: case FIELD_ID_MACRO: case FIELD_ID_REFPAGE_SET: case FIELD_ID_REFPAGE_GET: @@ -1647,6 +1652,30 @@ void XMLTextFieldExport::ExportFieldHelper( sPresentation); break; + case FIELD_ID_REF_STYLE: + { + ProcessString(XML_REFERENCE_FORMAT, + MapReferenceType(GetInt16Property(gsPropertyReferenceFieldPart, rPropSet)), + XML_TEMPLATE); + ProcessString(XML_REF_NAME, GetStringProperty(gsPropertySourceName, rPropSet)); + if (xPropSetInfo->hasPropertyByName(gsPropertyReferenceFieldLanguage) + && GetExport().getSaneDefaultVersion() & SvtSaveOptions::ODFSVER_EXTENDED) + { + // export text:reference-language attribute, if not empty + ProcessString(XML_REFERENCE_LANGUAGE, + GetStringProperty(gsPropertyReferenceFieldLanguage, rPropSet), true, + XML_NAMESPACE_LO_EXT); + } + SvXMLElementExport aElem( + GetExport(), + XML_NAMESPACE_LO_EXT, + MapReferenceSource(GetInt16Property(gsPropertyReferenceFieldSource, rPropSet)), + false, + false); + GetExport().Characters(sPresentation); + break; + } + case FIELD_ID_DDE: // name from field master ProcessString(XML_CONNECTION_NAME, @@ -3159,6 +3188,9 @@ enum XMLTokenEnum XMLTextFieldExport::MapReferenceSource(sal_Int16 nType) case ReferenceFieldSource::ENDNOTE: eElement = XML_NOTE_REF; break; + case ReferenceFieldSource::STYLE: + eElement = XML_STYLE_REF; + break; default: OSL_FAIL("unknown reference source"); break; diff --git a/xmloff/source/text/txtfldi.cxx b/xmloff/source/text/txtfldi.cxx index 05d95281ef1b..d51d1fb06316 100644 --- a/xmloff/source/text/txtfldi.cxx +++ b/xmloff/source/text/txtfldi.cxx @@ -407,6 +407,7 @@ XMLTextFieldImportContext::CreateTextFieldImportContext( case XML_ELEMENT(TEXT, XML_BOOKMARK_REF): case XML_ELEMENT(TEXT, XML_NOTE_REF): case XML_ELEMENT(TEXT, XML_SEQUENCE_REF): + case XML_ELEMENT(TEXT, XML_STYLE_REF): pContext = new XMLReferenceFieldImportContext( rImport, rHlp, nToken ); break; @@ -2509,6 +2510,9 @@ void XMLReferenceFieldImportContext::startFastElement( case XML_ELEMENT(TEXT, XML_SEQUENCE_REF): nSource = ReferenceFieldSource::SEQUENCE_FIELD; break; + case XML_ELEMENT(TEXT, XML_STYLE_REF): + nSource = ReferenceFieldSource::STYLE; + break; default: XMLOFF_WARN_UNKNOWN_ELEMENT("xmloff", nElementToken); bTypeOK = false; @@ -2577,6 +2581,7 @@ void XMLReferenceFieldImportContext::PrepareField( { case XML_ELEMENT(TEXT, XML_REFERENCE_REF): case XML_ELEMENT(TEXT, XML_BOOKMARK_REF): + case XML_ELEMENT(LO_EXT, XML_STYLE_REF): xPropertySet->setPropertyValue("SourceName", Any(sName)); break; |