summaryrefslogtreecommitdiff
path: root/sw/inc/tblenum.hxx
diff options
context:
space:
mode:
authorNoel Grandin <noel.grandin@collabora.co.uk>2017-04-12 13:38:31 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2017-04-13 08:48:23 +0200
commit890d6790715c4c3f3565b476d538643f04dc6936 (patch)
tree068639197df4994b2025cba2284686829a2aea1d /sw/inc/tblenum.hxx
parent5b6b0bb47aae0dfafb09f4ccf794a921e3717055 (diff)
convert TableChgWidthHeightType to o3tl::typed_flags
Change-Id: I9009f3302f4d117744d80f8816ddd177bae6639d Reviewed-on: https://gerrit.libreoffice.org/36460 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'sw/inc/tblenum.hxx')
-rw-r--r--sw/inc/tblenum.hxx41
1 files changed, 24 insertions, 17 deletions
diff --git a/sw/inc/tblenum.hxx b/sw/inc/tblenum.hxx
index 5e61189c69b2..b5590a6ebc01 100644
--- a/sw/inc/tblenum.hxx
+++ b/sw/inc/tblenum.hxx
@@ -19,26 +19,33 @@
#ifndef INCLUDED_SW_INC_TBLENUM_HXX
#define INCLUDED_SW_INC_TBLENUM_HXX
-// For changing table columns/rows widths/heights.
-typedef sal_uInt16 TableChgWidthHeightType;
+#include <o3tl/typed_flags_set.hxx>
-namespace nsTableChgWidthHeightType
+// For changing table columns/rows widths/heights.
+enum class TableChgWidthHeightType : sal_uInt16
{
- const TableChgWidthHeightType WH_COL_LEFT = 0;
- const TableChgWidthHeightType WH_COL_RIGHT = 1;
- const TableChgWidthHeightType WH_ROW_TOP = 2;
- const TableChgWidthHeightType WH_ROW_BOTTOM = 3;
- const TableChgWidthHeightType WH_CELL_LEFT = 4;
- const TableChgWidthHeightType WH_CELL_RIGHT = 5;
- const TableChgWidthHeightType WH_CELL_TOP = 6;
- const TableChgWidthHeightType WH_CELL_BOTTOM = 7;
+ ColLeft = 0,
+ ColRight = 1,
+ RowTop = 2,
+ RowBottom = 3,
+ CellLeft = 4,
+ CellRight = 5,
+ CellTop = 6,
+ CellBottom = 7,
+ InvalidPos = 0x0f,
- // The following can "or"ed into.
- const TableChgWidthHeightType WH_FLAG_INSDEL = 0x4000; // Insert/Del-mode: the Bigger-Flag
- // tells what happens:
- // bBigger -> box gets removed.
- // !bBigger-> box gets inserted.
- const TableChgWidthHeightType WH_FLAG_BIGGER = 0x8000; // Box becomes larger -> else smaller.
+ // The following can be "or"ed in.
+ InsertDeleteMode = 0x4000, // Insert/Del-mode: the Bigger-Flag
+ // tells what happens:
+ // bBigger -> box gets removed.
+ // !bBigger-> box gets inserted.
+ BiggerMode = 0x8000, // Box becomes larger -> else smaller.
+};
+namespace o3tl {
+ template<> struct typed_flags<TableChgWidthHeightType> : is_typed_flags<TableChgWidthHeightType, 0xc00f> {};
+}
+constexpr TableChgWidthHeightType extractPosition(TableChgWidthHeightType e) {
+ return static_cast<TableChgWidthHeightType>(static_cast<int>(e) & 0xf);
}
enum TableChgMode