diff options
author | Noel Grandin <noelgrandin@gmail.com> | 2015-09-20 21:21:54 +0200 |
---|---|---|
committer | Noel Grandin <noelgrandin@gmail.com> | 2015-09-21 08:17:50 +0000 |
commit | 921686a827e663199c040f376249de727613751f (patch) | |
tree | e6c7f5c8440f147f5f9c2640dc17e684e1083799 /sc | |
parent | 588e1f97577b53a0131fa24c3cdfdf158b27efa7 (diff) |
convert SC_LINKREFTYPE to scoped enum
Change-Id: Ia894548d87390e5170d2b704eac26e34729ebe8e
Reviewed-on: https://gerrit.libreoffice.org/18736
Reviewed-by: Noel Grandin <noelgrandin@gmail.com>
Tested-by: Noel Grandin <noelgrandin@gmail.com>
Diffstat (limited to 'sc')
-rw-r--r-- | sc/inc/hints.hxx | 12 | ||||
-rw-r--r-- | sc/source/core/tool/hints.cxx | 8 | ||||
-rw-r--r-- | sc/source/ui/unoobj/linkuno.cxx | 6 |
3 files changed, 12 insertions, 14 deletions
diff --git a/sc/inc/hints.hxx b/sc/inc/hints.hxx index cedbb00fb6c0..f219973ae622 100644 --- a/sc/inc/hints.hxx +++ b/sc/inc/hints.hxx @@ -81,15 +81,13 @@ public: }; //! move ScLinkRefreshedHint to a different file? - -#define SC_LINKREFTYPE_NONE 0 -#define SC_LINKREFTYPE_SHEET 1 -#define SC_LINKREFTYPE_AREA 2 -#define SC_LINKREFTYPE_DDE 3 +enum class ScLinkRefType { + NONE, SHEET, AREA, DDE +}; class ScLinkRefreshedHint : public SfxHint { - sal_uInt16 nLinkType; // SC_LINKREFTYPE_... + ScLinkRefType nLinkType; OUString aUrl; // used for sheet links OUString aDdeAppl; // used for dde links: OUString aDdeTopic; @@ -106,7 +104,7 @@ public: void SetDdeLink( const OUString& rA, const OUString& rT, const OUString& rI, sal_uInt8 nM ); void SetAreaLink( const ScAddress& rPos ); - sal_uInt16 GetLinkType() const { return nLinkType; } + ScLinkRefType GetLinkType() const { return nLinkType; } const OUString& GetUrl() const { return aUrl; } const OUString& GetDdeAppl() const { return aDdeAppl; } const OUString& GetDdeTopic() const { return aDdeTopic; } diff --git a/sc/source/core/tool/hints.cxx b/sc/source/core/tool/hints.cxx index 3d7a69bb46f7..3cbd133e99b3 100644 --- a/sc/source/core/tool/hints.cxx +++ b/sc/source/core/tool/hints.cxx @@ -57,7 +57,7 @@ ScPointerChangedHint::~ScPointerChangedHint() // ScLinkRefreshedHint - a link has been refreshed ScLinkRefreshedHint::ScLinkRefreshedHint() : - nLinkType( SC_LINKREFTYPE_NONE ), + nLinkType( ScLinkRefType::NONE ), nDdeMode( 0 ) { } @@ -68,14 +68,14 @@ ScLinkRefreshedHint::~ScLinkRefreshedHint() void ScLinkRefreshedHint::SetSheetLink( const OUString& rSourceUrl ) { - nLinkType = SC_LINKREFTYPE_SHEET; + nLinkType = ScLinkRefType::SHEET; aUrl = rSourceUrl; } void ScLinkRefreshedHint::SetDdeLink( const OUString& rA, const OUString& rT, const OUString& rI, sal_uInt8 nM ) { - nLinkType = SC_LINKREFTYPE_DDE; + nLinkType = ScLinkRefType::DDE; aDdeAppl = rA; aDdeTopic = rT; aDdeItem = rI; @@ -84,7 +84,7 @@ void ScLinkRefreshedHint::SetDdeLink( void ScLinkRefreshedHint::SetAreaLink( const ScAddress& rPos ) { - nLinkType = SC_LINKREFTYPE_AREA; + nLinkType = ScLinkRefType::AREA; aDestPos = rPos; } diff --git a/sc/source/ui/unoobj/linkuno.cxx b/sc/source/ui/unoobj/linkuno.cxx index 693c7d9de4c9..eb2b8b9fb8f5 100644 --- a/sc/source/ui/unoobj/linkuno.cxx +++ b/sc/source/ui/unoobj/linkuno.cxx @@ -102,7 +102,7 @@ void ScSheetLinkObj::Notify( SfxBroadcaster&, const SfxHint& rHint ) else if ( dynamic_cast<const ScLinkRefreshedHint*>(&rHint) ) { const ScLinkRefreshedHint& rLH = static_cast<const ScLinkRefreshedHint&>(rHint); - if ( rLH.GetLinkType() == SC_LINKREFTYPE_SHEET && rLH.GetUrl() == aFileName ) + if ( rLH.GetLinkType() == ScLinkRefType::SHEET && rLH.GetUrl() == aFileName ) Refreshed_Impl(); } } @@ -628,7 +628,7 @@ void ScAreaLinkObj::Notify( SfxBroadcaster&, const SfxHint& rHint ) else if ( dynamic_cast<const ScLinkRefreshedHint*>(&rHint) ) { const ScLinkRefreshedHint& rLH = static_cast<const ScLinkRefreshedHint&>(rHint); - if ( rLH.GetLinkType() == SC_LINKREFTYPE_AREA ) + if ( rLH.GetLinkType() == ScLinkRefType::AREA ) { // get this link to compare dest position ScAreaLink* pLink = lcl_GetAreaLink(pDocShell, nPos); @@ -1074,7 +1074,7 @@ void ScDDELinkObj::Notify( SfxBroadcaster&, const SfxHint& rHint ) else if ( dynamic_cast<const ScLinkRefreshedHint*>(&rHint) ) { const ScLinkRefreshedHint& rLH = static_cast<const ScLinkRefreshedHint&>(rHint); - if ( rLH.GetLinkType() == SC_LINKREFTYPE_DDE && + if ( rLH.GetLinkType() == ScLinkRefType::DDE && rLH.GetDdeAppl() == aAppl && rLH.GetDdeTopic() == aTopic && rLH.GetDdeItem() == aItem ) //! mode is ignored |