no need declare these tag structs separately

Change-Id: I00f336ee4eced431155c79bee6e2373e145ae95c
Reviewed-on: https://gerrit.libreoffice.org/54780
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
This commit is contained in:
Noel Grandin
2018-05-24 21:43:08 +02:00
committed by Noel Grandin
parent 4b4942224b
commit a28a839b9f
5 changed files with 6 additions and 10 deletions

View File

@@ -83,8 +83,8 @@
#include <sal/types.h> #include <sal/types.h>
#include <o3tl/strong_int.hxx> #include <o3tl/strong_int.hxx>
#include <ostream> #include <ostream>
struct LanguageTypeTag {};
typedef o3tl::strong_int<sal_uInt16, LanguageTypeTag> LanguageType; typedef o3tl::strong_int<sal_uInt16, struct LanguageTypeTag> LanguageType;
inline std::ostream& operator<<(std::ostream& os, LanguageType const & lt) { os << sal_uInt16(lt); return os; } inline std::ostream& operator<<(std::ostream& os, LanguageType const & lt) { os << sal_uInt16(lt); return os; }
constexpr LanguageType primary(LanguageType lt) { return LanguageType(sal_uInt16(lt) & 0x03ff); } constexpr LanguageType primary(LanguageType lt) { return LanguageType(sal_uInt16(lt) & 0x03ff); }

View File

@@ -75,8 +75,7 @@ isInRange(T2 value) {
/// Wrap up an integer type so that we prevent accidental conversion to other integer types. /// Wrap up an integer type so that we prevent accidental conversion to other integer types.
/// ///
/// e.g. /// e.g.
/// struct MyIntTag {}; /// typedef o3tl::strong_int<unsigned, struct MyIntTag> MyInt;
/// typedef o3tl::strong_int<unsigned, MyIntTag> MyInt;
/// ///
/// \param UNDERLYING_TYPE the underlying scalar type /// \param UNDERLYING_TYPE the underlying scalar type
/// \param PHANTOM_TYPE a type tag, used to distinguish this instantiation of the template /// \param PHANTOM_TYPE a type tag, used to distinguish this instantiation of the template

View File

@@ -66,8 +66,7 @@ namespace svl
Id for <SfxInterface>s, gives a quasi-static access to the interface Id for <SfxInterface>s, gives a quasi-static access to the interface
through an array to <SfxApplication>. through an array to <SfxApplication>.
*/ */
struct SfxInterfaceIdTag {}; typedef o3tl::strong_int<sal_uInt16, struct SfxInterfaceIdTag> SfxInterfaceId;
typedef o3tl::strong_int<sal_uInt16, SfxInterfaceIdTag> SfxInterfaceId;
constexpr auto SFX_INTERFACE_NONE = SfxInterfaceId(0); constexpr auto SFX_INTERFACE_NONE = SfxInterfaceId(0);
constexpr auto SFX_INTERFACE_SFXAPP = SfxInterfaceId(1); constexpr auto SFX_INTERFACE_SFXAPP = SfxInterfaceId(1);

View File

@@ -29,8 +29,7 @@
struct MarkedUndoAction; struct MarkedUndoAction;
struct ViewShellIdTag; typedef o3tl::strong_int<sal_Int32, struct ViewShellIdTag> ViewShellId;
typedef o3tl::strong_int<sal_Int32, ViewShellIdTag> ViewShellId;
class SVL_DLLPUBLIC SfxRepeatTarget class SVL_DLLPUBLIC SfxRepeatTarget
{ {

View File

@@ -56,8 +56,7 @@ enum class SdrDragMode
// You can use this value in the methods of SdrLayerSet, but false is returned // You can use this value in the methods of SdrLayerSet, but false is returned
// every time or the method does nothing. // every time or the method does nothing.
// type declaration for Layer-IDs // type declaration for Layer-IDs
struct SdrLayerIDTag {}; typedef o3tl::strong_int<sal_uInt8, struct SdrLayerIDTag> SdrLayerID;
typedef o3tl::strong_int<sal_uInt8,SdrLayerIDTag> SdrLayerID;
// If there is no layer when it should be identified, then // If there is no layer when it should be identified, then
// SdrLayerAdmin::GetLayerID(const String&) returns a value. // SdrLayerAdmin::GetLayerID(const String&) returns a value.