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

2022-08-30 Thread Maxim Monastirsky (via logerrit)
 framework/inc/uielement/toolbarmanager.hxx  |2 
 framework/source/uielement/generictoolbarcontroller.cxx |   94 +++-
 framework/source/uielement/toolbarmanager.cxx   |   10 +
 include/framework/generictoolbarcontroller.hxx  |   24 +++-
 include/sfx2/weldutils.hxx  |1 
 sfx2/inc/sidebar/ControllerFactory.hxx  |4 
 sfx2/inc/sidebar/SidebarToolBox.hxx |1 
 sfx2/source/sidebar/ControllerFactory.cxx   |   12 ++
 sfx2/source/sidebar/SidebarToolBox.cxx  |9 +
 sfx2/source/toolbox/weldutils.cxx   |5 
 vcl/source/window/toolbox2.cxx  |   43 ++-
 11 files changed, 169 insertions(+), 36 deletions(-)

New commits:
commit dbeb697d62250e9429462c7f61b859893262a651
Author: Maxim Monastirsky 
AuthorDate: Fri Jul 29 09:56:51 2022 +0300
Commit: Maxim Monastirsky 
CommitDate: Tue Aug 30 13:08:39 2022 +0200

tdf#149956 Rework toolbar image flipping

An unified code, covering both vcl and weld cases. For
SidebarToolBox, the controller is created before items
are inserted, so we listen for item insert event to set
initially correct state.

Change-Id: I3841f21883104b4d3f8541c97ec7fa5fc0bec575
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/139022
Tested-by: Jenkins
Reviewed-by: Maxim Monastirsky 

diff --git a/framework/inc/uielement/toolbarmanager.hxx 
b/framework/inc/uielement/toolbarmanager.hxx
index 865a1b54d5b4..debd898c9b45 100644
--- a/framework/inc/uielement/toolbarmanager.hxx
+++ b/framework/inc/uielement/toolbarmanager.hxx
@@ -55,6 +55,7 @@ class Menu;
 namespace framework
 {
 
+class ImageOrientationController;
 class ToolBarManager;
 
 class ToolBarManagerImpl
@@ -246,6 +247,7 @@ class ToolBarManager final : public ToolbarManager_Base
 OUString 
m_sIconTheme;
 
 rtl::Reference< ToolBarManager > 
m_aOverflowManager;
+rtl::Reference< ImageOrientationController > 
m_aImageController;
 };
 
 }
diff --git a/framework/source/uielement/generictoolbarcontroller.cxx 
b/framework/source/uielement/generictoolbarcontroller.cxx
index 312b5ed9e77f..f61a0d0150b9 100644
--- a/framework/source/uielement/generictoolbarcontroller.cxx
+++ b/framework/source/uielement/generictoolbarcontroller.cxx
@@ -30,9 +30,9 @@
 #include 
 #include 
 #include 
-#include 
 #include 
 #include 
+#include 
 #include 
 #include 
 
@@ -338,6 +338,98 @@ IMPL_STATIC_LINK( GenericToolbarController, 
ExecuteHdl_Impl, void*, p, void )
delete pExecuteInfo;
 }
 
