summaryrefslogtreecommitdiff
path: root/sd
diff options
context:
space:
mode:
authorPranav Kant <pranavk@collabora.co.uk>2017-02-19 18:33:46 +0530
committerPranav Kant <pranavk@collabora.co.uk>2017-02-20 13:58:12 +0530
commit46be94e3dc721d936de9699c1e24e5853b00c0fd (patch)
tree9f3be33a259db174e54feba5784dca14ceaf7c20 /sd
parentc3b26856cc4d69bc206dc56e0b6a47d9cf4afb6c (diff)
sd: Give ids to each annotation
We want to refer to these annotations using these IDs from LOK clients, for example, to delete or modify them via the LOK API. Change-Id: I8f516977ece098713bdbf63f15575ae2ded1d2d2
Diffstat (limited to 'sd')
-rw-r--r--sd/source/core/annotations/Annotation.cxx7
1 files changed, 7 insertions, 0 deletions
diff --git a/sd/source/core/annotations/Annotation.cxx b/sd/source/core/annotations/Annotation.cxx
index ef893140b858..3289eb6c4590 100644
--- a/sd/source/core/annotations/Annotation.cxx
+++ b/sd/source/core/annotations/Annotation.cxx
@@ -57,8 +57,11 @@ public:
Annotation(const Annotation&) = delete;
Annotation& operator=(const Annotation&) = delete;
+ static sal_uInt32 m_nLastId;
+
SdPage* GetPage() const { return mpPage; }
SdrModel* GetModel() { return (mpPage != nullptr) ? mpPage->GetModel() : nullptr; }
+ sal_uInt32 GetId() const { return m_nId; }
// XInterface:
virtual Any SAL_CALL queryInterface(Type const & type) override;
@@ -99,6 +102,7 @@ private:
// disposed, do it here.
virtual void SAL_CALL disposing() override;
+ sal_uInt32 m_nId;
SdPage* mpPage;
RealPoint2D m_Position;
RealSize2D m_Size;
@@ -170,9 +174,12 @@ void createAnnotation( Reference< XAnnotation >& xAnnotation, SdPage* pPage )
pPage->addAnnotation(xAnnotation, -1);
}
+sal_uInt32 Annotation::m_nLastId = 1;
+
Annotation::Annotation( const Reference< XComponentContext >& context, SdPage* pPage )
: ::cppu::WeakComponentImplHelper< XAnnotation >(m_aMutex)
, ::cppu::PropertySetMixin< XAnnotation >(context, static_cast< Implements >(IMPLEMENTS_PROPERTY_SET), Sequence< OUString >())
+, m_nId( m_nLastId++ )
, mpPage( pPage )
{
}