summaryrefslogtreecommitdiff
path: root/dbaccess
diff options
context:
space:
mode:
authorNoel Grandin <noel@peralex.com>2015-09-17 08:26:43 +0200
committerNoel Grandin <noel@peralex.com>2015-09-17 12:22:46 +0200
commitd048ba568fd54d8f1839fddc37ed4b75f1d01064 (patch)
treebe1bca60b5b78d65b181d7b020cf856df6eb7388 /dbaccess
parentc881e20ecddcbba5db6daf41e2ef294f6a97dd19 (diff)
convert Link<> to typed
Change-Id: Ie331012fa9beed1da99d3741d816fb8ac0e94d6d
Diffstat (limited to 'dbaccess')
-rw-r--r--dbaccess/source/ui/app/AppDetailPageHelper.cxx15
-rw-r--r--dbaccess/source/ui/app/AppDetailPageHelper.hxx10
-rw-r--r--dbaccess/source/ui/browser/dbtreeview.cxx6
-rw-r--r--dbaccess/source/ui/browser/dbtreeview.hxx11
-rw-r--r--dbaccess/source/ui/browser/dsbrowserDnD.cxx3
-rw-r--r--dbaccess/source/ui/browser/unodatbr.cxx12
-rw-r--r--dbaccess/source/ui/inc/dbtreelistbox.hxx30
-rw-r--r--dbaccess/source/ui/inc/unodatbr.hxx6
8 files changed, 44 insertions, 49 deletions
diff --git a/dbaccess/source/ui/app/AppDetailPageHelper.cxx b/dbaccess/source/ui/app/AppDetailPageHelper.cxx
index d2c2585587f4..b45ea63de059 100644
--- a/dbaccess/source/ui/app/AppDetailPageHelper.cxx
+++ b/dbaccess/source/ui/app/AppDetailPageHelper.cxx
@@ -915,34 +915,29 @@ IMPL_LINK_TYPED(OAppDetailPageHelper, OnEntryDoubleClick, SvTreeListBox*, _pTree
return bHandled;
}
-IMPL_LINK_NOARG(OAppDetailPageHelper, OnEntrySelChange)
+IMPL_LINK_NOARG_TYPED(OAppDetailPageHelper, OnEntrySelChange, LinkParamNone*, void)
{
getBorderWin().getView()->getAppController().onSelectionChanged();
- return 1L;
}
-IMPL_LINK_NOARG( OAppDetailPageHelper, OnCutEntry )
+IMPL_LINK_NOARG_TYPED( OAppDetailPageHelper, OnCutEntry, LinkParamNone*, void )
{
getBorderWin().getView()->getAppController().onCutEntry();
- return 1L;
}
-IMPL_LINK_NOARG( OAppDetailPageHelper, OnCopyEntry )
+IMPL_LINK_NOARG_TYPED( OAppDetailPageHelper, OnCopyEntry, LinkParamNone*, void )
{
getBorderWin().getView()->getAppController().onCopyEntry();
- return 1L;
}
-IMPL_LINK_NOARG( OAppDetailPageHelper, OnPasteEntry )
+IMPL_LINK_NOARG_TYPED( OAppDetailPageHelper, OnPasteEntry, LinkParamNone*, void )
{
getBorderWin().getView()->getAppController().onPasteEntry();
- return 1L;
}
-IMPL_LINK_NOARG( OAppDetailPageHelper, OnDeleteEntry )
+IMPL_LINK_NOARG_TYPED( OAppDetailPageHelper, OnDeleteEntry, LinkParamNone*, void )
{
getBorderWin().getView()->getAppController().onDeleteEntry();
- return 1L;
}
void OAppDetailPageHelper::Resize()
diff --git a/dbaccess/source/ui/app/AppDetailPageHelper.hxx b/dbaccess/source/ui/app/AppDetailPageHelper.hxx
index ab2331658348..ad26c24c07f2 100644
--- a/dbaccess/source/ui/app/AppDetailPageHelper.hxx
+++ b/dbaccess/source/ui/app/AppDetailPageHelper.hxx
@@ -153,12 +153,12 @@ namespace dbaui
DECL_LINK_TYPED( OnEntryDoubleClick, SvTreeListBox*, bool );
DECL_LINK( OnEntryEnterKey, void* );
- DECL_LINK( OnEntrySelChange, void* );
+ DECL_LINK_TYPED( OnEntrySelChange, LinkParamNone*, void );
- DECL_LINK( OnCutEntry, void* );
- DECL_LINK( OnCopyEntry, void* );
- DECL_LINK( OnPasteEntry, void* );
- DECL_LINK( OnDeleteEntry, void* );
+ DECL_LINK_TYPED( OnCutEntry, LinkParamNone*, void );
+ DECL_LINK_TYPED( OnCopyEntry, LinkParamNone*, void );
+ DECL_LINK_TYPED( OnPasteEntry, LinkParamNone*, void );
+ DECL_LINK_TYPED( OnDeleteEntry, LinkParamNone*, void );
// click a TB slot
DECL_LINK_TYPED(OnDropdownClickHdl, ToolBox*, void);
diff --git a/dbaccess/source/ui/browser/dbtreeview.cxx b/dbaccess/source/ui/browser/dbtreeview.cxx
index 6d8feddfcf7e..8f252fb0d691 100644
--- a/dbaccess/source/ui/browser/dbtreeview.cxx
+++ b/dbaccess/source/ui/browser/dbtreeview.cxx
@@ -63,12 +63,12 @@ void DBTreeView::dispose()
vcl::Window::dispose();
}
-void DBTreeView::SetPreExpandHandler(const Link<>& _rHdl)
+void DBTreeView::SetPreExpandHandler(const Link<SvTreeListEntry*,bool>& _rHdl)
{
m_pTreeListBox->SetPreExpandHandler(_rHdl);
}
-void DBTreeView::setCopyHandler(const Link<>& _rHdl)
+void DBTreeView::setCopyHandler(const Link<LinkParamNone*,void>& _rHdl)
{
m_pTreeListBox->setCopyHandler(_rHdl);
}
@@ -86,7 +86,7 @@ void DBTreeView::setModel(SvTreeList* _pTreeModel)
m_pTreeListBox->SetModel(_pTreeModel);
}
-void DBTreeView::setSelChangeHdl( const Link<>& _rHdl )
+void DBTreeView::setSelChangeHdl( const Link<LinkParamNone*,void>& _rHdl )
{
m_pTreeListBox->SetSelChangeHdl( _rHdl );
}
diff --git a/dbaccess/source/ui/browser/dbtreeview.hxx b/dbaccess/source/ui/browser/dbtreeview.hxx
index a3d237dc8351..378ae86e47de 100644
--- a/dbaccess/source/ui/browser/dbtreeview.hxx
+++ b/dbaccess/source/ui/browser/dbtreeview.hxx
@@ -23,6 +23,8 @@
#include <vcl/window.hxx>
class SvTreeList;
+class SvTreeListEntry;
+
namespace dbaui
{
class DBTreeListBox;
@@ -46,17 +48,16 @@ namespace dbaui
<p>When calling the link, the parameter is an SvTreeListEntry marking the entry to be expanded.
</p>
*/
- void SetPreExpandHandler(const Link<>& _rHdl);
- /// gets the currently set NodeExpansionHandler
+ void SetPreExpandHandler(const Link<SvTreeListEntry*,bool>& _rHdl);
- void setCopyHandler(const Link<>& _rHdl);
+ void setCopyHandler(const Link<LinkParamNone*,void>& _rHdl);
void setModel(SvTreeList* _pTreeModel);
- void setSelChangeHdl(const Link<>& _rHdl);
+ void setSelChangeHdl(const Link<LinkParamNone*,void>& _rHdl);
DBTreeListBox& getListBox() const { return *m_pTreeListBox; }
- virtual void GetFocus() SAL_OVERRIDE;
+ virtual void GetFocus() SAL_OVERRIDE;
};
}
diff --git a/dbaccess/source/ui/browser/dsbrowserDnD.cxx b/dbaccess/source/ui/browser/dsbrowserDnD.cxx
index 2f514739eefa..a9e44ac48fc3 100644
--- a/dbaccess/source/ui/browser/dsbrowserDnD.cxx
+++ b/dbaccess/source/ui/browser/dsbrowserDnD.cxx
@@ -193,12 +193,11 @@ namespace dbaui
return NULL != pTransfer;
}
- IMPL_LINK_NOARG(SbaTableQueryBrowser, OnCopyEntry)
+ IMPL_LINK_NOARG_TYPED(SbaTableQueryBrowser, OnCopyEntry, LinkParamNone*, void)
{
SvTreeListEntry* pSelected = m_pTreeView->getListBox().FirstSelected();
if( isEntryCopyAllowed( pSelected ) )
copyEntry( pSelected );
- return 0;
}
bool SbaTableQueryBrowser::isEntryCopyAllowed(SvTreeListEntry* _pEntry) const
{
diff --git a/dbaccess/source/ui/browser/unodatbr.cxx b/dbaccess/source/ui/browser/unodatbr.cxx
index 7d9b19cffc84..ee1fdd03b069 100644
--- a/dbaccess/source/ui/browser/unodatbr.cxx
+++ b/dbaccess/source/ui/browser/unodatbr.cxx
@@ -2156,11 +2156,11 @@ SvTreeListEntry* SbaTableQueryBrowser::implAppendEntry( SvTreeListEntry* _pParen
return pNewEntry;
}
-IMPL_LINK(SbaTableQueryBrowser, OnExpandEntry, SvTreeListEntry*, _pParent)
+IMPL_LINK_TYPED(SbaTableQueryBrowser, OnExpandEntry, SvTreeListEntry*, _pParent, bool)
{
if (_pParent->HasChildren())
// nothing to do...
- return 1L;
+ return true;
SvTreeListEntry* pFirstParent = m_pTreeView->getListBox().GetRootLevelParent(_pParent);
OSL_ENSURE(pFirstParent,"SbaTableQueryBrowser::OnExpandEntry: No rootlevelparent!");
@@ -2249,7 +2249,7 @@ IMPL_LINK(SbaTableQueryBrowser, OnExpandEntry, SvTreeListEntry*, _pParent)
showError(aInfo);
}
else
- return 0L;
+ return false;
// 0 indicates that an error occurred
}
else
@@ -2261,7 +2261,7 @@ IMPL_LINK(SbaTableQueryBrowser, OnExpandEntry, SvTreeListEntry*, _pParent)
populateTree( xCollection, _pParent, etQuery );
}
}
- return 1L;
+ return true;
}
bool SbaTableQueryBrowser::ensureEntryObject( SvTreeListEntry* _pEntry )
@@ -2489,9 +2489,9 @@ bool SbaTableQueryBrowser::implSelect(const OUString& _rDataSourceName, const OU
return false;
}
-IMPL_LINK_NOARG(SbaTableQueryBrowser, OnSelectionChange)
+IMPL_LINK_NOARG_TYPED(SbaTableQueryBrowser, OnSelectionChange, LinkParamNone*, void)
{
- return implSelect( m_pTreeView->getListBox().FirstSelected() ) ? 1L : 0L;
+ implSelect( m_pTreeView->getListBox().FirstSelected() );
}
SvTreeListEntry* SbaTableQueryBrowser::implGetConnectionEntry(SvTreeListEntry* _pEntry) const
diff --git a/dbaccess/source/ui/inc/dbtreelistbox.hxx b/dbaccess/source/ui/inc/dbtreelistbox.hxx
index 9bf8d85d577e..477276ccd640 100644
--- a/dbaccess/source/ui/inc/dbtreelistbox.hxx
+++ b/dbaccess/source/ui/inc/dbtreelistbox.hxx
@@ -54,23 +54,23 @@ namespace dbaui
OScrollHelper m_aScrollHelper;
Timer m_aTimer; // is needed for table updates
Point m_aMousePos;
- std::set<SvTreeListEntry*> m_aSelectedEntries;
- SvTreeListEntry* m_pDragedEntry;
+ std::set<SvTreeListEntry*> m_aSelectedEntries;
+ SvTreeListEntry* m_pDragedEntry;
IControlActionListener* m_pActionListener;
IContextMenuProvider*
m_pContextMenuProvider;
- Link<> m_aPreExpandHandler; // handler to be called before a node is expanded
- Link<> m_aSelChangeHdl; // handlet to be called (asynchronously) when the selection changes in any way
- Link<> m_aCutHandler; // called when someone press CTRL+X
- Link<> m_aCopyHandler; // called when someone press CTRL+C
- Link<> m_aPasteHandler; // called when someone press CTRL+V
- Link<> m_aDeleteHandler; // called when someone press DELETE Key
+ Link<SvTreeListEntry*,bool> m_aPreExpandHandler; // handler to be called before a node is expanded
+ Link<LinkParamNone*,void> m_aSelChangeHdl; // handlet to be called (asynchronously) when the selection changes in any way
+ Link<LinkParamNone*,void> m_aCutHandler; // called when someone press CTRL+X
+ Link<LinkParamNone*,void> m_aCopyHandler; // called when someone press CTRL+C
+ Link<LinkParamNone*,void> m_aPasteHandler; // called when someone press CTRL+V
+ Link<LinkParamNone*,void> m_aDeleteHandler; // called when someone press DELETE Key
Link<> m_aEditingHandler; // called before someone will edit an entry
Link<> m_aEditedHandler; // called after someone edited an entry
Link<> m_aEnterKeyHdl;
- bool m_bHandleEnterKey;
+ bool m_bHandleEnterKey;
private:
void init();
@@ -89,12 +89,12 @@ namespace dbaui
void setControlActionListener( IControlActionListener* _pListener ) { m_pActionListener = _pListener; }
void setContextMenuProvider( IContextMenuProvider* _pContextMenuProvider ) { m_pContextMenuProvider = _pContextMenuProvider; }
- void SetPreExpandHandler(const Link<>& _rHdl) { m_aPreExpandHandler = _rHdl; }
- void SetSelChangeHdl( const Link<>& _rHdl ) { m_aSelChangeHdl = _rHdl; }
- void setCutHandler(const Link<>& _rHdl) { m_aCutHandler = _rHdl; }
- void setCopyHandler(const Link<>& _rHdl) { m_aCopyHandler = _rHdl; }
- void setPasteHandler(const Link<>& _rHdl) { m_aPasteHandler = _rHdl; }
- void setDeleteHandler(const Link<>& _rHdl) { m_aDeleteHandler = _rHdl; }
+ void SetPreExpandHandler(const Link<SvTreeListEntry*,bool>& _rHdl) { m_aPreExpandHandler = _rHdl; }
+ void SetSelChangeHdl( const Link<LinkParamNone*,void>& _rHdl ) { m_aSelChangeHdl = _rHdl; }
+ void setCutHandler(const Link<LinkParamNone*,void>& _rHdl) { m_aCutHandler = _rHdl; }
+ void setCopyHandler(const Link<LinkParamNone*,void>& _rHdl) { m_aCopyHandler = _rHdl; }
+ void setPasteHandler(const Link<LinkParamNone*,void>& _rHdl) { m_aPasteHandler = _rHdl; }
+ void setDeleteHandler(const Link<LinkParamNone*,void>& _rHdl) { m_aDeleteHandler = _rHdl; }
// modified the given entry so that the expand handler is called whenever the entry is expanded
// (normally, the expand handler is called only once)
diff --git a/dbaccess/source/ui/inc/unodatbr.hxx b/dbaccess/source/ui/inc/unodatbr.hxx
index 86a48c0e1210..e113fb36fb4e 100644
--- a/dbaccess/source/ui/inc/unodatbr.hxx
+++ b/dbaccess/source/ui/inc/unodatbr.hxx
@@ -347,10 +347,10 @@ namespace dbaui
OUString GetEntryText( SvTreeListEntry* _pEntry ) const;
// is called when a table or a query was selected
- DECL_LINK( OnSelectionChange, void* );
- DECL_LINK( OnExpandEntry, SvTreeListEntry* );
+ DECL_LINK_TYPED( OnSelectionChange, LinkParamNone*, void );
+ DECL_LINK_TYPED( OnExpandEntry, SvTreeListEntry*, bool );
- DECL_LINK( OnCopyEntry, void* );
+ DECL_LINK_TYPED( OnCopyEntry, LinkParamNone*, void );
DECL_LINK_TYPED( OnTreeEntryCompare, const SvSortData&, sal_Int32 );