+ImageOrientationController::ImageOrientationController(const 
Reference& rContext,
+   const 
Reference& rFrame,
+   const 
Reference& rParentWindow,
+   const OUString& 
rModuleName)
+: ToolboxController(rContext, rFrame, ".uno:ImageOrientation")
+, m_nRotationAngle(0_deg10)
+, m_bMirrored(false)
+{
+m_sModuleName = rModuleName;
+m_xParentWindow = rParentWindow;
+initialize({});
+if (!m_pToolbar)
+VCLUnoHelper::GetWindow(getParent())->AddEventListener(LINK(this, 
ImageOrientationController, WindowEventListener));
+}
+
+void ImageOrientationController::dispose()
+{
+ToolboxController::dispose();
+if (!m_pToolbar)
+VCLUnoHelper::GetWindow(getParent())->RemoveEventListener(LINK(this, 
ImageOrientationController, WindowEventListener));
+}
+
+IMPL_LINK(ImageOrientationController, WindowEventListener, VclWindowEvent&, 
rWindowEvent, void)
+{
+if (m_bDisposed || rWindowEvent.GetId() != VclEventId::ToolboxItemAdded)
+return;
+
+ToolBox* pToolBox = static_cast(rWindowEvent.GetWindow());
+ToolBoxItemId nItemId = 
pToolBox->GetItemId(reinterpret_cast(rWindowEvent.GetData()));
+OUString aCommand = pToolBox->GetItemCommand(nItemId);
+
+if (vcl::CommandInfoProvider::IsMirrored(aCommand, getModuleName()))
+pToolBox->SetItemImageMirrorMode(nItemId, m_bMirrored);
+if (vcl::CommandInfoProvider::IsRotated(aCommand, getModuleName()))
+pToolBox->SetItemImageAngle(nItemId, m_nRotationAngle);
+}
+
+void ImageOrientationController::statusChanged(const 
css::frame::FeatureStateEvent& rEvent)
+{
+if (m_bDisposed)
+throw DisposedException();
+
+SfxImageItem aItem;
+aItem.PutValue(rEvent.State, 0);
+
+if (m_bMirrored == aItem.IsMirrored() && m_nRotationAngle == 
aItem.GetRotation())
+return;
+
+m_bMirrored = aItem.IsMirrored();
+m_nRotationAngle = aItem.GetRotation();
+
+if (m_pToolbar)
+{
+for (int i = 0, nCount = m_pToolbar->get_n_items(); i < nCount; ++i)
+{
+OString aCommand = m_pToolbar->get_item_ident(i);
+if 

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

2022-07-17 Thread Maxim Monastirsky (via logerrit)
 framework/inc/uielement/toolbarmanager.hxx  |5 --
 framework/source/fwe/classes/sfxhelperfunctions.cxx |   23 --
 framework/source/uielement/toolbarmanager.cxx   |   42 
 include/framework/sfxhelperfunctions.hxx|   19 -
 include/sfx2/tbxctrl.hxx|1 
 sfx2/source/appl/app.cxx|   12 -
 6 files changed, 12 insertions(+), 90 deletions(-)

New commits:
commit f87c7018fa5641eeecd788907ea66892514255a6
Author: Maxim Monastirsky 
AuthorDate: Sun Jul 17 15:43:17 2022 +0300
Commit: Maxim Monastirsky 
CommitDate: Sun Jul 17 22:36:53 2022 +0200

No need for SfxWeldToolBoxControllerFactory

sfx2::sidebar::ControllerFactory::CreateToolBoxController
only supports creating controllers using the uno factory,
or GenericToolbarController as a fallback. Given that we
already handle the uno factory case in
ToolBarManager::CreateControllers, all this complexity is
really just for creating GenericToolbarController with a
different ctor, which we can do locally as well.

Change-Id: I3a5a3cda95a6c5db97615286e93630214f76cbfc
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/137149
Tested-by: Jenkins
Reviewed-by: Maxim Monastirsky 

diff --git a/framework/inc/uielement/toolbarmanager.hxx 
b/framework/inc/uielement/toolbarmanager.hxx
index 17840c46fe95..2e7cd1c01a9a 100644
--- a/framework/inc/uielement/toolbarmanager.hxx
+++ b/framework/inc/uielement/toolbarmanager.hxx
@@ -64,10 +64,6 @@ public:
 virtual void Init() = 0;
 virtual void Destroy() = 0;
 virtual css::uno::Reference GetInterface() = 0;
-virtual css::uno::Reference 
CreateToolBoxController(
-const css::uno::Reference& 
rFrame,
-ToolBoxItemId nId,
-const OUString& aCommandURL ) = 0;
 virtual void InsertItem(ToolBoxItemId nId,
 const OUString& rString,
 const OUString& rCommandURL,
@@ -230,6 +226,7 @@ class ToolBarManager final : public ToolbarManager_Base
 
 std::unique_ptr  m_pImpl;
 VclPtr  
m_pToolBar;
+weld::Toolbar*   
m_pWeldedToolBar;
 
 OUString 
m_aModuleIdentifier;
 OUString 
m_aResourceName;
diff --git a/framework/source/fwe/classes/sfxhelperfunctions.cxx 
b/framework/source/fwe/classes/sfxhelperfunctions.cxx
index 170f3e7156bb..5a1cc0d716d5 100644
--- a/framework/source/fwe/classes/sfxhelperfunctions.cxx
+++ b/framework/source/fwe/classes/sfxhelperfunctions.cxx
@@ -24,7 +24,6 @@
 #include 
 
 static pfunc_setToolBoxControllerCreator   pToolBoxControllerCreator   = 
nullptr;
-static pfunc_setWeldToolBoxControllerCreator pWeldToolBoxControllerCreator = 
nullptr;
 static pfunc_setStatusBarControllerCreator pStatusBarControllerCreator = 
nullptr;
 static pfunc_getRefreshToolbarspRefreshToolbars= 
nullptr;
 static pfunc_createDockingWindow   pCreateDockingWindow= 
nullptr;
@@ -58,28 +57,6 @@ rtl::Reference 
CreateToolBoxController( const Reference<
 return nullptr;
 }
 
-pfunc_setWeldToolBoxControllerCreator SetWeldToolBoxControllerCreator( 
pfunc_setWeldToolBoxControllerCreator pSetWeldToolBoxControllerCreator )
-{
-::osl::MutexGuard aGuard( ::osl::Mutex::getGlobalMutex() );
-pfunc_setWeldToolBoxControllerCreator pOldSetToolBoxControllerCreator = 
pWeldToolBoxControllerCreator;
-pWeldToolBoxControllerCreator = pSetWeldToolBoxControllerCreator;
-return pOldSetToolBoxControllerCreator;
-}
-
-css::uno::Reference 
CreateWeldToolBoxController( const Reference< XFrame >& rFrame, weld::Toolbar* 
pToolbar, weld::Builder* pBuilder, const OUString& aCommandURL )
-{
-pfunc_setWeldToolBoxControllerCreator pFactory = nullptr;
-{
-::osl::MutexGuard aGuard( ::osl::Mutex::getGlobalMutex() );
-pFactory = pWeldToolBoxControllerCreator;
-}
-
-if ( pFactory )
-return (*pFactory)( rFrame, pToolbar, pBuilder, aCommandURL );
-else
-return nullptr;
-}
-
 pfunc_setStatusBarControllerCreator SetStatusBarControllerCreator( 
pfunc_setStatusBarControllerCreator pSetStatusBarControllerCreator )
 {
 ::osl::MutexGuard aGuard( ::osl::Mutex::getGlobalMutex() );
diff --git a/framework/source/uielement/toolbarmanager.cxx 
b/framework/source/uielement/toolbarmanager.cxx
index a632828b5c8c..587cd8b61ad8 100644
--- a/framework/source/uielement/toolbarmanager.cxx
+++ b/framework/source/uielement/toolbarmanager.cxx
@@ -200,19 +200,6 @@ public:
 return VCLUnoHelper::GetInterface(m_pToolBar);
 }
 
-virtual css::uno::Reference 
CreateToolBoxController(
-const css::uno::

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

2022-06-02 Thread Noel Grandin (via logerrit)
 framework/inc/classes/rootactiontriggercontainer.hxx  |2 -
 framework/inc/classes/taskcreator.hxx |2 -
 framework/inc/dispatch/closedispatcher.hxx|2 -
 framework/inc/dispatch/dispatchinformationprovider.hxx|4 +--
 framework/inc/dispatch/dispatchprovider.hxx   |4 +--
 framework/inc/dispatch/interceptionhelper.hxx |2 -
 framework/inc/dispatch/mailtodispatcher.hxx   |2 -
 framework/inc/dispatch/oxt_handler.hxx|2 -
 framework/inc/dispatch/popupmenudispatcher.hxx|2 -
 framework/inc/dispatch/servicehandler.hxx |2 -
 framework/inc/dispatch/startmoduledispatcher.hxx  |2 -
 framework/inc/dispatch/systemexec.hxx |2 -
 framework/inc/helper/mischelper.hxx   |3 +-
 framework/inc/helper/persistentwindowstate.hxx|2 -
 framework/inc/helper/statusindicatorfactory.hxx   |2 -
 framework/inc/helper/titlebarupdate.hxx   |2 -
 framework/inc/helper/vclstatusindicator.hxx   |2 -
 framework/inc/jobs/configaccess.hxx   |4 +--
 framework/inc/jobs/helponstartup.hxx  |2 -
 framework/inc/jobs/job.hxx|4 +--
 framework/inc/jobs/jobdata.hxx|   11 

 framework/inc/jobs/shelljob.hxx   |2 -
 framework/inc/menuconfiguration.hxx   |   13 
+-
 framework/inc/uiconfiguration/globalsettings.hxx  |2 -
 framework/inc/uielement/buttontoolbarcontroller.hxx   |4 +--
 framework/inc/uielement/menubarmanager.hxx|9 +++---
 framework/inc/uielement/menubarwrapper.hxx|3 --
 framework/inc/uielement/statusbaritem.hxx |2 -
 framework/inc/uielement/statusbarmanager.hxx  |4 +--
 framework/inc/uielement/statusbarwrapper.hxx  |2 -
 framework/inc/uielement/styletoolbarcontroller.hxx|2 -
 framework/inc/uielement/toolbarmanager.hxx|4 +--
 framework/inc/uielement/uielement.hxx |   13 
+-
 framework/inc/uifactory/configurationaccessfactorymanager.hxx |2 -
 framework/inc/uifactory/factoryconfiguration.hxx  |5 ++-
 framework/inc/uifactory/menubarfactory.hxx|2 -
 framework/inc/xml/acceleratorconfigurationwriter.hxx  |2 -
 framework/source/accelerators/acceleratorconfiguration.cxx|4 +--
 framework/source/accelerators/presethandler.cxx   |5 ++-
 framework/source/classes/taskcreator.cxx  |5 ++-
 framework/source/dispatch/closedispatcher.cxx |5 ++-
 framework/source/dispatch/dispatchinformationprovider.cxx |5 ++-
 framework/source/dispatch/dispatchprovider.cxx|7 +++--
 framework/source/dispatch/interceptionhelper.cxx  |5 ++-
 framework/source/dispatch/loaddispatcher.cxx  |5 ++-
 framework/source/dispatch/mailtodispatcher.cxx|5 ++-
 framework/source/dispatch/oxt_handler.cxx |5 ++-
 framework/source/dispatch/popupmenudispatcher.cxx |5 ++-
 framework/source/dispatch/servicehandler.cxx  |5 ++-
 framework/source/dispatch/startmoduledispatcher.cxx   |5 ++-
 framework/source/dispatch/systemexec.cxx  |5 ++-
 framework/source/dispatch/windowcommanddispatch.cxx   |5 ++-
 framework/source/fwe/classes/rootactiontriggercontainer.cxx   |5 ++-
 framework/source/fwe/dispatch/interaction.cxx |5 ++-
 framework/source/fwe/helper/titlehelper.cxx   |5 ++-
 framework/source/fwe/helper/undomanagerhelper.cxx |5 ++-
 framework/source/fwe/xml/menuconfiguration.cxx|6 ++--
 framework/source/fwi/jobs/configaccess.cxx|9 +++---
 framework/source/helper/persistentwindowstate.cxx |5 ++-
 framework/source/helper/statusindicatorfactory.cxx|4 +--
 framework/source/helper/titlebarupdate.cxx|5 ++-
 framework/source/helper/vclstatusindicator.cxx|5 ++-
 framework/source/inc/accelerators/acceleratorconfiguration.hxx|2 -
 framework/source/inc/accelerators/presethandler.hxx   |2 -
 framework/source/inc/dispat

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

2021-11-26 Thread Noel Grandin (via logerrit)
 framework/inc/acceleratorconst.h  |6 -
 framework/inc/bitmaps.hlst|   48 +-
 framework/inc/classes/actiontriggercontainer.hxx  |4 
 framework/inc/classes/actiontriggerpropertyset.hxx|4 
 framework/inc/classes/actiontriggerseparatorpropertyset.hxx   |4 
 framework/inc/classes/protocolhandlercache.hxx|2 
 framework/inc/classes/rootactiontriggercontainer.hxx  |2 
 framework/inc/properties.h|   42 
 framework/inc/services.h  |   16 +--
 framework/inc/targets.h   |   12 +-
 framework/inc/taskcreatordefs.hxx |   10 +-
 framework/inc/uiconfiguration/windowstateproperties.hxx   |   34 +++
 framework/inc/xml/toolboxconfigurationdefines.hxx |   38 +++
 framework/source/layoutmanager/helpers.hxx|4 
 framework/source/uiconfiguration/windowstateconfiguration.cxx |   13 --
 framework/source/uielement/controlmenucontroller.cxx  |   42 
 framework/source/xml/imagesdocumenthandler.cxx|2 
 include/framework/addonsoptions.hxx   |   16 +--
 18 files changed, 150 insertions(+), 149 deletions(-)

New commits:
commit c4499bef94845176b53bbe9678d242638d86040c
Author: Noel Grandin 
AuthorDate: Thu Nov 25 14:51:21 2021 +0200
Commit: Noel Grandin 
CommitDate: Fri Nov 26 09:47:52 2021 +0100

loplugin:stringliteraldefine in framework

Change-Id: I8bdda62c232b8f20aa6bb1e5e7ad303d6ffa47ff
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/125809
Tested-by: Jenkins
Reviewed-by: Noel Grandin 

diff --git a/framework/inc/acceleratorconst.h b/framework/inc/acceleratorconst.h
index e75b5be04b02..83fd40ac77f7 100644
--- a/framework/inc/acceleratorconst.h
+++ b/framework/inc/acceleratorconst.h
@@ -21,11 +21,11 @@
 
 namespace framework{
 
-#define ATTRIBUTE_TYPE_CDATA"CDATA"
+inline constexpr OUStringLiteral ATTRIBUTE_TYPE_CDATA = u"CDATA";
 
 // same items with a name space alias
-#define AL_ELEMENT_ACCELERATORLIST  "accel:acceleratorlist"
-#define AL_ELEMENT_ITEM "accel:item"
+inline constexpr OUStringLiteral AL_ELEMENT_ACCELERATORLIST = 
u"accel:acceleratorlist";
+inline constexpr OUStringLiteral AL_ELEMENT_ITEM = u"accel:item";
 
 } // namespace framework
 
diff --git a/framework/inc/bitmaps.hlst b/framework/inc/bitmaps.hlst
index e65566982d06..78211ef9e8c1 100644
--- a/framework/inc/bitmaps.hlst
+++ b/framework/inc/bitmaps.hlst
@@ -9,29 +9,31 @@
 
 #pragma once
 
-#define BMP_SAVEMODIFIED_SMALL  "res/savemodified_small.png"
-#define BMP_SAVEMODIFIED_LARGE  "res/savemodified_large.png"
-#define BMP_SAVEMODIFIED_EXTRALARGE "res/savemodified_extralarge.png"
+#include 
 
-#define RID_SVXBMP_BUTTON   "res/sx10594.png"
-#define RID_SVXBMP_RADIOBUTTON  "res/sx10595.png"
-#define RID_SVXBMP_CHECKBOX "res/sx10596.png"
-#define RID_SVXBMP_FIXEDTEXT"res/sx10597.png"
-#define RID_SVXBMP_GROUPBOX "res/sx10598.png"
-#define RID_SVXBMP_EDITBOX  "res/sx10599.png"
-#define RID_SVXBMP_LISTBOX  "res/sx10600.png"
-#define RID_SVXBMP_COMBOBOX "res/sx10601.png"
-#define RID_SVXBMP_IMAGEBUTTON  "res/sx10604.png"
-#define RID_SVXBMP_IMAGECONTROL "res/sx10710.png"
-#define RID_SVXBMP_FILECONTROL  "res/sx10605.png"
-#define RID_SVXBMP_DATEFIELD"res/sx10704.png"
-#define RID_SVXBMP_TIMEFIELD"res/sx10705.png"
-#define RID_SVXBMP_NUMERICFIELD "res/sx10706.png"
-#define RID_SVXBMP_CURRENCYFIELD"res/sx10707.png"
-#define RID_SVXBMP_PATTERNFIELD "res/sx10708.png"
-#define RID_SVXBMP_FORMATTEDFIELD   "res/sx10728.png"
-#define RID_SVXBMP_SCROLLBAR"res/sx10768.png"
-#define RID_SVXBMP_SPINBUTTON   "res/sx10769.png"
-#define RID_SVXBMP_NAVIGATIONBAR"res/sx10607.png"
+inline constexpr OUStringLiteral BMP_SAVEMODIFIED_SMALL = 
u"res/savemodified_small.png";
+inline constexpr OUStringLiteral BMP_SAVEMODIFIED_LARGE = 
u"res/savemodified_large.png";
+inline constexpr OUStringLiteral BMP_SAVEMODIFIED_EXTRALARGE = 
u"res/savemodified_extralarge.png";
+
+inline constexpr OUStringLiteral RID_SVXBMP_BUTTON = u"res/sx10594.png";
+inline constexpr OUStringLiteral RID_SVXBMP_RADIOBUTTON = u"res/sx10595.png";
+inline constexpr OUStringLiteral RID_SVXBMP_CHECKBOX = u"res/sx10596.png";
+inline constexpr OUStringLiteral RID_SVXBMP_FIXEDTEXT = u"res/sx10597.png";
+inline constexpr OUStringLiteral RID_S

[Libreoffice-commits] core.git: framework/inc framework/source include/framework solenv/clang-format

2020-02-07 Thread Noel Grandin (via logerrit)
 framework/inc/addonmenu.hxx   |5 +
 framework/inc/menuconfiguration.hxx   |5 +
 framework/inc/statusbarconfiguration.hxx  |5 +
 framework/inc/toolboxconfiguration.hxx|5 +
 framework/inc/xml/statusbardocumenthandler.hxx|2 +-
 framework/inc/xml/toolboxdocumenthandler.hxx  |2 +-
 framework/source/fwe/classes/addonmenu.cxx|4 ++--
 framework/source/fwe/helper/configimporter.cxx|2 +-
 framework/source/fwe/xml/menuconfiguration.cxx|4 ++--
 framework/source/fwe/xml/statusbarconfiguration.cxx   |2 +-
 framework/source/fwe/xml/toolboxconfiguration.cxx |2 +-
 framework/source/uiconfiguration/moduleuiconfigurationmanager.cxx |6 +++---
 framework/source/uiconfiguration/uiconfigurationmanager.cxx   |6 +++---
 framework/source/uielement/menubarmanager.cxx |4 ++--
 framework/source/uielement/newmenucontroller.cxx  |2 +-
 framework/source/uielement/popuptoolbarcontroller.cxx |2 +-
 solenv/clang-format/blacklist |8 

 17 files changed, 27 insertions(+), 39 deletions(-)

New commits:
commit 0d43023ed4bc14207b9ba15367b123f2af739d1b
Author: Noel Grandin 
AuthorDate: Fri Feb 7 15:48:46 2020 +0200
Commit: Noel Grandin 
CommitDate: Sat Feb 8 07:41:31 2020 +0100

move some headers inside framework

Change-Id: Ia005938c6a3a954eba910981dde5010a1f977fca
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/88201
Tested-by: Jenkins
Reviewed-by: Noel Grandin 

diff --git a/include/framework/addonmenu.hxx b/framework/inc/addonmenu.hxx
similarity index 96%
rename from include/framework/addonmenu.hxx
rename to framework/inc/addonmenu.hxx
index 4e8c1f24f9d8..45d8d0948c89 100644
--- a/include/framework/addonmenu.hxx
+++ b/framework/inc/addonmenu.hxx
@@ -16,8 +16,7 @@
  *   except in compliance with the License. You may obtain a copy of
  *   the License at http://www.apache.org/licenses/LICENSE-2.0 .
  */
-#ifndef INCLUDED_FRAMEWORK_ADDONMENU_HXX
-#define INCLUDED_FRAMEWORK_ADDONMENU_HXX
+#pragma once
 
 #include 
 #include 
@@ -81,6 +80,4 @@ class FWE_DLLPUBLIC AddonMenuManager
 
 } // namespace framework
 
-#endif // INCLUDED_FRAMEWORK_ADDONMENU_HXX
-
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/framework/menuconfiguration.hxx 
b/framework/inc/menuconfiguration.hxx
similarity index 96%
rename from include/framework/menuconfiguration.hxx
rename to framework/inc/menuconfiguration.hxx
index b1a49249061b..312608a7ecc9 100644
--- a/include/framework/menuconfiguration.hxx
+++ b/framework/inc/menuconfiguration.hxx
@@ -17,8 +17,7 @@
  *   the License at http://www.apache.org/licenses/LICENSE-2.0 .
  */
 
-#ifndef INCLUDED_FRAMEWORK_MENUCONFIGURATION_HXX
-#define INCLUDED_FRAMEWORK_MENUCONFIGURATION_HXX
+#pragma once
 
 #include 
 
@@ -105,6 +104,4 @@ private:
 
 }
 
-#endif // INCLUDED_FRAMEWORK_MENUCONFIGURATION_HXX
-
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/framework/statusbarconfiguration.hxx 
b/framework/inc/statusbarconfiguration.hxx
similarity index 92%
rename from include/framework/statusbarconfiguration.hxx
rename to framework/inc/statusbarconfiguration.hxx
index ff201cfee448..b4d8ceecfc4c 100644
--- a/include/framework/statusbarconfiguration.hxx
+++ b/framework/inc/statusbarconfiguration.hxx
@@ -16,8 +16,7 @@
  *   except in compliance with the License. You may obtain a copy of
  *   the License at http://www.apache.org/licenses/LICENSE-2.0 .
  */
-#ifndef INCLUDED_FRAMEWORK_STATUSBARCONFIGURATION_HXX
-#define INCLUDED_FRAMEWORK_STATUSBARCONFIGURATION_HXX
+#pragma once
 
 #include 
 
@@ -47,6 +46,4 @@ class FWE_DLLPUBLIC StatusBarConfiguration
 
 } // namespace framework
 
-#endif // INCLUDED_FRAMEWORK_STATUSBARCONFIGURATION_HXX
-
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/framework/toolboxconfiguration.hxx 
b/framework/inc/toolboxconfiguration.hxx
similarity index 92%
rename from include/framework/toolboxconfiguration.hxx
rename to framework/inc/toolboxconfiguration.hxx
index 2362bcc60aba..a0a04ccaceba 100644
--- a/include/framework/toolboxconfiguration.hxx
+++ b/framework/inc/toolboxconfiguration.hxx
@@ -16,8 +16,7 @@
  *   except in compliance with the License. You may obtain a copy of
  *   the License at http://www.apache.org/licenses/LICENSE-2.0 .
  */
-#ifndef INCLUDED_FRAMEWORK_TOOLBOXCONFIGURATION_HXX
-#define INCLUDED_FRAMEWORK_TOOLBOXCONFIGURATION_HXX
+#pragma once
 
 #include 
 
@@ -47,6 +46,4 @@ class FWE_DLLPUBLIC ToolBoxConfiguration
 
 } // namespace framework
 
-#endif // INCLUDED_FRAMEWORK_TOOLBOXCONFIGURATION_HXX
-
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --gi

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

2016-11-03 Thread Samuel Mehrbrodt
 framework/inc/classes/resource.hrc  |1 +
 framework/source/classes/resource.src   |5 +
 framework/source/fwe/helper/titlehelper.cxx |8 
 include/framework/titlehelper.hxx   |1 +
 4 files changed, 15 insertions(+)

New commits:
commit 291d8d4f9460f8d5292cab2ef706fd8b501641b4
Author: Samuel Mehrbrodt 
Date:   Thu Nov 3 09:26:02 2016 +0100

SafeMode: Add indicator to window title when in Safe Mode

Change-Id: I1d8350315768093b4c4af1cd8b732602c5217edb
Reviewed-on: https://gerrit.libreoffice.org/30518
Tested-by: Jenkins 
Reviewed-by: Samuel Mehrbrodt 

diff --git a/framework/inc/classes/resource.hrc 
b/framework/inc/classes/resource.hrc
index 49c051c..f3ad7e6 100644
--- a/framework/inc/classes/resource.hrc
+++ b/framework/inc/classes/resource.hrc
@@ -51,6 +51,7 @@
 #define STR_CLEAR_RECENT_FILES_HELP (RID_STR_START+24)
 #define STR_LANGSTATUS_HINT (RID_STR_START+25)
 #define STR_REMOTE_TITLE(RID_STR_START+26)
+#define STR_SAFEMODE_TITLE  (RID_STR_START+27)
 
 #define IMG_SAVEMODIFIED_SMALL  (RID_IMAGE_START+0)
 #define IMG_SAVEMODIFIED_LARGE  (RID_IMAGE_START+1)
diff --git a/framework/source/classes/resource.src 
b/framework/source/classes/resource.src
index dd5d877..a95149f 100644
--- a/framework/source/classes/resource.src
+++ b/framework/source/classes/resource.src
@@ -118,6 +118,11 @@ String STR_REMOTE_TITLE
 Text [ en-US ] = " (Remote)";
 };
 
