summaryrefslogtreecommitdiff
path: root/sc
diff options
context:
space:
mode:
authorStephan Bergmann <sbergman@redhat.com>2019-03-05 15:41:18 +0100
committerStephan Bergmann <sbergman@redhat.com>2019-03-05 22:11:48 +0100
commitb612cf0e06de231b7f936269db3b51a7f0e8ae3b (patch)
tree2fc88f5b0a78bc952e99b6ee2d24eed8a8241caa /sc
parentefbd217afc52390138195e06e96ef9c8f10bf37b (diff)
Introduce o3tl::underlyingEnumValue
Change-Id: I6554eb86326159b0da707539f45c411f61c0f3de Reviewed-on: https://gerrit.libreoffice.org/68761 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
Diffstat (limited to 'sc')
-rw-r--r--sc/inc/address.hxx5
-rw-r--r--sc/source/core/tool/address.cxx4
-rw-r--r--sc/source/core/tool/reffind.cxx6
3 files changed, 10 insertions, 5 deletions
diff --git a/sc/inc/address.hxx b/sc/inc/address.hxx
index 02a83a132d79..766135d614f9 100644
--- a/sc/inc/address.hxx
+++ b/sc/inc/address.hxx
@@ -32,6 +32,7 @@
#include <formula/grammar.hxx>
#include <o3tl/typed_flags_set.hxx>
+#include <o3tl/underlyingenumvalue.hxx>
namespace com { namespace sun { namespace star {
namespace sheet {
@@ -178,11 +179,11 @@ namespace o3tl
}
inline void applyStartToEndFlags(ScRefFlags &target,const ScRefFlags source)
{
- target |= ScRefFlags(static_cast<std::underlying_type<ScRefFlags>::type>(source) << 4);
+ target |= ScRefFlags(o3tl::underlyingEnumValue(source) << 4);
}
inline void applyStartToEndFlags(ScRefFlags &target)
{
- target |= ScRefFlags(static_cast<std::underlying_type<ScRefFlags>::type>(target) << 4);
+ target |= ScRefFlags(o3tl::underlyingEnumValue(target) << 4);
}
// ScAddress
diff --git a/sc/source/core/tool/address.cxx b/sc/source/core/tool/address.cxx
index 9d076053df6b..666e22ad2910 100644
--- a/sc/source/core/tool/address.cxx
+++ b/sc/source/core/tool/address.cxx
@@ -28,7 +28,7 @@
#include <externalrefmgr.hxx>
#include <osl/diagnose.h>
-
+#include <o3tl/underlyingenumvalue.hxx>
#include <com/sun/star/frame/XModel.hpp>
#include <com/sun/star/sheet/ExternalLinkInfo.hpp>
#include <com/sun/star/sheet/ExternalLinkType.hpp>
@@ -2219,7 +2219,7 @@ OUString ScRange::Format( ScRefFlags nFlags, const ScDocument* pDoc,
lcl_RowAbsFlagDiffer( nFlags ))
{
// move flags of end reference to start reference, mask with BITS to exclude FORCE_DOC flag
- nFlags = ScRefFlags::VALID | (ScRefFlags(static_cast<std::underlying_type<ScRefFlags>::type>(nFlags) >> 4) & ScRefFlags::BITS);
+ nFlags = ScRefFlags::VALID | (ScRefFlags(o3tl::underlyingEnumValue(nFlags) >> 4) & ScRefFlags::BITS);
if ( bOneTab )
pDoc = nullptr;
else
diff --git a/sc/source/core/tool/reffind.cxx b/sc/source/core/tool/reffind.cxx
index 970fa880b993..5896ec8dfd56 100644
--- a/sc/source/core/tool/reffind.cxx
+++ b/sc/source/core/tool/reffind.cxx
@@ -17,6 +17,10 @@
* the License at http://www.apache.org/licenses/LICENSE-2.0 .
*/
+#include <sal/config.h>
+
+#include <o3tl/underlyingenumvalue.hxx>
+
#include <reffind.hxx>
#include <global.hxx>
#include <compiler.hxx>
@@ -219,7 +223,7 @@ static ScRefFlags lcl_NextFlags( ScRefFlags nOld )
{
const ScRefFlags Mask_ABS = ScRefFlags::COL_ABS | ScRefFlags::ROW_ABS | ScRefFlags::TAB_ABS;
ScRefFlags nNew = nOld & Mask_ABS;
- nNew = ScRefFlags( static_cast<std::underlying_type<ScRefFlags>::type>(nNew) - 1 ) & Mask_ABS; // weiterzaehlen
+ nNew = ScRefFlags( o3tl::underlyingEnumValue(nNew) - 1 ) & Mask_ABS; // weiterzaehlen
if (!(nOld & ScRefFlags::TAB_3D))
nNew &= ~ScRefFlags::TAB_ABS; // not 3D -> never absolute!