summaryrefslogtreecommitdiff
path: root/extensions
diff options
context:
space:
mode:
authorNoel <noel.grandin@collabora.co.uk>2021-03-08 21:37:43 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2021-03-11 14:10:30 +0100
commit1692998399eecb79e7b59456cff805bcb77aece4 (patch)
tree8cc22c633e88f19c39f5736e87a0934f041729de /extensions
parent665a2b477dd4f412b42ffb58a183f7a702cd7645 (diff)
use strong_int for item ids in vcl::ToolBox
(*) fix bug in SfxToolBoxControl::StateChanged where it was using the slot id instead of the toolbox item id (*) I left the logic in SbaTableQueryBrowser alone, but it looks suspicious, casting slot ids to toolbox ids Change-Id: Ied229164c27fb4456b0515c6fdcbd1682766a1a9 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/112186 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'extensions')
-rw-r--r--extensions/source/bibliography/toolbar.cxx18
-rw-r--r--extensions/source/bibliography/toolbar.hxx28
2 files changed, 23 insertions, 23 deletions
diff --git a/extensions/source/bibliography/toolbar.cxx b/extensions/source/bibliography/toolbar.cxx
index 5ef3a8d5030c..8aafe10954da 100644
--- a/extensions/source/bibliography/toolbar.cxx
+++ b/extensions/source/bibliography/toolbar.cxx
@@ -49,7 +49,7 @@ using namespace ::com::sun::star::beans;
// Constants --------------------------------------------------------------
-BibToolBarListener::BibToolBarListener(BibToolBar *pTB, const OUString& aStr, sal_uInt16 nId):
+BibToolBarListener::BibToolBarListener(BibToolBar *pTB, const OUString& aStr, ToolBoxItemId nId):
nIndex(nId),
aCommand(aStr),
pToolBar(pTB)
@@ -77,7 +77,7 @@ void BibToolBarListener::statusChanged(const css::frame::FeatureStateEvent& rEvt
};
-BibTBListBoxListener::BibTBListBoxListener(BibToolBar *pTB, const OUString& aStr, sal_uInt16 nId):
+BibTBListBoxListener::BibTBListBoxListener(BibToolBar *pTB, const OUString& aStr, ToolBoxItemId nId):
BibToolBarListener(pTB,aStr,nId)
{
}
@@ -115,7 +115,7 @@ void BibTBListBoxListener::statusChanged(const css::frame::FeatureStateEvent& rE
pToolBar->SelectSourceEntry(rEvt.FeatureDescriptor);
};
-BibTBQueryMenuListener::BibTBQueryMenuListener(BibToolBar *pTB, const OUString& aStr, sal_uInt16 nId):
+BibTBQueryMenuListener::BibTBQueryMenuListener(BibToolBar *pTB, const OUString& aStr, ToolBoxItemId nId):
BibToolBarListener(pTB,aStr,nId)
{
}
@@ -152,7 +152,7 @@ void BibTBQueryMenuListener::statusChanged(const frame::FeatureStateEvent& rEvt)
}
};
-BibTBEditListener::BibTBEditListener(BibToolBar *pTB, const OUString& aStr, sal_uInt16 nId):
+BibTBEditListener::BibTBEditListener(BibToolBar *pTB, const OUString& aStr, ToolBoxItemId nId):
BibToolBarListener(pTB,aStr,nId)
{
}
@@ -302,7 +302,7 @@ void BibToolBar::InitListener()
for(ToolBox::ImplToolItems::size_type nPos=0;nPos<nCount;nPos++)
{
- sal_uInt16 nId=GetItemId(nPos);
+ ToolBoxItemId nId=GetItemId(nPos);
if (!nId)
continue;
@@ -341,7 +341,7 @@ void BibToolBar::SetXController(const uno::Reference< frame::XController > & xCt
void BibToolBar::Select()
{
- sal_uInt16 nId=GetCurItemId();
+ ToolBoxItemId nId=GetCurItemId();
if (nId != nTBC_BT_AUTOFILTER)
{
@@ -361,7 +361,7 @@ void BibToolBar::Select()
}
}
-void BibToolBar::SendDispatch(sal_uInt16 nId, const Sequence< PropertyValue >& rArgs)
+void BibToolBar::SendDispatch(ToolBoxItemId nId, const Sequence< PropertyValue >& rArgs)
{
OUString aCommand = GetItemCommand(nId);
@@ -389,7 +389,7 @@ void BibToolBar::SendDispatch(sal_uInt16 nId, const Sequence< PropertyValue >& r
void BibToolBar::Click()
{
- sal_uInt16 nId = GetCurItemId();
+ ToolBoxItemId nId = GetCurItemId();
vcl::Window* pWin = GetParent();
@@ -516,7 +516,7 @@ IMPL_LINK_NOARG( BibToolBar, SendSelHdl, Timer*, void )
IMPL_LINK_NOARG(BibToolBar, MenuHdl, ToolBox*, void)
{
- sal_uInt16 nId = GetCurItemId();
+ ToolBoxItemId nId = GetCurItemId();
if (nId != nTBC_BT_AUTOFILTER)
return;
diff --git a/extensions/source/bibliography/toolbar.hxx b/extensions/source/bibliography/toolbar.hxx
index ee4b58274e9e..a9b618479947 100644
--- a/extensions/source/bibliography/toolbar.hxx
+++ b/extensions/source/bibliography/toolbar.hxx
@@ -36,7 +36,7 @@ class BibToolBarListener: public cppu::WeakImplHelper < css::frame::XStatusListe
{
private:
- sal_uInt16 nIndex;
+ ToolBoxItemId nIndex;
OUString aCommand;
protected:
@@ -45,7 +45,7 @@ protected:
public:
- BibToolBarListener(BibToolBar *pTB, const OUString& aStr, sal_uInt16 nId);
+ BibToolBarListener(BibToolBar *pTB, const OUString& aStr, ToolBoxItemId nId);
virtual ~BibToolBarListener() override;
const OUString& GetCommand() const { return aCommand;}
@@ -63,7 +63,7 @@ class BibTBListBoxListener: public BibToolBarListener
{
public:
- BibTBListBoxListener(BibToolBar *pTB, const OUString& aStr, sal_uInt16 nId);
+ BibTBListBoxListener(BibToolBar *pTB, const OUString& aStr, ToolBoxItemId nId);
virtual ~BibTBListBoxListener() override;
virtual void SAL_CALL statusChanged(const css::frame::FeatureStateEvent& Event) override;
@@ -74,7 +74,7 @@ class BibTBEditListener: public BibToolBarListener
{
public:
- BibTBEditListener(BibToolBar *pTB, const OUString& aStr, sal_uInt16 nId);
+ BibTBEditListener(BibToolBar *pTB, const OUString& aStr, ToolBoxItemId nId);
virtual ~BibTBEditListener() override;
virtual void SAL_CALL statusChanged(const css::frame::FeatureStateEvent& Event) override;
@@ -85,7 +85,7 @@ class BibTBQueryMenuListener: public BibToolBarListener
{
public:
- BibTBQueryMenuListener(BibToolBar *pTB, const OUString& aStr, sal_uInt16 nId);
+ BibTBQueryMenuListener(BibToolBar *pTB, const OUString& aStr, ToolBoxItemId nId);
virtual ~BibTBQueryMenuListener() override;
virtual void SAL_CALL statusChanged(const css::frame::FeatureStateEvent& Event) override;
@@ -156,13 +156,13 @@ class BibToolBar: public ToolBox
Link<void*,void> aLayoutManager;
sal_Int16 nSymbolsSize;
- sal_uInt16 nTBC_SOURCE;
- sal_uInt16 nTBC_QUERY;
- sal_uInt16 nTBC_BT_AUTOFILTER;
- sal_uInt16 nTBC_BT_COL_ASSIGN;
- sal_uInt16 nTBC_BT_CHANGESOURCE;
- sal_uInt16 nTBC_BT_FILTERCRIT;
- sal_uInt16 nTBC_BT_REMOVEFILTER;
+ ToolBoxItemId nTBC_SOURCE;
+ ToolBoxItemId nTBC_QUERY;
+ ToolBoxItemId nTBC_BT_AUTOFILTER;
+ ToolBoxItemId nTBC_BT_COL_ASSIGN;
+ ToolBoxItemId nTBC_BT_CHANGESOURCE;
+ ToolBoxItemId nTBC_BT_FILTERCRIT;
+ ToolBoxItemId nTBC_BT_REMOVEFILTER;
BibDataManager* pDatMan;
DECL_LINK( SelHdl, weld::ComboBox&, void );
@@ -189,7 +189,7 @@ class BibToolBar: public ToolBox
virtual ~BibToolBar() override;
virtual void dispose() override;
- sal_uInt16 GetChangeSourceId() const { return nTBC_BT_CHANGESOURCE; }
+ ToolBoxItemId GetChangeSourceId() const { return nTBC_BT_CHANGESOURCE; }
void SetXController(const css::uno::Reference< css::frame::XController > &);
@@ -211,7 +211,7 @@ class BibToolBar: public ToolBox
void statusChanged(const css::frame::FeatureStateEvent& Event);
void SetDatMan(BibDataManager& rDatMan) {pDatMan = &rDatMan;}
- void SendDispatch(sal_uInt16 nId, const css::uno::Sequence< css::beans::PropertyValue >& rArgs);
+ void SendDispatch(ToolBoxItemId nId, const css::uno::Sequence< css::beans::PropertyValue >& rArgs);
};