diff options
Diffstat (limited to 'xmloff')
-rw-r--r-- | xmloff/inc/txtflde.hxx | 1 | ||||
-rw-r--r-- | xmloff/inc/txtfldi.hxx | 2 | ||||
-rw-r--r-- | xmloff/source/text/txtflde.cxx | 11 | ||||
-rw-r--r-- | xmloff/source/text/txtfldi.cxx | 12 |
4 files changed, 26 insertions, 0 deletions
diff --git a/xmloff/inc/txtflde.hxx b/xmloff/inc/txtflde.hxx index 6f85f9eca69f..771ca6c0a945 100644 --- a/xmloff/inc/txtflde.hxx +++ b/xmloff/inc/txtflde.hxx @@ -479,6 +479,7 @@ private: const ::rtl::OUString sPropertyFileFormat; const ::rtl::OUString sPropertyFullName; const ::rtl::OUString sPropertyHint; + const ::rtl::OUString sPropertyInitials; const ::rtl::OUString sPropertyInstanceName; const ::rtl::OUString sPropertyIsAutomaticUpdate; const ::rtl::OUString sPropertyIsConditionTrue; diff --git a/xmloff/inc/txtfldi.hxx b/xmloff/inc/txtfldi.hxx index 02ac73d272d8..7c0e6e605393 100644 --- a/xmloff/inc/txtfldi.hxx +++ b/xmloff/inc/txtfldi.hxx @@ -1341,11 +1341,13 @@ protected: class XMLAnnotationImportContext : public XMLTextFieldImportContext { const ::rtl::OUString sPropertyAuthor; + const ::rtl::OUString sPropertyInitials; const ::rtl::OUString sPropertyContent; const ::rtl::OUString sPropertyDate; const ::rtl::OUString sPropertyTextRange; ::rtl::OUStringBuffer aAuthorBuffer; + ::rtl::OUStringBuffer aInitialsBuffer; ::rtl::OUStringBuffer aTextBuffer; ::rtl::OUStringBuffer aDateBuffer; diff --git a/xmloff/source/text/txtflde.cxx b/xmloff/source/text/txtflde.cxx index 410bb05d6938..bc78c34669de 100644 --- a/xmloff/source/text/txtflde.cxx +++ b/xmloff/source/text/txtflde.cxx @@ -316,6 +316,7 @@ XMLTextFieldExport::XMLTextFieldExport( SvXMLExport& rExp, sPropertyFileFormat(RTL_CONSTASCII_USTRINGPARAM("FileFormat")), sPropertyFullName(RTL_CONSTASCII_USTRINGPARAM("FullName")), sPropertyHint(RTL_CONSTASCII_USTRINGPARAM("Hint")), + sPropertyInitials("Initials"), sPropertyInstanceName(RTL_CONSTASCII_USTRINGPARAM("InstanceName")), sPropertyIsAutomaticUpdate(RTL_CONSTASCII_USTRINGPARAM("IsAutomaticUpdate")), sPropertyIsConditionTrue(RTL_CONSTASCII_USTRINGPARAM("IsConditionTrue")), @@ -1760,6 +1761,16 @@ void XMLTextFieldExport::ExportFieldHelper( GetExport().Characters(aBuffer.makeStringAndClear()); } + // initials + OUString aInitials( GetStringProperty(sPropertyInitials, rPropSet) ); + if( !aInitials.isEmpty() ) + { + SvXMLElementExport aCreatorElem( GetExport(), XML_NAMESPACE_TEXT, + XML_SENDER_INITIALS, sal_True, + sal_False ); + GetExport().Characters(aInitials); + } + com::sun::star::uno::Reference < com::sun::star::text::XText > xText; try { diff --git a/xmloff/source/text/txtfldi.cxx b/xmloff/source/text/txtfldi.cxx index e162406be156..9425b799fc6a 100644 --- a/xmloff/source/text/txtfldi.cxx +++ b/xmloff/source/text/txtfldi.cxx @@ -158,6 +158,7 @@ const sal_Char sAPI_is_fixed[] = "IsFixed"; const sal_Char sAPI_content[] = "Content"; const sal_Char sAPI_value[] = "Value"; const sal_Char sAPI_author[] = "Author"; +const sal_Char sAPI_initials[] = "Initials"; const sal_Char sAPI_full_name[] = "FullName"; const sal_Char sAPI_place_holder_type[] = "PlaceHolderType"; const sal_Char sAPI_place_holder[] = "PlaceHolder"; @@ -3633,6 +3634,7 @@ XMLAnnotationImportContext::XMLAnnotationImportContext( XMLTextFieldImportContext(rImport, rHlp, sAPI_annotation, nPrfx, sLocalName), sPropertyAuthor(sAPI_author), + sPropertyInitials(sAPI_initials), sPropertyContent(sAPI_content), // why is there no UNO_NAME_DATE_TIME, but only UNO_NAME_DATE_TIME_VALUE? sPropertyDate(sAPI_date_time_value), @@ -3668,6 +3670,12 @@ SvXMLImportContext* XMLAnnotationImportContext::CreateChildContext( pContext = new XMLStringBufferImportContext(GetImport(), nPrefix, rLocalName, aDateBuffer); } + else if( XML_NAMESPACE_TEXT == nPrefix ) + { + if( IsXMLToken( rLocalName, XML_SENDER_INITIALS ) ) + pContext = new XMLStringBufferImportContext(GetImport(), nPrefix, + rLocalName, aInitialsBuffer); + } if( !pContext ) { @@ -3758,6 +3766,10 @@ void XMLAnnotationImportContext::PrepareField( OUString sAuthor( aAuthorBuffer.makeStringAndClear() ); xPropertySet->setPropertyValue(sPropertyAuthor, makeAny(sAuthor)); + // import (possibly empty) initials + OUString sInitials( aInitialsBuffer.makeStringAndClear() ); + xPropertySet->setPropertyValue(sPropertyInitials, makeAny(sInitials)); + DateTime aDateTime; if (::sax::Converter::convertDateTime(aDateTime, aDateBuffer.makeStringAndClear())) |