summaryrefslogtreecommitdiff
path: root/xmloff
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2016-02-05 10:44:12 +0000
committerMichael Stahl <mstahl@redhat.com>2016-02-18 11:06:27 +0000
commit29b9df16dfbf17bbe9c46cd268849e6bfa97c84d (patch)
tree8ec29a7fad837e70671fe282afc0155f271d277b /xmloff
parent77d329a90f5c4ba22883b0756af112d8ebdf2599 (diff)
[API CHANGE] add Author Initials to XAnnotation
and use the users preferred initials for impress annotations i.e. the ones entered in the tools->options and save and load those to/from odf similarly to what we do for writer annotation initials Change-Id: Iadc0e994bfaf58632ce25b8f7cdc737580ee97bc Reviewed-on: https://gerrit.libreoffice.org/22143 Reviewed-by: Michael Stahl <mstahl@redhat.com> Tested-by: Michael Stahl <mstahl@redhat.com>
Diffstat (limited to 'xmloff')
-rw-r--r--xmloff/source/draw/sdxmlexp.cxx12
-rw-r--r--xmloff/source/draw/ximppage.cxx7
2 files changed, 19 insertions, 0 deletions
diff --git a/xmloff/source/draw/sdxmlexp.cxx b/xmloff/source/draw/sdxmlexp.cxx
index ec6a0d42b640..04e257eab344 100644
--- a/xmloff/source/draw/sdxmlexp.cxx
+++ b/xmloff/source/draw/sdxmlexp.cxx
@@ -2705,6 +2705,18 @@ void SdXMLExport::exportAnnotations( const Reference<XDrawPage>& xDrawPage )
this->Characters(aAuthor);
}
+ if (SvtSaveOptions().GetODFDefaultVersion() > SvtSaveOptions::ODFVER_012)
+ {
+ // initials
+ OUString aInitials( xAnnotation->getInitials() );
+ if( !aInitials.isEmpty() )
+ {
+ SvXMLElementExport aInitialsElem( *this, XML_NAMESPACE_LO_EXT,
+ XML_SENDER_INITIALS, true, false );
+ this->Characters(aInitials);
+ }
+ }
+
{
// date time
css::util::DateTime aDate( xAnnotation->getDateTime() );
diff --git a/xmloff/source/draw/ximppage.cxx b/xmloff/source/draw/ximppage.cxx
index 891276165390..15758d6ec517 100644
--- a/xmloff/source/draw/ximppage.cxx
+++ b/xmloff/source/draw/ximppage.cxx
@@ -67,6 +67,7 @@ private:
Reference< XTextCursor > mxCursor;
OUStringBuffer maAuthorBuffer;
+ OUStringBuffer maInitialsBuffer;
OUStringBuffer maDateBuffer;
};
@@ -141,6 +142,11 @@ SvXMLImportContext * DrawAnnotationContext::CreateChildContext( sal_uInt16 nPref
else if( IsXMLToken( rLocalName, XML_DATE ) )
pContext = new XMLStringBufferImportContext(GetImport(), nPrefix, rLocalName, maDateBuffer);
}
+ else if( (XML_NAMESPACE_TEXT == nPrefix || XML_NAMESPACE_LO_EXT == nPrefix) &&
+ IsXMLToken(rLocalName, XML_SENDER_INITIALS) )
+ {
+ pContext = new XMLStringBufferImportContext(GetImport(), nPrefix, rLocalName, maInitialsBuffer);
+ }
else
{
// create text cursor on demand
@@ -188,6 +194,7 @@ void DrawAnnotationContext::EndElement()
if( mxAnnotation.is() )
{
mxAnnotation->setAuthor( maAuthorBuffer.makeStringAndClear() );
+ mxAnnotation->setInitials( maInitialsBuffer.makeStringAndClear() );
util::DateTime aDateTime;
if (::sax::Converter::parseDateTime(aDateTime, nullptr,