summaryrefslogtreecommitdiff
path: root/xmloff/source
diff options
context:
space:
mode:
Diffstat (limited to 'xmloff/source')
-rw-r--r--xmloff/source/core/xmltoken.cxx2
-rw-r--r--xmloff/source/text/txtflde.cxx22
-rw-r--r--xmloff/source/text/txtfldi.cxx4
-rw-r--r--xmloff/source/text/txtimp.cxx4
4 files changed, 32 insertions, 0 deletions
diff --git a/xmloff/source/core/xmltoken.cxx b/xmloff/source/core/xmltoken.cxx
index f1761339481d..26ca52d0966e 100644
--- a/xmloff/source/core/xmltoken.cxx
+++ b/xmloff/source/core/xmltoken.cxx
@@ -3294,6 +3294,8 @@ namespace xmloff { namespace token {
TOKEN( "zeros-denominator-digits", XML_ZEROS_DENOMINATOR_DIGITS ),
TOKEN( "integer-fraction-delimiter", XML_INTEGER_FRACTION_DELIMITER ),
+ // for optional language-dependent reference formats
+ TOKEN( "reference-language", XML_REFERENCE_LANGUAGE ),
#if OSL_DEBUG_LEVEL > 0
{ 0, nullptr, nullptr, XML_TOKEN_END }
#else
diff --git a/xmloff/source/text/txtflde.cxx b/xmloff/source/text/txtflde.cxx
index c2d52cf48421..b39772a82e46 100644
--- a/xmloff/source/text/txtflde.cxx
+++ b/xmloff/source/text/txtflde.cxx
@@ -327,6 +327,7 @@ XMLTextFieldExport::XMLTextFieldExport( SvXMLExport& rExp,
sPropertyPlaceholderType("PlaceHolderType"),
sPropertyReferenceFieldPart("ReferenceFieldPart"),
sPropertyReferenceFieldSource("ReferenceFieldSource"),
+ sPropertyReferenceFieldLanguage("ReferenceFieldLanguage"),
sPropertyScriptType("ScriptType"),
sPropertySelectedItem("SelectedItem"),
sPropertySequenceNumber("SequenceNumber"),
@@ -1601,6 +1602,13 @@ void XMLTextFieldExport::ExportFieldHelper(
MakeSequenceRefName(
GetInt16Property(sPropertySequenceNumber, rPropSet),
GetStringProperty(sPropertySourceName, rPropSet) ) );
+ if (xPropSetInfo->hasPropertyByName(sPropertyReferenceFieldLanguage) &&
+ SvtSaveOptions().GetODFDefaultVersion() > SvtSaveOptions::ODFVER_012)
+ {
+ // export text:reference-language attribute, if not empty
+ ProcessString(XML_REFERENCE_LANGUAGE,
+ GetStringProperty(sPropertyReferenceFieldLanguage, rPropSet), true);
+ }
ExportElement(
MapReferenceSource(
GetInt16Property(sPropertyReferenceFieldSource, rPropSet)),
@@ -1616,6 +1624,13 @@ void XMLTextFieldExport::ExportFieldHelper(
XML_TEMPLATE);
ProcessString(XML_REF_NAME,
GetStringProperty(sPropertySourceName, rPropSet));
+ if (xPropSetInfo->hasPropertyByName(sPropertyReferenceFieldLanguage) &&
+ SvtSaveOptions().GetODFDefaultVersion() > SvtSaveOptions::ODFVER_012)
+ {
+ // export text:reference-language attribute, if not empty
+ ProcessString(XML_REFERENCE_LANGUAGE,
+ GetStringProperty(sPropertyReferenceFieldLanguage, rPropSet), true);
+ }
ExportElement(
MapReferenceSource(GetInt16Property(
sPropertyReferenceFieldSource, rPropSet)),
@@ -1634,6 +1649,13 @@ void XMLTextFieldExport::ExportFieldHelper(
ProcessString(XML_REF_NAME,
MakeFootnoteRefName(GetInt16Property(
sPropertySequenceNumber, rPropSet)));
+ if (xPropSetInfo->hasPropertyByName(sPropertyReferenceFieldLanguage) &&
+ SvtSaveOptions().GetODFDefaultVersion() > SvtSaveOptions::ODFVER_012)
+ {
+ // export text:reference-language attribute, if not empty
+ ProcessString(XML_REFERENCE_LANGUAGE,
+ GetStringProperty(sPropertyReferenceFieldLanguage, rPropSet), true);
+ }
ExportElement(
MapReferenceSource(GetInt16Property(
sPropertyReferenceFieldSource, rPropSet)),
diff --git a/xmloff/source/text/txtfldi.cxx b/xmloff/source/text/txtfldi.cxx
index 963d0ce3fa50..fd20df679564 100644
--- a/xmloff/source/text/txtfldi.cxx
+++ b/xmloff/source/text/txtfldi.cxx
@@ -2626,6 +2626,9 @@ void XMLReferenceFieldImportContext::ProcessAttribute(
break;
}
+ case XML_TOK_TEXTFIELD_REFERENCE_LANGUAGE:
+ sLanguage = sAttrValue;
+ break;
}
// bValid: we need proper element type and name
@@ -2639,6 +2642,7 @@ void XMLReferenceFieldImportContext::PrepareField(
xPropertySet->setPropertyValue("ReferenceFieldSource", Any(nSource));
+ xPropertySet->setPropertyValue("ReferenceFieldLanguage", Any(sLanguage));
switch (nElementToken)
{
case XML_TOK_TEXT_REFERENCE_REF:
diff --git a/xmloff/source/text/txtimp.cxx b/xmloff/source/text/txtimp.cxx
index 53e8836c846b..c8abe9651736 100644
--- a/xmloff/source/text/txtimp.cxx
+++ b/xmloff/source/text/txtimp.cxx
@@ -482,6 +482,10 @@ static const SvXMLTokenMapEntry aTextFieldAttrTokenMap[] =
XML_TOK_TEXTFIELD_CURRENT_VALUE },
{ XML_NAMESPACE_TEXT, XML_TABLE_TYPE, XML_TOK_TEXTFIELD_TABLE_TYPE },
{ XML_NAMESPACE_OFFICE, XML_NAME, XML_TOK_TEXT_NAME },
+ { XML_NAMESPACE_LO_EXT, XML_REFERENCE_LANGUAGE,
+ XML_TOK_TEXTFIELD_REFERENCE_LANGUAGE },
+ { XML_NAMESPACE_TEXT, XML_REFERENCE_LANGUAGE,
+ XML_TOK_TEXTFIELD_REFERENCE_LANGUAGE },
XML_TOKEN_MAP_END
};