[Libreoffice-commits] core.git: 2 commits - accessibility/inc accessibility/source avmedia/source basctl/source dbaccess/source extensions/source forms/source framework/inc framework/source include/avmedia include/framework include/sfx2 include/svtools include/svx include/vcl sc/inc sc/source sd/source sfx2/inc sfx2/source svtools/source svx/inc svx/source sw/inc sw/source vcl/inc vcl/source vcl/workben
Noel (via logerrit)
logerrit at kemper.freedesktop.org
Thu Mar 11 13:11:19 UTC 2021
accessibility/inc/standard/vclxaccessibletoolboxitem.hxx | 2
accessibility/source/standard/vclxaccessibletoolbox.cxx | 26 +-
accessibility/source/standard/vclxaccessibletoolboxitem.cxx | 4
avmedia/source/framework/mediatoolbox.cxx | 2
basctl/source/basicide/IDEComboBox.cxx | 4
basctl/source/inc/IDEComboBox.hxx | 4
dbaccess/source/ui/browser/unodatbr.cxx | 4
extensions/source/bibliography/toolbar.cxx | 18 -
extensions/source/bibliography/toolbar.hxx | 28 +-
forms/source/solar/control/navtoolbar.cxx | 61 ++--
framework/inc/uielement/FixedImageToolbarController.hxx | 2
framework/inc/uielement/FixedTextToolbarController.hxx | 2
framework/inc/uielement/comboboxtoolbarcontroller.hxx | 2
framework/inc/uielement/commandinfo.hxx | 5
framework/inc/uielement/complextoolbarcontroller.hxx | 4
framework/inc/uielement/dropdownboxtoolbarcontroller.hxx | 2
framework/inc/uielement/edittoolbarcontroller.hxx | 2
framework/inc/uielement/imagebuttontoolbarcontroller.hxx | 2
framework/inc/uielement/spinfieldtoolbarcontroller.hxx | 2
framework/inc/uielement/togglebuttontoolbarcontroller.hxx | 2
framework/inc/uielement/toolbarmanager.hxx | 3
framework/inc/uielement/toolbarmerger.hxx | 12
framework/source/fwe/classes/sfxhelperfunctions.cxx | 2
framework/source/layoutmanager/toolbarlayoutmanager.cxx | 4
framework/source/uielement/FixedImageToolbarController.cxx | 2
framework/source/uielement/FixedTextToolbarController.cxx | 2
framework/source/uielement/comboboxtoolbarcontroller.cxx | 2
framework/source/uielement/complextoolbarcontroller.cxx | 4
framework/source/uielement/dropdownboxtoolbarcontroller.cxx | 2
framework/source/uielement/edittoolbarcontroller.cxx | 2
framework/source/uielement/generictoolbarcontroller.cxx | 6
framework/source/uielement/imagebuttontoolbarcontroller.cxx | 2
framework/source/uielement/popuptoolbarcontroller.cxx | 14 -
framework/source/uielement/spinfieldtoolbarcontroller.cxx | 2
framework/source/uielement/styletoolbarcontroller.cxx | 2
framework/source/uielement/subtoolbarcontroller.cxx | 8
framework/source/uielement/togglebuttontoolbarcontroller.cxx | 2
framework/source/uielement/toolbarmanager.cxx | 36 +-
framework/source/uielement/toolbarmerger.cxx | 16 -
include/avmedia/mediatoolbox.hxx | 2
include/framework/generictoolbarcontroller.hxx | 4
include/framework/sfxhelperfunctions.hxx | 5
include/sfx2/strings.hrc | 2
include/sfx2/tbxctrl.hxx | 16 -
include/svtools/toolboxcontroller.hxx | 5
include/svx/ParaSpacingControl.hxx | 14 -
include/svx/clipboardctl.hxx | 2
include/svx/colorwindow.hxx | 4
include/svx/fillctrl.hxx | 2
include/svx/formatpaintbrushctrl.hxx | 2
include/svx/grafctrl.hxx | 18 -
include/svx/linectrl.hxx | 2
include/svx/tbxctl.hxx | 2
include/vcl/builder.hxx | 3
include/vcl/toolbox.hxx | 128 +++++----
sc/inc/NumberFormatControl.hxx | 2
sc/inc/sc.hrc | 6
sc/source/ui/app/inputwin.cxx | 143 +++++------
sc/source/ui/cctrl/tbzoomsliderctrl.cxx | 4
sc/source/ui/inc/tbzoomsliderctrl.hxx | 2
sc/source/ui/sidebar/NumberFormatControl.cxx | 4
sd/source/ui/controller/displaymodecontroller.cxx | 4
sd/source/ui/controller/slidelayoutcontroller.cxx | 2
sd/source/ui/dlg/diactrl.cxx | 2
sd/source/ui/dlg/gluectrl.cxx | 2
sd/source/ui/inc/diactrl.hxx | 2
sd/source/ui/inc/gluectrl.hxx | 2
sfx2/inc/inettbc.hxx | 2
sfx2/inc/sidebar/ControllerFactory.hxx | 3
sfx2/inc/sidebar/SidebarToolBox.hxx | 6
sfx2/source/appl/linkmgr2.cxx | 2
sfx2/source/control/emojipopup.cxx | 2
sfx2/source/dialog/charmappopup.cxx | 2
sfx2/source/dialog/titledockwin.cxx | 12
sfx2/source/inet/inettbc.cxx | 4
sfx2/source/sidebar/ControllerFactory.cxx | 2
sfx2/source/sidebar/SidebarToolBox.cxx | 4
sfx2/source/toolbox/tbxitem.cxx | 14 -
sfx2/source/view/viewsh.cxx | 2
svtools/source/uno/popupwindowcontroller.cxx | 2
svtools/source/uno/toolboxcontroller.cxx | 20 -
svx/inc/tbxcolorupdate.hxx | 4
svx/source/dialog/srchdlg.cxx | 4
svx/source/form/tbxform.cxx | 14 -
svx/source/inc/tbxform.hxx | 12
svx/source/mnuctrls/clipboardctl.cxx | 4
svx/source/sidebar/paragraph/ParaLineSpacingPopup.cxx | 2
svx/source/sidebar/paragraph/ParaSpacingControl.cxx | 20 -
svx/source/sidebar/text/TextCharacterSpacingPopup.cxx | 2
svx/source/sidebar/text/TextUnderlinePopup.cxx | 2
svx/source/tbxctrls/bulletsnumbering.cxx | 2
svx/source/tbxctrls/extrusioncontrols.cxx | 8
svx/source/tbxctrls/fillctrl.cxx | 2
svx/source/tbxctrls/fontworkgallery.cxx | 4
svx/source/tbxctrls/formatpaintbrushctrl.cxx | 2
svx/source/tbxctrls/grafctrl.cxx | 18 -
svx/source/tbxctrls/layctrl.cxx | 8
svx/source/tbxctrls/lboxctrl.cxx | 4
svx/source/tbxctrls/linectrl.cxx | 6
svx/source/tbxctrls/linewidthctrl.cxx | 2
svx/source/tbxctrls/tbcontrl.cxx | 16 -
svx/source/tbxctrls/tbunocontroller.cxx | 2
svx/source/tbxctrls/tbunosearchcontrollers.cxx | 12
svx/source/tbxctrls/tbxcolorupdate.cxx | 2
svx/source/tbxctrls/tbxdrctl.cxx | 2
svx/source/tbxctrls/verttexttbxctrl.cxx | 4
sw/inc/cmdid.h | 4
sw/source/uibase/inc/workctrl.hxx | 6
sw/source/uibase/ribbar/inputwin.cxx | 30 +-
sw/source/uibase/ribbar/workctrl.cxx | 14 -
sw/source/uibase/sidebar/PageColumnPopup.cxx | 2
sw/source/uibase/sidebar/PageMarginPopup.cxx | 2
sw/source/uibase/sidebar/PageOrientationPopup.cxx | 2
sw/source/uibase/sidebar/PageSizePopup.cxx | 2
vcl/inc/salvtables.hxx | 4
vcl/inc/toolbox.h | 12
vcl/source/app/salvtables.cxx | 16 -
vcl/source/uitest/uiobject.cxx | 4
vcl/source/window/NotebookBarAddonsMerger.cxx | 2
vcl/source/window/builder.cxx | 4
vcl/source/window/dlgctrl.cxx | 3
vcl/source/window/floatwin.cxx | 2
vcl/source/window/menubarwindow.cxx | 32 +-
vcl/source/window/toolbox.cxx | 54 ++--
vcl/source/window/toolbox2.cxx | 132 +++++-----
vcl/workben/vcldemo.cxx | 4
126 files changed, 633 insertions(+), 620 deletions(-)
New commits:
commit 1692998399eecb79e7b59456cff805bcb77aece4
Author: Noel <noel.grandin at collabora.co.uk>
AuthorDate: Mon Mar 8 21:37:43 2021 +0200
Commit: Noel Grandin <noel.grandin at collabora.co.uk>
CommitDate: Thu Mar 11 14:10:30 2021 +0100
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 at collabora.co.uk>
diff --git a/accessibility/inc/standard/vclxaccessibletoolboxitem.hxx b/accessibility/inc/standard/vclxaccessibletoolboxitem.hxx
index 544be177044b..cbfb8162f677 100644
--- a/accessibility/inc/standard/vclxaccessibletoolboxitem.hxx
+++ b/accessibility/inc/standard/vclxaccessibletoolboxitem.hxx
@@ -45,7 +45,7 @@ private:
VclPtr<ToolBox> m_pToolBox;
sal_Int32 m_nIndexInParent;
sal_Int16 m_nRole;
- sal_uInt16 m_nItemId;
+ ToolBoxItemId m_nItemId;
bool m_bHasFocus;
bool m_bIsChecked;
bool m_bIndeterminate;
diff --git a/accessibility/source/standard/vclxaccessibletoolbox.cxx b/accessibility/source/standard/vclxaccessibletoolbox.cxx
index a04685730c85..cf3bf77169e7 100644
--- a/accessibility/source/standard/vclxaccessibletoolbox.cxx
+++ b/accessibility/source/standard/vclxaccessibletoolbox.cxx
@@ -200,11 +200,11 @@ void VCLXAccessibleToolBox::UpdateFocus_Impl()
if ( !bHasFocus )
return;
- sal_uInt16 nHighlightItemId = pToolBox->GetHighlightItemId();
+ ToolBoxItemId nHighlightItemId = pToolBox->GetHighlightItemId();
sal_uInt16 nFocusCount = 0;
for ( const auto& [rPos, rxChild] : m_aAccessibleChildren )
{
- sal_uInt16 nItemId = pToolBox->GetItemId( rPos );
+ ToolBoxItemId nItemId = pToolBox->GetItemId( rPos );
if ( rxChild.is() )
{
@@ -252,12 +252,12 @@ void VCLXAccessibleToolBox::UpdateChecked_Impl( ToolBox::ImplToolItems::size_typ
if ( !pToolBox )
return;
- sal_uInt16 nFocusId = pToolBox->GetItemId( _nPos );
+ ToolBoxItemId nFocusId = pToolBox->GetItemId( _nPos );
VCLXAccessibleToolBoxItem* pFocusItem = nullptr;
for ( const auto& [rPos, rxChild] : m_aAccessibleChildren )
{
- sal_uInt16 nItemId = pToolBox->GetItemId( rPos );
+ ToolBoxItemId nItemId = pToolBox->GetItemId( rPos );
VCLXAccessibleToolBoxItem* pItem =
static_cast< VCLXAccessibleToolBoxItem* >( rxChild.get() );
@@ -276,7 +276,7 @@ void VCLXAccessibleToolBox::UpdateIndeterminate_Impl( ToolBox::ImplToolItems::si
if ( !pToolBox )
return;
- sal_uInt16 nItemId = pToolBox->GetItemId( _nPos );
+ ToolBoxItemId nItemId = pToolBox->GetItemId( _nPos );
ToolBoxItemsMap::iterator aIter = m_aAccessibleChildren.find( _nPos );
//TODO: ToolBox::ImplToolItems::size_type -> sal_Int32!
@@ -392,7 +392,7 @@ void VCLXAccessibleToolBox::UpdateCustomPopupItemp_Impl( vcl::Window* pWindow, b
if( !(pWindow && pToolBox) )
return;
- const sal_uInt16 nDownItem = pToolBox->GetDownItemId();
+ const ToolBoxItemId nDownItem = pToolBox->GetDownItemId();
if ( !nDownItem )
// No item is currently in down state.
// Moreover, calling GetItemPos with 0 will find a separator if there is any.
@@ -434,7 +434,7 @@ void VCLXAccessibleToolBox::HandleSubToolBarEvent( const VclWindowEvent& rVclWin
&& pChildWindow->GetType() == WindowType::TOOLBOX) )
return;
- const sal_uInt16 nCurItemId( pToolBox->GetCurItemId() );
+ const ToolBoxItemId nCurItemId( pToolBox->GetCurItemId() );
if ( !nCurItemId )
// No item is currently active (might happen when opening the overflow popup).
// Moreover, calling GetItemPos with 0 will find a separator if there is any.
@@ -698,8 +698,8 @@ Reference< XAccessible > SAL_CALL VCLXAccessibleToolBox::getAccessibleChild( sal
ToolBoxItemsMap::iterator aIter = m_aAccessibleChildren.find(i);
if ( m_aAccessibleChildren.end() == aIter )
{
- sal_uInt16 nItemId = pToolBox->GetItemId( i );
- sal_uInt16 nHighlightItemId = pToolBox->GetHighlightItemId();
+ ToolBoxItemId nItemId = pToolBox->GetItemId( i );
+ ToolBoxItemId nHighlightItemId = pToolBox->GetHighlightItemId();
vcl::Window* pItemWindow = pToolBox->GetItemWindow( nItemId );
// not found -> create a new child
rtl::Reference<VCLXAccessibleToolBoxItem> pChild = new VCLXAccessibleToolBoxItem( pToolBox, i );
@@ -711,7 +711,7 @@ Reference< XAccessible > SAL_CALL VCLXAccessibleToolBox::getAccessibleChild( sal
pChild->SetChild( xChild );
}
xChild = pChild;
- if ( nHighlightItemId > 0 && nItemId == nHighlightItemId )
+ if ( nHighlightItemId > ToolBoxItemId(0) && nItemId == nHighlightItemId )
pChild->SetFocus( true );
if ( pToolBox->IsItemChecked( nItemId ) )
pChild->SetChecked( true );
@@ -754,7 +754,7 @@ Reference< XAccessible > VCLXAccessibleToolBox::GetItemWindowAccessible( const V
ToolBox::ImplToolItems::size_type nCount = pToolBox->GetItemCount();
for (ToolBox::ImplToolItems::size_type i = 0 ; i < nCount && !xReturn.is() ; ++i)
{
- sal_uInt16 nItemId = pToolBox->GetItemId( i );
+ ToolBoxItemId nItemId = pToolBox->GetItemId( i );
vcl::Window* pItemWindow = pToolBox->GetItemWindow( nItemId );
if ( pItemWindow == pChildWindow )
xReturn = getAccessibleChild(i);
@@ -819,7 +819,7 @@ sal_Int32 VCLXAccessibleToolBox::getSelectedAccessibleChildCount( )
VclPtr< ToolBox > pToolBox = GetAs< ToolBox >();
if (pToolBox)
{
- sal_uInt16 nHighlightItemId = pToolBox->GetHighlightItemId();
+ ToolBoxItemId nHighlightItemId = pToolBox->GetHighlightItemId();
for ( size_t i = 0, nCount = pToolBox->GetItemCount(); i < nCount; i++ )
{
if ( nHighlightItemId == pToolBox->GetItemId( i ) )
@@ -843,7 +843,7 @@ Reference< XAccessible > VCLXAccessibleToolBox::getSelectedAccessibleChild( sal_
VclPtr< ToolBox > pToolBox = GetAs< ToolBox >();
if (pToolBox)
{
- sal_uInt16 nHighlightItemId = pToolBox->GetHighlightItemId();
+ ToolBoxItemId nHighlightItemId = pToolBox->GetHighlightItemId();
for ( sal_Int32 i = 0, nCount = pToolBox->GetItemCount(); i < nCount; i++ )
{
if ( nHighlightItemId == pToolBox->GetItemId( i ) )
diff --git a/accessibility/source/standard/vclxaccessibletoolboxitem.cxx b/accessibility/source/standard/vclxaccessibletoolboxitem.cxx
index cc613bbe4ec3..211547a7e206 100644
--- a/accessibility/source/standard/vclxaccessibletoolboxitem.cxx
+++ b/accessibility/source/standard/vclxaccessibletoolboxitem.cxx
@@ -118,7 +118,7 @@ OUString VCLXAccessibleToolBoxItem::GetText()
{
OUString sRet;
// no text for separators and spaces
- if ( m_pToolBox && m_nItemId > 0 )
+ if ( m_pToolBox && m_nItemId > ToolBoxItemId(0) )
{
sRet = m_pToolBox->GetItemText( m_nItemId );
if (sRet.isEmpty())
@@ -498,7 +498,7 @@ sal_Int32 SAL_CALL VCLXAccessibleToolBoxItem::getIndexAtPoint( const awt::Point&
sal_Int32 nIndex = -1;
if ( m_pToolBox && m_pToolBox->GetButtonType() != ButtonType::SYMBOLONLY ) // symbol buttons have no character bounds
{
- sal_uInt16 nItemId = 0;
+ ToolBoxItemId nItemId;
tools::Rectangle aItemRect = m_pToolBox->GetItemRect( m_nItemId );
Point aPnt( VCLPoint( aPoint ) );
aPnt += aItemRect.TopLeft();
diff --git a/avmedia/source/framework/mediatoolbox.cxx b/avmedia/source/framework/mediatoolbox.cxx
index 5cdde7399afe..74049cf9bf7e 100644
--- a/avmedia/source/framework/mediatoolbox.cxx
+++ b/avmedia/source/framework/mediatoolbox.cxx
@@ -68,7 +68,7 @@ void MediaToolBoxControl_Impl::execute( const MediaItem& rItem )
SFX_IMPL_TOOLBOX_CONTROL( MediaToolBoxControl, ::avmedia::MediaItem );
-MediaToolBoxControl::MediaToolBoxControl( sal_uInt16 nSlotId, sal_uInt16 nId, ToolBox& rTbx ) :
+MediaToolBoxControl::MediaToolBoxControl( sal_uInt16 nSlotId, ToolBoxItemId nId, ToolBox& rTbx ) :
SfxToolBoxControl( nSlotId, nId, rTbx )
{
rTbx.Invalidate();
diff --git a/basctl/source/basicide/IDEComboBox.cxx b/basctl/source/basicide/IDEComboBox.cxx
index 5063eb4f45a9..cff0e58a206e 100644
--- a/basctl/source/basicide/IDEComboBox.cxx
+++ b/basctl/source/basicide/IDEComboBox.cxx
@@ -59,7 +59,7 @@ using namespace ::com::sun::star::uno;
*/
SFX_IMPL_TOOLBOX_CONTROL(LibBoxControl, SfxStringItem);
-LibBoxControl::LibBoxControl(sal_uInt16 nSlotId, sal_uInt16 nId, ToolBox& rTbx)
+LibBoxControl::LibBoxControl(sal_uInt16 nSlotId, ToolBoxItemId nId, ToolBox& rTbx)
: SfxToolBoxControl(nSlotId, nId, rTbx)
{
}
@@ -359,7 +359,7 @@ void LibBox::ClearBox()
*/
SFX_IMPL_TOOLBOX_CONTROL(LanguageBoxControl, SfxStringItem);
-LanguageBoxControl::LanguageBoxControl(sal_uInt16 nSlotId, sal_uInt16 nId, ToolBox& rTbx)
+LanguageBoxControl::LanguageBoxControl(sal_uInt16 nSlotId, ToolBoxItemId nId, ToolBox& rTbx)
: SfxToolBoxControl(nSlotId, nId, rTbx)
{
}
diff --git a/basctl/source/inc/IDEComboBox.hxx b/basctl/source/inc/IDEComboBox.hxx
index 76d73cdf8eec..1420feecd2d5 100644
--- a/basctl/source/inc/IDEComboBox.hxx
+++ b/basctl/source/inc/IDEComboBox.hxx
@@ -52,7 +52,7 @@ public:
* @param nId -- this item's unique id in ToolBox
* @param rTbx -- the ToolBox which contains this ComboBox
*/
- LibBoxControl(sal_uInt16 nSlotId, sal_uInt16 nId, ToolBox& rTbx);
+ LibBoxControl(sal_uInt16 nSlotId, ToolBoxItemId nId, ToolBox& rTbx);
/*!
* Triggered if state was changed
@@ -198,7 +198,7 @@ public:
* @param nId -- this item's unique id in ToolBox
* @param rTbx -- the ToolBox which contains this ComboBox
*/
- LanguageBoxControl(sal_uInt16 nSlotId, sal_uInt16 nId, ToolBox& rTbx);
+ LanguageBoxControl(sal_uInt16 nSlotId, ToolBoxItemId nId, ToolBox& rTbx);
/*!
* Triggered if state was changed
diff --git a/dbaccess/source/ui/browser/unodatbr.cxx b/dbaccess/source/ui/browser/unodatbr.cxx
index 3e934309c2e9..be857da0de9c 100644
--- a/dbaccess/source/ui/browser/unodatbr.cxx
+++ b/dbaccess/source/ui/browser/unodatbr.cxx
@@ -1290,8 +1290,8 @@ void SbaTableQueryBrowser::implCheckExternalSlot( sal_uInt16 _nId )
if ( pToolbox )
{
bool bHaveDispatcher = m_aExternalFeatures[ _nId ].xDispatcher.is();
- if ( bHaveDispatcher != pToolbox->IsItemVisible( _nId ) )
- bHaveDispatcher ? pToolbox->ShowItem( _nId ) : pToolbox->HideItem( _nId );
+ if ( bHaveDispatcher != pToolbox->IsItemVisible( ToolBoxItemId(_nId) ) )
+ bHaveDispatcher ? pToolbox->ShowItem( ToolBoxItemId(_nId) ) : pToolbox->HideItem( ToolBoxItemId(_nId) );
}
// and invalidate this feature in general
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);
};
diff --git a/forms/source/solar/control/navtoolbar.cxx b/forms/source/solar/control/navtoolbar.cxx
index e6497a8ea939..475038b8391d 100644
--- a/forms/source/solar/control/navtoolbar.cxx
+++ b/forms/source/solar/control/navtoolbar.cxx
@@ -123,12 +123,13 @@ namespace frm
{
if ( m_pDispatcher )
{
- if ( !m_pDispatcher->isEnabled( GetCurItemId() ) )
+ sal_Int16 nFeatureId = sal_uInt16(GetCurItemId());
+ if ( !m_pDispatcher->isEnabled( nFeatureId ) )
// the toolbox is a little bit buggy: With ToolBoxItemBits::REPEAT, it sometimes
// happens that a select is reported, even though the respective
// item has just been disabled.
return;
- m_pDispatcher->dispatch( GetCurItemId() );
+ m_pDispatcher->dispatch( nFeatureId );
}
}
@@ -165,7 +166,7 @@ namespace frm
m_pToolbar->setDispatcher( _pDispatcher );
- RecordPositionInput* pPositionWindow = static_cast< RecordPositionInput* >( m_pToolbar->GetItemWindow( FormFeature::MoveAbsolute ) );
+ RecordPositionInput* pPositionWindow = static_cast< RecordPositionInput* >( m_pToolbar->GetItemWindow( ToolBoxItemId(FormFeature::MoveAbsolute) ) );
OSL_ENSURE( pPositionWindow, "NavigationToolBar::setDispatcher: can't forward the dispatcher to the position window!" );
if ( pPositionWindow )
pPositionWindow->setDispatcher( _pDispatcher );
@@ -173,7 +174,7 @@ namespace frm
// update feature states
for ( ToolBox::ImplToolItems::size_type nPos = 0; nPos < m_pToolbar->GetItemCount(); ++nPos )
{
- sal_uInt16 nItemId = m_pToolbar->GetItemId( nPos );
+ sal_uInt16 nItemId = sal_uInt16(m_pToolbar->GetItemId( nPos ));
if ( ( nItemId == LID_RECORD_LABEL ) || ( nItemId == LID_RECORD_FILLER ) )
continue;
@@ -186,18 +187,18 @@ namespace frm
void NavigationToolBar::implEnableItem( sal_uInt16 _nItemId, bool _bEnabled )
{
- m_pToolbar->EnableItem( _nItemId, _bEnabled );
+ m_pToolbar->EnableItem( ToolBoxItemId(_nItemId), _bEnabled );
if ( _nItemId == FormFeature::MoveAbsolute )
- m_pToolbar->EnableItem( LID_RECORD_LABEL, _bEnabled );
+ m_pToolbar->EnableItem( ToolBoxItemId(LID_RECORD_LABEL), _bEnabled );
if ( _nItemId == FormFeature::TotalRecords )
- m_pToolbar->EnableItem( LID_RECORD_FILLER, _bEnabled );
+ m_pToolbar->EnableItem( ToolBoxItemId(LID_RECORD_FILLER), _bEnabled );
}
void NavigationToolBar::enableFeature( sal_Int16 _nFeatureId, bool _bEnabled )
{
- DBG_ASSERT( m_pToolbar->GetItemPos( static_cast<sal_uInt16>(_nFeatureId) ) != ToolBox::ITEM_NOTFOUND,
+ DBG_ASSERT( m_pToolbar->GetItemPos( ToolBoxItemId(_nFeatureId) ) != ToolBox::ITEM_NOTFOUND,
"NavigationToolBar::enableFeature: invalid id!" );
implEnableItem( static_cast<sal_uInt16>(_nFeatureId), _bEnabled );
@@ -205,18 +206,18 @@ namespace frm
void NavigationToolBar::checkFeature( sal_Int16 _nFeatureId, bool _bEnabled )
{
- DBG_ASSERT( m_pToolbar->GetItemPos( static_cast<sal_uInt16>(_nFeatureId) ) != ToolBox::ITEM_NOTFOUND,
+ DBG_ASSERT( m_pToolbar->GetItemPos( ToolBoxItemId(_nFeatureId) ) != ToolBox::ITEM_NOTFOUND,
"NavigationToolBar::checkFeature: invalid id!" );
- m_pToolbar->CheckItem( static_cast<sal_uInt16>(_nFeatureId), _bEnabled );
+ m_pToolbar->CheckItem( ToolBoxItemId(_nFeatureId), _bEnabled );
}
void NavigationToolBar::setFeatureText( sal_Int16 _nFeatureId, const OUString& _rText )
{
- DBG_ASSERT( m_pToolbar->GetItemPos( static_cast<sal_uInt16>(_nFeatureId) ) != ToolBox::ITEM_NOTFOUND,
+ DBG_ASSERT( m_pToolbar->GetItemPos( ToolBoxItemId(_nFeatureId) ) != ToolBox::ITEM_NOTFOUND,
"NavigationToolBar::checkFeature: invalid id!" );
- vcl::Window* pItemWindow = m_pToolbar->GetItemWindow( static_cast<sal_uInt16>(_nFeatureId) );
+ vcl::Window* pItemWindow = m_pToolbar->GetItemWindow( ToolBoxItemId(_nFeatureId) );
if ( pItemWindow )
{
if (_nFeatureId == FormFeature::TotalRecords)
@@ -225,7 +226,7 @@ namespace frm
static_cast<RecordPositionInput*>(pItemWindow)->set_text(_rText);
}
else
- m_pToolbar->SetItemText( static_cast<sal_uInt16>(_nFeatureId), _rText );
+ m_pToolbar->SetItemText( ToolBoxItemId(_nFeatureId), _rText );
}
void NavigationToolBar::implInit( )
@@ -277,15 +278,15 @@ namespace frm
{ // it's _not_ a separator
// insert the entry
- m_pToolbar->InsertItem( pSupportedFeatures->nId, OUString(), pSupportedFeatures->bRepeat ? ToolBoxItemBits::REPEAT : ToolBoxItemBits::NONE );
- m_pToolbar->SetQuickHelpText( pSupportedFeatures->nId, OUString() ); // TODO
+ m_pToolbar->InsertItem( ToolBoxItemId(pSupportedFeatures->nId), OUString(), pSupportedFeatures->bRepeat ? ToolBoxItemBits::REPEAT : ToolBoxItemBits::NONE );
+ m_pToolbar->SetQuickHelpText( ToolBoxItemId(pSupportedFeatures->nId), OUString() ); // TODO
if ( !isArtificialItem( pSupportedFeatures->nId ) )
{
OUString sCommandURL( lcl_getCommandURL( pSupportedFeatures->nId ) );
- m_pToolbar->SetItemCommand( pSupportedFeatures->nId, sCommandURL );
+ m_pToolbar->SetItemCommand( ToolBoxItemId(pSupportedFeatures->nId), sCommandURL );
auto aProperties = vcl::CommandInfoProvider::GetCommandProperties(sCommandURL, m_sModuleId);
- m_pToolbar->SetQuickHelpText(pSupportedFeatures->nId,
+ m_pToolbar->SetQuickHelpText(ToolBoxItemId(pSupportedFeatures->nId),
vcl::CommandInfoProvider::GetLabelForCommand(aProperties));
}
@@ -305,7 +306,7 @@ namespace frm
pItemWindow = VclPtr<LabelItemWindow>::Create(m_pToolbar, "");
m_aChildWins.emplace_back(pItemWindow );
- m_pToolbar->SetItemWindow( pSupportedFeatures->nId, pItemWindow );
+ m_pToolbar->SetItemWindow( ToolBoxItemId(pSupportedFeatures->nId), pItemWindow );
}
}
else
@@ -334,9 +335,9 @@ namespace frm
for ( ToolBox::ImplToolItems::size_type i=0; i<nItemCount; ++i )
{
- sal_uInt16 nId = m_pToolbar->GetItemId( i );
- if ( ( ToolBoxItemType::BUTTON == m_pToolbar->GetItemType( i ) ) && !isArtificialItem( nId ) )
- aFormFeatures.push_back( nId );
+ ToolBoxItemId nId = m_pToolbar->GetItemId( i );
+ if ( ( ToolBoxItemType::BUTTON == m_pToolbar->GetItemType( i ) ) && !isArtificialItem( sal_uInt16(nId) ) )
+ aFormFeatures.push_back( sal_uInt16(nId) );
}
// translate them into command URLs
@@ -352,9 +353,9 @@ namespace frm
// and set them at the toolbar
auto commandImage = aCommandImages.begin();
- for (auto const& formFeature : aFormFeatures)
+ for (sal_Int16 formFeature : aFormFeatures)
{
- m_pToolbar->SetItemImage( formFeature, *commandImage );
+ m_pToolbar->SetItemImage( ToolBoxItemId(formFeature), *commandImage );
++commandImage;
}
@@ -423,7 +424,7 @@ namespace frm
if ( pGroupIds )
while ( *pGroupIds )
- m_pToolbar->ShowItem( *pGroupIds++, _bShow );
+ m_pToolbar->ShowItem( ToolBoxItemId(*pGroupIds++), _bShow );
}
@@ -440,7 +441,7 @@ namespace frm
OSL_FAIL( "NavigationToolBar::IsFunctionGroupVisible: invalid group id!" );
}
- return m_pToolbar->IsItemVisible( nIndicatorItem );
+ return m_pToolbar->IsItemVisible( ToolBoxItemId(nIndicatorItem) );
}
@@ -526,10 +527,10 @@ namespace frm
{
for ( ToolBox::ImplToolItems::size_type item = 0; item < m_pToolbar->GetItemCount(); ++item )
{
- sal_uInt16 nItemId = m_pToolbar->GetItemId( item );
+ ToolBoxItemId nItemId = m_pToolbar->GetItemId( item );
vcl::Window* pItemWindow = m_pToolbar->GetItemWindow( nItemId );
if ( pItemWindow )
- (this->*_handler)( nItemId, pItemWindow );
+ (this->*_handler)( sal_uInt16(nItemId), pItemWindow );
}
}
@@ -537,10 +538,10 @@ namespace frm
{
for ( ToolBox::ImplToolItems::size_type item = 0; item < m_pToolbar->GetItemCount(); ++item )
{
- sal_uInt16 nItemId = m_pToolbar->GetItemId( item );
+ ToolBoxItemId nItemId = m_pToolbar->GetItemId( item );
vcl::Window* pItemWindow = m_pToolbar->GetItemWindow( nItemId );
if ( pItemWindow )
- (*_handler)( nItemId, pItemWindow, _pParam );
+ (*_handler)( sal_uInt16(nItemId), pItemWindow, _pParam );
}
}
@@ -609,7 +610,7 @@ namespace frm
aSize.AdjustWidth(6 );
_pItemWindow->SetSizePixel( aSize );
- m_pToolbar->SetItemWindow( _nItemId, _pItemWindow );
+ m_pToolbar->SetItemWindow( ToolBoxItemId(_nItemId), _pItemWindow );
}
void NavigationToolBar::enableItemRTL( sal_uInt16 /*_nItemId*/, vcl::Window* _pItemWindow, const void* _pIsRTLEnabled )
diff --git a/framework/inc/uielement/FixedImageToolbarController.hxx b/framework/inc/uielement/FixedImageToolbarController.hxx
index 66533fbc9cde..30359a051b20 100644
--- a/framework/inc/uielement/FixedImageToolbarController.hxx
+++ b/framework/inc/uielement/FixedImageToolbarController.hxx
@@ -36,7 +36,7 @@ class FixedImageToolbarController final : public ComplexToolbarController
public:
FixedImageToolbarController(const css::uno::Reference<css::uno::XComponentContext>& rxContext,
const css::uno::Reference<css::frame::XFrame>& rFrame,
- ToolBox* pToolBar, sal_uInt16 nID, const OUString& aCommand);
+ ToolBox* pToolBar, ToolBoxItemId nID, const OUString& aCommand);
// XComponent
virtual void SAL_CALL dispose() override;
diff --git a/framework/inc/uielement/FixedTextToolbarController.hxx b/framework/inc/uielement/FixedTextToolbarController.hxx
index 3d257414b6d2..b51d0de53654 100644
--- a/framework/inc/uielement/FixedTextToolbarController.hxx
+++ b/framework/inc/uielement/FixedTextToolbarController.hxx
@@ -36,7 +36,7 @@ class FixedTextToolbarController final : public ComplexToolbarController
public:
FixedTextToolbarController(const css::uno::Reference<css::uno::XComponentContext>& rxContext,
const css::uno::Reference<css::frame::XFrame>& rFrame,
- ToolBox* pToolBar, sal_uInt16 nID, const OUString& aCommand);
+ ToolBox* pToolBar, ToolBoxItemId nID, const OUString& aCommand);
// XComponent
virtual void SAL_CALL dispose() override;
diff --git a/framework/inc/uielement/comboboxtoolbarcontroller.hxx b/framework/inc/uielement/comboboxtoolbarcontroller.hxx
index 8dcf79b03510..4762d595ace9 100644
--- a/framework/inc/uielement/comboboxtoolbarcontroller.hxx
+++ b/framework/inc/uielement/comboboxtoolbarcontroller.hxx
@@ -36,7 +36,7 @@ class ComboboxToolbarController final : public ComplexToolbarController
ComboboxToolbarController( const css::uno::Reference< css::uno::XComponentContext >& rxContext,
const css::uno::Reference< css::frame::XFrame >& rFrame,
ToolBox* pToolBar,
- sal_uInt16 nID,
+ ToolBoxItemId nID,
sal_Int32 nWidth,
const OUString& aCommand );
virtual ~ComboboxToolbarController() override;
diff --git a/framework/inc/uielement/commandinfo.hxx b/framework/inc/uielement/commandinfo.hxx
index b2c7c3e880a9..de3bee8ee88f 100644
--- a/framework/inc/uielement/commandinfo.hxx
+++ b/framework/inc/uielement/commandinfo.hxx
@@ -21,6 +21,7 @@
#define INCLUDED_FRAMEWORK_INC_UIELEMENT_COMMANDINFO_HXX
#include <rtl/ustring.hxx>
+#include <vcl/toolbox.hxx>
#include <unordered_map>
#include <vector>
@@ -33,8 +34,8 @@ struct CommandInfo
CommandInfo() : nId( 0 ),
nImageInfo( 0 ) {}
- sal_uInt16 nId;
- ::std::vector< sal_uInt16 > aIds;
+ ToolBoxItemId nId;
+ ::std::vector< ToolBoxItemId > aIds;
sal_Int16 nImageInfo;
};
diff --git a/framework/inc/uielement/complextoolbarcontroller.hxx b/framework/inc/uielement/complextoolbarcontroller.hxx
index 5036943299e9..5855d2cb41b3 100644
--- a/framework/inc/uielement/complextoolbarcontroller.hxx
+++ b/framework/inc/uielement/complextoolbarcontroller.hxx
@@ -43,7 +43,7 @@ class ComplexToolbarController : public svt::ToolboxController
ComplexToolbarController( const css::uno::Reference< css::uno::XComponentContext >& rxContext,
const css::uno::Reference< css::frame::XFrame >& rFrame,
ToolBox* pToolBar,
- sal_uInt16 nID,
+ ToolBoxItemId nID,
const OUString& aCommand );
virtual ~ComplexToolbarController() override;
@@ -88,7 +88,7 @@ class ComplexToolbarController : public svt::ToolboxController
void notifyTextChanged( const OUString& aText );
VclPtr<ToolBox> m_xToolbar;
- sal_uInt16 m_nID;
+ ToolBoxItemId m_nID;
bool m_bMadeInvisible;
mutable css::util::URL m_aURL;
css::uno::Reference< css::util::XURLTransformer > m_xURLTransformer;
diff --git a/framework/inc/uielement/dropdownboxtoolbarcontroller.hxx b/framework/inc/uielement/dropdownboxtoolbarcontroller.hxx
index eb95c142cef3..d9f1664dfc87 100644
--- a/framework/inc/uielement/dropdownboxtoolbarcontroller.hxx
+++ b/framework/inc/uielement/dropdownboxtoolbarcontroller.hxx
@@ -39,7 +39,7 @@ class DropdownToolbarController final : public ComplexToolbarController
DropdownToolbarController( const css::uno::Reference< css::uno::XComponentContext >& rxContext,
const css::uno::Reference< css::frame::XFrame >& rFrame,
ToolBox* pToolBar,
- sal_uInt16 nID,
+ ToolBoxItemId nID,
sal_Int32 nWidth,
const OUString& aCommand );
virtual ~DropdownToolbarController() override;
diff --git a/framework/inc/uielement/edittoolbarcontroller.hxx b/framework/inc/uielement/edittoolbarcontroller.hxx
index 21e7f6935f6d..e7acaafe8aae 100644
--- a/framework/inc/uielement/edittoolbarcontroller.hxx
+++ b/framework/inc/uielement/edittoolbarcontroller.hxx
@@ -38,7 +38,7 @@ class EditToolbarController final : public ComplexToolbarController
EditToolbarController( const css::uno::Reference< css::uno::XComponentContext >& rxContext,
const css::uno::Reference< css::frame::XFrame >& rFrame,
ToolBox* pToolBar,
- sal_uInt16 nID,
+ ToolBoxItemId nID,
sal_Int32 nWidth,
const OUString& aCommand );
virtual ~EditToolbarController() override;
diff --git a/framework/inc/uielement/imagebuttontoolbarcontroller.hxx b/framework/inc/uielement/imagebuttontoolbarcontroller.hxx
index 9b625059717f..0888e390b037 100644
--- a/framework/inc/uielement/imagebuttontoolbarcontroller.hxx
+++ b/framework/inc/uielement/imagebuttontoolbarcontroller.hxx
@@ -37,7 +37,7 @@ class ImageButtonToolbarController final : public ComplexToolbarController
ImageButtonToolbarController( const css::uno::Reference< css::uno::XComponentContext >& rxContext,
const css::uno::Reference< css::frame::XFrame >& rFrame,
ToolBox* pToolBar,
- sal_uInt16 nID,
+ ToolBoxItemId nID,
const OUString& aCommand );
virtual ~ImageButtonToolbarController() override;
diff --git a/framework/inc/uielement/spinfieldtoolbarcontroller.hxx b/framework/inc/uielement/spinfieldtoolbarcontroller.hxx
index beb95049a206..80a0d26ebdc0 100644
--- a/framework/inc/uielement/spinfieldtoolbarcontroller.hxx
+++ b/framework/inc/uielement/spinfieldtoolbarcontroller.hxx
@@ -39,7 +39,7 @@ class SpinfieldToolbarController final : public ComplexToolbarController
SpinfieldToolbarController( const css::uno::Reference< css::uno::XComponentContext >& rxContext,
const css::uno::Reference< css::frame::XFrame >& rFrame,
ToolBox* pToolBar,
- sal_uInt16 nID,
+ ToolBoxItemId nID,
sal_Int32 nWidth,
const OUString& aCommand );
virtual ~SpinfieldToolbarController() override;
diff --git a/framework/inc/uielement/togglebuttontoolbarcontroller.hxx b/framework/inc/uielement/togglebuttontoolbarcontroller.hxx
index 9e667da83ba0..aeab78785556 100644
--- a/framework/inc/uielement/togglebuttontoolbarcontroller.hxx
+++ b/framework/inc/uielement/togglebuttontoolbarcontroller.hxx
@@ -51,7 +51,7 @@ class ToggleButtonToolbarController final : public ComplexToolbarController
ToggleButtonToolbarController( const css::uno::Reference< css::uno::XComponentContext >& rxContext,
const css::uno::Reference< css::frame::XFrame >& rFrame,
ToolBox* pToolBar,
- sal_uInt16 nID,
+ ToolBoxItemId nID,
Style eStyle,
const OUString& aCommand );
virtual ~ToggleButtonToolbarController() override;
diff --git a/framework/inc/uielement/toolbarmanager.hxx b/framework/inc/uielement/toolbarmanager.hxx
index d77ae16312aa..3b5e37d8dbb0 100644
--- a/framework/inc/uielement/toolbarmanager.hxx
+++ b/framework/inc/uielement/toolbarmanager.hxx
@@ -41,6 +41,7 @@
#include <tools/link.hxx>
#include <vcl/window.hxx>
#include <vcl/timer.hxx>
+#include <vcl/toolbox.hxx>
#include <unordered_map>
@@ -141,7 +142,7 @@ class ToolBarManager final : public ToolbarManager_Base
void setToolBarImage(const Image& _aImage,const CommandToInfoMap::const_iterator& _pIter);
void impl_elementChanged(bool _bRemove,const css::ui::ConfigurationEvent& Event );
- typedef std::unordered_map< sal_uInt16, css::uno::Reference< css::frame::XStatusListener > > ToolBarControllerMap;
+ typedef std::unordered_map< ToolBoxItemId, css::uno::Reference< css::frame::XStatusListener > > ToolBarControllerMap;
typedef ::std::vector< css::uno::Reference< css::frame::XSubToolbarController > > SubToolBarControllerVector;
typedef std::unordered_map<OUString, SubToolBarControllerVector> SubToolBarToSubToolBarControllerMap;
diff --git a/framework/inc/uielement/toolbarmerger.hxx b/framework/inc/uielement/toolbarmerger.hxx
index bd07bb17e7e4..01defd7b2e0f 100644
--- a/framework/inc/uielement/toolbarmerger.hxx
+++ b/framework/inc/uielement/toolbarmerger.hxx
@@ -81,7 +81,7 @@ class ToolBarMerger
static bool ProcessMergeOperation( ToolBox* pToolbar,
ToolBox::ImplToolItems::size_type nPos,
- sal_uInt16& rItemId,
+ ToolBoxItemId& rItemId,
CommandToInfoMap& rCommandMap,
std::u16string_view rModuleIdentifier,
std::u16string_view rMergeCommand,
@@ -89,7 +89,7 @@ class ToolBarMerger
const AddonToolbarItemContainer& rItems );
static bool ProcessMergeFallback( ToolBox* pToolbar,
- sal_uInt16& rItemId,
+ ToolBoxItemId& rItemId,
CommandToInfoMap& rCommandMap,
std::u16string_view rModuleIdentifier,
std::u16string_view rMergeCommand,
@@ -99,14 +99,14 @@ class ToolBarMerger
static void MergeItems( ToolBox* pToolbar,
ToolBox::ImplToolItems::size_type nPos,
sal_uInt16 nModIndex,
- sal_uInt16& rItemId,
+ ToolBoxItemId& rItemId,
CommandToInfoMap& rCommandMap,
std::u16string_view rModuleIdentifier,
const AddonToolbarItemContainer& rAddonToolbarItems );
static void ReplaceItem( ToolBox* pToolbar,
ToolBox::ImplToolItems::size_type nPos,
- sal_uInt16& rItemId,
+ ToolBoxItemId& rItemId,
CommandToInfoMap& rCommandMap,
std::u16string_view rModuleIdentifier,
const AddonToolbarItemContainer& rAddonToolbarItems );
@@ -120,13 +120,13 @@ class ToolBarMerger
const css::uno::Reference< css::frame::XFrame > & xFrame,
ToolBox* pToolbar,
const OUString& rCommandURL,
- sal_uInt16 nId,
+ ToolBoxItemId nId,
sal_uInt16 nWidth,
std::u16string_view rControlType );
static void CreateToolbarItem( ToolBox* pToolbox,
ToolBox::ImplToolItems::size_type nPos,
- sal_uInt16 nItemId,
+ ToolBoxItemId nItemId,
const AddonToolbarItem& rAddonToolbarItem );
private:
diff --git a/framework/source/fwe/classes/sfxhelperfunctions.cxx b/framework/source/fwe/classes/sfxhelperfunctions.cxx
index c96791c2f422..e456a7a42460 100644
--- a/framework/source/fwe/classes/sfxhelperfunctions.cxx
+++ b/framework/source/fwe/classes/sfxhelperfunctions.cxx
@@ -43,7 +43,7 @@ pfunc_setToolBoxControllerCreator SetToolBoxControllerCreator( pfunc_setToolBoxC
return pOldSetToolBoxControllerCreator;
}
-rtl::Reference<svt::ToolboxController> CreateToolBoxController( const Reference< XFrame >& rFrame, ToolBox* pToolbox, unsigned short nID, const OUString& aCommandURL )
+rtl::Reference<svt::ToolboxController> CreateToolBoxController( const Reference< XFrame >& rFrame, ToolBox* pToolbox, ToolBoxItemId nID, const OUString& aCommandURL )
{
pfunc_setToolBoxControllerCreator pFactory = nullptr;
{
diff --git a/framework/source/layoutmanager/toolbarlayoutmanager.cxx b/framework/source/layoutmanager/toolbarlayoutmanager.cxx
index 1f46f09e2274..9f79f0ac7a14 100644
--- a/framework/source/layoutmanager/toolbarlayoutmanager.cxx
+++ b/framework/source/layoutmanager/toolbarlayoutmanager.cxx
@@ -923,8 +923,8 @@ void ToolbarLayoutManager::childWindowEvent( VclSimpleEvent const * pEvent )
if ( pToolBox )
{
aToolbarName = retrieveToolbarNameFromHelpURL( pToolBox );
- sal_uInt16 nId = pToolBox->GetCurItemId();
- if ( nId > 0 )
+ ToolBoxItemId nId = pToolBox->GetCurItemId();
+ if ( nId > ToolBoxItemId(0) )
aCommand = pToolBox->GetItemCommand( nId );
}
diff --git a/framework/source/uielement/FixedImageToolbarController.cxx b/framework/source/uielement/FixedImageToolbarController.cxx
index 49377db5e555..303913432cd1 100644
--- a/framework/source/uielement/FixedImageToolbarController.cxx
+++ b/framework/source/uielement/FixedImageToolbarController.cxx
@@ -80,7 +80,7 @@ void FixedImageControl::dispose()
FixedImageToolbarController::FixedImageToolbarController(
const Reference<XComponentContext>& rxContext, const Reference<XFrame>& rFrame,
- ToolBox* pToolbar, sal_uInt16 nID, const OUString& rCommand)
+ ToolBox* pToolbar, ToolBoxItemId nID, const OUString& rCommand)
: ComplexToolbarController(rxContext, rFrame, pToolbar, nID, rCommand)
, m_eSymbolSize(SvtMiscOptions().GetCurrentSymbolsSize())
{
diff --git a/framework/source/uielement/FixedTextToolbarController.cxx b/framework/source/uielement/FixedTextToolbarController.cxx
index 32b486379178..36a1061aa86f 100644
--- a/framework/source/uielement/FixedTextToolbarController.cxx
+++ b/framework/source/uielement/FixedTextToolbarController.cxx
@@ -71,7 +71,7 @@ void FixedTextControl::dispose()
FixedTextToolbarController::FixedTextToolbarController(
const Reference<XComponentContext>& rxContext, const Reference<XFrame>& rFrame,
- ToolBox* pToolbar, sal_uInt16 nID, const OUString& aCommand)
+ ToolBox* pToolbar, ToolBoxItemId nID, const OUString& aCommand)
: ComplexToolbarController(rxContext, rFrame, pToolbar, nID, aCommand)
{
m_pFixedTextControl = VclPtr<FixedTextControl>::Create(m_xToolbar);
diff --git a/framework/source/uielement/comboboxtoolbarcontroller.cxx b/framework/source/uielement/comboboxtoolbarcontroller.cxx
index 745b25d2cf99..a54c78d0d774 100644
--- a/framework/source/uielement/comboboxtoolbarcontroller.cxx
+++ b/framework/source/uielement/comboboxtoolbarcontroller.cxx
@@ -145,7 +145,7 @@ ComboboxToolbarController::ComboboxToolbarController(
const Reference< XComponentContext >& rxContext,
const Reference< XFrame >& rFrame,
ToolBox* pToolbar,
- sal_uInt16 nID,
+ ToolBoxItemId nID,
sal_Int32 nWidth,
const OUString& aCommand ) :
ComplexToolbarController( rxContext, rFrame, pToolbar, nID, aCommand )
diff --git a/framework/source/uielement/complextoolbarcontroller.cxx b/framework/source/uielement/complextoolbarcontroller.cxx
index b62febf87663..743306590056 100644
--- a/framework/source/uielement/complextoolbarcontroller.cxx
+++ b/framework/source/uielement/complextoolbarcontroller.cxx
@@ -49,7 +49,7 @@ ComplexToolbarController::ComplexToolbarController(
const Reference< XComponentContext >& rxContext,
const Reference< XFrame >& rFrame,
ToolBox* pToolbar,
- sal_uInt16 nID,
+ ToolBoxItemId nID,
const OUString& aCommand ) :
svt::ToolboxController( rxContext, rFrame, aCommand )
, m_xToolbar( pToolbar )
@@ -72,7 +72,7 @@ void SAL_CALL ComplexToolbarController::dispose()
m_xURLTransformer.clear();
m_xToolbar.clear();
- m_nID = 0;
+ m_nID = ToolBoxItemId(0);
}
Sequence<PropertyValue> ComplexToolbarController::getExecuteArgs(sal_Int16 KeyModifier) const
diff --git a/framework/source/uielement/dropdownboxtoolbarcontroller.cxx b/framework/source/uielement/dropdownboxtoolbarcontroller.cxx
index b694bca18ed6..00c14f2b0c7c 100644
--- a/framework/source/uielement/dropdownboxtoolbarcontroller.cxx
+++ b/framework/source/uielement/dropdownboxtoolbarcontroller.cxx
@@ -122,7 +122,7 @@ DropdownToolbarController::DropdownToolbarController(
const Reference< XComponentContext >& rxContext,
const Reference< XFrame >& rFrame,
ToolBox* pToolbar,
- sal_uInt16 nID,
+ ToolBoxItemId nID,
sal_Int32 nWidth,
const OUString& aCommand ) :
ComplexToolbarController( rxContext, rFrame, pToolbar, nID, aCommand )
diff --git a/framework/source/uielement/edittoolbarcontroller.cxx b/framework/source/uielement/edittoolbarcontroller.cxx
index 3bbb3f9755cc..8bde909c703d 100644
--- a/framework/source/uielement/edittoolbarcontroller.cxx
+++ b/framework/source/uielement/edittoolbarcontroller.cxx
@@ -127,7 +127,7 @@ EditToolbarController::EditToolbarController(
const Reference< XComponentContext >& rxContext,
const Reference< XFrame >& rFrame,
ToolBox* pToolbar,
- sal_uInt16 nID,
+ ToolBoxItemId nID,
sal_Int32 nWidth,
const OUString& aCommand ) :
ComplexToolbarController( rxContext, rFrame, pToolbar, nID, aCommand )
diff --git a/framework/source/uielement/generictoolbarcontroller.cxx b/framework/source/uielement/generictoolbarcontroller.cxx
index 31c22d03bbb1..004fcf80ce78 100644
--- a/framework/source/uielement/generictoolbarcontroller.cxx
+++ b/framework/source/uielement/generictoolbarcontroller.cxx
@@ -82,7 +82,7 @@ static OUString getMasterCommand( const OUString& rCommand )
GenericToolbarController::GenericToolbarController( const Reference< XComponentContext >& rxContext,
const Reference< XFrame >& rFrame,
ToolBox* pToolbar,
- sal_uInt16 nID,
+ ToolBoxItemId nID,
const OUString& aCommand ) :
svt::ToolboxController( rxContext, rFrame, aCommand )
, m_xToolbar( pToolbar )
@@ -104,7 +104,7 @@ GenericToolbarController::GenericToolbarController( const Reference< XComponentC
const Reference< XFrame >& rFrame,
weld::Toolbar& rToolbar,
const OUString& aCommand ) :
- GenericToolbarController( rxContext, rFrame, nullptr, 0, aCommand )
+ GenericToolbarController( rxContext, rFrame, nullptr, ToolBoxItemId(0), aCommand )
{
m_pToolbar = &rToolbar;
}
@@ -121,7 +121,7 @@ void SAL_CALL GenericToolbarController::dispose()
m_pToolbar = nullptr;
m_xToolbar.clear();
- m_nID = 0;
+ m_nID = ToolBoxItemId(0);
}
void SAL_CALL GenericToolbarController::execute( sal_Int16 KeyModifier )
diff --git a/framework/source/uielement/imagebuttontoolbarcontroller.cxx b/framework/source/uielement/imagebuttontoolbarcontroller.cxx
index 19107d374019..e03a3cbc156a 100644
--- a/framework/source/uielement/imagebuttontoolbarcontroller.cxx
+++ b/framework/source/uielement/imagebuttontoolbarcontroller.cxx
@@ -57,7 +57,7 @@ ImageButtonToolbarController::ImageButtonToolbarController(
const Reference< XComponentContext >& rxContext,
const Reference< XFrame >& rFrame,
ToolBox* pToolbar,
- sal_uInt16 nID,
+ ToolBoxItemId nID,
const OUString& aCommand ) :
ComplexToolbarController( rxContext, rFrame, pToolbar, nID, aCommand )
{
diff --git a/framework/source/uielement/popuptoolbarcontroller.cxx b/framework/source/uielement/popuptoolbarcontroller.cxx
index 51fcd4f4ee13..7048778029e4 100644
--- a/framework/source/uielement/popuptoolbarcontroller.cxx
+++ b/framework/source/uielement/popuptoolbarcontroller.cxx
@@ -150,7 +150,7 @@ void SAL_CALL PopupMenuToolbarController::initialize(
SolarMutexGuard aSolarLock;
ToolBox* pToolBox = nullptr;
- sal_uInt16 nItemId = 0;
+ ToolBoxItemId nItemId;
if ( getToolboxId( nItemId, &pToolBox ) )
{
ToolBoxItemBits nCurStyle( pToolBox->GetItemBits( nItemId ) );
@@ -169,7 +169,7 @@ void SAL_CALL PopupMenuToolbarController::statusChanged( const css::frame::Featu
return;
ToolBox* pToolBox = nullptr;
- sal_uInt16 nItemId = 0;
+ ToolBoxItemId nItemId;
if ( getToolboxId( nItemId, &pToolBox ) )
{
SolarMutexGuard aSolarLock;
@@ -355,7 +355,7 @@ void GenericPopupToolbarController::statusChanged( const css::frame::FeatureStat
Menu* pVclMenu = comphelper::getUnoTunnelImplementation<VCLXMenu>( m_xPopupMenu )->GetMenu();
ToolBox* pToolBox = nullptr;
- sal_uInt16 nId = 0;
+ ToolBoxItemId nId;
if ( getToolboxId( nId, &pToolBox ) && pToolBox->IsItemEnabled( nId ) )
{
pVclMenu->Activate();
@@ -389,7 +389,7 @@ void GenericPopupToolbarController::functionExecuted( const OUString& rCommand )
addStatusListener( m_aCommandURL );
ToolBox* pToolBox = nullptr;
- sal_uInt16 nId = 0;
+ ToolBoxItemId nId;
if ( getToolboxId( nId, &pToolBox ) )
{
pToolBox->SetItemCommand( nId, rCommand );
@@ -461,7 +461,7 @@ void SaveToolbarController::initialize( const css::uno::Sequence< css::uno::Any
PopupMenuToolbarController::initialize( aArguments );
ToolBox* pToolBox = nullptr;
- sal_uInt16 nId = 0;
+ ToolBoxItemId nId;
if ( !getToolboxId( nId, &pToolBox ) )
return;
@@ -504,7 +504,7 @@ void SaveToolbarController::updateImage()
{
SolarMutexGuard aGuard;
ToolBox* pToolBox = nullptr;
- sal_uInt16 nId = 0;
+ ToolBoxItemId nId;
if ( !getToolboxId( nId, &pToolBox ) )
return;
@@ -536,7 +536,7 @@ void SaveToolbarController::updateImage()
void SaveToolbarController::statusChanged( const css::frame::FeatureStateEvent& rEvent )
{
ToolBox* pToolBox = nullptr;
- sal_uInt16 nId = 0;
+ ToolBoxItemId nId;
if ( !getToolboxId( nId, &pToolBox ) )
return;
diff --git a/framework/source/uielement/spinfieldtoolbarcontroller.cxx b/framework/source/uielement/spinfieldtoolbarcontroller.cxx
index d76db7516c88..cb5e16194193 100644
--- a/framework/source/uielement/spinfieldtoolbarcontroller.cxx
+++ b/framework/source/uielement/spinfieldtoolbarcontroller.cxx
@@ -168,7 +168,7 @@ SpinfieldToolbarController::SpinfieldToolbarController(
const Reference< XComponentContext >& rxContext,
const Reference< XFrame >& rFrame,
ToolBox* pToolbar,
- sal_uInt16 nID,
+ ToolBoxItemId nID,
sal_Int32 nWidth,
const OUString& aCommand ) :
ComplexToolbarController( rxContext, rFrame, pToolbar, nID, aCommand )
diff --git a/framework/source/uielement/styletoolbarcontroller.cxx b/framework/source/uielement/styletoolbarcontroller.cxx
index a5c2715095ec..05af487ff48f 100644
--- a/framework/source/uielement/styletoolbarcontroller.cxx
+++ b/framework/source/uielement/styletoolbarcontroller.cxx
@@ -220,7 +220,7 @@ void StyleToolbarController::statusChanged( const css::frame::FeatureStateEvent&
throw css::lang::DisposedException();
ToolBox* pToolBox = nullptr;
- sal_uInt16 nItemId = 0;
+ ToolBoxItemId nItemId;
if ( getToolboxId( nItemId, &pToolBox ) )
{
bool bChecked = false;
diff --git a/framework/source/uielement/subtoolbarcontroller.cxx b/framework/source/uielement/subtoolbarcontroller.cxx
index 6dcd8b67404a..489eb135593d 100644
--- a/framework/source/uielement/subtoolbarcontroller.cxx
+++ b/framework/source/uielement/subtoolbarcontroller.cxx
@@ -135,7 +135,7 @@ void SubToolBarController::statusChanged( const css::frame::FeatureStateEvent& E
return;
ToolBox* pToolBox = nullptr;
- sal_uInt16 nId = 0;
+ ToolBoxItemId nId;
if ( !getToolboxId( nId, &pToolBox ) )
return;
@@ -196,7 +196,7 @@ css::uno::Reference< css::awt::XWindow > SubToolBarController::createPopupWindow
SolarMutexGuard aGuard;
ToolBox* pToolBox = nullptr;
- sal_uInt16 nId = 0;
+ ToolBoxItemId nId;
if ( getToolboxId( nId, &pToolBox ) )
{
css::uno::Reference< css::frame::XFrame > xFrame ( getFrameInterface() );
@@ -284,7 +284,7 @@ void SubToolBarController::updateImage()
if ( !m_aLastCommand.isEmpty() )
{
ToolBox* pToolBox = nullptr;
- sal_uInt16 nId = 0;
+ ToolBoxItemId nId;
if ( getToolboxId( nId, &pToolBox ) )
{
vcl::ImageType eImageType = pToolBox->GetImageSize();
@@ -400,7 +400,7 @@ void SubToolBarController::initialize( const css::uno::Sequence< css::uno::Any >
svt::ToolboxController::initialize( rxArgs );
ToolBox* pToolBox = nullptr;
- sal_uInt16 nId = 0;
+ ToolBoxItemId nId;
if ( getToolboxId( nId, &pToolBox ) )
{
if ( m_aLastCommand.isEmpty() )
diff --git a/framework/source/uielement/togglebuttontoolbarcontroller.cxx b/framework/source/uielement/togglebuttontoolbarcontroller.cxx
index ee2cb30e9910..77bf14418ca5 100644
--- a/framework/source/uielement/togglebuttontoolbarcontroller.cxx
+++ b/framework/source/uielement/togglebuttontoolbarcontroller.cxx
@@ -38,7 +38,7 @@ ToggleButtonToolbarController::ToggleButtonToolbarController(
const Reference< XComponentContext >& rxContext,
const Reference< XFrame >& rFrame,
ToolBox* pToolbar,
- sal_uInt16 nID,
+ ToolBoxItemId nID,
Style eStyle,
const OUString& aCommand ) :
ComplexToolbarController( rxContext, rFrame, pToolbar, nID, aCommand )
diff --git a/framework/source/uielement/toolbarmanager.cxx b/framework/source/uielement/toolbarmanager.cxx
index d88ba1384f39..c50d25650082 100644
--- a/framework/source/uielement/toolbarmanager.cxx
+++ b/framework/source/uielement/toolbarmanager.cxx
@@ -229,8 +229,8 @@ void ToolBarManager::Destroy()
// Delete the additional add-ons data
for ( ToolBox::ImplToolItems::size_type i = 0; i < m_pToolBar->GetItemCount(); i++ )
{
- sal_uInt16 nItemId = m_pToolBar->GetItemId( i );
- if ( nItemId > 0 )
+ ToolBoxItemId nItemId = m_pToolBar->GetItemId( i );
+ if ( nItemId > ToolBoxItemId(0) )
delete static_cast< AddonsParams* >( m_pToolBar->GetItemData( nItemId ));
}
@@ -604,7 +604,7 @@ void ToolBarManager::impl_elementChanged(bool const isRemove,
void ToolBarManager::setToolBarImage(const Image& rImage,
const CommandToInfoMap::const_iterator& rIter)
{
- const ::std::vector<sal_uInt16>& rIDs = rIter->second.aIds;
+ const ::std::vector<ToolBoxItemId>& rIDs = rIter->second.aIds;
m_pToolBar->SetItemImage( rIter->second.nId, rImage );
for (auto const& it : rIDs)
{
@@ -631,8 +631,8 @@ void ToolBarManager::RemoveControllers()
// dtors where the item window is already invalid!
for ( ToolBox::ImplToolItems::size_type i = 0; i < m_pToolBar->GetItemCount(); i++ )
{
- sal_uInt16 nItemId = m_pToolBar->GetItemId( i );
- if ( nItemId > 0 )
+ ToolBoxItemId nItemId = m_pToolBar->GetItemId( i );
+ if ( nItemId > ToolBoxItemId(0) )
{
Reference< XComponent > xComponent( m_aControllerMap[ nItemId ], UNO_QUERY );
if ( xComponent.is() )
@@ -661,8 +661,8 @@ void ToolBarManager::CreateControllers()
for ( ToolBox::ImplToolItems::size_type i = 0; i < m_pToolBar->GetItemCount(); i++ )
{
- sal_uInt16 nId = m_pToolBar->GetItemId( i );
- if ( nId == 0 )
+ ToolBoxItemId nId = m_pToolBar->GetItemId( i );
+ if ( nId == ToolBoxItemId(0) )
continue;
bool bInit( true );
@@ -710,7 +710,7 @@ void ToolBarManager::CreateControllers()
aPropValue.Value <<= xToolbarWindow;
aPropertyVector.push_back( makeAny( aPropValue ));
aPropValue.Name = "Identifier";
- aPropValue.Value <<= nId;
+ aPropValue.Value <<= sal_uInt16(nId);
aPropertyVector.push_back( uno::makeAny( aPropValue ) );
Sequence< Any > aArgs( comphelper::containerToSequence( aPropertyVector ));
@@ -822,7 +822,7 @@ void ToolBarManager::CreateControllers()
aPropValue.Value <<= m_aModuleIdentifier;
aPropertyVector.push_back( makeAny( aPropValue ));
aPropValue.Name = "Identifier";
- aPropValue.Value <<= nId;
+ aPropValue.Value <<= sal_uInt16(nId);
aPropertyVector.push_back( uno::makeAny( aPropValue ) );
Sequence< Any > aArgs( comphelper::containerToSequence( aPropertyVector ));
@@ -973,7 +973,7 @@ void ToolBarManager::FillToolbar( const Reference< XIndexAccess >& rItemContaine
m_aControllerMap.clear();
m_aCommandMap.clear();
- sal_uInt16 nId( 1 );
+ ToolBoxItemId nId( 1 );
CommandInfo aCmdInfo;
for ( sal_Int32 n = 0; n < rItemContainer->getCount(); n++ )
{
@@ -1090,7 +1090,7 @@ void ToolBarManager::FillToolbar( const Reference< XIndexAccess >& rItemContaine
if ( !aMergeInstructionContainer.empty() )
{
- sal_uInt16 nItemId( TOOLBAR_ITEM_STARTID );
+ ToolBoxItemId nItemId( TOOLBAR_ITEM_STARTID );
const sal_uInt32 nCount = aMergeInstructionContainer.size();
for ( sal_uInt32 i=0; i < nCount; i++ )
{
@@ -1180,7 +1180,7 @@ void ToolBarManager::FillAddonToolbar( const Sequence< Sequence< PropertyValue >
m_aControllerMap.clear();
m_aCommandMap.clear();
- sal_uInt16 nId( 1 );
+ ToolBoxItemId nId( 1 );
CommandInfo aCmdInfo;
for ( const Sequence< PropertyValue >& rSeq : rAddonToolbar )
{
@@ -1248,7 +1248,7 @@ void ToolBarManager::FillOverflowToolbar( ToolBox const * pParent )
bool bInsertSeparator = false;
for ( ToolBox::ImplToolItems::size_type i = 0; i < pParent->GetItemCount(); ++i )
{
- sal_uInt16 nId = pParent->GetItemId( i );
+ ToolBoxItemId nId = pParent->GetItemId( i );
if ( pParent->IsItemClipped( nId ) )
{
if ( bInsertSeparator )
@@ -1394,7 +1394,7 @@ void ToolBarManager::HandleClick(void ( SAL_CALL XToolbarController::*_pClick )(
if ( m_bDisposed )
return;
- sal_uInt16 nId( m_pToolBar->GetCurItemId() );
+ ToolBoxItemId nId( m_pToolBar->GetCurItemId() );
ToolBarControllerMap::const_iterator pIter = m_aControllerMap.find( nId );
if ( pIter != m_aControllerMap.end() )
{
@@ -1417,7 +1417,7 @@ IMPL_LINK_NOARG(ToolBarManager, DropdownClick, ToolBox *, void)
if ( m_bDisposed )
return;
- sal_uInt16 nId( m_pToolBar->GetCurItemId() );
+ ToolBoxItemId nId( m_pToolBar->GetCurItemId() );
ToolBarControllerMap::const_iterator pIter = m_aControllerMap.find( nId );
if ( pIter != m_aControllerMap.end() )
{
@@ -1569,7 +1569,7 @@ void ToolBarManager::AddCustomizeMenuItems(ToolBox const * pToolBar)
{
if ( m_pToolBar->GetItemType(nPos) == ToolBoxItemType::BUTTON )
{
- sal_uInt16 nId = m_pToolBar->GetItemId(nPos);
+ ToolBoxItemId nId = m_pToolBar->GetItemId(nPos);
OUString aCommandURL = m_pToolBar->GetItemCommand( nId );
xVisibleItemsPopupMenu->InsertItem( STARTID_CUSTOMIZE_POPUPMENU+nPos, m_pToolBar->GetItemText( nId ), MenuItemBits::CHECKABLE );
xVisibleItemsPopupMenu->CheckItem( STARTID_CUSTOMIZE_POPUPMENU+nPos, m_pToolBar->IsItemVisible( nId ) );
@@ -1853,7 +1853,7 @@ IMPL_LINK_NOARG(ToolBarManager, Select, ToolBox *, void)
return;
sal_Int16 nKeyModifier( static_cast<sal_Int16>(m_pToolBar->GetModifier()) );
- sal_uInt16 nId( m_pToolBar->GetCurItemId() );
+ ToolBoxItemId nId( m_pToolBar->GetCurItemId() );
ToolBarControllerMap::const_iterator pIter = m_aControllerMap.find( nId );
if ( pIter != m_aControllerMap.end() )
@@ -1898,7 +1898,7 @@ IMPL_LINK( ToolBarManager, DataChanged, DataChangedEvent const *, pDataChangedEv
for ( ToolBox::ImplToolItems::size_type nPos = 0; nPos < m_pToolBar->GetItemCount(); ++nPos )
{
- const sal_uInt16 nId = m_pToolBar->GetItemId(nPos);
+ const ToolBoxItemId nId = m_pToolBar->GetItemId(nPos);
vcl::Window* pWindow = m_pToolBar->GetItemWindow( nId );
if ( pWindow )
{
diff --git a/framework/source/uielement/toolbarmerger.cxx b/framework/source/uielement/toolbarmerger.cxx
index 297f38cba9ad..652383988bcd 100644
--- a/framework/source/uielement/toolbarmerger.cxx
+++ b/framework/source/uielement/toolbarmerger.cxx
@@ -238,8 +238,8 @@ ReferenceToolbarPathInfo ToolBarMerger::FindReferencePoint(
for ( ToolBox::ImplToolItems::size_type i = 0; i < nSize; i++ )
{
- const sal_uInt16 nItemId = pToolbar->GetItemId( i );
- if ( nItemId > 0 )
+ const ToolBoxItemId nItemId = pToolbar->GetItemId( i );
+ if ( nItemId > ToolBoxItemId(0) )
{
const OUString rCmd = pToolbar->GetItemCommand( nItemId );
if ( rCmd == rReferencePoint )
@@ -303,7 +303,7 @@ ReferenceToolbarPathInfo ToolBarMerger::FindReferencePoint(
bool ToolBarMerger::ProcessMergeOperation(
ToolBox* pToolbar,
ToolBox::ImplToolItems::size_type nPos,
- sal_uInt16& rItemId,
+ ToolBoxItemId& rItemId,
CommandToInfoMap& rCommandMap,
std::u16string_view rModuleIdentifier,
std::u16string_view rMergeCommand,
@@ -366,7 +366,7 @@ bool ToolBarMerger::ProcessMergeOperation(
*/
bool ToolBarMerger::ProcessMergeFallback(
ToolBox* pToolbar,
- sal_uInt16& rItemId,
+ ToolBoxItemId& rItemId,
CommandToInfoMap& rCommandMap,
std::u16string_view rModuleIdentifier,
std::u16string_view rMergeCommand,
@@ -430,7 +430,7 @@ void ToolBarMerger::MergeItems(
ToolBox* pToolbar,
ToolBox::ImplToolItems::size_type nPos,
sal_uInt16 nModIndex,
- sal_uInt16& rItemId,
+ ToolBoxItemId& rItemId,
CommandToInfoMap& rCommandMap,
std::u16string_view rModuleIdentifier,
const AddonToolbarItemContainer& rAddonToolbarItems )
@@ -511,7 +511,7 @@ void ToolBarMerger::MergeItems(
void ToolBarMerger::ReplaceItem(
ToolBox* pToolbar,
ToolBox::ImplToolItems::size_type nPos,
- sal_uInt16& rItemId,
+ ToolBoxItemId& rItemId,
CommandToInfoMap& rCommandMap,
std::u16string_view rModuleIdentifier,
const AddonToolbarItemContainer& rAddonToolbarItems )
@@ -587,7 +587,7 @@ rtl::Reference<::cppu::OWeakObject> ToolBarMerger::CreateController(
const uno::Reference< frame::XFrame > & xFrame,
ToolBox* pToolbar,
const OUString& rCommandURL,
- sal_uInt16 nId,
+ ToolBoxItemId nId,
sal_uInt16 nWidth,
std::u16string_view rControlType )
{
@@ -621,7 +621,7 @@ rtl::Reference<::cppu::OWeakObject> ToolBarMerger::CreateController(
return pResult;
}
-void ToolBarMerger::CreateToolbarItem( ToolBox* pToolbar, ToolBox::ImplToolItems::size_type nPos, sal_uInt16 nItemId, const AddonToolbarItem& rItem )
+void ToolBarMerger::CreateToolbarItem( ToolBox* pToolbar, ToolBox::ImplToolItems::size_type nPos, ToolBoxItemId nItemId, const AddonToolbarItem& rItem )
{
pToolbar->InsertItem( nItemId, rItem.aLabel, ToolBoxItemBits::NONE, nPos );
pToolbar->SetItemCommand( nItemId, rItem.aCommandURL );
diff --git a/include/avmedia/mediatoolbox.hxx b/include/avmedia/mediatoolbox.hxx
index 23a766d7829c..0a742abd6214 100644
--- a/include/avmedia/mediatoolbox.hxx
+++ b/include/avmedia/mediatoolbox.hxx
@@ -36,7 +36,7 @@ public:
SFX_DECL_TOOLBOX_CONTROL();
- MediaToolBoxControl( sal_uInt16 nSlotId, sal_uInt16 nId, ToolBox& rTbX );
+ MediaToolBoxControl( sal_uInt16 nSlotId, ToolBoxItemId nId, ToolBox& rTbX );
virtual ~MediaToolBoxControl() override;
virtual void StateChanged( sal_uInt16 nSID, SfxItemState eState, const SfxPoolItem* pState ) override;
diff --git a/include/framework/generictoolbarcontroller.hxx b/include/framework/generictoolbarcontroller.hxx
index bebdf78621c2..8184de97e92f 100644
--- a/include/framework/generictoolbarcontroller.hxx
+++ b/include/framework/generictoolbarcontroller.hxx
@@ -34,7 +34,7 @@ class FWK_DLLPUBLIC GenericToolbarController final : public svt::ToolboxControll
GenericToolbarController( const css::uno::Reference< css::uno::XComponentContext >& rxContext,
const css::uno::Reference< css::frame::XFrame >& rFrame,
ToolBox* pToolBar,
- sal_uInt16 nID,
+ ToolBoxItemId nID,
const OUString& aCommand );
GenericToolbarController( const css::uno::Reference< css::uno::XComponentContext >& rxContext,
const css::uno::Reference< css::frame::XFrame >& rFrame,
@@ -62,7 +62,7 @@ class FWK_DLLPUBLIC GenericToolbarController final : public svt::ToolboxControll
private:
VclPtr<ToolBox> m_xToolbar;
- sal_uInt16 m_nID;
+ ToolBoxItemId m_nID;
bool m_bEnumCommand : 1,
m_bMadeInvisible : 1;
OUString m_aEnumCommand;
diff --git a/include/framework/sfxhelperfunctions.hxx b/include/framework/sfxhelperfunctions.hxx
index 7a30899d97de..4858960f7edf 100644
--- a/include/framework/sfxhelperfunctions.hxx
+++ b/include/framework/sfxhelperfunctions.hxx
@@ -23,6 +23,7 @@
#include <framework/fwkdllapi.h>
#include <rtl/ustring.hxx>
#include <rtl/ref.hxx>
+#include <vcl/toolbox.hxx>
namespace com::sun::star::frame { class XFrame; }
namespace com::sun::star::uno { template <typename > class Reference; }
@@ -35,7 +36,7 @@ class ToolBox;
typedef rtl::Reference<svt::ToolboxController> ( *pfunc_setToolBoxControllerCreator)(
const css::uno::Reference< css::frame::XFrame >& rFrame,
ToolBox* pToolbox,
- unsigned short nID,
+ ToolBoxItemId nID,
const OUString& aCommandURL );
typedef rtl::Reference<svt::StatusbarController> ( *pfunc_setStatusBarControllerCreator)(
@@ -62,7 +63,7 @@ FWK_DLLPUBLIC pfunc_setToolBoxControllerCreator SetToolBoxControllerCreator( pfu
FWK_DLLPUBLIC rtl::Reference<svt::ToolboxController> CreateToolBoxController(
const css::uno::Reference< css::frame::XFrame >& rFrame,
ToolBox* pToolbox,
- unsigned short nID,
+ ToolBoxItemId nID,
const OUString& aCommandURL );
FWK_DLLPUBLIC pfunc_setStatusBarControllerCreator SetStatusBarControllerCreator( pfunc_setStatusBarControllerCreator pSetStatusBarControllerCreator );
diff --git a/include/sfx2/tbxctrl.hxx b/include/sfx2/tbxctrl.hxx
index daa9d77b84ac..65d44088629e 100644
--- a/include/sfx2/tbxctrl.hxx
+++ b/include/sfx2/tbxctrl.hxx
@@ -35,9 +35,9 @@ class InterimItemWindow;
class SfxToolBoxControl;
class SfxModule;
-rtl::Reference<svt::ToolboxController> SfxToolBoxControllerFactory( const css::uno::Reference< css::frame::XFrame >& rFrame, ToolBox* pToolbox, unsigned short nID, const OUString& aCommandURL );
+rtl::Reference<svt::ToolboxController> SfxToolBoxControllerFactory( const css::uno::Reference< css::frame::XFrame >& rFrame, ToolBox* pToolbox, ToolBoxItemId nID, const OUString& aCommandURL );
-typedef rtl::Reference<SfxToolBoxControl> (*SfxToolBoxControlCtor)( sal_uInt16 nSlotId, sal_uInt16 nId, ToolBox& rBox );
+typedef rtl::Reference<SfxToolBoxControl> (*SfxToolBoxControlCtor)( sal_uInt16 nSlotId, ToolBoxItemId nId, ToolBox& rBox );
struct SfxTbxCtrlFactory
{
@@ -55,7 +55,7 @@ struct SfxTbxCtrlFactory
#define SFX_DECL_TOOLBOX_CONTROL() \
- static rtl::Reference<SfxToolBoxControl> CreateImpl( sal_uInt16 nSlotId, sal_uInt16 nId, ToolBox &rTbx ); \
+ static rtl::Reference<SfxToolBoxControl> CreateImpl( sal_uInt16 nSlotId, ToolBoxItemId nId, ToolBox &rTbx ); \
static void RegisterControl(sal_uInt16 nSlotId = 0, SfxModule *pMod=nullptr)
/* For special ToolBox controls, such as a font selection box or toolbox
@@ -102,11 +102,11 @@ public:
public:
SFX_DECL_TOOLBOX_CONTROL();
- SfxToolBoxControl( sal_uInt16 nSlotID, sal_uInt16 nId, ToolBox& rBox, bool bShowStrings = false );
+ SfxToolBoxControl( sal_uInt16 nSlotID, ToolBoxItemId nId, ToolBox& rBox, bool bShowStrings = false );
virtual ~SfxToolBoxControl() override;
ToolBox& GetToolBox() const;
- unsigned short GetId() const;
+ ToolBoxItemId GetId() const;
unsigned short GetSlotId() const;
void Dispatch( const OUString& aCommand,
@@ -116,19 +116,19 @@ public:
css::uno::Sequence< css::beans::PropertyValue > const & aArgs );
static SfxItemState GetItemState( const SfxPoolItem* pState );
- static rtl::Reference<SfxToolBoxControl> CreateControl( sal_uInt16 nSlotId, sal_uInt16 nTbxId, ToolBox *pBox, SfxModule const *pMod );
+ static rtl::Reference<SfxToolBoxControl> CreateControl( sal_uInt16 nSlotId, ToolBoxItemId nTbxId, ToolBox *pBox, SfxModule const *pMod );
static void RegisterToolBoxControl( SfxModule*, const SfxTbxCtrlFactory&);
};
#define SFX_IMPL_TOOLBOX_CONTROL(Class, nItemClass) \
- rtl::Reference<SfxToolBoxControl> Class::CreateImpl( sal_uInt16 nSlotId, sal_uInt16 nId, ToolBox &rTbx ) \
+ rtl::Reference<SfxToolBoxControl> Class::CreateImpl( sal_uInt16 nSlotId, ToolBoxItemId nId, ToolBox &rTbx ) \
{ return new Class( nSlotId, nId, rTbx ); } \
void Class::RegisterControl(sal_uInt16 nSlotId, SfxModule *pMod) \
{ SfxToolBoxControl::RegisterToolBoxControl( pMod, SfxTbxCtrlFactory( \
Class::CreateImpl, typeid(nItemClass), nSlotId ) ); }
#define SFX_IMPL_TOOLBOX_CONTROL_ARG(Class, nItemClass, Arg) \
- rtl::Reference<SfxToolBoxControl> Class::CreateImpl( sal_uInt16 nSlotId, sal_uInt16 nId, ToolBox &rTbx ) \
+ rtl::Reference<SfxToolBoxControl> Class::CreateImpl( sal_uInt16 nSlotId, ToolBoxItemId nId, ToolBox &rTbx ) \
{ return new Class( nSlotId, nId, rTbx, Arg); } \
void Class::RegisterControl(sal_uInt16 nSlotId, SfxModule *pMod) \
{ SfxToolBoxControl::RegisterToolBoxControl( pMod, SfxTbxCtrlFactory( \
diff --git a/include/svtools/toolboxcontroller.hxx b/include/svtools/toolboxcontroller.hxx
index 0bf372e9502f..ef15f70c263b 100644
--- a/include/svtools/toolboxcontroller.hxx
+++ b/include/svtools/toolboxcontroller.hxx
@@ -33,6 +33,7 @@
#include <comphelper/propertycontainer.hxx>
#include <cppuhelper/propshlp.hxx>
#include <tools/link.hxx>
+#include <vcl/toolbox.hxx>
#include <unordered_map>
@@ -131,7 +132,7 @@ class SVT_DLLPUBLIC ToolboxController :
bool IsInSidebar() const { return m_bSidebar; }
protected:
- bool getToolboxId( sal_uInt16& rItemId, ToolBox** ppToolBox );
+ bool getToolboxId( ToolBoxItemId& rItemId, ToolBox** ppToolBox );
struct Listener
{
Listener( const css::util::URL& rURL, const css::uno::Reference< css::frame::XDispatch >& rDispatch ) :
@@ -175,7 +176,7 @@ class SVT_DLLPUBLIC ToolboxController :
bool m_bInitialized,
m_bDisposed,
m_bSidebar;
- sal_uInt16 m_nToolBoxId;
+ ToolBoxItemId m_nToolBoxId;
css::uno::Reference< css::frame::XFrame > m_xFrame;
css::uno::Reference< css::uno::XComponentContext > m_xContext;
OUString m_aCommandURL;
diff --git a/include/svx/ParaSpacingControl.hxx b/include/svx/ParaSpacingControl.hxx
index f6403e45207b..877ab9abd52e 100644
--- a/include/svx/ParaSpacingControl.hxx
+++ b/include/svx/ParaSpacingControl.hxx
@@ -41,7 +41,7 @@ namespace svx
class ParaULSpacingControl : public SfxToolBoxControl
{
public:
- ParaULSpacingControl(sal_uInt16 nSlotId, sal_uInt16 nId, ToolBox& rTbx);
+ ParaULSpacingControl(sal_uInt16 nSlotId, ToolBoxItemId nId, ToolBox& rTbx);
virtual ~ParaULSpacingControl() override;
virtual void StateChanged(sal_uInt16 nSID, SfxItemState eState,
@@ -54,7 +54,7 @@ class SVX_DLLPUBLIC ParaAboveSpacingControl final : public ParaULSpacingControl
public:
SFX_DECL_TOOLBOX_CONTROL();
- ParaAboveSpacingControl(sal_uInt16 nSlotId, sal_uInt16 nId, ToolBox& rTbx);
+ ParaAboveSpacingControl(sal_uInt16 nSlotId, ToolBoxItemId nId, ToolBox& rTbx);
virtual VclPtr<InterimItemWindow> CreateItemWindow(vcl::Window* pParent) override;
};
@@ -63,14 +63,14 @@ class SVX_DLLPUBLIC ParaBelowSpacingControl final : public ParaULSpacingControl
public:
SFX_DECL_TOOLBOX_CONTROL();
- ParaBelowSpacingControl(sal_uInt16 nSlotId, sal_uInt16 nId, ToolBox& rTbx);
+ ParaBelowSpacingControl(sal_uInt16 nSlotId, ToolBoxItemId nId, ToolBox& rTbx);
virtual VclPtr<InterimItemWindow> CreateItemWindow(vcl::Window* pParent) override;
};
class ParaLRSpacingControl : public SfxToolBoxControl, public css::ui::XContextChangeEventListener
{
public:
- ParaLRSpacingControl(sal_uInt16 nSlotId, sal_uInt16 nId, ToolBox& rTbx);
+ ParaLRSpacingControl(sal_uInt16 nSlotId, ToolBoxItemId nId, ToolBox& rTbx);
virtual ~ParaLRSpacingControl() override;
virtual void SAL_CALL dispose() override;
@@ -100,7 +100,7 @@ class SVX_DLLPUBLIC ParaLeftSpacingControl final : public ParaLRSpacingControl
public:
SFX_DECL_TOOLBOX_CONTROL();
- ParaLeftSpacingControl(sal_uInt16 nSlotId, sal_uInt16 nId, ToolBox& rTbx);
+ ParaLeftSpacingControl(sal_uInt16 nSlotId, ToolBoxItemId nId, ToolBox& rTbx);
virtual VclPtr<InterimItemWindow> CreateItemWindow(vcl::Window* pParent) override;
};
@@ -109,7 +109,7 @@ class SVX_DLLPUBLIC ParaRightSpacingControl final : public ParaLRSpacingControl
public:
SFX_DECL_TOOLBOX_CONTROL();
- ParaRightSpacingControl(sal_uInt16 nSlotId, sal_uInt16 nId, ToolBox& rTbx);
+ ParaRightSpacingControl(sal_uInt16 nSlotId, ToolBoxItemId nId, ToolBox& rTbx);
virtual VclPtr<InterimItemWindow> CreateItemWindow(vcl::Window* pParent) override;
};
@@ -118,7 +118,7 @@ class SVX_DLLPUBLIC ParaFirstLineSpacingControl final : public ParaLRSpacingCont
public:
SFX_DECL_TOOLBOX_CONTROL();
- ParaFirstLineSpacingControl(sal_uInt16 nSlotId, sal_uInt16 nId, ToolBox& rTbx);
+ ParaFirstLineSpacingControl(sal_uInt16 nSlotId, ToolBoxItemId nId, ToolBox& rTbx);
virtual VclPtr<InterimItemWindow> CreateItemWindow(vcl::Window* pParent) override;
};
}
diff --git a/include/svx/clipboardctl.hxx b/include/svx/clipboardctl.hxx
index 00a0a301d7f7..2c93dedfaf86 100644
--- a/include/svx/clipboardctl.hxx
+++ b/include/svx/clipboardctl.hxx
@@ -37,7 +37,7 @@ class SAL_WARN_UNUSED SVX_DLLPUBLIC SvxClipBoardControl final : public SfxToolBo
public:
SFX_DECL_TOOLBOX_CONTROL();
- SvxClipBoardControl( sal_uInt16 nSlotId, sal_uInt16 nId, ToolBox& rTbx );
+ SvxClipBoardControl( sal_uInt16 nSlotId, ToolBoxItemId nId, ToolBox& rTbx );
virtual ~SvxClipBoardControl() override;
void CreatePopupWindow() override;
diff --git a/include/svx/colorwindow.hxx b/include/svx/colorwindow.hxx
index 784f273e87a7..95f7c5c13d86 100644
--- a/include/svx/colorwindow.hxx
+++ b/include/svx/colorwindow.hxx
@@ -61,11 +61,11 @@ private:
// or
SvxColorToolBoxControl* m_pControl;
VclPtr<ToolBox> m_xToolBox;
- sal_uInt16 m_nId;
+ ToolBoxItemId m_nId;
public:
MenuOrToolMenuButton(weld::MenuButton* pMenuButton);
MenuOrToolMenuButton(weld::Toolbar* pToolbar, const OString& rIdent);
- MenuOrToolMenuButton(SvxColorToolBoxControl* pControl, ToolBox* pToolbar, sal_uInt16 nId);
+ MenuOrToolMenuButton(SvxColorToolBoxControl* pControl, ToolBox* pToolbar, ToolBoxItemId nId);
~MenuOrToolMenuButton();
MenuOrToolMenuButton(MenuOrToolMenuButton const &) = default;
diff --git a/include/svx/fillctrl.hxx b/include/svx/fillctrl.hxx
index 7155d261a090..ad428a10529f 100644
--- a/include/svx/fillctrl.hxx
+++ b/include/svx/fillctrl.hxx
@@ -65,7 +65,7 @@ private:
public:
SFX_DECL_TOOLBOX_CONTROL();
- SvxFillToolBoxControl(sal_uInt16 nSlotId, sal_uInt16 nId, ToolBox& rTbx);
+ SvxFillToolBoxControl(sal_uInt16 nSlotId, ToolBoxItemId nId, ToolBox& rTbx);
virtual ~SvxFillToolBoxControl() override;
virtual void StateChanged(sal_uInt16 nSID, SfxItemState eState, const SfxPoolItem* pState) override;
diff --git a/include/svx/formatpaintbrushctrl.hxx b/include/svx/formatpaintbrushctrl.hxx
index 826344064051..a9bb530da25c 100644
--- a/include/svx/formatpaintbrushctrl.hxx
+++ b/include/svx/formatpaintbrushctrl.hxx
@@ -33,7 +33,7 @@ class SAL_WARN_UNUSED SVX_DLLPUBLIC FormatPaintBrushToolBoxControl final : publi
{
public:
SFX_DECL_TOOLBOX_CONTROL();
- FormatPaintBrushToolBoxControl( sal_uInt16 nSlotId, sal_uInt16 nId, ToolBox& rTbx );
+ FormatPaintBrushToolBoxControl( sal_uInt16 nSlotId, ToolBoxItemId nId, ToolBox& rTbx );
virtual ~FormatPaintBrushToolBoxControl() override;
virtual void DoubleClick() override;
diff --git a/include/svx/grafctrl.hxx b/include/svx/grafctrl.hxx
index b22b82392409..ad3187c6dcb3 100644
--- a/include/svx/grafctrl.hxx
+++ b/include/svx/grafctrl.hxx
@@ -28,7 +28,7 @@
class SvxGrafToolBoxControl : public SfxToolBoxControl
{
public:
- SvxGrafToolBoxControl( sal_uInt16 nSlotId, sal_uInt16 nId, ToolBox& rTbx );
+ SvxGrafToolBoxControl( sal_uInt16 nSlotId, ToolBoxItemId nId, ToolBox& rTbx );
virtual ~SvxGrafToolBoxControl() override;
virtual void StateChanged( sal_uInt16 nSID, SfxItemState eState, const SfxPoolItem* pState ) override;
@@ -40,7 +40,7 @@ class SVX_DLLPUBLIC SvxGrafRedToolBoxControl final : public SvxGrafToolBoxContro
{
public:
SFX_DECL_TOOLBOX_CONTROL();
- SvxGrafRedToolBoxControl( sal_uInt16 nSlotId, sal_uInt16 nId, ToolBox& rTbx );
+ SvxGrafRedToolBoxControl( sal_uInt16 nSlotId, ToolBoxItemId nId, ToolBox& rTbx );
};
@@ -48,7 +48,7 @@ class SVX_DLLPUBLIC SvxGrafGreenToolBoxControl final : public SvxGrafToolBoxCont
{
public:
SFX_DECL_TOOLBOX_CONTROL();
- SvxGrafGreenToolBoxControl( sal_uInt16 nSlotId, sal_uInt16 nId, ToolBox& rTbx );
+ SvxGrafGreenToolBoxControl( sal_uInt16 nSlotId, ToolBoxItemId nId, ToolBox& rTbx );
};
@@ -56,7 +56,7 @@ class SVX_DLLPUBLIC SvxGrafBlueToolBoxControl final : public SvxGrafToolBoxContr
{
public:
SFX_DECL_TOOLBOX_CONTROL();
- SvxGrafBlueToolBoxControl( sal_uInt16 nSlotId, sal_uInt16 nId, ToolBox& rTbx );
+ SvxGrafBlueToolBoxControl( sal_uInt16 nSlotId, ToolBoxItemId nId, ToolBox& rTbx );
};
@@ -64,7 +64,7 @@ class SVX_DLLPUBLIC SvxGrafLuminanceToolBoxControl final : public SvxGrafToolBox
{
public:
SFX_DECL_TOOLBOX_CONTROL();
- SvxGrafLuminanceToolBoxControl( sal_uInt16 nSlotId, sal_uInt16 nId, ToolBox& rTbx );
+ SvxGrafLuminanceToolBoxControl( sal_uInt16 nSlotId, ToolBoxItemId nId, ToolBox& rTbx );
};
@@ -72,7 +72,7 @@ class SVX_DLLPUBLIC SvxGrafContrastToolBoxControl final : public SvxGrafToolBoxC
{
public:
SFX_DECL_TOOLBOX_CONTROL();
- SvxGrafContrastToolBoxControl( sal_uInt16 nSlotId, sal_uInt16 nId, ToolBox& rTbx );
+ SvxGrafContrastToolBoxControl( sal_uInt16 nSlotId, ToolBoxItemId nId, ToolBox& rTbx );
};
@@ -80,7 +80,7 @@ class SVX_DLLPUBLIC SvxGrafGammaToolBoxControl final : public SvxGrafToolBoxCont
{
public:
SFX_DECL_TOOLBOX_CONTROL();
- SvxGrafGammaToolBoxControl( sal_uInt16 nSlotId, sal_uInt16 nId, ToolBox& rTbx );
+ SvxGrafGammaToolBoxControl( sal_uInt16 nSlotId, ToolBoxItemId nId, ToolBox& rTbx );
};
@@ -88,7 +88,7 @@ class SVX_DLLPUBLIC SvxGrafTransparenceToolBoxControl final : public SvxGrafTool
{
public:
SFX_DECL_TOOLBOX_CONTROL();
- SvxGrafTransparenceToolBoxControl( sal_uInt16 nSlotId, sal_uInt16 nId, ToolBox& rTbx );
+ SvxGrafTransparenceToolBoxControl( sal_uInt16 nSlotId, ToolBoxItemId nId, ToolBox& rTbx );
};
@@ -96,7 +96,7 @@ class SVX_DLLPUBLIC SvxGrafModeToolBoxControl final : public SfxToolBoxControl,
{
public:
SFX_DECL_TOOLBOX_CONTROL();
- SvxGrafModeToolBoxControl( sal_uInt16 nSlotId, sal_uInt16 nId, ToolBox& rTbx );
+ SvxGrafModeToolBoxControl( sal_uInt16 nSlotId, ToolBoxItemId nId, ToolBox& rTbx );
virtual ~SvxGrafModeToolBoxControl() override;
virtual void StateChanged( sal_uInt16 nSID, SfxItemState eState, const SfxPoolItem* pState ) override;
diff --git a/include/svx/linectrl.hxx b/include/svx/linectrl.hxx
index 7ade8dc06643..2fd24305ca2e 100644
--- a/include/svx/linectrl.hxx
+++ b/include/svx/linectrl.hxx
@@ -79,7 +79,7 @@ class SVX_DLLPUBLIC SvxLineWidthToolBoxControl final : public SfxToolBoxControl
public:
SFX_DECL_TOOLBOX_CONTROL();
- SvxLineWidthToolBoxControl( sal_uInt16 nSlotId, sal_uInt16 nId, ToolBox& rTbx );
+ SvxLineWidthToolBoxControl( sal_uInt16 nSlotId, ToolBoxItemId nId, ToolBox& rTbx );
virtual ~SvxLineWidthToolBoxControl() override;
virtual void StateChanged( sal_uInt16 nSID, SfxItemState eState,
diff --git a/include/svx/tbxctl.hxx b/include/svx/tbxctl.hxx
index 46b8d6dbbfa0..f2e28c9ec47d 100644
--- a/include/svx/tbxctl.hxx
+++ b/include/svx/tbxctl.hxx
@@ -38,7 +38,7 @@ private:
protected:
public:
- SvxTbxCtlDraw( sal_uInt16 nSlotId, sal_uInt16 nId, ToolBox& rTbx );
+ SvxTbxCtlDraw( sal_uInt16 nSlotId, ToolBoxItemId nId, ToolBox& rTbx );
// XInitialization
virtual void SAL_CALL initialize( const css::uno::Sequence< css::uno::Any >& aArguments ) override;
diff --git a/include/vcl/builder.hxx b/include/vcl/builder.hxx
index c7d7f645532c..153d52887d7a 100644
--- a/include/vcl/builder.hxx
+++ b/include/vcl/builder.hxx
@@ -17,6 +17,7 @@
#include <vcl/dllapi.h>
#include <vcl/window.hxx>
#include <vcl/vclptr.hxx>
+#include <vcl/toolbox.hxx>
#include <tools/wintypes.hxx>
#include <vcl/EnumContext.hxx>
@@ -282,7 +283,7 @@ private:
std::vector< VclPtr<MessageDialog> > m_aMessageDialogs;
- sal_uInt16 m_nLastToolbarId;
+ ToolBoxItemId m_nLastToolbarId;
sal_uInt16 m_nLastMenuItemId;
diff --git a/include/vcl/toolbox.hxx b/include/vcl/toolbox.hxx
index 98d60ba1d73b..649cc0fe3093 100644
--- a/include/vcl/toolbox.hxx
+++ b/include/vcl/toolbox.hxx
@@ -68,6 +68,16 @@ enum class ToolBoxLayoutMode
// Position of the text when icon and text are painted
enum class ToolBoxTextPosition { Right, Bottom };
+typedef o3tl::strong_int<sal_uInt16, struct ToolBoxItemIdTag> ToolBoxItemId;
+namespace std {
+ template<>
+ struct hash<ToolBoxItemId>
+ {
+ std::size_t operator()(ToolBoxItemId const & s) const
+ { return std::size_t(sal_uInt16(s)); }
+ };
+}
+
class Idle;
class VCL_DLLPUBLIC ToolBox : public DockingWindow
{
@@ -79,7 +89,7 @@ public:
virtual FactoryFunction GetUITestFactory() const override;
- void SetCurItemId( sal_uInt16 CurID ) { mnCurItemId=CurID; }
+ void SetCurItemId( ToolBoxItemId CurID ) { mnCurItemId=CurID; }
static constexpr auto APPEND
= std::numeric_limits<ImplToolItems::size_type>::max();
@@ -114,10 +124,10 @@ private:
tools::Long mnLastResizeDY;
tools::Long mnActivateCount;
Degree10 mnImagesRotationAngle;
- sal_uInt16 mnLastFocusItemId;
- sal_uInt16 mnHighItemId;
- sal_uInt16 mnCurItemId;
- sal_uInt16 mnDownItemId;
+ ToolBoxItemId mnLastFocusItemId;
+ ToolBoxItemId mnHighItemId;
+ ToolBoxItemId mnCurItemId;
+ ToolBoxItemId mnDownItemId;
ImplToolItems::size_type mnCurPos;
ImplToolItems::size_type mnLines; // total number of toolbox lines
ImplToolItems::size_type mnCurLine; // the currently visible line
@@ -173,7 +183,7 @@ private:
SAL_DLLPRIVATE void ImplInit( vcl::Window* pParent, WinBits nStyle );
using DockingWindow::ImplInitSettings;
SAL_DLLPRIVATE void ImplInitSettings( bool bFont, bool bForeground, bool bBackground );
- SAL_DLLPRIVATE ImplToolItem* ImplGetItem( sal_uInt16 nId ) const;
+ SAL_DLLPRIVATE ImplToolItem* ImplGetItem( ToolBoxItemId nId ) const;
SAL_DLLPRIVATE bool ImplCalcItem();
SAL_DLLPRIVATE ImplToolItems::size_type ImplCalcBreaks( tools::Long nWidth, tools::Long* pMaxLineWidth, bool bCalcHorz ) const;
SAL_DLLPRIVATE void ImplFormat( bool bResize = false );
@@ -199,7 +209,7 @@ private:
SAL_DLLPRIVATE Point ImplGetPopupPosition( const tools::Rectangle& rRect ) const;
SAL_DLLPRIVATE bool ImplIsFloatingMode() const;
SAL_DLLPRIVATE bool ImplIsInPopupMode() const;
- SAL_DLLPRIVATE const OUString& ImplGetHelpText( sal_uInt16 nItemId ) const;
+ SAL_DLLPRIVATE const OUString& ImplGetHelpText( ToolBoxItemId nItemId ) const;
SAL_DLLPRIVATE Size ImplGetOptimalFloatingSize();
SAL_DLLPRIVATE bool ImplHasExternalMenubutton();
SAL_DLLPRIVATE void ImplDrawFloatwinBorder(vcl::RenderContext& rRenderContext, ImplToolItem const * pItem );
@@ -300,24 +310,24 @@ public:
ToolBoxItemBits nBits,
const Size& rRequestedSize,
ImplToolItems::size_type nPos = APPEND );
- void InsertItem( sal_uInt16 nItemId, const Image& rImage,
+ void InsertItem( ToolBoxItemId nItemId, const Image& rImage,
ToolBoxItemBits nBits = ToolBoxItemBits::NONE,
ImplToolItems::size_type nPos = APPEND );
- void InsertItem( sal_uInt16 nItemId, const Image& rImage,
+ void InsertItem( ToolBoxItemId nItemId, const Image& rImage,
const OUString& rText,
ToolBoxItemBits nBits = ToolBoxItemBits::NONE,
ImplToolItems::size_type nPos = APPEND );
- void InsertItem( sal_uInt16 nItemId, const OUString& rText,
+ void InsertItem( ToolBoxItemId nItemId, const OUString& rText,
ToolBoxItemBits nBits = ToolBoxItemBits::NONE,
ImplToolItems::size_type nPos = APPEND );
- void InsertWindow( sal_uInt16 nItemId, vcl::Window* pWindow,
+ void InsertWindow( ToolBoxItemId nItemId, vcl::Window* pWindow,
ToolBoxItemBits nBits = ToolBoxItemBits::NONE,
ImplToolItems::size_type nPos = APPEND );
void InsertSpace();
void InsertSeparator( ImplToolItems::size_type nPos = APPEND, sal_uInt16 nPixSize = 0 );
void InsertBreak( ImplToolItems::size_type nPos = APPEND );
void RemoveItem( ImplToolItems::size_type nPos );
- void CopyItem( const ToolBox& rToolBox, sal_uInt16 nItemId );
+ void CopyItem( const ToolBox& rToolBox, ToolBoxItemId nItemId );
void Clear();
void SetButtonType( ButtonType eNewType );
@@ -337,80 +347,80 @@ public:
ImplToolItems::size_type GetItemCount() const;
ToolBoxItemType GetItemType( ImplToolItems::size_type nPos ) const;
- ImplToolItems::size_type GetItemPos( sal_uInt16 nItemId ) const;
+ ImplToolItems::size_type GetItemPos( ToolBoxItemId nItemId ) const;
ImplToolItems::size_type GetItemPos( const Point& rPos ) const;
- sal_uInt16 GetItemId( ImplToolItems::size_type nPos ) const;
- sal_uInt16 GetItemId( const Point& rPos ) const;
+ ToolBoxItemId GetItemId( ImplToolItems::size_type nPos ) const;
+ ToolBoxItemId GetItemId( const Point& rPos ) const;
/// Map the command name (like .uno:Save) back to item id.
- sal_uInt16 GetItemId( const OUString& rCommand ) const;
- tools::Rectangle GetItemRect( sal_uInt16 nItemId );
+ ToolBoxItemId GetItemId( const OUString& rCommand ) const;
+ tools::Rectangle GetItemRect( ToolBoxItemId nItemId );
tools::Rectangle GetItemPosRect( ImplToolItems::size_type nPos );
tools::Rectangle const & GetOverflowRect() const;
/// Returns size of the bitmap / text that is inside this toolbox item.
- Size GetItemContentSize( sal_uInt16 nItemId );
+ Size GetItemContentSize( ToolBoxItemId nItemId );
- sal_uInt16 GetCurItemId() const { return mnCurItemId; }
- sal_uInt16 GetDownItemId() const { return mnDownItemId; }
+ ToolBoxItemId GetCurItemId() const { return mnCurItemId; }
+ ToolBoxItemId GetDownItemId() const { return mnDownItemId; }
sal_uInt16 GetModifier() const { return mnMouseModifier; }
- void SetItemBits( sal_uInt16 nItemId, ToolBoxItemBits nBits );
- ToolBoxItemBits GetItemBits( sal_uInt16 nItemId ) const;
+ void SetItemBits( ToolBoxItemId nItemId, ToolBoxItemBits nBits );
+ ToolBoxItemBits GetItemBits( ToolBoxItemId nItemId ) const;
- void SetItemExpand( sal_uInt16 nItemId, bool bExpand );
+ void SetItemExpand( ToolBoxItemId nItemId, bool bExpand );
// e.g. a label used as an itemwindow
- void SetItemWindowNonInteractive(sal_uInt16 nItemId, bool bNonInteractive);
+ void SetItemWindowNonInteractive(ToolBoxItemId nItemId, bool bNonInteractive);
- void SetItemData( sal_uInt16 nItemId, void* pNewData );
- void* GetItemData( sal_uInt16 nItemId ) const;
- void SetItemImage( sal_uInt16 nItemId, const Image& rImage );
- Image GetItemImage( sal_uInt16 nItemId ) const;
- void SetItemImageAngle( sal_uInt16 nItemId, Degree10 nAngle10 );
- void SetItemImageMirrorMode( sal_uInt16 nItemId, bool bMirror );
- void SetItemText( sal_uInt16 nItemId, const OUString& rText );
- const OUString& GetItemText( sal_uInt16 nItemId ) const;
- void SetItemWindow( sal_uInt16 nItemId, vcl::Window* pNewWindow );
- vcl::Window* GetItemWindow( sal_uInt16 nItemId ) const;
- sal_uInt16 GetHighlightItemId() const { return mnHighItemId; }
+ void SetItemData( ToolBoxItemId nItemId, void* pNewData );
+ void* GetItemData( ToolBoxItemId nItemId ) const;
+ void SetItemImage( ToolBoxItemId nItemId, const Image& rImage );
+ Image GetItemImage( ToolBoxItemId nItemId ) const;
+ void SetItemImageAngle( ToolBoxItemId nItemId, Degree10 nAngle10 );
+ void SetItemImageMirrorMode( ToolBoxItemId nItemId, bool bMirror );
+ void SetItemText( ToolBoxItemId nItemId, const OUString& rText );
+ const OUString& GetItemText( ToolBoxItemId nItemId ) const;
+ void SetItemWindow( ToolBoxItemId nItemId, vcl::Window* pNewWindow );
+ vcl::Window* GetItemWindow( ToolBoxItemId nItemId ) const;
+ ToolBoxItemId GetHighlightItemId() const { return mnHighItemId; }
void EndSelection();
- void SetItemDown( sal_uInt16 nItemId, bool bDown );
+ void SetItemDown( ToolBoxItemId nItemId, bool bDown );
- void SetItemState( sal_uInt16 nItemId, TriState eState );
- TriState GetItemState( sal_uInt16 nItemId ) const;
+ void SetItemState( ToolBoxItemId nItemId, TriState eState );
+ TriState GetItemState( ToolBoxItemId nItemId ) const;
- void CheckItem( sal_uInt16 nItemId, bool bCheck = true );
- bool IsItemChecked( sal_uInt16 nItemId ) const;
+ void CheckItem( ToolBoxItemId nItemId, bool bCheck = true );
+ bool IsItemChecked( ToolBoxItemId nItemId ) const;
- void EnableItem( sal_uInt16 nItemId, bool bEnable = true );
- bool IsItemEnabled( sal_uInt16 nItemId ) const;
+ void EnableItem( ToolBoxItemId nItemId, bool bEnable = true );
+ bool IsItemEnabled( ToolBoxItemId nItemId ) const;
- void TriggerItem( sal_uInt16 nItemId );
+ void TriggerItem( ToolBoxItemId nItemId );
/// Shows or hides items.
- void ShowItem(sal_uInt16 nItemId, bool bVisible = true);
+ void ShowItem(ToolBoxItemId nItemId, bool bVisible = true);
/// Convenience method to hide items (via ShowItem).
- void HideItem(sal_uInt16 nItemId) { ShowItem( nItemId, false ); }
+ void HideItem(ToolBoxItemId nItemId) { ShowItem( nItemId, false ); }
- bool IsItemClipped( sal_uInt16 nItemId ) const;
- bool IsItemVisible( sal_uInt16 nItemId ) const;
- bool IsItemReallyVisible( sal_uInt16 nItemId ) const;
+ bool IsItemClipped( ToolBoxItemId nItemId ) const;
+ bool IsItemVisible( ToolBoxItemId nItemId ) const;
+ bool IsItemReallyVisible( ToolBoxItemId nItemId ) const;
- void SetItemCommand( sal_uInt16 nItemId, const OUString& rCommand );
- OUString GetItemCommand( sal_uInt16 nItemId ) const;
+ void SetItemCommand( ToolBoxItemId nItemId, const OUString& rCommand );
+ OUString GetItemCommand( ToolBoxItemId nItemId ) const;
using Window::SetQuickHelpText;
- void SetQuickHelpText( sal_uInt16 nItemId, const OUString& rText );
+ void SetQuickHelpText( ToolBoxItemId nItemId, const OUString& rText );
using Window::GetQuickHelpText;
- OUString GetQuickHelpText( sal_uInt16 nItemId ) const;
+ OUString GetQuickHelpText( ToolBoxItemId nItemId ) const;
... etc. - the rest is truncated
More information about the Libreoffice-commits
mailing list