[Libreoffice-commits] core.git: framework/source include/framework sfx2/source

Caolán McNamara caolanm at redhat.com
Wed Feb 4 13:04:06 PST 2015


 framework/source/classes/menumanager.cxx              |    8 -
 framework/source/fwe/classes/addonmenu.cxx            |    4 
 framework/source/fwe/classes/bmkmenu.cxx              |    4 
 framework/source/fwe/xml/menuconfiguration.cxx        |   12 +-
 framework/source/uielement/menubarmanager.cxx         |   12 +-
 framework/source/uielement/newmenucontroller.cxx      |    8 -
 framework/source/uielement/popuptoolbarcontroller.cxx |    4 
 include/framework/menuconfiguration.hxx               |   88 +++++++++---------
 sfx2/source/menu/mnuitem.cxx                          |    8 -
 sfx2/source/menu/virtmenu.cxx                         |   12 +-
 10 files changed, 80 insertions(+), 80 deletions(-)

New commits:
commit af6cd2356afd1212acc529f796f8043ad7e278e6
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Wed Feb 4 20:46:57 2015 +0000

    rename MenuConfiguration::Attributes->MenuAttributes
    
    Change-Id: I2ada1394c4cbee7c27b02f241ee4a254597a5dd8

diff --git a/framework/source/classes/menumanager.cxx b/framework/source/classes/menumanager.cxx
index c09cc87..b9350ef 100644
--- a/framework/source/classes/menumanager.cxx
+++ b/framework/source/classes/menumanager.cxx
@@ -219,8 +219,8 @@ MenuManager::MenuManager(
                         Image           aImage;
                         OUString   aImageId;
 
-                        MenuConfiguration::Attributes* pMenuAttributes =
-                            reinterpret_cast<MenuConfiguration::Attributes*>(pMenu->GetUserValue( nItemId ));
+                        MenuAttributes* pMenuAttributes =
+                            reinterpret_cast<MenuAttributes*>(pMenu->GetUserValue( nItemId ));
 
                         if ( pMenuAttributes && !pMenuAttributes->aImageId.isEmpty() )
                         {
@@ -944,8 +944,8 @@ void MenuManager::FillMenuImages(Reference< XFrame >& _xFrame, Menu* _pMenu,bool
                 bool        bImageSet = false;
                 OUString aImageId;
 
-                ::framework::MenuConfiguration::Attributes* pMenuAttributes =
-                    reinterpret_cast< ::framework::MenuConfiguration::Attributes*>(_pMenu->GetUserValue( nId ));
+                ::framework::MenuAttributes* pMenuAttributes =
+                    reinterpret_cast< ::framework::MenuAttributes*>(_pMenu->GetUserValue( nId ));
 
                 if ( pMenuAttributes )
                     aImageId = pMenuAttributes->aImageId; // Retrieve image id from menu attributes
diff --git a/framework/source/fwe/classes/addonmenu.cxx b/framework/source/fwe/classes/addonmenu.cxx
index 54c1fa9..5161e62 100644
--- a/framework/source/fwe/classes/addonmenu.cxx
+++ b/framework/source/fwe/classes/addonmenu.cxx
@@ -330,8 +330,8 @@ void AddonMenuManager::BuildMenu( PopupMenu*                            pCurrent
 
             // Store values from configuration to the New and Wizard menu entries to enable
             // sfx2 based code to support high contrast mode correctly!
-            sal_uIntPtr nAttributePtr = MenuConfiguration::Attributes::CreateAttribute(aTarget, aImageId);
-            pCurrentMenu->SetUserValue(nId, nAttributePtr, MenuConfiguration::Attributes::ReleaseAttribute);
+            sal_uIntPtr nAttributePtr = MenuAttributes::CreateAttribute(aTarget, aImageId);
+            pCurrentMenu->SetUserValue(nId, nAttributePtr, MenuAttributes::ReleaseAttribute);
             pCurrentMenu->SetItemCommand( nId, aURL );
 
             if ( pSubMenu )
diff --git a/framework/source/fwe/classes/bmkmenu.cxx b/framework/source/fwe/classes/bmkmenu.cxx
index a3f4290..cc9c31f 100644
--- a/framework/source/fwe/classes/bmkmenu.cxx
+++ b/framework/source/fwe/classes/bmkmenu.cxx
@@ -164,8 +164,8 @@ void BmkMenu::Initialize()
             else
                 InsertItem( nId, aTitle );
 
-            sal_uIntPtr nAttributePtr = MenuConfiguration::Attributes::CreateAttribute(aTargetFrame, aImageId);
-            SetUserValue(nId, nAttributePtr, MenuConfiguration::Attributes::ReleaseAttribute);
+            sal_uIntPtr nAttributePtr = MenuAttributes::CreateAttribute(aTargetFrame, aImageId);
+            SetUserValue(nId, nAttributePtr, MenuAttributes::ReleaseAttribute);
 
             SetItemCommand( nId, aURL );
         }
diff --git a/framework/source/fwe/xml/menuconfiguration.cxx b/framework/source/fwe/xml/menuconfiguration.cxx
index aabbc47..1d2a8dd 100644
--- a/framework/source/fwe/xml/menuconfiguration.cxx
+++ b/framework/source/fwe/xml/menuconfiguration.cxx
@@ -139,25 +139,25 @@ void MenuConfiguration::StoreMenuBarConfigurationToXML(
     }
 }
 
-sal_uIntPtr MenuConfiguration::Attributes::CreateAttribute(const OUString& rFrame, const OUString& rImageIdStr)
+sal_uIntPtr MenuAttributes::CreateAttribute(const OUString& rFrame, const OUString& rImageIdStr)
 {
-    Attributes* pAttributes = new Attributes(rFrame, rImageIdStr);
+    MenuAttributes* pAttributes = new MenuAttributes(rFrame, rImageIdStr);
     pAttributes->acquire();
     return reinterpret_cast<sal_uIntPtr>(pAttributes);
 }
 
-sal_uIntPtr MenuConfiguration::Attributes::CreateAttribute(const css::uno::WeakReference<css::frame::XDispatchProvider>& rDispatchProvider)
+sal_uIntPtr MenuAttributes::CreateAttribute(const css::uno::WeakReference<css::frame::XDispatchProvider>& rDispatchProvider)
 {
-    Attributes* pAttributes = new Attributes(rDispatchProvider);
+    MenuAttributes* pAttributes = new MenuAttributes(rDispatchProvider);
     pAttributes->acquire();
     return reinterpret_cast<sal_uIntPtr>(pAttributes);
 }
 
-void MenuConfiguration::Attributes::ReleaseAttribute(sal_uIntPtr nAttributePtr)
+void MenuAttributes::ReleaseAttribute(sal_uIntPtr nAttributePtr)
 {
     if (!nAttributePtr)
         return;
-    Attributes* pAttributes = reinterpret_cast<Attributes*>(nAttributePtr);
+    MenuAttributes* pAttributes = reinterpret_cast<MenuAttributes*>(nAttributePtr);
     pAttributes->release();
 }
 
diff --git a/framework/source/uielement/menubarmanager.cxx b/framework/source/uielement/menubarmanager.cxx
index d97c96d..de1b06b 100644
--- a/framework/source/uielement/menubarmanager.cxx
+++ b/framework/source/uielement/menubarmanager.cxx
@@ -1255,7 +1255,7 @@ void MenuBarManager::FillMenuManager( Menu* pMenu, const Reference< XFrame >& rF
                 Reference< XDispatchProvider > xPopupMenuDispatchProvider( rDispatchProvider );
 
                 // Retrieve possible attributes struct
-                MenuConfiguration::Attributes* pAttributes = reinterpret_cast<MenuConfiguration::Attributes *>(pMenu->GetUserValue( nItemId ));
+                MenuAttributes* pAttributes = reinterpret_cast<MenuAttributes *>(pMenu->GetUserValue( nItemId ));
                 if ( pAttributes )
                     xPopupMenuDispatchProvider = pAttributes->xDispatchProvider;
 
@@ -1325,8 +1325,8 @@ void MenuBarManager::FillMenuManager( Menu* pMenu, const Reference< XFrame >& rF
                     Image           aImage;
                     OUString   aImageId;
 
-                    MenuConfiguration::Attributes* pMenuAttributes =
-                        reinterpret_cast<MenuConfiguration::Attributes*>(pMenu->GetUserValue( nItemId ));
+                    MenuAttributes* pMenuAttributes =
+                        reinterpret_cast<MenuAttributes*>(pMenu->GetUserValue( nItemId ));
 
                     if ( pMenuAttributes && !pMenuAttributes->aImageId.isEmpty() )
                     {
@@ -1687,8 +1687,8 @@ void MenuBarManager::FillMenu(
                         if ( xDispatchProvider.is() )
                         {
                             // Use attributes struct to transport special dispatch provider
-                            sal_uIntPtr nAttributePtr = MenuConfiguration::Attributes::CreateAttribute(xDispatchProvider);
-                            pMenu->SetUserValue(nId, nAttributePtr, MenuConfiguration::Attributes::ReleaseAttribute);
+                            sal_uIntPtr nAttributePtr = MenuAttributes::CreateAttribute(xDispatchProvider);
+                            pMenu->SetUserValue(nId, nAttributePtr, MenuAttributes::ReleaseAttribute);
                         }
 
                         // Use help command to transport module identifier
@@ -1944,7 +1944,7 @@ void MenuBarManager::Init(const Reference< XFrame >& rFrame,AddonMenu* pAddonMen
         {
             if ( pAddonMenu->GetItemType( i ) != MenuItemType::SEPARATOR )
             {
-                MenuConfiguration::Attributes* pAddonAttributes = reinterpret_cast<MenuConfiguration::Attributes *>(pAddonMenu->GetUserValue( nItemId ));
+                MenuAttributes* pAddonAttributes = reinterpret_cast<MenuAttributes *>(pAddonMenu->GetUserValue( nItemId ));
                 MenuItemHandler* pMenuItemHandler = new MenuItemHandler( nItemId, xStatusListener, xDispatch );
 
                 if ( pAddonAttributes )
diff --git a/framework/source/uielement/newmenucontroller.cxx b/framework/source/uielement/newmenucontroller.cxx
index 12e13fa..c02f1f1 100644
--- a/framework/source/uielement/newmenucontroller.cxx
+++ b/framework/source/uielement/newmenucontroller.cxx
@@ -84,7 +84,7 @@ void NewMenuController::setMenuImages( PopupMenu* pPopupMenu, bool bSetImages )
                 OUString aImageId;
 
                 sal_uIntPtr nAttributePtr = pPopupMenu->GetUserValue(sal::static_int_cast<sal_uInt16>(i));
-                MenuConfiguration::Attributes* pAttributes = reinterpret_cast<MenuConfiguration::Attributes *>(nAttributePtr);
+                MenuAttributes* pAttributes = reinterpret_cast<MenuAttributes *>(nAttributePtr);
                 if (pAttributes)
                     aImageId = pAttributes->aImageId;
 
@@ -349,9 +349,9 @@ void NewMenuController::fillPopupMenu( Reference< css::awt::XPopupMenu >& rPopup
                 sal_uIntPtr nAttributePtr = pSubMenu->GetUserValue(nItemId);
                 if (nAttributePtr)
                 {
-                    MenuConfiguration::Attributes* pAttributes = reinterpret_cast<MenuConfiguration::Attributes *>(nAttributePtr);
+                    MenuAttributes* pAttributes = reinterpret_cast<MenuAttributes *>(nAttributePtr);
                     pAttributes->acquire();
-                    pVCLPopupMenu->SetUserValue(nItemId, nAttributePtr, MenuConfiguration::Attributes::ReleaseAttribute);
+                    pVCLPopupMenu->SetUserValue(nItemId, nAttributePtr, MenuAttributes::ReleaseAttribute);
                 }
             }
         }
@@ -412,7 +412,7 @@ void SAL_CALL NewMenuController::itemSelected( const css::awt::MenuEvent& rEvent
                 PopupMenu* pVCLPopupMenu = static_cast<PopupMenu *>(pPopupMenu->GetMenu());
                 aTargetURL.Complete = pVCLPopupMenu->GetItemCommand(rEvent.MenuId);
                 sal_uIntPtr nAttributePtr = pVCLPopupMenu->GetUserValue(rEvent.MenuId);
-                MenuConfiguration::Attributes* pAttributes = reinterpret_cast<MenuConfiguration::Attributes *>(nAttributePtr);
+                MenuAttributes* pAttributes = reinterpret_cast<MenuAttributes *>(nAttributePtr);
                 if (pAttributes)
                     aTargetFrame = pAttributes->aTargetFrame;
             }
diff --git a/framework/source/uielement/popuptoolbarcontroller.cxx b/framework/source/uielement/popuptoolbarcontroller.cxx
index e0e0ad9..259601e 100644
--- a/framework/source/uielement/popuptoolbarcontroller.cxx
+++ b/framework/source/uielement/popuptoolbarcontroller.cxx
@@ -431,7 +431,7 @@ throw ( css::uno::RuntimeException, std::exception )
     if ( m_xPopupMenu.is() )
     {
         // TODO investigate how to wrap Get/SetUserValue in css::awt::XMenu
-        MenuConfiguration::Attributes* pMenuAttributes( 0 );
+        MenuAttributes* pMenuAttributes( 0 );
         VCLXPopupMenu*  pTkPopupMenu =
             static_cast<VCLXPopupMenu *>( VCLXMenu::GetImplementation( m_xPopupMenu ) );
 
@@ -440,7 +440,7 @@ throw ( css::uno::RuntimeException, std::exception )
             dynamic_cast< PopupMenu * >( pTkPopupMenu->GetMenu() ) : NULL;
 
         if ( pVCLPopupMenu )
-            pMenuAttributes = reinterpret_cast< MenuConfiguration::Attributes* >(
+            pMenuAttributes = reinterpret_cast< MenuAttributes* >(
                 pVCLPopupMenu->GetUserValue( pVCLPopupMenu->GetCurItemId() ) );
 
         if ( pMenuAttributes )
diff --git a/include/framework/menuconfiguration.hxx b/include/framework/menuconfiguration.hxx
index 1a952f7..feeed63 100644
--- a/include/framework/menuconfiguration.hxx
+++ b/include/framework/menuconfiguration.hxx
@@ -56,53 +56,53 @@ const sal_uInt16 ITEMID_ADDONHELP           = FWK_SID_ADDONHELP;
 namespace framework
 {
 
+struct FWE_DLLPUBLIC MenuAttributes
+{
+private:
+    oslInterlockedCount refCount;
+
+    MenuAttributes(const OUString& rFrame, const OUString& rImageIdStr)
+        : refCount(0)
+        , aTargetFrame(rFrame)
+        , aImageId(rImageIdStr)
+        , nStyle(0)
+    {
+    }
+
+    MenuAttributes(const css::uno::WeakReference<css::frame::XDispatchProvider>& rDispatchProvider)
+        : refCount(0)
+        , xDispatchProvider(rDispatchProvider)
+        , nStyle(0)
+    {
+    }
+
+    MenuAttributes(const MenuAttributes&);  //not-implemented
+
+public:
+    OUString aTargetFrame;
+    OUString aImageId;
+    css::uno::WeakReference<css::frame::XDispatchProvider> xDispatchProvider;
+    sal_Int16 nStyle;
+
+    static sal_uIntPtr CreateAttribute(const OUString& rFrame, const OUString& rImageIdStr);
+    static sal_uIntPtr CreateAttribute(const css::uno::WeakReference<css::frame::XDispatchProvider>& rDispatchProvider);
+    static void ReleaseAttribute(sal_uIntPtr nAttributePtr);
+
+    void acquire()
+    {
+        osl_atomic_increment(&refCount);
+    }
+
+    void release()
+    {
+        if (!osl_atomic_decrement(&refCount))
+            delete this;
+    }
+};
+
 class FWE_DLLPUBLIC MenuConfiguration
 {
     public:
-        struct Attributes
-        {
-        private:
-            oslInterlockedCount refCount;
-
-            Attributes(const OUString& rFrame, const OUString& rImageIdStr)
-                : refCount(0)
-                , aTargetFrame(rFrame)
-                , aImageId(rImageIdStr)
-                , nStyle(0)
-            {
-            }
-
-            Attributes(const css::uno::WeakReference<css::frame::XDispatchProvider>& rDispatchProvider)
-                : refCount(0)
-                , xDispatchProvider(rDispatchProvider)
-                , nStyle(0)
-            {
-            }
-
-            Attributes(const Attributes&);  //not-implemented
-
-        public:
-            OUString aTargetFrame;
-            OUString aImageId;
-            css::uno::WeakReference<css::frame::XDispatchProvider> xDispatchProvider;
-            sal_Int16 nStyle;
-
-            static sal_uIntPtr CreateAttribute(const OUString& rFrame, const OUString& rImageIdStr);
-            static sal_uIntPtr CreateAttribute(const css::uno::WeakReference<css::frame::XDispatchProvider>& rDispatchProvider);
-            static void ReleaseAttribute(sal_uIntPtr nAttributePtr);
-
-            void acquire()
-            {
-                osl_atomic_increment(&refCount);
-            }
-
-            void release()
-            {
-                if (!osl_atomic_decrement(&refCount))
-                    delete this;
-            }
-        };
-
         MenuConfiguration(
             // use const when giving a uno reference by reference
             const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext >& rxContext );
diff --git a/sfx2/source/menu/mnuitem.cxx b/sfx2/source/menu/mnuitem.cxx
index 83de775..455d517 100644
--- a/sfx2/source/menu/mnuitem.cxx
+++ b/sfx2/source/menu/mnuitem.cxx
@@ -352,8 +352,8 @@ IMPL_LINK( SfxAppMenuControl_Impl, Activate, Menu *, pActMenu )
                     {
                         bool        bImageSet = false;
                         OUString aImageId;
-                        ::framework::MenuConfiguration::Attributes* pMenuAttributes =
-                            reinterpret_cast< ::framework::MenuConfiguration::Attributes*>(pMenu->GetUserValue( nItemId ));
+                        ::framework::MenuAttributes* pMenuAttributes =
+                            reinterpret_cast< ::framework::MenuAttributes*>(pMenu->GetUserValue( nItemId ));
 
                         if ( pMenuAttributes )
                             aImageId = pMenuAttributes->aImageId; // Retrieve image id from menu attributes
@@ -438,8 +438,8 @@ sal_IntPtr Select_Impl( void* /*pHdl*/, void* pVoid )
     else
     {
         OUString aTargetFrame( "_blank" );
-        ::framework::MenuConfiguration::Attributes* pMenuAttributes =
-            reinterpret_cast< ::framework::MenuConfiguration::Attributes*>(pMenu->GetUserValue( pMenu->GetCurItemId() ));
+        ::framework::MenuAttributes* pMenuAttributes =
+            reinterpret_cast< ::framework::MenuAttributes*>(pMenu->GetUserValue( pMenu->GetCurItemId() ));
 
         if ( pMenuAttributes )
             aTargetFrame = pMenuAttributes->aTargetFrame;
diff --git a/sfx2/source/menu/virtmenu.cxx b/sfx2/source/menu/virtmenu.cxx
index 84c4208..610f7e4 100644
--- a/sfx2/source/menu/virtmenu.cxx
+++ b/sfx2/source/menu/virtmenu.cxx
@@ -438,8 +438,8 @@ void SfxVirtualMenu::CreateFromSVMenu()
                         {
                             OUString aImageId;
 
-                            ::framework::MenuConfiguration::Attributes* pMenuAttributes =
-                                reinterpret_cast< ::framework::MenuConfiguration::Attributes*>(pSVMenu->GetUserValue( nSlotId ));
+                            ::framework::MenuAttributes* pMenuAttributes =
+                                reinterpret_cast< ::framework::MenuAttributes*>(pSVMenu->GetUserValue( nSlotId ));
 
                             if ( pMenuAttributes )
                                 aImageId = pMenuAttributes->aImageId; // Retrieve image id from menu attributes
@@ -510,8 +510,8 @@ IMPL_LINK_NOARG(SfxVirtualMenu, SettingsChanged)
                     OUString aCmd( pSVMenu->GetItemCommand( nSlotId ) );
                     OUString aImageId;
 
-                    ::framework::MenuConfiguration::Attributes* pMenuAttributes =
-                        reinterpret_cast< ::framework::MenuConfiguration::Attributes*>(pSVMenu->GetUserValue( nSlotId ));
+                    ::framework::MenuAttributes* pMenuAttributes =
+                        reinterpret_cast< ::framework::MenuAttributes*>(pSVMenu->GetUserValue( nSlotId ));
 
                     if ( pMenuAttributes )
                         aImageId = pMenuAttributes->aImageId; // Retrieve image id from menu attributes
@@ -578,8 +578,8 @@ void SfxVirtualMenu::UpdateImages( Menu* pMenu )
             {
                 OUString aImageId;
 
-                ::framework::MenuConfiguration::Attributes* pMenuAttributes =
-                    reinterpret_cast< ::framework::MenuConfiguration::Attributes*>(pMenu->GetUserValue( nSlotId ));
+                ::framework::MenuAttributes* pMenuAttributes =
+                    reinterpret_cast< ::framework::MenuAttributes*>(pMenu->GetUserValue( nSlotId ));
 
                 if ( pMenuAttributes )
                     aImageId = pMenuAttributes->aImageId; // Retrieve image id from menu attributes


More information about the Libreoffice-commits mailing list