+String STR_SAFEMODE_TITLE
+{
+Text [ en-US ] = " (Safe Mode)";
+};
+
 String STR_TOOLBAR_TITLE_ADDON
 {
 Text [ en-US ] = "Add-On %num%";
diff --git a/framework/source/fwe/helper/titlehelper.cxx 
b/framework/source/fwe/helper/titlehelper.cxx
index cbd18f9..1e7e797 100644
--- a/framework/source/fwe/helper/titlehelper.cxx
+++ b/framework/source/fwe/helper/titlehelper.cxx
@@ -37,6 +37,7 @@
 #include 
 #include 
 #include 
+#include 
 
 namespace framework{
 
@@ -492,6 +493,7 @@ void TitleHelper::impl_updateTitleForFrame (const 
css::uno::Reference< css::fram
 impl_appendModuleName   (sTitle);
 impl_appendDebugVersion (sTitle);
 #endif
+impl_appendSafeMode (sTitle);
 // SYNCHRONIZED ->
 aLock.reset ();
 
@@ -579,6 +581,12 @@ void TitleHelper::impl_appendDebugVersion (OUStringBuffer&)
 }
 #endif
 
+void TitleHelper::impl_appendSafeMode (OUStringBuffer& sTitle)
+{
+if (Application::IsSafeModeEnabled())
+sTitle.append(FwkResId (STR_SAFEMODE_TITLE));
+}
+
 void TitleHelper::impl_startListeningForModel (const css::uno::Reference< 
css::frame::XModel >& xModel)
 {
 css::uno::Reference< css::document::XDocumentEventBroadcaster > 
xBroadcaster(xModel, css::uno::UNO_QUERY);
diff --git a/include/framework/titlehelper.hxx 
b/include/framework/titlehelper.hxx
index 48c05c9..5fe23b7 100644
--- a/include/framework/titlehelper.hxx
+++ b/include/framework/titlehelper.hxx
@@ -160,6 +160,7 @@ class FWE_DLLPUBLIC TitleHelper : private ::cppu::BaseMutex
 void impl_appendProductName (OUStringBuffer& sTitle);
 void impl_appendModuleName (OUStringBuffer& sTitle);
 void impl_appendDebugVersion (OUStringBuffer& sTitle);
+void impl_appendSafeMode (OUStringBuffer& sTitle);
 
 void impl_setSubTitle (const css::uno::Reference< css::frame::XTitle 
>& xSubTitle);
 
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: framework/inc framework/source include/framework solenv/gbuild

2015-11-03 Thread Maxim Monastirsky
 framework/inc/xml/menudocumenthandler.hxx |7 -
 framework/source/fwe/xml/menuconfiguration.cxx|4 
 framework/source/fwe/xml/menudocumenthandler.cxx  |   55 
++
 framework/source/uiconfiguration/moduleuiconfigurationmanager.cxx |   13 +-
 framework/source/uiconfiguration/uiconfigurationmanager.cxx   |   10 -
 include/framework/menuconfiguration.hxx   |3 
 solenv/gbuild/UIConfig.mk |   18 +++
 7 files changed, 76 insertions(+), 34 deletions(-)

New commits:
commit 0c6305a01f13f5c09dc4c000d5b250319fffe0e4
Author: Maxim Monastirsky 
Date:   Tue Nov 3 18:33:43 2015 +0200

Support of popupmenu resource type

Reusing the same xml format as the menubar, except that
a popup menu use menu:menupopup as the root element.

Change-Id: I2987af0dc698b09aeeb757cff828617515bc3009

diff --git a/framework/inc/xml/menudocumenthandler.hxx 
b/framework/inc/xml/menudocumenthandler.hxx
index 087836f..58df5bb 100644
--- a/framework/inc/xml/menudocumenthandler.hxx
+++ b/framework/inc/xml/menudocumenthandler.hxx
@@ -127,7 +127,8 @@ class FWE_DLLPUBLIC OReadMenuDocumentHandler : public 
ReadMenuDocumentHandlerBas
 
 private:
   int   m_nElementDepth;
-  bool  m_bMenuBarMode;
+  enum class ReaderMode { None, MenuBar, MenuPopup };
+  ReaderMode m_eReaderMode;
   css::uno::Reference< css::container::XIndexContainer > 
m_xMenuBarContainer;
   css::uno::Reference< css::lang::XSingleComponentFactory > 
m_xContainerFactory;
 };  // OReadMenuDocumentHandler
@@ -254,7 +255,8 @@ class FWE_DLLPUBLIC OWriteMenuDocumentHandler
 public:
 OWriteMenuDocumentHandler(
 const css::uno::Reference< css::container::XIndexAccess >& 
rMenuBarContainer,
-const css::uno::Reference< css::xml::sax::XDocumentHandler >& 
rDocumentHandler );
+const css::uno::Reference< css::xml::sax::XDocumentHandler >& 
rDocumentHandler,
+bool bIsMenuBar );
 virtual ~OWriteMenuDocumentHandler();
 
 void WriteMenuDocument() throw
@@ -270,6 +272,7 @@ class FWE_DLLPUBLIC OWriteMenuDocumentHandler
 css::uno::Reference< css::xml::sax::XDocumentHandler > 
m_xWriteDocumentHandler;
 css::uno::Reference< css::xml::sax::XAttributeList > m_xEmptyList;
 OUString m_aAttributeType;
+bool m_bIsMenuBar;
 };
 
 } // namespace framework
