diff options
Diffstat (limited to 'sw/inc')
-rw-r--r-- | sw/inc/doc.hxx | 2 | ||||
-rw-r--r-- | sw/inc/fesh.hxx | 2 | ||||
-rw-r--r-- | sw/inc/swtable.hxx | 4 | ||||
-rw-r--r-- | sw/inc/tblenum.hxx | 41 |
4 files changed, 28 insertions, 21 deletions
diff --git a/sw/inc/doc.hxx b/sw/inc/doc.hxx index 6fc96f312452..a285846cd63a 100644 --- a/sw/inc/doc.hxx +++ b/sw/inc/doc.hxx @@ -1251,7 +1251,7 @@ public: void AppendUndoForInsertFromDB( const SwPaM& rPam, bool bIsTable ); - bool SetColRowWidthHeight( SwTableBox& rAktBox, sal_uInt16 eType, + bool SetColRowWidthHeight( SwTableBox& rAktBox, TableChgWidthHeightType eType, SwTwips nAbsDiff, SwTwips nRelDiff ); SwTableBoxFormat* MakeTableBoxFormat(); SwTableLineFormat* MakeTableLineFormat(); diff --git a/sw/inc/fesh.hxx b/sw/inc/fesh.hxx index 7b3b50a7a30d..9b8a6d4304e3 100644 --- a/sw/inc/fesh.hxx +++ b/sw/inc/fesh.hxx @@ -729,7 +729,7 @@ public: bool GetTableAutoFormat( SwTableAutoFormat& rGet ); - bool SetColRowWidthHeight( sal_uInt16 eType, sal_uInt16 nDiff ); + bool SetColRowWidthHeight( TableChgWidthHeightType eType, sal_uInt16 nDiff ); bool GetAutoSum( OUString& rFormula ) const; diff --git a/sw/inc/swtable.hxx b/sw/inc/swtable.hxx index c1e9a50fe82e..e2508ec117ac 100644 --- a/sw/inc/swtable.hxx +++ b/sw/inc/swtable.hxx @@ -344,9 +344,9 @@ public: TableChgMode GetTableChgMode() const { return m_eTableChgMode; } void SetTableChgMode( TableChgMode eMode ) { m_eTableChgMode = eMode; } - bool SetColWidth( SwTableBox& rAktBox, sal_uInt16 eType, + bool SetColWidth( SwTableBox& rAktBox, TableChgWidthHeightType eType, SwTwips nAbsDiff, SwTwips nRelDiff, SwUndo** ppUndo ); - bool SetRowHeight( SwTableBox& rAktBox, sal_uInt16 eType, + bool SetRowHeight( SwTableBox& rAktBox, TableChgWidthHeightType eType, SwTwips nAbsDiff, SwTwips nRelDiff, SwUndo** ppUndo ); void RegisterToFormat( SwFormat& rFormat ); #ifdef DBG_UTIL 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 |