summaryrefslogtreecommitdiff
path: root/sd/source
diff options
context:
space:
mode:
authorPranav Kant <pranavk@collabora.co.uk>2017-02-19 18:51:13 +0530
committerAndras Timar <andras.timar@collabora.com>2017-02-28 11:10:41 +0100
commit1c22cf5a7f6ddf41dd63918fced13a1c80d8d50a (patch)
treed4255959d8a05309248c2b74c68ecb5c7c3874cd /sd/source
parenta544c5e3971819e2fab25dd3387bcdf12169ef5d (diff)
sd lok: Use IDs in ViewAnnotations output
Change-Id: Ifb1f55ad5a1d21d63f9b37a83e3218c40dfa0b59 (cherry picked from commit 80d1ada96010a943ff1793139d176086f4598d98)
Diffstat (limited to 'sd/source')
-rw-r--r--sd/source/core/annotations/Annotation.cxx9
-rw-r--r--sd/source/ui/unoidl/unomodel.cxx3
2 files changed, 11 insertions, 1 deletions
diff --git a/sd/source/core/annotations/Annotation.cxx b/sd/source/core/annotations/Annotation.cxx
index a22c03e7e798..eb64dab482d5 100644
--- a/sd/source/core/annotations/Annotation.cxx
+++ b/sd/source/core/annotations/Annotation.cxx
@@ -370,6 +370,15 @@ SdrUndoAction* CreateUndoInsertOrRemoveAnnotation( const Reference< XAnnotation
}
}
+sal_uInt32 getAnnotationId(const Reference<XAnnotation>& xAnnotation)
+{
+ Annotation* pAnnotation = dynamic_cast<Annotation*>(xAnnotation.get());
+ sal_uInt32 nId = 0;
+ if (pAnnotation)
+ nId = pAnnotation->GetId();
+ return nId;
+}
+
UndoInsertOrRemoveAnnotation::UndoInsertOrRemoveAnnotation( Annotation& rAnnotation, bool bInsert )
: SdrUndoAction( *rAnnotation.GetModel() )
, mxAnnotation( &rAnnotation )
diff --git a/sd/source/ui/unoidl/unomodel.cxx b/sd/source/ui/unoidl/unomodel.cxx
index 61a02779e5c3..958fa25dfc5c 100644
--- a/sd/source/ui/unoidl/unomodel.cxx
+++ b/sd/source/ui/unoidl/unomodel.cxx
@@ -77,6 +77,7 @@
#include "ViewShellBase.hxx"
#include <UnoDocumentSettings.hxx>
+#include <Annotation.hxx>
#include <drawdoc.hxx>
#include <glob.hrc>
#include <sdresid.hxx>
@@ -2395,7 +2396,7 @@ OUString SdXImpressDocument::getPostIts()
uno::Reference<office::XAnnotation> xAnnotation(aPageAnnotation);
boost::property_tree::ptree aAnnotation;
-
+ aAnnotation.put("id", sd::getAnnotationId(xAnnotation));
aAnnotation.put("author", xAnnotation->getAuthor());
aAnnotation.put("dateTime", utl::toISO8601(xAnnotation->getDateTime()));
uno::Reference<text::XText> xText(xAnnotation->getTextRange());