summaryrefslogtreecommitdiff
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
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>
-rw-r--r--editeng/source/outliner/outliner.cxx13
-rw-r--r--filter/source/svg/svgexport.cxx7
-rw-r--r--filter/source/svg/svgfilter.hxx6
-rw-r--r--include/editeng/outliner.hxx88
-rw-r--r--include/svx/svdedxv.hxx8
-rw-r--r--sc/inc/scmod.hxx2
-rw-r--r--sc/source/ui/app/scmod.cxx62
-rw-r--r--sd/inc/sdmod.hxx2
-rw-r--r--sd/source/ui/app/sdmod2.cxx407
-rw-r--r--sd/source/ui/func/fuinsfil.cxx22
-rw-r--r--sd/source/ui/inc/OutlineView.hxx16
-rw-r--r--sd/source/ui/inc/View.hxx4
-rw-r--r--sd/source/ui/view/outlview.cxx188
-rw-r--r--sd/source/ui/view/sdview.cxx6
-rw-r--r--svx/source/svdraw/svdedxv.cxx23
-rw-r--r--svx/source/svdraw/svdotextdecomposition.cxx24
-rw-r--r--svx/source/unodraw/UnoGraphicExporter.cxx12
-rw-r--r--sw/inc/doc.hxx2
-rw-r--r--sw/source/core/doc/docdraw.cxx114
19 files changed, 479 insertions, 527 deletions
diff --git a/editeng/source/outliner/outliner.cxx b/editeng/source/outliner/outliner.cxx
index 1deb55f649aa..86725f0bc110 100644
--- a/editeng/source/outliner/outliner.cxx
+++ b/editeng/source/outliner/outliner.cxx
@@ -807,7 +807,6 @@ bool Outliner::Expand( Paragraph* pPara )
pHdlParagraph = pPara;
bIsExpanding = true;
pParaList->Expand( pPara );
- ExpandHdl();
InvalidateBullet(pParaList->GetAbsPos(pPara));
if( bUndo )
{
@@ -839,7 +838,6 @@ bool Outliner::Collapse( Paragraph* pPara )
pHdlParagraph = pPara;
bIsExpanding = false;
pParaList->Collapse( pPara );
- ExpandHdl();
InvalidateBullet(pParaList->GetAbsPos(pPara));
if( bUndo )
{
@@ -1663,11 +1661,6 @@ Rectangle Outliner::ImpCalcBulletArea( sal_Int32 nPara, bool bAdjust, bool bRetu
return aBulletArea;
}
-void Outliner::ExpandHdl()
-{
- aExpandHdl.Call( this );
-}
-
EBulletInfo Outliner::GetBulletInfo( sal_Int32 nPara )
{
EBulletInfo aInfo;
@@ -1803,7 +1796,7 @@ IMPL_LINK_NOARG(Outliner, BeginMovingParagraphsHdl)
{
if( !IsInUndo() )
- GetBeginMovingHdl().Call( this );
+ aBeginMovingHdl.Call( this );
return 0;
}
@@ -2056,13 +2049,13 @@ void Outliner::SetEndDropHdl( const Link<>& rLink )
}
/** sets a link that is called before a drop or paste operation. */
-void Outliner::SetBeginPasteOrDropHdl( const Link<>& rLink )
+void Outliner::SetBeginPasteOrDropHdl( const Link<PasteOrDropInfos*,void>& rLink )
{
maBeginPasteOrDropHdl = rLink;
}
/** sets a link that is called after a drop or paste operation. */
-void Outliner::SetEndPasteOrDropHdl( const Link<>& rLink )
+void Outliner::SetEndPasteOrDropHdl( const Link<PasteOrDropInfos*,void>& rLink )
{
maEndPasteOrDropHdl = rLink;
}
diff --git a/filter/source/svg/svgexport.cxx b/filter/source/svg/svgexport.cxx
index 6e91d555bc53..b0ddc8c4eb97 100644
--- a/filter/source/svg/svgexport.cxx
+++ b/filter/source/svg/svgexport.cxx
@@ -2128,7 +2128,7 @@ OUString SVGFilter::implGetInterfaceName( const Reference< XInterface >& rxIf )
-IMPL_LINK( SVGFilter, CalcFieldHdl, EditFieldInfo*, pInfo )
+IMPL_LINK_TYPED( SVGFilter, CalcFieldHdl, EditFieldInfo*, pInfo, void )
{
bool bFieldProcessed = false;
if( pInfo && mbPresentation )
@@ -2146,7 +2146,7 @@ IMPL_LINK( SVGFilter, CalcFieldHdl, EditFieldInfo*, pInfo )
if( !mCreateOjectsCurrentMasterPage.is() )
{
OSL_FAIL( "error: !mCreateOjectsCurrentMasterPage.is()" );
- return 0;
+ return;
}
bool bHasCharSetMap = !( mTextFieldCharSets.find( mCreateOjectsCurrentMasterPage ) == mTextFieldCharSets.end() );
@@ -2365,7 +2365,8 @@ IMPL_LINK( SVGFilter, CalcFieldHdl, EditFieldInfo*, pInfo )
}
}
- return ( bFieldProcessed ? 0 : maOldFieldHdl.Call( pInfo ) );
+ if (!bFieldProcessed)
+ maOldFieldHdl.Call( pInfo );
}
diff --git a/filter/source/svg/svgfilter.hxx b/filter/source/svg/svgfilter.hxx
index 55b625344cfb..b0fc550295af 100644
--- a/filter/source/svg/svgfilter.hxx
+++ b/filter/source/svg/svgfilter.hxx
@@ -244,8 +244,8 @@ private:
XDrawPageSequence mSelectedPages;
XDrawPageSequence mMasterPageTargets;
- Link<> maOldFieldHdl;
- Link<> maNewFieldHdl;
+ Link<EditFieldInfo*,void> maOldFieldHdl;
+ Link<EditFieldInfo*,void> maNewFieldHdl;
bool implImport( const Sequence< PropertyValue >& rDescriptor ) throw (RuntimeException, std::exception);
@@ -290,7 +290,7 @@ private:
static Any implSafeGetPagePropSet( const OUString & sPropertyName,
const Reference< XPropertySet > & rxPropSet,
const Reference< XPropertySetInfo > & rxPropSetInfo );
- DECL_LINK( CalcFieldHdl, EditFieldInfo* );
+ DECL_LINK_TYPED( CalcFieldHdl, EditFieldInfo*, void );
static bool isStreamGZip(css::uno::Reference<css::io::XInputStream> xInput);
static bool isStreamSvg(css::uno::Reference<css::io::XInputStream> xInput);
diff --git a/include/editeng/outliner.hxx b/include/editeng/outliner.hxx
index fbe0b367c16b..d1b05adf6138 100644
--- a/include/editeng/outliner.hxx
+++ b/include/editeng/outliner.hxx
@@ -590,21 +590,19 @@ class EDITENG_DLLPUBLIC Outliner : public SfxBroadcaster
Paragraph* pHdlParagraph;
sal_Int32 mnFirstSelPage;
Link<DrawPortionInfo*,void> aDrawPortionHdl;
- Link<> aDrawBulletHdl;
- Link<> aExpandHdl;
- Link<> aParaInsertedHdl;
- Link<> aParaRemovingHdl;
- Link<> aDepthChangedHdl;
- Link<> aWidthArrReqHdl;
- Link<> aBeginMovingHdl;
- Link<> aEndMovingHdl;
- Link<> aIndentingPagesHdl;
- Link<> aRemovingPagesHdl;
- Link<> aFieldClickedHdl;
- Link<> aCalcFieldValueHdl;
- Link<> maPaintFirstLineHdl;
- Link<> maBeginPasteOrDropHdl;
- Link<> maEndPasteOrDropHdl;
+ Link<DrawBulletInfo*,void> aDrawBulletHdl;
+ Link<Outliner*,void> aParaInsertedHdl;
+ Link<Outliner*,void> aParaRemovingHdl;
+ Link<Outliner*,void> aDepthChangedHdl;
+ Link<Outliner*,void> aBeginMovingHdl;
+ Link<Outliner*,void> aEndMovingHdl;
+ Link<OutlinerView*,long> aIndentingPagesHdl;
+ Link<OutlinerView*,bool> aRemovingPagesHdl;
+ Link<EditFieldInfo*,void> aFieldClickedHdl;
+ Link<EditFieldInfo*,void> aCalcFieldValueHdl;
+ Link<PaintFirstLineInfo*,void> maPaintFirstLineHdl;
+ Link<PasteOrDropInfos*,void> maBeginPasteOrDropHdl;
+ Link<PasteOrDropInfos*,void> maEndPasteOrDropHdl;
sal_Int32 nDepthChangedHdlPrevDepth;
ParaFlag mnDepthChangeHdlPrevFlags;
@@ -760,50 +758,46 @@ public:
Paragraph* GetHdlParagraph() const { return pHdlParagraph; }
bool IsExpanding() const { return bIsExpanding; }
- void ExpandHdl();
- void SetExpandHdl( const Link<>& rLink ) { aExpandHdl = rLink; }
- Link<> GetExpandHdl() const { return aExpandHdl; }
-
void ParagraphInsertedHdl();
- void SetParaInsertedHdl(const Link<>& rLink){aParaInsertedHdl=rLink;}
- Link<> GetParaInsertedHdl() const { return aParaInsertedHdl; }
+ void SetParaInsertedHdl(const Link<Outliner*,void>& rLink){aParaInsertedHdl=rLink;}
+ Link<Outliner*,void> GetParaInsertedHdl() const { return aParaInsertedHdl; }
void ParagraphRemovingHdl();
- void SetParaRemovingHdl(const Link<>& rLink){aParaRemovingHdl=rLink;}
- Link<> GetParaRemovingHdl() const { return aParaRemovingHdl; }
+ void SetParaRemovingHdl(const Link<Outliner*,void>& rLink){aParaRemovingHdl=rLink;}
+ Link<Outliner*,void> GetParaRemovingHdl() const { return aParaRemovingHdl; }
void DepthChangedHdl();
- void SetDepthChangedHdl(const Link<>& rLink){aDepthChangedHdl=rLink;}
- Link<> GetDepthChangedHdl() const { return aDepthChangedHdl; }
+ void SetDepthChangedHdl(const Link<Outliner*,void>& rLink){aDepthChangedHdl=rLink;}
+ Link<Outliner*,void> GetDepthChangedHdl() const { return aDepthChangedHdl; }
sal_Int16 GetPrevDepth() const { return static_cast<sal_Int16>(nDepthChangedHdlPrevDepth); }
ParaFlag GetPrevFlags() const { return mnDepthChangeHdlPrevFlags; }
bool RemovingPagesHdl( OutlinerView* );
- void SetRemovingPagesHdl(const Link<>& rLink){aRemovingPagesHdl=rLink;}
- Link<> GetRemovingPagesHdl() const { return aRemovingPagesHdl; }
+ void SetRemovingPagesHdl(const Link<OutlinerView*,bool>& rLink){aRemovingPagesHdl=rLink;}
+ Link<OutlinerView*,bool> GetRemovingPagesHdl() const { return aRemovingPagesHdl; }
long IndentingPagesHdl( OutlinerView* );
- void SetIndentingPagesHdl(const Link<>& rLink){aIndentingPagesHdl=rLink;}
- Link<> GetIndentingPagesHdl() const { return aIndentingPagesHdl; }
+ void SetIndentingPagesHdl(const Link<OutlinerView*,long>& rLink){aIndentingPagesHdl=rLink;}
+ Link<OutlinerView*,long> GetIndentingPagesHdl() const { return aIndentingPagesHdl; }
// valid only in the two upper handlers
sal_Int32 GetSelPageCount() const { return nDepthChangedHdlPrevDepth; }
// valid only in the two upper handlers
sal_Int32 GetFirstSelPage() const { return mnFirstSelPage; }
- void SetCalcFieldValueHdl(const Link<>& rLink ) { aCalcFieldValueHdl= rLink; }
- Link<> GetCalcFieldValueHdl() const { return aCalcFieldValueHdl; }
+ void SetCalcFieldValueHdl(const Link<EditFieldInfo*,void>& rLink ) { aCalcFieldValueHdl= rLink; }
+ Link<EditFieldInfo*,void> GetCalcFieldValueHdl() const { return aCalcFieldValueHdl; }
- void SetFieldClickedHdl(const Link<>& rLink ) { aFieldClickedHdl= rLink; }
- Link<> GetFieldClickedHdl() const { return aFieldClickedHdl; }
+ void SetFieldClickedHdl(const Link<EditFieldInfo*,void>& rLink ) { aFieldClickedHdl= rLink; }
+ Link<EditFieldInfo*,void> GetFieldClickedHdl() const { return aFieldClickedHdl; }
void SetDrawPortionHdl(const Link<DrawPortionInfo*,void>& rLink){aDrawPortionHdl=rLink;}
Link<DrawPortionInfo*,void> GetDrawPortionHdl() const { return aDrawPortionHdl; }
- void SetDrawBulletHdl(const Link<>& rLink){aDrawBulletHdl=rLink;}
- Link<> GetDrawBulletHdl() const { return aDrawBulletHdl; }
+ void SetDrawBulletHdl(const Link<DrawBulletInfo*,void>& rLink){aDrawBulletHdl=rLink;}
+ Link<DrawBulletInfo*,void> GetDrawBulletHdl() const { return aDrawBulletHdl; }
- void SetPaintFirstLineHdl(const Link<>& rLink) { maPaintFirstLineHdl = rLink; }
- Link<> GetPaintFirstLineHdl() const { return maPaintFirstLineHdl; }
+ void SetPaintFirstLineHdl(const Link<PaintFirstLineInfo*,void>& rLink) { maPaintFirstLineHdl = rLink; }
+ Link<PaintFirstLineInfo*,void> GetPaintFirstLineHdl() const { return maPaintFirstLineHdl; }
void SetModifyHdl( const Link<>& rLink );
Link<> GetModifyHdl() const;
@@ -891,18 +885,14 @@ public:
void SetParaFlag( Paragraph* pPara, ParaFlag nFlag );
static bool HasParaFlag( const Paragraph* pPara, ParaFlag nFlag );
- // Returns an array containing the widths of the Bullet Indentations
- // Last value must be -1. Is deleted by the outliner.
- Link<> GetWidthArrReqHdl() const{ return aWidthArrReqHdl; }
- void SetWidthArrReqHdl(const Link<>& rLink){aWidthArrReqHdl=rLink; }
void SetControlWord( EEControlBits nWord );
EEControlBits GetControlWord() const;
- Link<> GetBeginMovingHdl() const { return aBeginMovingHdl; }
- void SetBeginMovingHdl(const Link<>& rLink) {aBeginMovingHdl=rLink;}
- Link<> GetEndMovingHdl() const {return aEndMovingHdl;}
- void SetEndMovingHdl( const Link<>& rLink){aEndMovingHdl=rLink;}
+ Link<Outliner*,void> GetBeginMovingHdl() const { return aBeginMovingHdl; }
+ void SetBeginMovingHdl(const Link<Outliner*,void>& rLink) {aBeginMovingHdl=rLink;}
+ Link<Outliner*,void> GetEndMovingHdl() const {return aEndMovingHdl;}
+ void SetEndMovingHdl( const Link<Outliner*,void>& rLink){aEndMovingHdl=rLink;}
sal_uLong GetLineCount( sal_Int32 nParagraph ) const;
sal_Int32 GetLineLen( sal_Int32 nParagraph, sal_Int32 nLine ) const;
@@ -995,12 +985,12 @@ public:
void SetEndDropHdl( const Link<>& rLink );
/** sets a link that is called before a drop or paste operation. */
- void SetBeginPasteOrDropHdl( const Link<>& rLink );
- Link<> GetBeginPasteOrDropHdl() const { return maBeginPasteOrDropHdl; }
+ void SetBeginPasteOrDropHdl( const Link<PasteOrDropInfos*,void>& rLink );
+ Link<PasteOrDropInfos*,void> GetBeginPasteOrDropHdl() const { return maBeginPasteOrDropHdl; }
/** sets a link that is called after a drop or paste operation. */
- void SetEndPasteOrDropHdl( const Link<>& rLink );
- Link<> GetEndPasteOrDropHdl() const { return maEndPasteOrDropHdl; }
+ void SetEndPasteOrDropHdl( const Link<PasteOrDropInfos*,void>& rLink );
+ Link<PasteOrDropInfos*,void> GetEndPasteOrDropHdl() const { return maEndPasteOrDropHdl; }
sal_Int16 GetNumberingStartValue( sal_Int32 nPara );
void SetNumberingStartValue( sal_Int32 nPara, sal_Int16 nNumberingStartValue );
diff --git a/include/svx/svdedxv.hxx b/include/svx/svdedxv.hxx
index 005000ddacbf..5c994cc19942 100644
--- a/include/svx/svdedxv.hxx
+++ b/include/svx/svdedxv.hxx
@@ -74,7 +74,7 @@ protected:
Rectangle aTextEditArea;
Rectangle aMinTextEditArea;
- Link<> aOldCalcFieldValueLink; // for call the old handler
+ Link<EditFieldInfo*,void> aOldCalcFieldValueLink; // for call the old handler
Point aMacroDownPos;
sal_uInt16 nMacroTol;
@@ -116,7 +116,7 @@ protected:
// handler for AutoGrowing text with active Outliner
DECL_LINK(ImpOutlinerStatusEventHdl,EditStatus*);
- DECL_LINK(ImpOutlinerCalcFieldValueHdl,EditFieldInfo*);
+ DECL_LINK_TYPED(ImpOutlinerCalcFieldValueHdl,EditFieldInfo*,void);
// link for EndTextEditHdl
DECL_LINK(EndTextEditHdl, SdrUndoManager*);
@@ -124,8 +124,8 @@ protected:
void ImpMacroUp(const Point& rUpPos);
void ImpMacroDown(const Point& rDownPos);
- DECL_LINK( BeginPasteOrDropHdl, PasteOrDropInfos* );
- DECL_LINK( EndPasteOrDropHdl, PasteOrDropInfos* );
+ DECL_LINK_TYPED( BeginPasteOrDropHdl, PasteOrDropInfos*, void );
+ DECL_LINK_TYPED( EndPasteOrDropHdl, PasteOrDropInfos*, void );
protected:
// #i71538# make constructors of SdrView sub-components protected to avoid incomplete incarnations which may get casted to SdrView
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 )
diff --git a/sd/inc/sdmod.hxx b/sd/inc/sdmod.hxx
index dfb9c6a62c76..a113a00fda0d 100644
--- a/sd/inc/sdmod.hxx
+++ b/sd/inc/sdmod.hxx
@@ -80,7 +80,7 @@ class SdModule : public SfxModule, public SfxListener
public:
TYPEINFO_OVERRIDE();
SFX_DECL_INTERFACE(SD_IF_SDAPP)
- DECL_LINK( CalcFieldValueHdl, EditFieldInfo* );
+ DECL_LINK_TYPED( CalcFieldValueHdl, EditFieldInfo*, void );
private:
/// SfxInterface initializer.
diff --git a/sd/source/ui/app/sdmod2.cxx b/sd/source/ui/app/sdmod2.cxx
index a69beb88c18c..2b4866d680fa 100644
--- a/sd/source/ui/app/sdmod2.cxx
+++ b/sd/source/ui/app/sdmod2.cxx
@@ -142,268 +142,265 @@ static SdPage* GetCurrentPage( sd::ViewShell* pViewSh, EditFieldInfo* pInfo, boo
/**
* Link for CalcFieldValue of Outliners
*/
-IMPL_LINK(SdModule, CalcFieldValueHdl, EditFieldInfo*, pInfo)
+IMPL_LINK_TYPED(SdModule, CalcFieldValueHdl, EditFieldInfo*, pInfo, void)
{
- if (pInfo)
- {
- const SvxFieldData* pField = pInfo->GetField().GetField();
- ::sd::DrawDocShell* pDocShell = NULL;
- SdDrawDocument* pDoc = 0;
+ if (!pInfo)
+ return;
- SdrOutliner* pSdrOutliner = dynamic_cast< SdrOutliner* >( pInfo->GetOutliner() );
- if( pSdrOutliner )
- {
- const SdrTextObj* pTextObj = pSdrOutliner->GetTextObj();
+ const SvxFieldData* pField = pInfo->GetField().GetField();
+ ::sd::DrawDocShell* pDocShell = NULL;
+ SdDrawDocument* pDoc = 0;
- if( pTextObj )
- pDoc = dynamic_cast< SdDrawDocument* >( pTextObj->GetModel() );
+ SdrOutliner* pSdrOutliner = dynamic_cast< SdrOutliner* >( pInfo->GetOutliner() );
+ if( pSdrOutliner )
+ {
+ const SdrTextObj* pTextObj = pSdrOutliner->GetTextObj();
- if( pDoc )
- pDocShell = pDoc->GetDocSh();
- }
+ if( pTextObj )
+ pDoc = dynamic_cast< SdDrawDocument* >( pTextObj->GetModel() );
+
+ if( pDoc )
+ pDocShell = pDoc->GetDocSh();
+ }
- if( !pDocShell )
- pDocShell = dynamic_cast< ::sd::DrawDocShell *>( SfxObjectShell::Current() );
+ if( !pDocShell )
+ pDocShell = dynamic_cast< ::sd::DrawDocShell *>( SfxObjectShell::Current() );
- const SvxDateField* pDateField = 0;
- const SvxExtTimeField* pExtTimeField = 0;
- const SvxExtFileField* pExtFileField = 0;
- const SvxAuthorField* pAuthorField = 0;
- const SvxURLField* pURLField = 0;
+ const SvxDateField* pDateField = 0;
+ const SvxExtTimeField* pExtTimeField = 0;
+ const SvxExtFileField* pExtFileField = 0;
+ const SvxAuthorField* pAuthorField = 0;
+ const SvxURLField* pURLField = 0;
- if( (pDateField = dynamic_cast< const SvxDateField* >(pField)) != 0 )
+ if( (pDateField = dynamic_cast< const SvxDateField* >(pField)) != 0 )
+ {
+ LanguageType eLang = pInfo->GetOutliner()->GetLanguage( pInfo->GetPara(), pInfo->GetPos() );
+ pInfo->SetRepresentation( pDateField->GetFormatted( *GetNumberFormatter(), eLang ) );
+ }
+ else if( (pExtTimeField = dynamic_cast< const SvxExtTimeField *>(pField)) != 0 )
+ {
+ LanguageType eLang = pInfo->GetOutliner()->GetLanguage( pInfo->GetPara(), pInfo->GetPos() );
+ pInfo->SetRepresentation( pExtTimeField->GetFormatted( *GetNumberFormatter(), eLang ) );
+ }
+ else if( (pExtFileField = dynamic_cast< const SvxExtFileField * >(pField)) != 0 )
+ {
+ if( pDocShell && (pExtFileField->GetType() != SVXFILETYPE_FIX) )
{
- LanguageType eLang = pInfo->GetOutliner()->GetLanguage( pInfo->GetPara(), pInfo->GetPos() );
- pInfo->SetRepresentation( pDateField->GetFormatted( *GetNumberFormatter(), eLang ) );
+ OUString aName;
+ if( pDocShell->HasName() )
+ aName = pDocShell->GetMedium()->GetName();
+ else
+ aName = pDocShell->GetName();
+
+ const_cast< SvxExtFileField* >(pExtFileField)->SetFile( aName );
}
- else if( (pExtTimeField = dynamic_cast< const SvxExtTimeField *>(pField)) != 0 )
+ pInfo->SetRepresentation( pExtFileField->GetFormatted() );
+
+ }
+ else if( (pAuthorField = dynamic_cast< const SvxAuthorField* >( pField )) != 0 )
+ {
+ if( pAuthorField->GetType() != SVXAUTHORTYPE_FIX )
{
- LanguageType eLang = pInfo->GetOutliner()->GetLanguage( pInfo->GetPara(), pInfo->GetPos() );
- pInfo->SetRepresentation( pExtTimeField->GetFormatted( *GetNumberFormatter(), eLang ) );
+ SvtUserOptions aUserOptions;
+ SvxAuthorField aAuthorField(
+ aUserOptions.GetFirstName(), aUserOptions.GetLastName(), aUserOptions.GetID(),
+ pAuthorField->GetType(), pAuthorField->GetFormat() );
+
+ *(const_cast< SvxAuthorField* >(pAuthorField)) = aAuthorField;
}
- else if( (pExtFileField = dynamic_cast< const SvxExtFileField * >(pField)) != 0 )
- {
- if( pDocShell && (pExtFileField->GetType() != SVXFILETYPE_FIX) )
- {
- OUString aName;
- if( pDocShell->HasName() )
- aName = pDocShell->GetMedium()->GetName();
- else
- aName = pDocShell->GetName();
+ pInfo->SetRepresentation( pAuthorField->GetFormatted() );
- const_cast< SvxExtFileField* >(pExtFileField)->SetFile( aName );
- }
- pInfo->SetRepresentation( pExtFileField->GetFormatted() );
+ }
+ else if( dynamic_cast< const SvxPageField* >(pField) )
+ {
+ OUString aRepresentation(" ");
- }
- else if( (pAuthorField = dynamic_cast< const SvxAuthorField* >( pField )) != 0 )
+ ::sd::ViewShell* pViewSh = pDocShell ? pDocShell->GetViewShell() : NULL;
+ if(pViewSh == NULL)
{
- if( pAuthorField->GetType() != SVXAUTHORTYPE_FIX )
- {
- SvtUserOptions aUserOptions;
- SvxAuthorField aAuthorField(
- aUserOptions.GetFirstName(), aUserOptions.GetLastName(), aUserOptions.GetID(),
- pAuthorField->GetType(), pAuthorField->GetFormat() );
+ ::sd::ViewShellBase* pBase = PTR_CAST(::sd::ViewShellBase, SfxViewShell::Current());
+ if(pBase)
+ pViewSh = pBase->GetMainViewShell().get();
+ }
+ if( !pDoc && pViewSh )
+ pDoc = pViewSh->GetDoc();
- *(const_cast< SvxAuthorField* >(pAuthorField)) = aAuthorField;
- }
- pInfo->SetRepresentation( pAuthorField->GetFormatted() );
+ bool bMasterView;
+ SdPage* pPage = GetCurrentPage( pViewSh, pInfo, bMasterView );
- }
- else if( dynamic_cast< const SvxPageField* >(pField) )
+ if( pPage && pDoc && !bMasterView )
{
- OUString aRepresentation(" ");
+ int nPgNum;
- ::sd::ViewShell* pViewSh = pDocShell ? pDocShell->GetViewShell() : NULL;
- if(pViewSh == NULL)
+ if( (pPage->GetPageKind() == PK_HANDOUT) && pViewSh )
{
- ::sd::ViewShellBase* pBase = PTR_CAST(::sd::ViewShellBase, SfxViewShell::Current());
- if(pBase)
- pViewSh = pBase->GetMainViewShell().get();
+ nPgNum = pViewSh->GetPrintedHandoutPageNum();
}
- if( !pDoc && pViewSh )
- pDoc = pViewSh->GetDoc();
-
- bool bMasterView;
- SdPage* pPage = GetCurrentPage( pViewSh, pInfo, bMasterView );
-
- if( pPage && pDoc && !bMasterView )
+ else
{
- int nPgNum;
-
- if( (pPage->GetPageKind() == PK_HANDOUT) && pViewSh )
- {
- nPgNum = pViewSh->GetPrintedHandoutPageNum();
- }
- else
- {
- nPgNum = (pPage->GetPageNum() - 1) / 2 + 1;
- }
- aRepresentation = pDoc->CreatePageNumValue((sal_uInt16)nPgNum);
+ nPgNum = (pPage->GetPageNum() - 1) / 2 + 1;
}
- else
- aRepresentation = SdResId(STR_FIELD_PLACEHOLDER_NUMBER).toString();
-
- pInfo->SetRepresentation( aRepresentation );
+ aRepresentation = pDoc->CreatePageNumValue((sal_uInt16)nPgNum);
}
+ else
+ aRepresentation = SdResId(STR_FIELD_PLACEHOLDER_NUMBER).toString();
- else if( dynamic_cast< const SvxPageTitleField* >(pField) )
- {
- OUString aRepresentation(" ");
+ pInfo->SetRepresentation( aRepresentation );
+ }
- ::sd::ViewShell* pViewSh = pDocShell ? pDocShell->GetViewShell() : NULL;
- if(pViewSh == NULL)
- {
- ::sd::ViewShellBase* pBase = PTR_CAST(::sd::ViewShellBase, SfxViewShell::Current());
- if(pBase)
- pViewSh = pBase->GetMainViewShell().get();
- }
- if( !pDoc && pViewSh )
- pDoc = pViewSh->GetDoc();
+ else if( dynamic_cast< const SvxPageTitleField* >(pField) )
+ {
+ OUString aRepresentation(" ");
- bool bMasterView;
- SdPage* pPage = GetCurrentPage( pViewSh, pInfo, bMasterView );
+ ::sd::ViewShell* pViewSh = pDocShell ? pDocShell->GetViewShell() : NULL;
+ if(pViewSh == NULL)
+ {
+ ::sd::ViewShellBase* pBase = PTR_CAST(::sd::ViewShellBase, SfxViewShell::Current());
+ if(pBase)
+ pViewSh = pBase->GetMainViewShell().get();
+ }
+ if( !pDoc && pViewSh )
+ pDoc = pViewSh->GetDoc();
- if( pPage && pDoc && !bMasterView )
- {
- aRepresentation = pPage->GetName();
- }
- else
- {
- DocumentType eDocType = pDoc ? pDoc->GetDocumentType() : DOCUMENT_TYPE_IMPRESS;
- aRepresentation = ( ( eDocType == DOCUMENT_TYPE_IMPRESS )
- ? SdResId(STR_FIELD_PLACEHOLDER_SLIDENAME).toString()
- : SdResId(STR_FIELD_PLACEHOLDER_PAGENAME).toString() );
- }
+ bool bMasterView;
+ SdPage* pPage = GetCurrentPage( pViewSh, pInfo, bMasterView );
- pInfo->SetRepresentation( aRepresentation );
+ if( pPage && pDoc && !bMasterView )
+ {
+ aRepresentation = pPage->GetName();
}
- else if( dynamic_cast< const SvxPagesField* >(pField) )
+ else
{
- OUString aRepresentation(" ");
+ aRepresentation = ( ( pDoc->GetDocumentType() == DOCUMENT_TYPE_IMPRESS )
+ ? SdResId(STR_FIELD_PLACEHOLDER_SLIDENAME).toString()
+ : SdResId(STR_FIELD_PLACEHOLDER_PAGENAME).toString() );
+ }
- ::sd::ViewShell* pViewSh = pDocShell ? pDocShell->GetViewShell() : NULL;
- if(pViewSh == NULL)
- {
- ::sd::ViewShellBase* pBase = PTR_CAST(::sd::ViewShellBase, SfxViewShell::Current());
- if(pBase)
- pViewSh = pBase->GetMainViewShell().get();
- }
- if( !pDoc && pViewSh )
- pDoc = pViewSh->GetDoc();
+ pInfo->SetRepresentation( aRepresentation );
+ }
+ else if( dynamic_cast< const SvxPagesField* >(pField) )
+ {
+ OUString aRepresentation(" ");
- bool bMasterView;
- SdPage* pPage = GetCurrentPage( pViewSh, pInfo, bMasterView );
+ ::sd::ViewShell* pViewSh = pDocShell ? pDocShell->GetViewShell() : NULL;
+ if(pViewSh == NULL)
+ {
+ ::sd::ViewShellBase* pBase = PTR_CAST(::sd::ViewShellBase, SfxViewShell::Current());
+ if(pBase)
+ pViewSh = pBase->GetMainViewShell().get();
+ }
+ if( !pDoc && pViewSh )
+ pDoc = pViewSh->GetDoc();
- sal_uInt16 nPageCount = 0;
+ bool bMasterView;
+ SdPage* pPage = GetCurrentPage( pViewSh, pInfo, bMasterView );
- if( !bMasterView )
- {
- if( pPage && (pPage->GetPageKind() == PK_HANDOUT) && pViewSh )
- {
- nPageCount = pViewSh->GetPrintedHandoutPageCount();
- }
- else if( pDoc )
- {
- nPageCount = (sal_uInt16)pDoc->GetActiveSdPageCount();
- }
- }
+ sal_uInt16 nPageCount = 0;
- if( nPageCount > 0 )
- aRepresentation = pDoc->CreatePageNumValue(nPageCount);
- else
- aRepresentation = SdResId(STR_FIELD_PLACEHOLDER_COUNT).toString();
-
- pInfo->SetRepresentation( aRepresentation );
- }
- else if( (pURLField = dynamic_cast< const SvxURLField* >(pField)) != 0 )
+ if( !bMasterView )
{
- switch ( pURLField->GetFormat() )
+ if( pPage && (pPage->GetPageKind() == PK_HANDOUT) && pViewSh )
{
- case SVXURLFORMAT_APPDEFAULT: //!!! adjustable at App???
- case SVXURLFORMAT_REPR:
- pInfo->SetRepresentation( pURLField->GetRepresentation() );
- break;
-
- case SVXURLFORMAT_URL:
- pInfo->SetRepresentation( pURLField->GetURL() );
- break;
+ nPageCount = pViewSh->GetPrintedHandoutPageCount();
}
+ else if( pDoc )
+ {
+ nPageCount = (sal_uInt16)pDoc->GetActiveSdPageCount();
+ }
+ }
- OUString aURL = pURLField->GetURL();
+ if( nPageCount > 0 )
+ aRepresentation = pDoc->CreatePageNumValue(nPageCount);
+ else
+ aRepresentation = SdResId(STR_FIELD_PLACEHOLDER_COUNT).toString();
- svtools::ColorConfig aConfig;
- svtools::ColorConfigEntry eEntry =
- INetURLHistory::GetOrCreate()->QueryUrl( aURL ) ? svtools::LINKSVISITED : svtools::LINKS;
- pInfo->SetTextColor( aConfig.GetColorValue(eEntry).nColor );
- }
- else if ( dynamic_cast< const SdrMeasureField* >(pField))
+ pInfo->SetRepresentation( aRepresentation );
+ }
+ else if( (pURLField = dynamic_cast< const SvxURLField* >(pField)) != 0 )
+ {
+ switch ( pURLField->GetFormat() )
{
- pInfo->ClearFieldColor();
+ case SVXURLFORMAT_APPDEFAULT: //!!! adjustable at App???
+ case SVXURLFORMAT_REPR:
+ pInfo->SetRepresentation( pURLField->GetRepresentation() );
+ break;
+
+ case SVXURLFORMAT_URL:
+ pInfo->SetRepresentation( pURLField->GetURL() );
+ break;
}
- else
- {
- OUString aRepresentation;
- bool bHeaderField = dynamic_cast< const SvxHeaderField* >( pField ) != 0;
- bool bFooterField = !bHeaderField && (dynamic_cast< const SvxFooterField* >( pField ) != 0 );
- bool bDateTimeField = !bHeaderField && !bFooterField && (dynamic_cast< const SvxDateTimeField* >( pField ) != 0);
+ OUString aURL = pURLField->GetURL();
+
+ svtools::ColorConfig aConfig;
+ svtools::ColorConfigEntry eEntry =
+ INetURLHistory::GetOrCreate()->QueryUrl( aURL ) ? svtools::LINKSVISITED : svtools::LINKS;
+ pInfo->SetTextColor( aConfig.GetColorValue(eEntry).nColor );
+ }
+ else if ( dynamic_cast< const SdrMeasureField* >(pField))
+ {
+ pInfo->ClearFieldColor();
+ }
+ else
+ {
+ OUString aRepresentation;
+
+ bool bHeaderField = dynamic_cast< const SvxHeaderField* >( pField ) != 0;
+ bool bFooterField = !bHeaderField && (dynamic_cast< const SvxFooterField* >( pField ) != 0 );
+ bool bDateTimeField = !bHeaderField && !bFooterField && (dynamic_cast< const SvxDateTimeField* >( pField ) != 0);
+
+ if( bHeaderField || bFooterField || bDateTimeField )
+ {
+ sd::ViewShell* pViewSh = pDocShell ? pDocShell->GetViewShell() : NULL;
+ bool bMasterView = false;
+ SdPage* pPage = GetCurrentPage( pViewSh, pInfo, bMasterView );
- if( bHeaderField || bFooterField || bDateTimeField )
+ if( (pPage == NULL) || bMasterView )
{
- sd::ViewShell* pViewSh = pDocShell ? pDocShell->GetViewShell() : NULL;
- bool bMasterView = false;
- SdPage* pPage = GetCurrentPage( pViewSh, pInfo, bMasterView );
+ if( bHeaderField )
+ aRepresentation = SdResId(STR_FIELD_PLACEHOLDER_HEADER).toString();
+ else if (bFooterField )
+ aRepresentation = SdResId(STR_FIELD_PLACEHOLDER_FOOTER).toString();
+ else if (bDateTimeField )
+ aRepresentation = SdResId(STR_FIELD_PLACEHOLDER_DATETIME).toString();
+ }
+ else
+ {
+ const sd::HeaderFooterSettings &rSettings = pPage->getHeaderFooterSettings();
- if( (pPage == NULL) || bMasterView )
+ if( bHeaderField )
{
- if( bHeaderField )
- aRepresentation = SdResId(STR_FIELD_PLACEHOLDER_HEADER).toString();
- else if (bFooterField )
- aRepresentation = SdResId(STR_FIELD_PLACEHOLDER_FOOTER).toString();
- else if (bDateTimeField )
- aRepresentation = SdResId(STR_FIELD_PLACEHOLDER_DATETIME).toString();
+ aRepresentation = rSettings.maHeaderText;
}
- else
+ else if( bFooterField )
{
- const sd::HeaderFooterSettings &rSettings = pPage->getHeaderFooterSettings();
-
- if( bHeaderField )
- {
- aRepresentation = rSettings.maHeaderText;
- }
- else if( bFooterField )
+ aRepresentation = rSettings.maFooterText;
+ }
+ else if( bDateTimeField )
+ {
+ if( rSettings.mbDateTimeIsFixed )
{
- aRepresentation = rSettings.maFooterText;
+ aRepresentation = rSettings.maDateTimeText;
}
- else if( bDateTimeField )
+ else
{
- if( rSettings.mbDateTimeIsFixed )
- {
- aRepresentation = rSettings.maDateTimeText;
- }
- else
- {
- Date aDate( Date::SYSTEM );
- tools::Time aTime( tools::Time::SYSTEM );
- LanguageType eLang = pInfo->GetOutliner()->GetLanguage( pInfo->GetPara(), pInfo->GetPos() );
- aRepresentation = SvxDateTimeField::GetFormatted( aDate, aTime, (SvxDateFormat)rSettings.meDateTimeFormat, *GetNumberFormatter(), eLang );
- }
+ Date aDate( Date::SYSTEM );
+ tools::Time aTime( tools::Time::SYSTEM );
+ LanguageType eLang = pInfo->GetOutliner()->GetLanguage( pInfo->GetPara(), pInfo->GetPos() );
+ aRepresentation = SvxDateTimeField::GetFormatted( aDate, aTime, (SvxDateFormat)rSettings.meDateTimeFormat, *GetNumberFormatter(), eLang );
}
}
}
- else
- {
- OSL_FAIL("sd::SdModule::CalcFieldValueHdl(), unknown field type!");
- }
-
- if( aRepresentation.isEmpty() ) // TODO: Edit engine doesn't handle empty fields?
- aRepresentation = " ";
- pInfo->SetRepresentation( aRepresentation );
}
- }
+ else
+ {
+ OSL_FAIL("sd::SdModule::CalcFieldValueHdl(), unknown field type!");
+ }
- return 0;
+ if( aRepresentation.isEmpty() ) // TODO: Edit engine doesn't handle empty fields?
+ aRepresentation = " ";
+ pInfo->SetRepresentation( aRepresentation );
+ }
}
/**
diff --git a/sd/source/ui/func/fuinsfil.cxx b/sd/source/ui/func/fuinsfil.cxx
index 414ea1ac7ba5..213365d60168 100644
--- a/sd/source/ui/func/fuinsfil.cxx
+++ b/sd/source/ui/func/fuinsfil.cxx
@@ -694,19 +694,19 @@ bool FuInsertFile::InsSDDinOlMode(SfxMedium* pMedium)
::Outliner* pOutliner = pOlView->GetViewByWindow(mpWindow)->GetOutliner();
// cut notification links temporarily
- Link<> aOldParagraphInsertedHdl = pOutliner->GetParaInsertedHdl();
- pOutliner->SetParaInsertedHdl( Link<>(NULL, NULL));
- Link<> aOldParagraphRemovingHdl = pOutliner->GetParaRemovingHdl();
- pOutliner->SetParaRemovingHdl( Link<>(NULL, NULL));
- Link<> aOldDepthChangedHdl = pOutliner->GetDepthChangedHdl();
- pOutliner->SetDepthChangedHdl( Link<>(NULL, NULL));
- Link<> aOldBeginMovingHdl = pOutliner->GetBeginMovingHdl();
- pOutliner->SetBeginMovingHdl( Link<>(NULL, NULL));
- Link<> aOldEndMovingHdl = pOutliner->GetEndMovingHdl();
- pOutliner->SetEndMovingHdl( Link<>(NULL, NULL));
+ Link<::Outliner*,void> aOldParagraphInsertedHdl = pOutliner->GetParaInsertedHdl();
+ pOutliner->SetParaInsertedHdl( Link<::Outliner*,void>());
+ Link<::Outliner*,void> aOldParagraphRemovingHdl = pOutliner->GetParaRemovingHdl();
+ pOutliner->SetParaRemovingHdl( Link<::Outliner*,void>());
+ Link<::Outliner*,void> aOldDepthChangedHdl = pOutliner->GetDepthChangedHdl();
+ pOutliner->SetDepthChangedHdl( Link<::Outliner*,void>());
+ Link<::Outliner*,void> aOldBeginMovingHdl = pOutliner->GetBeginMovingHdl();
+ pOutliner->SetBeginMovingHdl( Link<::Outliner*,void>());
+ Link<::Outliner*,void> aOldEndMovingHdl = pOutliner->GetEndMovingHdl();
+ pOutliner->SetEndMovingHdl( Link<::Outliner*,void>());
Link<> aOldStatusEventHdl = pOutliner->GetStatusEventHdl();
- pOutliner->SetStatusEventHdl(Link<>(NULL, NULL));
+ pOutliner->SetStatusEventHdl(Link<>());
pOutliner->Clear();
pOlView->FillOutliner();
diff --git a/sd/source/ui/inc/OutlineView.hxx b/sd/source/ui/inc/OutlineView.hxx
index 68756dc14e73..495a4d7b4fc6 100644
--- a/sd/source/ui/inc/OutlineView.hxx
+++ b/sd/source/ui/inc/OutlineView.hxx
@@ -95,17 +95,17 @@ public:
void Paint (const Rectangle& rRect, ::sd::Window* pWin);
// Callbacks fuer LINKs
- DECL_LINK( ParagraphInsertedHdl, Outliner * );
- DECL_LINK( ParagraphRemovingHdl, Outliner * );
- DECL_LINK( DepthChangedHdl, Outliner * );
+ DECL_LINK_TYPED( ParagraphInsertedHdl, Outliner *, void );
+ DECL_LINK_TYPED( ParagraphRemovingHdl, Outliner *, void );
+ DECL_LINK_TYPED( DepthChangedHdl, Outliner *, void );
DECL_LINK( StatusEventHdl, void * );
- DECL_LINK( BeginMovingHdl, Outliner * );
- DECL_LINK( EndMovingHdl, Outliner * );
- DECL_LINK(RemovingPagesHdl, void *);
- DECL_LINK( IndentingPagesHdl, OutlinerView * );
+ DECL_LINK_TYPED( BeginMovingHdl, Outliner *, void );
+ DECL_LINK_TYPED( EndMovingHdl, Outliner *, void );
+ DECL_LINK_TYPED( RemovingPagesHdl, OutlinerView *, bool );
+ DECL_LINK_TYPED( IndentingPagesHdl, OutlinerView *, long );
DECL_LINK( BeginDropHdl, void * );
DECL_LINK( EndDropHdl, void * );
- DECL_LINK( PaintingFirstLineHdl, PaintFirstLineInfo* );
+ DECL_LINK_TYPED( PaintingFirstLineHdl, PaintFirstLineInfo*, void );
sal_uLong GetPaperWidth() { return mnPaperWidth;}
diff --git a/sd/source/ui/inc/View.hxx b/sd/source/ui/inc/View.hxx
index 1b2e223a8d25..f2509c52194a 100644
--- a/sd/source/ui/inc/View.hxx
+++ b/sd/source/ui/inc/View.hxx
@@ -258,8 +258,8 @@ public:
SdrObject* GetSelectedSingleObject(SdPage* pPage);
protected:
- DECL_LINK( OnParagraphInsertedHdl, ::Outliner * );
- DECL_LINK( OnParagraphRemovingHdl, ::Outliner * );
+ DECL_LINK_TYPED( OnParagraphInsertedHdl, ::Outliner *, void );
+ DECL_LINK_TYPED( OnParagraphRemovingHdl, ::Outliner *, void );
virtual void OnBeginPasteOrDrop( PasteOrDropInfos* pInfos ) SAL_OVERRIDE;
virtual void OnEndPasteOrDrop( PasteOrDropInfos* pInfos ) SAL_OVERRIDE;
diff --git a/sd/source/ui/view/outlview.cxx b/sd/source/ui/view/outlview.cxx
index bc3c87b1e197..19f38f0181b9 100644
--- a/sd/source/ui/view/outlview.cxx
+++ b/sd/source/ui/view/outlview.cxx
@@ -363,7 +363,7 @@ Paragraph* OutlineView::GetNextTitle(const Paragraph* pPara)
/**
* Handler for inserting pages (paragraphs)
*/
-IMPL_LINK( OutlineView, ParagraphInsertedHdl, ::Outliner *, pOutliner )
+IMPL_LINK_TYPED( OutlineView, ParagraphInsertedHdl, ::Outliner *, pOutliner, void )
{
// we get calls to this handler during binary insert of drag and drop contents but
// we ignore it here and handle it later in OnEndPasteOrDrop()
@@ -384,8 +384,6 @@ IMPL_LINK( OutlineView, ParagraphInsertedHdl, ::Outliner *, pOutliner )
InsertSlideForParagraph( pPara );
}
}
-
- return 0;
}
/** creates and inserts an empty slide for the given paragraph */
@@ -505,7 +503,7 @@ SdPage* OutlineView::InsertSlideForParagraph( Paragraph* pPara )
/**
* Handler for deleting pages (paragraphs)
*/
-IMPL_LINK( OutlineView, ParagraphRemovingHdl, ::Outliner *, pOutliner )
+IMPL_LINK_TYPED( OutlineView, ParagraphRemovingHdl, ::Outliner *, pOutliner, void )
{
DBG_ASSERT( isRecordingUndo(), "sd::OutlineView::ParagraphRemovingHdl(), model change without undo?!" );
@@ -556,15 +554,13 @@ IMPL_LINK( OutlineView, ParagraphRemovingHdl, ::Outliner *, pOutliner )
}
pOutliner->UpdateFields();
}
-
- return 0;
}
/**
* Handler for changing the indentation depth of paragraphs (requires inserting
* or deleting of pages in some cases)
*/
-IMPL_LINK( OutlineView, DepthChangedHdl, ::Outliner *, pOutliner )
+IMPL_LINK_TYPED( OutlineView, DepthChangedHdl, ::Outliner *, pOutliner, void )
{
DBG_ASSERT( isRecordingUndo(), "sd::OutlineView::DepthChangedHdl(), no undo for model change?!" );
@@ -773,8 +769,6 @@ IMPL_LINK( OutlineView, DepthChangedHdl, ::Outliner *, pOutliner )
}
}
}
-
- return 0;
}
/**
@@ -821,7 +815,7 @@ IMPL_LINK_NOARG(OutlineView, EndDropHdl)
/**
* Handler for the start of a paragraph movement
*/
-IMPL_LINK( OutlineView, BeginMovingHdl, ::Outliner *, pOutliner )
+IMPL_LINK_TYPED( OutlineView, BeginMovingHdl, ::Outliner *, pOutliner, void )
{
OutlineViewPageChangesGuard aGuard(this);
@@ -857,14 +851,12 @@ IMPL_LINK( OutlineView, BeginMovingHdl, ::Outliner *, pOutliner )
}
pPara = pOutliner->GetParagraph( ++nParaPos );
}
-
- return 0;
}
/**
* Handler for the end of a paragraph movement
*/
-IMPL_LINK( OutlineView, EndMovingHdl, ::Outliner *, pOutliner )
+IMPL_LINK_TYPED( OutlineView, EndMovingHdl, ::Outliner *, pOutliner, void )
{
OutlineViewPageChangesGuard aGuard(this);
@@ -924,8 +916,6 @@ IMPL_LINK( OutlineView, EndMovingHdl, ::Outliner *, pOutliner )
maSelectedParas.clear();
maOldParaOrder.clear();
-
- return 0;
}
/**
@@ -1181,7 +1171,7 @@ void OutlineView::FillOutliner()
/**
* Handler for deleting of level 0 paragraphs (pages): Warning
*/
-IMPL_LINK_NOARG(OutlineView, RemovingPagesHdl)
+IMPL_LINK_NOARG_TYPED(OutlineView, RemovingPagesHdl, OutlinerView*, bool)
{
sal_Int32 nNumOfPages = mrOutliner.GetSelPageCount();
@@ -1198,13 +1188,13 @@ IMPL_LINK_NOARG(OutlineView, RemovingPagesHdl)
}
mrOutliner.UpdateFields();
- return 1;
+ return true;
}
/**
* Handler for indenting level 0 paragraphs (pages): Warning
*/
-IMPL_LINK( OutlineView, IndentingPagesHdl, OutlinerView *, pOutlinerView )
+IMPL_LINK_TYPED( OutlineView, IndentingPagesHdl, OutlinerView *, pOutlinerView, long )
{
return RemovingPagesHdl(pOutlinerView);
}
@@ -1374,17 +1364,17 @@ void OutlineView::SetLinks()
void OutlineView::ResetLinks() const
{
Link<> aEmptyLink;
- mrOutliner.SetParaInsertedHdl(aEmptyLink);
- mrOutliner.SetParaRemovingHdl(aEmptyLink);
- mrOutliner.SetDepthChangedHdl(aEmptyLink);
- mrOutliner.SetBeginMovingHdl(aEmptyLink);
- mrOutliner.SetEndMovingHdl(aEmptyLink);
+ mrOutliner.SetParaInsertedHdl(Link<::Outliner*,void>());
+ mrOutliner.SetParaRemovingHdl(Link<::Outliner*,void>());
+ mrOutliner.SetDepthChangedHdl(Link<::Outliner*,void>());
+ mrOutliner.SetBeginMovingHdl(Link<::Outliner*,void>());
+ mrOutliner.SetEndMovingHdl(Link<::Outliner*,void>());
mrOutliner.SetStatusEventHdl(aEmptyLink);
- mrOutliner.SetRemovingPagesHdl(aEmptyLink);
- mrOutliner.SetIndentingPagesHdl(aEmptyLink);
+ mrOutliner.SetRemovingPagesHdl(Link<OutlinerView*,bool>());
+ mrOutliner.SetIndentingPagesHdl(Link<OutlinerView*,long>());
mrOutliner.SetDrawPortionHdl(Link<DrawPortionInfo*,void>());
- mrOutliner.SetBeginPasteOrDropHdl(aEmptyLink);
- mrOutliner.SetEndPasteOrDropHdl(aEmptyLink);
+ mrOutliner.SetBeginPasteOrDropHdl(Link<PasteOrDropInfos*,void>());
+ mrOutliner.SetEndPasteOrDropHdl(Link<PasteOrDropInfos*,void>());
}
sal_Int8 OutlineView::AcceptDrop( const AcceptDropEvent&, DropTargetHelper&, ::sd::Window*, sal_uInt16, sal_uInt16)
@@ -1659,94 +1649,92 @@ void OutlineView::TryToMergeUndoActions()
}
}
-IMPL_LINK(OutlineView, PaintingFirstLineHdl, PaintFirstLineInfo*, pInfo)
+IMPL_LINK_TYPED(OutlineView, PaintingFirstLineHdl, PaintFirstLineInfo*, pInfo, void)
{
- if( pInfo )
- {
- Paragraph* pPara = mrOutliner.GetParagraph( pInfo->mnPara );
- EditEngine& rEditEngine = const_cast< EditEngine& >( mrOutliner.GetEditEngine() );
+ if( !pInfo )
+ return;
+
+ Paragraph* pPara = mrOutliner.GetParagraph( pInfo->mnPara );
+ EditEngine& rEditEngine = const_cast< EditEngine& >( mrOutliner.GetEditEngine() );
- Size aImageSize( pInfo->mpOutDev->PixelToLogic( maSlideImage.GetSizePixel() ) );
- Size aOffset( 100, 100 );
+ Size aImageSize( pInfo->mpOutDev->PixelToLogic( maSlideImage.GetSizePixel() ) );
+ Size aOffset( 100, 100 );
- // paint slide number
- if( pPara && ::Outliner::HasParaFlag(pPara,ParaFlag::ISPAGE) )
+ // paint slide number
+ if( pPara && ::Outliner::HasParaFlag(pPara,ParaFlag::ISPAGE) )
+ {
+ long nPage = 0; // todo, printing??
+ for ( sal_Int32 n = 0; n <= pInfo->mnPara; n++ )
{
- long nPage = 0; // todo, printing??
- for ( sal_Int32 n = 0; n <= pInfo->mnPara; n++ )
- {
- Paragraph* p = mrOutliner.GetParagraph( n );
- if ( ::Outliner::HasParaFlag(p,ParaFlag::ISPAGE) )
- nPage++;
- }
+ Paragraph* p = mrOutliner.GetParagraph( n );
+ if ( ::Outliner::HasParaFlag(p,ParaFlag::ISPAGE) )
+ nPage++;
+ }
- long nBulletHeight = (long)mrOutliner.GetLineHeight( pInfo->mnPara );
- long nFontHeight = 0;
- if ( !rEditEngine.IsFlatMode() )
- {
- nFontHeight = nBulletHeight / 5;
- }
- else
- {
- nFontHeight = (nBulletHeight * 10) / 25;
- }
+ long nBulletHeight = (long)mrOutliner.GetLineHeight( pInfo->mnPara );
+ long nFontHeight = 0;
+ if ( !rEditEngine.IsFlatMode() )
+ {
+ nFontHeight = nBulletHeight / 5;
+ }
+ else
+ {
+ nFontHeight = (nBulletHeight * 10) / 25;
+ }
- Size aFontSz( 0, nFontHeight );
+ Size aFontSz( 0, nFontHeight );
- Size aOutSize( 2000, nBulletHeight );
+ Size aOutSize( 2000, nBulletHeight );
- const float fImageHeight = ((float)aOutSize.Height() * (float)4) / (float)7;
- if (aImageSize.Width() != 0)
- {
- const float fImageRatio = (float)aImageSize.Height() / (float)aImageSize.Width();
- aImageSize.Width() = (long)( fImageRatio * fImageHeight );
- }
- aImageSize.Height() = (long)( fImageHeight );
-
- Point aImagePos( pInfo->mrStartPos );
- aImagePos.X() += aOutSize.Width() - aImageSize.Width() - aOffset.Width() ;
- aImagePos.Y() += (aOutSize.Height() - aImageSize.Height()) / 2;
-
- pInfo->mpOutDev->DrawImage( aImagePos, aImageSize, maSlideImage );
-
- const bool bVertical = mrOutliner.IsVertical();
- const bool bRightToLeftPara = rEditEngine.IsRightToLeft( pInfo->mnPara );
-
- LanguageType eLang = rEditEngine.GetDefaultLanguage();
-
- Point aTextPos( aImagePos.X() - aOffset.Width(), pInfo->mrStartPos.Y() );
- vcl::Font aNewFont( OutputDevice::GetDefaultFont( DefaultFontType::SANS_UNICODE, eLang, GetDefaultFontFlags::NONE ) );
- aNewFont.SetSize( aFontSz );
- aNewFont.SetVertical( bVertical );
- aNewFont.SetOrientation( bVertical ? 2700 : 0 );
- aNewFont.SetColor( COL_AUTO );
- pInfo->mpOutDev->SetFont( aNewFont );
- OUString aPageText = OUString::number( nPage );
- Size aTextSz;
- aTextSz.Width() = pInfo->mpOutDev->GetTextWidth( aPageText );
- aTextSz.Height() = pInfo->mpOutDev->GetTextHeight();
- if ( !bVertical )
+ const float fImageHeight = ((float)aOutSize.Height() * (float)4) / (float)7;
+ if (aImageSize.Width() != 0)
+ {
+ const float fImageRatio = (float)aImageSize.Height() / (float)aImageSize.Width();
+ aImageSize.Width() = (long)( fImageRatio * fImageHeight );
+ }
+ aImageSize.Height() = (long)( fImageHeight );
+
+ Point aImagePos( pInfo->mrStartPos );
+ aImagePos.X() += aOutSize.Width() - aImageSize.Width() - aOffset.Width() ;
+ aImagePos.Y() += (aOutSize.Height() - aImageSize.Height()) / 2;
+
+ pInfo->mpOutDev->DrawImage( aImagePos, aImageSize, maSlideImage );
+
+ const bool bVertical = mrOutliner.IsVertical();
+ const bool bRightToLeftPara = rEditEngine.IsRightToLeft( pInfo->mnPara );
+
+ LanguageType eLang = rEditEngine.GetDefaultLanguage();
+
+ Point aTextPos( aImagePos.X() - aOffset.Width(), pInfo->mrStartPos.Y() );
+ vcl::Font aNewFont( OutputDevice::GetDefaultFont( DefaultFontType::SANS_UNICODE, eLang, GetDefaultFontFlags::NONE ) );
+ aNewFont.SetSize( aFontSz );
+ aNewFont.SetVertical( bVertical );
+ aNewFont.SetOrientation( bVertical ? 2700 : 0 );
+ aNewFont.SetColor( COL_AUTO );
+ pInfo->mpOutDev->SetFont( aNewFont );
+ OUString aPageText = OUString::number( nPage );
+ Size aTextSz;
+ aTextSz.Width() = pInfo->mpOutDev->GetTextWidth( aPageText );
+ aTextSz.Height() = pInfo->mpOutDev->GetTextHeight();
+ if ( !bVertical )
+ {
+ aTextPos.Y() += (aOutSize.Height() - aTextSz.Height()) / 2;
+ if ( !bRightToLeftPara )
{
- aTextPos.Y() += (aOutSize.Height() - aTextSz.Height()) / 2;
- if ( !bRightToLeftPara )
- {
- aTextPos.X() -= aTextSz.Width();
- }
- else
- {
- aTextPos.X() += aTextSz.Width();
- }
+ aTextPos.X() -= aTextSz.Width();
}
else
{
- aTextPos.Y() -= aTextSz.Width();
- aTextPos.X() += nBulletHeight / 2;
+ aTextPos.X() += aTextSz.Width();
}
- pInfo->mpOutDev->DrawText( aTextPos, aPageText );
}
+ else
+ {
+ aTextPos.Y() -= aTextSz.Width();
+ aTextPos.X() += nBulletHeight / 2;
+ }
+ pInfo->mpOutDev->DrawText( aTextPos, aPageText );
}
-
- return 0;
}
void OutlineView::UpdateParagraph( sal_Int32 nPara )
diff --git a/sd/source/ui/view/sdview.cxx b/sd/source/ui/view/sdview.cxx
index b424cf7db4d5..18fbf2e7e68b 100644
--- a/sd/source/ui/view/sdview.cxx
+++ b/sd/source/ui/view/sdview.cxx
@@ -1075,7 +1075,7 @@ void View::onAccessibilityOptionsChanged()
}
}
-IMPL_LINK( View, OnParagraphInsertedHdl, ::Outliner *, pOutliner )
+IMPL_LINK_TYPED( View, OnParagraphInsertedHdl, ::Outliner *, pOutliner, void )
{
Paragraph* pPara = pOutliner->GetHdlParagraph();
SdrObject* pObj = GetTextEditObject();
@@ -1086,13 +1086,12 @@ IMPL_LINK( View, OnParagraphInsertedHdl, ::Outliner *, pOutliner )
if( pPage )
pPage->onParagraphInserted( pOutliner, pPara, pObj );
}
- return 0;
}
/**
* Handler for the deletion of the pages (paragraphs).
*/
-IMPL_LINK( View, OnParagraphRemovingHdl, ::Outliner *, pOutliner )
+IMPL_LINK_TYPED( View, OnParagraphRemovingHdl, ::Outliner *, pOutliner, void )
{
Paragraph* pPara = pOutliner->GetHdlParagraph();
SdrObject* pObj = GetTextEditObject();
@@ -1103,7 +1102,6 @@ IMPL_LINK( View, OnParagraphRemovingHdl, ::Outliner *, pOutliner )
if( pPage )
pPage->onParagraphRemoving( pOutliner, pPara, pObj );
}
- return 0;
}
bool View::isRecordingUndo() const
diff --git a/svx/source/svdraw/svdedxv.cxx b/svx/source/svdraw/svdedxv.cxx
index dc7f4f688788..88d46504cca4 100644
--- a/svx/source/svdraw/svdedxv.cxx
+++ b/svx/source/svdraw/svdedxv.cxx
@@ -489,7 +489,7 @@ IMPL_LINK(SdrObjEditView,ImpOutlinerStatusEventHdl,EditStatus*,pEditStat)
return 0;
}
-IMPL_LINK(SdrObjEditView,ImpOutlinerCalcFieldValueHdl,EditFieldInfo*,pFI)
+IMPL_LINK_TYPED(SdrObjEditView,ImpOutlinerCalcFieldValueHdl,EditFieldInfo*,pFI,void)
{
bool bOk=false;
OUString& rStr=pFI->GetRepresentation();
@@ -513,15 +513,14 @@ IMPL_LINK(SdrObjEditView,ImpOutlinerCalcFieldValueHdl,EditFieldInfo*,pFI)
}
}
Outliner& rDrawOutl=pMod->GetDrawOutliner(pTextObj);
- Link<> aDrawOutlLink=rDrawOutl.GetCalcFieldValueHdl();
+ Link<EditFieldInfo*,void> aDrawOutlLink=rDrawOutl.GetCalcFieldValueHdl();
if (!bOk && aDrawOutlLink.IsSet()) {
aDrawOutlLink.Call(pFI);
bOk = !rStr.isEmpty();
}
if (!bOk && aOldCalcFieldValueLink.IsSet()) {
- return aOldCalcFieldValueLink.Call(pFI);
+ aOldCalcFieldValueLink.Call(pFI);
}
- return 0;
}
IMPL_LINK(SdrObjEditView, EndTextEditHdl, SdrUndoManager*, /*pUndoManager*/)
@@ -633,7 +632,7 @@ bool SdrObjEditView::SdrBeginTextEdit(
// FieldHdl has to be set by SdrBeginTextEdit, because this call an UpdateFields
pTextEditOutliner->SetCalcFieldValueHdl(LINK(this,SdrObjEditView,ImpOutlinerCalcFieldValueHdl));
pTextEditOutliner->SetBeginPasteOrDropHdl(LINK(this,SdrObjEditView,BeginPasteOrDropHdl));
- pTextEditOutliner->SetEndPasteOrDropHdl(LINK(this,SdrObjEditView, EndPasteOrDropHdl));
+ pTextEditOutliner->SetEndPasteOrDropHdl(LINK(this,SdrObjEditView,EndPasteOrDropHdl));
// It is just necessary to make the visualized page known. Set it.
pTextEditOutliner->setVisualizedPage(pPV->GetPage());
@@ -782,8 +781,8 @@ bool SdrObjEditView::SdrBeginTextEdit(
else
{
pTextEditOutliner->SetCalcFieldValueHdl(aOldCalcFieldValueLink);
- pTextEditOutliner->SetBeginPasteOrDropHdl(Link<>());
- pTextEditOutliner->SetEndPasteOrDropHdl(Link<>());
+ pTextEditOutliner->SetBeginPasteOrDropHdl(Link<PasteOrDropInfos*,void>());
+ pTextEditOutliner->SetEndPasteOrDropHdl(Link<PasteOrDropInfos*,void>());
}
}
if (pTextEditOutliner != NULL)
@@ -915,8 +914,8 @@ SdrEndTextEditKind SdrObjEditView::SdrEndTextEdit(bool bDontDeleteReally)
// Set old CalcFieldValue-Handler again, this
// has to happen before Obj::EndTextEdit(), as this does UpdateFields().
pTEOutliner->SetCalcFieldValueHdl(aOldCalcFieldValueLink);
- pTEOutliner->SetBeginPasteOrDropHdl(Link<>());
- pTEOutliner->SetEndPasteOrDropHdl(Link<>());
+ pTEOutliner->SetBeginPasteOrDropHdl(Link<PasteOrDropInfos*,void>());
+ pTEOutliner->SetEndPasteOrDropHdl(Link<PasteOrDropInfos*,void>());
const bool bUndo = IsUndoEnabled();
if( bUndo )
@@ -1873,16 +1872,14 @@ void SdrObjEditView::MarkListHasChanged()
}
}
-IMPL_LINK( SdrObjEditView, EndPasteOrDropHdl, PasteOrDropInfos*, pInfos )
+IMPL_LINK_TYPED( SdrObjEditView, EndPasteOrDropHdl, PasteOrDropInfos*, pInfos, void )
{
OnEndPasteOrDrop( pInfos );
- return 0;
}
-IMPL_LINK( SdrObjEditView, BeginPasteOrDropHdl, PasteOrDropInfos*, pInfos )
+IMPL_LINK_TYPED( SdrObjEditView, BeginPasteOrDropHdl, PasteOrDropInfos*, pInfos, void )
{
OnBeginPasteOrDrop( pInfos );
- return 0;
}
void SdrObjEditView::OnBeginPasteOrDrop( PasteOrDropInfos* )
diff --git a/svx/source/svdraw/svdotextdecomposition.cxx b/svx/source/svdraw/svdotextdecomposition.cxx
index 0f2cca449268..74eebf06590d 100644
--- a/svx/source/svdraw/svdotextdecomposition.cxx
+++ b/svx/source/svdraw/svdotextdecomposition.cxx
@@ -93,9 +93,9 @@ namespace
DECL_LINK_TYPED(decomposeBlockTextPrimitive, DrawPortionInfo*, void);
DECL_LINK_TYPED(decomposeStretchTextPrimitive, DrawPortionInfo*, void);
- DECL_LINK(decomposeContourBulletPrimitive, DrawBulletInfo* );
- DECL_LINK(decomposeBlockBulletPrimitive, DrawBulletInfo* );
- DECL_LINK(decomposeStretchBulletPrimitive, DrawBulletInfo* );
+ DECL_LINK_TYPED(decomposeContourBulletPrimitive, DrawBulletInfo*, void);
+ DECL_LINK_TYPED(decomposeBlockBulletPrimitive, DrawBulletInfo*, void);
+ DECL_LINK_TYPED(decomposeStretchBulletPrimitive, DrawBulletInfo*, void);
static bool impIsUnderlineAbove(const vcl::Font& rFont);
void impCreateTextPortionPrimitive(const DrawPortionInfo& rInfo);
@@ -127,7 +127,7 @@ namespace
mrOutliner.SetDrawBulletHdl(LINK(this, impTextBreakupHandler, decomposeContourBulletPrimitive));
mrOutliner.StripPortions();
mrOutliner.SetDrawPortionHdl(Link<DrawPortionInfo*,void>());
- mrOutliner.SetDrawBulletHdl(Link<>());
+ mrOutliner.SetDrawBulletHdl(Link<DrawBulletInfo*,void>());
}
void decomposeBlockTextPrimitive(
@@ -142,7 +142,7 @@ namespace
mrOutliner.SetDrawBulletHdl(LINK(this, impTextBreakupHandler, decomposeBlockBulletPrimitive));
mrOutliner.StripPortions();
mrOutliner.SetDrawPortionHdl(Link<DrawPortionInfo*,void>());
- mrOutliner.SetDrawBulletHdl(Link<>());
+ mrOutliner.SetDrawBulletHdl(Link<DrawBulletInfo*,void>());
}
void decomposeStretchTextPrimitive(const basegfx::B2DHomMatrix& rNewTransformA, const basegfx::B2DHomMatrix& rNewTransformB)
@@ -153,7 +153,7 @@ namespace
mrOutliner.SetDrawBulletHdl(LINK(this, impTextBreakupHandler, decomposeStretchBulletPrimitive));
mrOutliner.StripPortions();
mrOutliner.SetDrawPortionHdl(Link<DrawPortionInfo*,void>());
- mrOutliner.SetDrawBulletHdl(Link<>());
+ mrOutliner.SetDrawBulletHdl(Link<DrawBulletInfo*,void>());
}
drawinglayer::primitive2d::Primitive2DSequence getPrimitive2DSequence();
@@ -620,34 +620,28 @@ namespace
}
}
- IMPL_LINK(impTextBreakupHandler, decomposeContourBulletPrimitive, DrawBulletInfo*, pInfo)
+ IMPL_LINK_TYPED(impTextBreakupHandler, decomposeContourBulletPrimitive, DrawBulletInfo*, pInfo, void)
{
if(pInfo)
{
impHandleDrawBulletInfo(*pInfo);
}
-
- return 0;
}
- IMPL_LINK(impTextBreakupHandler, decomposeBlockBulletPrimitive, DrawBulletInfo*, pInfo)
+ IMPL_LINK_TYPED(impTextBreakupHandler, decomposeBlockBulletPrimitive, DrawBulletInfo*, pInfo, void)
{
if(pInfo)
{
impHandleDrawBulletInfo(*pInfo);
}
-
- return 0;
}
- IMPL_LINK(impTextBreakupHandler, decomposeStretchBulletPrimitive, DrawBulletInfo*, pInfo)
+ IMPL_LINK_TYPED(impTextBreakupHandler, decomposeStretchBulletPrimitive, DrawBulletInfo*, pInfo, void)
{
if(pInfo)
{
impHandleDrawBulletInfo(*pInfo);
}
-
- return 0;
}
drawinglayer::primitive2d::Primitive2DSequence impTextBreakupHandler::getPrimitive2DSequence()
diff --git a/svx/source/unodraw/UnoGraphicExporter.cxx b/svx/source/unodraw/UnoGraphicExporter.cxx
index 449e34c39ed5..52ccf4995eef 100644
--- a/svx/source/unodraw/UnoGraphicExporter.cxx
+++ b/svx/source/unodraw/UnoGraphicExporter.cxx
@@ -162,7 +162,7 @@ namespace {
VclPtr<VirtualDevice> CreatePageVDev( SdrPage* pPage, sal_uIntPtr nWidthPixel, sal_uIntPtr nHeightPixel ) const;
- DECL_LINK( CalcFieldValueHdl, EditFieldInfo* );
+ DECL_LINK_TYPED( CalcFieldValueHdl, EditFieldInfo*, void );
void ParseSettings( const Sequence< PropertyValue >& aDescriptor, ExportSettings& rSettings );
bool GetGraphic( ExportSettings& rSettings, Graphic& aGraphic, bool bVectorType );
@@ -174,7 +174,7 @@ namespace {
SvxDrawPage* mpUnoPage;
- Link<> maOldCalcFieldValueHdl;
+ Link<EditFieldInfo*,void> maOldCalcFieldValueHdl;
sal_Int32 mnPageNumber;
SdrPage* mpCurrentPage;
SdrModel* mpDoc;
@@ -339,7 +339,7 @@ GraphicExporter::~GraphicExporter()
{
}
-IMPL_LINK(GraphicExporter, CalcFieldValueHdl, EditFieldInfo*, pInfo)
+IMPL_LINK_TYPED(GraphicExporter, CalcFieldValueHdl, EditFieldInfo*, pInfo, void)
{
if( pInfo )
{
@@ -378,17 +378,15 @@ IMPL_LINK(GraphicExporter, CalcFieldValueHdl, EditFieldInfo*, pInfo)
pInfo->SetRepresentation( aPageNumValue );
- return 0;
+ return;
}
}
}
- long nRet = maOldCalcFieldValueHdl.Call( pInfo );
+ maOldCalcFieldValueHdl.Call( pInfo );
if( pInfo && mpCurrentPage )
pInfo->SetSdrPage( 0 );
-
- return nRet;
}
/** creates an virtual device for the given page
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#