From 7916487cf4d9603cdbe4c7ffbe9bb3f28b51ce4e Mon Sep 17 00:00:00 2001 From: Noel Grandin Date: Sat, 18 Mar 2017 18:24:53 +0200 Subject: convert ViewShellId to o3tl::strong_int Change-Id: I45553d11d56aa8c4432aec126ca51f24bd3ead09 Reviewed-on: https://gerrit.libreoffice.org/35421 Tested-by: Jenkins Reviewed-by: Noel Grandin --- include/editeng/editund2.hxx | 8 ++++---- include/editeng/outliner.hxx | 3 ++- include/sfx2/viewsh.hxx | 2 +- include/svl/undo.hxx | 14 +++++++++----- include/svx/svdundo.hxx | 6 +++--- 5 files changed, 19 insertions(+), 14 deletions(-) (limited to 'include') diff --git a/include/editeng/editund2.hxx b/include/editeng/editund2.hxx index 0a86fe7a96a5..e4af37b25a36 100644 --- a/include/editeng/editund2.hxx +++ b/include/editeng/editund2.hxx @@ -46,9 +46,9 @@ public: class EDITENG_DLLPUBLIC EditUndo : public SfxUndoAction { private: - sal_uInt16 nId; - sal_Int32 mnViewShellId; - EditEngine* mpEditEngine; + sal_uInt16 nId; + ViewShellId mnViewShellId; + EditEngine* mpEditEngine; public: EditUndo(sal_uInt16 nI, EditEngine* pEE); @@ -62,7 +62,7 @@ public: virtual bool CanRepeat(SfxRepeatTarget&) const override; virtual OUString GetComment() const override; /// See SfxUndoAction::GetViewShellId(). - sal_Int32 GetViewShellId() const override; + ViewShellId GetViewShellId() const override; sal_uInt16 GetId() const; }; diff --git a/include/editeng/outliner.hxx b/include/editeng/outliner.hxx index 034de4776bfc..75127e7e5f30 100644 --- a/include/editeng/outliner.hxx +++ b/include/editeng/outliner.hxx @@ -26,6 +26,7 @@ #include #include #include +#include #include #include #include @@ -377,7 +378,7 @@ class SAL_NO_VTABLE SAL_DLLPUBLIC_RTTI OutlinerViewShell { public: virtual void libreOfficeKitViewCallback(int nType, const char* pPayload) const = 0; - virtual sal_uInt32 GetViewShellId() const = 0; + virtual ViewShellId GetViewShellId() const = 0; /// Wrapper around SfxLokHelper::notifyOtherViews(). virtual void NotifyOtherViews(int nType, const OString& rKey, const OString& rPayload) = 0; /// Wrapper around SfxLokHelper::notifyOtherView(). diff --git a/include/sfx2/viewsh.hxx b/include/sfx2/viewsh.hxx index 14466922f461..e8aef57c7c50 100644 --- a/include/sfx2/viewsh.hxx +++ b/include/sfx2/viewsh.hxx @@ -332,7 +332,7 @@ public: virtual int getPart() const; virtual void dumpAsXml(struct _xmlTextWriter* pWriter) const; /// See OutlinerViewShell::GetViewShellId(). - sal_uInt32 GetViewShellId() const override; + ViewShellId GetViewShellId() const override; /// See OutlinerViewShell::NotifyOtherViews(). void NotifyOtherViews(int nType, const OString& rKey, const OString& rPayload) override; /// See OutlinerViewShell::NotifyOtherView(). diff --git a/include/svl/undo.hxx b/include/svl/undo.hxx index 3fdfb8b4babc..abb892788cbf 100644 --- a/include/svl/undo.hxx +++ b/include/svl/undo.hxx @@ -22,12 +22,16 @@ #include #include #include +#include #include #include struct MarkedUndoAction; +struct ViewShellIdTag; +typedef o3tl::strong_int ViewShellId; + class SVL_DLLPUBLIC SfxRepeatTarget { public: @@ -60,7 +64,7 @@ public: virtual OUString GetComment() const; virtual OUString GetRepeatComment(SfxRepeatTarget&) const; /// ID of the view shell that created this undo action. - virtual sal_Int32 GetViewShellId() const; + virtual ViewShellId GetViewShellId() const; /// Timestamp when this undo item was created. const DateTime& GetDateTime() const; virtual void dumpAsXml(struct _xmlTextWriter* pWriter) const; @@ -134,7 +138,7 @@ class SVL_DLLPUBLIC SfxListUndoAction : public SfxUndoAction, public SfxUndoArra public: SfxListUndoAction( - const OUString &rComment, const OUString& rRepeatComment, sal_uInt16 nId, sal_Int32 nViewShellId, SfxUndoArray *pFather ); + const OUString &rComment, const OUString& rRepeatComment, sal_uInt16 nId, ViewShellId nViewShellId, SfxUndoArray *pFather ); virtual ~SfxListUndoAction() override; virtual void Undo() override; @@ -148,7 +152,7 @@ public: virtual OUString GetComment() const override; /// See SfxUndoAction::GetViewShellId(). - sal_Int32 GetViewShellId() const override; + ViewShellId GetViewShellId() const override; virtual OUString GetRepeatComment(SfxRepeatTarget&) const override; virtual sal_uInt16 GetId() const; @@ -237,7 +241,7 @@ namespace svl virtual bool Repeat( SfxRepeatTarget &rTarget ) = 0; virtual bool CanRepeat( SfxRepeatTarget &rTarget ) const = 0; - virtual void EnterListAction(const OUString &rComment, const OUString& rRepeatComment, sal_uInt16 nId, sal_Int32 nViewShellId) = 0; + virtual void EnterListAction(const OUString &rComment, const OUString& rRepeatComment, sal_uInt16 nId, ViewShellId nViewShellId) = 0; /** leaves the list action entered with EnterListAction @return the number of the sub actions in the list which has just been left. Note that in case no such @@ -329,7 +333,7 @@ public: virtual OUString GetRepeatActionComment( SfxRepeatTarget &rTarget) const override; virtual bool Repeat( SfxRepeatTarget &rTarget ) override; virtual bool CanRepeat( SfxRepeatTarget &rTarget ) const override; - virtual void EnterListAction(const OUString &rComment, const OUString& rRepeatComment, sal_uInt16 nId, sal_Int32 nViewShellId) override; + virtual void EnterListAction(const OUString &rComment, const OUString& rRepeatComment, sal_uInt16 nId, ViewShellId nViewShellId) override; virtual size_t LeaveListAction() override; virtual size_t LeaveAndMergeListAction() override; virtual bool IsInListAction() const override; diff --git a/include/svx/svdundo.hxx b/include/svx/svdundo.hxx index e53ca9872744..2653ba8569e8 100644 --- a/include/svx/svdundo.hxx +++ b/include/svx/svdundo.hxx @@ -54,8 +54,8 @@ class OutlinerParaObject; class SVX_DLLPUBLIC SdrUndoAction : public SfxUndoAction { protected: - SdrModel& rMod; - sal_Int32 m_nViewShellId; + SdrModel& rMod; + ViewShellId m_nViewShellId; protected: SdrUndoAction(SdrModel& rNewMod); @@ -73,7 +73,7 @@ public: virtual void SdrRepeat(SdrView& rView); /// See SfxUndoAction::GetViewShellId(). - sal_Int32 GetViewShellId() const override; + ViewShellId GetViewShellId() const override; }; /** -- cgit