summaryrefslogtreecommitdiff
path: root/framework/source/uielement/controlmenucontroller.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'framework/source/uielement/controlmenucontroller.cxx')
-rw-r--r--framework/source/uielement/controlmenucontroller.cxx28
1 files changed, 14 insertions, 14 deletions
diff --git a/framework/source/uielement/controlmenucontroller.cxx b/framework/source/uielement/controlmenucontroller.cxx
index 556414c84c..a2aa126948 100644
--- a/framework/source/uielement/controlmenucontroller.cxx
+++ b/framework/source/uielement/controlmenucontroller.cxx
@@ -255,13 +255,13 @@ void ControlMenuController::fillPopupMenu( Reference< css::awt::XPopupMenu >& rP
{
VCLXPopupMenu* pPopupMenu = (VCLXPopupMenu *)VCLXMenu::GetImplementation( rPopupMenu );
PopupMenu* pVCLPopupMenu = 0;
-
+
SolarMutexGuard aSolarMutexGuard;
-
+
resetPopupMenu( rPopupMenu );
if ( pPopupMenu )
pVCLPopupMenu = (PopupMenu *)pPopupMenu->GetMenu();
-
+
if ( pVCLPopupMenu && m_pResPopupMenu )
*pVCLPopupMenu = *m_pResPopupMenu;
}
@@ -275,7 +275,7 @@ void SAL_CALL ControlMenuController::disposing( const EventObject& ) throw ( Run
m_xFrame.clear();
m_xDispatch.clear();
m_xServiceManager.clear();
-
+
if ( m_xPopupMenu.is() )
m_xPopupMenu->removeMenuListener( Reference< css::awt::XMenuListener >(( OWeakObject *)this, UNO_QUERY ));
m_xPopupMenu.clear();
@@ -300,9 +300,9 @@ void SAL_CALL ControlMenuController::statusChanged( const FeatureStateEvent& Eve
if ( nMenuId )
{
VCLXPopupMenu* pPopupMenu = (VCLXPopupMenu *)VCLXMenu::GetImplementation( m_xPopupMenu );
-
+
SolarMutexGuard aSolarMutexGuard;
-
+
PopupMenu* pVCLPopupMenu = (PopupMenu *)pPopupMenu->GetMenu();
if ( !Event.IsEnabled && pVCLPopupMenu->GetItemPos( nMenuId ) != MENU_ITEM_NOTFOUND )
@@ -321,11 +321,11 @@ void SAL_CALL ControlMenuController::statusChanged( const FeatureStateEvent& Eve
if ( nPrevInConversion != MENU_ITEM_NOTFOUND )
break;
}
-
+
if ( MENU_ITEM_NOTFOUND == nPrevInConversion )
// none of the items which precede the nSID-slot in the source menu are present in our conversion menu
nPrevInConversion = sal::static_int_cast< sal_uInt16 >(-1); // put the item at the first position
-
+
pVCLPopupMenu->InsertItem( nMenuId, m_pResPopupMenu->GetItemText( nMenuId ), m_pResPopupMenu->GetItemBits( nMenuId ), ++nPrevInConversion );
pVCLPopupMenu->SetItemImage( nMenuId, m_pResPopupMenu->GetItemImage( nMenuId ));
pVCLPopupMenu->SetHelpId( nMenuId, m_pResPopupMenu->GetHelpId( nMenuId ));
@@ -351,11 +351,11 @@ void ControlMenuController::impl_select(const Reference< XDispatch >& /*_xDispat
void SAL_CALL ControlMenuController::activate( const css::awt::MenuEvent& ) throw (RuntimeException)
{
osl::ResettableMutexGuard aLock( m_aMutex );
-
+
if ( m_xPopupMenu.is() )
{
SolarMutexGuard aSolarMutexGuard;
-
+
// Check if some modes have changed so we have to update our menu images
const StyleSettings& rSettings = Application::GetSettings().GetStyleSettings();
sal_Bool bShowMenuImages = rSettings.GetUseImagesInMenus();
@@ -394,25 +394,25 @@ void ControlMenuController::impl_setPopupMenu()
}
} // if ( m_pResPopupMenu == 0 )
}
-
+
void SAL_CALL ControlMenuController::updatePopupMenu() throw (::com::sun::star::uno::RuntimeException)
{
osl::ResettableMutexGuard aLock( m_aMutex );
throwIfDisposed();
-
+
if ( m_xFrame.is() && m_xPopupMenu.is() )
{
URL aTargetURL;
Reference< XDispatchProvider > xDispatchProvider( m_xFrame, UNO_QUERY );
fillPopupMenu( m_xPopupMenu );
m_aURLToDispatchMap.free();
-
+
for (sal_uInt32 i=0; i < SAL_N_ELEMENTS(aCommands); ++i)
{
aTargetURL.Complete = rtl::OUString::createFromAscii( aCommands[i] );
m_xURLTransformer->parseStrict( aTargetURL );
-
+
Reference< XDispatch > xDispatch = xDispatchProvider->queryDispatch( aTargetURL, ::rtl::OUString(), 0 );
if ( xDispatch.is() )
{