diff options
author | Jochen Nitschke <j.nitschke+logerrit@ok.de> | 2016-07-21 15:05:01 +0200 |
---|---|---|
committer | Noel Grandin <noelgrandin@gmail.com> | 2016-07-22 07:04:48 +0000 |
commit | c6c8c2a8b132b1555be3efb7181bac9a074bc208 (patch) | |
tree | 2bf92c878f61c1b4970fc966e381eebf5f82ddd2 /sc/inc | |
parent | f045d14791a84f478c40fbd6b0590f527b36cbff (diff) |
sc: convert MatrixEdge... to typed_flags
remove some unhelpful or obvious comments
replace numeric values in last loop of ScTable::HasBlockMatrixFragment
Change-Id: If7115b504689ce31b5caadbcae8ce2f5466e5b2a
Reviewed-on: https://gerrit.libreoffice.org/27378
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noelgrandin@gmail.com>
Diffstat (limited to 'sc/inc')
-rw-r--r-- | sc/inc/column.hxx | 3 | ||||
-rw-r--r-- | sc/inc/formulacell.hxx | 2 | ||||
-rw-r--r-- | sc/inc/types.hxx | 21 |
3 files changed, 17 insertions, 9 deletions
diff --git a/sc/inc/column.hxx b/sc/inc/column.hxx index 4c2ebca317db..a73f7c4eed13 100644 --- a/sc/inc/column.hxx +++ b/sc/inc/column.hxx @@ -66,6 +66,7 @@ class RowHeightContext; class CompileFormulaContext; struct SetFormulaDirtyContext; class RefMovedHint; +enum class MatrixEdge; } @@ -236,7 +237,7 @@ public: void FindUsed( SCROW nStartRow, SCROW nEndRow, mdds::flat_segment_tree<SCROW, bool>& rUsed ) const; SCSIZE VisibleCount( SCROW nStartRow, SCROW nEndRow ) const; - sal_uInt16 GetBlockMatrixEdges( SCROW nRow1, SCROW nRow2, sal_uInt16 nMask ) const; + sc::MatrixEdge GetBlockMatrixEdges(SCROW nRow1, SCROW nRow2, sc::MatrixEdge nMask ) const; bool HasSelectionMatrixFragment(const ScMarkData& rMark) const; bool GetFirstVisibleAttr( SCROW& rFirstRow ) const; diff --git a/sc/inc/formulacell.hxx b/sc/inc/formulacell.hxx index 28c6d0965287..987704f7c51f 100644 --- a/sc/inc/formulacell.hxx +++ b/sc/inc/formulacell.hxx @@ -295,7 +295,7 @@ public: const ScMatrix* GetMatrix(); bool GetMatrixOrigin( ScAddress& rPos ) const; void GetResultDimensions( SCSIZE& rCols, SCSIZE& rRows ); - sal_uInt16 GetMatrixEdge( ScAddress& rOrgPos ) const; + sc::MatrixEdge GetMatrixEdge( ScAddress& rOrgPos ) const; sal_uInt16 GetErrCode(); // interpret first if necessary sal_uInt16 GetRawError(); // don't interpret, just return code or result error bool GetErrorOrValue( sal_uInt16& rErr, double& rVal ); diff --git a/sc/inc/types.hxx b/sc/inc/types.hxx index ed944b0b7617..5fc451bf4198 100644 --- a/sc/inc/types.hxx +++ b/sc/inc/types.hxx @@ -13,6 +13,7 @@ #include <sal/types.h> #include <boost/intrusive_ptr.hpp> +#include <o3tl/typed_flags_set.hxx> class ScMatrix; @@ -60,13 +61,15 @@ enum ScFormulaVectorState namespace sc { -const sal_uInt16 MatrixEdgeNothing = 0; -const sal_uInt16 MatrixEdgeInside = 1; -const sal_uInt16 MatrixEdgeBottom = 2; -const sal_uInt16 MatrixEdgeLeft = 4; -const sal_uInt16 MatrixEdgeTop = 8; -const sal_uInt16 MatrixEdgeRight = 16; -const sal_uInt16 MatrixEdgeOpen = 32; +enum class MatrixEdge{ + Nothing = 0, + Inside = 1, + Bottom = 2, + Left = 4, + Top = 8, + Right = 16, + Open = 32 +}; // typed_flags, template outside of sc namespace enum GroupCalcState { @@ -121,6 +124,10 @@ enum StartListeningType } +namespace o3tl{ + template<> struct typed_flags<sc::MatrixEdge> : o3tl::is_typed_flags<sc::MatrixEdge, 63> {}; +} + #endif /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ |