[Libreoffice-commits] core.git: 2 commits - cui/source editeng/source filter/source include/editeng include/svx sc/inc sc/source sd/inc sd/source svx/source sw/inc sw/source
Noel Grandin
noelgrandin at gmail.com
Sun Jul 12 23:58:26 PDT 2015
cui/source/tabpages/tpline.cxx | 2
editeng/source/items/frmitems.cxx | 8
editeng/source/items/numitem.cxx | 3
editeng/source/outliner/outliner.cxx | 13
filter/source/svg/svgexport.cxx | 7
filter/source/svg/svgfilter.hxx | 6
include/editeng/brushitem.hxx | 2
include/editeng/outliner.hxx | 94 ++---
include/svx/svdedxv.hxx | 8
sc/inc/scmod.hxx | 2
sc/source/ui/app/scmod.cxx | 62 +--
sd/inc/sdmod.hxx | 2
sd/source/ui/app/sdmod2.cxx | 407 +++++++++++-------------
sd/source/ui/func/fuinsfil.cxx | 22 -
sd/source/ui/inc/OutlineView.hxx | 16
sd/source/ui/inc/View.hxx | 4
sd/source/ui/view/outlview.cxx | 190 +++++------
sd/source/ui/view/sdview.cxx | 6
svx/source/svdraw/svdedxv.cxx | 23 -
svx/source/svdraw/svdotextdecomposition.cxx | 54 +--
svx/source/svdraw/svdotextpathdecomposition.cxx | 7
svx/source/unodraw/UnoGraphicExporter.cxx | 12
sw/inc/doc.hxx | 2
sw/source/core/doc/docdraw.cxx | 114 +++---
sw/source/core/layout/paintfrm.cxx | 6
sw/source/uibase/docvw/romenu.cxx | 1
26 files changed, 498 insertions(+), 575 deletions(-)
New commits:
commit 2970ec843820a72d73a91cc11fc353e5b9fde5fd
Author: Noel Grandin <noelgrandin at gmail.com>
Date: Sun Jul 12 21:13:57 2015 +0200
editeng: make Link<> usage typed
Change-Id: Iec36c7e4f4fbc2ee2ee25d4d0c8488340ba7d8c4
Reviewed-on: https://gerrit.libreoffice.org/16968
Tested-by: Jenkins <ci at libreoffice.org>
Reviewed-by: Noel Grandin <noelgrandin at gmail.com>
diff --git a/editeng/source/outliner/outliner.cxx b/editeng/source/outliner/outliner.cxx
index 1deb55f..86725f0 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 6e91d55..b0ddc8c 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 55b6253..b0fc550 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 fbe0b36..d1b05ad 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 005000d..5c994cc 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 936fb43..2eb1f5d 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 754ba8b..d6b6726 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 dfb9c6a..a113a00 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 a69beb8..2b4866d 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 414ea1a..213365d 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 68756dc..495a4d7 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 1b2e223..f2509c5 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 bc3c87b..19f38f0 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 b424cf7..18fbf2e 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 dc7f4f6..88d4650 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 0f2cca4..74eebf0 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 449e34c..52ccf49 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 706f79d..d736ff8 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 deb4e74..99cf115 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#
commit 26ac3ee8b2f8cb3bd298d98f9a94c9e305f6c304
Author: Noel Grandin <noelgrandin at gmail.com>
Date: Sat Jul 11 12:52:23 2015 +0200
editeng, convert to typed Link<>
and remove SvxBrushItem::SetDoneLink since the field it sets
is unused.wq
Change-Id: Ide95a295fa8004f1ddab5e560f01d36d36658a72
Reviewed-on: https://gerrit.libreoffice.org/16943
Tested-by: Jenkins <ci at libreoffice.org>
Reviewed-by: Noel Grandin <noelgrandin at gmail.com>
diff --git a/cui/source/tabpages/tpline.cxx b/cui/source/tabpages/tpline.cxx
index 01940a7..7849d18 100644
--- a/cui/source/tabpages/tpline.cxx
+++ b/cui/source/tabpages/tpline.cxx
@@ -315,7 +315,6 @@ void SvxLineTabPage::InitSymbols(MenuButton* pButton)
}
SvxBrushItem* pBrushItem = new SvxBrushItem(*it, aEmptyStr, GPOS_AREA, SID_ATTR_BRUSH);
- pBrushItem->SetDoneLink(LINK(this, SvxLineTabPage, GraphicArrivedHdl_Impl));
SvxBmpItemInfo* pInfo = new SvxBmpItemInfo();
pInfo->pBrushItem = pBrushItem;
@@ -408,7 +407,6 @@ void SvxLineTabPage::InitSymbols(MenuButton* pButton)
SdrObject::Free(pObj);
SvxBrushItem* pBrushItem = new SvxBrushItem(Graphic(aMeta), GPOS_AREA, SID_ATTR_BRUSH);
- pBrushItem->SetDoneLink(LINK(this, SvxLineTabPage, GraphicArrivedHdl_Impl));
SvxBmpItemInfo* pInfo = new SvxBmpItemInfo();
pInfo->pBrushItem = pBrushItem;
diff --git a/editeng/source/items/frmitems.cxx b/editeng/source/items/frmitems.cxx
index 357eb8b..b0b61af 100644
--- a/editeng/source/items/frmitems.cxx
+++ b/editeng/source/items/frmitems.cxx
@@ -3315,7 +3315,6 @@ public:
GraphicObject* pGraphicObject;
sal_Int8 nGraphicTransparency; //contains a percentage value which is
//copied to the GraphicObject when necessary
- Link<> aDoneLink;
SvStream* pStream;
SvxBrushItem_Impl( GraphicObject* p ) : pGraphicObject( p ), nGraphicTransparency(0), pStream(0) {}
@@ -3323,13 +3322,6 @@ public:
-void SvxBrushItem::SetDoneLink( const Link<>& rLink )
-{
- pImpl->aDoneLink = rLink;
-}
-
-
-
SvxBrushItem::SvxBrushItem( sal_uInt16 _nWhich ) :
SfxPoolItem( _nWhich ),
diff --git a/editeng/source/items/numitem.cxx b/editeng/source/items/numitem.cxx
index c251214..0edc0a4 100644
--- a/editeng/source/items/numitem.cxx
+++ b/editeng/source/items/numitem.cxx
@@ -338,7 +338,6 @@ SvxNumberFormat& SvxNumberFormat::operator=( const SvxNumberFormat& rFormat )
if(rFormat.pGraphicBrush)
{
pGraphicBrush = new SvxBrushItem(*rFormat.pGraphicBrush);
- pGraphicBrush->SetDoneLink( LINK( this, SvxNumberFormat, GraphicArrived) );
}
DELETEZ(pBulletFont);
if(rFormat.pBulletFont)
@@ -402,7 +401,6 @@ void SvxNumberFormat::SetGraphicBrush( const SvxBrushItem* pBrushItem,
{
delete pGraphicBrush;
pGraphicBrush = static_cast<SvxBrushItem*>(pBrushItem->Clone());
- pGraphicBrush->SetDoneLink( LINK( this, SvxNumberFormat, GraphicArrived) );
}
if(pOrient)
@@ -422,7 +420,6 @@ void SvxNumberFormat::SetGraphic( const OUString& rName )
delete pGraphicBrush;
pGraphicBrush = new SvxBrushItem( rName, "", GPOS_AREA, 0 );
- pGraphicBrush->SetDoneLink( LINK( this, SvxNumberFormat, GraphicArrived) );
if( eVertOrient == text::VertOrientation::NONE )
eVertOrient = text::VertOrientation::TOP;
diff --git a/include/editeng/brushitem.hxx b/include/editeng/brushitem.hxx
index 22a3d42..0c2c26f 100644
--- a/include/editeng/brushitem.hxx
+++ b/include/editeng/brushitem.hxx
@@ -95,8 +95,6 @@ public:
Color& GetColor() { return aColor; }
void SetColor( const Color& rCol) { aColor = rCol; }
- void SetDoneLink( const Link<>& rLink );
-
SvxGraphicPosition GetGraphicPos() const { return eGraphicPos; }
void PurgeMedium() const;
diff --git a/include/editeng/outliner.hxx b/include/editeng/outliner.hxx
index 5a2dbe9..fbe0b36 100644
--- a/include/editeng/outliner.hxx
+++ b/include/editeng/outliner.hxx
@@ -589,7 +589,7 @@ class EDITENG_DLLPUBLIC Outliner : public SfxBroadcaster
Paragraph* pHdlParagraph;
sal_Int32 mnFirstSelPage;
- Link<> aDrawPortionHdl;
+ Link<DrawPortionInfo*,void> aDrawPortionHdl;
Link<> aDrawBulletHdl;
Link<> aExpandHdl;
Link<> aParaInsertedHdl;
@@ -796,8 +796,8 @@ public:
void SetFieldClickedHdl(const Link<>& rLink ) { aFieldClickedHdl= rLink; }
Link<> GetFieldClickedHdl() const { return aFieldClickedHdl; }
- void SetDrawPortionHdl(const Link<>& rLink){aDrawPortionHdl=rLink;}
- Link<> GetDrawPortionHdl() const { return aDrawPortionHdl; }
+ 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; }
diff --git a/sd/source/ui/view/outlview.cxx b/sd/source/ui/view/outlview.cxx
index 59e790c..bc3c87b 100644
--- a/sd/source/ui/view/outlview.cxx
+++ b/sd/source/ui/view/outlview.cxx
@@ -1382,7 +1382,7 @@ void OutlineView::ResetLinks() const
mrOutliner.SetStatusEventHdl(aEmptyLink);
mrOutliner.SetRemovingPagesHdl(aEmptyLink);
mrOutliner.SetIndentingPagesHdl(aEmptyLink);
- mrOutliner.SetDrawPortionHdl(aEmptyLink);
+ mrOutliner.SetDrawPortionHdl(Link<DrawPortionInfo*,void>());
mrOutliner.SetBeginPasteOrDropHdl(aEmptyLink);
mrOutliner.SetEndPasteOrDropHdl(aEmptyLink);
}
diff --git a/svx/source/svdraw/svdotextdecomposition.cxx b/svx/source/svdraw/svdotextdecomposition.cxx
index f10dc92..0f2cca4 100644
--- a/svx/source/svdraw/svdotextdecomposition.cxx
+++ b/svx/source/svdraw/svdotextdecomposition.cxx
@@ -89,9 +89,9 @@ namespace
// BlockText (see there)
basegfx::B2DRange maClipRange;
- DECL_LINK(decomposeContourTextPrimitive, DrawPortionInfo* );
- DECL_LINK(decomposeBlockTextPrimitive, DrawPortionInfo* );
- DECL_LINK(decomposeStretchTextPrimitive, DrawPortionInfo* );
+ DECL_LINK_TYPED(decomposeContourTextPrimitive, DrawPortionInfo*, void);
+ DECL_LINK_TYPED(decomposeBlockTextPrimitive, DrawPortionInfo*, void);
+ DECL_LINK_TYPED(decomposeStretchTextPrimitive, DrawPortionInfo*, void);
DECL_LINK(decomposeContourBulletPrimitive, DrawBulletInfo* );
DECL_LINK(decomposeBlockBulletPrimitive, DrawBulletInfo* );
@@ -126,7 +126,7 @@ namespace
mrOutliner.SetDrawPortionHdl(LINK(this, impTextBreakupHandler, decomposeContourTextPrimitive));
mrOutliner.SetDrawBulletHdl(LINK(this, impTextBreakupHandler, decomposeContourBulletPrimitive));
mrOutliner.StripPortions();
- mrOutliner.SetDrawPortionHdl(Link<>());
+ mrOutliner.SetDrawPortionHdl(Link<DrawPortionInfo*,void>());
mrOutliner.SetDrawBulletHdl(Link<>());
}
@@ -141,7 +141,7 @@ namespace
mrOutliner.SetDrawPortionHdl(LINK(this, impTextBreakupHandler, decomposeBlockTextPrimitive));
mrOutliner.SetDrawBulletHdl(LINK(this, impTextBreakupHandler, decomposeBlockBulletPrimitive));
mrOutliner.StripPortions();
- mrOutliner.SetDrawPortionHdl(Link<>());
+ mrOutliner.SetDrawPortionHdl(Link<DrawPortionInfo*,void>());
mrOutliner.SetDrawBulletHdl(Link<>());
}
@@ -152,7 +152,7 @@ namespace
mrOutliner.SetDrawPortionHdl(LINK(this, impTextBreakupHandler, decomposeStretchTextPrimitive));
mrOutliner.SetDrawBulletHdl(LINK(this, impTextBreakupHandler, decomposeStretchBulletPrimitive));
mrOutliner.StripPortions();
- mrOutliner.SetDrawPortionHdl(Link<>());
+ mrOutliner.SetDrawPortionHdl(Link<DrawPortionInfo*,void>());
mrOutliner.SetDrawBulletHdl(Link<>());
}
@@ -557,7 +557,7 @@ namespace
maTextPortionPrimitives.push_back(pNewPrimitive);
}
- IMPL_LINK(impTextBreakupHandler, decomposeContourTextPrimitive, DrawPortionInfo*, pInfo)
+ IMPL_LINK_TYPED(impTextBreakupHandler, decomposeContourTextPrimitive, DrawPortionInfo*, pInfo, void)
{
// for contour text, ignore (clip away) all portions which are below
// the visible area given by maScale
@@ -565,11 +565,9 @@ namespace
{
impHandleDrawPortionInfo(*pInfo);
}
-
- return 0;
}
- IMPL_LINK(impTextBreakupHandler, decomposeBlockTextPrimitive, DrawPortionInfo*, pInfo)
+ IMPL_LINK_TYPED(impTextBreakupHandler, decomposeBlockTextPrimitive, DrawPortionInfo*, pInfo, void)
{
if(pInfo)
{
@@ -583,7 +581,7 @@ namespace
if(!maClipRange.isInside(aStartPosition))
{
- return 0;
+ return;
}
// Start position is inside. Get TextBoundRect and TopLeft next
@@ -597,7 +595,7 @@ namespace
if(!maClipRange.isInside(aTopLeft))
{
- return 0;
+ return;
}
// TopLeft is inside. Get BottomRight and check
@@ -605,25 +603,21 @@ namespace
if(!maClipRange.isInside(aBottomRight))
{
- return 0;
+ return;
}
// all inside, clip was successful
}
impHandleDrawPortionInfo(*pInfo);
}
-
- return 0;
}
- IMPL_LINK(impTextBreakupHandler, decomposeStretchTextPrimitive, DrawPortionInfo*, pInfo)
+ IMPL_LINK_TYPED(impTextBreakupHandler, decomposeStretchTextPrimitive, DrawPortionInfo*, pInfo, void)
{
if(pInfo)
{
impHandleDrawPortionInfo(*pInfo);
}
-
- return 0;
}
IMPL_LINK(impTextBreakupHandler, decomposeContourBulletPrimitive, DrawBulletInfo*, pInfo)
diff --git a/svx/source/svdraw/svdotextpathdecomposition.cxx b/svx/source/svdraw/svdotextpathdecomposition.cxx
index 5a7ca17..226c07b 100644
--- a/svx/source/svdraw/svdotextpathdecomposition.cxx
+++ b/svx/source/svdraw/svdotextpathdecomposition.cxx
@@ -171,7 +171,7 @@ namespace
SdrOutliner& mrOutliner;
::std::vector< impPathTextPortion > maPathTextPortions;
- DECL_LINK(decompositionPathTextPrimitive, DrawPortionInfo* );
+ DECL_LINK_TYPED(decompositionPathTextPrimitive, DrawPortionInfo*, void );
public:
explicit impTextBreakupHandler(SdrOutliner& rOutliner)
@@ -195,10 +195,9 @@ namespace
}
};
- IMPL_LINK(impTextBreakupHandler, decompositionPathTextPrimitive, DrawPortionInfo*, pInfo)
+ IMPL_LINK_TYPED(impTextBreakupHandler, decompositionPathTextPrimitive, DrawPortionInfo*, pInfo, void)
{
maPathTextPortions.push_back(impPathTextPortion(*pInfo));
- return 0;
}
} // end of anonymous namespace
@@ -791,7 +790,7 @@ void SdrTextObj::impDecomposePathTextPrimitive(
}
// clean up outliner
- rOutliner.SetDrawPortionHdl(Link<>());
+ rOutliner.SetDrawPortionHdl(Link<DrawPortionInfo*,void>());
rOutliner.Clear();
rOutliner.setVisualizedPage(0);
diff --git a/sw/source/core/layout/paintfrm.cxx b/sw/source/core/layout/paintfrm.cxx
index b22259a..679a3d3 100644
--- a/sw/source/core/layout/paintfrm.cxx
+++ b/sw/source/core/layout/paintfrm.cxx
@@ -1836,8 +1836,6 @@ static void lcl_DrawGraphic( const SvxBrushItem& rBrush, vcl::RenderContext *pOu
pOut->IntersectClipRegion( rOut.SVRect() );
}
- // No Link here, we want to load the graphic synchronously!
- const_cast<SvxBrushItem&>(rBrush).SetDoneLink( Link<>() );
GraphicObject *pGrf = const_cast<GraphicObject*>(rBrush.GetGraphicObject());
// Outsource drawing of background with a background color
@@ -1985,11 +1983,7 @@ void DrawGraphic(
rSh.GetOut()->GetOutDevType() == OUTDEV_PRINTER )
{
pBrush->PurgeMedium();
- const_cast<SvxBrushItem*>(pBrush)->SetDoneLink( Link<>() );
}
- else
- const_cast<SvxBrushItem*>(pBrush)->SetDoneLink( LINK(
- rSh.GetDoc(), SwDoc, BackgroundDone ) );
OUString referer;
SfxObjectShell * sh = rSh.GetDoc()->GetPersist();
if (sh != 0 && sh->HasName()) {
diff --git a/sw/source/uibase/docvw/romenu.cxx b/sw/source/uibase/docvw/romenu.cxx
index f53e3ea..6896e9b 100644
--- a/sw/source/uibase/docvw/romenu.cxx
+++ b/sw/source/uibase/docvw/romenu.cxx
@@ -352,7 +352,6 @@ OUString SwReadOnlyPopup::SaveGraphic( sal_uInt16 nId )
{
if ( !aBrushItem.GetGraphicLink().isEmpty() )
sGrfName = aBrushItem.GetGraphicLink();
- aBrushItem.SetDoneLink( Link<>() );
const Graphic *pGrf = aBrushItem.GetGraphic();
if ( pGrf )
{
More information about the Libreoffice-commits
mailing list