[Libreoffice-commits] core.git: 3 commits - framework/Library_fwk.mk framework/source framework/util include/sfx2 officecfg/registry sfx2/source sw/source sw/uiconfig sw/UIConfig_sglobal.mk sw/UIConfig_sweb.mk sw/UIConfig_swform.mk sw/UIConfig_swreport.mk sw/UIConfig_swriter.mk sw/UIConfig_swxform.mk

Maxim Monastirsky momonasmon at gmail.com
Sat Dec 12 23:14:33 PST 2015


 framework/Library_fwk.mk                                                     |    1 
 framework/source/uielement/resourcemenucontroller.cxx                        |  332 ++++++++++
 framework/util/fwk.component                                                 |    4 
 include/sfx2/objface.hxx                                                     |    2 
 include/sfx2/viewsh.hxx                                                      |    1 
 officecfg/registry/data/org/openoffice/Office/UI/GenericCommands.xcu         |    3 
 officecfg/registry/data/org/openoffice/Office/UI/WriterCommands.xcu          |   13 
 officecfg/registry/data/org/openoffice/Office/UI/WriterFormWindowState.xcu   |    5 
 officecfg/registry/data/org/openoffice/Office/UI/WriterGlobalWindowState.xcu |    5 
 officecfg/registry/data/org/openoffice/Office/UI/WriterReportWindowState.xcu |    5 
 officecfg/registry/data/org/openoffice/Office/UI/WriterWebWindowState.xcu    |    5 
 officecfg/registry/data/org/openoffice/Office/UI/WriterWindowState.xcu       |    5 
 sfx2/source/control/dispatch.cxx                                             |   39 +
 sfx2/source/control/objface.cxx                                              |   11 
 sfx2/source/view/viewsh.cxx                                                  |   59 +
 sw/UIConfig_sglobal.mk                                                       |    4 
 sw/UIConfig_sweb.mk                                                          |    4 
 sw/UIConfig_swform.mk                                                        |    4 
 sw/UIConfig_swreport.mk                                                      |    4 
 sw/UIConfig_swriter.mk                                                       |    4 
 sw/UIConfig_swxform.mk                                                       |    4 
 sw/source/uibase/shells/tabsh.cxx                                            |    3 
 sw/source/uibase/web/wtabsh.cxx                                              |    3 
 sw/uiconfig/sglobal/popupmenu/table.xml                                      |  109 +++
 sw/uiconfig/sweb/popupmenu/table.xml                                         |  109 +++
 sw/uiconfig/swform/popupmenu/table.xml                                       |  109 +++
 sw/uiconfig/swreport/popupmenu/table.xml                                     |  109 +++
 sw/uiconfig/swriter/popupmenu/table.xml                                      |  109 +++
 sw/uiconfig/swxform/popupmenu/table.xml                                      |  109 +++
 29 files changed, 1169 insertions(+), 5 deletions(-)

New commits:
commit bb2ead8b4bcf197403842cef16a61acdb3185755
Author: Maxim Monastirsky <momonasmon at gmail.com>
Date:   Sat Dec 12 23:44:47 2015 +0200

    tdf#93837 Adapt sfx2 to use xml based context menus
    
    Change-Id: I71aaa98e9cf022b53cc094418bc09fb385af55ce

diff --git a/include/sfx2/objface.hxx b/include/sfx2/objface.hxx
index d7c1b76..22b28a3 100644
--- a/include/sfx2/objface.hxx
+++ b/include/sfx2/objface.hxx
@@ -80,7 +80,9 @@ public:
     sal_uInt32              GetChildWindowId( sal_uInt16 nNo ) const;
     sal_uInt16              GetChildWindowCount() const;
     void                    RegisterPopupMenu( const ResId& );
+    void                    RegisterPopupMenu( const OUString& );
     const ResId&            GetPopupMenuResId() const;
+    const OUString&         GetPopupMenuName() const;
     const ResId&            GetStatusBarResId() const;
 
     void                    Register( SfxModule* );
diff --git a/include/sfx2/viewsh.hxx b/include/sfx2/viewsh.hxx
index b333196..f19d66a 100644
--- a/include/sfx2/viewsh.hxx
+++ b/include/sfx2/viewsh.hxx
@@ -284,6 +284,7 @@ public:
                                 GetController();
 
     bool                        TryContextMenuInterception( Menu& rIn, const OUString& rMenuIdentifier, Menu*& rpOut, css::ui::ContextMenuExecuteEvent aEvent );
+    bool                        TryContextMenuInterception( Menu& rMenu, const OUString& rMenuIdentifier, css::ui::ContextMenuExecuteEvent aEvent );
 
     void                        ExecPrint( const css::uno::Sequence < css::beans::PropertyValue >&, bool, bool );
     // Like ExecPrint(), but only sets up for printing. Use Printer::ExecutePrintJob() and Printer::FinishPrintJob() afterwards.
diff --git a/sfx2/source/control/dispatch.cxx b/sfx2/source/control/dispatch.cxx
index 023b4cb..e50f9ab 100644
--- a/sfx2/source/control/dispatch.cxx
+++ b/sfx2/source/control/dispatch.cxx
@@ -29,8 +29,11 @@
 #include <com/sun/star/beans/XPropertySet.hpp>
 #include <com/sun/star/frame/XDispatchRecorderSupplier.hpp>
 #include <com/sun/star/frame/XLayoutManager.hpp>
+#include <com/sun/star/frame/XPopupMenuController.hpp>
 
 #include <comphelper/lok.hxx>
+#include <comphelper/processfactory.hxx>
+#include <comphelper/propertyvalue.hxx>
 #include <rtl/strbuf.hxx>
 #include <sfx2/app.hxx>
 #include <sfx2/bindings.hxx>
@@ -57,6 +60,8 @@
 #include <svl/undo.hxx>
 #include <svl/whiter.hxx>
 #include <svtools/helpopt.hxx>
+#include <toolkit/awt/vclxmenu.hxx>
+#include <toolkit/helper/vclunohelper.hxx>
 #include <vcl/wrkwin.hxx>
 #include <vcl/idle.hxx>
 
@@ -1881,12 +1886,44 @@ void SfxDispatcher::ExecutePopup( sal_uInt16 nConfigId, vcl::Window *pWin, const
     }
 
     vcl::Window *pWindow = pWin ? pWin : rDisp.xImp->pFrame->GetFrame().GetWorkWindow_Impl()->GetWindow();
+    Point aPos = pPos ? *pPos : pWindow->GetPointerPosPixel();
     for ( pSh = rDisp.GetShell(nShLevel); pSh; ++nShLevel, pSh = rDisp.GetShell(nShLevel) )
     {
         const ResId& rResId = pSh->GetInterface()->GetPopupMenuResId();
+        const OUString& rResName = pSh->GetInterface()->GetPopupMenuName();
         if ( ( nConfigId == 0 && rResId.GetId() ) || ( nConfigId != 0 && rResId.GetId() == nConfigId ) )
         {
-            SfxPopupMenuManager::ExecutePopup( rResId, rDisp.GetFrame(), pPos ? *pPos : pWindow->GetPointerPosPixel(), pWindow );
+            SfxPopupMenuManager::ExecutePopup( rResId, rDisp.GetFrame(), aPos, pWindow );
+            return;
+        }
+        else if ( nConfigId == 0 && !rResName.isEmpty() )
+        {
+            css::uno::Sequence< css::uno::Any > aArgs( 3 );
+            aArgs[0] <<= comphelper::makePropertyValue( "Value", rResName );
+            aArgs[1] <<= comphelper::makePropertyValue( "Frame", rDisp.GetFrame()->GetFrame().GetFrameInterface() );
+            aArgs[2] <<= comphelper::makePropertyValue( "IsContextMenu", true );
+
+            css::uno::Reference< css::uno::XComponentContext > xContext = comphelper::getProcessComponentContext();
+            css::uno::Reference< css::frame::XPopupMenuController > xPopupController(
+                xContext->getServiceManager()->createInstanceWithArgumentsAndContext(
+                "com.sun.star.comp.framework.ResourceMenuController", aArgs, xContext ), css::uno::UNO_QUERY );
+
+            css::uno::Reference< css::awt::XPopupMenu > xPopupMenu( xContext->getServiceManager()->createInstanceWithContext(
+                "com.sun.star.awt.PopupMenu", xContext ), css::uno::UNO_QUERY );
+
+            if ( !xPopupController.is() || !xPopupMenu.is() )
+                continue;
+
+            css::ui::ContextMenuExecuteEvent aEvent;
+            aEvent.SourceWindow = VCLUnoHelper::GetInterface( pWindow );
+            aEvent.ExecutePosition.X = aPos.X();
+            aEvent.ExecutePosition.Y = aPos.Y();
+
+            xPopupController->setPopupMenu( xPopupMenu );
+            VCLXMenu* pAwtMenu = VCLXMenu::GetImplementation( xPopupMenu );
+            PopupMenu* pVCLMenu = static_cast< PopupMenu* >( pAwtMenu->GetMenu() );
+            if ( pVCLMenu && rDisp.GetFrame()->GetViewShell()->TryContextMenuInterception( *pVCLMenu, rResName, aEvent ) )
+                pVCLMenu->Execute( pWindow, aPos );
             return;
         }
     }
diff --git a/sfx2/source/control/objface.cxx b/sfx2/source/control/objface.cxx
index 4794ff1..cd51b0a 100644
--- a/sfx2/source/control/objface.cxx
+++ b/sfx2/source/control/objface.cxx
@@ -77,6 +77,7 @@ struct SfxInterface_Impl
 {
     SfxObjectUIArr_Impl     aObjectBars;    // registered ObjectBars
     SfxObjectUIArr_Impl     aChildWindows;  // registered ChildWindows
+    OUString                aPopupName;     // registered xml-based PopupMenu
     ResId                   aPopupRes;      // registered PopupMenu
     ResId                   aStatBarRes;    // registered StatusBar
     SfxModule*              pModule;
@@ -372,6 +373,11 @@ void SfxInterface::RegisterPopupMenu( const ResId& rResId )
     pImpData->aPopupRes = rResId;
 }
 
+void SfxInterface::RegisterPopupMenu( const OUString& rResourceName )
+{
+    pImpData->aPopupName = rResourceName;
+}
+
 void SfxInterface::RegisterObjectBar(sal_uInt16 nPos, sal_uInt32 nResId)
 {
     RegisterObjectBar(nPos, nResId, 0UL);
@@ -510,6 +516,11 @@ const ResId& SfxInterface::GetPopupMenuResId() const
     return pImpData->aPopupRes;
 }
 
+const OUString& SfxInterface::GetPopupMenuName() const
+{
+    return pImpData->aPopupName;
+}
+
 const ResId& SfxInterface::GetStatusBarResId() const
 {
     if (pImpData->aStatBarRes.GetId() == 0 && pGenoType)
diff --git a/sfx2/source/view/viewsh.cxx b/sfx2/source/view/viewsh.cxx
index e4c14a2..392f68d 100644
--- a/sfx2/source/view/viewsh.cxx
+++ b/sfx2/source/view/viewsh.cxx
@@ -2000,6 +2000,65 @@ bool SfxViewShell::TryContextMenuInterception( Menu& rIn, const OUString& rMenuI
     return true;
 }
 
+bool SfxViewShell::TryContextMenuInterception( Menu& rMenu, const OUString& rMenuIdentifier, css::ui::ContextMenuExecuteEvent aEvent )
+{
+    bool bModified = false;
+
+    // create container from menu
+    aEvent.ActionTriggerContainer = ::framework::ActionTriggerHelper::CreateActionTriggerContainerFromMenu( &rMenu, &rMenuIdentifier );
+
+    // get selection from controller
+    aEvent.Selection = css::uno::Reference< css::view::XSelectionSupplier >( GetController(), css::uno::UNO_QUERY );
+
+    // call interceptors
+    ::cppu::OInterfaceIteratorHelper aIt( pImp->aInterceptorContainer );
+    while( aIt.hasMoreElements() )
+    {
+        try
+        {
+            css::ui::ContextMenuInterceptorAction eAction;
+            {
+                SolarMutexReleaser rel;
+                eAction = static_cast< css::ui::XContextMenuInterceptor* >( aIt.next() )->notifyContextMenuExecute( aEvent );
+            }
+            switch ( eAction )
+            {
+                case css::ui::ContextMenuInterceptorAction_CANCELLED:
+                    // interceptor does not want execution
+                    return false;
+                case css::ui::ContextMenuInterceptorAction_EXECUTE_MODIFIED:
+                    // interceptor wants his modified menu to be executed
+                    bModified = true;
+                    break;
+                case css::ui::ContextMenuInterceptorAction_CONTINUE_MODIFIED:
+                    // interceptor has modified menu, but allows for calling other interceptors
+                    bModified = true;
+                    continue;
+                case css::ui::ContextMenuInterceptorAction_IGNORED:
+                    // interceptor is indifferent
+                    continue;
+                default:
+                    SAL_WARN( "sfx.view", "Wrong return value of ContextMenuInterceptor!" );
+                    continue;
+            }
+        }
+        catch (...)
+        {
+            aIt.remove();
+        }
+
+        break;
+    }
+
+    if ( bModified )
+    {
+        rMenu.Clear();
+        ::framework::ActionTriggerHelper::CreateMenuFromActionTriggerContainer( &rMenu, aEvent.ActionTriggerContainer );
+    }
+
+    return true;
+}
+
 void SfxViewShell::TakeOwnership_Impl()
 {
     // currently there is only one reason to take Ownership: a hidden frame is printed
commit bf18145d3ff9ec731bc6caa9797e76bfb71a6c1a
Author: Maxim Monastirsky <momonasmon at gmail.com>
Date:   Sat Dec 12 23:43:06 2015 +0200

    tdf#93837 Add helper code to load popup menus from xml
    
    Using internally MenuBarManager to manage this kind of menus.
    Implemented as a popup menu controller to be able to use in
    menubar/toolbar, not only as a context menu.
    
    Change-Id: I46719d66c569db83edd04faf977e0b2b3df0c5fa

diff --git a/framework/Library_fwk.mk b/framework/Library_fwk.mk
index 7cd6fe4..ce85848 100644
--- a/framework/Library_fwk.mk
+++ b/framework/Library_fwk.mk
@@ -144,6 +144,7 @@ $(eval $(call gb_Library_add_exception_objects,fwk,\
     framework/source/uielement/popuptoolbarcontroller \
     framework/source/uielement/progressbarwrapper \
     framework/source/uielement/recentfilesmenucontroller \
+    framework/source/uielement/resourcemenucontroller \
     framework/source/uielement/saveasmenucontroller \
     framework/source/uielement/spinfieldtoolbarcontroller \
     framework/source/uielement/statusbar \
diff --git a/framework/source/uielement/resourcemenucontroller.cxx b/framework/source/uielement/resourcemenucontroller.cxx
new file mode 100644
index 0000000..a5c55d5
--- /dev/null
+++ b/framework/source/uielement/resourcemenucontroller.cxx
@@ -0,0 +1,332 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ */
+
+#include <uielement/menubarmanager.hxx>
+
+#include <svtools/popupmenucontrollerbase.hxx>
+#include <unotools/mediadescriptor.hxx>
+
+#include <com/sun/star/embed/VerbAttributes.hpp>
+#include <com/sun/star/embed/VerbDescriptor.hpp>
+#include <com/sun/star/frame/ModuleManager.hpp>
+#include <com/sun/star/ui/theModuleUIConfigurationManagerSupplier.hpp>
+#include <com/sun/star/ui/XUIConfigurationManagerSupplier.hpp>
+#include <com/sun/star/util/URL.hpp>
+
+namespace {
+
+class ResourceMenuController : public cppu::ImplInheritanceHelper< svt::PopupMenuControllerBase, css::ui::XUIConfigurationListener >
+{
+public:
+    ResourceMenuController( const css::uno::Reference< css::uno::XComponentContext >& rxContext,
+                            const css::uno::Sequence< css::uno::Any >& rxArgs );
+    virtual ~ResourceMenuController();
+
+    // XPopupMenuController
+    virtual void SAL_CALL updatePopupMenu() throw ( css::uno::RuntimeException, std::exception ) override;
+
+    // XStatusListener
+    virtual void SAL_CALL statusChanged( const css::frame::FeatureStateEvent& rEvent ) throw ( css::uno::RuntimeException, std::exception ) override;
+
+    // XEventListener
+    virtual void SAL_CALL disposing( const css::lang::EventObject& rEvent ) throw ( css::uno::RuntimeException, std::exception ) override;
+
+    // XUIConfigurationListener
+    virtual void SAL_CALL elementInserted( const css::ui::ConfigurationEvent& rEvent ) throw ( css::uno::RuntimeException, std::exception ) override;
+    virtual void SAL_CALL elementRemoved( const css::ui::ConfigurationEvent& rEvent ) throw ( css::uno::RuntimeException, std::exception ) override;
+    virtual void SAL_CALL elementReplaced( const css::ui::ConfigurationEvent& rEvent ) throw ( css::uno::RuntimeException, std::exception ) override;
+
+    // XMenuListener
+    virtual void SAL_CALL itemActivated( const css::awt::MenuEvent& rEvent ) throw ( css::uno::RuntimeException, std::exception ) override;
+    virtual void SAL_CALL itemSelected( const css::awt::MenuEvent& rEvent ) throw ( css::uno::RuntimeException, std::exception ) override;
+
+    // XServiceInfo
+    virtual OUString SAL_CALL getImplementationName() throw ( css::uno::RuntimeException, std::exception ) override;
+    virtual css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames() throw ( css::uno::RuntimeException, std::exception ) override;
+
+private:
+    OUString m_aMenuURL;
+    bool m_bContextMenu;
+    bool m_bInToolbar;
+    sal_uInt16 m_nNewMenuId;
+    rtl::Reference< framework::MenuBarManager > m_xMenuBarManager;
+    css::uno::Reference< css::container::XIndexAccess > m_xMenuContainer;
+    css::uno::Reference< css::uno::XComponentContext > m_xContext;
+    css::uno::Reference< css::ui::XUIConfigurationManager > m_xConfigManager, m_xModuleConfigManager;
+    void addVerbs( const css::uno::Sequence< css::embed::VerbDescriptor >& rVerbs );
+    virtual void SAL_CALL disposing() override;
+};
+
+ResourceMenuController::ResourceMenuController( const css::uno::Reference< css::uno::XComponentContext >& rxContext,
+                                                const css::uno::Sequence< css::uno::Any >& rxArgs ) :
+    ImplInheritanceHelper( rxContext ),
+    m_bContextMenu( false ),
+    m_bInToolbar( false ),
+    m_nNewMenuId( 1 ),
+    m_xContext( rxContext )
+{
+    for ( const auto& arg: rxArgs )
+    {
+        css::beans::PropertyValue aPropValue;
+        if ( arg >>= aPropValue )
+        {
+            if ( aPropValue.Name == "Value" )
+            {
+                OUString aMenuName;
+                aPropValue.Value >>= aMenuName;
+                m_aMenuURL = "private:resource/popupmenu/" + aMenuName;
+            }
+            else if ( aPropValue.Name == "Frame" )
+                aPropValue.Value >>= m_xFrame;
+            else if ( aPropValue.Name == "ModuleIdentifier" )
+                aPropValue.Value >>= m_aModuleName;
+            else if ( aPropValue.Name == "IsContextMenu" )
+                aPropValue.Value >>= m_bContextMenu;
+            else if ( aPropValue.Name == "InToolbar" )
+                aPropValue.Value >>= m_bInToolbar;
+        }
+    }
+    if ( m_xFrame.is() )
+        // No need to initialize again through initialize method.
+        m_bInitialized = true;
+}
+
+ResourceMenuController::~ResourceMenuController()
+{
+}
+
+void ResourceMenuController::updatePopupMenu()
+    throw ( css::uno::RuntimeException, std::exception )
+{
+    if ( m_xMenuContainer.is() && !m_bContextMenu )
+        // Container is still valid, no need to do anything on our side.
+        return;
+
+    if ( m_aModuleName.isEmpty() )
+    {
+        try
+        {
+            css::uno::Reference< css::frame::XModuleManager > xModuleManager( css::frame::ModuleManager::create( m_xContext ) );
+            m_aModuleName = xModuleManager->identify( m_xFrame );
+        }
+        catch( const css::uno::Exception& )
+        {}
+    }
+
+    if ( !m_xConfigManager.is() )
+    {
+        try
+        {
+            css::uno::Reference< css::frame::XController > xController( m_xFrame->getController() );
+            css::uno::Reference< css::frame::XModel > xModel( xController->getModel() );
+            css::uno::Reference< css::ui::XUIConfigurationManagerSupplier > xSupplier( xModel, css::uno::UNO_QUERY_THROW );
+            m_xConfigManager.set( xSupplier->getUIConfigurationManager() );
+            css::uno::Reference< css::ui::XUIConfiguration > xConfig( m_xConfigManager, css::uno::UNO_QUERY_THROW );
+            xConfig->addConfigurationListener( this );
+        }
+        catch( const css::uno::RuntimeException& )
+        {}
+    }
+
+    if ( !m_xModuleConfigManager.is() )
+    {
+        try
+        {
+            css::uno::Reference< css::ui::XModuleUIConfigurationManagerSupplier > xModuleCfgMgrSupplier(
+                css::ui::theModuleUIConfigurationManagerSupplier::get( m_xContext ) );
+            m_xModuleConfigManager.set( xModuleCfgMgrSupplier->getUIConfigurationManager( m_aModuleName ) );
+            css::uno::Reference< css::ui::XUIConfiguration > xConfig( m_xModuleConfigManager, css::uno::UNO_QUERY_THROW );
+            xConfig->addConfigurationListener( this );
+        }
+        catch ( const css::container::NoSuchElementException& )
+        {
+            SAL_WARN( "fwk.uielement", "Invalid module identifier: " << m_aModuleName );
+        }
+        catch( const css::uno::RuntimeException& )
+        {}
+    }
+
+    if ( !m_xMenuContainer.is() )
+    {
+        try
+        {
+            if ( m_xConfigManager.is() && m_xConfigManager->hasSettings( m_aMenuURL ) )
+                m_xMenuContainer.set( m_xConfigManager->getSettings( m_aMenuURL, sal_False ) );
+            else if ( m_xModuleConfigManager.is() && m_xModuleConfigManager->hasSettings( m_aMenuURL ) )
+                m_xMenuContainer.set( m_xModuleConfigManager->getSettings( m_aMenuURL, sal_False ) );
+        }
+        catch ( const css::container::NoSuchElementException& )
+        {
+            SAL_WARN( "fwk.uielement", "Can not find settings for " << m_aMenuURL );
+            return;
+        }
+        catch ( const css::lang::IllegalArgumentException& )
+        {
+            SAL_WARN( "fwk.uielement", "The given URL is not valid: " << m_aMenuURL );
+            return;
+        }
+    }
+
+    // Clear previous content.
+    m_xMenuBarManager.clear();
+    resetPopupMenu( m_xPopupMenu );
+    m_nNewMenuId = 1;
+
+    // Now fill the menu with the configuration data.
+    VCLXMenu* pAwtMenu = VCLXMenu::GetImplementation( m_xPopupMenu );
+    css::uno::Reference< css::frame::XDispatchProvider > xDispatchProvider( m_xFrame, css::uno::UNO_QUERY );
+    framework::MenuBarManager::FillMenu( m_nNewMenuId, pAwtMenu->GetMenu(), m_aModuleName, m_xMenuContainer, xDispatchProvider );
+
+    // For context menus, add object verbs.
+    if ( m_bContextMenu )
+    {
+        css::util::URL aObjectMenuURL;
+        aObjectMenuURL.Complete = ".uno:ObjectMenue";
+        m_xURLTransformer->parseStrict( aObjectMenuURL );
+        css::uno::Reference< css::frame::XDispatch > xDispatch( xDispatchProvider->queryDispatch( aObjectMenuURL, OUString(), 0 ) );
+        if ( xDispatch.is() )
+        {
+            xDispatch->addStatusListener( this, aObjectMenuURL );
+            xDispatch->removeStatusListener( this, aObjectMenuURL );
+        }
+    }
+}
+
+void ResourceMenuController::statusChanged( const css::frame::FeatureStateEvent& rEvent )
+    throw ( css::uno::RuntimeException, std::exception )
+{
+    css::uno::Sequence< css::embed::VerbDescriptor > aVerbs;
+    if ( rEvent.IsEnabled && ( rEvent.State >>= aVerbs ) )
+        addVerbs( aVerbs );
+}
+
+void ResourceMenuController::addVerbs( const css::uno::Sequence< css::embed::VerbDescriptor >& rVerbs )
+{
+    // Check if the document is read-only.
+    css::uno::Reference< css::frame::XController > xController( m_xFrame->getController() );
+    css::uno::Reference< css::frame::XModel > xModel;
+    if ( xController.is() )
+        xModel.set( xController->getModel() );
+
+    bool bReadOnly = false;
+    if ( xModel.is() )
+    {
+        utl::MediaDescriptor aMediaDesc( xModel->getArgs() );
+        bReadOnly = aMediaDesc.getUnpackedValueOrDefault( utl::MediaDescriptor::PROP_READONLY(), false );
+    }
+
+    VCLXMenu* pAwtMenu = VCLXMenu::GetImplementation( m_xPopupMenu );
+    Menu* pVCLMenu = pAwtMenu->GetMenu();
+
+    for ( const auto& rVerb : rVerbs )
+    {
+        if ( rVerb.VerbAttributes ^ css::embed::VerbAttributes::MS_VERBATTR_ONCONTAINERMENU ||
+            ( bReadOnly && rVerb.VerbAttributes ^ css::embed::VerbAttributes::MS_VERBATTR_NEVERDIRTIES ) )
+            continue;
+
+        pVCLMenu->InsertItem( m_nNewMenuId, rVerb.VerbName );
+        pVCLMenu->SetItemCommand( m_nNewMenuId, ".uno:ObjectMenue?VerbID:short=" + OUString::number( rVerb.VerbID ) );
+        ++m_nNewMenuId;
+    }
+}
+
+void ResourceMenuController::itemActivated( const css::awt::MenuEvent& /*rEvent*/ )
+    throw ( css::uno::RuntimeException, std::exception )
+{
+    // Must initialize MenuBarManager here, because we want to let the app do context menu interception before.
+    if ( !m_xMenuBarManager.is() )
+    {
+        VCLXMenu* pAwtMenu = VCLXMenu::GetImplementation( m_xPopupMenu );
+        css::uno::Reference< css::frame::XDispatchProvider > xDispatchProvider( m_xFrame, css::uno::UNO_QUERY );
+        m_xMenuBarManager.set( new framework::MenuBarManager(
+            m_xContext, m_xFrame, m_xURLTransformer, xDispatchProvider, m_aModuleName, pAwtMenu->GetMenu(), true, true, !m_bContextMenu && !m_bInToolbar ) );
+    }
+}
+
+void ResourceMenuController::itemSelected( const css::awt::MenuEvent& /*rEvent*/ )
+    throw ( css::uno::RuntimeException, std::exception )
+{
+    // Must override this, because we are managed by MenuBarManager, so don't want the handler found in the base class.
+}
+
+void ResourceMenuController::elementInserted( const css::ui::ConfigurationEvent& rEvent )
+    throw ( css::uno::RuntimeException, std::exception )
+{
+    if ( rEvent.ResourceURL == m_aMenuURL )
+        m_xMenuContainer.clear();
+}
+
+void ResourceMenuController::elementRemoved( const css::ui::ConfigurationEvent& rEvent )
+    throw ( css::uno::RuntimeException, std::exception )
+{
+    elementInserted( rEvent );
+}
+
+void ResourceMenuController::elementReplaced( const css::ui::ConfigurationEvent& rEvent )
+    throw ( css::uno::RuntimeException, std::exception )
+{
+    elementInserted( rEvent );
+}
+
+void ResourceMenuController::disposing( const css::lang::EventObject& rEvent )
+    throw ( css::uno::RuntimeException, std::exception )
+{
+    if ( rEvent.Source == m_xConfigManager )
+        m_xConfigManager.clear();
+    else if ( rEvent.Source == m_xModuleConfigManager )
+        m_xModuleConfigManager.clear();
+    else
+    {
+        svt::PopupMenuControllerBase::disposing( rEvent );
+        m_xMenuBarManager.clear();
+    }
+}
+
+void ResourceMenuController::disposing()
+{
+    css::uno::Reference< css::ui::XUIConfiguration > xConfig( m_xConfigManager, css::uno::UNO_QUERY );
+    if ( xConfig.is() )
+        xConfig->removeConfigurationListener( this );
+
+    css::uno::Reference< css::ui::XUIConfiguration > xModuleConfig( m_xModuleConfigManager, css::uno::UNO_QUERY );
+    if ( xModuleConfig.is() )
+        xModuleConfig->removeConfigurationListener( this );
+
+    m_xConfigManager.clear();
+    m_xModuleConfigManager.clear();
+    m_xMenuBarManager.clear();
+    m_xMenuContainer.clear();
+
+    svt::PopupMenuControllerBase::disposing();
+}
+
+OUString ResourceMenuController::getImplementationName()
+    throw ( css::uno::RuntimeException, std::exception )
+{
+    return OUString( "com.sun.star.comp.framework.ResourceMenuController" );
+}
+
+css::uno::Sequence< OUString > ResourceMenuController::getSupportedServiceNames()
+    throw ( css::uno::RuntimeException, std::exception )
+{
+    css::uno::Sequence< OUString > aRet { "com.sun.star.frame.PopupMenuController" };
+    return aRet;
+}
+
+}
+
+extern "C" SAL_DLLPUBLIC_EXPORT css::uno::XInterface * SAL_CALL
+com_sun_star_comp_framework_ResourceMenuController_get_implementation(
+    css::uno::XComponentContext* context,
+    css::uno::Sequence< css::uno::Any > const & args )
+{
+    return cppu::acquire( new ResourceMenuController( context, args ) );
+}
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/framework/util/fwk.component b/framework/util/fwk.component
index 9d5dbbc..f14fbe4 100644
--- a/framework/util/fwk.component
+++ b/framework/util/fwk.component
@@ -212,4 +212,8 @@
       constructor="com_sun_star_comp_framework_ToolbarAsMenuController_get_implementation">
     <service name="com.sun.star.frame.PopupMenuController"/>
   </implementation>
+  <implementation name="com.sun.star.comp.framework.ResourceMenuController"
+      constructor="com_sun_star_comp_framework_ResourceMenuController_get_implementation">
+    <service name="com.sun.star.frame.PopupMenuController"/>
+  </implementation>
 </component>
commit 2657e3146232dc61d759ff5da35eba2ce6270517
Author: Maxim Monastirsky <momonasmon at gmail.com>
Date:   Sat Dec 12 23:34:38 2015 +0200

    tdf#93837 Convert MN_TAB_POPUPMENU to xml
    
    Change-Id: I8bf4557094bc32ad58760e822689c3f1d5f33c8f

diff --git a/officecfg/registry/data/org/openoffice/Office/UI/GenericCommands.xcu b/officecfg/registry/data/org/openoffice/Office/UI/GenericCommands.xcu
index 29e005d..a75ea71 100644
--- a/officecfg/registry/data/org/openoffice/Office/UI/GenericCommands.xcu
+++ b/officecfg/registry/data/org/openoffice/Office/UI/GenericCommands.xcu
@@ -3736,6 +3736,9 @@
         <prop oor:name="Label" oor:type="xs:string">
           <value xml:lang="en-US">Paste Unformatted Text</value>
         </prop>
+        <prop oor:name="PopupLabel" oor:type="xs:string">
+          <value xml:lang="en-US">~Unformatted Text</value>
+        </prop>
       </node>
       <node oor:name=".uno:Delete" oor:op="replace">
         <prop oor:name="Label" oor:type="xs:string">
diff --git a/officecfg/registry/data/org/openoffice/Office/UI/WriterCommands.xcu b/officecfg/registry/data/org/openoffice/Office/UI/WriterCommands.xcu
index 3981ce1..b6a0311 100644
--- a/officecfg/registry/data/org/openoffice/Office/UI/WriterCommands.xcu
+++ b/officecfg/registry/data/org/openoffice/Office/UI/WriterCommands.xcu
@@ -1199,6 +1199,9 @@
         <prop oor:name="Label" oor:type="xs:string">
           <value xml:lang="en-US">Paste ~Special...</value>
         </prop>
+        <prop oor:name="PopupLabel" oor:type="xs:string">
+          <value xml:lang="en-US">~More Options...</value>
+        </prop>
       </node>
       <node oor:name=".uno:DeleteRows" oor:op="replace">
         <prop oor:name="Label" oor:type="xs:string">
@@ -2369,6 +2372,16 @@
       </node>
     </node>
     <node oor:name="Popups">
+      <node oor:name=".uno:PasteSpecialMenu" oor:op="replace">
+        <prop oor:name="Label" oor:type="xs:string">
+          <value xml:lang="en-US">Paste ~Special</value>
+        </prop>
+      </node>
+      <node oor:name=".uno:AlignTextMenu" oor:op="replace">
+        <prop oor:name="Label" oor:type="xs:string">
+          <value xml:lang="en-US">A~lignment</value>
+        </prop>
+      </node>
       <node oor:name=".uno:TableMenu" oor:op="replace">
         <prop oor:name="Label" oor:type="xs:string">
           <value xml:lang="en-US">T~able</value>
diff --git a/officecfg/registry/data/org/openoffice/Office/UI/WriterFormWindowState.xcu b/officecfg/registry/data/org/openoffice/Office/UI/WriterFormWindowState.xcu
index 45333b8..e64c937 100644
--- a/officecfg/registry/data/org/openoffice/Office/UI/WriterFormWindowState.xcu
+++ b/officecfg/registry/data/org/openoffice/Office/UI/WriterFormWindowState.xcu
@@ -20,6 +20,11 @@
 <oor:component-data xmlns:install="http://openoffice.org/2004/installation" xmlns:oor="http://openoffice.org/2001/registry" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" oor:name="WriterFormWindowState" oor:package="org.openoffice.Office.UI">
   <node oor:name="UIElements">
     <node oor:name="States">
+      <node oor:name="private:resource/popupmenu/table" oor:op="replace">
+        <prop oor:name="UIName" oor:type="xs:string">
+          <value xml:lang="en-US">Table</value>
+        </prop>
+      </node>
       <node oor:name="private:resource/toolbar/standardbar" oor:op="replace">
         <prop oor:name="DockPos" oor:type="xs:string">
           <value>0,0</value>
diff --git a/officecfg/registry/data/org/openoffice/Office/UI/WriterGlobalWindowState.xcu b/officecfg/registry/data/org/openoffice/Office/UI/WriterGlobalWindowState.xcu
index 05d1659..16821c2 100644
--- a/officecfg/registry/data/org/openoffice/Office/UI/WriterGlobalWindowState.xcu
+++ b/officecfg/registry/data/org/openoffice/Office/UI/WriterGlobalWindowState.xcu
@@ -20,6 +20,11 @@
 <oor:component-data xmlns:install="http://openoffice.org/2004/installation" xmlns:oor="http://openoffice.org/2001/registry" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" oor:name="WriterGlobalWindowState" oor:package="org.openoffice.Office.UI">
   <node oor:name="UIElements">
     <node oor:name="States">
+      <node oor:name="private:resource/popupmenu/table" oor:op="replace">
+        <prop oor:name="UIName" oor:type="xs:string">
+          <value xml:lang="en-US">Table</value>
+        </prop>
+      </node>
       <node oor:name="private:resource/toolbar/standardbar" oor:op="replace">
         <prop oor:name="DockPos" oor:type="xs:string">
           <value>0,0</value>
diff --git a/officecfg/registry/data/org/openoffice/Office/UI/WriterReportWindowState.xcu b/officecfg/registry/data/org/openoffice/Office/UI/WriterReportWindowState.xcu
index 6fe2b60..6934c5b 100644
--- a/officecfg/registry/data/org/openoffice/Office/UI/WriterReportWindowState.xcu
+++ b/officecfg/registry/data/org/openoffice/Office/UI/WriterReportWindowState.xcu
@@ -20,6 +20,11 @@
 <oor:component-data xmlns:install="http://openoffice.org/2004/installation" xmlns:oor="http://openoffice.org/2001/registry" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" oor:name="WriterReportWindowState" oor:package="org.openoffice.Office.UI">
   <node oor:name="UIElements">
     <node oor:name="States">
+      <node oor:name="private:resource/popupmenu/table" oor:op="replace">
+        <prop oor:name="UIName" oor:type="xs:string">
+          <value xml:lang="en-US">Table</value>
+        </prop>
+      </node>
       <node oor:name="private:resource/toolbar/standardbar" oor:op="replace">
         <prop oor:name="DockPos" oor:type="xs:string">
           <value>0,0</value>
diff --git a/officecfg/registry/data/org/openoffice/Office/UI/WriterWebWindowState.xcu b/officecfg/registry/data/org/openoffice/Office/UI/WriterWebWindowState.xcu
index e6da9a4..0af4b5f 100644
--- a/officecfg/registry/data/org/openoffice/Office/UI/WriterWebWindowState.xcu
+++ b/officecfg/registry/data/org/openoffice/Office/UI/WriterWebWindowState.xcu
@@ -20,6 +20,11 @@
 <oor:component-data xmlns:install="http://openoffice.org/2004/installation" xmlns:oor="http://openoffice.org/2001/registry" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" oor:name="WriterWebWindowState" oor:package="org.openoffice.Office.UI">
   <node oor:name="UIElements">
     <node oor:name="States">
+      <node oor:name="private:resource/popupmenu/table" oor:op="replace">
+        <prop oor:name="UIName" oor:type="xs:string">
+          <value xml:lang="en-US">Table</value>
+        </prop>
+      </node>
       <node oor:name="private:resource/toolbar/standardbar" oor:op="replace">
         <prop oor:name="DockPos" oor:type="xs:string">
           <value>0,0</value>
diff --git a/officecfg/registry/data/org/openoffice/Office/UI/WriterWindowState.xcu b/officecfg/registry/data/org/openoffice/Office/UI/WriterWindowState.xcu
index add0851..29d1afe 100644
--- a/officecfg/registry/data/org/openoffice/Office/UI/WriterWindowState.xcu
+++ b/officecfg/registry/data/org/openoffice/Office/UI/WriterWindowState.xcu
@@ -20,6 +20,11 @@
 <oor:component-data xmlns:install="http://openoffice.org/2004/installation" xmlns:oor="http://openoffice.org/2001/registry" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" oor:name="WriterWindowState" oor:package="org.openoffice.Office.UI">
   <node oor:name="UIElements">
     <node oor:name="States">
+      <node oor:name="private:resource/popupmenu/table" oor:op="replace">
+        <prop oor:name="UIName" oor:type="xs:string">
+          <value xml:lang="en-US">Table</value>
+        </prop>
+      </node>
       <node oor:name="private:resource/toolbar/standardbar" oor:op="replace">
         <prop oor:name="DockPos" oor:type="xs:string">
           <value>0,0</value>
diff --git a/sw/UIConfig_sglobal.mk b/sw/UIConfig_sglobal.mk
index 1f5eddf..f76ae87 100644
--- a/sw/UIConfig_sglobal.mk
+++ b/sw/UIConfig_sglobal.mk
@@ -13,6 +13,10 @@ $(eval $(call gb_UIConfig_add_menubarfiles,modules/sglobal,\
 	sw/uiconfig/sglobal/menubar/menubar \
 ))
 
+$(eval $(call gb_UIConfig_add_popupmenufiles,modules/sglobal,\
+	sw/uiconfig/sglobal/popupmenu/table \
+))
+
 $(eval $(call gb_UIConfig_add_statusbarfiles,modules/sglobal,\
 	sw/uiconfig/sglobal/statusbar/statusbar \
 ))
diff --git a/sw/UIConfig_sweb.mk b/sw/UIConfig_sweb.mk
index 5c8a12f..ca6c6b8 100644
--- a/sw/UIConfig_sweb.mk
+++ b/sw/UIConfig_sweb.mk
@@ -13,6 +13,10 @@ $(eval $(call gb_UIConfig_add_menubarfiles,modules/sweb,\
 	sw/uiconfig/sweb/menubar/menubar \
 ))
 
+$(eval $(call gb_UIConfig_add_popupmenufiles,modules/sweb,\
+	sw/uiconfig/sweb/popupmenu/table \
+))
+
 $(eval $(call gb_UIConfig_add_statusbarfiles,modules/sweb,\
 	sw/uiconfig/sweb/statusbar/statusbar \
 ))
diff --git a/sw/UIConfig_swform.mk b/sw/UIConfig_swform.mk
index 359a35a..b7dfc49 100644
--- a/sw/UIConfig_swform.mk
+++ b/sw/UIConfig_swform.mk
@@ -13,6 +13,10 @@ $(eval $(call gb_UIConfig_add_menubarfiles,modules/swform,\
 	sw/uiconfig/swform/menubar/menubar \
 ))
 
+$(eval $(call gb_UIConfig_add_popupmenufiles,modules/swform,\
+	sw/uiconfig/swform/popupmenu/table \
+))
+
 $(eval $(call gb_UIConfig_add_statusbarfiles,modules/swform,\
 	sw/uiconfig/swform/statusbar/statusbar \
 ))
diff --git a/sw/UIConfig_swreport.mk b/sw/UIConfig_swreport.mk
index ac807fb5..8d0a2db 100644
--- a/sw/UIConfig_swreport.mk
+++ b/sw/UIConfig_swreport.mk
@@ -13,6 +13,10 @@ $(eval $(call gb_UIConfig_add_menubarfiles,modules/swreport,\
 	sw/uiconfig/swreport/menubar/menubar \
 ))
 
+$(eval $(call gb_UIConfig_add_popupmenufiles,modules/swreport,\
+	sw/uiconfig/swreport/popupmenu/table \
+))
+
 $(eval $(call gb_UIConfig_add_statusbarfiles,modules/swreport,\
 	sw/uiconfig/swreport/statusbar/statusbar \
 ))
diff --git a/sw/UIConfig_swriter.mk b/sw/UIConfig_swriter.mk
index 9d5c873..f5e2ded 100644
--- a/sw/UIConfig_swriter.mk
+++ b/sw/UIConfig_swriter.mk
@@ -13,6 +13,10 @@ $(eval $(call gb_UIConfig_add_menubarfiles,modules/swriter,\
 	sw/uiconfig/swriter/menubar/menubar \
 ))
 
+$(eval $(call gb_UIConfig_add_popupmenufiles,modules/swriter,\
+	sw/uiconfig/swriter/popupmenu/table \
+))
+
 $(eval $(call gb_UIConfig_add_statusbarfiles,modules/swriter,\
 	sw/uiconfig/swriter/statusbar/statusbar \
 ))
diff --git a/sw/UIConfig_swxform.mk b/sw/UIConfig_swxform.mk
index ff6b383..95e1442 100644
--- a/sw/UIConfig_swxform.mk
+++ b/sw/UIConfig_swxform.mk
@@ -13,6 +13,10 @@ $(eval $(call gb_UIConfig_add_menubarfiles,modules/swxform,\
 	sw/uiconfig/swxform/menubar/menubar \
 ))
 
+$(eval $(call gb_UIConfig_add_popupmenufiles,modules/swxform,\
+	sw/uiconfig/swxform/popupmenu/table \
+))
+
 $(eval $(call gb_UIConfig_add_statusbarfiles,modules/swxform,\
 	sw/uiconfig/swxform/statusbar/statusbar \
 ))
diff --git a/sw/source/uibase/shells/tabsh.cxx b/sw/source/uibase/shells/tabsh.cxx
index c9ea88a..e39829f 100644
--- a/sw/source/uibase/shells/tabsh.cxx
+++ b/sw/source/uibase/shells/tabsh.cxx
@@ -95,8 +95,7 @@ SFX_IMPL_INTERFACE(SwTableShell, SwBaseShell)
 
 void SwTableShell::InitInterface_Impl()
 {
-    GetStaticInterface()->RegisterPopupMenu(SW_RES(MN_TAB_POPUPMENU));
-
+    GetStaticInterface()->RegisterPopupMenu("table");
     GetStaticInterface()->RegisterObjectBar(SFX_OBJECTBAR_OBJECT, RID_TABLE_TOOLBOX);
 }
 
diff --git a/sw/source/uibase/web/wtabsh.cxx b/sw/source/uibase/web/wtabsh.cxx
index e58ab8a..ef0b704 100644
--- a/sw/source/uibase/web/wtabsh.cxx
+++ b/sw/source/uibase/web/wtabsh.cxx
@@ -45,8 +45,7 @@ SFX_IMPL_INTERFACE(SwWebTableShell, SwTableShell)
 
 void SwWebTableShell::InitInterface_Impl()
 {
-    GetStaticInterface()->RegisterPopupMenu(SW_RES(MN_TAB_POPUPMENU));
-
+    GetStaticInterface()->RegisterPopupMenu("table");
     GetStaticInterface()->RegisterObjectBar(SFX_OBJECTBAR_OBJECT, RID_TABLE_TOOLBOX);
 }
 
diff --git a/sw/uiconfig/sglobal/popupmenu/table.xml b/sw/uiconfig/sglobal/popupmenu/table.xml
new file mode 100644
index 0000000..c92c50e
--- /dev/null
+++ b/sw/uiconfig/sglobal/popupmenu/table.xml
@@ -0,0 +1,109 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ *
+-->
+<menu:menupopup xmlns:menu="http://openoffice.org/2001/menu">
+  <menu:menuitem menu:id=".uno:Cut"/>
+  <menu:menuitem menu:id=".uno:Copy"/>
+  <menu:menuitem menu:id=".uno:Paste"/>
+  <menu:menu menu:id=".uno:PasteSpecialMenu">
+    <menu:menupopup>
+      <menu:menuitem menu:id=".uno:PasteUnformatted"/>
+      <menu:menuitem menu:id=".uno:PasteSpecial"/>
+    </menu:menupopup>
+  </menu:menu>
+  <menu:menuseparator/>
+  <menu:menuitem menu:id=".uno:NumberingStart"/>
+  <menu:menuitem menu:id=".uno:ContinueNumbering"/>
+  <menu:menuitem menu:id=".uno:IncrementLevel"/>
+  <menu:menuitem menu:id=".uno:DecrementLevel"/>
+  <menu:menuseparator/>
+  <menu:menu menu:id=".uno:TableInsertMenu">
+    <menu:menupopup>
+      <menu:menuitem menu:id=".uno:InsertRowsBefore"/>
+      <menu:menuitem menu:id=".uno:InsertRowsAfter"/>
+      <menu:menuitem menu:id=".uno:InsertRowDialog"/>
+      <menu:menuseparator/>
+      <menu:menuitem menu:id=".uno:InsertColumnsBefore"/>
+      <menu:menuitem menu:id=".uno:InsertColumnsAfter"/>
+      <menu:menuitem menu:id=".uno:InsertColumnDialog"/>
+    </menu:menupopup>
+  </menu:menu>
+  <menu:menu menu:id=".uno:TableDeleteMenu">
+    <menu:menupopup>
+      <menu:menuitem menu:id=".uno:DeleteRows"/>
+      <menu:menuitem menu:id=".uno:DeleteColumns"/>
+      <menu:menuitem menu:id=".uno:DeleteTable"/>
+    </menu:menupopup>
+  </menu:menu>
+  <menu:menu menu:id=".uno:TableSelectMenu">
+    <menu:menupopup>
+      <menu:menuitem menu:id=".uno:EntireRow"/>
+      <menu:menuitem menu:id=".uno:EntireColumn"/>
+      <menu:menuitem menu:id=".uno:SelectTable"/>
+      <menu:menuitem menu:id=".uno:EntireCell"/>
+    </menu:menupopup>
+  </menu:menu>
+  <menu:menuitem menu:id=".uno:MergeCells"/>
+  <menu:menu menu:id=".uno:AlignTextMenu">
+    <menu:menupopup>
+      <menu:menuitem menu:id=".uno:CellVertTop"/>
+      <menu:menuitem menu:id=".uno:CellVertCenter"/>
+      <menu:menuitem menu:id=".uno:CellVertBottom"/>
+    </menu:menupopup>
+  </menu:menu>
+  <menu:menu menu:id=".uno:TableAutoFitMenu">
+    <menu:menupopup>
+      <menu:menuitem menu:id=".uno:SetColumnWidth"/>
+      <menu:menuitem menu:id=".uno:SetOptimalColumnWidth"/>
+      <menu:menuitem menu:id=".uno:DistributeColumns"/>
+      <menu:menuitem menu:id=".uno:SetRowHeight"/>
+      <menu:menuitem menu:id=".uno:SetOptimalRowHeight"/>
+      <menu:menuitem menu:id=".uno:DistributeRows"/>
+    </menu:menupopup>
+  </menu:menu>
+  <menu:menuitem menu:id=".uno:TableNumberFormatDialog"/>
+  <menu:menuitem menu:id=".uno:TableDialog"/>
+  <menu:menuseparator/>
+  <menu:menuitem menu:id=".uno:ResetAttributes"/>
+  <menu:menuseparator/>
+  <menu:menuitem menu:id=".uno:FontDialog"/>
+  <menu:menuitem menu:id=".uno:ParagraphDialog"/>
+  <menu:menuitem menu:id=".uno:OutlineBullet"/>
+  <menu:menu menu:id=".uno:TransliterateMenu">
+    <menu:menupopup>
+      <menu:menuitem menu:id=".uno:ChangeCaseToSentenceCase"/>
+      <menu:menuitem menu:id=".uno:ChangeCaseToLower"/>
+      <menu:menuitem menu:id=".uno:ChangeCaseToUpper"/>
+      <menu:menuitem menu:id=".uno:ChangeCaseToTitleCase"/>
+      <menu:menuitem menu:id=".uno:ChangeCaseToToggleCase"/>
+      <menu:menuitem menu:id=".uno:ChangeCaseToHalfWidth"/>
+      <menu:menuitem menu:id=".uno:ChangeCaseToFullWidth"/>
+      <menu:menuitem menu:id=".uno:ChangeCaseToHiragana"/>
+      <menu:menuitem menu:id=".uno:ChangeCaseToKatakana"/>
+    </menu:menupopup>
+  </menu:menu>
+  <menu:menuseparator/>
+  <menu:menuitem menu:id=".uno:FieldDialog"/>
+  <menu:menuitem menu:id=".uno:EditFootnote"/>
+  <menu:menuitem menu:id=".uno:IndexEntryDialog"/>
+  <menu:menuitem menu:id=".uno:AuthoritiesEntryDialog"/>
+  <menu:menuitem menu:id=".uno:AcceptTrackedChange"/>
+  <menu:menuitem menu:id=".uno:RejectTrackedChange"/>
+  <menu:menuitem menu:id=".uno:NextTrackedChange"/>
+  <menu:menuitem menu:id=".uno:PreviousTrackedChange"/>
+  <menu:menuseparator/>
+  <menu:menuitem menu:id=".uno:EditStyle"/>
+  <menu:menuseparator/>
+  <menu:menuitem menu:id=".uno:OpenHyperlinkOnCursor"/>
+  <menu:menuitem menu:id=".uno:EditHyperlink"/>
+  <menu:menuitem menu:id=".uno:CopyHyperlinkLocation"/>
+  <menu:menuitem menu:id=".uno:RemoveHyperlink"/>
+  <menu:menuitem menu:id=".uno:OpenSmartTagMenuOnCursor"/>
+  <menu:menuitem menu:id=".uno:ThesaurusFromContext"/>
+</menu:menupopup>
diff --git a/sw/uiconfig/sweb/popupmenu/table.xml b/sw/uiconfig/sweb/popupmenu/table.xml
new file mode 100644
index 0000000..c92c50e
--- /dev/null
+++ b/sw/uiconfig/sweb/popupmenu/table.xml
@@ -0,0 +1,109 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ *
+-->
+<menu:menupopup xmlns:menu="http://openoffice.org/2001/menu">
+  <menu:menuitem menu:id=".uno:Cut"/>
+  <menu:menuitem menu:id=".uno:Copy"/>
+  <menu:menuitem menu:id=".uno:Paste"/>
+  <menu:menu menu:id=".uno:PasteSpecialMenu">
+    <menu:menupopup>
+      <menu:menuitem menu:id=".uno:PasteUnformatted"/>
+      <menu:menuitem menu:id=".uno:PasteSpecial"/>
+    </menu:menupopup>
+  </menu:menu>
+  <menu:menuseparator/>
+  <menu:menuitem menu:id=".uno:NumberingStart"/>
+  <menu:menuitem menu:id=".uno:ContinueNumbering"/>
+  <menu:menuitem menu:id=".uno:IncrementLevel"/>
+  <menu:menuitem menu:id=".uno:DecrementLevel"/>
+  <menu:menuseparator/>
+  <menu:menu menu:id=".uno:TableInsertMenu">
+    <menu:menupopup>
+      <menu:menuitem menu:id=".uno:InsertRowsBefore"/>
+      <menu:menuitem menu:id=".uno:InsertRowsAfter"/>
+      <menu:menuitem menu:id=".uno:InsertRowDialog"/>
+      <menu:menuseparator/>
+      <menu:menuitem menu:id=".uno:InsertColumnsBefore"/>
+      <menu:menuitem menu:id=".uno:InsertColumnsAfter"/>
+      <menu:menuitem menu:id=".uno:InsertColumnDialog"/>
+    </menu:menupopup>
+  </menu:menu>
+  <menu:menu menu:id=".uno:TableDeleteMenu">
+    <menu:menupopup>
+      <menu:menuitem menu:id=".uno:DeleteRows"/>
+      <menu:menuitem menu:id=".uno:DeleteColumns"/>
+      <menu:menuitem menu:id=".uno:DeleteTable"/>
+    </menu:menupopup>
+  </menu:menu>
+  <menu:menu menu:id=".uno:TableSelectMenu">
+    <menu:menupopup>
+      <menu:menuitem menu:id=".uno:EntireRow"/>
+      <menu:menuitem menu:id=".uno:EntireColumn"/>
+      <menu:menuitem menu:id=".uno:SelectTable"/>
+      <menu:menuitem menu:id=".uno:EntireCell"/>
+    </menu:menupopup>
+  </menu:menu>
+  <menu:menuitem menu:id=".uno:MergeCells"/>
+  <menu:menu menu:id=".uno:AlignTextMenu">
+    <menu:menupopup>
+      <menu:menuitem menu:id=".uno:CellVertTop"/>
+      <menu:menuitem menu:id=".uno:CellVertCenter"/>
+      <menu:menuitem menu:id=".uno:CellVertBottom"/>
+    </menu:menupopup>
+  </menu:menu>
+  <menu:menu menu:id=".uno:TableAutoFitMenu">
+    <menu:menupopup>
+      <menu:menuitem menu:id=".uno:SetColumnWidth"/>
+      <menu:menuitem menu:id=".uno:SetOptimalColumnWidth"/>
+      <menu:menuitem menu:id=".uno:DistributeColumns"/>
+      <menu:menuitem menu:id=".uno:SetRowHeight"/>
+      <menu:menuitem menu:id=".uno:SetOptimalRowHeight"/>
+      <menu:menuitem menu:id=".uno:DistributeRows"/>
+    </menu:menupopup>
+  </menu:menu>
+  <menu:menuitem menu:id=".uno:TableNumberFormatDialog"/>
+  <menu:menuitem menu:id=".uno:TableDialog"/>
+  <menu:menuseparator/>
+  <menu:menuitem menu:id=".uno:ResetAttributes"/>
+  <menu:menuseparator/>
+  <menu:menuitem menu:id=".uno:FontDialog"/>
+  <menu:menuitem menu:id=".uno:ParagraphDialog"/>
+  <menu:menuitem menu:id=".uno:OutlineBullet"/>
+  <menu:menu menu:id=".uno:TransliterateMenu">
+    <menu:menupopup>
+      <menu:menuitem menu:id=".uno:ChangeCaseToSentenceCase"/>
+      <menu:menuitem menu:id=".uno:ChangeCaseToLower"/>
+      <menu:menuitem menu:id=".uno:ChangeCaseToUpper"/>
+      <menu:menuitem menu:id=".uno:ChangeCaseToTitleCase"/>
+      <menu:menuitem menu:id=".uno:ChangeCaseToToggleCase"/>
+      <menu:menuitem menu:id=".uno:ChangeCaseToHalfWidth"/>
+      <menu:menuitem menu:id=".uno:ChangeCaseToFullWidth"/>
+      <menu:menuitem menu:id=".uno:ChangeCaseToHiragana"/>
+      <menu:menuitem menu:id=".uno:ChangeCaseToKatakana"/>
+    </menu:menupopup>
+  </menu:menu>
+  <menu:menuseparator/>
+  <menu:menuitem menu:id=".uno:FieldDialog"/>
+  <menu:menuitem menu:id=".uno:EditFootnote"/>
+  <menu:menuitem menu:id=".uno:IndexEntryDialog"/>
+  <menu:menuitem menu:id=".uno:AuthoritiesEntryDialog"/>
+  <menu:menuitem menu:id=".uno:AcceptTrackedChange"/>
+  <menu:menuitem menu:id=".uno:RejectTrackedChange"/>
+  <menu:menuitem menu:id=".uno:NextTrackedChange"/>
+  <menu:menuitem menu:id=".uno:PreviousTrackedChange"/>
+  <menu:menuseparator/>
+  <menu:menuitem menu:id=".uno:EditStyle"/>
+  <menu:menuseparator/>
+  <menu:menuitem menu:id=".uno:OpenHyperlinkOnCursor"/>
+  <menu:menuitem menu:id=".uno:EditHyperlink"/>
+  <menu:menuitem menu:id=".uno:CopyHyperlinkLocation"/>
+  <menu:menuitem menu:id=".uno:RemoveHyperlink"/>
+  <menu:menuitem menu:id=".uno:OpenSmartTagMenuOnCursor"/>
+  <menu:menuitem menu:id=".uno:ThesaurusFromContext"/>
+</menu:menupopup>
diff --git a/sw/uiconfig/swform/popupmenu/table.xml b/sw/uiconfig/swform/popupmenu/table.xml
new file mode 100644
index 0000000..c92c50e
--- /dev/null
+++ b/sw/uiconfig/swform/popupmenu/table.xml
@@ -0,0 +1,109 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ *
+-->
+<menu:menupopup xmlns:menu="http://openoffice.org/2001/menu">
+  <menu:menuitem menu:id=".uno:Cut"/>
+  <menu:menuitem menu:id=".uno:Copy"/>
+  <menu:menuitem menu:id=".uno:Paste"/>
+  <menu:menu menu:id=".uno:PasteSpecialMenu">
+    <menu:menupopup>
+      <menu:menuitem menu:id=".uno:PasteUnformatted"/>
+      <menu:menuitem menu:id=".uno:PasteSpecial"/>
+    </menu:menupopup>
+  </menu:menu>
+  <menu:menuseparator/>
+  <menu:menuitem menu:id=".uno:NumberingStart"/>
+  <menu:menuitem menu:id=".uno:ContinueNumbering"/>
+  <menu:menuitem menu:id=".uno:IncrementLevel"/>
+  <menu:menuitem menu:id=".uno:DecrementLevel"/>
+  <menu:menuseparator/>
+  <menu:menu menu:id=".uno:TableInsertMenu">
+    <menu:menupopup>
+      <menu:menuitem menu:id=".uno:InsertRowsBefore"/>
+      <menu:menuitem menu:id=".uno:InsertRowsAfter"/>
+      <menu:menuitem menu:id=".uno:InsertRowDialog"/>
+      <menu:menuseparator/>
+      <menu:menuitem menu:id=".uno:InsertColumnsBefore"/>
+      <menu:menuitem menu:id=".uno:InsertColumnsAfter"/>
+      <menu:menuitem menu:id=".uno:InsertColumnDialog"/>
+    </menu:menupopup>
+  </menu:menu>
+  <menu:menu menu:id=".uno:TableDeleteMenu">
+    <menu:menupopup>
+      <menu:menuitem menu:id=".uno:DeleteRows"/>
+      <menu:menuitem menu:id=".uno:DeleteColumns"/>
+      <menu:menuitem menu:id=".uno:DeleteTable"/>
+    </menu:menupopup>
+  </menu:menu>
+  <menu:menu menu:id=".uno:TableSelectMenu">
+    <menu:menupopup>
+      <menu:menuitem menu:id=".uno:EntireRow"/>
+      <menu:menuitem menu:id=".uno:EntireColumn"/>
+      <menu:menuitem menu:id=".uno:SelectTable"/>
+      <menu:menuitem menu:id=".uno:EntireCell"/>
+    </menu:menupopup>
+  </menu:menu>
+  <menu:menuitem menu:id=".uno:MergeCells"/>
+  <menu:menu menu:id=".uno:AlignTextMenu">
+    <menu:menupopup>
+      <menu:menuitem menu:id=".uno:CellVertTop"/>
+      <menu:menuitem menu:id=".uno:CellVertCenter"/>
+      <menu:menuitem menu:id=".uno:CellVertBottom"/>
+    </menu:menupopup>
+  </menu:menu>
+  <menu:menu menu:id=".uno:TableAutoFitMenu">
+    <menu:menupopup>
+      <menu:menuitem menu:id=".uno:SetColumnWidth"/>
+      <menu:menuitem menu:id=".uno:SetOptimalColumnWidth"/>
+      <menu:menuitem menu:id=".uno:DistributeColumns"/>
+      <menu:menuitem menu:id=".uno:SetRowHeight"/>
+      <menu:menuitem menu:id=".uno:SetOptimalRowHeight"/>
+      <menu:menuitem menu:id=".uno:DistributeRows"/>
+    </menu:menupopup>
+  </menu:menu>
+  <menu:menuitem menu:id=".uno:TableNumberFormatDialog"/>
+  <menu:menuitem menu:id=".uno:TableDialog"/>
+  <menu:menuseparator/>
+  <menu:menuitem menu:id=".uno:ResetAttributes"/>
+  <menu:menuseparator/>
+  <menu:menuitem menu:id=".uno:FontDialog"/>
+  <menu:menuitem menu:id=".uno:ParagraphDialog"/>
+  <menu:menuitem menu:id=".uno:OutlineBullet"/>
+  <menu:menu menu:id=".uno:TransliterateMenu">
+    <menu:menupopup>
+      <menu:menuitem menu:id=".uno:ChangeCaseToSentenceCase"/>
+      <menu:menuitem menu:id=".uno:ChangeCaseToLower"/>
+      <menu:menuitem menu:id=".uno:ChangeCaseToUpper"/>
+      <menu:menuitem menu:id=".uno:ChangeCaseToTitleCase"/>
+      <menu:menuitem menu:id=".uno:ChangeCaseToToggleCase"/>
+      <menu:menuitem menu:id=".uno:ChangeCaseToHalfWidth"/>
+      <menu:menuitem menu:id=".uno:ChangeCaseToFullWidth"/>
+      <menu:menuitem menu:id=".uno:ChangeCaseToHiragana"/>
+      <menu:menuitem menu:id=".uno:ChangeCaseToKatakana"/>
+    </menu:menupopup>
+  </menu:menu>
+  <menu:menuseparator/>
+  <menu:menuitem menu:id=".uno:FieldDialog"/>
+  <menu:menuitem menu:id=".uno:EditFootnote"/>
+  <menu:menuitem menu:id=".uno:IndexEntryDialog"/>
+  <menu:menuitem menu:id=".uno:AuthoritiesEntryDialog"/>
+  <menu:menuitem menu:id=".uno:AcceptTrackedChange"/>
+  <menu:menuitem menu:id=".uno:RejectTrackedChange"/>
+  <menu:menuitem menu:id=".uno:NextTrackedChange"/>
+  <menu:menuitem menu:id=".uno:PreviousTrackedChange"/>
+  <menu:menuseparator/>
+  <menu:menuitem menu:id=".uno:EditStyle"/>
+  <menu:menuseparator/>
+  <menu:menuitem menu:id=".uno:OpenHyperlinkOnCursor"/>
+  <menu:menuitem menu:id=".uno:EditHyperlink"/>
+  <menu:menuitem menu:id=".uno:CopyHyperlinkLocation"/>
+  <menu:menuitem menu:id=".uno:RemoveHyperlink"/>
+  <menu:menuitem menu:id=".uno:OpenSmartTagMenuOnCursor"/>
+  <menu:menuitem menu:id=".uno:ThesaurusFromContext"/>
+</menu:menupopup>
diff --git a/sw/uiconfig/swreport/popupmenu/table.xml b/sw/uiconfig/swreport/popupmenu/table.xml
new file mode 100644
index 0000000..c92c50e
--- /dev/null
+++ b/sw/uiconfig/swreport/popupmenu/table.xml
@@ -0,0 +1,109 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ *
+-->
+<menu:menupopup xmlns:menu="http://openoffice.org/2001/menu">
+  <menu:menuitem menu:id=".uno:Cut"/>
+  <menu:menuitem menu:id=".uno:Copy"/>
+  <menu:menuitem menu:id=".uno:Paste"/>
+  <menu:menu menu:id=".uno:PasteSpecialMenu">
+    <menu:menupopup>
+      <menu:menuitem menu:id=".uno:PasteUnformatted"/>
+      <menu:menuitem menu:id=".uno:PasteSpecial"/>
+    </menu:menupopup>
+  </menu:menu>
+  <menu:menuseparator/>
+  <menu:menuitem menu:id=".uno:NumberingStart"/>
+  <menu:menuitem menu:id=".uno:ContinueNumbering"/>
+  <menu:menuitem menu:id=".uno:IncrementLevel"/>
+  <menu:menuitem menu:id=".uno:DecrementLevel"/>
+  <menu:menuseparator/>
+  <menu:menu menu:id=".uno:TableInsertMenu">
+    <menu:menupopup>
+      <menu:menuitem menu:id=".uno:InsertRowsBefore"/>
+      <menu:menuitem menu:id=".uno:InsertRowsAfter"/>
+      <menu:menuitem menu:id=".uno:InsertRowDialog"/>
+      <menu:menuseparator/>
+      <menu:menuitem menu:id=".uno:InsertColumnsBefore"/>
+      <menu:menuitem menu:id=".uno:InsertColumnsAfter"/>
+      <menu:menuitem menu:id=".uno:InsertColumnDialog"/>
+    </menu:menupopup>
+  </menu:menu>
+  <menu:menu menu:id=".uno:TableDeleteMenu">
+    <menu:menupopup>
+      <menu:menuitem menu:id=".uno:DeleteRows"/>
+      <menu:menuitem menu:id=".uno:DeleteColumns"/>
+      <menu:menuitem menu:id=".uno:DeleteTable"/>
+    </menu:menupopup>
+  </menu:menu>
+  <menu:menu menu:id=".uno:TableSelectMenu">
+    <menu:menupopup>
+      <menu:menuitem menu:id=".uno:EntireRow"/>
+      <menu:menuitem menu:id=".uno:EntireColumn"/>
+      <menu:menuitem menu:id=".uno:SelectTable"/>
+      <menu:menuitem menu:id=".uno:EntireCell"/>
+    </menu:menupopup>
+  </menu:menu>
+  <menu:menuitem menu:id=".uno:MergeCells"/>
+  <menu:menu menu:id=".uno:AlignTextMenu">
+    <menu:menupopup>
+      <menu:menuitem menu:id=".uno:CellVertTop"/>
+      <menu:menuitem menu:id=".uno:CellVertCenter"/>
+      <menu:menuitem menu:id=".uno:CellVertBottom"/>
+    </menu:menupopup>
+  </menu:menu>
+  <menu:menu menu:id=".uno:TableAutoFitMenu">
+    <menu:menupopup>
+      <menu:menuitem menu:id=".uno:SetColumnWidth"/>
+      <menu:menuitem menu:id=".uno:SetOptimalColumnWidth"/>
+      <menu:menuitem menu:id=".uno:DistributeColumns"/>
+      <menu:menuitem menu:id=".uno:SetRowHeight"/>
+      <menu:menuitem menu:id=".uno:SetOptimalRowHeight"/>
+      <menu:menuitem menu:id=".uno:DistributeRows"/>
+    </menu:menupopup>
+  </menu:menu>
+  <menu:menuitem menu:id=".uno:TableNumberFormatDialog"/>
+  <menu:menuitem menu:id=".uno:TableDialog"/>
+  <menu:menuseparator/>
+  <menu:menuitem menu:id=".uno:ResetAttributes"/>
+  <menu:menuseparator/>
+  <menu:menuitem menu:id=".uno:FontDialog"/>
+  <menu:menuitem menu:id=".uno:ParagraphDialog"/>
+  <menu:menuitem menu:id=".uno:OutlineBullet"/>
+  <menu:menu menu:id=".uno:TransliterateMenu">
+    <menu:menupopup>
+      <menu:menuitem menu:id=".uno:ChangeCaseToSentenceCase"/>
+      <menu:menuitem menu:id=".uno:ChangeCaseToLower"/>
+      <menu:menuitem menu:id=".uno:ChangeCaseToUpper"/>
+      <menu:menuitem menu:id=".uno:ChangeCaseToTitleCase"/>
+      <menu:menuitem menu:id=".uno:ChangeCaseToToggleCase"/>
+      <menu:menuitem menu:id=".uno:ChangeCaseToHalfWidth"/>
+      <menu:menuitem menu:id=".uno:ChangeCaseToFullWidth"/>
+      <menu:menuitem menu:id=".uno:ChangeCaseToHiragana"/>
+      <menu:menuitem menu:id=".uno:ChangeCaseToKatakana"/>
+    </menu:menupopup>
+  </menu:menu>
+  <menu:menuseparator/>
+  <menu:menuitem menu:id=".uno:FieldDialog"/>
+  <menu:menuitem menu:id=".uno:EditFootnote"/>
+  <menu:menuitem menu:id=".uno:IndexEntryDialog"/>
+  <menu:menuitem menu:id=".uno:AuthoritiesEntryDialog"/>
+  <menu:menuitem menu:id=".uno:AcceptTrackedChange"/>
+  <menu:menuitem menu:id=".uno:RejectTrackedChange"/>
+  <menu:menuitem menu:id=".uno:NextTrackedChange"/>
+  <menu:menuitem menu:id=".uno:PreviousTrackedChange"/>
+  <menu:menuseparator/>
+  <menu:menuitem menu:id=".uno:EditStyle"/>
+  <menu:menuseparator/>
+  <menu:menuitem menu:id=".uno:OpenHyperlinkOnCursor"/>
+  <menu:menuitem menu:id=".uno:EditHyperlink"/>
+  <menu:menuitem menu:id=".uno:CopyHyperlinkLocation"/>
+  <menu:menuitem menu:id=".uno:RemoveHyperlink"/>
+  <menu:menuitem menu:id=".uno:OpenSmartTagMenuOnCursor"/>
+  <menu:menuitem menu:id=".uno:ThesaurusFromContext"/>
+</menu:menupopup>
diff --git a/sw/uiconfig/swriter/popupmenu/table.xml b/sw/uiconfig/swriter/popupmenu/table.xml
new file mode 100644
index 0000000..c92c50e
--- /dev/null
+++ b/sw/uiconfig/swriter/popupmenu/table.xml
@@ -0,0 +1,109 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ *
+-->
+<menu:menupopup xmlns:menu="http://openoffice.org/2001/menu">
+  <menu:menuitem menu:id=".uno:Cut"/>
+  <menu:menuitem menu:id=".uno:Copy"/>
+  <menu:menuitem menu:id=".uno:Paste"/>
+  <menu:menu menu:id=".uno:PasteSpecialMenu">
+    <menu:menupopup>
+      <menu:menuitem menu:id=".uno:PasteUnformatted"/>
+      <menu:menuitem menu:id=".uno:PasteSpecial"/>
+    </menu:menupopup>
+  </menu:menu>
+  <menu:menuseparator/>
+  <menu:menuitem menu:id=".uno:NumberingStart"/>
+  <menu:menuitem menu:id=".uno:ContinueNumbering"/>
+  <menu:menuitem menu:id=".uno:IncrementLevel"/>
+  <menu:menuitem menu:id=".uno:DecrementLevel"/>
+  <menu:menuseparator/>
+  <menu:menu menu:id=".uno:TableInsertMenu">
+    <menu:menupopup>
+      <menu:menuitem menu:id=".uno:InsertRowsBefore"/>
+      <menu:menuitem menu:id=".uno:InsertRowsAfter"/>
+      <menu:menuitem menu:id=".uno:InsertRowDialog"/>
+      <menu:menuseparator/>
+      <menu:menuitem menu:id=".uno:InsertColumnsBefore"/>
+      <menu:menuitem menu:id=".uno:InsertColumnsAfter"/>
+      <menu:menuitem menu:id=".uno:InsertColumnDialog"/>
+    </menu:menupopup>
+  </menu:menu>
+  <menu:menu menu:id=".uno:TableDeleteMenu">
+    <menu:menupopup>
+      <menu:menuitem menu:id=".uno:DeleteRows"/>
+      <menu:menuitem menu:id=".uno:DeleteColumns"/>
+      <menu:menuitem menu:id=".uno:DeleteTable"/>
+    </menu:menupopup>
+  </menu:menu>
+  <menu:menu menu:id=".uno:TableSelectMenu">
+    <menu:menupopup>
+      <menu:menuitem menu:id=".uno:EntireRow"/>
+      <menu:menuitem menu:id=".uno:EntireColumn"/>
+      <menu:menuitem menu:id=".uno:SelectTable"/>
+      <menu:menuitem menu:id=".uno:EntireCell"/>
+    </menu:menupopup>
+  </menu:menu>
+  <menu:menuitem menu:id=".uno:MergeCells"/>
+  <menu:menu menu:id=".uno:AlignTextMenu">
+    <menu:menupopup>
+      <menu:menuitem menu:id=".uno:CellVertTop"/>
+      <menu:menuitem menu:id=".uno:CellVertCenter"/>
+      <menu:menuitem menu:id=".uno:CellVertBottom"/>
+    </menu:menupopup>
+  </menu:menu>
+  <menu:menu menu:id=".uno:TableAutoFitMenu">
+    <menu:menupopup>
+      <menu:menuitem menu:id=".uno:SetColumnWidth"/>
+      <menu:menuitem menu:id=".uno:SetOptimalColumnWidth"/>
+      <menu:menuitem menu:id=".uno:DistributeColumns"/>
+      <menu:menuitem menu:id=".uno:SetRowHeight"/>
+      <menu:menuitem menu:id=".uno:SetOptimalRowHeight"/>
+      <menu:menuitem menu:id=".uno:DistributeRows"/>
+    </menu:menupopup>
+  </menu:menu>
+  <menu:menuitem menu:id=".uno:TableNumberFormatDialog"/>
+  <menu:menuitem menu:id=".uno:TableDialog"/>
+  <menu:menuseparator/>
+  <menu:menuitem menu:id=".uno:ResetAttributes"/>
+  <menu:menuseparator/>
+  <menu:menuitem menu:id=".uno:FontDialog"/>
+  <menu:menuitem menu:id=".uno:ParagraphDialog"/>
+  <menu:menuitem menu:id=".uno:OutlineBullet"/>
+  <menu:menu menu:id=".uno:TransliterateMenu">
+    <menu:menupopup>
+      <menu:menuitem menu:id=".uno:ChangeCaseToSentenceCase"/>
+      <menu:menuitem menu:id=".uno:ChangeCaseToLower"/>
+      <menu:menuitem menu:id=".uno:ChangeCaseToUpper"/>
+      <menu:menuitem menu:id=".uno:ChangeCaseToTitleCase"/>
+      <menu:menuitem menu:id=".uno:ChangeCaseToToggleCase"/>
+      <menu:menuitem menu:id=".uno:ChangeCaseToHalfWidth"/>
+      <menu:menuitem menu:id=".uno:ChangeCaseToFullWidth"/>
+      <menu:menuitem menu:id=".uno:ChangeCaseToHiragana"/>
+      <menu:menuitem menu:id=".uno:ChangeCaseToKatakana"/>
+    </menu:menupopup>
+  </menu:menu>
+  <menu:menuseparator/>
+  <menu:menuitem menu:id=".uno:FieldDialog"/>
+  <menu:menuitem menu:id=".uno:EditFootnote"/>
+  <menu:menuitem menu:id=".uno:IndexEntryDialog"/>
+  <menu:menuitem menu:id=".uno:AuthoritiesEntryDialog"/>
+  <menu:menuitem menu:id=".uno:AcceptTrackedChange"/>
+  <menu:menuitem menu:id=".uno:RejectTrackedChange"/>
+  <menu:menuitem menu:id=".uno:NextTrackedChange"/>
+  <menu:menuitem menu:id=".uno:PreviousTrackedChange"/>
+  <menu:menuseparator/>
+  <menu:menuitem menu:id=".uno:EditStyle"/>
+  <menu:menuseparator/>
+  <menu:menuitem menu:id=".uno:OpenHyperlinkOnCursor"/>
+  <menu:menuitem menu:id=".uno:EditHyperlink"/>
+  <menu:menuitem menu:id=".uno:CopyHyperlinkLocation"/>
+  <menu:menuitem menu:id=".uno:RemoveHyperlink"/>
+  <menu:menuitem menu:id=".uno:OpenSmartTagMenuOnCursor"/>
+  <menu:menuitem menu:id=".uno:ThesaurusFromContext"/>
+</menu:menupopup>
diff --git a/sw/uiconfig/swxform/popupmenu/table.xml b/sw/uiconfig/swxform/popupmenu/table.xml
new file mode 100644
index 0000000..c92c50e
--- /dev/null
+++ b/sw/uiconfig/swxform/popupmenu/table.xml
@@ -0,0 +1,109 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ *
+-->
+<menu:menupopup xmlns:menu="http://openoffice.org/2001/menu">
+  <menu:menuitem menu:id=".uno:Cut"/>
+  <menu:menuitem menu:id=".uno:Copy"/>
+  <menu:menuitem menu:id=".uno:Paste"/>
+  <menu:menu menu:id=".uno:PasteSpecialMenu">
+    <menu:menupopup>
+      <menu:menuitem menu:id=".uno:PasteUnformatted"/>
+      <menu:menuitem menu:id=".uno:PasteSpecial"/>
+    </menu:menupopup>
+  </menu:menu>
+  <menu:menuseparator/>
+  <menu:menuitem menu:id=".uno:NumberingStart"/>
+  <menu:menuitem menu:id=".uno:ContinueNumbering"/>
+  <menu:menuitem menu:id=".uno:IncrementLevel"/>
+  <menu:menuitem menu:id=".uno:DecrementLevel"/>
+  <menu:menuseparator/>
+  <menu:menu menu:id=".uno:TableInsertMenu">
+    <menu:menupopup>
+      <menu:menuitem menu:id=".uno:InsertRowsBefore"/>
+      <menu:menuitem menu:id=".uno:InsertRowsAfter"/>
+      <menu:menuitem menu:id=".uno:InsertRowDialog"/>
+      <menu:menuseparator/>
+      <menu:menuitem menu:id=".uno:InsertColumnsBefore"/>
+      <menu:menuitem menu:id=".uno:InsertColumnsAfter"/>
+      <menu:menuitem menu:id=".uno:InsertColumnDialog"/>
+    </menu:menupopup>
+  </menu:menu>
+  <menu:menu menu:id=".uno:TableDeleteMenu">
+    <menu:menupopup>
+      <menu:menuitem menu:id=".uno:DeleteRows"/>
+      <menu:menuitem menu:id=".uno:DeleteColumns"/>
+      <menu:menuitem menu:id=".uno:DeleteTable"/>
+    </menu:menupopup>
+  </menu:menu>
+  <menu:menu menu:id=".uno:TableSelectMenu">
+    <menu:menupopup>
+      <menu:menuitem menu:id=".uno:EntireRow"/>
+      <menu:menuitem menu:id=".uno:EntireColumn"/>
+      <menu:menuitem menu:id=".uno:SelectTable"/>
+      <menu:menuitem menu:id=".uno:EntireCell"/>
+    </menu:menupopup>
+  </menu:menu>
+  <menu:menuitem menu:id=".uno:MergeCells"/>
+  <menu:menu menu:id=".uno:AlignTextMenu">
+    <menu:menupopup>
+      <menu:menuitem menu:id=".uno:CellVertTop"/>
+      <menu:menuitem menu:id=".uno:CellVertCenter"/>
+      <menu:menuitem menu:id=".uno:CellVertBottom"/>
+    </menu:menupopup>
+  </menu:menu>
+  <menu:menu menu:id=".uno:TableAutoFitMenu">
+    <menu:menupopup>
+      <menu:menuitem menu:id=".uno:SetColumnWidth"/>
+      <menu:menuitem menu:id=".uno:SetOptimalColumnWidth"/>
+      <menu:menuitem menu:id=".uno:DistributeColumns"/>
+      <menu:menuitem menu:id=".uno:SetRowHeight"/>
+      <menu:menuitem menu:id=".uno:SetOptimalRowHeight"/>
+      <menu:menuitem menu:id=".uno:DistributeRows"/>
+    </menu:menupopup>
+  </menu:menu>
+  <menu:menuitem menu:id=".uno:TableNumberFormatDialog"/>
+  <menu:menuitem menu:id=".uno:TableDialog"/>
+  <menu:menuseparator/>
+  <menu:menuitem menu:id=".uno:ResetAttributes"/>
+  <menu:menuseparator/>
+  <menu:menuitem menu:id=".uno:FontDialog"/>
+  <menu:menuitem menu:id=".uno:ParagraphDialog"/>
+  <menu:menuitem menu:id=".uno:OutlineBullet"/>
+  <menu:menu menu:id=".uno:TransliterateMenu">
+    <menu:menupopup>
+      <menu:menuitem menu:id=".uno:ChangeCaseToSentenceCase"/>
+      <menu:menuitem menu:id=".uno:ChangeCaseToLower"/>
+      <menu:menuitem menu:id=".uno:ChangeCaseToUpper"/>
+      <menu:menuitem menu:id=".uno:ChangeCaseToTitleCase"/>
+      <menu:menuitem menu:id=".uno:ChangeCaseToToggleCase"/>
+      <menu:menuitem menu:id=".uno:ChangeCaseToHalfWidth"/>
+      <menu:menuitem menu:id=".uno:ChangeCaseToFullWidth"/>
+      <menu:menuitem menu:id=".uno:ChangeCaseToHiragana"/>
+      <menu:menuitem menu:id=".uno:ChangeCaseToKatakana"/>
+    </menu:menupopup>
+  </menu:menu>
+  <menu:menuseparator/>
+  <menu:menuitem menu:id=".uno:FieldDialog"/>
+  <menu:menuitem menu:id=".uno:EditFootnote"/>
+  <menu:menuitem menu:id=".uno:IndexEntryDialog"/>
+  <menu:menuitem menu:id=".uno:AuthoritiesEntryDialog"/>
+  <menu:menuitem menu:id=".uno:AcceptTrackedChange"/>
+  <menu:menuitem menu:id=".uno:RejectTrackedChange"/>
+  <menu:menuitem menu:id=".uno:NextTrackedChange"/>
+  <menu:menuitem menu:id=".uno:PreviousTrackedChange"/>
+  <menu:menuseparator/>
+  <menu:menuitem menu:id=".uno:EditStyle"/>
+  <menu:menuseparator/>
+  <menu:menuitem menu:id=".uno:OpenHyperlinkOnCursor"/>
+  <menu:menuitem menu:id=".uno:EditHyperlink"/>
+  <menu:menuitem menu:id=".uno:CopyHyperlinkLocation"/>
+  <menu:menuitem menu:id=".uno:RemoveHyperlink"/>
+  <menu:menuitem menu:id=".uno:OpenSmartTagMenuOnCursor"/>
+  <menu:menuitem menu:id=".uno:ThesaurusFromContext"/>
+</menu:menupopup>


More information about the Libreoffice-commits mailing list