summaryrefslogtreecommitdiff
path: root/framework/source/uielement
diff options
context:
space:
mode:
Diffstat (limited to 'framework/source/uielement')
-rw-r--r--framework/source/uielement/controlmenucontroller.cxx2
-rw-r--r--framework/source/uielement/fontmenucontroller.cxx4
-rw-r--r--framework/source/uielement/fontsizemenucontroller.cxx4
-rw-r--r--framework/source/uielement/headermenucontroller.cxx4
-rw-r--r--framework/source/uielement/langselectionmenucontroller.cxx2
-rw-r--r--framework/source/uielement/langselectionstatusbarcontroller.cxx4
-rw-r--r--framework/source/uielement/menubarmanager.cxx12
-rw-r--r--framework/source/uielement/newmenucontroller.cxx44
-rw-r--r--framework/source/uielement/objectmenucontroller.cxx4
-rw-r--r--framework/source/uielement/recentfilesmenucontroller.cxx52
-rw-r--r--framework/source/uielement/toolbarmanager.cxx12
-rw-r--r--framework/source/uielement/toolbarsmenucontroller.cxx48
12 files changed, 101 insertions, 91 deletions
diff --git a/framework/source/uielement/controlmenucontroller.cxx b/framework/source/uielement/controlmenucontroller.cxx
index bb33aa6c89..56cbdde695 100644
--- a/framework/source/uielement/controlmenucontroller.cxx
+++ b/framework/source/uielement/controlmenucontroller.cxx
@@ -62,7 +62,7 @@
#include <rtl/ustrbuf.hxx>
#include <rtl/strbuf.hxx>
#ifndef _SOLAR_HRC
-#include <svtools/solar.hrc>
+#include <svl/solar.hrc>
#endif
#include <tools/rcid.h>
#include <vcl/image.hxx>
diff --git a/framework/source/uielement/fontmenucontroller.cxx b/framework/source/uielement/fontmenucontroller.cxx
index 320e7ffbe1..24e879b5ad 100644
--- a/framework/source/uielement/fontmenucontroller.cxx
+++ b/framework/source/uielement/fontmenucontroller.cxx
@@ -188,7 +188,9 @@ void FontMenuController::impl_select(const Reference< XDispatch >& _xDispatch,co
m_xFrame,
aTargetURL,
Sequence<PropertyValue>());
- _xDispatch->dispatch( aTargetURL, aArgs );
+ OSL_ENSURE(_xDispatch.is(),"FontMenuController::impl_select: No dispatch");
+ if ( _xDispatch.is() )
+ _xDispatch->dispatch( aTargetURL, aArgs );
}
void SAL_CALL FontMenuController::activate( const css::awt::MenuEvent& ) throw (RuntimeException)
diff --git a/framework/source/uielement/fontsizemenucontroller.cxx b/framework/source/uielement/fontsizemenucontroller.cxx
index e3ff3f2033..56a14f4ba4 100644
--- a/framework/source/uielement/fontsizemenucontroller.cxx
+++ b/framework/source/uielement/fontsizemenucontroller.cxx
@@ -326,7 +326,9 @@ void FontSizeMenuController::impl_select(const Reference< XDispatch >& _xDispatc
Sequence<PropertyValue> aArgs;
if(::comphelper::UiEventsLogger::isEnabled()) //#i88653#
UiEventLogHelper(::rtl::OUString::createFromAscii("FontSizeMenuController")).log(m_xServiceManager, m_xFrame, aTargetURL, aArgs);
- _xDispatch->dispatch( aTargetURL, aArgs );
+ OSL_ENSURE(_xDispatch.is(),"FontSizeMenuController::impl_select: No dispatch");
+ if ( _xDispatch.is() )
+ _xDispatch->dispatch( aTargetURL, aArgs );
}
// XPopupMenuController
diff --git a/framework/source/uielement/headermenucontroller.cxx b/framework/source/uielement/headermenucontroller.cxx
index 7882abbb94..3ab8386c87 100644
--- a/framework/source/uielement/headermenucontroller.cxx
+++ b/framework/source/uielement/headermenucontroller.cxx
@@ -254,7 +254,9 @@ void HeaderMenuController::impl_select(const Reference< XDispatch >& _xDispatch,
Sequence<PropertyValue> aArgs;
if(::comphelper::UiEventsLogger::isEnabled()) //#i88653#
UiEventLogHelper(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(m_bFooter ? "FooterMenuController" : "HeaderMenuController"))).log(m_xServiceManager, m_xFrame, aTargetURL, aArgs);
- _xDispatch->dispatch( aTargetURL, aArgs );
+ OSL_ENSURE(_xDispatch.is(),"HeaderMenuController::impl_select: No dispatch");
+ if ( _xDispatch.is() )
+ _xDispatch->dispatch( aTargetURL, aArgs );
}
void SAL_CALL HeaderMenuController::updatePopupMenu() throw (::com::sun::star::uno::RuntimeException)
diff --git a/framework/source/uielement/langselectionmenucontroller.cxx b/framework/source/uielement/langselectionmenucontroller.cxx
index a2f8ec271a..d91d389931 100644
--- a/framework/source/uielement/langselectionmenucontroller.cxx
+++ b/framework/source/uielement/langselectionmenucontroller.cxx
@@ -68,7 +68,7 @@
#include <com/sun/star/linguistic2/XLanguageGuessing.hpp>
#include <map>
#include <i18npool/mslangid.hxx>
-#include <svtools/languageoptions.hxx>
+#include <svl/languageoptions.hxx>
#include <com/sun/star/awt/MenuItemStyle.hpp>
#include <svtools/langtab.hxx>
#include <classes/fwlresid.hxx>
diff --git a/framework/source/uielement/langselectionstatusbarcontroller.cxx b/framework/source/uielement/langselectionstatusbarcontroller.cxx
index a99c60a10e..d56a120c75 100644
--- a/framework/source/uielement/langselectionstatusbarcontroller.cxx
+++ b/framework/source/uielement/langselectionstatusbarcontroller.cxx
@@ -71,7 +71,7 @@
#include <toolkit/unohlp.hxx>
#include <tools/gen.hxx>
#include <com/sun/star/awt/Command.hpp>
-#include <svtools/languageoptions.hxx>
+#include <svl/languageoptions.hxx>
#include <com/sun/star/linguistic2/XLanguageGuessing.hpp>
#include <dispatch/uieventloghelper.hxx>
@@ -337,7 +337,7 @@ void LangSelectionStatusbarController::LangMenu()throw (::com::sun::star::uno::R
mRectangle.Y = mMousePos.Y();
sal_Int16 nId = xPopupMenu->execute( xParent, mRectangle, com::sun::star::awt::PopupMenuDirection::EXECUTE_UP+16 );
//click "More..."
- if ( m_xFrame.is() )
+ if ( nId && m_xFrame.is() )
{
uno::Reference< XDispatchProvider > xDispatchProvider( m_xFrame, UNO_QUERY );
util::URL aURL;
diff --git a/framework/source/uielement/menubarmanager.cxx b/framework/source/uielement/menubarmanager.cxx
index f5991c9d86..730e022ab0 100644
--- a/framework/source/uielement/menubarmanager.cxx
+++ b/framework/source/uielement/menubarmanager.cxx
@@ -1,7 +1,7 @@
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
+ *
* Copyright 2008 by Sun Microsystems, Inc.
*
* OpenOffice.org - a multi-platform office productivity suite
@@ -82,9 +82,9 @@
#include <comphelper/processfactory.hxx>
#include <comphelper/extract.hxx>
#include <svtools/menuoptions.hxx>
-#include <svtools/historyoptions.hxx>
-#include <svtools/pathoptions.hxx>
-#include <svtools/cmdoptions.hxx>
+#include <unotools/historyoptions.hxx>
+#include <unotools/pathoptions.hxx>
+#include <unotools/cmdoptions.hxx>
#include <unotools/localfilehelper.hxx>
#ifndef _TOOLKIT_HELPER_VCLUNOHELPER_HXX_
#include <toolkit/unohlp.hxx>
@@ -541,7 +541,7 @@ throw ( RuntimeException )
)
bEnabledItem = sal_True;
#endif
-
+
// Enable/disable item
if ( bEnabledItem != bMenuItemEnabled )
m_pVCLMenu->EnableItem( pMenuItemHandler->nItemId, bEnabledItem );
@@ -2104,7 +2104,7 @@ void MenuBarManager::Init(const Reference< XFrame >& rFrame,AddonMenu* pAddonMen
PopupMenu* pCtlPopupMenu = (PopupMenu *)pVCLXPopupMenu->GetMenu();
pAddonMenu->SetPopupMenu( pMenuItemHandler->nItemId, pCtlPopupMenu );
pMenuItemHandler->xPopupMenu = Reference< com::sun::star::awt::XPopupMenu >( (OWeakObject *)pVCLXPopupMenu, UNO_QUERY );
-
+
}
}
m_aMenuItemHandlerVector.push_back( pMenuItemHandler );
diff --git a/framework/source/uielement/newmenucontroller.cxx b/framework/source/uielement/newmenucontroller.cxx
index 7dc52b4f5a..fa90f0c161 100644
--- a/framework/source/uielement/newmenucontroller.cxx
+++ b/framework/source/uielement/newmenucontroller.cxx
@@ -1,7 +1,7 @@
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
+ *
* Copyright 2008 by Sun Microsystems, Inc.
*
* OpenOffice.org - a multi-platform office productivity suite
@@ -68,7 +68,7 @@
#include <osl/file.hxx>
#include <svtools/menuoptions.hxx>
#include <svtools/acceleratorexecute.hxx>
-#include <svtools/moduleoptions.hxx>
+#include <unotools/moduleoptions.hxx>
#include <dispatch/uieventloghelper.hxx>
//_________________________________________________________________________________________________________________
@@ -112,11 +112,11 @@ void NewMenuController::setMenuImages( PopupMenu* pPopupMenu, sal_Bool bSetImage
{
sal_Bool bImageSet( sal_False );
::rtl::OUString aImageId;
-
+
AddInfoForId::const_iterator pInfo = m_aAddInfoForItem.find( nItemId );
if ( pInfo != m_aAddInfoForItem.end() )
aImageId = pInfo->second.aImageId; // Retrieve image id for menu item
-
+
if ( aImageId.getLength() > 0 )
{
aImage = GetImageFromURL( xFrame, aImageId, FALSE, bHiContrast );
@@ -132,7 +132,7 @@ void NewMenuController::setMenuImages( PopupMenu* pPopupMenu, sal_Bool bSetImage
String aCmd( pPopupMenu->GetItemCommand( nItemId ) );
if ( aCmd.Len() )
aImage = GetImageFromURL( xFrame, aCmd, FALSE, bHiContrast );
-
+
if ( !!aImage )
pPopupMenu->SetItemImage( nItemId, aImage );
}
@@ -149,7 +149,7 @@ void NewMenuController::determineAndSetNewDocAccel( PopupMenu* pPopupMenu, const
USHORT nId( 0 );
sal_Bool bFound( sal_False );
rtl::OUString aCommand;
-
+
if ( m_aEmptyDocURL.getLength() > 0 )
{
// Search for the empty document URL
@@ -169,7 +169,7 @@ void NewMenuController::determineAndSetNewDocAccel( PopupMenu* pPopupMenu, const
}
}
}
-
+
if ( !bFound )
{
// Search for the default module name
@@ -265,25 +265,25 @@ void NewMenuController::setAccelerators( PopupMenu* pPopupMenu )
aCmds.push_back( pPopupMenu->GetItemCommand( nId ));
}
}
-
+
sal_uInt32 nSeqCount( aIds.size() );
if ( m_bNewMenu )
nSeqCount+=1;
Sequence< rtl::OUString > aSeq( nSeqCount );
-
+
// Add a special command for our "New" menu.
if ( m_bNewMenu )
{
aSeq[nSeqCount-1] = m_aCommandURL;
aMenuShortCuts.push_back( aEmptyKeyCode );
}
-
+
const sal_uInt32 nCount = aCmds.size();
for ( sal_uInt32 i = 0; i < nCount; i++ )
aSeq[i] = aCmds[i];
-
+
if ( m_xGlobalAcceleratorManager.is() )
retrieveShortcutsFromConfiguration( xGlobalAccelCfg, aSeq, aMenuShortCuts );
if ( m_xModuleAcceleratorManager.is() )
@@ -305,7 +305,7 @@ void NewMenuController::setAccelerators( PopupMenu* pPopupMenu )
}
}
-void NewMenuController::retrieveShortcutsFromConfiguration(
+void NewMenuController::retrieveShortcutsFromConfiguration(
const Reference< XAcceleratorConfiguration >& rAccelCfg,
const Sequence< rtl::OUString >& rCommands,
std::vector< KeyCode >& aMenuShortCuts )
@@ -359,7 +359,7 @@ void NewMenuController::fillPopupMenu( Reference< css::awt::XPopupMenu >& rPopup
{
MenuConfiguration aMenuCfg( m_xServiceManager );
BmkMenu* pSubMenu( 0 );
-
+
if ( m_bNewMenu )
pSubMenu = (BmkMenu*)aMenuCfg.CreateBookmarkMenu( m_xFrame, BOOKMARK_NEWMENU );
else
@@ -370,13 +370,13 @@ void NewMenuController::fillPopupMenu( Reference< css::awt::XPopupMenu >& rPopup
Image aImage;
AddInfo aAddInfo;
-
+
// retrieve additional parameters from bookmark menu and
// store it in a hash_map.
for ( USHORT i = 0; i < pSubMenu->GetItemCount(); i++ )
{
USHORT nItemId = pSubMenu->GetItemId( sal::static_int_cast<USHORT>( i ) );
- if (( nItemId != 0 ) &&
+ if (( nItemId != 0 ) &&
( pSubMenu->GetItemType( nItemId ) != MENUITEM_SEPARATOR ))
{
MenuConfiguration::Attributes* pBmkAttributes = (MenuConfiguration::Attributes *)(pSubMenu->GetUserValue( nItemId ));
@@ -384,15 +384,15 @@ void NewMenuController::fillPopupMenu( Reference< css::awt::XPopupMenu >& rPopup
{
aAddInfo.aTargetFrame = pBmkAttributes->aTargetFrame;
aAddInfo.aImageId = pBmkAttributes->aImageId;
-
+
m_aAddInfoForItem.insert( AddInfoForId::value_type( nItemId, aAddInfo ));
}
}
}
-
+
if ( m_bShowImages )
setMenuImages( pVCLPopupMenu, m_bShowImages, m_bHiContrast );
-
+
delete pSubMenu;
}
}
@@ -489,8 +489,8 @@ void SAL_CALL NewMenuController::activate( const css::awt::MenuEvent& ) throw (R
sal_Bool bHiContrast( rSettings.GetHighContrastMode() );
PopupMenu* pVCLPopupMenu = (PopupMenu *)pPopupMenu->GetMenu();
-
- if (( m_bShowImages != bShowImages ) ||
+
+ if (( m_bShowImages != bShowImages ) ||
( m_bHiContrast != bHiContrast ))
{
m_bShowImages = bShowImages;
@@ -498,7 +498,7 @@ void SAL_CALL NewMenuController::activate( const css::awt::MenuEvent& ) throw (R
setMenuImages( pVCLPopupMenu, m_bShowImages, m_bHiContrast );
}
-
+
setAccelerators( pVCLPopupMenu );
}
}
@@ -507,7 +507,7 @@ void SAL_CALL NewMenuController::activate( const css::awt::MenuEvent& ) throw (R
// XPopupMenuController
void NewMenuController::impl_setPopupMenu()
{
-
+
if ( m_xPopupMenu.is() )
fillPopupMenu( m_xPopupMenu );
diff --git a/framework/source/uielement/objectmenucontroller.cxx b/framework/source/uielement/objectmenucontroller.cxx
index accc576f31..16be5513e2 100644
--- a/framework/source/uielement/objectmenucontroller.cxx
+++ b/framework/source/uielement/objectmenucontroller.cxx
@@ -160,7 +160,9 @@ void ObjectMenuController::impl_select(const Reference< XDispatch >& _xDispatch,
Sequence<PropertyValue> aArgs;
if(::comphelper::UiEventsLogger::isEnabled()) //#i88653#
UiEventLogHelper(::rtl::OUString::createFromAscii("ObjectMenuController")).log(m_xServiceManager, m_xFrame, aTargetURL, aArgs);
- _xDispatch->dispatch( aTargetURL, aArgs );
+ OSL_ENSURE(_xDispatch.is(),"ObjectMenuController::impl_select: No dispatch");
+ if ( _xDispatch.is() )
+ _xDispatch->dispatch( aTargetURL, aArgs );
}
}
diff --git a/framework/source/uielement/recentfilesmenucontroller.cxx b/framework/source/uielement/recentfilesmenucontroller.cxx
index 7ab450d59c..5bf8611801 100644
--- a/framework/source/uielement/recentfilesmenucontroller.cxx
+++ b/framework/source/uielement/recentfilesmenucontroller.cxx
@@ -1,7 +1,7 @@
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
+ *
* Copyright 2008 by Sun Microsystems, Inc.
*
* OpenOffice.org - a multi-platform office productivity suite
@@ -62,7 +62,7 @@
#include <vcl/i18nhelp.hxx>
#include <tools/urlobj.hxx>
#include <rtl/ustrbuf.hxx>
-#include <svtools/historyoptions.hxx>
+#include <unotools/historyoptions.hxx>
#include <cppuhelper/implbase1.hxx>
#include <osl/file.hxx>
//#include <tools/solar.hrc>
@@ -135,7 +135,7 @@ void RecentFilesMenuController::fillPopupMenu( Reference< css::awt::XPopupMenu >
Reference< XStringWidth > xStringLength( new RecentFilesStringLength );
int nPickListMenuItems = ( aHistoryList.getLength() > 99 ) ? 99 : aHistoryList.getLength();
-
+
// New vnd.sun.star.popup: command URL to support direct dispatches
const rtl::OUString aCmdPrefix( RTL_CONSTASCII_USTRINGPARAM( "vnd.sun.star.popup:RecentFileList?entry=" ));
@@ -253,11 +253,11 @@ void RecentFilesMenuController::executeEntry( sal_Int32 nIndex )
xDispatchProvider = Reference< XDispatchProvider >( m_xFrame, UNO_QUERY );
xServiceManager = m_xServiceManager;
aLock.unlock();
-
+
css::util::URL aTargetURL;
Sequence< PropertyValue > aArgsList;
-
- if (( nIndex >= 0 ) &&
+
+ if (( nIndex >= 0 ) &&
( nIndex < sal::static_int_cast<sal_Int32>( m_aRecentFilesItems.size() )))
{
const RecentFile& rRecentFile = m_aRecentFilesItems[ nIndex ];
@@ -353,7 +353,7 @@ void SAL_CALL RecentFilesMenuController::select( const css::awt::MenuEvent& rEve
VCLXPopupMenu* pPopupMenu = (VCLXPopupMenu *)VCLXPopupMenu::GetImplementation( xPopupMenu );
if ( pPopupMenu )
executeEntry( rEvent.MenuId-1 );
- }
+ }
}
void SAL_CALL RecentFilesMenuController::activate( const css::awt::MenuEvent& ) throw (RuntimeException)
@@ -372,7 +372,7 @@ void RecentFilesMenuController::impl_setPopupMenu()
void SAL_CALL RecentFilesMenuController::updatePopupMenu() throw (RuntimeException)
{
ResetableGuard aLock( m_aLock );
-
+
if ( m_bDisposed )
throw DisposedException();
@@ -392,17 +392,17 @@ void SAL_CALL RecentFilesMenuController::updatePopupMenu() throw (RuntimeExcepti
}
// XDispatchProvider
-Reference< XDispatch > SAL_CALL RecentFilesMenuController::queryDispatch(
- const URL& aURL,
- const ::rtl::OUString& /*sTarget*/,
- sal_Int32 /*nFlags*/ )
+Reference< XDispatch > SAL_CALL RecentFilesMenuController::queryDispatch(
+ const URL& aURL,
+ const ::rtl::OUString& /*sTarget*/,
+ sal_Int32 /*nFlags*/ )
throw( RuntimeException )
{
ResetableGuard aLock( m_aLock );
-
+
if ( m_bDisposed )
throw DisposedException();
-
+
if ( aURL.Complete.indexOf( m_aBaseURL ) == 0 )
return Reference< XDispatch >( static_cast< OWeakObject* >( this ), UNO_QUERY );
else
@@ -410,13 +410,13 @@ throw( RuntimeException )
}
// XDispatch
-void SAL_CALL RecentFilesMenuController::dispatch(
- const URL& aURL,
- const Sequence< PropertyValue >& /*seqProperties*/ )
+void SAL_CALL RecentFilesMenuController::dispatch(
+ const URL& aURL,
+ const Sequence< PropertyValue >& /*seqProperties*/ )
throw( RuntimeException )
{
ResetableGuard aLock( m_aLock );
-
+
if ( m_bDisposed )
throw DisposedException();
@@ -433,7 +433,7 @@ throw( RuntimeException )
{
sal_Int32 nAddArgs = aURL.Complete.indexOf( '&', nEntryPos );
rtl::OUString aEntryArg;
-
+
if ( nAddArgs < 0 )
aEntryArg = aURL.Complete.copy( nEntryPos );
else
@@ -446,22 +446,22 @@ throw( RuntimeException )
}
}
-void SAL_CALL RecentFilesMenuController::addStatusListener(
- const Reference< XStatusListener >& xControl,
- const URL& aURL )
+void SAL_CALL RecentFilesMenuController::addStatusListener(
+ const Reference< XStatusListener >& xControl,
+ const URL& aURL )
throw( RuntimeException )
{
ResetableGuard aLock( m_aLock );
-
+
if ( m_bDisposed )
throw DisposedException();
-
+
PopupMenuControllerBase::addStatusListener( xControl, aURL );
}
void SAL_CALL RecentFilesMenuController::removeStatusListener(
- const Reference< XStatusListener >& xControl,
- const URL& aURL )
+ const Reference< XStatusListener >& xControl,
+ const URL& aURL )
throw( RuntimeException )
{
PopupMenuControllerBase::removeStatusListener( xControl, aURL );
diff --git a/framework/source/uielement/toolbarmanager.cxx b/framework/source/uielement/toolbarmanager.cxx
index 6d5add117e..d9a35ede35 100644
--- a/framework/source/uielement/toolbarmanager.cxx
+++ b/framework/source/uielement/toolbarmanager.cxx
@@ -85,13 +85,13 @@
//_________________________________________________________________________________________________________________
#include <svtools/imgdef.hxx>
#include <svtools/toolboxcontroller.hxx>
-#include <svtools/cmdoptions.hxx>
+#include <unotools/cmdoptions.hxx>
#ifndef _TOOLKIT_HELPER_VCLUNOHELPER_HXX_
#include <toolkit/unohlp.hxx>
#endif
#include <comphelper/mediadescriptor.hxx>
#include <svtools/miscopt.hxx>
-#include <svtools/imageitm.hxx>
+#include <svl/imageitm.hxx>
#include <svtools/framestatuslistener.hxx>
#include <vcl/svapp.hxx>
#include <vcl/menu.hxx>
@@ -99,7 +99,7 @@
#include <vcl/taskpanelist.hxx>
#include <rtl/logfile.hxx>
#include <svtools/menuoptions.hxx>
-#include <svtools/cmdoptions.hxx>
+#include <unotools/cmdoptions.hxx>
#include <boost/bind.hpp>
//_________________________________________________________________________________________________________________
@@ -341,9 +341,11 @@ void ToolBarManager::Destroy()
delete static_cast< AddonsParams* >( m_pToolBar->GetItemData( nItemId ));
}
+ // Hide toolbar as lazy delete can destroy the toolbar much later.
+ m_pToolBar->Hide();
/* #i99167# removed change for i93173 since there is some weird crash */
// #i93173# delete toolbar lazily as we can still be in one of its handlers
- m_pToolBar->doLazyDelete();
+ m_pToolBar->doLazyDelete();
Link aEmpty;
m_pToolBar->SetSelectHdl( aEmpty );
@@ -1388,7 +1390,7 @@ void ToolBarManager::RequestImages()
// empty image.
if ( !aImage )
aImage = QueryAddonsImage( aCmdURLSeq[i], bBigImages, m_bIsHiContrast );
-
+
pIter->second.nImageInfo = 1; // mark image as module based
}
else
diff --git a/framework/source/uielement/toolbarsmenucontroller.cxx b/framework/source/uielement/toolbarsmenucontroller.cxx
index f0359f3fba..86aad1a41c 100644
--- a/framework/source/uielement/toolbarsmenucontroller.cxx
+++ b/framework/source/uielement/toolbarsmenucontroller.cxx
@@ -1,7 +1,7 @@
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
+ *
* Copyright 2008 by Sun Microsystems, Inc.
*
* OpenOffice.org - a multi-platform office productivity suite
@@ -80,7 +80,7 @@
#endif
#include <vcl/window.hxx>
#include <svtools/menuoptions.hxx>
-#include <svtools/cmdoptions.hxx>
+#include <unotools/cmdoptions.hxx>
#include <dispatch/uieventloghelper.hxx>
#include <rtl/logfile.hxx>
@@ -143,7 +143,7 @@ Reference< XLayoutManager > getLayoutManagerFromFrame( const Reference< XFrame >
{
Reference< XPropertySet > xPropSet( rFrame, UNO_QUERY );
Reference< XLayoutManager > xLayoutManager;
-
+
try
{
xPropSet->getPropertyValue( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "LayoutManager" ))) >>= xLayoutManager;
@@ -183,7 +183,7 @@ ToolbarsMenuController::~ToolbarsMenuController()
{
}
-void ToolbarsMenuController::addCommand(
+void ToolbarsMenuController::addCommand(
Reference< css::awt::XPopupMenu >& rPopupMenu, const rtl::OUString& rCommandURL, USHORT nHelpId, const rtl::OUString& rLabel )
{
USHORT nItemId = m_xPopupMenu->getItemCount()+1;
@@ -193,11 +193,11 @@ void ToolbarsMenuController::addCommand(
aLabel = getUINameFromCommand( rCommandURL );
else
aLabel = rLabel;
-
+
rPopupMenu->insertItem( nItemId, aLabel, 0, nItemId );
Reference< awt::XMenuExtended > xMenuExtended( m_xPopupMenu, UNO_QUERY );
xMenuExtended->setCommand( nItemId, rCommandURL );
-
+
bool bInternal = ( rCommandURL.indexOf( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( STATIC_INTERNAL_CMD_PART ))) == 0);
if ( !bInternal )
{
@@ -206,10 +206,10 @@ void ToolbarsMenuController::addCommand(
}
vos::OGuard aSolarMutexGuard( Application::GetSolarMutex() );
-
+
Image aImage;
const StyleSettings& rSettings = Application::GetSettings().GetStyleSettings();
-
+
if ( rSettings.GetUseImagesInMenus() )
aImage = GetImageFromURL( m_xFrame, rCommandURL, FALSE, rSettings.GetHighContrastMode() );
@@ -407,8 +407,8 @@ void ToolbarsMenuController::fillPopupMenu( Reference< css::awt::XPopupMenu >& r
Sequence< Sequence< com::sun::star::beans::PropertyValue > > aSeqToolBars =
m_xModuleCfgMgr->getUIElementsInfo( UIElementType::TOOLBAR );
fillHashMap( aSeqToolBars, aToolbarHashMap );
- }
-
+ }
+
std::vector< ToolBarEntry > aSortedTbs;
rtl::OUString aStaticCmdPart( RTL_CONSTASCII_USTRINGPARAM( STATIC_CMD_PART ));
@@ -524,14 +524,14 @@ void ToolbarsMenuController::fillPopupMenu( Reference< css::awt::XPopupMenu >& r
sal_Bool bAddCommand( sal_True );
SvtCommandOptions aCmdOptions;
rtl::OUString aConfigureToolbar( RTL_CONSTASCII_USTRINGPARAM( CONFIGURE_TOOLBARS ));
-
+
if ( aCmdOptions.HasEntries( SvtCommandOptions::CMDOPTION_DISABLED ))
{
- if ( aCmdOptions.Lookup( SvtCommandOptions::CMDOPTION_DISABLED,
+ if ( aCmdOptions.Lookup( SvtCommandOptions::CMDOPTION_DISABLED,
rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( CONFIGURE_TOOLBARS_CMD ))))
bAddCommand = sal_False;
}
-
+
if ( bAddCommand )
{
// Create command for configure
@@ -777,7 +777,7 @@ void SAL_CALL ToolbarsMenuController::select( const css::awt::MenuEvent& rEvent
}
else
{
- // closing means:
+ // closing means:
// hide and destroy element
xLayoutManager->hideElement( aToolBarResName );
xLayoutManager->destroyElement( aToolBarResName );
@@ -833,7 +833,7 @@ void SAL_CALL ToolbarsMenuController::activate( const css::awt::MenuEvent& ) thr
void SAL_CALL ToolbarsMenuController::setPopupMenu( const Reference< css::awt::XPopupMenu >& xPopupMenu ) throw ( RuntimeException )
{
ResetableGuard aLock( m_aLock );
-
+
if ( m_bDisposed )
throw DisposedException();
@@ -841,13 +841,13 @@ void SAL_CALL ToolbarsMenuController::setPopupMenu( const Reference< css::awt::X
{
// Create popup menu on demand
vos::OGuard aSolarMutexGuard( Application::GetSolarMutex() );
-
+
m_xPopupMenu = xPopupMenu;
m_xPopupMenu->addMenuListener( Reference< css::awt::XMenuListener >( (OWeakObject*)this, UNO_QUERY ));
fillPopupMenu( m_xPopupMenu );
- }
+ }
}
-
+
// XInitialization
void SAL_CALL ToolbarsMenuController::initialize( const Sequence< Any >& aArguments ) throw ( Exception, RuntimeException )
{
@@ -856,14 +856,14 @@ void SAL_CALL ToolbarsMenuController::initialize( const Sequence< Any >& aArgume
if ( !bInitalized )
{
PopupMenuControllerBase::initialize(aArguments);
-
+
if ( m_bInitialized )
{
- Reference< XModuleManager > xModuleManager( m_xServiceManager->createInstance(
- SERVICENAME_MODULEMANAGER ),
+ Reference< XModuleManager > xModuleManager( m_xServiceManager->createInstance(
+ SERVICENAME_MODULEMANAGER ),
UNO_QUERY );
- Reference< XNameAccess > xPersistentWindowStateSupplier( m_xServiceManager->createInstance(
- SERVICENAME_WINDOWSTATECONFIGURATION ),
+ Reference< XNameAccess > xPersistentWindowStateSupplier( m_xServiceManager->createInstance(
+ SERVICENAME_WINDOWSTATECONFIGURATION ),
UNO_QUERY );
// Retrieve persistent window state reference for our module
@@ -916,7 +916,7 @@ IMPL_STATIC_LINK_NOINSTANCE( ToolbarsMenuController, ExecuteHdl_Impl, ExecuteInf
catch ( Exception& )
{
}
-
+
delete pExecuteInfo;
return 0;
}