diff options
author | Noel Grandin <noelgrandin@gmail.com> | 2015-07-12 21:13:57 +0200 |
---|---|---|
committer | Noel Grandin <noelgrandin@gmail.com> | 2015-07-13 06:58:14 +0000 |
commit | 2970ec843820a72d73a91cc11fc353e5b9fde5fd (patch) | |
tree | f2cee9aa4ff219d1456f2d2f79404cf58f5bb845 /sc | |
parent | 26ac3ee8b2f8cb3bd298d98f9a94c9e305f6c304 (diff) |
editeng: make Link<> usage typed
Change-Id: Iec36c7e4f4fbc2ee2ee25d4d0c8488340ba7d8c4
Reviewed-on: https://gerrit.libreoffice.org/16968
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noelgrandin@gmail.com>
Diffstat (limited to 'sc')
-rw-r--r-- | sc/inc/scmod.hxx | 2 | ||||
-rw-r--r-- | sc/source/ui/app/scmod.cxx | 62 |
2 files changed, 31 insertions, 33 deletions
diff --git a/sc/inc/scmod.hxx b/sc/inc/scmod.hxx index 936fb436abb8..2eb1f5dff769 100644 --- a/sc/inc/scmod.hxx +++ b/sc/inc/scmod.hxx @@ -131,7 +131,7 @@ public: DECL_LINK_TYPED( IdleHandler, Timer*, void ); // Timer instead of idle DECL_LINK_TYPED( SpellTimerHdl, Idle*, void ); - DECL_LINK( CalcFieldValueHdl, EditFieldInfo* ); + DECL_LINK_TYPED( CalcFieldValueHdl, EditFieldInfo*, void ); void Execute( SfxRequest& rReq ); void GetState( SfxItemSet& rSet ); diff --git a/sc/source/ui/app/scmod.cxx b/sc/source/ui/app/scmod.cxx index 754ba8b1efa8..d6b6726d0a0b 100644 --- a/sc/source/ui/app/scmod.cxx +++ b/sc/source/ui/app/scmod.cxx @@ -2140,48 +2140,46 @@ VclPtr<SfxTabPage> ScModule::CreateTabPage( sal_uInt16 nId, vcl::Window* pParent return pRet; } -IMPL_LINK( ScModule, CalcFieldValueHdl, EditFieldInfo*, pInfo ) +IMPL_LINK_TYPED( ScModule, CalcFieldValueHdl, EditFieldInfo*, pInfo, void ) { //TODO: Merge with ScFieldEditEngine! - if (pInfo) + if (!pInfo) + return; + + const SvxFieldItem& rField = pInfo->GetField(); + const SvxFieldData* pField = rField.GetField(); + + if (pField && pField->ISA(SvxURLField)) { - const SvxFieldItem& rField = pInfo->GetField(); - const SvxFieldData* pField = rField.GetField(); + // URLField + const SvxURLField* pURLField = static_cast<const SvxURLField*>(pField); + OUString aURL = pURLField->GetURL(); - if (pField && pField->ISA(SvxURLField)) + switch ( pURLField->GetFormat() ) { - // URLField - const SvxURLField* pURLField = static_cast<const SvxURLField*>(pField); - OUString aURL = pURLField->GetURL(); - - switch ( pURLField->GetFormat() ) + case SVXURLFORMAT_APPDEFAULT: //TODO: Settable in the App? + case SVXURLFORMAT_REPR: { - case SVXURLFORMAT_APPDEFAULT: //TODO: Settable in the App? - case SVXURLFORMAT_REPR: - { - pInfo->SetRepresentation( pURLField->GetRepresentation() ); - } - break; - - case SVXURLFORMAT_URL: - { - pInfo->SetRepresentation( aURL ); - } - break; + pInfo->SetRepresentation( pURLField->GetRepresentation() ); } + break; - svtools::ColorConfigEntry eEntry = - INetURLHistory::GetOrCreate()->QueryUrl( aURL ) ? svtools::LINKSVISITED : svtools::LINKS; - pInfo->SetTextColor( GetColorConfig().GetColorValue(eEntry).nColor ); - } - else - { - OSL_FAIL("Unknown Field"); - pInfo->SetRepresentation(OUString('?')); + case SVXURLFORMAT_URL: + { + pInfo->SetRepresentation( aURL ); + } + break; } - } - return 0; + svtools::ColorConfigEntry eEntry = + INetURLHistory::GetOrCreate()->QueryUrl( aURL ) ? svtools::LINKSVISITED : svtools::LINKS; + pInfo->SetTextColor( GetColorConfig().GetColorValue(eEntry).nColor ); + } + else + { + OSL_FAIL("Unknown Field"); + pInfo->SetRepresentation(OUString('?')); + } } bool ScModule::RegisterRefWindow( sal_uInt16 nSlotId, vcl::Window *pWnd ) |