diff --git a/framework/source/fwe/xml/menuconfiguration.cxx 
b/framework/source/fwe/xml/menuconfiguration.cxx
index b2b378e..417bb05 100644
--- a/framework/source/fwe/xml/menuconfiguration.cxx
+++ b/framework/source/fwe/xml/menuconfiguration.cxx
@@ -114,7 +114,7 @@ PopupMenu* 
MenuConfiguration::CreateBookmarkMenu(css::uno::Reference& rMenuBarConfiguration,
-Reference< XOutputStream >& rOutputStream )
+Reference< XOutputStream >& rOutputStream, bool bIsMenuBar )
 throw (WrappedTargetException, RuntimeException)
 {
 Reference< XWriter > xWriter = Writer::create(m_xContext);
@@ -122,7 +122,7 @@ void MenuConfiguration::StoreMenuBarConfigurationToXML(
 
 try
 {
-OWriteMenuDocumentHandler aWriteMenuDocumentHandler( 
rMenuBarConfiguration, xWriter );
+OWriteMenuDocumentHandler aWriteMenuDocumentHandler( 
rMenuBarConfiguration, xWriter, bIsMenuBar );
 aWriteMenuDocumentHandler.WriteMenuDocument();
 }
 catch ( const RuntimeException& e )
diff --git a/framework/source/fwe/xml/menudocumenthandler.cxx 
b/framework/source/fwe/xml/menudocumenthandler.cxx
index 24ca38b..2313102 100644
--- a/framework/source/fwe/xml/menudocumenthandler.cxx
+++ b/framework/source/fwe/xml/menudocumenthandler.cxx
@@ -217,7 +217,7 @@ void ReadMenuDocumentHandlerBase::initPropertyCommon(
 OReadMenuDocumentHandler::OReadMenuDocumentHandler(
 const Reference< XIndexContainer >& rMenuBarContainer )
 :   m_nElementDepth( 0 ),
-m_bMenuBarMode( false ),
+m_eReaderMode( ReaderMode::None ),
 m_xMenuBarContainer( rMenuBarContainer ),
 m_xContainerFactory( rMenuBarContainer, UNO_QUERY )
 {
@@ -247,17 +247,24 @@ void SAL_CALL OReadMenuDocumentHandler::startElement(
 const OUString& aName, const Reference< XAttributeList > &xAttrList )
 throw( SAXException, RuntimeException, std::exception )
 {
-if ( m_bMenuBarMode )
+if ( m_eReaderMode != ReaderMode::None )
 {
 ++m_nElementDepth;
 m_xReader->startElement( aName, xAttrList );
 }
-else if ( aName == ELEMENT_MENUBAR )
+else
 {
+if ( aName == ELEMENT_MENUBAR )
+{
+m_eReaderMode = ReaderMode::MenuBar;
+m_xReader.set( new OReadMenuBarHandler( m_xMenuBarContainer, 
m_xContainerFactory ));
+}
+else if ( aName == ELEMENT_MENUPOPUP )
+{
+m_eReaderMode = ReaderMode::MenuPopup;
+m_xReader.set( new OReadMenuPopupHandler( m_xMenuBarContai

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

2015-08-14 Thread Takeshi Abe
 framework/inc/classes/imagewrapper.hxx |4 ++--
 framework/inc/classes/menumanager.hxx  |4 ++--
 framework/inc/dispatch/closedispatcher.hxx |4 ++--
 framework/inc/dispatch/dispatchinformationprovider.hxx |4 ++--
 framework/inc/dispatch/dispatchprovider.hxx|4 ++--
 framework/inc/dispatch/interceptionhelper.hxx  |4 ++--
 framework/inc/dispatch/mailtodispatcher.hxx|4 ++--
 framework/inc/dispatch/menudispatcher.hxx  |4 ++--
 framework/inc/dispatch/oxt_handler.hxx |4 ++--
 framework/inc/dispatch/popupmenudispatcher.hxx |4 ++--
 framework/inc/dispatch/servicehandler.hxx  |4 ++--
 framework/inc/dispatch/startmoduledispatcher.hxx   |4 ++--
 framework/inc/dispatch/systemexec.hxx  |4 ++--
 framework/inc/helper/dockingareadefaultacceptor.hxx|4 ++--
 framework/inc/helper/mischelper.hxx|   10 
+-
 framework/inc/helper/ocomponentaccess.hxx  |4 ++--
 framework/inc/helper/ocomponentenumeration.hxx |4 ++--
 framework/inc/helper/oframes.hxx   |4 ++--
 framework/inc/helper/persistentwindowstate.hxx |4 ++--
 framework/inc/helper/statusindicator.hxx   |4 ++--
 framework/inc/helper/statusindicatorfactory.hxx|4 ++--
 framework/inc/helper/tagwindowasmodified.hxx   |4 ++--
 framework/inc/helper/titlebarupdate.hxx|4 ++--
 framework/inc/helper/uiconfigelementwrapperbase.hxx|4 ++--
 framework/inc/helper/uielementwrapperbase.hxx  |4 ++--
 framework/inc/helper/vclstatusindicator.hxx|4 ++--
 framework/inc/interaction/quietinteraction.hxx |4 ++--
 framework/inc/jobs/helponstartup.hxx   |4 ++--
 framework/inc/jobs/job.hxx |4 ++--
 framework/inc/jobs/shelljob.hxx|4 ++--
 framework/inc/pch/precompiled_fwe.hxx  |2 +-
 framework/inc/pch/precompiled_fwi.hxx  |2 +-
 framework/inc/pch/precompiled_fwk.hxx  |   10 
++
 framework/inc/pch/precompiled_fwl.hxx  |2 +-
 framework/inc/recording/dispatchrecorder.hxx   |4 ++--
 framework/inc/recording/dispatchrecordersupplier.hxx   |4 ++--
 framework/inc/services/desktop.hxx |4 ++--
 framework/inc/services/dispatchhelper.hxx  |4 ++--
 framework/inc/services/layoutmanager.hxx   |4 ++--
 framework/inc/services/mediatypedetectionhelper.hxx|4 ++--
 framework/inc/services/uriabbreviation.hxx |4 ++--
 framework/inc/tabwin/tabwinfactory.hxx |4 ++--
 framework/inc/uiconfiguration/graphicnameaccess.hxx|4 ++--
 framework/inc/uiconfiguration/imagemanager.hxx |4 ++--
 framework/inc/uiconfiguration/moduleimagemanager.hxx   |4 ++--
 framework/inc/uielement/constitemcontainer.hxx |4 ++--
 framework/inc/uielement/itemcontainer.hxx  |4 ++--
 framework/inc/uielement/rootitemcontainer.hxx  |4 ++--
 framework/inc/uielement/statusbaritem.hxx  |4 ++--
 framework/inc/uielement/statusbarmanager.hxx   |4 ++--
 framework/inc/uielement/statusindicatorinterfacewrapper.hxx|4 ++--
 framework/inc/uielement/toolbarmanager.hxx |4 ++--
 framework/inc/uielement/uicommanddescription.hxx   |4 ++--
 framework/inc/uifactory/configurationaccessfactorymanager.hxx  |4 ++--
 framework/inc/uifactory/factoryconfiguration.hxx   |4 ++--
 framework/inc/uifactory/menubarfactory.hxx |4 ++--
 framework/inc/xml/acceleratorconfigurationreader.hxx   |4 ++--
 framework/inc/xml/imagesdocumenthandler.hxx|4 ++--
 framework/inc/xml/menudocumenthandler.hxx  |4 ++--
 framework/inc/xml/saxnamespacefilter.hxx   |4 ++--
 framework/inc/xml/statusbardocumenthandler.hxx |4 ++--
 framework/inc/xml/toolboxdocumenthandler.hxx   |4 ++--
 framework/source/accelerators/

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

2015-07-15 Thread Noel Grandin
 framework/inc/classes/filtercache.hxx  |  201 
--
 framework/inc/classes/filtercachedata.hxx  |  120 -
 framework/inc/classes/menumanager.hxx  |1 
 framework/inc/queries.h|   45 --
 framework/inc/services/layoutmanager.hxx   |9 
 framework/inc/uielement/menubarmanager.hxx |3 
 framework/inc/uielement/menubarwrapper.hxx |1 
 framework/inc/xml/statusbardocumenthandler.hxx |   15 
 framework/inc/xml/toolboxdocumenthandler.hxx   |9 
 framework/source/inc/accelerators/acceleratorconfiguration.hxx |   27 -
 framework/source/inc/loadenv/actionlockguard.hxx   |   11 
 framework/source/inc/loadenv/loadenv.hxx   |   13 
 framework/source/layoutmanager/layoutmanager.cxx   |1 
 framework/source/layoutmanager/toolbarlayoutmanager.hxx|2 
 include/framework/addonmenu.hxx|4 
 include/framework/addonsoptions.hxx|9 
 include/framework/menuconfiguration.hxx|8 
 include/framework/titlehelper.hxx  |1 
 18 files changed, 10 insertions(+), 470 deletions(-)

New commits:
commit 269bf161e6904f33dda21e319982bfb119f24592
Author: Noel Grandin 
Date:   Tue Jul 14 15:55:09 2015 +0200

loplugin:unusedmethods framework

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

diff --git a/framework/inc/classes/filtercache.hxx 
b/framework/inc/classes/filtercache.hxx
index f194385..f8f1da2 100644
--- a/framework/inc/classes/filtercache.hxx
+++ b/framework/inc/classes/filtercache.hxx
@@ -79,207 +79,6 @@ class FilterCache   :   private TransactionBase
 
 virtual ~FilterCache();
 
-void flush( DataContainer::ECFGType eType );
-
-
/*-
-@short  get the current state of the cache
-@descr  Call this methods to get information about the state 
of the current cache.
-
*//*-*/
-
-bool isValidOrRepairable() const;
-bool hasTypes   () const;
-bool hasFilters () const;
-bool hasDetectors   () const;
-bool hasLoaders () const;
-bool hasContentHandlers () const;
-
-
/*-
-@short  search routines to find items which match given 
parameter
-@descr  Mostly we search for a type first and get all 
information about filter, detector and loader
-services from the other configuration tables which are 
registered for this type.
-These operations support a FindFirst/Next mechanism.
-If you call search...( ... nStartEntry=0 ... ) we 
search for
-the first entry. If these return a value different 
from  you can work with these value.
-If found value isn't the right one - you can call 
search method again.
-DONT'T CHANGE THE VALUE OF "rStartEntry" between two 
search calls!
-You can use returned value as parameter for 
getBy...Name() functions of this implementation too!
-
-@attention  returned type name is an internal name
-returned filter name is an internal name
-returned loader name is an implementation name of a 
service
-returned detector name is an implementation name of a 
service
-@param  "sResult", name of found type, filter, ...
-@return true, if search was successful,
-false, otherwise.
-
-@onerrorWe return false.
-
*//*-*/
-
-bool searchType (   const   OUString&
sURL,
-const   OUString&
sMediaType  ,
-const   OUString&
sClipboardFormat,
-CheckedTypeIterator&   
 aStartEntry ,
-OUString&
sResult ) const;
-
-bool searchFilterForType(   const   OUString&
sInternalTypeName 

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

2015-02-04 Thread Caolán McNamara
 framework/inc/uielement/newmenucontroller.hxx|4 --
 framework/source/fwe/classes/addonmenu.cxx   |6 +--
 framework/source/fwe/classes/bmkmenu.cxx |4 +-
 framework/source/fwe/xml/menuconfiguration.cxx   |   22 ++
 framework/source/uielement/menubarmanager.cxx|5 +--
 framework/source/uielement/newmenucontroller.cxx |   31 ++-
 include/framework/menuconfiguration.hxx  |   36 +++
 include/vcl/menu.hxx |6 ++-
 vcl/source/window/menu.cxx   |   11 +--
 vcl/source/window/menuitemlist.cxx   |2 +
 vcl/source/window/menuitemlist.hxx   |5 ++-
 11 files changed, 92 insertions(+), 40 deletions(-)

New commits:
commit 4904180247c0d5745a393e3cd57eaae29f3837e5
Author: Caolán McNamara 
Date:   Wed Feb 4 14:02:41 2015 +

fix leak from framework::AddonMenuManager::BuildMenu

provide a callback when a menu item gets deleted

Change-Id: I5b5f1a181fb10f53f6b1fe7b5637d385e1517530

diff --git a/framework/inc/uielement/newmenucontroller.hxx 
b/framework/inc/uielement/newmenucontroller.hxx
index ad802fa..a86d5ad 100644
--- a/framework/inc/uielement/newmenucontroller.hxx
+++ b/framework/inc/uielement/newmenucontroller.hxx
@@ -81,9 +81,6 @@ namespace framework
 
 private:
 virtual void impl_setPopupMenu() SAL_OVERRIDE;
-typedef MenuConfiguration::Attributes AddInfo;
-
-typedef std::unordered_map< int, std::unique_ptr > 
AddInfoForId;
 
 void fillPopupMenu( com::sun::star::uno::Reference< 
com::sun::star::awt::XPopupMenu >& rPopupMenu );
 void retrieveShortcutsFromConfiguration( const 
::com::sun::star::uno::Reference< 
::com::sun::star::ui::XAcceleratorConfiguration >& rAccelCfg,
@@ -99,7 +96,6 @@ namespace framework
 m_bNewMenu: 1,
 m_bModuleIdentified : 1,
 m_bAcceleratorCfg : 1;
-AddInfoForIdm_aAddInfoForItem;
 OUString   m_aTargetFrame;
 OUString   m_aModuleIdentifier;
 OUString   m_aEmptyDocURL;
diff --git a/framework/source/fwe/classes/addonmenu.cxx 
b/framework/source/fwe/classes/addonmenu.cxx
index 460104a..54c1fa9 100644
--- a/framework/source/fwe/classes/addonmenu.cxx
+++ b/framework/source/fwe/classes/addonmenu.cxx
@@ -58,10 +58,7 @@ AddonMenu::~AddonMenu()
 {
 if ( GetItemType( i ) != MenuItemType::SEPARATOR )
 {
-// delete user attributes created with new!
 sal_uInt16 nId = GetItemId( i );
-MenuConfiguration::Attributes* pUserAttributes = 
reinterpret_cast(GetUserValue( nId ));
-delete pUserAttributes;
 delete GetPopupMenu( nId );
 }
 }
@@ -333,7 +330,8 @@ void AddonMenuManager::BuildMenu( PopupMenu*
pCurrent
 
 // Store values from configuration to the New and Wizard menu 
entries to enable
 // sfx2 based code to support high contrast mode correctly!
-pCurrentMenu->SetUserValue( nId, sal_uIntPtr( new 
MenuConfiguration::Attributes( aTarget, aImageId )) );
+sal_uIntPtr nAttributePtr = 
MenuConfiguration::Attributes::CreateAttribute(aTarget, aImageId);
+pCurrentMenu->SetUserValue(nId, nAttributePtr, 
MenuConfiguration::Attributes::ReleaseAttribute);
 pCurrentMenu->SetItemCommand( nId, aURL );
 
 if ( pSubMenu )
diff --git a/framework/source/fwe/classes/bmkmenu.cxx 
b/framework/source/fwe/classes/bmkmenu.cxx
index bf1396b..a3f4290 100644
--- a/framework/source/fwe/classes/bmkmenu.cxx
+++ b/framework/source/fwe/classes/bmkmenu.cxx
@@ -164,8 +164,8 @@ void BmkMenu::Initialize()
 else
 InsertItem( nId, aTitle );
 
-MenuConfiguration::Attributes* pUserAttributes = new 
MenuConfiguration::Attributes( aTargetFrame, aImageId );
-SetUserValue( nId, reinterpret_cast(pUserAttributes) 
);
+sal_uIntPtr nAttributePtr = 
MenuConfiguration::Attributes::CreateAttribute(aTargetFrame, aImageId);
+SetUserValue(nId, nAttributePtr, 
MenuConfiguration::Attributes::ReleaseAttribute);
 
 SetItemCommand( nId, aURL );
 }
diff --git a/framework/source/fwe/xml/menuconfiguration.cxx 
b/framework/source/fwe/xml/menuconfiguration.cxx
index 8eb6a6d..aabbc47 100644
--- a/framework/source/fwe/xml/menuconfiguration.cxx
+++ b/framework/source/fwe/xml/menuconfiguration.cxx
@@ -139,6 +139,28 @@ void MenuConfiguration::StoreMenuBarConfigurationToXML(
 }
 }
 
+sal_uIntPtr MenuConfiguration::Attributes::CreateAttribute(const OUString& 
rFrame, const OUString& rImageIdStr)
+{
+Attributes* pAttributes = new Attributes(rFrame, rImageIdStr);
+pAttributes->acquire();
+return reinterpret_cast(pAttributes);
+}
+
+sal_uIntPtr Me