diff options
author | Pranav Kant <pranavk@collabora.co.uk> | 2017-02-19 18:51:13 +0530 |
---|---|---|
committer | Pranav Kant <pranavk@collabora.co.uk> | 2017-02-20 13:58:13 +0530 |
commit | 80d1ada96010a943ff1793139d176086f4598d98 (patch) | |
tree | 9348b9b80c924bb5765ee6a2c87d8e12e6c80abb | |
parent | 46be94e3dc721d936de9699c1e24e5853b00c0fd (diff) |
sd lok: Use IDs in ViewAnnotations output
Change-Id: Ifb1f55ad5a1d21d63f9b37a83e3218c40dfa0b59
-rw-r--r-- | sd/inc/Annotation.hxx | 2 | ||||
-rw-r--r-- | sd/source/core/annotations/Annotation.cxx | 9 | ||||
-rw-r--r-- | sd/source/ui/unoidl/unomodel.cxx | 3 |
3 files changed, 13 insertions, 1 deletions
diff --git a/sd/inc/Annotation.hxx b/sd/inc/Annotation.hxx index fe2f39a961e4..39e746c7da3e 100644 --- a/sd/inc/Annotation.hxx +++ b/sd/inc/Annotation.hxx @@ -35,6 +35,8 @@ void createAnnotation( css::uno::Reference< css::office::XAnnotation >& xAnnotat SdrUndoAction* CreateUndoInsertOrRemoveAnnotation( const css::uno::Reference< css::office::XAnnotation >& xAnnotation, bool bInsert ); +sal_uInt32 getAnnotationId(const css::uno::Reference <css::office::XAnnotation>& xAnnotation); + } #endif diff --git a/sd/source/core/annotations/Annotation.cxx b/sd/source/core/annotations/Annotation.cxx index 3289eb6c4590..fcc0a60f2868 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 3fcc45b58b0f..efd1b2dfd476 100644 --- a/sd/source/ui/unoidl/unomodel.cxx +++ b/sd/source/ui/unoidl/unomodel.cxx @@ -78,6 +78,7 @@ #include "ViewShellBase.hxx" #include <UnoDocumentSettings.hxx> +#include <Annotation.hxx> #include <drawdoc.hxx> #include <glob.hrc> #include <sdresid.hxx> @@ -2380,7 +2381,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()); |