cui/source/dialogs/cuifmsearch.cxx | 2 +- cui/source/factory/dlgfact.cxx | 2 +- cui/source/factory/dlgfact.hxx | 3 ++- cui/source/inc/cuifmsearch.hxx | 4 ++-- dbaccess/source/ui/browser/brwctrlr.cxx | 10 ++++------ dbaccess/source/ui/inc/brwctrlr.hxx | 2 +- include/svx/svxdlg.hxx | 3 ++- svx/source/form/fmshimp.cxx | 22 ++++++++++------------ svx/source/inc/fmshimp.hxx | 2 +- 9 files changed, 24 insertions(+), 26 deletions(-)
New commits: commit 14a5131658cd25009c625fcf2472a49d9392de6c Author: Noel Grandin <[email protected]> Date: Fri Sep 25 11:19:01 2015 +0200 convert Link<> to typed Change-Id: I7fd77490ab49a18f48e248ca277bc30b5a7d2071 Reviewed-on: https://gerrit.libreoffice.org/18858 Tested-by: Jenkins <[email protected]> Reviewed-by: Noel Grandin <[email protected]> diff --git a/cui/source/dialogs/cuifmsearch.cxx b/cui/source/dialogs/cuifmsearch.cxx index b0d80cf..bb410ac 100644 --- a/cui/source/dialogs/cuifmsearch.cxx +++ b/cui/source/dialogs/cuifmsearch.cxx @@ -696,7 +696,7 @@ void FmSearchDialog::OnFound(const css::uno::Any& aCursorPos, sal_Int16 nFieldPo // this of course implies that I have really searched in the field that is selected in the listbox, // which is made sure in RebuildUsedFields - m_lnkFoundHandler.Call(&friInfo); + m_lnkFoundHandler.Call(friInfo); m_pcmbSearchText->GrabFocus(); } diff --git a/cui/source/factory/dlgfact.cxx b/cui/source/factory/dlgfact.cxx index 426fe28..5b00fd1 100644 --- a/cui/source/factory/dlgfact.cxx +++ b/cui/source/factory/dlgfact.cxx @@ -694,7 +694,7 @@ bool AbstractSvxHpLinkDlg_Impl::QueryClose() } -void AbstractFmSearchDialog_Impl::SetFoundHandler(const Link<>& lnk) +void AbstractFmSearchDialog_Impl::SetFoundHandler(const Link<FmFoundRecordInformation&,void>& lnk) { pDlg->SetFoundHandler(lnk); } diff --git a/cui/source/factory/dlgfact.hxx b/cui/source/factory/dlgfact.hxx index f7d9e6b..2fd4ebf 100644 --- a/cui/source/factory/dlgfact.hxx +++ b/cui/source/factory/dlgfact.hxx @@ -389,10 +389,11 @@ class AbstractSvxHpLinkDlg_Impl :public AbstractSvxHpLinkDlg }; class FmSearchDialog; +struct FmFoundRecordInformation; class AbstractFmSearchDialog_Impl :public AbstractFmSearchDialog { DECL_ABSTDLG_BASE(AbstractFmSearchDialog_Impl,FmSearchDialog) - virtual void SetFoundHandler(const Link<>& lnk) SAL_OVERRIDE ; + virtual void SetFoundHandler(const Link<FmFoundRecordInformation&,void>& lnk) SAL_OVERRIDE ; virtual void SetCanceledNotFoundHdl(const Link<>& lnk) SAL_OVERRIDE; virtual void SetActiveField(const OUString& strField) SAL_OVERRIDE; }; diff --git a/cui/source/inc/cuifmsearch.hxx b/cui/source/inc/cuifmsearch.hxx index c41ea5c..c52fd38 100644 --- a/cui/source/inc/cuifmsearch.hxx +++ b/cui/source/inc/cuifmsearch.hxx @@ -78,7 +78,7 @@ class FmSearchDialog : public ModalDialog VclPtr<vcl::Window> m_pPreSearchFocus; - Link<> m_lnkFoundHandler; ///< Handler for "found" + Link<FmFoundRecordInformation&,void> m_lnkFoundHandler; ///< Handler for "found" Link<> m_lnkCanceledNotFoundHdl; ///< Handler for Positioning the Cursors Link<FmSearchContext&,sal_uInt32> m_lnkContextSupplier; ///< for search in contexts @@ -119,7 +119,7 @@ public: This handler MUST be set. Furthermore, it should be considered, that during the handler the search-dialog is still modal. */ - void SetFoundHandler(const Link<>& lnk) { m_lnkFoundHandler = lnk; } + void SetFoundHandler(const Link<FmFoundRecordInformation&,void>& lnk) { m_lnkFoundHandler = lnk; } /** If the search has been cancelled or has been finished without success, the current data set is always displayed in the search dialog. This handler exists to make this synchronous with the possible display of the caller (it does not diff --git a/dbaccess/source/ui/browser/brwctrlr.cxx b/dbaccess/source/ui/browser/brwctrlr.cxx index 8783d31..10fbab4 100644 --- a/dbaccess/source/ui/browser/brwctrlr.cxx +++ b/dbaccess/source/ui/browser/brwctrlr.cxx @@ -2369,13 +2369,13 @@ IMPL_LINK_TYPED(SbaXDataBrowserController, OnSearchContextRequest, FmSearchConte return rContext.arrFields.size(); } -IMPL_LINK(SbaXDataBrowserController, OnFoundData, FmFoundRecordInformation*, pInfo) +IMPL_LINK_TYPED(SbaXDataBrowserController, OnFoundData, FmFoundRecordInformation&, rInfo, void) { Reference< css::sdbcx::XRowLocate > xCursor(getRowSet(), UNO_QUERY); OSL_ENSURE(xCursor.is(), "SbaXDataBrowserController::OnFoundData : xCursor is empty"); // move the cursor - xCursor->moveToBookmark(pInfo->aPosition); + xCursor->moveToBookmark(rInfo.aPosition); // let the grid snyc it's display with the cursor Reference< XPropertySet > xModelSet(getControlModel(), UNO_QUERY); @@ -2393,8 +2393,8 @@ IMPL_LINK(SbaXDataBrowserController, OnFoundData, FmFoundRecordInformation*, pIn Reference< XInterface > xCurrent(aColumnControls->getByIndex(nViewPos),UNO_QUERY); if (IsSearchableControl(xCurrent)) { - if (pInfo->nFieldPos) - --pInfo->nFieldPos; + if (rInfo.nFieldPos) + --rInfo.nFieldPos; else break; } @@ -2402,8 +2402,6 @@ IMPL_LINK(SbaXDataBrowserController, OnFoundData, FmFoundRecordInformation*, pIn Reference< css::form::XGrid > xGrid(getBrowserView()->getGridControl(), UNO_QUERY); xGrid->setCurrentColumnPosition(nViewPos); - - return 0; } IMPL_LINK(SbaXDataBrowserController, OnCanceledNotFound, FmFoundRecordInformation*, pInfo) diff --git a/dbaccess/source/ui/inc/brwctrlr.hxx b/dbaccess/source/ui/inc/brwctrlr.hxx index 8bcab45..e340c04 100644 --- a/dbaccess/source/ui/inc/brwctrlr.hxx +++ b/dbaccess/source/ui/inc/brwctrlr.hxx @@ -332,7 +332,7 @@ namespace dbaui // search callbacks DECL_LINK_TYPED(OnSearchContextRequest, FmSearchContext&, sal_uInt32); - DECL_LINK(OnFoundData, FmFoundRecordInformation*); + DECL_LINK_TYPED(OnFoundData, FmFoundRecordInformation&, void); DECL_LINK(OnCanceledNotFound, FmFoundRecordInformation*); DECL_LINK_TYPED( OnAsyncGetCellFocus, void*, void ); diff --git a/include/svx/svxdlg.hxx b/include/svx/svxdlg.hxx index 0fb8845..30f0dacf 100644 --- a/include/svx/svxdlg.hxx +++ b/include/svx/svxdlg.hxx @@ -198,10 +198,11 @@ public: virtual bool QueryClose() = 0; }; +struct FmFoundRecordInformation; class AbstractFmSearchDialog :public VclAbstractDialog { public: - virtual void SetFoundHandler(const Link<>& lnk) = 0; + virtual void SetFoundHandler(const Link<FmFoundRecordInformation&,void>& lnk) = 0; virtual void SetCanceledNotFoundHdl(const Link<>& lnk)=0; virtual void SetActiveField(const OUString& strField)=0; }; diff --git a/svx/source/form/fmshimp.cxx b/svx/source/form/fmshimp.cxx index b18ca4e..c82829a 100644 --- a/svx/source/form/fmshimp.cxx +++ b/svx/source/form/fmshimp.cxx @@ -2200,24 +2200,24 @@ void FmXFormShell::ShowSelectionProperties( bool bShow ) } -IMPL_LINK(FmXFormShell, OnFoundData, FmFoundRecordInformation*, pfriWhere) +IMPL_LINK_TYPED(FmXFormShell, OnFoundData, FmFoundRecordInformation&, rfriWhere, void) { if ( impl_checkDisposed() ) - return 0; + return; - DBG_ASSERT((pfriWhere->nContext >= 0) && (pfriWhere->nContext < (sal_Int16)m_aSearchForms.size()), + DBG_ASSERT((rfriWhere.nContext >= 0) && (rfriWhere.nContext < (sal_Int16)m_aSearchForms.size()), "FmXFormShell::OnFoundData : ungueltiger Kontext !"); - Reference< XForm> xForm( m_aSearchForms.at(pfriWhere->nContext)); + Reference< XForm> xForm( m_aSearchForms.at(rfriWhere.nContext)); DBG_ASSERT(xForm.is(), "FmXFormShell::OnFoundData : ungueltige Form !"); Reference< XRowLocate> xCursor(xForm, UNO_QUERY); if (!xCursor.is()) - return 0; // was soll ich da machen ? + return; // was soll ich da machen ? // zum Datensatz try { - xCursor->moveToBookmark(pfriWhere->aPosition); + xCursor->moveToBookmark(rfriWhere.aPosition); } catch(const SQLException&) { @@ -2227,10 +2227,10 @@ IMPL_LINK(FmXFormShell, OnFoundData, FmFoundRecordInformation*, pfriWhere) LoopGrids(LoopGridsSync::FORCE_SYNC); // und zum Feld (dazu habe ich vor dem Start des Suchens die XVclComponent-Interfaces eingesammelt) - SAL_WARN_IF(static_cast<size_t>(pfriWhere->nFieldPos) >= + SAL_WARN_IF(static_cast<size_t>(rfriWhere.nFieldPos) >= m_arrSearchedControls.size(), "svx.form", "FmXFormShell::OnFoundData : invalid index!"); - SdrObject* pObject = m_arrSearchedControls.at(pfriWhere->nFieldPos); + SdrObject* pObject = m_arrSearchedControls.at(rfriWhere.nFieldPos); m_pShell->GetFormView()->UnMarkAll(m_pShell->GetFormView()->GetSdrPageView()); m_pShell->GetFormView()->MarkObj(pObject, m_pShell->GetFormView()->GetSdrPageView()); @@ -2239,7 +2239,7 @@ IMPL_LINK(FmXFormShell, OnFoundData, FmFoundRecordInformation*, pfriWhere) Reference< XControlModel > xControlModel( pFormObject ? pFormObject->GetUnoControlModel() : Reference< XControlModel >() ); DBG_ASSERT( xControlModel.is(), "FmXFormShell::OnFoundData: invalid control!" ); if ( !xControlModel.is() ) - return 0; + return; // disable the permanent cursor for the last grid we found a record if (m_xLastGridFound.is() && (m_xLastGridFound != xControlModel)) @@ -2254,7 +2254,7 @@ IMPL_LINK(FmXFormShell, OnFoundData, FmFoundRecordInformation*, pfriWhere) } // wenn das Feld sich in einem GridControl befindet, muss ich dort noch in die entsprechende Spalte gehen - sal_Int32 nGridColumn = m_arrRelativeGridColumn[pfriWhere->nFieldPos]; + sal_Int32 nGridColumn = m_arrRelativeGridColumn[rfriWhere.nFieldPos]; if (nGridColumn != -1) { // dummer weise muss ich mir das Control erst wieder besorgen Reference<XControl> xControl( pFormObject ? impl_getControl( xControlModel, *pFormObject ) : Reference< XControl>() ); @@ -2279,8 +2279,6 @@ IMPL_LINK(FmXFormShell, OnFoundData, FmFoundRecordInformation*, pfriWhere) while (DatabaseSlotMap[nPos]) m_pShell->GetViewShell()->GetViewFrame()->GetBindings().Update(DatabaseSlotMap[nPos++]); // leider geht das Update im Gegensatz zum Invalidate nur mit einzelnen Slots) - - return 0; } diff --git a/svx/source/inc/fmshimp.hxx b/svx/source/inc/fmshimp.hxx index 5c78784..521e7fb 100644 --- a/svx/source/inc/fmshimp.hxx +++ b/svx/source/inc/fmshimp.hxx @@ -464,7 +464,7 @@ public: SAL_DLLPRIVATE bool HasControlFocus() const; private: - DECL_DLLPRIVATE_LINK(OnFoundData, FmFoundRecordInformation*); + DECL_DLLPRIVATE_LINK_TYPED(OnFoundData, FmFoundRecordInformation&, void); DECL_DLLPRIVATE_LINK(OnCanceledNotFound, FmFoundRecordInformation*); DECL_DLLPRIVATE_LINK_TYPED(OnSearchContextRequest, FmSearchContext&, sal_uInt32); DECL_DLLPRIVATE_LINK_TYPED(OnTimeOut, Timer*, void); _______________________________________________ Libreoffice-commits mailing list [email protected] http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
