summaryrefslogtreecommitdiff
path: root/xmloff
diff options
context:
space:
mode:
authorRosemary Sebastian <rosemary.seb8@gmail.com>2017-01-25 12:56:47 +0530
committerRosemary Sebastian <rosemaryseb8@gmail.com>2017-03-10 04:47:48 +0000
commit5de40734af30a8b897c6c5b7f681759e36a25557 (patch)
treeca5510435b692fd5f35359bc17494000a7250502 /xmloff
parentda3d56b077ce81f6f399a68f53895590dbb1357f (diff)
Implement export and import of author field in fixed format
Change-Id: I1975bfcdc8436f2b05e2fab2a4c9c09838330b30 Reviewed-on: https://gerrit.libreoffice.org/33520 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Rosemary Sebastian <rosemaryseb8@gmail.com>
Diffstat (limited to 'xmloff')
-rw-r--r--xmloff/inc/txtfldi.hxx4
-rw-r--r--xmloff/source/text/txtflde.cxx7
-rw-r--r--xmloff/source/text/txtfldi.cxx10
3 files changed, 19 insertions, 2 deletions
diff --git a/xmloff/inc/txtfldi.hxx b/xmloff/inc/txtfldi.hxx
index 106545c34503..ed154c72ffe0 100644
--- a/xmloff/inc/txtfldi.hxx
+++ b/xmloff/inc/txtfldi.hxx
@@ -234,6 +234,10 @@ protected:
virtual void StartElement(
const css::uno::Reference< css::xml::sax::XAttributeList> & xAttrList) override;
+ /// process attribute values
+ virtual void ProcessAttribute( sal_uInt16 nAttrToken,
+ const OUString& sAttrValue ) override;
+
/// prepare XTextField for insertion into document
virtual void PrepareField(
const css::uno::Reference< css::beans::XPropertySet> & xPropertySet) override;
diff --git a/xmloff/source/text/txtflde.cxx b/xmloff/source/text/txtflde.cxx
index 4037bab0d0e1..72dc79a828b8 100644
--- a/xmloff/source/text/txtflde.cxx
+++ b/xmloff/source/text/txtflde.cxx
@@ -1067,8 +1067,11 @@ void XMLTextFieldExport::ExportFieldHelper(
switch (nToken) {
case FIELD_ID_AUTHOR:
// author field: fixed, field (sub-)type
- ProcessBoolean(XML_FIXED,
- GetBoolProperty(sPropertyIsFixed, rPropSet), true);
+ if (xPropSetInfo->hasPropertyByName(sPropertyIsFixed))
+ {
+ GetExport().AddAttribute(XML_NAMESPACE_TEXT, XML_FIXED,
+ (GetBoolProperty(sPropertyIsFixed, rPropSet) ? XML_TRUE : XML_FALSE) );
+ }
ExportElement(MapAuthorFieldName(rPropSet), sPresentation);
break;
diff --git a/xmloff/source/text/txtfldi.cxx b/xmloff/source/text/txtfldi.cxx
index 909cebb61c16..0e5c2f6bbc82 100644
--- a/xmloff/source/text/txtfldi.cxx
+++ b/xmloff/source/text/txtfldi.cxx
@@ -680,6 +680,16 @@ void XMLAuthorFieldImportContext::StartElement(
XMLTextFieldImportContext::StartElement(xAttrList);
}
+void XMLAuthorFieldImportContext::ProcessAttribute(sal_uInt16 nAttrToken, const OUString& sAttrValue)
+{
+ if(nAttrToken == XML_TOK_TEXTFIELD_FIXED)
+ {
+ bool bTmp(false);
+ if (::sax::Converter::convertBool(bTmp, sAttrValue))
+ bFixed = bTmp;
+ }
+}
+
void XMLAuthorFieldImportContext::PrepareField(
const Reference<XPropertySet> & rPropSet)
{