diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2017-02-13 10:45:55 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2017-02-13 13:17:54 +0000 |
commit | ec7cc3e529740384735f7c396461cc16d419f874 (patch) | |
tree | c5e1091f6e368d56f3de7be7110bf364227641f1 /svx/source/inc | |
parent | dc2d33dd903590ca37246376acea7cab5befc06b (diff) |
convert EDocStates to o3tl::typed_flags
Change-Id: I56564932a96560f2113cdc98f389b6a7ede79cf5
Reviewed-on: https://gerrit.libreoffice.org/34203
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'svx/source/inc')
-rw-r--r-- | svx/source/inc/docrecovery.hxx | 32 |
1 files changed, 18 insertions, 14 deletions
diff --git a/svx/source/inc/docrecovery.hxx b/svx/source/inc/docrecovery.hxx index 50b76bc817a3..1f3b3fa70ddf 100644 --- a/svx/source/inc/docrecovery.hxx +++ b/svx/source/inc/docrecovery.hxx @@ -30,6 +30,7 @@ #include <svtools/svlbitm.hxx> #include <svtools/svmedit2.hxx> #include <svtools/treelistbox.hxx> +#include <o3tl/typed_flags_set.hxx> #include <cppuhelper/implbase.hxx> #include <com/sun/star/task/StatusIndicatorFactory.hpp> @@ -73,29 +74,32 @@ #define DLG_RET_OK_AUTOLUNCH 101 -namespace svx{ - namespace DocRecovery{ - - -enum EDocStates +enum class EDocStates { /* TEMP STATES */ /// default state, if a document was new created or loaded - E_UNKNOWN = 0, + Unknown = 0x000, /** an action was started (saving/loading) ... Can be interesting later if the process may be was interrupted by an exception. */ - E_TRY_LOAD_BACKUP = 16, - E_TRY_LOAD_ORIGINAL = 32, + TryLoadBackup = 0x010, + TryLoadOriginal = 0x020, /* FINAL STATES */ /// the Auto/Emergency saved document isn't useable any longer - E_DAMAGED = 64, + Damaged = 0x040, /// the Auto/Emergency saved document is not really up-to-date (some changes can be missing) - E_INCOMPLETE = 128, + Incomplete = 0x080, /// the Auto/Emergency saved document was processed successfully - E_SUCCEDED = 512 + Succeeded = 0x200 }; +namespace o3tl { + template<> struct typed_flags<EDocStates> : is_typed_flags<EDocStates, 0x2f0> {}; +} + + +namespace svx{ + namespace DocRecovery{ enum ERecoveryState @@ -134,7 +138,7 @@ struct TURLInfo OUString Module; /// state info as e.g. VALID, CORRUPTED, NON EXISTING ... - sal_Int32 DocState; + EDocStates DocState; /// ui representation for DocState! ERecoveryState RecoveryState; @@ -146,7 +150,7 @@ struct TURLInfo TURLInfo() : ID (-1 ) - , DocState (E_UNKNOWN ) + , DocState (EDocStates::Unknown) , RecoveryState(E_NOT_RECOVERED_YET) {} }; @@ -256,7 +260,7 @@ class RecoveryCore : public ::cppu::WeakImplHelper< css::frame::XStatusListener /** @short TODO */ - static ERecoveryState mapDocState2RecoverState(sal_Int32 eDocState); + static ERecoveryState mapDocState2RecoverState(EDocStates eDocState); // uno interface |