[Libreoffice-commits] core.git: cui/source dbaccess/source include/svx svx/source
Noel Grandin
noelgrandin at gmail.com
Tue Sep 22 11:57:49 PDT 2015
cui/source/dialogs/cuifmsearch.cxx | 6 +++---
cui/source/factory/dlgfact.cxx | 2 +-
cui/source/factory/dlgfact.hxx | 2 +-
cui/source/inc/cuifmsearch.hxx | 4 ++--
dbaccess/source/ui/browser/brwctrlr.cxx | 14 +++++++-------
dbaccess/source/ui/inc/brwctrlr.hxx | 2 +-
include/svx/svxdlg.hxx | 3 ++-
svx/source/form/fmshimp.cxx | 32 ++++++++++++++++----------------
svx/source/inc/fmshimp.hxx | 2 +-
9 files changed, 34 insertions(+), 33 deletions(-)
New commits:
commit efeb9281535f9e32a1d23332a19da69767dd1387
Author: Noel Grandin <noelgrandin at gmail.com>
Date: Tue Sep 22 16:18:58 2015 +0200
convert Link<> to typed
Change-Id: I12b3fdb443226a63786b94ce9836e9d2efa6a5c8
Reviewed-on: https://gerrit.libreoffice.org/18776
Reviewed-by: Noel Grandin <noelgrandin at gmail.com>
Tested-by: Noel Grandin <noelgrandin at gmail.com>
diff --git a/cui/source/dialogs/cuifmsearch.cxx b/cui/source/dialogs/cuifmsearch.cxx
index 26b18e1..8b38031 100644
--- a/cui/source/dialogs/cuifmsearch.cxx
+++ b/cui/source/dialogs/cuifmsearch.cxx
@@ -74,7 +74,7 @@ void FmSearchDialog::initCommon( const Reference< XResultSet >& _rxCursor )
}
FmSearchDialog::FmSearchDialog(vcl::Window* pParent, const OUString& sInitialText, const ::std::vector< OUString >& _rContexts, sal_Int16 nInitialContext,
- const Link<>& lnkContextSupplier)
+ const Link<FmSearchContext&,sal_uInt32>& lnkContextSupplier)
:ModalDialog(pParent, "RecordSearchDialog", "cui/ui/fmsearchdialog.ui")
,m_sCancel( Button::GetStandardText( StandardButtonType::Cancel ) )
,m_pPreSearchFocus( NULL )
@@ -115,7 +115,7 @@ FmSearchDialog::FmSearchDialog(vcl::Window* pParent, const OUString& sInitialTex
FmSearchContext fmscInitial;
fmscInitial.nContext = nInitialContext;
- m_lnkContextSupplier.Call(&fmscInitial);
+ m_lnkContextSupplier.Call(fmscInitial);
DBG_ASSERT(fmscInitial.xCursor.is(), "FmSearchDialog::FmSearchDialog : invalid data supplied by ContextSupplier !");
DBG_ASSERT(comphelper::string::getTokenCount(fmscInitial.strUsedFields, ';') == (sal_Int32)fmscInitial.arrFields.size(),
"FmSearchDialog::FmSearchDialog : invalid data supplied by ContextSupplied !");
@@ -520,7 +520,7 @@ void FmSearchDialog::InitContext(sal_Int16 nContext)
FmSearchContext fmscContext;
fmscContext.nContext = nContext;
- sal_uInt32 nResult = m_lnkContextSupplier.Call(&fmscContext);
+ sal_uInt32 nResult = m_lnkContextSupplier.Call(fmscContext);
DBG_ASSERT(nResult > 0, "FmSearchDialog::InitContext : ContextSupplier didn't give me any controls !");
// put the field names into the respective listbox
diff --git a/cui/source/factory/dlgfact.cxx b/cui/source/factory/dlgfact.cxx
index f18a3ec..9f39f38 100644
--- a/cui/source/factory/dlgfact.cxx
+++ b/cui/source/factory/dlgfact.cxx
@@ -1266,7 +1266,7 @@ AbstractFmSearchDialog* AbstractDialogFactory_Impl::CreateFmSearchDialog(vcl::W
const OUString& strInitialText,
const ::std::vector< OUString >& _rContexts,
sal_Int16 nInitialContext,
- const Link<>& lnkContextSupplier)
+ const Link<FmSearchContext&,sal_uInt32>& lnkContextSupplier)
{
VclPtrInstance<FmSearchDialog> pDlg( pParent, strInitialText, _rContexts,
nInitialContext, lnkContextSupplier );
diff --git a/cui/source/factory/dlgfact.hxx b/cui/source/factory/dlgfact.hxx
index 7b803b4..4c8b228 100644
--- a/cui/source/factory/dlgfact.hxx
+++ b/cui/source/factory/dlgfact.hxx
@@ -606,7 +606,7 @@ public:
const OUString& strInitialText,
const ::std::vector< OUString >& _rContexts,
sal_Int16 nInitialContext,
- const Link<>& lnkContextSupplier) SAL_OVERRIDE;
+ const Link<FmSearchContext&,sal_uInt32>& lnkContextSupplier) SAL_OVERRIDE;
virtual AbstractGraphicFilterDialog * CreateGraphicFilterEmboss(vcl::Window* pParent,
const Graphic& rGraphic, RECT_POINT eLightSource) SAL_OVERRIDE;
virtual AbstractGraphicFilterDialog * CreateGraphicFilterPoster(vcl::Window* pParent,
diff --git a/cui/source/inc/cuifmsearch.hxx b/cui/source/inc/cuifmsearch.hxx
index fb1d9b2..42a9fab 100644
--- a/cui/source/inc/cuifmsearch.hxx
+++ b/cui/source/inc/cuifmsearch.hxx
@@ -81,7 +81,7 @@ class FmSearchDialog : public ModalDialog
Link<> m_lnkFoundHandler; ///< Handler for "found"
Link<> m_lnkCanceledNotFoundHdl; ///< Handler for Positioning the Cursors
- Link<> m_lnkContextSupplier; ///< for search in contexts
+ Link<FmSearchContext&,sal_uInt32> m_lnkContextSupplier; ///< for search in contexts
/// memorize the currently selected field for every context
::std::vector<OUString> m_arrContextFields;
@@ -108,7 +108,7 @@ public:
arrFields of the context)
*/
FmSearchDialog(vcl::Window* pParent, const OUString& strInitialText, const ::std::vector< OUString >& _rContexts, sal_Int16 nInitialContext,
- const Link<>& lnkContextSupplier);
+ const Link<FmSearchContext&,sal_uInt32>& lnkContextSupplier);
virtual ~FmSearchDialog();
virtual void dispose() SAL_OVERRIDE;
diff --git a/dbaccess/source/ui/browser/brwctrlr.cxx b/dbaccess/source/ui/browser/brwctrlr.cxx
index 9d1f159..8783d31 100644
--- a/dbaccess/source/ui/browser/brwctrlr.cxx
+++ b/dbaccess/source/ui/browser/brwctrlr.cxx
@@ -2323,7 +2323,7 @@ Reference< XPropertySet > SbaXDataBrowserController::getBoundField(sal_uInt16 n
return xEmptyReturn;
}
-IMPL_LINK(SbaXDataBrowserController, OnSearchContextRequest, FmSearchContext*, pContext)
+IMPL_LINK_TYPED(SbaXDataBrowserController, OnSearchContextRequest, FmSearchContext&, rContext, sal_uInt32)
{
Reference< css::container::XIndexAccess > xPeerContainer(getBrowserView()->getGridControl(), UNO_QUERY);
@@ -2350,23 +2350,23 @@ IMPL_LINK(SbaXDataBrowserController, OnSearchContextRequest, FmSearchContext*, p
sFieldList += aName + ";";
- pContext->arrFields.push_back(xCurrentColumn);
+ rContext.arrFields.push_back(xCurrentColumn);
}
sFieldList = comphelper::string::stripEnd(sFieldList, ';');
- pContext->xCursor.set(getRowSet(),UNO_QUERY);
- pContext->strUsedFields = sFieldList;
+ rContext.xCursor.set(getRowSet(),UNO_QUERY);
+ rContext.strUsedFields = sFieldList;
// if the cursor is in a mode other than STANDARD -> reset
- Reference< XPropertySet > xCursorSet(pContext->xCursor, UNO_QUERY);
+ Reference< XPropertySet > xCursorSet(rContext.xCursor, UNO_QUERY);
OSL_ENSURE(xCursorSet.is() && !::comphelper::getBOOL(xCursorSet->getPropertyValue(PROPERTY_ISMODIFIED)),
"SbaXDataBrowserController::OnSearchContextRequest : please do not call for cursors with modified rows !");
if (xCursorSet.is() && ::comphelper::getBOOL(xCursorSet->getPropertyValue(PROPERTY_ISNEW)))
{
- Reference< XResultSetUpdate > xUpdateCursor(pContext->xCursor, UNO_QUERY);
+ Reference< XResultSetUpdate > xUpdateCursor(rContext.xCursor, UNO_QUERY);
xUpdateCursor->moveToCurrentRow();
}
- return pContext->arrFields.size();
+ return rContext.arrFields.size();
}
IMPL_LINK(SbaXDataBrowserController, OnFoundData, FmFoundRecordInformation*, pInfo)
diff --git a/dbaccess/source/ui/inc/brwctrlr.hxx b/dbaccess/source/ui/inc/brwctrlr.hxx
index b18b267..8bcab45 100644
--- a/dbaccess/source/ui/inc/brwctrlr.hxx
+++ b/dbaccess/source/ui/inc/brwctrlr.hxx
@@ -331,7 +331,7 @@ namespace dbaui
DECL_LINK_TYPED( OnClipboardChanged, TransferableDataHelper*, void );
// search callbacks
- DECL_LINK(OnSearchContextRequest, FmSearchContext*);
+ DECL_LINK_TYPED(OnSearchContextRequest, FmSearchContext&, sal_uInt32);
DECL_LINK(OnFoundData, FmFoundRecordInformation*);
DECL_LINK(OnCanceledNotFound, FmFoundRecordInformation*);
diff --git a/include/svx/svxdlg.hxx b/include/svx/svxdlg.hxx
index 369a581..74b6597 100644
--- a/include/svx/svxdlg.hxx
+++ b/include/svx/svxdlg.hxx
@@ -55,6 +55,7 @@ class FmFormShell;
class Graphic;
class SdrObject;
class SvxSpellWrapper;
+struct FmSearchContext;
typedef ::std::vector< OUString > TargetList;
@@ -363,7 +364,7 @@ public:
const OUString& strInitialText,
const ::std::vector< OUString >& _rContexts,
sal_Int16 nInitialContext,
- const Link<>& lnkContextSupplier)=0;
+ const Link<FmSearchContext&,sal_uInt32>& lnkContextSupplier)=0;
virtual AbstractGraphicFilterDialog * CreateGraphicFilterEmboss(vcl::Window* pParent,
const Graphic& rGraphic,
RECT_POINT eLightSource)=0;
diff --git a/svx/source/form/fmshimp.cxx b/svx/source/form/fmshimp.cxx
index 196a1fa..b18ca4e 100644
--- a/svx/source/form/fmshimp.cxx
+++ b/svx/source/form/fmshimp.cxx
@@ -1468,7 +1468,7 @@ void FmXFormShell::ExecuteSearch()
{
FmSearchContext aTestContext;
aTestContext.nContext = static_cast< sal_Int16 >( form - m_aSearchForms.begin() );
- sal_uInt32 nValidControls = OnSearchContextRequest( &aTestContext );
+ sal_uInt32 nValidControls = OnSearchContextRequest(aTestContext );
if ( nValidControls > 0 )
{
aValidForms.push_back( *form );
@@ -2314,13 +2314,13 @@ IMPL_LINK(FmXFormShell, OnCanceledNotFound, FmFoundRecordInformation*, pfriWhere
}
-IMPL_LINK(FmXFormShell, OnSearchContextRequest, FmSearchContext*, pfmscContextInfo)
+IMPL_LINK_TYPED(FmXFormShell, OnSearchContextRequest, FmSearchContext&, rfmscContextInfo, sal_uInt32)
{
if ( impl_checkDisposed() )
return 0;
- DBG_ASSERT(pfmscContextInfo->nContext < (sal_Int16)m_aSearchForms.size(), "FmXFormShell::OnSearchContextRequest : invalid parameter !");
- Reference< XForm> xForm( m_aSearchForms.at(pfmscContextInfo->nContext));
+ DBG_ASSERT(rfmscContextInfo.nContext < (sal_Int16)m_aSearchForms.size(), "FmXFormShell::OnSearchContextRequest : invalid parameter !");
+ Reference< XForm> xForm( m_aSearchForms.at(rfmscContextInfo.nContext));
DBG_ASSERT(xForm.is(), "FmXFormShell::OnSearchContextRequest : unexpected : invalid context !");
Reference< XResultSet> xIter(xForm, UNO_QUERY);
@@ -2438,7 +2438,7 @@ IMPL_LINK(FmXFormShell, OnSearchContextRequest, FmSearchContext*, pfmscContextIn
OUString(::comphelper::getString(xCurrentColModel->getPropertyValue(FM_PROP_LABEL)).getStr()) +
";";
- pfmscContextInfo->arrFields.push_back(xCurrentColumn);
+ rfmscContextInfo.arrFields.push_back(xCurrentColumn);
// and the SdrOject to the Field
m_arrSearchedControls.push_back(pCurrent);
@@ -2476,7 +2476,7 @@ IMPL_LINK(FmXFormShell, OnSearchContextRequest, FmSearchContext*, pfmscContextIn
m_arrRelativeGridColumn.push_back(-1);
// and for the formatted search...
- pfmscContextInfo->arrFields.push_back(Reference<XInterface>( xControl, UNO_QUERY ));
+ rfmscContextInfo.arrFields.push_back(Reference<XInterface>( xControl, UNO_QUERY ));
}
}
}
@@ -2488,22 +2488,22 @@ IMPL_LINK(FmXFormShell, OnSearchContextRequest, FmSearchContext*, pfmscContextIn
strFieldList = comphelper::string::stripEnd(strFieldList, ';');
sFieldDisplayNames = comphelper::string::stripEnd(sFieldDisplayNames, ';');
- if (pfmscContextInfo->arrFields.empty())
+ if (rfmscContextInfo.arrFields.empty())
{
- pfmscContextInfo->arrFields.clear();
- pfmscContextInfo->xCursor = NULL;
- pfmscContextInfo->strUsedFields.clear();
+ rfmscContextInfo.arrFields.clear();
+ rfmscContextInfo.xCursor = NULL;
+ rfmscContextInfo.strUsedFields.clear();
return 0L;
}
- pfmscContextInfo->xCursor = xIter;
- pfmscContextInfo->strUsedFields = strFieldList;
- pfmscContextInfo->sFieldDisplayNames = sFieldDisplayNames;
+ rfmscContextInfo.xCursor = xIter;
+ rfmscContextInfo.strUsedFields = strFieldList;
+ rfmscContextInfo.sFieldDisplayNames = sFieldDisplayNames;
// 66463 - 31.05.99 - FS
// when the cursor is a non-STANDARD RecordMode, set it back
- Reference< XPropertySet> xCursorSet(pfmscContextInfo->xCursor, UNO_QUERY);
- Reference< XResultSetUpdate> xUpdateCursor(pfmscContextInfo->xCursor, UNO_QUERY);
+ Reference< XPropertySet> xCursorSet(rfmscContextInfo.xCursor, UNO_QUERY);
+ Reference< XResultSetUpdate> xUpdateCursor(rfmscContextInfo.xCursor, UNO_QUERY);
if (xUpdateCursor.is() && xCursorSet.is())
{
if (::comphelper::getBOOL(xCursorSet->getPropertyValue(FM_PROP_ISNEW)))
@@ -2512,7 +2512,7 @@ IMPL_LINK(FmXFormShell, OnSearchContextRequest, FmSearchContext*, pfmscContextIn
xUpdateCursor->cancelRowUpdates();
}
- return pfmscContextInfo->arrFields.size();
+ return rfmscContextInfo.arrFields.size();
}
// XContainerListener
diff --git a/svx/source/inc/fmshimp.hxx b/svx/source/inc/fmshimp.hxx
index fcee255..5c78784 100644
--- a/svx/source/inc/fmshimp.hxx
+++ b/svx/source/inc/fmshimp.hxx
@@ -466,7 +466,7 @@ public:
private:
DECL_DLLPRIVATE_LINK(OnFoundData, FmFoundRecordInformation*);
DECL_DLLPRIVATE_LINK(OnCanceledNotFound, FmFoundRecordInformation*);
- DECL_DLLPRIVATE_LINK(OnSearchContextRequest, FmSearchContext*);
+ DECL_DLLPRIVATE_LINK_TYPED(OnSearchContextRequest, FmSearchContext&, sal_uInt32);
DECL_DLLPRIVATE_LINK_TYPED(OnTimeOut, Timer*, void);
DECL_DLLPRIVATE_LINK_TYPED(OnFirstTimeActivation, void*, void);
DECL_DLLPRIVATE_LINK_TYPED(OnFormsCreated, FmFormPageImpl&, void);
More information about the Libreoffice-commits
mailing list