[Libreoffice-commits] core.git: framework/Library_fwk.mk framework/source

2019-07-19 Thread Noel Grandin (via logerrit)
 framework/Library_fwk.mk|2 
 framework/source/uiconfiguration/ImageArrayData.cxx |   91 ---
 framework/source/uiconfiguration/ImageList.cxx  |  157 ++--
 framework/source/uiconfiguration/ImageList.hxx  |   27 ++-
 framework/source/uiconfiguration/ImplImageList.cxx  |   71 -
 framework/source/uiconfiguration/image.h|   67 
 6 files changed, 101 insertions(+), 314 deletions(-)

New commits:
commit 825e3f66497c673dd7ac11a8fce830874288977d
Author: Noel Grandin 
AuthorDate: Fri Jul 19 16:31:37 2019 +0200
Commit: Noel Grandin 
CommitDate: Fri Jul 19 21:49:35 2019 +0200

simplify ImageList

we don't need an Impl pattern here

Change-Id: I93d0c5904a3aee8844987c7e36c19319d071d2f4
Reviewed-on: https://gerrit.libreoffice.org/75960
Tested-by: Jenkins
Reviewed-by: Noel Grandin 

diff --git a/framework/Library_fwk.mk b/framework/Library_fwk.mk
index 3957a5ace0ff..7a433735ce43 100644
--- a/framework/Library_fwk.mk
+++ b/framework/Library_fwk.mk
@@ -112,9 +112,7 @@ $(eval $(call gb_Library_add_exception_objects,fwk,\
 framework/source/services/taskcreatorsrv \
 framework/source/services/urltransformer \
 framework/source/uiconfiguration/CommandImageResolver \
-framework/source/uiconfiguration/ImageArrayData \
 framework/source/uiconfiguration/ImageList \
-framework/source/uiconfiguration/ImplImageList \
 framework/source/uiconfiguration/globalsettings \
 framework/source/uiconfiguration/graphicnameaccess \
 framework/source/uiconfiguration/imagemanager \
diff --git a/framework/source/uiconfiguration/ImageArrayData.cxx 
b/framework/source/uiconfiguration/ImageArrayData.cxx
deleted file mode 100644
index 570d2846ff77..
--- a/framework/source/uiconfiguration/ImageArrayData.cxx
+++ /dev/null
@@ -1,91 +0,0 @@
-/* -*- 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/.
- *
- * This file incorporates work covered by the following license notice:
- *
- *   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 regarding copyright
- *   ownership. The ASF licenses this file 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 .
- */
-
-#include 
-#include 
-#include 
-#include 
-#include 
-#include 
-#include 
-#include 
-#include 
-#include 
-
-#include "image.h"
-#include 
-#include 
-
-#if OSL_DEBUG_LEVEL > 0
-#include 
-#endif
-
-ImageAryData::ImageAryData( const ImageAryData& rData ) :
-maName( rData.maName ),
-mnId( rData.mnId ),
-maBitmapEx( rData.maBitmapEx )
-{
-}
-
-ImageAryData::ImageAryData( const OUString &aName,
-sal_uInt16 nId, const BitmapEx &aBitmap )
-: maName( aName ), mnId( nId ), maBitmapEx( aBitmap )
-{
-}
-
-ImageAryData::~ImageAryData()
-{
-}
-
-ImageAryData& ImageAryData::operator=( const ImageAryData& rData )
-{
-maName = rData.maName;
-mnId = rData.mnId;
-maBitmapEx = rData.maBitmapEx;
-
-return *this;
-}
-
-void ImageAryData::Load(const OUString &rPrefix)
-{
-OUString aIconTheme = 
Application::GetSettings().GetStyleSettings().DetermineIconTheme();
-
-OUString aFileName = rPrefix;
-aFileName += maName;
-
-bool bSuccess = ImageTree::get().loadImage(aFileName, aIconTheme, 
maBitmapEx, true);
-
-/* If the uno command has parameters, passed in from a toolbar,
- * recover from failure by removing the parameters from the file name
- */
-if (!bSuccess && aFileName.indexOf("%3f") > 0)
-{
-sal_Int32 nStart = aFileName.indexOf("%3f");
-sal_Int32 nEnd = aFileName.lastIndexOf(".");
-
-aFileName = aFileName.replaceAt(nStart, nEnd - nStart, "");
-bSuccess = ImageTree::get().loadImage(aFileName, aIconTheme, 
maBitmapEx, true);
-}
-
-SAL_WARN_IF(!bSuccess, "fwk.uiconfiguration", "Failed to load image '" << 
aFileName
-  << "' from icon theme '" << aIconTheme << "'");
-}
-
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/framework/source/uiconfiguration/ImageList.cxx 
b/framework/source/uiconfiguration/ImageList.cxx
index 0bb10d3d2bdb..100e152b17fc 100644
--- a/framework/source/uiconfiguration/ImageList.cxx
+++ b/framework/source/uiconfiguration/ImageList.cxx
@@ -29,7 +29,6 @@
 #include 
 #include 
 #include 
-#include "image.h"
 #include "ImageList.hxx"
 
 ImageList::ImageList()
@@ -41,48 +40,40 

[Libreoffice-commits] core.git: framework/Library_fwk.mk framework/source

2016-12-28 Thread Markus Mohrhard
 framework/Library_fwk.mk  |2 ++
 framework/source/services/desktop.cxx |2 ++
 2 files changed, 4 insertions(+)

New commits:
commit 657ec16557f374d05ddc298b3de4baca7ba283ce
Author: Markus Mohrhard 
Date:   Wed Dec 28 23:57:36 2016 +0100

add a crashreporter entry when we start the shutdown

This will help us identify shutdown related crashes.

Change-Id: Id09c3dfdc94c430d5dcb2aebb017f17db80f17e5
Reviewed-on: https://gerrit.libreoffice.org/32485
Tested-by: Jenkins 
Reviewed-by: Markus Mohrhard 

diff --git a/framework/Library_fwk.mk b/framework/Library_fwk.mk
index e6d0ae2..2246286 100644
--- a/framework/Library_fwk.mk
+++ b/framework/Library_fwk.mk
@@ -41,6 +41,8 @@ $(eval $(call gb_Library_use_libraries,fwk,\
 comphelper \
 cppu \
 cppuhelper \
+$(call gb_Helper_optional,BREAKPAD, \
+   crashreport) \
 fwe \
 fwi \
 i18nlangtag \
diff --git a/framework/source/services/desktop.cxx 
b/framework/source/services/desktop.cxx
index d11fad7..fffaa76 100644
--- a/framework/source/services/desktop.cxx
+++ b/framework/source/services/desktop.cxx
@@ -62,6 +62,7 @@
 #include 
 #include 
 #include 
+#include 
 
 #include 
 #include 
@@ -317,6 +318,7 @@ sal_Bool SAL_CALL Desktop::terminate()
 // see dispose() for further information.
 /* SAFE AREA 
---
 */
 SolarMutexClearableGuard aWriteLock;
+CrashReporter::AddKeyValue("ShutDown", OUString::boolean(true));
 m_bIsTerminated = true;
 aWriteLock.clear();
 /* UNSAFE AREA 
-
 */
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: framework/Library_fwk.mk framework/source vcl/source

2016-09-25 Thread Maxim Monastirsky
 framework/Library_fwk.mk  |1 
 framework/source/uielement/resourcemenucontroller.cxx |   53 +++
 framework/source/uielement/saveasmenucontroller.cxx   |  133 --
 vcl/source/window/menu.cxx|   18 +-
 4 files changed, 65 insertions(+), 140 deletions(-)

New commits:
commit 02ddfd10e9e46e2b121416d815303c386400ba6f
Author: Maxim Monastirsky 
Date:   Sun Sep 25 18:15:27 2016 +0300

tdf#96736 Let MenuBarManager handle the save dropdown

Instead of trying to do everything (icon theme
changes, disabling commands etc.) manually.

Change-Id: Iffd420bf09ccd566e96f39cb9684ab466a7c6555

diff --git a/framework/Library_fwk.mk b/framework/Library_fwk.mk
index ab6518a..e6d0ae2 100644
--- a/framework/Library_fwk.mk
+++ b/framework/Library_fwk.mk
@@ -141,7 +141,6 @@ $(eval $(call gb_Library_add_exception_objects,fwk,\
 framework/source/uielement/progressbarwrapper \
 framework/source/uielement/recentfilesmenucontroller \
 framework/source/uielement/resourcemenucontroller \
-framework/source/uielement/saveasmenucontroller \
 framework/source/uielement/spinfieldtoolbarcontroller \
 framework/source/uielement/statusbar \
 framework/source/uielement/statusbaritem \
diff --git a/framework/source/uielement/resourcemenucontroller.cxx 
b/framework/source/uielement/resourcemenucontroller.cxx
index 33956f3..02011c7 100644
--- a/framework/source/uielement/resourcemenucontroller.cxx
+++ b/framework/source/uielement/resourcemenucontroller.cxx
@@ -408,6 +408,51 @@ css::uno::Sequence< OUString > 
ResourceMenuController::getSupportedServiceNames(
 return { "com.sun.star.frame.PopupMenuController" };
 }
 
+class SaveAsMenuController : public ResourceMenuController
+{
+public:
+SaveAsMenuController( const css::uno::Reference< 
css::uno::XComponentContext >& rContext,
+  const css::uno::Sequence< css::uno::Any >& rArgs );
+
+// XServiceInfo
+virtual OUString SAL_CALL getImplementationName() throw ( 
css::uno::RuntimeException, std::exception ) override;
+
+private:
+virtual void impl_setPopupMenu() override;
+};
+
+SaveAsMenuController::SaveAsMenuController( const css::uno::Reference< 
css::uno::XComponentContext >& rContext,
+const css::uno::Sequence< 
css::uno::Any >& rArgs )
+: ResourceMenuController( rContext, rArgs, false )
+{
+}
+
+void SaveAsMenuController::impl_setPopupMenu()
+{
+VCLXMenu* pPopupMenu= VCLXMenu::GetImplementation( m_xPopupMenu );
+Menu* pVCLPopupMenu = nullptr;
+
+SolarMutexGuard aGuard;
+
+if ( pPopupMenu )
+pVCLPopupMenu = pPopupMenu->GetMenu();
+
+if ( !pVCLPopupMenu )
+return;
+
+pVCLPopupMenu->InsertItem( ".uno:SaveAs", nullptr );
+pVCLPopupMenu->InsertItem( ".uno:ExportTo", nullptr );
+pVCLPopupMenu->InsertItem( ".uno:SaveAsTemplate", nullptr );
+pVCLPopupMenu->InsertSeparator();
+pVCLPopupMenu->InsertItem( ".uno:SaveAsRemote", nullptr );
+}
+
+OUString SaveAsMenuController::getImplementationName()
+throw ( css::uno::RuntimeException, std::exception )
+{
+return OUString( "com.sun.star.comp.framework.SaveAsMenuController" );
+}
+
 }
 
 extern "C" SAL_DLLPUBLIC_EXPORT css::uno::XInterface * SAL_CALL
@@ -426,4 +471,12 @@ 
com_sun_star_comp_framework_ToolbarAsMenuController_get_implementation(
 return cppu::acquire( new ResourceMenuController( context, args, true ) );
 }
 
+extern "C" SAL_DLLPUBLIC_EXPORT css::uno::XInterface * SAL_CALL
+com_sun_star_comp_framework_SaveAsMenuController_get_implementation(
+css::uno::XComponentContext* context,
+css::uno::Sequence< css::uno::Any > const & args )
+{
+return cppu::acquire( new SaveAsMenuController( context, args ) );
+}
+
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/framework/source/uielement/saveasmenucontroller.cxx 
b/framework/source/uielement/saveasmenucontroller.cxx
deleted file mode 100644
index 0941552..000
--- a/framework/source/uielement/saveasmenucontroller.cxx
+++ /dev/null
@@ -1,133 +0,0 @@
-/* -*- 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/.
- *
- * This file incorporates work covered by the following license notice:
- *
- *   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 regarding copyright
- *   ownership. The ASF licenses this file 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
- *   th

[Libreoffice-commits] core.git: framework/Library_fwk.mk framework/source framework/util

2016-04-07 Thread Stephan Bergmann
 framework/Library_fwk.mk   |1 
 framework/source/services/tabwindowservice.cxx |  537 -
 framework/util/fwk.component   |4 
 3 files changed, 542 deletions(-)

New commits:
commit d6d86237b1b438919609988049ac4a152612fee1
Author: Stephan Bergmann 
Date:   Thu Apr 7 15:22:42 2016 +0200

[API CHANGE] Remove undocumented TabContainerWindow service

It originally got introduced with b1da5a57d93e8e9b43b9bba9fabc3b7e61289edc
"CWS-TOOLING: integrate CWS alf01" but appears to have never been used.

Curiously, there were two commits to its code
(f565a4b3d9b47ca3336df4f8d8d56d4e2dcceec5 "#i107087# TabWindowService must 
set
member pointer to zero on VCLEVENT_OBJECT_DYING. The window life time is
controlled by the docking window! Adding missing RemoveEventListener call" 
and
84c0ebe7d3e7dbc3796967d52f9535fecc9e6947 "#i107087# Remove event listener 
from
tab window on TabWindowService dtor") that mention
 "button merged in 
standard
toolbar + own UI caused office crash", but the description of which ("when i
merge a toolbar button in a standard toolbar and provide own UI (via the
toolkit) the office crashed sometimes") doesn't give a hint how this service
would have been used.  (Maybe it was intended to be used by extensions, but
never got documented neither in offapi's UNOIDL nor in

.)

Change-Id: I86746f73ee99ebe7f5afbc902204a9353e5ccb7b

diff --git a/framework/Library_fwk.mk b/framework/Library_fwk.mk
index f4a2aed..d1927cd 100644
--- a/framework/Library_fwk.mk
+++ b/framework/Library_fwk.mk
@@ -110,7 +110,6 @@ $(eval $(call gb_Library_add_exception_objects,fwk,\
 framework/source/services/pathsettings \
 framework/source/services/sessionlistener \
 framework/source/services/substitutepathvars \
-framework/source/services/tabwindowservice \
 framework/source/services/taskcreatorsrv \
 framework/source/services/urltransformer \
 framework/source/uiconfiguration/globalsettings \
diff --git a/framework/source/services/tabwindowservice.cxx 
b/framework/source/services/tabwindowservice.cxx
deleted file mode 100644
index 06aff9f..000
--- a/framework/source/services/tabwindowservice.cxx
+++ /dev/null
@@ -1,537 +0,0 @@
-/* -*- 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/.
- *
- * This file incorporates work covered by the following license notice:
- *
- *   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 regarding copyright
- *   ownership. The ASF licenses this file 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 .
- */
-
-#include 
-#include 
-#include 
-
-#include 
-#include 
-#include 
-#include 
-#include 
-
-#include 
-#include 
-#include 
-#include 
-#include 
-#include 
-#include 
-#include 
-#include 
-#include 
-#include 
-#include 
-#include 
-#include 
-
-using namespace framework;
-
-namespace {
-
-struct TTabPageInfo
-{
-public:
-
-TTabPageInfo()
-: m_nIndex  ( -1  )
-, m_bCreated(false)
-, m_lProperties ( )
-{}
-
-explicit TTabPageInfo(::sal_Int32 nID)
-: m_nIndex  ( nID )
-, m_bCreated(false)
-, m_lProperties ( )
-{}
-
-public:
-
-::sal_Int32   m_nIndex;
-bool  m_bCreated;
-css::uno::Sequence< css::beans::NamedValue >  m_lProperties;
-};
-
-typedef std::unordered_map< ::sal_Int32,
-TTabPageInfo   ,
-Int32HashCode > TTabPageInfoHash;
-
-/*-
-@short  implements a helper service providing a dockable tab control window
-*//*-*/
-
-class TabWindowService :  public css::lang::XTypeProvider
- ,  public css::lang::XServiceInfo
- ,  public css::awt::XSimpleTabController
- ,  public css::

[Libreoffice-commits] core.git: framework/Library_fwk.mk framework/source

2016-01-29 Thread Maxim Monastirsky
 framework/Library_fwk.mk   |1 
 framework/source/uielement/resourcemenucontroller.cxx  |   92 +++-
 framework/source/uielement/toolbarasmenucontroller.cxx |  363 -
 3 files changed, 84 insertions(+), 372 deletions(-)

New commits:
commit 1d0f08cdf1b9396e97e068f97fd78f31b5906748
Author: Maxim Monastirsky 
Date:   Fri Jan 29 12:21:45 2016 +0200

Use ResourceMenuController for toolbar-based menus too

No need for yet another controller that does similar things.

Change-Id: I4ad79d82ea34a90a43e36082d1fb834201dba3a1

diff --git a/framework/Library_fwk.mk b/framework/Library_fwk.mk
index ce85848..0c78fc4 100644
--- a/framework/Library_fwk.mk
+++ b/framework/Library_fwk.mk
@@ -156,7 +156,6 @@ $(eval $(call gb_Library_add_exception_objects,fwk,\
 framework/source/uielement/subtoolbarcontroller \
 framework/source/uielement/thesaurusmenucontroller \
 framework/source/uielement/togglebuttontoolbarcontroller \
-framework/source/uielement/toolbarasmenucontroller \
 framework/source/uielement/toolbarmanager \
 framework/source/uielement/toolbarmerger \
 framework/source/uielement/toolbarwrapper \
diff --git a/framework/source/uielement/resourcemenucontroller.cxx 
b/framework/source/uielement/resourcemenucontroller.cxx
index 581c227..4477516 100644
--- a/framework/source/uielement/resourcemenucontroller.cxx
+++ b/framework/source/uielement/resourcemenucontroller.cxx
@@ -16,6 +16,7 @@
 #include 
 #include 
 #include 
+#include 
 #include 
 #include 
 #include 
@@ -26,7 +27,7 @@ class ResourceMenuController : public 
cppu::ImplInheritanceHelper< svt::PopupMen
 {
 public:
 ResourceMenuController( const css::uno::Reference< 
css::uno::XComponentContext >& rxContext,
-const css::uno::Sequence< css::uno::Any >& rxArgs 
);
+const css::uno::Sequence< css::uno::Any >& rxArgs, 
bool bToolbarContainer );
 virtual ~ResourceMenuController();
 
 // XPopupMenuController
@@ -55,20 +56,23 @@ private:
 OUString m_aMenuURL;
 bool m_bContextMenu;
 bool m_bInToolbar;
+bool m_bToolbarContainer;
 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 );
+void fillToolbarData();
 virtual void SAL_CALL disposing() override;
 };
 
 ResourceMenuController::ResourceMenuController( const css::uno::Reference< 
css::uno::XComponentContext >& rxContext,
-const css::uno::Sequence< 
css::uno::Any >& rxArgs ) :
+const css::uno::Sequence< 
css::uno::Any >& rxArgs, bool bToolbarContainer ) :
 ImplInheritanceHelper( rxContext ),
 m_bContextMenu( false ),
 m_bInToolbar( false ),
+m_bToolbarContainer( bToolbarContainer ),
 m_nNewMenuId( 1 ),
 m_xContext( rxContext )
 {
@@ -81,7 +85,10 @@ ResourceMenuController::ResourceMenuController( const 
css::uno::Reference< css::
 {
 OUString aMenuName;
 aPropValue.Value >>= aMenuName;
-m_aMenuURL = "private:resource/popupmenu/" + aMenuName;
+if ( m_bToolbarContainer )
+m_aMenuURL = "private:resource/toolbar/" + aMenuName;
+else
+m_aMenuURL = "private:resource/popupmenu/" + aMenuName;
 }
 else if ( aPropValue.Name == "Frame" )
 aPropValue.Value >>= m_xFrame;
@@ -184,9 +191,11 @@ void ResourceMenuController::updatePopupMenu()
 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 );
+if ( m_bToolbarContainer )
+fillToolbarData();
+else
+framework::MenuBarManager::FillMenu( m_nNewMenuId, 
VCLXMenu::GetImplementation( m_xPopupMenu )->GetMenu(), m_aModuleName, 
m_xMenuContainer, xDispatchProvider );
 
 // For context menus, add object verbs.
 if ( m_bContextMenu )
@@ -235,6 +244,63 @@ void ResourceMenuController::addVerbs( const 
css::uno::Sequence< css::embed::Ver
 }
 }
 
+void ResourceMenuController::fillToolbarData()
+{
+if ( !m_xMenuContainer.is() )
+return;
+
+VCLXMenu* pAwtMenu = VCLXMenu::GetImplementation( m_xPopupMenu );
+Menu* pVCLMenu = pAwtMenu->GetMenu();
+
+css::uno::Sequence< css::bea

[Libreoffice-commits] core.git: framework/Library_fwk.mk framework/source framework/util officecfg/registry

2015-11-28 Thread Maxim Monastirsky
 framework/Library_fwk.mk|1 
 framework/source/uielement/toolbarasmenucontroller.cxx  |  362 
++
 framework/util/fwk.component|4 
 officecfg/registry/data/org/openoffice/Office/UI/Controller.xcu |   14 
 4 files changed, 381 insertions(+)

New commits:
commit ac5d31ee131f5b966946af365c64ce0bb1b0d112
Author: Maxim Monastirsky 
Date:   Fri Nov 27 13:03:28 2015 +0200

New controller to show toolbar contents as menu

Change-Id: I75911a251b0a38874068b95f496496eccc4d05fb
Reviewed-on: https://gerrit.libreoffice.org/20224
Tested-by: Jenkins 
Reviewed-by: Maxim Monastirsky 

diff --git a/framework/Library_fwk.mk b/framework/Library_fwk.mk
index 3efd330..7cd6fe4 100644
--- a/framework/Library_fwk.mk
+++ b/framework/Library_fwk.mk
@@ -155,6 +155,7 @@ $(eval $(call gb_Library_add_exception_objects,fwk,\
 framework/source/uielement/subtoolbarcontroller \
 framework/source/uielement/thesaurusmenucontroller \
 framework/source/uielement/togglebuttontoolbarcontroller \
+framework/source/uielement/toolbarasmenucontroller \
 framework/source/uielement/toolbarmanager \
 framework/source/uielement/toolbarmerger \
 framework/source/uielement/toolbarwrapper \
diff --git a/framework/source/uielement/toolbarasmenucontroller.cxx 
b/framework/source/uielement/toolbarasmenucontroller.cxx
new file mode 100644
index 000..83fdde4
--- /dev/null
+++ b/framework/source/uielement/toolbarasmenucontroller.cxx
@@ -0,0 +1,362 @@
+/* -*- 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 
+#include 
+#include 
+
+#include 
+#include 
+#include 
+#include 
+
+namespace framework {
+
+class CommandStatusHelper : public cppu::WeakImplHelper< 
css::frame::XStatusListener >
+{
+public:
+CommandStatusHelper( const css::uno::Reference< 
css::uno::XComponentContext >& rxContext,
+ const css::uno::Reference< css::frame::XFrame >& 
rxFrame,
+ const OUString& rCommandURL );
+~CommandStatusHelper();
+
+// 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;
+
+void updateCommand();
+bool isCommandEnabled() { return m_bEnabled; }
+bool isCommandChecked() { return m_bChecked; }
+
+private:
+bool m_bEnabled;
+bool m_bChecked;
+OUString m_aCommandURL;
+css::uno::Reference< css::frame::XFrame > m_xFrame;
+css::uno::Reference< css::util::XURLTransformer > m_xURLTransformer;
+};
+
+CommandStatusHelper::CommandStatusHelper( const css::uno::Reference< 
css::uno::XComponentContext >& rxContext,
+  const css::uno::Reference< 
css::frame::XFrame >& rxFrame,
+  const OUString& rCommandURL ) :
+m_bEnabled( true ),
+m_bChecked( false ),
+m_aCommandURL( rCommandURL ),
+m_xFrame( rxFrame ),
+m_xURLTransformer( css::util::URLTransformer::create( rxContext ) )
+{
+}
+
+CommandStatusHelper::~CommandStatusHelper()
+{
+}
+
+void CommandStatusHelper::updateCommand()
+{
+css::uno::Reference< css::frame::XDispatchProvider > xDispatchProvider( 
m_xFrame, css::uno::UNO_QUERY );
+if ( xDispatchProvider.is() )
+{
+css::util::URL aTargetURL;
+aTargetURL.Complete = m_aCommandURL;
+m_xURLTransformer->parseStrict( aTargetURL );
+
+css::uno::Reference< css::frame::XDispatch > xDispatch( 
xDispatchProvider->queryDispatch( aTargetURL, OUString(), 0 ) );
+if ( xDispatch.is() )
+{
+xDispatch->addStatusListener( this, aTargetURL );
+xDispatch->removeStatusListener( this, aTargetURL );
+}
+}
+}
+
+void CommandStatusHelper::statusChanged( const css::frame::FeatureStateEvent& 
rEvent )
+throw ( css::uno::RuntimeException, std::exception )
+{
+OUString aStringStatus;
+if ( rEvent.State >>= aStringStatus )
+{
+const OUString aEnumPart( rEvent.FeatureURL.Complete.getToken( 2, '.' 
) );
+if ( !aEnumPart.isEmpty() && rEvent.FeatureURL.Protocol == ".uno:" )
+m_bChecked = aStringStatus == aEnumPart;
+}
+rEvent.State >>= m_bChecked;
+m_bEnabled = rEvent.IsEnabled;
+}
+
+void CommandStatusHelper::disposing( const css::lang::EventObject& /*rEvent*/ )
+throw ( css::uno::RuntimeException, std::exception )
+{
+// We aren't holding reference