Modified: openoffice/trunk/main/toolkit/source/awt/vclxmenu.cxx
URL: 
http://svn.apache.org/viewvc/openoffice/trunk/main/toolkit/source/awt/vclxmenu.cxx?rev=1425458&r1=1425457&r2=1425458&view=diff
==============================================================================
--- openoffice/trunk/main/toolkit/source/awt/vclxmenu.cxx (original)
+++ openoffice/trunk/main/toolkit/source/awt/vclxmenu.cxx Sun Dec 23 12:29:21 
2012
@@ -1,5 +1,5 @@
 /**************************************************************
- * 
+ *
  * Licensed to the Apache Software Foundation (ASF) under one
  * or more contributor license agreements.  See the NOTICE file
  * distributed with this work for additional information
@@ -7,16 +7,16 @@
  * to you under the Apache License, Version 2.0 (the
  * "License"); you may not use this file except in compliance
  * with the License.  You may obtain a copy of the License at
- * 
+ *
  *   http://www.apache.org/licenses/LICENSE-2.0
- * 
+ *
  * Unless required by applicable law or agreed to in writing,
  * software distributed under the License is distributed on an
  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
  * KIND, either express or implied.  See the License for the
  * specific language governing permissions and limitations
  * under the License.
- * 
+ *
  *************************************************************/
 
 
@@ -24,67 +24,40 @@
 // MARKER(update_precomp.py): autogen include statement, do not remove
 #include "precompiled_toolkit.hxx"
 
-
 #include <toolkit/awt/vclxmenu.hxx>
+#include <toolkit/helper/convert.hxx>
 #include <toolkit/helper/macros.hxx>
 #include <toolkit/helper/servicenames.hxx>
 #include <toolkit/helper/vclunohelper.hxx>
-#include <toolkit/helper/convert.hxx>
+
 #include <cppuhelper/typeprovider.hxx>
 #include <rtl/memory.h>
+#include <rtl/ustrbuf.hxx>
 #include <rtl/uuid.h>
-#include <vos/mutex.hxx>
-
-#include <vcl/menu.hxx>
-#include <vcl/keycod.hxx>
 #include <vcl/image.hxx>
+#include <vcl/keycod.hxx>
+#include <vcl/menu.hxx>
 #include <vcl/mnemonic.hxx>
 #include <vcl/svapp.hxx>
+#include <vos/mutex.hxx>
 
 #include <com/sun/star/awt/KeyModifier.hpp>
 
+using rtl::OUString;
+using rtl::OUStringBuffer;
 
