diff options
-rw-r--r-- | framework/inc/uielement/toolbarmerger.hxx | 6 | ||||
-rw-r--r-- | framework/source/uielement/addonstoolbarmanager.cxx | 6 | ||||
-rw-r--r-- | framework/source/uielement/toolbarmanager.cxx | 2 | ||||
-rw-r--r-- | framework/source/uielement/toolbarmerger.cxx | 23 |
4 files changed, 28 insertions, 9 deletions
diff --git a/framework/inc/uielement/toolbarmerger.hxx b/framework/inc/uielement/toolbarmerger.hxx index ea1ab340ec33..4ad1467bbe64 100644 --- a/framework/inc/uielement/toolbarmerger.hxx +++ b/framework/inc/uielement/toolbarmerger.hxx @@ -44,6 +44,7 @@ struct AddonsParams OUString aImageId; OUString aTarget; OUString aControlType; + sal_uInt16 nWidth; }; struct AddonToolbarItem @@ -54,6 +55,7 @@ struct AddonToolbarItem OUString aTarget; OUString aContext; OUString aControlType; + sal_uInt16 nWidth; }; typedef ::std::vector< AddonToolbarItem > AddonToolbarItemContainer; @@ -79,7 +81,8 @@ class ToolBarMerger OUString& rImageIdentifier, OUString& rTarget, OUString& rContext, - OUString& rControlType ); + OUString& rControlType, + sal_uInt16& rWidth ); static ReferenceToolbarPathInfo FindReferencePoint( ToolBox* pToolbar, const OUString& rReferencePoint ); @@ -131,6 +134,7 @@ class ToolBarMerger ToolBox* pToolbar, const OUString& rCommandURL, sal_uInt16 nId, + sal_uInt16 nWidth, const OUString& rControlType ); static void CreateToolbarItem( ToolBox* pToolbox, diff --git a/framework/source/uielement/addonstoolbarmanager.cxx b/framework/source/uielement/addonstoolbarmanager.cxx index d6e23276b38e..80f6e803cd0e 100644 --- a/framework/source/uielement/addonstoolbarmanager.cxx +++ b/framework/source/uielement/addonstoolbarmanager.cxx @@ -229,10 +229,11 @@ void AddonsToolBarManager::FillToolbar( const Sequence< Sequence< PropertyValue OUString aContext; OUString aTarget; OUString aControlType; + sal_uInt16 nWidth( 0 ); const Sequence< PropertyValue >& rSeq = rAddonToolbar[n]; - ToolBarMerger::ConvertSequenceToValues( rSeq, aURL, aTitle, aImageId, aTarget, aContext, aControlType ); + ToolBarMerger::ConvertSequenceToValues( rSeq, aURL, aTitle, aImageId, aTarget, aContext, aControlType, nWidth ); if ( IsCorrectContext( aModuleIdentifier, aContext )) { @@ -263,6 +264,7 @@ void AddonsToolBarManager::FillToolbar( const Sequence< Sequence< PropertyValue AddonsParams* pRuntimeItemData = new AddonsParams; pRuntimeItemData->aImageId = aImageId; pRuntimeItemData->aTarget = aTarget; + pRuntimeItemData->nWidth = nWidth; m_pToolBar->SetItemData( nId, pRuntimeItemData ); m_pToolBar->SetItemCommand( nId, aURL ); @@ -308,7 +310,7 @@ void AddonsToolBarManager::FillToolbar( const Sequence< Sequence< PropertyValue { ::cppu::OWeakObject* pController = nullptr; - pController = ToolBarMerger::CreateController( m_xContext, m_xFrame, m_pToolBar, aURL, nId, aControlType ); + pController = ToolBarMerger::CreateController( m_xContext, m_xFrame, m_pToolBar, aURL, nId, nWidth, aControlType ); xController.set( pController, UNO_QUERY ); } diff --git a/framework/source/uielement/toolbarmanager.cxx b/framework/source/uielement/toolbarmanager.cxx index 25eda26a83db..061bf5c5eeb5 100644 --- a/framework/source/uielement/toolbarmanager.cxx +++ b/framework/source/uielement/toolbarmanager.cxx @@ -707,6 +707,7 @@ void ToolBarManager::CreateControllers() { // retrieve additional parameters OUString aControlType = static_cast< AddonsParams* >( m_pToolBar->GetItemData( nId ))->aControlType; + sal_uInt16 nWidth = static_cast< AddonsParams* >( m_pToolBar->GetItemData( nId ))->nWidth; Reference< XStatusListener > xStatusListener( ToolBarMerger::CreateController( m_xContext, @@ -714,6 +715,7 @@ void ToolBarManager::CreateControllers() m_pToolBar, aCommandURL, nId, + nWidth, aControlType ), UNO_QUERY ); xController = xStatusListener; diff --git a/framework/source/uielement/toolbarmerger.cxx b/framework/source/uielement/toolbarmerger.cxx index 8d12efb926b4..4f97ee2132c0 100644 --- a/framework/source/uielement/toolbarmerger.cxx +++ b/framework/source/uielement/toolbarmerger.cxx @@ -33,6 +33,7 @@ static const char MERGE_TOOLBAR_IMAGEID[] = "ImageIdentifier"; static const char MERGE_TOOLBAR_CONTEXT[] = "Context"; static const char MERGE_TOOLBAR_TARGET[] = "Target"; static const char MERGE_TOOLBAR_CONTROLTYPE[] = "ControlType"; +static const char MERGE_TOOLBAR_WIDTH[] = "Width"; static const char MERGECOMMAND_ADDAFTER[] = "AddAfter"; static const char MERGECOMMAND_ADDBEFORE[] = "AddBefore"; @@ -120,7 +121,8 @@ bool ToolBarMerger::ConvertSeqSeqToVector( aAddonToolbarItem.aImageIdentifier, aAddonToolbarItem.aTarget, aAddonToolbarItem.aContext, - aAddonToolbarItem.aControlType ); + aAddonToolbarItem.aControlType, + aAddonToolbarItem.nWidth ); rContainer.push_back( aAddonToolbarItem ); } @@ -184,7 +186,8 @@ void ToolBarMerger::ConvertSequenceToValues( OUString& rImageIdentifier, OUString& rTarget, OUString& rContext, - OUString& rControlType ) + OUString& rControlType, + sal_uInt16& rWidth ) { for ( sal_Int32 i = 0; i < rSequence.getLength(); i++ ) { @@ -200,6 +203,12 @@ void ToolBarMerger::ConvertSequenceToValues( rSequence[i].Value >>= rTarget; else if ( rSequence[i].Name == MERGE_TOOLBAR_CONTROLTYPE ) rSequence[i].Value >>= rControlType; + else if ( rSequence[i].Name == MERGE_TOOLBAR_WIDTH ) + { + sal_Int32 aValue = 0; + rSequence[i].Value >>= aValue; + rWidth = sal_uInt16( aValue ); + } } } @@ -622,6 +631,7 @@ bool ToolBarMerger::RemoveItems( ToolBox* pToolbar, const OUString& rCommandURL, sal_uInt16 nId, + sal_uInt16 nWidth, const OUString& rControlType ) { ::cppu::OWeakObject* pResult( nullptr ); @@ -629,15 +639,15 @@ bool ToolBarMerger::RemoveItems( if ( rControlType == TOOLBARCONTROLLER_BUTTON ) pResult = new ButtonToolbarController( rxContext, pToolbar, rCommandURL ); else if ( rControlType == TOOLBARCONTROLLER_COMBOBOX ) - pResult = new ComboboxToolbarController( rxContext, xFrame, pToolbar, nId, 0, rCommandURL ); + pResult = new ComboboxToolbarController( rxContext, xFrame, pToolbar, nId, nWidth, rCommandURL ); else if ( rControlType == TOOLBARCONTROLLER_EDIT ) - pResult = new EditToolbarController( rxContext, xFrame, pToolbar, nId, 0, rCommandURL ); + pResult = new EditToolbarController( rxContext, xFrame, pToolbar, nId, nWidth, rCommandURL ); else if ( rControlType == TOOLBARCONTROLLER_SPINFIELD ) - pResult = new SpinfieldToolbarController( rxContext, xFrame, pToolbar, nId, 0, rCommandURL ); + pResult = new SpinfieldToolbarController( rxContext, xFrame, pToolbar, nId, nWidth, rCommandURL ); else if ( rControlType == TOOLBARCONTROLLER_IMGBUTTON ) pResult = new ImageButtonToolbarController( rxContext, xFrame, pToolbar, nId, rCommandURL ); else if ( rControlType == TOOLBARCONTROLLER_DROPDOWNBOX ) - pResult = new DropdownToolbarController( rxContext, xFrame, pToolbar, nId, 0, rCommandURL ); + pResult = new DropdownToolbarController( rxContext, xFrame, pToolbar, nId, nWidth, rCommandURL ); else if ( rControlType == TOOLBARCONTROLLER_DROPDOWNBTN ) pResult = new ToggleButtonToolbarController( rxContext, xFrame, pToolbar, nId, ToggleButtonToolbarController::STYLE_DROPDOWNBUTTON, rCommandURL ); @@ -664,6 +674,7 @@ void ToolBarMerger::CreateToolbarItem( ToolBox* pToolbar, sal_uInt16 nPos, sal_u pAddonParams->aImageId = rItem.aImageIdentifier; pAddonParams->aTarget = rItem.aTarget; pAddonParams->aControlType = rItem.aControlType; + pAddonParams->nWidth = rItem.nWidth; pToolbar->SetItemData( nItemId, pAddonParams ); } |