summaryrefslogtreecommitdiff
path: root/xmloff/source
diff options
context:
space:
mode:
authorMichael Stahl <mstahl@redhat.com>2016-07-19 14:50:18 +0200
committerMichael Stahl <mstahl@redhat.com>2016-07-19 15:06:09 +0200
commitc49b87ac140f3f2c79c8211f38cd86118022bdce (patch)
treea5e576fbfa107bac3b65e03c70ed300c0b310fb1 /xmloff/source
parent1ba00c2173938ed2ea2f25074e866ea51370d727 (diff)
xmloff: forms import: convert relative xlink:href to absolute
There is currently only one place in the forms directory that converts relative hyperlinks to absolute on import, in OURLReferenceImport::handleAttribute(), but there are other elements that have xlink:href attribute as well, such as form:form. The export of form:form xlink:href does convert absolute to relative, in exportTargetLocationAttribute(), but if the model URL is actually already relative it will be converted to absolute instead, oddly enough. This leads to different absolute href attributes, depending on the directory where the file is exported, as can be observed with e.g. ooo95698-1.odt and fdo40634-2.odt. Let's apply a big hammer and make all "href" attributes absolute on import. Change-Id: I39d05707f3a8a899c7bbde8d9c0e2bc006c39e12
Diffstat (limited to 'xmloff/source')
-rw-r--r--xmloff/source/forms/propertyimport.cxx11
1 files changed, 10 insertions, 1 deletions
diff --git a/xmloff/source/forms/propertyimport.cxx b/xmloff/source/forms/propertyimport.cxx
index fa92c1c53552..33ac8aca3281 100644
--- a/xmloff/source/forms/propertyimport.cxx
+++ b/xmloff/source/forms/propertyimport.cxx
@@ -323,7 +323,16 @@ bool OPropertyImport::handleAttribute(sal_uInt16 /*_nNamespaceKey*/, const OUStr
aNewValue.Name = pProperty->sPropertyName;
// convert the value string into the target type
- aNewValue.Value = PropertyConversion::convertString(pProperty->aPropertyType, _rValue, pProperty->pEnumMap, pProperty->bInverseSemantics);
+ if (token::IsXMLToken(_rLocalName, token::XML_HREF))
+ {
+ aNewValue.Value <<= m_rContext.getGlobalContext().GetAbsoluteReference(_rValue);
+ }
+ else
+ {
+ aNewValue.Value = PropertyConversion::convertString(
+ pProperty->aPropertyType, _rValue, pProperty->pEnumMap,
+ pProperty->bInverseSemantics);
+ }
implPushBackPropertyValue( aNewValue );
return true;
}