summaryrefslogtreecommitdiff
path: root/sw/source/ui
diff options
context:
space:
mode:
authorNoel Grandin <noelgrandin@gmail.com>2015-09-24 13:53:17 +0200
committerNoel Grandin <noelgrandin@gmail.com>2015-09-24 16:19:37 +0000
commite85b2333bce7b1dcae73861df6d90b48b9f4efe5 (patch)
tree21d066cecfbfda9ace96b26953ddcc3ae1764001 /sw/source/ui
parentff6462e6307e6924dc6c8178043ae9032f4b4152 (diff)
convert Link<> to typed
Change-Id: I59d325c3b051690303a5841907317122fa1ec98b Reviewed-on: https://gerrit.libreoffice.org/18825 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noelgrandin@gmail.com>
Diffstat (limited to 'sw/source/ui')
-rw-r--r--sw/source/ui/config/optpage.cxx6
-rw-r--r--sw/source/ui/dbui/createaddresslistdialog.cxx8
-rw-r--r--sw/source/ui/dbui/mmaddressblockpage.cxx8
-rw-r--r--sw/source/ui/dbui/mmlayoutpage.cxx9
-rw-r--r--sw/source/ui/dbui/mmlayoutpage.hxx1
-rw-r--r--sw/source/ui/envelp/envfmt.cxx17
-rw-r--r--sw/source/ui/envelp/envfmt.hxx1
-rw-r--r--sw/source/ui/envelp/labfmt.cxx27
-rw-r--r--sw/source/ui/envelp/labfmt.hxx6
-rw-r--r--sw/source/ui/frmdlg/frmpage.cxx38
-rw-r--r--sw/source/ui/frmdlg/wrap.cxx54
-rw-r--r--sw/source/ui/index/cnttab.cxx14
-rw-r--r--sw/source/ui/misc/num.cxx17
-rw-r--r--sw/source/ui/misc/outline.cxx3
-rw-r--r--sw/source/ui/misc/pgfnote.cxx7
-rw-r--r--sw/source/ui/misc/pggrid.cxx20
-rw-r--r--sw/source/ui/table/tabledlg.cxx27
17 files changed, 148 insertions, 115 deletions
diff --git a/sw/source/ui/config/optpage.cxx b/sw/source/ui/config/optpage.cxx
index 519bec7b39bc..4b672fb64f51 100644
--- a/sw/source/ui/config/optpage.cxx
+++ b/sw/source/ui/config/optpage.cxx
@@ -588,7 +588,7 @@ SwStdFontTabPage::SwStdFontTabPage( vcl::Window* pParent,
pListBox ->SetModifyHdl( LINK(this, SwStdFontTabPage, ModifyHdl));
pLabelBox ->SetModifyHdl( LINK(this, SwStdFontTabPage, ModifyHdl));
pIdxBox ->SetModifyHdl( LINK(this, SwStdFontTabPage, ModifyHdl));
- Link<> aFocusLink = LINK( this, SwStdFontTabPage, LoseFocusHdl);
+ Link<Control&,void> aFocusLink = LINK( this, SwStdFontTabPage, LoseFocusHdl);
pStandardBox->SetLoseFocusHdl( aFocusLink );
pTitleBox ->SetLoseFocusHdl( aFocusLink );
pListBox ->SetLoseFocusHdl( aFocusLink );
@@ -1061,8 +1061,9 @@ IMPL_LINK( SwStdFontTabPage, ModifyHeightHdl, FontSizeBox*, pBox )
return 0;
}
-IMPL_LINK( SwStdFontTabPage, LoseFocusHdl, ComboBox*, pBox )
+IMPL_LINK_TYPED( SwStdFontTabPage, LoseFocusHdl, Control&, rControl, void )
{
+ ComboBox* pBox = static_cast<ComboBox*>(&rControl);
FontSizeBox* pHeightLB = 0;
const OUString sEntry = pBox->GetText();
if(pBox == pStandardBox)
@@ -1087,7 +1088,6 @@ IMPL_LINK( SwStdFontTabPage, LoseFocusHdl, ComboBox*, pBox )
}
vcl::FontInfo aFontInfo( pFontList->Get(sEntry, sEntry) );
pHeightLB->Fill( &aFontInfo, pFontList );
- return 0;
}
void SwStdFontTabPage::PageCreated( const SfxAllItemSet& aSet)
diff --git a/sw/source/ui/dbui/createaddresslistdialog.cxx b/sw/source/ui/dbui/createaddresslistdialog.cxx
index 6501cae53220..ca48c63f8e5d 100644
--- a/sw/source/ui/dbui/createaddresslistdialog.cxx
+++ b/sw/source/ui/dbui/createaddresslistdialog.cxx
@@ -60,7 +60,7 @@ class SwAddressControl_Impl : public Control
bool m_bNoDataSet;
DECL_LINK_TYPED(ScrollHdl_Impl, ScrollBar*, void);
- DECL_LINK(GotFocusHdl_Impl, Edit*);
+ DECL_LINK_TYPED(GotFocusHdl_Impl, Control&, void);
DECL_LINK(EditModifyHdl_Impl, Edit*);
void MakeVisible(const Rectangle& aRect);
@@ -173,7 +173,7 @@ void SwAddressControl_Impl::SetData(SwCSVData& rDBData)
long nEDYPos = m_pWindow->LogicToPixel(Size(RSC_SP_CTRL_DESC_Y, RSC_SP_CTRL_DESC_Y), MAP_APPFONT).Height();
long nFTYPos = nEDYPos + nEDHeight - nFTHeight;
- Link<> aFocusLink = LINK(this, SwAddressControl_Impl, GotFocusHdl_Impl);
+ Link<Control&,void> aFocusLink = LINK(this, SwAddressControl_Impl, GotFocusHdl_Impl);
Link<> aEditModifyLink = LINK(this, SwAddressControl_Impl, EditModifyHdl_Impl);
Edit* pLastEdit = 0;
sal_Int32 nVisibleLines = 0;
@@ -267,14 +267,14 @@ IMPL_LINK_TYPED(SwAddressControl_Impl, ScrollHdl_Impl, ScrollBar*, pScroll, void
m_pWindow->SetPosPixel(Point(0, - (m_nLineHeight * nThumb)));
}
-IMPL_LINK(SwAddressControl_Impl, GotFocusHdl_Impl, Edit*, pEdit)
+IMPL_LINK_TYPED(SwAddressControl_Impl, GotFocusHdl_Impl, Control&, rControl, void)
{
+ Edit* pEdit = static_cast<Edit*>(&rControl);
if(GetFocusFlags::Tab & pEdit->GetGetFocusFlags())
{
Rectangle aRect(pEdit->GetPosPixel(), pEdit->GetSizePixel());
MakeVisible(aRect);
}
- return 0;
}
void SwAddressControl_Impl::MakeVisible(const Rectangle & rRect)
diff --git a/sw/source/ui/dbui/mmaddressblockpage.cxx b/sw/source/ui/dbui/mmaddressblockpage.cxx
index 199617a7512c..d8387c1f8284 100644
--- a/sw/source/ui/dbui/mmaddressblockpage.cxx
+++ b/sw/source/ui/dbui/mmaddressblockpage.cxx
@@ -811,7 +811,7 @@ class SwAssignFieldsControl : public Control
DECL_LINK_TYPED(ScrollHdl_Impl, ScrollBar*, void);
DECL_LINK(MatchHdl_Impl, ListBox*);
- DECL_LINK(GotFocusHdl_Impl, ListBox*);
+ DECL_LINK_TYPED(GotFocusHdl_Impl, Control&, void);
virtual bool PreNotify( NotifyEvent& rNEvt ) SAL_OVERRIDE;
virtual void Command( const CommandEvent& rCEvt ) SAL_OVERRIDE;
@@ -882,7 +882,7 @@ void SwAssignFieldsControl::Init(SwMailMergeConfigItem& rConfigItem)
//if no assignment is available an empty sequence will be returned
uno::Sequence< OUString> aAssignments = rConfigItem.GetColumnAssignment( rConfigItem.GetCurrentDBData() );
Link<> aMatchHdl = LINK(this, SwAssignFieldsControl, MatchHdl_Impl);
- Link<> aFocusHdl = LINK(this, SwAssignFieldsControl, GotFocusHdl_Impl);
+ Link<Control&,void> aFocusHdl = LINK(this, SwAssignFieldsControl, GotFocusHdl_Impl);
//fill the controls
long nControlWidth = aOutputSize.Width() / 3;
@@ -1133,8 +1133,9 @@ IMPL_LINK(SwAssignFieldsControl, MatchHdl_Impl, ListBox*, pBox)
return 0;
}
-IMPL_LINK(SwAssignFieldsControl, GotFocusHdl_Impl, ListBox*, pBox)
+IMPL_LINK_TYPED(SwAssignFieldsControl, GotFocusHdl_Impl, Control&, rControl, void)
{
+ ListBox* pBox = static_cast<ListBox*>(&rControl);
if(GetFocusFlags::Tab & pBox->GetGetFocusFlags())
{
sal_Int32 nIndex = 0;
@@ -1147,7 +1148,6 @@ IMPL_LINK(SwAssignFieldsControl, GotFocusHdl_Impl, ListBox*, pBox)
}
}
}
- return 0;
}
SwAssignFieldsDialog::SwAssignFieldsDialog(
diff --git a/sw/source/ui/dbui/mmlayoutpage.cxx b/sw/source/ui/dbui/mmlayoutpage.cxx
index 678db1815b43..719cc59bdd14 100644
--- a/sw/source/ui/dbui/mmlayoutpage.cxx
+++ b/sw/source/ui/dbui/mmlayoutpage.cxx
@@ -135,12 +135,13 @@ SwMailMergeLayoutPage::SwMailMergeLayoutPage( SwMailMergeWizard* _pParent) :
m_pZoomLB->SetSelectHdl(LINK(this, SwMailMergeLayoutPage, ZoomHdl_Impl));
Link<> aFrameHdl = LINK(this, SwMailMergeLayoutPage, ChangeAddressHdl_Impl);
+ Link<Control&,void> aFocusHdl = LINK(this, SwMailMergeLayoutPage, ChangeAddressLoseFocusHdl_Impl);
m_pLeftMF->SetUpHdl(aFrameHdl);
m_pLeftMF->SetDownHdl(aFrameHdl);
- m_pLeftMF->SetLoseFocusHdl(aFrameHdl);
+ m_pLeftMF->SetLoseFocusHdl(aFocusHdl);
m_pTopMF->SetUpHdl(aFrameHdl);
m_pTopMF->SetDownHdl(aFrameHdl);
- m_pTopMF->SetLoseFocusHdl(aFrameHdl);
+ m_pTopMF->SetLoseFocusHdl(aFocusHdl);
FieldUnit eFieldUnit = ::GetDfltMetric(false);
::SetFieldUnit( *m_pLeftMF, eFieldUnit );
@@ -682,6 +683,10 @@ IMPL_LINK(SwMailMergeLayoutPage, ZoomHdl_Impl, ListBox*, pBox)
return 0;
}
+IMPL_LINK_NOARG_TYPED(SwMailMergeLayoutPage, ChangeAddressLoseFocusHdl_Impl, Control&, void)
+{
+ ChangeAddressHdl_Impl(nullptr);
+}
IMPL_LINK_NOARG(SwMailMergeLayoutPage, ChangeAddressHdl_Impl)
{
if(m_pExampleWrtShell && m_pAddressBlockFormat)
diff --git a/sw/source/ui/dbui/mmlayoutpage.hxx b/sw/source/ui/dbui/mmlayoutpage.hxx
index 2b46221beb7c..7d18971aae26 100644
--- a/sw/source/ui/dbui/mmlayoutpage.hxx
+++ b/sw/source/ui/dbui/mmlayoutpage.hxx
@@ -68,6 +68,7 @@ class SwMailMergeLayoutPage : public svt::OWizardPage
DECL_LINK_TYPED(PreviewLoadedHdl_Impl, SwOneExampleFrame&, void);
DECL_LINK(ZoomHdl_Impl, ListBox*);
DECL_LINK(ChangeAddressHdl_Impl, void *);
+ DECL_LINK_TYPED(ChangeAddressLoseFocusHdl_Impl, Control&, void);
DECL_LINK_TYPED(GreetingsHdl_Impl, Button*, void);
DECL_LINK_TYPED(AlignToTextHdl_Impl, Button*, void);
diff --git a/sw/source/ui/envelp/envfmt.cxx b/sw/source/ui/envelp/envfmt.cxx
index b49ce96b1853..495af4caf296 100644
--- a/sw/source/ui/envelp/envfmt.cxx
+++ b/sw/source/ui/envelp/envfmt.cxx
@@ -156,12 +156,13 @@ SwEnvFormatPage::SwEnvFormatPage(vcl::Window* pParent, const SfxItemSet& rSet)
m_pSizeWidthField->SetDownHdl( aLk );
m_pSizeHeightField->SetDownHdl( aLk );
- m_pAddrLeftField->SetLoseFocusHdl( aLk );
- m_pAddrTopField->SetLoseFocusHdl( aLk );
- m_pSendLeftField->SetLoseFocusHdl( aLk );
- m_pSendTopField->SetLoseFocusHdl( aLk );
- m_pSizeWidthField->SetLoseFocusHdl( aLk );
- m_pSizeHeightField->SetLoseFocusHdl( aLk );
+ Link<Control&,void> aLk3 = LINK(this, SwEnvFormatPage, LoseFocusHdl);
+ m_pAddrLeftField->SetLoseFocusHdl( aLk3 );
+ m_pAddrTopField->SetLoseFocusHdl( aLk3 );
+ m_pSendLeftField->SetLoseFocusHdl( aLk3 );
+ m_pSendTopField->SetLoseFocusHdl( aLk3 );
+ m_pSizeWidthField->SetLoseFocusHdl( aLk3 );
+ m_pSizeHeightField->SetLoseFocusHdl( aLk3 );
Link<MenuButton *, void> aLk2 = LINK(this, SwEnvFormatPage, EditHdl );
m_pAddrEditButton->SetSelectHdl( aLk2 );
@@ -217,6 +218,10 @@ void SwEnvFormatPage::dispose()
}
+IMPL_LINK_TYPED( SwEnvFormatPage, LoseFocusHdl, Control&, rControl, void )
+{
+ ModifyHdl(static_cast<Edit*>(&rControl));
+}
IMPL_LINK( SwEnvFormatPage, ModifyHdl, Edit *, pEdit )
{
long lWVal = static_cast< long >(GetFieldVal(*m_pSizeWidthField ));
diff --git a/sw/source/ui/envelp/envfmt.hxx b/sw/source/ui/envelp/envfmt.hxx
index ced01862a050..d3a81afdaf86 100644
--- a/sw/source/ui/envelp/envfmt.hxx
+++ b/sw/source/ui/envelp/envfmt.hxx
@@ -44,6 +44,7 @@ class SwEnvFormatPage : public SfxTabPage
std::vector<sal_uInt16> aIDs;
DECL_LINK( ModifyHdl, Edit * );
+ DECL_LINK_TYPED( LoseFocusHdl, Control&, void );
DECL_LINK_TYPED( EditHdl, MenuButton *, void );
DECL_LINK(FormatHdl, void *);
diff --git a/sw/source/ui/envelp/labfmt.cxx b/sw/source/ui/envelp/labfmt.cxx
index 4d739aba8eb0..7d721c2cd1dd 100644
--- a/sw/source/ui/envelp/labfmt.cxx
+++ b/sw/source/ui/envelp/labfmt.cxx
@@ -338,17 +338,17 @@ SwLabFormatPage::SwLabFormatPage(vcl::Window* pParent, const SfxItemSet& rSet)
m_pPWidthField->SetModifyHdl( aLk );
m_pPHeightField->SetModifyHdl( aLk );
- aLk = LINK(this, SwLabFormatPage, LoseFocusHdl);
- m_pHDistField->SetLoseFocusHdl( aLk );
- m_pVDistField->SetLoseFocusHdl( aLk );
- m_pWidthField->SetLoseFocusHdl( aLk );
- m_pHeightField->SetLoseFocusHdl( aLk );
- m_pLeftField->SetLoseFocusHdl( aLk );
- m_pUpperField->SetLoseFocusHdl( aLk );
- m_pColsField->SetLoseFocusHdl( aLk );
- m_pRowsField->SetLoseFocusHdl( aLk );
- m_pPWidthField->SetLoseFocusHdl( aLk );
- m_pPHeightField->SetLoseFocusHdl( aLk );
+ Link<Control&,void> aLk2 = LINK(this, SwLabFormatPage, LoseFocusHdl);
+ m_pHDistField->SetLoseFocusHdl( aLk2 );
+ m_pVDistField->SetLoseFocusHdl( aLk2 );
+ m_pWidthField->SetLoseFocusHdl( aLk2 );
+ m_pHeightField->SetLoseFocusHdl( aLk2 );
+ m_pLeftField->SetLoseFocusHdl( aLk2 );
+ m_pUpperField->SetLoseFocusHdl( aLk2 );
+ m_pColsField->SetLoseFocusHdl( aLk2 );
+ m_pRowsField->SetLoseFocusHdl( aLk2 );
+ m_pPWidthField->SetLoseFocusHdl( aLk2 );
+ m_pPHeightField->SetLoseFocusHdl( aLk2 );
m_pSavePB->SetClickHdl( LINK (this, SwLabFormatPage, SaveHdl));
// Set timer
@@ -399,11 +399,10 @@ IMPL_LINK_NOARG_TYPED(SwLabFormatPage, PreviewHdl, Idle *, void)
}
// LoseFocus-Handler: Update on change
-IMPL_LINK( SwLabFormatPage, LoseFocusHdl, Control *, pControl )
+IMPL_LINK_TYPED( SwLabFormatPage, LoseFocusHdl, Control&, rControl, void )
{
- if (static_cast<Edit*>( pControl)->IsModified())
+ if (static_cast<Edit*>( &rControl)->IsModified())
PreviewHdl(0);
- return 0;
}
void SwLabFormatPage::ChangeMinMax()
diff --git a/sw/source/ui/envelp/labfmt.hxx b/sw/source/ui/envelp/labfmt.hxx
index 67ad694dfbda..74a50574f6b3 100644
--- a/sw/source/ui/envelp/labfmt.hxx
+++ b/sw/source/ui/envelp/labfmt.hxx
@@ -88,9 +88,9 @@ class SwLabFormatPage : public SfxTabPage
SwLabItem aItem;
DECL_LINK(ModifyHdl, void *);
- DECL_LINK_TYPED(PreviewHdl, Idle *, void);
- DECL_LINK( LoseFocusHdl, Control * );
- DECL_LINK_TYPED(SaveHdl, Button*, void);
+ DECL_LINK_TYPED( PreviewHdl, Idle *, void );
+ DECL_LINK_TYPED( LoseFocusHdl, Control&, void );
+ DECL_LINK_TYPED( SaveHdl, Button*, void );
void ChangeMinMax();
diff --git a/sw/source/ui/frmdlg/frmpage.cxx b/sw/source/ui/frmdlg/frmpage.cxx
index 5f272d4f96a7..bc0ae4dc741b 100644
--- a/sw/source/ui/frmdlg/frmpage.cxx
+++ b/sw/source/ui/frmdlg/frmpage.cxx
@@ -677,14 +677,14 @@ SwFrmPage::SwFrmPage(vcl::Window *pParent, const SfxItemSet &rSet)
SetExchangeSupport();
- Link<> aLk = LINK(this, SwFrmPage, RangeModifyHdl);
- m_aWidthED.SetLoseFocusHdl( aLk );
- m_aHeightED.SetLoseFocusHdl( aLk );
- m_pAtHorzPosED->SetLoseFocusHdl( aLk );
- m_pAtVertPosED->SetLoseFocusHdl( aLk );
+ Link<Control&,void> aLk3 = LINK(this, SwFrmPage, RangeModifyLoseFocusHdl);
+ m_aWidthED.SetLoseFocusHdl( aLk3 );
+ m_aHeightED.SetLoseFocusHdl( aLk3 );
+ m_pAtHorzPosED->SetLoseFocusHdl( aLk3 );
+ m_pAtVertPosED->SetLoseFocusHdl( aLk3 );
m_pFollowTextFlowCB->SetClickHdl( LINK(this, SwFrmPage, RangeModifyClickHdl) );
- aLk = LINK(this, SwFrmPage, ModifyHdl);
+ Link<> aLk = LINK(this, SwFrmPage, ModifyHdl);
m_aWidthED.SetModifyHdl( aLk );
m_aHeightED.SetModifyHdl( aLk );
m_pAtHorzPosED->SetModifyHdl( aLk );
@@ -1047,7 +1047,7 @@ void SwFrmPage::Reset( const SfxItemSet *rSet )
//lock PercentFields
m_aWidthED.LockAutoCalculation(true);
m_aHeightED.LockAutoCalculation(true);
- RangeModifyHdl(&m_aWidthED); // set all maximum values initially
+ RangeModifyHdl(); // set all maximum values initially
m_aHeightED.LockAutoCalculation(false);
m_aWidthED.LockAutoCalculation(false);
@@ -1736,7 +1736,7 @@ void SwFrmPage::ActivatePage(const SfxItemSet& rSet)
//lock PercentFields
m_aWidthED.LockAutoCalculation(true);
m_aHeightED.LockAutoCalculation(true);
- RangeModifyHdl(&m_aWidthED); // set all maximum values initially
+ RangeModifyHdl(); // set all maximum values initially
m_aHeightED.LockAutoCalculation(false);
m_aWidthED.LockAutoCalculation(false);
m_pFollowTextFlowCB->SaveValue();
@@ -1785,7 +1785,7 @@ IMPL_LINK_TYPED( SwFrmPage, RelSizeClickHdl, Button *, p, void )
m_aHeightED.get()->SetMax(MAX_PERCENT_HEIGHT);
}
- RangeModifyHdl(m_aWidthED.get()); // correct the values again
+ RangeModifyHdl(); // correct the values again
if (pBtn == m_pRelWidthCB)
ModifyHdl(m_aWidthED.get());
@@ -1796,12 +1796,16 @@ IMPL_LINK_TYPED( SwFrmPage, RelSizeClickHdl, Button *, p, void )
// range check
IMPL_LINK_NOARG_TYPED(SwFrmPage, RangeModifyClickHdl, Button*, void)
{
- RangeModifyHdl(NULL);
+ RangeModifyHdl();
}
-IMPL_LINK_NOARG(SwFrmPage, RangeModifyHdl)
+IMPL_LINK_NOARG_TYPED(SwFrmPage, RangeModifyLoseFocusHdl, Control&, void)
+{
+ RangeModifyHdl();
+}
+void SwFrmPage::RangeModifyHdl()
{
if (bNoModifyHdl)
- return 0;
+ return;
SwWrtShell* pSh = bFormat ? ::GetActiveWrtShell()
: getFrmDlgParentShell();
@@ -1915,8 +1919,6 @@ IMPL_LINK_NOARG(SwFrmPage, RangeModifyHdl)
m_pAtVertPosED->SetMax(m_pAtVertPosED->Normalize(aVal.nMaxVPos), FUNIT_TWIP);
if ( aVal.nVPos != nAtVertPosVal )
m_pAtVertPosED->SetValue(m_pAtVertPosED->Normalize(aVal.nVPos), FUNIT_TWIP);
-
- return 0;
}
IMPL_LINK_NOARG_TYPED(SwFrmPage, AnchorTypeHdl, Button*, void)
@@ -1934,7 +1936,7 @@ IMPL_LINK_NOARG_TYPED(SwFrmPage, AnchorTypeHdl, Button*, void)
RndStdIds eId = GetAnchor();
InitPos( eId, -1, 0, -1, 0, LONG_MAX, LONG_MAX);
- RangeModifyHdl(0);
+ RangeModifyHdl();
if(bHtmlMode)
{
@@ -1969,7 +1971,7 @@ IMPL_LINK( SwFrmPage, PosHdl, ListBox *, pLB )
m_pAtVertPosFT->Enable( bEnable );
}
- RangeModifyHdl( 0 );
+ RangeModifyHdl();
sal_Int16 nRel = 0;
if (pLB->GetSelectEntryCount())
@@ -2076,7 +2078,7 @@ IMPL_LINK( SwFrmPage, RelHdl, ListBox *, pLB )
}
}
if (pLB) // Only when Handler was called by changing of the controller
- RangeModifyHdl(0);
+ RangeModifyHdl();
return 0;
}
@@ -2322,7 +2324,7 @@ void SwFrmPage::Init(const SfxItemSet& rSet, bool bReset)
}
// switch to percent if applicable
- RangeModifyHdl(&m_aWidthED); // set reference values (for 100%)
+ RangeModifyHdl(); // set reference values (for 100%)
if (rSize.GetWidthPercent() == SwFormatFrmSize::SYNCED || rSize.GetHeightPercent() == SwFormatFrmSize::SYNCED)
m_pFixedRatioCB->Check();
diff --git a/sw/source/ui/frmdlg/wrap.cxx b/sw/source/ui/frmdlg/wrap.cxx
index f7081b741726..bc3227de5030 100644
--- a/sw/source/ui/frmdlg/wrap.cxx
+++ b/sw/source/ui/frmdlg/wrap.cxx
@@ -96,29 +96,30 @@ SwWrapTabPage::SwWrapTabPage(vcl::Window *pParent, const SfxItemSet &rSet)
SetExchangeSupport();
Link<> aLk = LINK(this, SwWrapTabPage, RangeModifyHdl);
+ Link<Control&,void> aLk3 = LINK(this, SwWrapTabPage, RangeLoseFocusHdl);
m_pLeftMarginED->SetUpHdl(aLk);
m_pLeftMarginED->SetDownHdl(aLk);
m_pLeftMarginED->SetFirstHdl(aLk);
m_pLeftMarginED->SetLastHdl(aLk);
- m_pLeftMarginED->SetLoseFocusHdl(aLk);
+ m_pLeftMarginED->SetLoseFocusHdl(aLk3);
m_pRightMarginED->SetUpHdl(aLk);
m_pRightMarginED->SetDownHdl(aLk);
m_pRightMarginED->SetFirstHdl(aLk);
m_pRightMarginED->SetLastHdl(aLk);
- m_pRightMarginED->SetLoseFocusHdl(aLk);
+ m_pRightMarginED->SetLoseFocusHdl(aLk3);
m_pTopMarginED->SetUpHdl(aLk);
m_pTopMarginED->SetDownHdl(aLk);
m_pTopMarginED->SetFirstHdl(aLk);
m_pTopMarginED->SetLastHdl(aLk);
- m_pTopMarginED->SetLoseFocusHdl(aLk);
+ m_pTopMarginED->SetLoseFocusHdl(aLk3);
m_pBottomMarginED->SetUpHdl(aLk);
m_pBottomMarginED->SetDownHdl(aLk);
m_pBottomMarginED->SetFirstHdl(aLk);
m_pBottomMarginED->SetLastHdl(aLk);
- m_pBottomMarginED->SetLoseFocusHdl(aLk);
+ m_pBottomMarginED->SetLoseFocusHdl(aLk3);
Link<Button*,void> aLk2 = LINK(this, SwWrapTabPage, WrapTypeHdl);
m_pNoWrapRB->SetClickHdl(aLk2);
@@ -586,29 +587,32 @@ SfxTabPage::sfxpg SwWrapTabPage::DeactivatePage(SfxItemSet* _pSet)
}
// range check
-IMPL_LINK( SwWrapTabPage, RangeModifyHdl, MetricField *, pEdit )
+IMPL_LINK_TYPED( SwWrapTabPage, RangeLoseFocusHdl, Control&, rControl, void )
{
- sal_Int64 nValue = pEdit->GetValue();
- MetricField *pOpposite = 0;
- if (pEdit == m_pLeftMarginED)
- pOpposite = m_pRightMarginED;
- else if (pEdit == m_pRightMarginED)
- pOpposite = m_pLeftMarginED;
- else if (pEdit == m_pTopMarginED)
- pOpposite = m_pBottomMarginED;
- else if (pEdit == m_pBottomMarginED)
- pOpposite = m_pTopMarginED;
-
- OSL_ASSERT(pOpposite);
-
- if (pOpposite)
- {
- sal_Int64 nOpposite = pOpposite->GetValue();
-
- if (nValue + nOpposite > std::max(pEdit->GetMax(), pOpposite->GetMax()))
- pOpposite->SetValue(pOpposite->GetMax() - nValue);
- }
+ RangeModifyHdl( static_cast<MetricField*>(&rControl) );
+}
+IMPL_LINK( SwWrapTabPage, RangeModifyHdl, MetricField*, pEdit )
+{
+ sal_Int64 nValue = pEdit->GetValue();
+ MetricField *pOpposite = 0;
+ if (pEdit == m_pLeftMarginED)
+ pOpposite = m_pRightMarginED;
+ else if (pEdit == m_pRightMarginED)
+ pOpposite = m_pLeftMarginED;
+ else if (pEdit == m_pTopMarginED)
+ pOpposite = m_pBottomMarginED;
+ else if (pEdit == m_pBottomMarginED)
+ pOpposite = m_pTopMarginED;
+
+ OSL_ASSERT(pOpposite);
+
+ if (pOpposite)
+ {
+ sal_Int64 nOpposite = pOpposite->GetValue();
+ if (nValue + nOpposite > std::max(pEdit->GetMax(), pOpposite->GetMax()))
+ pOpposite->SetValue(pOpposite->GetMax() - nValue);
+ }
return 0;
}
diff --git a/sw/source/ui/index/cnttab.cxx b/sw/source/ui/index/cnttab.cxx
index 7c32c52d348e..19b39c8fed5d 100644
--- a/sw/source/ui/index/cnttab.cxx
+++ b/sw/source/ui/index/cnttab.cxx
@@ -2751,8 +2751,8 @@ void SwTokenWindow::dispose()
for (ctrl_iterator it = aControlList.begin(); it != aControlList.end(); ++it)
{
VclPtr<Control> pControl = (*it);
- pControl->SetGetFocusHdl( Link<>() );
- pControl->SetLoseFocusHdl( Link<>() );
+ pControl->SetGetFocusHdl( Link<Control&,void>() );
+ pControl->SetLoseFocusHdl( Link<Control&,void>() );
pControl.disposeAndClear();
}
aControlList.clear();
@@ -3485,8 +3485,9 @@ IMPL_LINK_TYPED(SwTokenWindow, NextItemHdl, SwTOXEdit&, rEdit, void)
}
}
-IMPL_LINK(SwTokenWindow, TbxFocusHdl, SwTOXEdit*, pEdit)
+IMPL_LINK_TYPED(SwTokenWindow, TbxFocusHdl, Control&, rControl, void)
{
+ SwTOXEdit* pEdit = static_cast<SwTOXEdit*>(&rControl);
for (ctrl_iterator it = aControlList.begin(); it != aControlList.end(); ++it)
{
Control *pCtrl = *it;
@@ -3496,8 +3497,6 @@ IMPL_LINK(SwTokenWindow, TbxFocusHdl, SwTOXEdit*, pEdit)
}
SetActiveControl(pEdit);
-
- return 0;
}
IMPL_LINK_TYPED(SwTokenWindow, NextItemBtnHdl, SwTOXButton&, rBtn, void )
@@ -3537,8 +3536,9 @@ IMPL_LINK_TYPED(SwTokenWindow, NextItemBtnHdl, SwTOXButton&, rBtn, void )
}
}
-IMPL_LINK(SwTokenWindow, TbxFocusBtnHdl, SwTOXButton*, pBtn )
+IMPL_LINK_TYPED(SwTokenWindow, TbxFocusBtnHdl, Control&, rControl, void )
{
+ SwTOXButton* pBtn = static_cast<SwTOXButton*>(&rControl);
for (ctrl_iterator it = aControlList.begin(); it != aControlList.end(); ++it)
{
Control *pControl = *it;
@@ -3548,8 +3548,6 @@ IMPL_LINK(SwTokenWindow, TbxFocusBtnHdl, SwTOXButton*, pBtn )
}
SetActiveControl(pBtn);
-
- return 0;
}
void SwTokenWindow::GetFocus()
diff --git a/sw/source/ui/misc/num.cxx b/sw/source/ui/misc/num.cxx
index 59f4935189d3..8636c8e2b144 100644
--- a/sw/source/ui/misc/num.cxx
+++ b/sw/source/ui/misc/num.cxx
@@ -116,15 +116,16 @@ SwNumPositionTabPage::SwNumPositionTabPage(vcl::Window* pParent,
m_pAlign2FT->SetText( m_pAlignFT->GetText() );
Link<> aLk = LINK(this, SwNumPositionTabPage, DistanceHdl);
+ Link<Control&,void> aLk2 = LINK(this, SwNumPositionTabPage, DistanceLoseFocusHdl);
m_pDistBorderMF->SetUpHdl(aLk);
m_pDistNumMF->SetUpHdl(aLk);
m_pIndentMF->SetUpHdl(aLk);
m_pDistBorderMF->SetDownHdl(aLk);
m_pDistNumMF->SetDownHdl(aLk);
m_pIndentMF->SetDownHdl(aLk);
- m_pDistBorderMF->SetLoseFocusHdl(aLk);
- m_pDistNumMF->SetLoseFocusHdl(aLk);
- m_pIndentMF->SetLoseFocusHdl(aLk);
+ m_pDistBorderMF->SetLoseFocusHdl(aLk2);
+ m_pDistNumMF->SetLoseFocusHdl(aLk2);
+ m_pIndentMF->SetLoseFocusHdl(aLk2);
m_pLabelFollowedByLB->SetDropDownLineCount( m_pLabelFollowedByLB->GetEntryCount() );
m_pLabelFollowedByLB->SetSelectHdl( LINK(this, SwNumPositionTabPage, LabelFollowedByHdl_Impl) );
@@ -132,17 +133,17 @@ SwNumPositionTabPage::SwNumPositionTabPage(vcl::Window* pParent,
aLk = LINK(this, SwNumPositionTabPage, ListtabPosHdl_Impl);
m_pListtabMF->SetUpHdl(aLk);
m_pListtabMF->SetDownHdl(aLk);
- m_pListtabMF->SetLoseFocusHdl(aLk);
+ m_pListtabMF->SetLoseFocusHdl(aLk2);
aLk = LINK(this, SwNumPositionTabPage, AlignAtHdl_Impl);
m_pAlignedAtMF->SetUpHdl(aLk);
m_pAlignedAtMF->SetDownHdl(aLk);
- m_pAlignedAtMF->SetLoseFocusHdl(aLk);
+ m_pAlignedAtMF->SetLoseFocusHdl(aLk2);
aLk = LINK(this, SwNumPositionTabPage, IndentAtHdl_Impl);
m_pIndentAtMF->SetUpHdl(aLk);
m_pIndentAtMF->SetDownHdl(aLk);
- m_pIndentAtMF->SetLoseFocusHdl(aLk);
+ m_pIndentAtMF->SetLoseFocusHdl(aLk2);
m_pLevelLB->SetSelectHdl(LINK(this, SwNumPositionTabPage, LevelHdl));
m_pRelativeCB->SetClickHdl(LINK(this, SwNumPositionTabPage, RelativeHdl));
@@ -659,6 +660,10 @@ IMPL_LINK( SwNumPositionTabPage, LevelHdl, ListBox *, pBox )
return 0;
}
+IMPL_LINK_TYPED( SwNumPositionTabPage, DistanceLoseFocusHdl, Control&, rControl, void )
+{
+ DistanceHdl(static_cast<MetricField*>(&rControl));
+}
IMPL_LINK( SwNumPositionTabPage, DistanceHdl, MetricField *, pField )
{
if(bInInintControl)
diff --git a/sw/source/ui/misc/outline.cxx b/sw/source/ui/misc/outline.cxx
index f2b2a07e186c..5801208958d8 100644
--- a/sw/source/ui/misc/outline.cxx
+++ b/sw/source/ui/misc/outline.cxx
@@ -647,11 +647,10 @@ IMPL_LINK( SwOutlineSettingsTabPage, CollSelect, ListBox *, pBox )
return 0;
}
-IMPL_LINK_NOARG(SwOutlineSettingsTabPage, CollSelectGetFocus)
+IMPL_LINK_NOARG_TYPED(SwOutlineSettingsTabPage, CollSelectGetFocus, Control&, void)
{
for( sal_uInt8 i = 0; i < MAXLEVEL; ++i)
aSaveCollNames[i] = pCollNames[i];
- return 0;
}
IMPL_LINK( SwOutlineSettingsTabPage, NumberSelect, SwNumberingTypeListBox *, pBox )
diff --git a/sw/source/ui/misc/pgfnote.cxx b/sw/source/ui/misc/pgfnote.cxx
index d7f627c8d334..fd4e4ba3c20b 100644
--- a/sw/source/ui/misc/pgfnote.cxx
+++ b/sw/source/ui/misc/pgfnote.cxx
@@ -64,7 +64,7 @@ IMPL_LINK_NOARG_TYPED(SwFootNotePage, HeightMetric, Button*, void)
}
// handler limit values
-IMPL_LINK_NOARG(SwFootNotePage, HeightModify)
+IMPL_LINK_NOARG_TYPED(SwFootNotePage, HeightModify, Control&, void)
{
m_pMaxHeightEdit->SetMax(m_pMaxHeightEdit->Normalize(lMaxHeight -
(m_pDistEdit->Denormalize(m_pDistEdit->GetValue(FUNIT_TWIP)) +
@@ -82,7 +82,6 @@ IMPL_LINK_NOARG(SwFootNotePage, HeightModify)
(m_pMaxHeightEdit->Denormalize(m_pMaxHeightEdit->GetValue(FUNIT_TWIP)) +
m_pDistEdit->Denormalize(m_pDistEdit->GetValue(FUNIT_TWIP)))),
FUNIT_TWIP);
- return 0;
}
IMPL_LINK_NOARG(SwFootNotePage, LineWidthChanged_Impl)
@@ -185,7 +184,7 @@ void SwFootNotePage::Reset(const SfxItemSet *rSet)
}
m_pMaxHeightPageBtn->SetClickHdl(LINK(this,SwFootNotePage,HeightPage));
m_pMaxHeightBtn->SetClickHdl(LINK(this,SwFootNotePage,HeightMetric));
- Link<> aLk = LINK(this, SwFootNotePage, HeightModify);
+ Link<Control&,void> aLk = LINK(this, SwFootNotePage, HeightModify);
m_pMaxHeightEdit->SetLoseFocusHdl( aLk );
m_pDistEdit->SetLoseFocusHdl( aLk );
m_pLineDistEdit->SetLoseFocusHdl( aLk );
@@ -359,7 +358,7 @@ void SwFootNotePage::ActivatePage(const SfxItemSet& rSet)
lMaxHeight /= 10;
// set maximum values
- HeightModify(0);
+ HeightModify(*m_pMaxHeightEdit);
}
SfxTabPage::sfxpg SwFootNotePage::DeactivatePage( SfxItemSet* _pSet)
diff --git a/sw/source/ui/misc/pggrid.cxx b/sw/source/ui/misc/pggrid.cxx
index cdcba665ccbe..1ac0fb2be6fd 100644
--- a/sw/source/ui/misc/pggrid.cxx
+++ b/sw/source/ui/misc/pggrid.cxx
@@ -77,23 +77,25 @@ SwTextGridPage::SwTextGridPage(vcl::Window *pParent, const SfxItemSet &rSet) :
get(m_pColorLB,"listLB_COLOR");
Link<> aLink = LINK(this, SwTextGridPage, CharorLineChangedHdl);
+ Link<Control&,void> aLink2 = LINK(this, SwTextGridPage, CharorLineLoseFocusdHdl);
m_pCharsPerLineNF->SetUpHdl(aLink);
m_pCharsPerLineNF->SetDownHdl(aLink);
- m_pCharsPerLineNF->SetLoseFocusHdl(aLink);
+ m_pCharsPerLineNF->SetLoseFocusHdl(aLink2);
m_pLinesPerPageNF->SetUpHdl(aLink);
m_pLinesPerPageNF->SetDownHdl(aLink);
- m_pLinesPerPageNF->SetLoseFocusHdl(aLink);
+ m_pLinesPerPageNF->SetLoseFocusHdl(aLink2);
Link<> aSizeLink = LINK(this, SwTextGridPage, TextSizeChangedHdl);
+ Link<Control&,void> aSizeLink2 = LINK(this, SwTextGridPage, TextSizeLoseFocusHdl);
m_pTextSizeMF->SetUpHdl(aSizeLink);
m_pTextSizeMF->SetDownHdl(aSizeLink);
- m_pTextSizeMF->SetLoseFocusHdl(aSizeLink);
+ m_pTextSizeMF->SetLoseFocusHdl(aSizeLink2);
m_pRubySizeMF->SetUpHdl(aSizeLink);
m_pRubySizeMF->SetDownHdl(aSizeLink);
- m_pRubySizeMF->SetLoseFocusHdl(aSizeLink);
+ m_pRubySizeMF->SetLoseFocusHdl(aSizeLink2);
m_pCharWidthMF->SetUpHdl(aSizeLink);
m_pCharWidthMF->SetDownHdl(aSizeLink);
- m_pCharWidthMF->SetLoseFocusHdl(aSizeLink);
+ m_pCharWidthMF->SetLoseFocusHdl(aSizeLink2);
Link<Button*,void> aGridTypeHdl = LINK(this, SwTextGridPage, GridTypeHdl);
m_pNoGridRB->SetClickHdl(aGridTypeHdl);
@@ -385,6 +387,10 @@ const sal_uInt16* SwTextGridPage::GetRanges()
return aPageRg;
}
+IMPL_LINK_TYPED(SwTextGridPage, CharorLineLoseFocusdHdl, Control&, rControl, void)
+{
+ CharorLineChangedHdl(static_cast<SpinField*>(&rControl));
+}
IMPL_LINK(SwTextGridPage, CharorLineChangedHdl, SpinField*, pField)
{
//if in squared mode
@@ -432,6 +438,10 @@ IMPL_LINK(SwTextGridPage, CharorLineChangedHdl, SpinField*, pField)
return 0;
}
+IMPL_LINK_TYPED(SwTextGridPage, TextSizeLoseFocusHdl, Control&, rControl, void)
+{
+ TextSizeChangedHdl(static_cast<SpinField*>(&rControl));
+}
IMPL_LINK(SwTextGridPage, TextSizeChangedHdl, SpinField*, pField)
{
//if in squared mode
diff --git a/sw/source/ui/table/tabledlg.cxx b/sw/source/ui/table/tabledlg.cxx
index d16675521945..6402a7dd382d 100644
--- a/sw/source/ui/table/tabledlg.cxx
+++ b/sw/source/ui/table/tabledlg.cxx
@@ -145,7 +145,7 @@ void SwFormatTablePage::Init()
m_pRightBtn->SetClickHdl( aLk2 );
m_pCenterBtn->SetClickHdl( aLk2 );
- Link<> aLk = LINK( this, SwFormatTablePage, UpDownLoseFocusHdl );
+ Link<> aLk = LINK( this, SwFormatTablePage, UpDownHdl );
m_pTopMF->SetUpHdl( aLk );
m_pBottomMF->SetUpHdl( aLk );
m_aRightMF.SetUpHdl( aLk );
@@ -158,11 +158,12 @@ void SwFormatTablePage::Init()
m_aLeftMF.SetDownHdl( aLk );
m_aWidthMF.SetDownHdl( aLk );
- m_pTopMF->SetLoseFocusHdl( aLk );
- m_pBottomMF->SetLoseFocusHdl( aLk );
- m_aRightMF.SetLoseFocusHdl( aLk );
- m_aLeftMF.SetLoseFocusHdl( aLk );
- m_aWidthMF.SetLoseFocusHdl( aLk );
+ Link<Control&,void> aLk3 = LINK( this, SwFormatTablePage, LoseFocusHdl );
+ m_pTopMF->SetLoseFocusHdl( aLk3 );
+ m_pBottomMF->SetLoseFocusHdl( aLk3 );
+ m_aRightMF.SetLoseFocusHdl( aLk3 );
+ m_aLeftMF.SetLoseFocusHdl( aLk3 );
+ m_aWidthMF.SetLoseFocusHdl( aLk3 );
m_pRelWidthCB->SetClickHdl(LINK( this, SwFormatTablePage, RelWidthClickHdl ));
}
@@ -283,7 +284,11 @@ void SwFormatTablePage::RightModify()
}
}
-IMPL_LINK( SwFormatTablePage, UpDownLoseFocusHdl, MetricField *, pEdit )
+IMPL_LINK_TYPED( SwFormatTablePage, LoseFocusHdl, Control&, rControl, void )
+{
+ UpDownHdl(static_cast<MetricField*>(&rControl));
+}
+IMPL_LINK( SwFormatTablePage, UpDownHdl, MetricField *, pEdit )
{
if( m_aRightMF.get() == pEdit)
RightModify();
@@ -845,7 +850,7 @@ void SwTableColumnPage::Init(bool bWeb)
FieldUnit aMetric = ::GetDfltMetric(bWeb);
Link<> aLkUp = LINK( this, SwTableColumnPage, UpHdl );
Link<> aLkDown = LINK( this, SwTableColumnPage, DownHdl );
- Link<> aLkLF = LINK( this, SwTableColumnPage, LoseFocusHdl );
+ Link<Control&,void> aLkLF = LINK( this, SwTableColumnPage, LoseFocusHdl );
for( sal_uInt16 i = 0; i < MET_FIELDS; i++ )
{
aValueTable[i] = i;
@@ -916,14 +921,14 @@ IMPL_LINK( SwTableColumnPage, DownHdl, MetricField*, pEdit )
return 0;
}
-IMPL_LINK( SwTableColumnPage, LoseFocusHdl, MetricField*, pEdit )
+IMPL_LINK_TYPED( SwTableColumnPage, LoseFocusHdl, Control&, rControl, void )
{
+ MetricField* pEdit = static_cast<MetricField*>(&rControl);
if (pEdit->IsModified())
{
bModified = true;
ModifyHdl( pEdit );
}
- return 0;
}
IMPL_LINK_TYPED( SwTableColumnPage, ModeHdl, Button*, pBox, void )
@@ -943,7 +948,7 @@ bool SwTableColumnPage::FillItemSet( SfxItemSet* )
{
if (m_aFieldArr[i].HasFocus())
{
- LoseFocusHdl(m_aFieldArr[i].get());
+ LoseFocusHdl(*m_aFieldArr[i].get());
break;
}
}