-#ifdef DBG_UTIL
-    #define THROW_MENUITEM_NOT_FOUND( Func, nItemId ) \
-        if ( MENU_ITEM_NOTFOUND == mpMenu->GetItemPos( nItemId ) ) \
-            throw  ::com::sun::star::container::NoSuchElementException( \
-                ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( Func ) ) \
-                += ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( ": There is 
no menu item with " ) ) \
-                += ::rtl::OUString::valueOf( sal_Int32( nItemId ) ) \
-                += ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( " as 
identifier" ) ), \
-                *this \
-            );
-    #define THROW_MENUPOS_NOT_FOUND( Func, nPos ) \
-        if ( MENU_ITEM_NOTFOUND == sal_uInt16( nPos ) ) \
-            throw  ::com::sun::star::container::NoSuchElementException( \
-                ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( Func ) ) \
-                += ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( ": There is 
no menu item at position " ) ) \
-                += ::rtl::OUString::valueOf( sal_Int32( nPos ) ), \
-                *this \
-            );
-#else
-    #define THROW_MENUITEM_NOT_FOUND( Func, nItemId ) \
-        if ( MENU_ITEM_NOTFOUND == mpMenu->GetItemPos( nItemId ) ) \
-            throw  ::com::sun::star::container::NoSuchElementException();
-    #define THROW_MENUPOS_NOT_FOUND( Func, nPos ) \
-        if ( MENU_ITEM_NOTFOUND == sal_uInt16( nPos ) ) \
-            throw  ::com::sun::star::container::NoSuchElementException();
-#endif
-
-
-//     ----------------------------------------------------
-//     class VCLXMenu
-//     ----------------------------------------------------
 
 DBG_NAME(VCLXMenu)
 
-VCLXMenu::VCLXMenu() : maMenuListeners( *this )
+VCLXMenu::VCLXMenu()
+    : maMenuListeners( *this )
 {
     DBG_CTOR( VCLXMenu, 0 );
-       mpMenu = NULL;
+    mpMenu = NULL;
 }
 
-VCLXMenu::VCLXMenu( Menu* pMenu ) : maMenuListeners( *this )
+VCLXMenu::VCLXMenu( Menu* pMenu )
+    : maMenuListeners( *this )
 {
     DBG_CTOR( VCLXMenu, 0 );
     mpMenu = pMenu;
@@ -93,15 +66,15 @@ VCLXMenu::VCLXMenu( Menu* pMenu ) : maMe
 VCLXMenu::~VCLXMenu()
 {
     DBG_DTOR( VCLXMenu, 0 );
-       for ( sal_uInt32 n = maPopupMenueRefs.Count(); n; )
-       {
-               ::com::sun::star::uno::Reference< 
::com::sun::star::awt::XPopupMenu > * pRef = maPopupMenueRefs.GetObject( --n );
-               delete pRef;
-       }
+    for ( sal_uInt32 n = maPopupMenueRefs.Count(); n; )
+    {
+        css::uno::Reference< css::awt::XPopupMenu > * pRef = 
maPopupMenueRefs.GetObject( --n );
+        delete pRef;
+    }
     if ( mpMenu )
     {
         mpMenu->RemoveEventListener( LINK( this, VCLXMenu, MenuEventListener ) 
);
-           delete mpMenu;
+        delete mpMenu;
     }
 }
 
@@ -112,12 +85,12 @@ sal_Bool VCLXMenu::IsPopupMenu() const
 
 void VCLXMenu::ImplCreateMenu( sal_Bool bPopup )
 {
-       DBG_ASSERT( !mpMenu, "CreateMenu: Menu exists!" );
+    DBG_ASSERT( !mpMenu, "CreateMenu: Menu exists!" );
 
-       if ( bPopup )
-               mpMenu = new PopupMenu;
-       else
-               mpMenu = new MenuBar;
+    if ( bPopup )
+        mpMenu = new PopupMenu;
+    else
+        mpMenu = new MenuBar;
 
     mpMenu->AddEventListener( LINK( this, VCLXMenu, MenuEventListener ) );
 }
@@ -136,51 +109,51 @@ IMPL_LINK( VCLXMenu, MenuEventListener, 
             {
                 case VCLEVENT_MENU_SELECT:
                 {
-                       if ( maMenuListeners.getLength() )
-                       {
-                               ::com::sun::star::awt::MenuEvent aEvent;
-                               aEvent.Source = (::cppu::OWeakObject*)this;
-                               aEvent.MenuId = mpMenu->GetCurItemId();
-                               maMenuListeners.select( aEvent );
-                       }
+                    if ( maMenuListeners.getLength() )
+                    {
+                        css::awt::MenuEvent aEvent;
+                        aEvent.Source = (::cppu::OWeakObject*)this;
+                        aEvent.MenuId = mpMenu->GetCurItemId();
+                        maMenuListeners.itemSelected( aEvent );
+                    }
                 }
                 break;
                 case VCLEVENT_OBJECT_DYING:
                 {
-                       mpMenu = NULL;
+                    mpMenu = NULL;
                 }
                 break;
                 case VCLEVENT_MENU_HIGHLIGHT:
                 {
-                       if ( maMenuListeners.getLength() )
-                       {
-                               ::com::sun::star::awt::MenuEvent aEvent;
-                               aEvent.Source = (::cppu::OWeakObject*)this;
-                               aEvent.MenuId = mpMenu->GetCurItemId();
-                               maMenuListeners.highlight( aEvent );
-                       }
+                    if ( maMenuListeners.getLength() )
+                    {
+                        css::awt::MenuEvent aEvent;
+                        aEvent.Source = (::cppu::OWeakObject*)this;
+                        aEvent.MenuId = mpMenu->GetCurItemId();
+                        maMenuListeners.itemHighlighted( aEvent );
+                    }
                 }
                 break;
                 case VCLEVENT_MENU_ACTIVATE:
                 {
-                       if ( maMenuListeners.getLength() )
-                       {
-                               ::com::sun::star::awt::MenuEvent aEvent;
-                               aEvent.Source = (::cppu::OWeakObject*)this;
-                               aEvent.MenuId = mpMenu->GetCurItemId();
-                               maMenuListeners.activate( aEvent );
-                       }
+                    if ( maMenuListeners.getLength() )
+                    {
+                        css::awt::MenuEvent aEvent;
+                        aEvent.Source = (::cppu::OWeakObject*)this;
+                        aEvent.MenuId = mpMenu->GetCurItemId();
+                        maMenuListeners.itemActivated( aEvent );
+                    }
                 }
                 break;
                 case VCLEVENT_MENU_DEACTIVATE:
                 {
-                       if ( maMenuListeners.getLength() )
-                       {
-                               ::com::sun::star::awt::MenuEvent aEvent;
-                               aEvent.Source = (::cppu::OWeakObject*)this;
-                               aEvent.MenuId = mpMenu->GetCurItemId();
-                               maMenuListeners.deactivate( aEvent );
-                       }
+                    if ( maMenuListeners.getLength() )
+                    {
+                        css::awt::MenuEvent aEvent;
+                        aEvent.Source = (::cppu::OWeakObject*)this;
+                        aEvent.MenuId = mpMenu->GetCurItemId();
+                        maMenuListeners.itemDeactivated( aEvent );
+                    }
                 }
                 break;
 
@@ -208,50 +181,46 @@ IMPL_LINK( VCLXMenu, MenuEventListener, 
 }
 
 
-//=============================================================================
-//=============================================================================
-//=============================================================================
-
-
-// ::com::sun::star::lang::XServiceInfo
-::rtl::OUString SAL_CALL VCLXMenu::getImplementationName(  )
-throw (::com::sun::star::uno::RuntimeException)
+OUString SAL_CALL VCLXMenu::getImplementationName(  )
+throw (css::uno::RuntimeException)
 {
     ::osl::ResettableGuard < ::osl::Mutex > aGuard( GetMutex() );
     const sal_Bool bIsPopupMenu = IsPopupMenu();
     aGuard.clear();
 
-    ::rtl::OUString implName( RTL_CONSTASCII_USTRINGPARAM( "stardiv.Toolkit." 
) );
+    OUStringBuffer implName;
+    implName.appendAscii( RTL_CONSTASCII_STRINGPARAM( "stardiv.Toolkit." ) );
     if ( bIsPopupMenu )
-        implName += ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( 
"VCLXPopupMenu" ) );
+        implName.appendAscii( RTL_CONSTASCII_STRINGPARAM( "VCLXPopupMenu" ) );
     else
-        implName += ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( 
"VCLXMenuBar" ) );
+        implName.appendAscii( RTL_CONSTASCII_STRINGPARAM( "VCLXMenuBar" ) );
 
-    return implName;
+    return implName.makeStringAndClear();
 }
 
 
-::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL 
VCLXMenu::getSupportedServiceNames(  )
-throw (::com::sun::star::uno::RuntimeException)
+css::uno::Sequence< OUString > SAL_CALL VCLXMenu::getSupportedServiceNames(  )
+throw (css::uno::RuntimeException)
 {
     ::osl::ResettableGuard < ::osl::Mutex > aGuard( GetMutex() );
     const sal_Bool bIsPopupMenu = IsPopupMenu();
     aGuard.clear();
 
-    ::com::sun::star::uno::Sequence< ::rtl::OUString > aNames( 1 );
+    css::uno::Sequence< OUString > aNames( 1 );
     if ( bIsPopupMenu )
-        aNames[ 0 ] = ::rtl::OUString::createFromAscii( 
szServiceName2_PopupMenu );
+        aNames[ 0 ] = OUString::createFromAscii( szServiceName2_PopupMenu );
     else
-        aNames[ 0 ] = ::rtl::OUString::createFromAscii( szServiceName2_MenuBar 
);
+        aNames[ 0 ] = OUString::createFromAscii( szServiceName2_MenuBar );
 
     return aNames;
 }
 
 
-::sal_Bool SAL_CALL VCLXMenu::supportsService( const ::rtl::OUString& 
rServiceName )
-throw (::com::sun::star::uno::RuntimeException)
+::sal_Bool SAL_CALL VCLXMenu::supportsService(
+    const OUString& rServiceName )
+throw (css::uno::RuntimeException)
 {
-    ::com::sun::star::uno::Sequence< ::rtl::OUString > aServiceNames( 
getSupportedServiceNames() );
+    css::uno::Sequence< OUString > aServiceNames( getSupportedServiceNames() );
 
     if ( aServiceNames[ 0 ] == rServiceName )
         return sal_True;
@@ -260,46 +229,40 @@ throw (::com::sun::star::uno::RuntimeExc
 }
 
 
-// ::com::sun::star::uno::XInterface
-::com::sun::star::uno::Any VCLXMenu::queryInterface( const 
::com::sun::star::uno::Type & rType )
-throw(::com::sun::star::uno::RuntimeException)
+css::uno::Any VCLXMenu::queryInterface(
+    const css::uno::Type & rType )
+throw(css::uno::RuntimeException)
 {
     ::osl::ResettableGuard < ::osl::Mutex > aGuard( GetMutex() );
     const sal_Bool bIsPopupMenu = IsPopupMenu();
     aGuard.clear();
 
-    ::com::sun::star::uno::Any aRet;
+    css::uno::Any aRet;
 
     if ( bIsPopupMenu )
         aRet = ::cppu::queryInterface(  rType,
-                                        SAL_STATIC_CAST( 
::com::sun::star::awt::XMenu*, (::com::sun::star::awt::XMenuBar*) this ),
-                                        SAL_STATIC_CAST( 
::com::sun::star::awt::XPopupMenu*, this ),
-                                        SAL_STATIC_CAST( 
::com::sun::star::awt::XPopupMenuExtended*, this ),
-                                        SAL_STATIC_CAST( 
::com::sun::star::awt::XMenuExtended*, 
(::com::sun::star::awt::XPopupMenuExtended*) this ),
-                                        SAL_STATIC_CAST( 
::com::sun::star::awt::XMenuExtended2*, 
(::com::sun::star::awt::XPopupMenuExtended*) this ),
-                                        SAL_STATIC_CAST( 
::com::sun::star::lang::XTypeProvider*, this ),
-                                        SAL_STATIC_CAST( 
::com::sun::star::lang::XServiceInfo*, this ),
-                                        SAL_STATIC_CAST( 
::com::sun::star::lang::XUnoTunnel*, this ) );
+                                        SAL_STATIC_CAST( css::awt::XMenu*, 
(css::awt::XPopupMenu*) this ),
+                                        SAL_STATIC_CAST( 
css::awt::XPopupMenu*, this ),
+                                        SAL_STATIC_CAST( 
css::lang::XTypeProvider*, this ),
+                                        SAL_STATIC_CAST( 
css::lang::XServiceInfo*, this ),
+                                        SAL_STATIC_CAST( 
css::lang::XUnoTunnel*, this ) );
     else
         aRet = ::cppu::queryInterface(  rType,
-                                        SAL_STATIC_CAST( 
::com::sun::star::awt::XMenu*, (::com::sun::star::awt::XMenuBar*) this ),
-                                        SAL_STATIC_CAST( 
::com::sun::star::awt::XMenuBar*, this ),
-                                        SAL_STATIC_CAST( 
::com::sun::star::awt::XMenuBarExtended*, this ),
-                                        SAL_STATIC_CAST( 
::com::sun::star::awt::XMenuExtended*, 
(::com::sun::star::awt::XMenuBarExtended*) this ),
-                                        SAL_STATIC_CAST( 
::com::sun::star::awt::XMenuExtended2*, 
(::com::sun::star::awt::XMenuBarExtended*) this ),
-                                        SAL_STATIC_CAST( 
::com::sun::star::lang::XTypeProvider*, this ),
-                                        SAL_STATIC_CAST( 
::com::sun::star::lang::XServiceInfo*, this ),
-                                        SAL_STATIC_CAST( 
::com::sun::star::lang::XUnoTunnel*, this ) );
+                                        SAL_STATIC_CAST( css::awt::XMenu*, 
(css::awt::XMenuBar*) this ),
+                                        SAL_STATIC_CAST( css::awt::XMenuBar*, 
this ),
+                                        SAL_STATIC_CAST( 
css::lang::XTypeProvider*, this ),
+                                        SAL_STATIC_CAST( 
css::lang::XServiceInfo*, this ),
+                                        SAL_STATIC_CAST( 
css::lang::XUnoTunnel*, this ) );
 
     return (aRet.hasValue() ? aRet : OWeakObject::queryInterface( rType ));
 }
 
-// ::com::sun::star::lang::XUnoTunnel
+
 IMPL_XUNOTUNNEL( VCLXMenu )
 
-// ::com::sun::star::lang::XTypeProvider
-::com::sun::star::uno::Sequence< ::com::sun::star::uno::Type > 
VCLXMenu::getTypes()
-throw(::com::sun::star::uno::RuntimeException)
+
+css::uno::Sequence< css::uno::Type > VCLXMenu::getTypes()
+throw(css::uno::RuntimeException)
 {
     ::osl::ResettableGuard < ::osl::Mutex > aGuard( GetMutex() );
     const sal_Bool bIsPopupMenu = IsPopupMenu();
@@ -316,13 +279,10 @@ throw(::com::sun::star::uno::RuntimeExce
             if( !pCollectionPopupMenu )
             {
                 static ::cppu::OTypeCollection collectionPopupMenu(
-                getCppuType( ( ::com::sun::star::uno::Reference< 
::com::sun::star::lang::XTypeProvider>* ) NULL ),
-                getCppuType( ( ::com::sun::star::uno::Reference< 
::com::sun::star::awt::XMenu>* ) NULL ),
-                getCppuType( ( ::com::sun::star::uno::Reference< 
::com::sun::star::awt::XPopupMenu>* ) NULL ),
-                getCppuType( ( ::com::sun::star::uno::Reference< 
::com::sun::star::awt::XPopupMenuExtended>* ) NULL ),
-                getCppuType( ( ::com::sun::star::uno::Reference< 
::com::sun::star::awt::XMenuExtended>* ) NULL ),
-                getCppuType( ( ::com::sun::star::uno::Reference< 
::com::sun::star::awt::XMenuExtended2>* ) NULL ),
-                getCppuType( ( ::com::sun::star::uno::Reference< 
::com::sun::star::lang::XServiceInfo>* ) NULL ) );
+                getCppuType( ( css::uno::Reference< css::lang::XTypeProvider>* 
) NULL ),
+                getCppuType( ( css::uno::Reference< css::awt::XMenu>* ) NULL ),
+                getCppuType( ( css::uno::Reference< css::awt::XPopupMenu>* ) 
NULL ),
+                getCppuType( ( css::uno::Reference< css::lang::XServiceInfo>* 
) NULL ) );
                 pCollectionPopupMenu = &collectionPopupMenu;
             }
         }
@@ -337,13 +297,10 @@ throw(::com::sun::star::uno::RuntimeExce
             if( !pCollectionMenuBar )
             {
                 static ::cppu::OTypeCollection collectionMenuBar(
-                getCppuType( ( ::com::sun::star::uno::Reference< 
::com::sun::star::lang::XTypeProvider>* ) NULL ),
-                getCppuType( ( ::com::sun::star::uno::Reference< 
::com::sun::star::awt::XMenu>* ) NULL ),
-                getCppuType( ( ::com::sun::star::uno::Reference< 
::com::sun::star::awt::XMenuBar>* ) NULL ),
-                getCppuType( ( ::com::sun::star::uno::Reference< 
::com::sun::star::awt::XMenuBarExtended>* ) NULL ),
-                getCppuType( ( ::com::sun::star::uno::Reference< 
::com::sun::star::awt::XMenuExtended>* ) NULL ),
-                getCppuType( ( ::com::sun::star::uno::Reference< 
::com::sun::star::awt::XMenuExtended2>* ) NULL ),
-                getCppuType( ( ::com::sun::star::uno::Reference< 
::com::sun::star::lang::XServiceInfo>* ) NULL ) );
+                getCppuType( ( css::uno::Reference< css::lang::XTypeProvider>* 
) NULL ),
+                getCppuType( ( css::uno::Reference< css::awt::XMenu>* ) NULL ),
+                getCppuType( ( css::uno::Reference< css::awt::XMenuBar>* ) 
NULL ),
+                getCppuType( ( css::uno::Reference< css::lang::XServiceInfo>* 
) NULL ) );
                 pCollectionMenuBar = &collectionMenuBar;
             }
         }
@@ -352,8 +309,8 @@ throw(::com::sun::star::uno::RuntimeExce
 }
 
 
-::com::sun::star::uno::Sequence< sal_Int8 > VCLXMenu::getImplementationId()
-throw(::com::sun::star::uno::RuntimeException)
+css::uno::Sequence< sal_Int8 > VCLXMenu::getImplementationId()
+throw(css::uno::RuntimeException)
 {
     ::osl::ResettableGuard < ::osl::Mutex > aGuard( GetMutex() );
     const sal_Bool bIsPopupMenu = IsPopupMenu();
@@ -392,263 +349,310 @@ throw(::com::sun::star::uno::RuntimeExce
     }
 }
 
-
-//=============================================================================
-//=============================================================================
-//=============================================================================
-
-
-void VCLXMenu::addMenuListener( const ::com::sun::star::uno::Reference< 
::com::sun::star::awt::XMenuListener >& rxListener ) 
throw(::com::sun::star::uno::RuntimeException)
+void VCLXMenu::addMenuListener(
+    const css::uno::Reference< css::awt::XMenuListener >& rxListener )
+throw(css::uno::RuntimeException)
 {
-       ::osl::Guard< ::osl::Mutex > aGuard( GetMutex() );
+    ::osl::Guard< ::osl::Mutex > aGuard( GetMutex() );
 
-       maMenuListeners.addInterface( rxListener );
+    maMenuListeners.addInterface( rxListener );
 }
 
-void VCLXMenu::removeMenuListener( const ::com::sun::star::uno::Reference< 
::com::sun::star::awt::XMenuListener >& rxListener ) 
throw(::com::sun::star::uno::RuntimeException)
+void VCLXMenu::removeMenuListener(
+    const css::uno::Reference< css::awt::XMenuListener >& rxListener )
+throw(css::uno::RuntimeException)
 {
-       ::osl::Guard< ::osl::Mutex > aGuard( GetMutex() );
+    ::osl::Guard< ::osl::Mutex > aGuard( GetMutex() );
 
-       maMenuListeners.removeInterface( rxListener );
+    maMenuListeners.removeInterface( rxListener );
 }
 
-void VCLXMenu::insertItem( sal_Int16 nItemId, const ::rtl::OUString& aText, 
sal_Int16 nItemStyle, sal_Int16 nPos ) 
throw(::com::sun::star::uno::RuntimeException)
+void VCLXMenu::insertItem(
+    sal_Int16 nItemId,
+    const OUString& aText,
+    sal_Int16 nItemStyle,
+    sal_Int16 nPos )
+throw(css::uno::RuntimeException)
 {
     ::vos::OGuard aSolarGuard( Application::GetSolarMutex() );
-       ::osl::Guard< ::osl::Mutex > aGuard( GetMutex() );
+    ::osl::Guard< ::osl::Mutex > aGuard( GetMutex() );
 
     if ( mpMenu )
-           mpMenu->InsertItem( nItemId, aText, (MenuItemBits)nItemStyle, nPos 
);
+        mpMenu->InsertItem( nItemId, aText, (MenuItemBits)nItemStyle, nPos );
 }
 
-void VCLXMenu::removeItem( sal_Int16 nPos, sal_Int16 nCount ) 
throw(::com::sun::star::uno::RuntimeException)
+void VCLXMenu::removeItem(
+    sal_Int16 nPos,
+    sal_Int16 nCount )
+throw(css::uno::RuntimeException)
 {
     ::vos::OGuard aSolarGuard( Application::GetSolarMutex() );
-       ::osl::Guard< ::osl::Mutex > aGuard( GetMutex() );
+    ::osl::Guard< ::osl::Mutex > aGuard( GetMutex() );
 
     sal_Int32 nItemCount = (sal_Int32)mpMenu->GetItemCount();
     if ( mpMenu && ( nCount > 0 ) && ( nPos >= 0 ) && ( nPos < nItemCount ) && 
( nItemCount > 0 ))
-       {
-               sal_Int16 nP = sal::static_int_cast< sal_Int16 >(
+    {
+        sal_Int16 nP = sal::static_int_cast< sal_Int16 >(
             Min( (int)(nPos+nCount), (int)nItemCount ));
         while( nP-nPos > 0 )
             mpMenu->RemoveItem( --nP );
-       }
+    }
 }
 
-sal_Int16 VCLXMenu::getItemCount(  ) 
throw(::com::sun::star::uno::RuntimeException)
+sal_Int16 VCLXMenu::getItemCount(  )
+throw(css::uno::RuntimeException)
 {
     ::vos::OGuard aSolarGuard( Application::GetSolarMutex() );
-       ::osl::Guard< ::osl::Mutex > aGuard( GetMutex() );
+    ::osl::Guard< ::osl::Mutex > aGuard( GetMutex() );
 
     return mpMenu ? mpMenu->GetItemCount() : 0;
 }
 
-sal_Int16 VCLXMenu::getItemId( sal_Int16 nPos ) 
throw(::com::sun::star::uno::RuntimeException)
+sal_Int16 VCLXMenu::getItemId(
+    sal_Int16 nPos )
+throw(css::uno::RuntimeException)
 {
     ::vos::OGuard aSolarGuard( Application::GetSolarMutex() );
-       ::osl::Guard< ::osl::Mutex > aGuard( GetMutex() );
+    ::osl::Guard< ::osl::Mutex > aGuard( GetMutex() );
 
     return mpMenu ? mpMenu->GetItemId( nPos ) : 0;
 }
 
-sal_Int16 VCLXMenu::getItemPos( sal_Int16 nId ) 
throw(::com::sun::star::uno::RuntimeException)
+sal_Int16 VCLXMenu::getItemPos(
+    sal_Int16 nId )
+throw(css::uno::RuntimeException)
 {
     ::vos::OGuard aSolarGuard( Application::GetSolarMutex() );
-       ::osl::Guard< ::osl::Mutex > aGuard( GetMutex() );
+    ::osl::Guard< ::osl::Mutex > aGuard( GetMutex() );
 
     return mpMenu ? mpMenu->GetItemPos( nId ) : 0;
 }
 
-void VCLXMenu::enableItem( sal_Int16 nItemId, sal_Bool bEnable ) 
throw(::com::sun::star::uno::RuntimeException)
+void VCLXMenu::enableItem(
+    sal_Int16 nItemId,
+    sal_Bool bEnable )
+throw(css::uno::RuntimeException)
 {
     ::vos::OGuard aSolarGuard( Application::GetSolarMutex() );
-       ::osl::Guard< ::osl::Mutex > aGuard( GetMutex() );
+    ::osl::Guard< ::osl::Mutex > aGuard( GetMutex() );
 
     if ( mpMenu )
-           mpMenu->EnableItem( nItemId, bEnable );
+        mpMenu->EnableItem( nItemId, bEnable );
 }
 
-sal_Bool VCLXMenu::isItemEnabled( sal_Int16 nItemId ) 
throw(::com::sun::star::uno::RuntimeException)
+sal_Bool VCLXMenu::isItemEnabled(
+    sal_Int16 nItemId )
+throw(css::uno::RuntimeException)
 {
     ::vos::OGuard aSolarGuard( Application::GetSolarMutex() );
-       ::osl::Guard< ::osl::Mutex > aGuard( GetMutex() );
+    ::osl::Guard< ::osl::Mutex > aGuard( GetMutex() );
 
     return mpMenu ? mpMenu->IsItemEnabled( nItemId ) : sal_False;
 }
 
-void VCLXMenu::setItemText( sal_Int16 nItemId, const ::rtl::OUString& aText ) 
throw(::com::sun::star::uno::RuntimeException)
+void VCLXMenu::setItemText(
+    sal_Int16 nItemId,
+    const OUString& aText )
+throw(css::uno::RuntimeException)
 {
     ::vos::OGuard aSolarGuard( Application::GetSolarMutex() );
-       ::osl::Guard< ::osl::Mutex > aGuard( GetMutex() );
+    ::osl::Guard< ::osl::Mutex > aGuard( GetMutex() );
 
     if ( mpMenu )
-           mpMenu->SetItemText( nItemId, aText );
+        mpMenu->SetItemText( nItemId, aText );
 }
 
-::rtl::OUString VCLXMenu::getItemText( sal_Int16 nItemId ) 
throw(::com::sun::star::uno::RuntimeException)
+OUString VCLXMenu::getItemText(
+    sal_Int16 nItemId )
+throw(css::uno::RuntimeException)
 {
     ::vos::OGuard aSolarGuard( Application::GetSolarMutex() );
-       ::osl::Guard< ::osl::Mutex > aGuard( GetMutex() );
+    ::osl::Guard< ::osl::Mutex > aGuard( GetMutex() );
 
-    ::rtl::OUString aItemText;
+    OUString aItemText;
     if ( mpMenu )
         aItemText = mpMenu->GetItemText( nItemId );
     return aItemText;
 }
 
-void VCLXMenu::setPopupMenu( sal_Int16 nItemId, const 
::com::sun::star::uno::Reference< ::com::sun::star::awt::XPopupMenu >& 
rxPopupMenu ) throw(::com::sun::star::uno::RuntimeException)
+void VCLXMenu::setPopupMenu(
+    sal_Int16 nItemId,
+    const css::uno::Reference< css::awt::XPopupMenu >& rxPopupMenu )
+throw(css::uno::RuntimeException)
 {
     ::vos::OGuard aSolarGuard( Application::GetSolarMutex() );
-       ::osl::Guard< ::osl::Mutex > aGuard( GetMutex() );
+    ::osl::Guard< ::osl::Mutex > aGuard( GetMutex() );
 
-       VCLXMenu* pVCLMenu = VCLXMenu::GetImplementation( rxPopupMenu );
-       DBG_ASSERT( pVCLMenu && pVCLMenu->GetMenu() && pVCLMenu->IsPopupMenu(), 
"setPopupMenu: Invalid Menu!" );
+    VCLXMenu* pVCLMenu = VCLXMenu::GetImplementation( rxPopupMenu );
+    DBG_ASSERT( pVCLMenu && pVCLMenu->GetMenu() && pVCLMenu->IsPopupMenu(), 
"setPopupMenu: Invalid Menu!" );
 
-       if ( mpMenu && pVCLMenu && pVCLMenu->GetMenu() && 
pVCLMenu->IsPopupMenu() )
-       {
-               // Selbst eine Ref halten!
-               ::com::sun::star::uno::Reference< 
::com::sun::star::awt::XPopupMenu > * pNewRef = new 
::com::sun::star::uno::Reference< ::com::sun::star::awt::XPopupMenu > ;
-               *pNewRef = rxPopupMenu;
-               maPopupMenueRefs.Insert( pNewRef, LIST_APPEND );
+    if ( mpMenu && pVCLMenu && pVCLMenu->GetMenu() && pVCLMenu->IsPopupMenu() )
+    {
+        // Selbst eine Ref halten!
+        css::uno::Reference< css::awt::XPopupMenu > * pNewRef = new 
css::uno::Reference< css::awt::XPopupMenu > ;
+        *pNewRef = rxPopupMenu;
+        maPopupMenueRefs.Insert( pNewRef, LIST_APPEND );
 
-               mpMenu->SetPopupMenu( nItemId, (PopupMenu*) pVCLMenu->GetMenu() 
);
-       }
+        mpMenu->SetPopupMenu( nItemId, (PopupMenu*) pVCLMenu->GetMenu() );
+    }
 }
 
-::com::sun::star::uno::Reference< ::com::sun::star::awt::XPopupMenu > 
VCLXMenu::getPopupMenu( sal_Int16 nItemId ) 
throw(::com::sun::star::uno::RuntimeException)
+css::uno::Reference< css::awt::XPopupMenu > VCLXMenu::getPopupMenu(
+    sal_Int16 nItemId )
+throw(css::uno::RuntimeException)
 {
     ::vos::OGuard aSolarGuard( Application::GetSolarMutex() );
-       ::osl::Guard< ::osl::Mutex > aGuard( GetMutex() );
+    ::osl::Guard< ::osl::Mutex > aGuard( GetMutex() );
 
-       ::com::sun::star::uno::Reference< ::com::sun::star::awt::XPopupMenu >  
aRef;
+    css::uno::Reference< css::awt::XPopupMenu >  aRef;
     Menu* pMenu = mpMenu ? mpMenu->GetPopupMenu( nItemId ) : NULL;
-       if ( pMenu )
-       {
-               for ( sal_uInt32 n = maPopupMenueRefs.Count(); n; )
-               {
-                       ::com::sun::star::uno::Reference< 
::com::sun::star::awt::XPopupMenu > * pRef = maPopupMenueRefs.GetObject( --n );
-                       Menu* pM = ((VCLXMenu*)pRef->get())->GetMenu();
-                       if ( pM == pMenu )
-                       {
-                               aRef = *pRef;
-                               break;
-                       }
-               }
-       }
-       return aRef;
+    if ( pMenu )
+    {
+        for ( sal_uInt32 n = maPopupMenueRefs.Count(); n; )
+        {
+            css::uno::Reference< css::awt::XPopupMenu > * pRef = 
maPopupMenueRefs.GetObject( --n );
+            Menu* pM = ((VCLXMenu*)pRef->get())->GetMenu();
+            if ( pM == pMenu )
+            {
+                aRef = *pRef;
+                break;
+            }
+        }
+    }
+    return aRef;
 }
 
-// ::com::sun::star::awt::XPopupMenu
-void VCLXMenu::insertSeparator( sal_Int16 nPos ) 
throw(::com::sun::star::uno::RuntimeException)
+// css::awt::XPopupMenu
+void VCLXMenu::insertSeparator(
+    sal_Int16 nPos )
+throw(css::uno::RuntimeException)
 {
     ::vos::OGuard aSolarGuard( Application::GetSolarMutex() );
-       ::osl::Guard< ::osl::Mutex > aGuard( GetMutex() );
+    ::osl::Guard< ::osl::Mutex > aGuard( GetMutex() );
 
     if ( mpMenu )
-           mpMenu->InsertSeparator( nPos );
+        mpMenu->InsertSeparator( nPos );
 }
 
-void VCLXMenu::setDefaultItem( sal_Int16 nItemId ) 
throw(::com::sun::star::uno::RuntimeException)
+void VCLXMenu::setDefaultItem(
+    sal_Int16 nItemId )
+throw(css::uno::RuntimeException)
 {
     ::vos::OGuard aSolarGuard( Application::GetSolarMutex() );
-       ::osl::Guard< ::osl::Mutex > aGuard( GetMutex() );
+    ::osl::Guard< ::osl::Mutex > aGuard( GetMutex() );
 
-       if ( mpMenu )
+    if ( mpMenu )
         mpMenu->SetDefaultItem( nItemId );
 }
 
-sal_Int16 VCLXMenu::getDefaultItem(  ) 
throw(::com::sun::star::uno::RuntimeException)
+sal_Int16 VCLXMenu::getDefaultItem(  )
+throw(css::uno::RuntimeException)
 {
     ::vos::OGuard aSolarGuard( Application::GetSolarMutex() );
-       ::osl::Guard< ::osl::Mutex > aGuard( GetMutex() );
+    ::osl::Guard< ::osl::Mutex > aGuard( GetMutex() );
 
     return mpMenu ? mpMenu->GetDefaultItem() : 0;
 }
 
-void VCLXMenu::checkItem( sal_Int16 nItemId, sal_Bool bCheck ) 
throw(::com::sun::star::uno::RuntimeException)
+void VCLXMenu::checkItem(
+    sal_Int16 nItemId,
+    sal_Bool bCheck )
+throw(css::uno::RuntimeException)
 {
     ::vos::OGuard aSolarGuard( Application::GetSolarMutex() );
-       ::osl::Guard< ::osl::Mutex > aGuard( GetMutex() );
+    ::osl::Guard< ::osl::Mutex > aGuard( GetMutex() );
 
     if ( mpMenu )
         mpMenu->CheckItem( nItemId, bCheck );
 }
 
-sal_Bool VCLXMenu::isItemChecked( sal_Int16 nItemId ) 
throw(::com::sun::star::uno::RuntimeException)
+sal_Bool VCLXMenu::isItemChecked(
+    sal_Int16 nItemId )
+throw(css::uno::RuntimeException)
 {
     ::vos::OGuard aSolarGuard( Application::GetSolarMutex() );
-       ::osl::Guard< ::osl::Mutex > aGuard( GetMutex() );
+    ::osl::Guard< ::osl::Mutex > aGuard( GetMutex() );
 
     return mpMenu ? mpMenu->IsItemChecked( nItemId ) : sal_False;
 }
 
-sal_Int16 VCLXMenu::execute( const ::com::sun::star::uno::Reference< 
::com::sun::star::awt::XWindowPeer >& rxWindowPeer, const 
::com::sun::star::awt::Rectangle& rArea, sal_Int16 nFlags ) 
throw(::com::sun::star::uno::RuntimeException)
+sal_Int16 VCLXMenu::execute(
+    const css::uno::Reference< css::awt::XWindowPeer >& rxWindowPeer,
+    const css::awt::Point& rPos,
+    sal_Int16 nFlags )
+throw(css::uno::RuntimeException)
 {
     ::vos::OGuard aSolarGuard( Application::GetSolarMutex() );
-       ::osl::Guard< ::osl::Mutex > aGuard( GetMutex() );
+    ::osl::Guard< ::osl::Mutex > aGuard( GetMutex() );
 
-       sal_Int16 nRet = 0;
-       if ( mpMenu && IsPopupMenu() )
-               nRet = ((PopupMenu*)mpMenu)->Execute( VCLUnoHelper::GetWindow( 
rxWindowPeer ), VCLRectangle(rArea), nFlags | POPUPMENU_NOMOUSEUPCLOSE );
-       return nRet;
+    sal_Int16 nRet = 0;
+    if ( mpMenu && IsPopupMenu() )
+    {
+        const ::Point aPoint = VCLPoint( rPos );
+        nRet = ((PopupMenu*)mpMenu)->Execute( VCLUnoHelper::GetWindow( 
rxWindowPeer ),
+                                              ::Rectangle(aPoint,aPoint),
+                                              nFlags | 
POPUPMENU_NOMOUSEUPCLOSE );
+    }
+    return nRet;
 }
 
 
-void SAL_CALL VCLXMenu::setCommand( sal_Int16 nItemId, const ::rtl::OUString& 
aCommand ) throw (::com::sun::star::uno::RuntimeException)
+void SAL_CALL VCLXMenu::setCommand(
+    sal_Int16 nItemId,
+    const OUString& aCommand )
+throw (css::uno::RuntimeException)
 {
     ::vos::OGuard aSolarGuard( Application::GetSolarMutex() );
-       ::osl::Guard< ::osl::Mutex > aGuard( GetMutex() );
+    ::osl::Guard< ::osl::Mutex > aGuard( GetMutex() );
 
     if ( mpMenu )
         mpMenu->SetItemCommand( nItemId, aCommand );
 }
 
-::rtl::OUString SAL_CALL VCLXMenu::getCommand( sal_Int16 nItemId ) throw 
(::com::sun::star::uno::RuntimeException)
+OUString SAL_CALL VCLXMenu::getCommand(
+    sal_Int16 nItemId )
+throw (css::uno::RuntimeException)
 {
     ::vos::OGuard aSolarGuard( Application::GetSolarMutex() );
-       ::osl::Guard< ::osl::Mutex > aGuard( GetMutex() );
+    ::osl::Guard< ::osl::Mutex > aGuard( GetMutex() );
 
-    ::rtl::OUString aItemCommand;
+    OUString aItemCommand;
     if ( mpMenu )
         aItemCommand = mpMenu->GetItemCommand( nItemId );
     return aItemCommand;
 }
 
-void SAL_CALL VCLXMenu::setHelpCommand( sal_Int16 nItemId, const 
::rtl::OUString& aHelp ) throw (::com::sun::star::uno::RuntimeException)
+void SAL_CALL VCLXMenu::setHelpCommand(
+    sal_Int16 nItemId,
+    const OUString& aHelp )
+throw (css::uno::RuntimeException)
 {
     ::vos::OGuard aSolarGuard( Application::GetSolarMutex() );
-       ::osl::Guard< ::osl::Mutex > aGuard( GetMutex() );
+    ::osl::Guard< ::osl::Mutex > aGuard( GetMutex() );
 
     if ( mpMenu )
         mpMenu->SetHelpCommand( nItemId, aHelp );
 }
 
-::rtl::OUString SAL_CALL VCLXMenu::getHelpCommand( sal_Int16 nItemId ) throw 
(::com::sun::star::uno::RuntimeException)
+OUString SAL_CALL VCLXMenu::getHelpCommand(
+    sal_Int16 nItemId )
+throw (css::uno::RuntimeException)
 {
     ::vos::OGuard aSolarGuard( Application::GetSolarMutex() );
-       ::osl::Guard< ::osl::Mutex > aGuard( GetMutex() );
+    ::osl::Guard< ::osl::Mutex > aGuard( GetMutex() );
 
-    ::rtl::OUString aHelpCommand;
+    OUString aHelpCommand;
     if ( mpMenu )
         aHelpCommand = mpMenu->GetHelpCommand( nItemId );
     return aHelpCommand;
 }
 
 
-// ============================================================================
-// ============================================================================
-// ============================================================================
-
-
-// BEGIN ANONYMOUS NAMESPACE
 namespace
 {
-    namespace css = ::com::sun::star;
-
-    Image lcl_XGraphic2VCLImage(
-                                const css::uno::Reference< 
css::graphic::XGraphic >& xGraphic,
-                                sal_Bool bResize )
+    static Image lcl_XGraphic2VCLImage(
+        const css::uno::Reference< css::graphic::XGraphic >& xGraphic,
+        sal_Bool bResize )
     {
         Image aImage;
         if ( !xGraphic.is() )
@@ -680,13 +684,9 @@ namespace
         return aImage;
     }
 
-    /**
-        As svtools builds after toolkit, we can not include/use
-        svtools/inc/acceleratorexecute.hxx
-        So I just copy here svt::AcceleratorExecute::st_AWTKey2VCLKey
-        and svt::AcceleratorExecute::st_VCLKey2AWTKey
-    */
-    css::awt::KeyEvent lcl_VCLKey2AWTKey(const KeyCode& aVCLKey)
+    /** Copied from svtools/inc/acceleratorexecute.hxx */
+    static css::awt::KeyEvent lcl_VCLKey2AWTKey(
+        const KeyCode& aVCLKey)
     {
         css::awt::KeyEvent aAWTKey;
         aAWTKey.Modifiers = 0;
@@ -715,24 +715,19 @@ namespace
         return KeyCode(nKey, bShift, bMod1, bMod2, bMod3);
     }
 
-} // END ANONYMOUS NAMESPACE
-
-
-// ============================================================================
-// ============================================================================
-// ============================================================================
-
+}
 
-// XMenuExtended2 Methods
 
-::sal_Bool SAL_CALL VCLXMenu::isPopupMenu(  ) throw 
(::com::sun::star::uno::RuntimeException)
+::sal_Bool SAL_CALL VCLXMenu::isPopupMenu(  )
+throw (css::uno::RuntimeException)
 {
     ::vos::OGuard aSolarGuard( Application::GetSolarMutex() );
     ::osl::Guard< ::osl::Mutex > aGuard( GetMutex() );
     return IsPopupMenu();
 }
 
-void SAL_CALL VCLXMenu::clear(  ) throw 
(::com::sun::star::uno::RuntimeException)
+void SAL_CALL VCLXMenu::clear(  )
+throw (css::uno::RuntimeException)
 {
     ::vos::OGuard aSolarGuard( Application::GetSolarMutex() );
     ::osl::Guard< ::osl::Mutex > aGuard( GetMutex() );
@@ -741,26 +736,26 @@ void SAL_CALL VCLXMenu::clear(  ) throw 
 }
 
 
-::com::sun::star::awt::MenuItemType SAL_CALL VCLXMenu::getItemType( 
::sal_Int16 nItemPos )
-throw ( ::com::sun::star::container::NoSuchElementException,
-        ::com::sun::star::uno::RuntimeException)
+css::awt::MenuItemType SAL_CALL VCLXMenu::getItemType(
+    ::sal_Int16 nItemPos )
+throw (css::uno::RuntimeException)
 {
     ::vos::OGuard aSolarGuard( Application::GetSolarMutex() );
     ::osl::Guard< ::osl::Mutex > aGuard( GetMutex() );
 
-    ::com::sun::star::awt::MenuItemType aMenuItemType =
-        ::com::sun::star::awt::MenuItemType_DONTKNOW;
+    css::awt::MenuItemType aMenuItemType =
+        css::awt::MenuItemType_DONTKNOW;
     if ( mpMenu )
     {
-        THROW_MENUPOS_NOT_FOUND( "VCLXMenu::getItemType()", nItemPos )
-        aMenuItemType = ( (::com::sun::star::awt::MenuItemType) 
mpMenu->GetItemType( nItemPos ) );
+        aMenuItemType = ( (css::awt::MenuItemType) mpMenu->GetItemType( 
nItemPos ) );
     }
 
     return aMenuItemType;
 }
 
-void SAL_CALL VCLXMenu::hideDisabledEntries( ::sal_Bool bHide )
-throw (::com::sun::star::uno::RuntimeException)
+void SAL_CALL VCLXMenu::hideDisabledEntries(
+    ::sal_Bool bHide )
+throw (css::uno::RuntimeException)
 {
     ::vos::OGuard aSolarGuard( Application::GetSolarMutex() );
     ::osl::Guard< ::osl::Mutex > aGuard( GetMutex() );
@@ -774,15 +769,8 @@ throw (::com::sun::star::uno::RuntimeExc
 }
 
 
-// ============================================================================
-// ============================================================================
-// ============================================================================
-
-
-// XPopupMenuExtended Methods
-
 ::sal_Bool SAL_CALL VCLXMenu::isInExecute(  )
-throw (::com::sun::star::uno::RuntimeException)
+throw (css::uno::RuntimeException)
 {
     ::vos::OGuard aSolarGuard( Application::GetSolarMutex() );
     ::osl::Guard< ::osl::Mutex > aGuard( GetMutex() );
@@ -795,7 +783,7 @@ throw (::com::sun::star::uno::RuntimeExc
 
 
 void SAL_CALL VCLXMenu::endExecute()
-throw (::com::sun::star::uno::RuntimeException)
+throw (css::uno::RuntimeException)
 {
     ::vos::OGuard aSolarGuard( Application::GetSolarMutex() );
     ::osl::Guard< ::osl::Mutex > aGuard( GetMutex() );
@@ -805,54 +793,9 @@ throw (::com::sun::star::uno::RuntimeExc
 }
 
 
-void SAL_CALL VCLXMenu::setLogo( const ::com::sun::star::awt::MenuLogo& 
aMenuLogo )
-throw (::com::sun::star::uno::RuntimeException)
-{
-    ::vos::OGuard aSolarGuard( Application::GetSolarMutex() );
-    ::osl::Guard< ::osl::Mutex > aGuard( GetMutex() );
-
-    if ( mpMenu )
-    {
-        if ( aMenuLogo.Graphic.is() )
-        {
-            Image aImage = lcl_XGraphic2VCLImage( aMenuLogo.Graphic, sal_False 
);
-            MenuLogo aVCLMenuLogo;
-
-            aVCLMenuLogo.aBitmap        = aImage.GetBitmapEx();
-            aVCLMenuLogo.aStartColor    = Color( 
(sal_uInt32)(aMenuLogo.StartColor) );
-            aVCLMenuLogo.aEndColor      = Color( 
(sal_uInt32)(aMenuLogo.EndColor) );
-
-            mpMenu->SetLogo( aVCLMenuLogo );
-        }
-        else
-            mpMenu->SetLogo();
-    }
-}
-
-
-::com::sun::star::awt::MenuLogo SAL_CALL VCLXMenu::getLogo(  )
-throw (::com::sun::star::uno::RuntimeException)
-{
-    ::vos::OGuard aSolarGuard( Application::GetSolarMutex() );
-    ::osl::Guard< ::osl::Mutex > aGuard( GetMutex() );
-
-    ::com::sun::star::awt::MenuLogo aAWTMenuLogo;
-    if ( mpMenu )
-    {
-        if ( mpMenu->HasLogo() )
-        {
-            MenuLogo aVCLMenuLogo      = mpMenu->GetLogo();
-            aAWTMenuLogo.Graphic       = 
Image(aVCLMenuLogo.aBitmap).GetXGraphic();
-            aAWTMenuLogo.StartColor    = aVCLMenuLogo.aStartColor.GetColor();
-            aAWTMenuLogo.EndColor      = aVCLMenuLogo.aEndColor.GetColor();
-        }
-    }
-    return aAWTMenuLogo;
-}
-
-
-void SAL_CALL VCLXMenu::enableAutoMnemonics( ::sal_Bool bEnable )
-throw (::com::sun::star::uno::RuntimeException)
+void SAL_CALL VCLXMenu::enableAutoMnemonics(
+    ::sal_Bool bEnable )
+throw (css::uno::RuntimeException)
 {
     ::vos::OGuard aSolarGuard( Application::GetSolarMutex() );
     ::osl::Guard< ::osl::Mutex > aGuard( GetMutex() );
@@ -866,34 +809,32 @@ throw (::com::sun::star::uno::RuntimeExc
 }
 
 
-void SAL_CALL VCLXMenu::setAcceleratorKeyEvent( ::sal_Int16 nItemId,
-                                                const 
::com::sun::star::awt::KeyEvent& aKeyEvent )
-throw ( ::com::sun::star::container::NoSuchElementException,
-        ::com::sun::star::uno::RuntimeException)
+void SAL_CALL VCLXMenu::setAcceleratorKeyEvent(
+    ::sal_Int16 nItemId,
+    const css::awt::KeyEvent& aKeyEvent )
+throw (css::uno::RuntimeException)
 {
     ::vos::OGuard aSolarGuard( Application::GetSolarMutex() );
     ::osl::Guard< ::osl::Mutex > aGuard( GetMutex() );
 
-    if ( mpMenu && IsPopupMenu() )
+    if ( mpMenu && IsPopupMenu() && MENU_ITEM_NOTFOUND != mpMenu->GetItemPos( 
nItemId ) )
     {
-        THROW_MENUITEM_NOT_FOUND( "VCLXMenu::setAcceleratorKeyEvent()", 
nItemId )
         KeyCode aVCLKeyCode = lcl_AWTKey2VCLKey( aKeyEvent );
         mpMenu->SetAccelKey( nItemId, aVCLKeyCode );
     }
 }
 
 
-::com::sun::star::awt::KeyEvent SAL_CALL VCLXMenu::getAcceleratorKeyEvent( 
::sal_Int16 nItemId )
-throw ( ::com::sun::star::container::NoSuchElementException,
-        ::com::sun::star::uno::RuntimeException)
+css::awt::KeyEvent SAL_CALL VCLXMenu::getAcceleratorKeyEvent(
+    ::sal_Int16 nItemId )
+throw (css::uno::RuntimeException)
 {
     ::vos::OGuard aSolarGuard( Application::GetSolarMutex() );
     ::osl::Guard< ::osl::Mutex > aGuard( GetMutex() );
 
-    ::com::sun::star::awt::KeyEvent aKeyEvent;
-    if ( mpMenu && IsPopupMenu() )
+    css::awt::KeyEvent aKeyEvent;
+    if ( mpMenu && IsPopupMenu() && MENU_ITEM_NOTFOUND != mpMenu->GetItemPos( 
nItemId ) )
     {
-        THROW_MENUITEM_NOT_FOUND( "VCLXMenu::getAcceleratorKeyEvent()", 
nItemId )
         KeyCode nKeyCode = mpMenu->GetAccelKey( nItemId );
         aKeyEvent = lcl_VCLKey2AWTKey( nKeyCode );
     }
@@ -902,32 +843,31 @@ throw ( ::com::sun::star::container::NoS
 }
 
 
-void SAL_CALL VCLXMenu::setHelpText( ::sal_Int16 nItemId, const 
::rtl::OUString& sHelpText )
-throw ( ::com::sun::star::container::NoSuchElementException,
-        ::com::sun::star::uno::RuntimeException)
+void SAL_CALL VCLXMenu::setHelpText(
+    ::sal_Int16 nItemId,
+    const OUString& sHelpText )
+throw (css::uno::RuntimeException)
 {
     ::vos::OGuard aSolarGuard( Application::GetSolarMutex() );
     ::osl::Guard< ::osl::Mutex > aGuard( GetMutex() );
 
-    if ( mpMenu && IsPopupMenu() )
+    if ( mpMenu && MENU_ITEM_NOTFOUND != mpMenu->GetItemPos( nItemId ) )
     {
-        THROW_MENUITEM_NOT_FOUND( "VCLXMenu::setHelpText()", nItemId )
         mpMenu->SetHelpText( nItemId, sHelpText );
     }
 }
 
 
-::rtl::OUString SAL_CALL VCLXMenu::getHelpText( ::sal_Int16 nItemId )
-throw ( ::com::sun::star::container::NoSuchElementException,
-        ::com::sun::star::uno::RuntimeException)
+OUString SAL_CALL VCLXMenu::getHelpText(
+    ::sal_Int16 nItemId )
+throw (css::uno::RuntimeException)
 {
     ::vos::OGuard aSolarGuard( Application::GetSolarMutex() );
     ::osl::Guard< ::osl::Mutex > aGuard( GetMutex() );
 
     rtl::OUString sHelpText;
-    if ( mpMenu && IsPopupMenu() )
+    if ( mpMenu && MENU_ITEM_NOTFOUND != mpMenu->GetItemPos( nItemId ) )
     {
-        THROW_MENUITEM_NOT_FOUND( "VCLXMenu::getHelpText()", nItemId )
         sHelpText = mpMenu->GetHelpText( nItemId );
     }
 
@@ -935,32 +875,31 @@ throw ( ::com::sun::star::container::NoS
 }
 
 
-void SAL_CALL VCLXMenu::setTipHelpText( ::sal_Int16 nItemId, const 
::rtl::OUString& sTipHelpText )
-throw ( ::com::sun::star::container::NoSuchElementException,
-        ::com::sun::star::uno::RuntimeException)
+void SAL_CALL VCLXMenu::setTipHelpText(
+    ::sal_Int16 nItemId,
+    const OUString& sTipHelpText )
+throw (css::uno::RuntimeException)
 {
     ::vos::OGuard aSolarGuard( Application::GetSolarMutex() );
     ::osl::Guard< ::osl::Mutex > aGuard( GetMutex() );
 
-    if ( mpMenu && IsPopupMenu() )
+    if ( mpMenu && MENU_ITEM_NOTFOUND != mpMenu->GetItemPos( nItemId ) )
     {
-        THROW_MENUITEM_NOT_FOUND( "VCLXMenu::setTipHelpText()", nItemId )
         mpMenu->SetTipHelpText( nItemId, sTipHelpText );
     }
 }
 
 
-::rtl::OUString SAL_CALL VCLXMenu::getTipHelpText( ::sal_Int16 nItemId )
-throw ( ::com::sun::star::container::NoSuchElementException,
-        ::com::sun::star::uno::RuntimeException)
+OUString SAL_CALL VCLXMenu::getTipHelpText(
+    ::sal_Int16 nItemId )
+throw (css::uno::RuntimeException)
 {
     ::vos::OGuard aSolarGuard( Application::GetSolarMutex() );
     ::osl::Guard< ::osl::Mutex > aGuard( GetMutex() );
 
     rtl::OUString sTipHelpText;
-    if ( mpMenu && IsPopupMenu() )
+    if ( mpMenu && MENU_ITEM_NOTFOUND != mpMenu->GetItemPos( nItemId ) )
     {
-        THROW_MENUITEM_NOT_FOUND( "VCLXMenu::getTipHelpText()", nItemId )
         sTipHelpText = mpMenu->GetTipHelpText( nItemId );
     }
     return sTipHelpText;
@@ -968,35 +907,34 @@ throw ( ::com::sun::star::container::NoS
 
 
 void SAL_CALL VCLXMenu::setItemImage(
-                                            ::sal_Int16 nItemId,
-                                            const 
::com::sun::star::uno::Reference< ::com::sun::star::graphic::XGraphic >& 
xGraphic, ::sal_Bool bScale )
-throw ( ::com::sun::star::container::NoSuchElementException,
-        ::com::sun::star::uno::RuntimeException)
+    ::sal_Int16 nItemId,
+    const css::uno::Reference< css::graphic::XGraphic >& xGraphic,
+    ::sal_Bool bScale )
+throw (css::uno::RuntimeException)
 {
     ::vos::OGuard aSolarGuard( Application::GetSolarMutex() );
     ::osl::Guard< ::osl::Mutex > aGuard( GetMutex() );
 
-    if ( mpMenu && IsPopupMenu() )
+    if ( mpMenu && IsPopupMenu() && MENU_ITEM_NOTFOUND != mpMenu->GetItemPos( 
nItemId ) )
     {
-        THROW_MENUITEM_NOT_FOUND( "VCLXMenu::setItemImage()", nItemId )
         Image aImage = lcl_XGraphic2VCLImage( xGraphic, bScale );
         mpMenu->SetItemImage( nItemId, aImage );
     }
 }
 
 
-::com::sun::star::uno::Reference< ::com::sun::star::graphic::XGraphic > 
SAL_CALL VCLXMenu::getItemImage( ::sal_Int16 nItemId )
-throw ( ::com::sun::star::container::NoSuchElementException,
-        ::com::sun::star::uno::RuntimeException)
+css::uno::Reference< css::graphic::XGraphic > SAL_CALL
+VCLXMenu::getItemImage(
+    ::sal_Int16 nItemId )
+throw (css::uno::RuntimeException)
 {
     ::vos::OGuard aSolarGuard( Application::GetSolarMutex() );
     ::osl::Guard< ::osl::Mutex > aGuard( GetMutex() );
 
-    ::com::sun::star::uno::Reference< ::com::sun::star::graphic::XGraphic > 
rxGraphic;
+    css::uno::Reference< css::graphic::XGraphic > rxGraphic;
 
-    if ( mpMenu && IsPopupMenu() )
+    if ( mpMenu && IsPopupMenu() && MENU_ITEM_NOTFOUND != mpMenu->GetItemPos( 
nItemId ) )
     {
-        THROW_MENUITEM_NOT_FOUND( "VCLXMenu::getItemImage()", nItemId )
         Image aImage = mpMenu->GetItemImage( nItemId );
         if ( !!aImage )
             rxGraphic = aImage.GetXGraphic();
@@ -1005,73 +943,6 @@ throw ( ::com::sun::star::container::NoS
 }
 
 
-void SAL_CALL VCLXMenu::setItemImageAngle( ::sal_Int16 nItemId, ::sal_Int32 
nAngle )
-throw ( ::com::sun::star::container::NoSuchElementException,
-        ::com::sun::star::uno::RuntimeException)
-{
-    ::vos::OGuard aSolarGuard( Application::GetSolarMutex() );
-    ::osl::Guard< ::osl::Mutex > aGuard( GetMutex() );
-
-    if ( mpMenu && IsPopupMenu() )
-    {
-        THROW_MENUITEM_NOT_FOUND( "VCLXMenu::setItemImageAngle()", nItemId )
-        mpMenu->SetItemImageAngle( nItemId, nAngle );
-    }
-}
-
-
-::sal_Int32 SAL_CALL VCLXMenu::getItemImageAngle( ::sal_Int16 nItemId )
-throw ( ::com::sun::star::container::NoSuchElementException,
-        ::com::sun::star::uno::RuntimeException)
-{
-    ::vos::OGuard aSolarGuard( Application::GetSolarMutex() );
-    ::osl::Guard< ::osl::Mutex > aGuard( GetMutex() );
-
-    ::sal_Int32 nItemImageAngle( 0 );
-    if ( mpMenu && IsPopupMenu() )
-    {
-        THROW_MENUITEM_NOT_FOUND( "VCLXMenu::getItemImageAngle()", nItemId )
-        nItemImageAngle = mpMenu->GetItemImageAngle( nItemId );
-    }
-    return nItemImageAngle;
-}
-
-
-void SAL_CALL VCLXMenu::setItemImageMirrorMode( ::sal_Int16 nItemId, 
::sal_Bool bMirror )
-throw ( ::com::sun::star::container::NoSuchElementException,
-        ::com::sun::star::uno::RuntimeException)
-{
-    ::vos::OGuard aSolarGuard( Application::GetSolarMutex() );
-    ::osl::Guard< ::osl::Mutex > aGuard( GetMutex() );
-
-    if ( mpMenu && IsPopupMenu() )
-    {
-        THROW_MENUITEM_NOT_FOUND( "VCLXMenu::setItemImageMirrorMode()", 
nItemId )
-        mpMenu->SetItemImageMirrorMode( nItemId, bMirror );
-    }
-}
-
-
-::sal_Bool SAL_CALL VCLXMenu::isItemImageInMirrorMode( ::sal_Int16 nItemId )
-throw ( ::com::sun::star::container::NoSuchElementException,
-        ::com::sun::star::uno::RuntimeException)
-{
-    ::vos::OGuard aSolarGuard( Application::GetSolarMutex() );
-    ::osl::Guard< ::osl::Mutex > aGuard( GetMutex() );
-
-    sal_Bool bMirrorMode( sal_False );
-    if ( mpMenu && IsPopupMenu() )
-    {
-        THROW_MENUITEM_NOT_FOUND( "VCLXMenu::isItemImageInMirrorMode()", 
nItemId )
-        bMirrorMode = mpMenu->GetItemImageMirrorMode( nItemId );
-    }
-    return bMirrorMode;
-}
-
-
-//     ----------------------------------------------------
-//     class VCLXMenuBar
-//     ----------------------------------------------------
 
 DBG_NAME(VCLXMenuBar);
 
@@ -1086,9 +957,6 @@ VCLXMenuBar::VCLXMenuBar( MenuBar* pMenu
     DBG_CTOR( VCLXMenuBar, 0 );
 }
 
-//     ----------------------------------------------------
-//     class VCLXPopupMenu
-//     ----------------------------------------------------
 
 DBG_NAME(VCLXPopupMenu);
 

Modified: openoffice/trunk/main/toolkit/source/helper/listenermultiplexer.cxx
URL: 
http://svn.apache.org/viewvc/openoffice/trunk/main/toolkit/source/helper/listenermultiplexer.cxx?rev=1425458&r1=1425457&r2=1425458&view=diff
==============================================================================
--- openoffice/trunk/main/toolkit/source/helper/listenermultiplexer.cxx 
(original)
+++ openoffice/trunk/main/toolkit/source/helper/listenermultiplexer.cxx Sun Dec 
23 12:29:21 2012
@@ -176,10 +176,10 @@ IMPL_LISTENERMULTIPLEXER_LISTENERMETHOD(
 //     class MenuListenerMultiplexer
 //     ----------------------------------------------------
 IMPL_LISTENERMULTIPLEXER_BASEMETHODS( MenuListenerMultiplexer, 
::com::sun::star::awt::XMenuListener )
-IMPL_LISTENERMULTIPLEXER_LISTENERMETHOD( MenuListenerMultiplexer, 
::com::sun::star::awt::XMenuListener, highlight, 
::com::sun::star::awt::MenuEvent )
-IMPL_LISTENERMULTIPLEXER_LISTENERMETHOD( MenuListenerMultiplexer, 
::com::sun::star::awt::XMenuListener, select, ::com::sun::star::awt::MenuEvent )
-IMPL_LISTENERMULTIPLEXER_LISTENERMETHOD( MenuListenerMultiplexer, 
::com::sun::star::awt::XMenuListener, activate, 
::com::sun::star::awt::MenuEvent )
-IMPL_LISTENERMULTIPLEXER_LISTENERMETHOD( MenuListenerMultiplexer, 
::com::sun::star::awt::XMenuListener, deactivate, 
::com::sun::star::awt::MenuEvent )
+IMPL_LISTENERMULTIPLEXER_LISTENERMETHOD( MenuListenerMultiplexer, 
::com::sun::star::awt::XMenuListener, itemHighlighted, 
::com::sun::star::awt::MenuEvent )
+IMPL_LISTENERMULTIPLEXER_LISTENERMETHOD( MenuListenerMultiplexer, 
::com::sun::star::awt::XMenuListener, itemSelected, 
::com::sun::star::awt::MenuEvent )
+IMPL_LISTENERMULTIPLEXER_LISTENERMETHOD( MenuListenerMultiplexer, 
::com::sun::star::awt::XMenuListener, itemActivated, 
::com::sun::star::awt::MenuEvent )
+IMPL_LISTENERMULTIPLEXER_LISTENERMETHOD( MenuListenerMultiplexer, 
::com::sun::star::awt::XMenuListener, itemDeactivated, 
::com::sun::star::awt::MenuEvent )
 
 //     ----------------------------------------------------
 //     class TreeSelectionListenerMultiplexer

Modified: openoffice/trunk/main/vcl/source/app/svdata.cxx
URL: 
http://svn.apache.org/viewvc/openoffice/trunk/main/vcl/source/app/svdata.cxx?rev=1425458&r1=1425457&r2=1425458&view=diff
==============================================================================
--- openoffice/trunk/main/vcl/source/app/svdata.cxx (original)
+++ openoffice/trunk/main/vcl/source/app/svdata.cxx Sun Dec 23 12:29:21 2012
@@ -570,7 +570,7 @@ bool ImplInitAccessBridge(sal_Bool bAllo
 
 // -----------------------------------------------------------------------
 
-Window* ImplFindWindow( const SalFrame* pFrame, Point& rSalFramePos )
+Window* ImplFindWindow( const SalFrame* pFrame, ::Point& rSalFramePos )
 {
     ImplSVData* pSVData = ImplGetSVData();
     Window*     pFrameWindow = pSVData->maWinData.mpFirstFrame;


Reply via email to