summaryrefslogtreecommitdiff
path: root/sw
diff options
context:
space:
mode:
authorNoel Grandin <noelgrandin@gmail.com>2015-07-12 21:13:57 +0200
committerNoel Grandin <noelgrandin@gmail.com>2015-07-13 06:58:14 +0000
commit2970ec843820a72d73a91cc11fc353e5b9fde5fd (patch)
treef2cee9aa4ff219d1456f2d2f79404cf58f5bb845 /sw
parent26ac3ee8b2f8cb3bd298d98f9a94c9e305f6c304 (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 'sw')
-rw-r--r--sw/inc/doc.hxx2
-rw-r--r--sw/source/core/doc/docdraw.cxx114
2 files changed, 57 insertions, 59 deletions
diff --git a/sw/inc/doc.hxx b/sw/inc/doc.hxx
index 706f79da1405..d736ff81235a 100644
--- a/sw/inc/doc.hxx
+++ b/sw/inc/doc.hxx
@@ -600,7 +600,7 @@ public:
// INextInterface here
DECL_LINK(BackgroundDone, SvxBrushItem *);
- DECL_LINK(CalcFieldValueHdl, EditFieldInfo*);
+ DECL_LINK_TYPED(CalcFieldValueHdl, EditFieldInfo*, void);
// OLE ???
bool IsOLEPrtNotifyPending() const { return mbOLEPrtNotifyPending; }
diff --git a/sw/source/core/doc/docdraw.cxx b/sw/source/core/doc/docdraw.cxx
index deb4e747cf97..99cf11502345 100644
--- a/sw/source/core/doc/docdraw.cxx
+++ b/sw/source/core/doc/docdraw.cxx
@@ -522,76 +522,74 @@ void SwDoc::SetCalcFieldValueHdl(Outliner* pOutliner)
}
/// Recognise fields/URLs in the Outliner and set how they are displayed.
-IMPL_LINK(SwDoc, CalcFieldValueHdl, EditFieldInfo*, pInfo)
+IMPL_LINK_TYPED(SwDoc, CalcFieldValueHdl, EditFieldInfo*, pInfo, void)
{
- if (pInfo)
- {
- const SvxFieldItem& rField = pInfo->GetField();
- const SvxFieldData* pField = rField.GetField();
+ if (!pInfo)
+ return;
- if (pField && pField->ISA(SvxDateField))
- {
- // Date field
- pInfo->SetRepresentation(
- static_cast<const SvxDateField*>( pField)->GetFormatted(
- *GetNumberFormatter( true ), LANGUAGE_SYSTEM) );
- }
- else if (pField && pField->ISA(SvxURLField))
+ const SvxFieldItem& rField = pInfo->GetField();
+ const SvxFieldData* pField = rField.GetField();
+
+ if (pField && pField->ISA(SvxDateField))
+ {
+ // Date field
+ pInfo->SetRepresentation(
+ static_cast<const SvxDateField*>( pField)->GetFormatted(
+ *GetNumberFormatter( true ), LANGUAGE_SYSTEM) );
+ }
+ else if (pField && pField->ISA(SvxURLField))
+ {
+ // URL field
+ switch ( static_cast<const SvxURLField*>( pField)->GetFormat() )
{
- // URL field
- switch ( static_cast<const SvxURLField*>( pField)->GetFormat() )
+ case SVXURLFORMAT_APPDEFAULT: //!!! Can be set in App???
+ case SVXURLFORMAT_REPR:
{
- case SVXURLFORMAT_APPDEFAULT: //!!! Can be set in App???
- case SVXURLFORMAT_REPR:
- {
- pInfo->SetRepresentation(
- static_cast<const SvxURLField*>(pField)->GetRepresentation());
- }
- break;
+ pInfo->SetRepresentation(
+ static_cast<const SvxURLField*>(pField)->GetRepresentation());
+ }
+ break;
- case SVXURLFORMAT_URL:
- {
- pInfo->SetRepresentation(
- static_cast<const SvxURLField*>(pField)->GetURL());
- }
- break;
+ case SVXURLFORMAT_URL:
+ {
+ pInfo->SetRepresentation(
+ static_cast<const SvxURLField*>(pField)->GetURL());
}
+ break;
+ }
- sal_uInt16 nChrFormat;
+ sal_uInt16 nChrFormat;
- if (IsVisitedURL(static_cast<const SvxURLField*>(pField)->GetURL()))
- nChrFormat = RES_POOLCHR_INET_VISIT;
- else
- nChrFormat = RES_POOLCHR_INET_NORMAL;
+ if (IsVisitedURL(static_cast<const SvxURLField*>(pField)->GetURL()))
+ nChrFormat = RES_POOLCHR_INET_VISIT;
+ else
+ nChrFormat = RES_POOLCHR_INET_NORMAL;
- SwFormat *pFormat = getIDocumentStylePoolAccess().GetCharFormatFromPool(nChrFormat);
+ SwFormat *pFormat = getIDocumentStylePoolAccess().GetCharFormatFromPool(nChrFormat);
- Color aColor(COL_LIGHTBLUE);
- if (pFormat)
- aColor = pFormat->GetColor().GetValue();
+ Color aColor(COL_LIGHTBLUE);
+ if (pFormat)
+ aColor = pFormat->GetColor().GetValue();
- pInfo->SetTextColor(aColor);
- }
- else if (pField && pField->ISA(SdrMeasureField))
- {
- // Measure field
- pInfo->ClearFieldColor();
- }
- else if ( pField && pField->ISA(SvxExtTimeField))
- {
- // Time field
- pInfo->SetRepresentation(
- static_cast<const SvxExtTimeField*>( pField)->GetFormatted(
- *GetNumberFormatter( true ), LANGUAGE_SYSTEM) );
- }
- else
- {
- OSL_FAIL("unknown field command");
- pInfo->SetRepresentation( OUString( '?' ) );
- }
+ pInfo->SetTextColor(aColor);
+ }
+ else if (pField && pField->ISA(SdrMeasureField))
+ {
+ // Measure field
+ pInfo->ClearFieldColor();
+ }
+ else if ( pField && pField->ISA(SvxExtTimeField))
+ {
+ // Time field
+ pInfo->SetRepresentation(
+ static_cast<const SvxExtTimeField*>( pField)->GetFormatted(
+ *GetNumberFormatter( true ), LANGUAGE_SYSTEM) );
+ }
+ else
+ {
+ OSL_FAIL("unknown field command");
+ pInfo->SetRepresentation( OUString( '?' ) );
}
-
- return 0;
}
// #i62875#