diff options
author | Pranav Kant <pranavk@collabora.co.uk> | 2017-04-23 14:54:42 +0530 |
---|---|---|
committer | pranavk <pranavk@collabora.co.uk> | 2017-05-01 06:46:19 +0200 |
commit | c454fbb9b62164d5f047990ae63522c9fb932086 (patch) | |
tree | 682c263be6e283fd4ad04e509548abd520595f16 /sd/inc | |
parent | 862b6c0a32dfce924bfafa84acaed47c5380fc46 (diff) |
sd: Use unique Page ids for better multi-view support + unit test
... instead of using simple IDs which are assumed to be one greater than
the slide position everywhere in the codebase.
Use a 16 bit static counter and uniquely assign page ids to SdPage
objects. This helps in identifying which slide was already selected
in second view before any slide is deleted in the first view. Otherwise,
using simple positions to keep track of it leads the second view to end
up selecting the wrong slide after any slide is added or removed in the
first view.
Change-Id: I465cf7ea86899f0e52549062a9e5fa5cd459f978
Reviewed-on: https://gerrit.libreoffice.org/36863
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: pranavk <pranavk@collabora.co.uk>
Diffstat (limited to 'sd/inc')
-rw-r--r-- | sd/inc/sdpage.hxx | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/sd/inc/sdpage.hxx b/sd/inc/sdpage.hxx index df89127d80b8..0fb422bb1546 100644 --- a/sd/inc/sdpage.hxx +++ b/sd/inc/sdpage.hxx @@ -377,10 +377,16 @@ public: const sd::AnnotationVector& getAnnotations() const { return maAnnotations; } OString stringify() const; virtual void dumpAsXml(struct _xmlTextWriter* pWriter) const override; + sal_uInt16 getPageId() { return mnPageId; } + + static sal_uInt16 mnLastPageId; private: bool mbIsPrecious; + // page id of this page + sal_uInt16 mnPageId; + /** clone the animations from this and set them to rTargetPage */ void cloneAnimations( SdPage& rTargetPage ) const; |