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

2023-05-07 Thread Julien Nabet (via logerrit)
 framework/inc/taskcreatordefs.hxx|5 +
 framework/source/classes/taskcreator.cxx |2 +-
 framework/source/services/taskcreatorsrv.cxx |2 +-
 3 files changed, 7 insertions(+), 2 deletions(-)

New commits:
commit 5152841ad0c9e3307285b809b7432bee3df78471
Author: Julien Nabet 
AuthorDate: Sun May 7 19:24:25 2023 +0200
Commit: Noel Grandin 
CommitDate: Sun May 7 22:15:41 2023 +0200

framework/taskcreator: declare ARGUMENT_HIDDENFORCONVERSION and use it

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

diff --git a/framework/inc/taskcreatordefs.hxx 
b/framework/inc/taskcreatordefs.hxx
index d4cdcb13189c..c4036e08dc19 100644
--- a/framework/inc/taskcreatordefs.hxx
+++ b/framework/inc/taskcreatordefs.hxx
@@ -55,4 +55,9 @@ inline constexpr OUStringLiteral 
ARGUMENT_SUPPORTPERSISTENTWINDOWSTATE
  */
 inline constexpr OUStringLiteral ARGUMENT_ENABLE_TITLEBARUPDATE = 
u"EnableTitleBarUpdate"; // bool
 
+/** [bool] enable/disable if the frame is explicitly requested to be hidden
+   Default = OFF !
+ */
+inline constexpr OUStringLiteral ARGUMENT_HIDDENFORCONVERSION = 
u"HiddenForConversion"; // bool
+
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/framework/source/classes/taskcreator.cxx 
b/framework/source/classes/taskcreator.cxx
index 1372dfeb7c1b..f84bcb711467 100644
--- a/framework/source/classes/taskcreator.cxx
+++ b/framework/source/classes/taskcreator.cxx
@@ -78,7 +78,7 @@ css::uno::Reference< css::frame::XFrame > 
TaskCreator::createTask( const OUStrin
 css::uno::Any(css::beans::NamedValue(ARGUMENT_MAKEVISIBLE, 
css::uno::Any(false))),
 
css::uno::Any(css::beans::NamedValue(ARGUMENT_SUPPORTPERSISTENTWINDOWSTATE, 
css::uno::Any(true))),
 css::uno::Any(css::beans::NamedValue(ARGUMENT_FRAMENAME, 
css::uno::Any(sName))),
-css::uno::Any(css::beans::NamedValue("HiddenForConversion", 
css::uno::Any(rDescriptor.getUnpackedValueOrDefault("HiddenForConversion", 
false
+css::uno::Any(css::beans::NamedValue(ARGUMENT_HIDDENFORCONVERSION, 
css::uno::Any(rDescriptor.getUnpackedValueOrDefault(ARGUMENT_HIDDENFORCONVERSION,
 false
 };
 css::uno::Reference< css::frame::XFrame > 
xTask(xCreator->createInstanceWithArguments(lArgs), css::uno::UNO_QUERY_THROW);
 return xTask;
diff --git a/framework/source/services/taskcreatorsrv.cxx 
b/framework/source/services/taskcreatorsrv.cxx
index 0d09e30cf572..a4db7856d30a 100644
--- a/framework/source/services/taskcreatorsrv.cxx
+++ b/framework/source/services/taskcreatorsrv.cxx
@@ -128,7 +128,7 @@ css::uno::Reference< css::uno::XInterface > SAL_CALL 
TaskCreatorService::createI
 bool  bSupportPersistentWindowState = 
lArgs.getUnpackedValueOrDefault(ARGUMENT_SUPPORTPERSISTENTWINDOWSTATE , false );
 bool  bEnableTitleBarUpdate = 
lArgs.getUnpackedValueOrDefault(ARGUMENT_ENABLE_TITLEBARUPDATE, true );
 // If the frame is explicitly requested to be hidden.
-bool bHidden = lArgs.getUnpackedValueOrDefault("HiddenForConversion", 
false);
+bool bHidden = 
lArgs.getUnpackedValueOrDefault(ARGUMENT_HIDDENFORCONVERSION, false);
 
 // We use FrameName property to set it as API name of the new created 
frame later.
 // But those frame names must be different from the set of special target 
names as e.g. _blank, _self etcpp !


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

2023-05-07 Thread Julien Nabet (via logerrit)
 framework/inc/taskcreatordefs.hxx |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit 9f878c69f3da944261989d59f46bd26cc61b0fe1
Author: Julien Nabet 
AuthorDate: Sun May 7 19:17:00 2023 +0200
Commit: Julien Nabet 
CommitDate: Sun May 7 19:17:43 2023 +0200

framework/inc/taskcreatordefs.hxx: these are bool and not sal_Bool (2)

Thank you Mike for having spotted it! :-)

Change-Id: I210edf2e05eb6ba02ac9cdd999c4f2233819cfa4
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/151476
Tested-by: Julien Nabet 
Reviewed-by: Julien Nabet 

diff --git a/framework/inc/taskcreatordefs.hxx 
b/framework/inc/taskcreatordefs.hxx
index b7a223527d4f..d4cdcb13189c 100644
--- a/framework/inc/taskcreatordefs.hxx
+++ b/framework/inc/taskcreatordefs.hxx
@@ -29,7 +29,7 @@ inline constexpr OUStringLiteral ARGUMENT_PARENTFRAME = 
u"ParentFrame"; // XFram
  */
 inline constexpr OUStringLiteral ARGUMENT_FRAMENAME = u"FrameName"; // OUString
 
-/// [bool] If it's set to sal_True we will make the new created frame visible.
+/// [bool] If it's set to true we will make the new created frame visible.
 inline constexpr OUStringLiteral ARGUMENT_MAKEVISIBLE = u"MakeVisible"; // bool
 
 /** [bool] If not "ContainerWindow" property is set it force creation of a


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

2023-05-07 Thread Julien Nabet (via logerrit)
 framework/inc/taskcreatordefs.hxx |   17 -
 1 file changed, 8 insertions(+), 9 deletions(-)

New commits:
commit 45aa6f7ca99fff8388ade3484f5d5458a84af015
Author: Julien Nabet 
AuthorDate: Sun May 7 18:21:38 2023 +0200
Commit: Julien Nabet 
CommitDate: Sun May 7 18:24:26 2023 +0200

framework/inc/taskcreatordefs.hxx: these are bool and not sal_Bool since 
2014

See a6287e21f1dab6ae382c24ceeb4c0212b7cad2d7 "framework: sal_Bool->bool"

+ /opt/lo/bin/clang-format -i framework/inc/taskcreatordefs.hxx
as requested when submitting patch with logerrit

Change-Id: Icb21563590a4104f3cb678db44fc4b5f1d884764
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/151475
Tested-by: Julien Nabet 
Reviewed-by: Julien Nabet 

diff --git a/framework/inc/taskcreatordefs.hxx 
b/framework/inc/taskcreatordefs.hxx
index 262de19f56fb..b7a223527d4f 100644
--- a/framework/inc/taskcreatordefs.hxx
+++ b/framework/inc/taskcreatordefs.hxx
@@ -29,13 +29,13 @@ inline constexpr OUStringLiteral ARGUMENT_PARENTFRAME = 
u"ParentFrame"; // XFram
  */
 inline constexpr OUStringLiteral ARGUMENT_FRAMENAME = u"FrameName"; // OUString
 
-/// [sal_Bool] If it's set to sal_True we will make the new created frame 
visible.
-inline constexpr OUStringLiteral ARGUMENT_MAKEVISIBLE = u"MakeVisible"; // 
sal_Bool
+/// [bool] If it's set to sal_True we will make the new created frame visible.
+inline constexpr OUStringLiteral ARGUMENT_MAKEVISIBLE = u"MakeVisible"; // bool
 
-/** [sal_Bool] If not "ContainerWindow" property is set it force creation of a
+/** [bool] If not "ContainerWindow" property is set it force creation of a
top level window as new container window.
  */
-inline constexpr OUStringLiteral ARGUMENT_CREATETOPWINDOW = 
u"CreateTopWindow"; // sal_Bool
+inline constexpr OUStringLiteral ARGUMENT_CREATETOPWINDOW = 
u"CreateTopWindow"; // bool
 
 /// [Rectangle] Place the new created frame on this place and resize the 
container window.
 inline constexpr OUStringLiteral ARGUMENT_POSSIZE = u"PosSize"; // Rectangle
@@ -43,17 +43,16 @@ inline constexpr OUStringLiteral ARGUMENT_POSSIZE = 
u"PosSize"; // Rectangle
 /// [XWindow] an outside created window, used as container window of the new 
created frame.
 inline constexpr OUStringLiteral ARGUMENT_CONTAINERWINDOW = 
u"ContainerWindow"; // XWindow
 
-/** [sal_Bool] enable/disable special mode, where this frame will be part of
+/** [bool] enable/disable special mode, where this frame will be part of
the persistent window state feature suitable for any office 
module window
  */
 inline constexpr OUStringLiteral ARGUMENT_SUPPORTPERSISTENTWINDOWSTATE
-= u"SupportPersistentWindowState"; // sal_Bool
+= u"SupportPersistentWindowState"; // bool
 
-/** [sal_Bool] enable/disable special mode, where the title bar of our
+/** [bool] enable/disable special mode, where the title bar of our
the new created frame will be updated automatically.
Default = ON !
  */
-inline constexpr OUStringLiteral ARGUMENT_ENABLE_TITLEBARUPDATE
-= u"EnableTitleBarUpdate"; // sal_Bool
+inline constexpr OUStringLiteral ARGUMENT_ENABLE_TITLEBARUPDATE = 
u"EnableTitleBarUpdate"; // bool
 
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */


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

2023-04-28 Thread Noel Grandin (via logerrit)
 framework/inc/xml/toolboxdocumenthandler.hxx|8 -
 framework/source/fwe/xml/toolboxdocumenthandler.cxx |   27 +---
 2 files changed, 8 insertions(+), 27 deletions(-)

New commits:
commit 601db233f5cc7ee8bcd948681345fa37d5bb1d84
Author: Noel Grandin 
AuthorDate: Thu Apr 27 18:43:39 2023 +0200
Commit: Noel Grandin 
CommitDate: Fri Apr 28 08:24:45 2023 +0200

remove dodgy code in OReadToolBoxDocumentHandler

comparing hashcodes without doing an actual comparison
is not safe.
Code was like this since
commit 6845330a228f7b516425e2dcb0aa5f2cdfaedc85
Author: Carsten Driesner 
Date:   Wed Oct 17 09:57:37 2001 +
#87255# support toolbar item style and help id

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

diff --git a/framework/inc/xml/toolboxdocumenthandler.hxx 
b/framework/inc/xml/toolboxdocumenthandler.hxx
index 721d02936616..f134054267ae 100644
--- a/framework/inc/xml/toolboxdocumenthandler.hxx
+++ b/framework/inc/xml/toolboxdocumenthandler.hxx
@@ -100,14 +100,6 @@ class OReadToolBoxDocumentHandler final : public 
OReadToolBoxDocumentHandler_Bas
 css::uno::Reference< css::container::XIndexContainer >
m_rItemContainer;
 css::uno::Reference< css::xml::sax::XLocator >m_xLocator;
 
-sal_Int32 
m_nHashCode_Style_Radio;
-sal_Int32 
m_nHashCode_Style_Left;
-sal_Int32 
m_nHashCode_Style_AutoSize;
-sal_Int32 
m_nHashCode_Style_DropDown;
-sal_Int32 
m_nHashCode_Style_Repeat;
-sal_Int32 
m_nHashCode_Style_DropDownOnly;
-sal_Int32 
m_nHashCode_Style_Text;
-sal_Int32 
m_nHashCode_Style_Image;
 OUString  m_aType;
 OUString  m_aLabel;
 OUString  m_aStyle;
diff --git a/framework/source/fwe/xml/toolboxdocumenthandler.cxx 
b/framework/source/fwe/xml/toolboxdocumenthandler.cxx
index 595845279d4c..67d67ed308a9 100644
--- a/framework/source/fwe/xml/toolboxdocumenthandler.cxx
+++ b/framework/source/fwe/xml/toolboxdocumenthandler.cxx
@@ -149,16 +149,6 @@ OReadToolBoxDocumentHandler::OReadToolBoxDocumentHandler( 
const Reference< XInde
 }
 }
 
-// pre-calculate a hash code for all style strings to speed up xml read 
process
-m_nHashCode_Style_Radio = OUString( ATTRIBUTE_ITEMSTYLE_RADIO 
).hashCode();
-m_nHashCode_Style_Left  = OUString( ATTRIBUTE_ITEMSTYLE_LEFT 
).hashCode();
-m_nHashCode_Style_AutoSize  = OUString( ATTRIBUTE_ITEMSTYLE_AUTOSIZE 
).hashCode();
-m_nHashCode_Style_DropDown  = OUString( ATTRIBUTE_ITEMSTYLE_DROPDOWN 
).hashCode();
-m_nHashCode_Style_Repeat= OUString( ATTRIBUTE_ITEMSTYLE_REPEAT 
).hashCode();
-m_nHashCode_Style_DropDownOnly  = OUString( 
ATTRIBUTE_ITEMSTYLE_DROPDOWNONLY ).hashCode();
-m_nHashCode_Style_Text  = OUString( ATTRIBUTE_ITEMSTYLE_TEXT 
).hashCode();
-m_nHashCode_Style_Image = OUString( ATTRIBUTE_ITEMSTYLE_IMAGE 
).hashCode();
-
 m_bToolBarStartFound= false;
 m_bToolBarItemStartFound= false;
 m_bToolBarSpaceStartFound   = false;
@@ -310,22 +300,21 @@ void SAL_CALL OReadToolBoxDocumentHandler::startElement(
 OUString aToken  = aTemp.getToken( 0, ' ', 
nIndex );
 if ( !aToken.isEmpty() )
 {
-sal_Int32 nHashCode = aToken.hashCode();
-if ( nHashCode == m_nHashCode_Style_Radio )
+if ( aToken == ATTRIBUTE_ITEMSTYLE_RADIO )
 nItemBits |= 
css::ui::ItemStyle::RADIO_CHECK;
-else if ( nHashCode == 
m_nHashCode_Style_Left )
+else if ( aToken == 
ATTRIBUTE_ITEMSTYLE_LEFT )
 nItemBits |= 
css::ui::ItemStyle::ALIGN_LEFT;
-else if ( nHashCode == 
m_nHashCode_Style_AutoSize )
+else if ( aToken == 
ATTRIBUTE_ITEMSTYLE_AUTOSIZE )
 nItemBits |= 
css::ui::ItemStyle::AUTO_SIZE;
-else if ( nHashCode == 
m_nHashCode_Style_Repeat )
+ 

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

2023-02-22 Thread Noel Grandin (via logerrit)
 framework/inc/uielement/langselectionmenucontroller.hxx|6 
 framework/inc/uielement/newmenucontroller.hxx  |6 
 framework/inc/uielement/toolbarsmenucontroller.hxx |6 
 framework/source/uielement/controlmenucontroller.cxx   |   21 +-
 framework/source/uielement/fontmenucontroller.cxx  |   12 -
 framework/source/uielement/fontsizemenucontroller.cxx  |   12 -
 framework/source/uielement/headermenucontroller.cxx|   12 -
 framework/source/uielement/langselectionmenucontroller.cxx |   14 -
 framework/source/uielement/macrosmenucontroller.cxx|4 
 framework/source/uielement/newmenucontroller.cxx   |   10 -
 framework/source/uielement/objectmenucontroller.cxx|4 
 framework/source/uielement/recentfilesmenucontroller.cxx   |   16 +-
 framework/source/uielement/resourcemenucontroller.cxx  |6 
 framework/source/uielement/toolbarmodemenucontroller.cxx   |   10 -
 framework/source/uielement/toolbarsmenucontroller.cxx  |   19 +-
 include/svtools/popupmenucontrollerbase.hxx|   16 --
 svtools/source/uno/popupmenucontrollerbase.cxx |   96 ++---
 17 files changed, 128 insertions(+), 142 deletions(-)

New commits:
commit 5032262fccd0ef7f274323ae481b3230ffd42d3a
Author: Noel Grandin 
AuthorDate: Tue Feb 21 15:05:37 2023 +0200
Commit: Noel Grandin 
CommitDate: Wed Feb 22 13:24:47 2023 +

BaseMutex->std::mutex in PopupMenuControllerBase

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

diff --git a/framework/inc/uielement/langselectionmenucontroller.hxx 
b/framework/inc/uielement/langselectionmenucontroller.hxx
index c27f42b56431..070054a2f4ac 100644
--- a/framework/inc/uielement/langselectionmenucontroller.hxx
+++ b/framework/inc/uielement/langselectionmenucontroller.hxx
@@ -44,9 +44,6 @@ namespace framework
 // XPopupMenuController
 virtual void SAL_CALL updatePopupMenu() override;
 
-// XInitialization
-virtual void SAL_CALL initialize( const css::uno::Sequence< 
css::uno::Any >& aArguments ) override;
-
 // XStatusListener
 virtual void SAL_CALL statusChanged( const 
css::frame::FeatureStateEvent& Event ) override;
 
@@ -54,6 +51,9 @@ namespace framework
 virtual void SAL_CALL disposing( const css::lang::EventObject& 
Source ) override;
 
 private:
+// XInitialization
+virtual void initializeImpl( std::unique_lock& rGuard, 
const css::uno::Sequence< css::uno::Any >& aArguments ) override;
+
 virtual void impl_setPopupMenu() override;
 enum Mode
 {
diff --git a/framework/inc/uielement/newmenucontroller.hxx 
b/framework/inc/uielement/newmenucontroller.hxx
index 57e58239fc19..45b5e8f88696 100644
--- a/framework/inc/uielement/newmenucontroller.hxx
+++ b/framework/inc/uielement/newmenucontroller.hxx
@@ -40,9 +40,6 @@ namespace framework
 virtual sal_Bool SAL_CALL supportsService( const OUString& 
sServiceName ) override;
 virtual css::uno::Sequence< OUString > SAL_CALL 
getSupportedServiceNames() override;
 
-// XInitialization
-virtual void SAL_CALL initialize( const css::uno::Sequence< 
css::uno::Any >& aArguments ) override;
-
 // XStatusListener
 virtual void SAL_CALL statusChanged( const 
css::frame::FeatureStateEvent& Event ) override;
 
@@ -54,6 +51,9 @@ namespace framework
 virtual void SAL_CALL disposing( const css::lang::EventObject& 
Source ) override;
 
 private:
+// XInitialization
+virtual void initializeImpl( std::unique_lock& rGuard, 
const css::uno::Sequence< css::uno::Any >& aArguments ) override;
+
 virtual void impl_setPopupMenu() override;
 
 void fillPopupMenu( css::uno::Reference< css::awt::XPopupMenu > 
const & rPopupMenu );
diff --git a/framework/inc/uielement/toolbarsmenucontroller.hxx 
b/framework/inc/uielement/toolbarsmenucontroller.hxx
index 99d64775d6b6..48ae2eacd360 100644
--- a/framework/inc/uielement/toolbarsmenucontroller.hxx
+++ b/framework/inc/uielement/toolbarsmenucontroller.hxx
@@ -48,9 +48,6 @@ namespace framework
 // XPopupMenuController
 virtual void SAL_CALL setPopupMenu( const css::uno::Reference< 
css::awt::XPopupMenu >& PopupMenu ) override;
 
-// XInitialization
-virtual void SAL_CALL initialize( const css::uno::Sequence< 
css::uno::Any >& aArguments ) override;
-
 // XStatusListener
 virtual void SAL_CALL statusChanged( const 
css::frame::FeatureStateEvent& Event ) override;
 
@@ -71,6 +68,9 @@ namespace framework
 DECL_STATIC_LINK( ToolbarsMenuController, ExecuteHdl_Impl, void*, 
void );
 
 private:
+// 

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

2023-01-17 Thread Radhey Parekh (via logerrit)
 framework/inc/strings.hrc   |1 +
 framework/source/fwe/helper/titlehelper.cxx |5 -
 2 files changed, 5 insertions(+), 1 deletion(-)

New commits:
commit f7d4efc02118a92a3f3cb17ea131674e88907a7b
Author: Radhey Parekh 
AuthorDate: Mon Jan 16 02:13:53 2023 +0530
Commit: Heiko Tietze 
CommitDate: Tue Jan 17 09:35:31 2023 +

tdf#146638 In a titlebar, separator is changed from a hyphen to an emdash

Change-Id: Ibf79dfd4c3e2f44ba4564567cd5e3f3650095719
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/145542
Tested-by: Jenkins
Reviewed-by: Heiko Tietze 

diff --git a/framework/inc/strings.hrc b/framework/inc/strings.hrc
index 18b372915b9b..182c3cf120ac 100644
--- a/framework/inc/strings.hrc
+++ b/framework/inc/strings.hrc
@@ -36,6 +36,7 @@
 #define STR_CLEAR_RECENT_FILES  
NC_("STR_CLEAR_RECENT_FILES", "Clear List")
 #define STR_CLEAR_RECENT_FILES_HELP 
NC_("STR_CLEAR_RECENT_FILES_HELP", "Clears the list with the most recently 
opened files. This action can not be undone.")
 #define STR_REMOTE_TITLENC_("STR_REMOTE_TITLE", " 
(Remote)")
+#define STR_EMDASH_SEPARATOR
NC_("STR_EMDASH_SEPARATOR", " — ")
 #define STR_SAFEMODE_TITLE  NC_("STR_SAFEMODE_TITLE", 
" (Safe Mode)")
 #define STR_TOOLBAR_TITLE_ADDON 
NC_("STR_TOOLBAR_TITLE_ADDON", "Add-On %num%")
 #define STR_FULL_DISC_RETRY_BUTTON  
NC_("STR_FULL_DISC_RETRY_BUTTON", "Retry" )
diff --git a/framework/source/fwe/helper/titlehelper.cxx 
b/framework/source/fwe/helper/titlehelper.cxx
index aa4e8f0b2010..51025f71e4a5 100644
--- a/framework/source/fwe/helper/titlehelper.cxx
+++ b/framework/source/fwe/helper/titlehelper.cxx
@@ -536,7 +536,10 @@ void TitleHelper::impl_appendProductName (OUStringBuffer& 
sTitle)
 if (!name.isEmpty())
 {
 if (!sTitle.isEmpty())
-sTitle.append(" - ");
+{
+OUString separator (FwkResId (STR_EMDASH_SEPARATOR));
+sTitle.append(separator);
+}
 sTitle.append(name);
 }
 }


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

2023-01-17 Thread Noel Grandin (via logerrit)
 framework/inc/uielement/rootitemcontainer.hxx |8 --
 framework/source/fwi/uielement/rootitemcontainer.cxx  |   12 
--
 framework/source/uiconfiguration/moduleuiconfigurationmanager.cxx |6 ++---
 framework/source/uiconfiguration/uiconfigurationmanager.cxx   |6 ++---
 4 files changed, 7 insertions(+), 25 deletions(-)

New commits:
commit 5ed9bb8bdcb1bee63d89909eed82110da31edfe5
Author: Noel Grandin 
AuthorDate: Mon Jan 16 08:48:06 2023 +0200
Commit: Noel Grandin 
CommitDate: Tue Jan 17 09:03:04 2023 +

XUnoTunnel->dynamic_cast in RootItemContainer

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

diff --git a/framework/inc/uielement/rootitemcontainer.hxx 
b/framework/inc/uielement/rootitemcontainer.hxx
index cdfc82fada3e..159137f0f67e 100644
--- a/framework/inc/uielement/rootitemcontainer.hxx
+++ b/framework/inc/uielement/rootitemcontainer.hxx
@@ -25,7 +25,6 @@
 #include 
 #include 
 #include 
-#include 
 
 #include 
 #include 
@@ -40,8 +39,7 @@ class ConstItemContainer;
 
 typedef ::cppu::WeakImplHelper<
 css::container::XIndexContainer,
-css::lang::XSingleComponentFactory,
-css::lang::XUnoTunnel > RootItemContainer_BASE;
+css::lang::XSingleComponentFactory > RootItemContainer_BASE;
 
 class RootItemContainer final : private cppu::BaseMutex,
 public ::cppu::OBroadcastHelper
 ,
@@ -65,10 +63,6 @@ class RootItemContainer final : private cppu::BaseMutex,
 // XTypeProvider
 virtual css::uno::Sequence< css::uno::Type > SAL_CALL getTypes(  ) 
override;
 
-// XUnoTunnel
-static const css::uno::Sequence< sal_Int8 >&   getUnoTunnelId() 
noexcept;
-sal_Int64   SAL_CALL 
getSomething( const css::uno::Sequence< sal_Int8 >& rIdentifier ) override;
-
 // XIndexContainer
 virtual void SAL_CALL insertByIndex( sal_Int32 Index, const 
css::uno::Any& Element ) override;
 
diff --git a/framework/source/fwi/uielement/rootitemcontainer.cxx 
b/framework/source/fwi/uielement/rootitemcontainer.cxx
index db267f54a658..fdfb6b709c4a 100644
--- a/framework/source/fwi/uielement/rootitemcontainer.cxx
+++ b/framework/source/fwi/uielement/rootitemcontainer.cxx
@@ -138,18 +138,6 @@ Reference< XIndexAccess > 
RootItemContainer::deepCopyContainer( const Reference<
 return xReturn;
 }
 
-// XUnoTunnel
-sal_Int64 RootItemContainer::getSomething( const css::uno::Sequence< sal_Int8 
>& rIdentifier )
-{
-return comphelper::getSomethingImpl(rIdentifier, this);
-}
-
-const Sequence< sal_Int8 >& RootItemContainer::getUnoTunnelId() noexcept
-{
-static const comphelper::UnoIdInit theRootItemContainerUnoTunnelId;
-return theRootItemContainerUnoTunnelId.getSeq();
-}
-
 // XElementAccess
 sal_Bool SAL_CALL RootItemContainer::hasElements()
 {
diff --git a/framework/source/uiconfiguration/moduleuiconfigurationmanager.cxx 
b/framework/source/uiconfiguration/moduleuiconfigurationmanager.cxx
index 235190ac9d0d..a75b84e7457f 100644
--- a/framework/source/uiconfiguration/moduleuiconfigurationmanager.cxx
+++ b/framework/source/uiconfiguration/moduleuiconfigurationmanager.cxx
@@ -429,7 +429,7 @@ void 
ModuleUIConfigurationManager::impl_requestUIElementData( sal_Int16 nElement
 {
 MenuConfiguration aMenuCfg( m_xContext );
 Reference< XIndexAccess > xContainer( 
aMenuCfg.CreateMenuBarConfigurationFromXML( xInputStream ));
-auto pRootItemContainer = 
comphelper::getFromUnoTunnel( xContainer );
+auto pRootItemContainer = 
dynamic_cast( xContainer.get() );
 if ( pRootItemContainer )
 aUIElementData.xSettings = new 
ConstItemContainer( pRootItemContainer, true );
 else
@@ -448,7 +448,7 @@ void 
ModuleUIConfigurationManager::impl_requestUIElementData( sal_Int16 nElement
 {
 Reference< XIndexContainer > xIndexContainer( new 
RootItemContainer() );
 ToolBoxConfiguration::LoadToolBox( m_xContext, 
xInputStream, xIndexContainer );
-auto pRootItemContainer = 
comphelper::getFromUnoTunnel( xIndexContainer );
+auto pRootItemContainer = 
dynamic_cast( xIndexContainer.get() );
 aUIElementData.xSettings = new ConstItemContainer( 
pRootItemContainer, true );
 return;
 }
@@ -465,7 +465,7 @@ void 
ModuleUIConfigurationManager::impl_requestUIElementData( sal_Int16 nElement
 {
 

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

2023-01-16 Thread Noel Grandin (via logerrit)
 framework/inc/uielement/constitemcontainer.hxx|6 --
 framework/inc/uielement/itemcontainer.hxx |3 ---
 framework/source/fwi/uielement/constitemcontainer.cxx |   14 +-
 framework/source/fwi/uielement/itemcontainer.cxx  |8 +---
 framework/source/fwi/uielement/rootitemcontainer.cxx  |2 +-
 5 files changed, 3 insertions(+), 30 deletions(-)

New commits:
commit 81fd038c81e5ebbb8a52d9b2fbdca1fd48f445e3
Author: Noel Grandin 
AuthorDate: Sat Jan 14 12:51:03 2023 +0200
Commit: Noel Grandin 
CommitDate: Tue Jan 17 07:48:50 2023 +

XUnoTunnel->dynamic_cast in ConstItemContainer

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

diff --git a/framework/inc/uielement/constitemcontainer.hxx 
b/framework/inc/uielement/constitemcontainer.hxx
index e25edc57fc7a..2cec0b9a3017 100644
--- a/framework/inc/uielement/constitemcontainer.hxx
+++ b/framework/inc/uielement/constitemcontainer.hxx
@@ -23,7 +23,6 @@
 #include 
 #include 
 #include 
-#include 
 
 #include 
 #include 
@@ -38,7 +37,6 @@ class RootItemContainer;
 class ItemContainer;
 class ConstItemContainer final : public ::cppu::WeakImplHelper<
 
css::container::XIndexAccess,
-css::lang::XUnoTunnel  
 ,
 
css::beans::XFastPropertySet,
 css::beans::XPropertySet >
 {
@@ -51,10 +49,6 @@ class ConstItemContainer final : public 
::cppu::WeakImplHelper<
 ConstItemContainer( const css::uno::Reference< 
css::container::XIndexAccess >& rSourceContainer, bool bFastCopy = false );
 virtual ~ConstItemContainer() override;
 
-// XUnoTunnel
-static const css::uno::Sequence< sal_Int8 >&   getUnoTunnelId() 
noexcept;
-sal_Int64   SAL_CALL 
getSomething( const css::uno::Sequence< sal_Int8 >& rIdentifier ) override;
-
 // XIndexAccess
 virtual sal_Int32 SAL_CALL getCount() override;
 
diff --git a/framework/inc/uielement/itemcontainer.hxx 
b/framework/inc/uielement/itemcontainer.hxx
index 5d5bc9c85c41..927beea584af 100644
--- a/framework/inc/uielement/itemcontainer.hxx
+++ b/framework/inc/uielement/itemcontainer.hxx
@@ -43,9 +43,6 @@ class ItemContainer final : public ::cppu::WeakImplHelper< 
css::container::XInde
 
 //  XInterface, XTypeProvider
 
-// XUnoTunnel
-static const css::uno::Sequence< sal_Int8 >&   getUnoTunnelId() 
noexcept;
-
 // XIndexContainer
 virtual void SAL_CALL insertByIndex( sal_Int32 Index, const 
css::uno::Any& Element ) override;
 
diff --git a/framework/source/fwi/uielement/constitemcontainer.cxx 
b/framework/source/fwi/uielement/constitemcontainer.cxx
index 7e43a5009c36..cab82acd870c 100644
--- a/framework/source/fwi/uielement/constitemcontainer.cxx
+++ b/framework/source/fwi/uielement/constitemcontainer.cxx
@@ -147,7 +147,7 @@ Reference< XIndexAccess > 
ConstItemContainer::deepCopyContainer( const Reference
 Reference< XIndexAccess > xReturn;
 if ( rSubContainer.is() )
 {
-ItemContainer*  pSource = 
comphelper::getFromUnoTunnel( rSubContainer );
+ItemContainer* pSource = dynamic_cast( 
rSubContainer.get() );
 rtl::Reference pSubContainer;
 if ( pSource )
 pSubContainer = new ConstItemContainer( *pSource );
@@ -159,18 +159,6 @@ Reference< XIndexAccess > 
ConstItemContainer::deepCopyContainer( const Reference
 return xReturn;
 }
 
-// XUnoTunnel
-sal_Int64 ConstItemContainer::getSomething( const css::uno::Sequence< sal_Int8 
>& rIdentifier )
-{
-return comphelper::getSomethingImpl(rIdentifier, this);
-}
-
-const Sequence< sal_Int8 >& ConstItemContainer::getUnoTunnelId() noexcept
-{
-static const comphelper::UnoIdInit theConstItemContainerUnoTunnelId;
-return theConstItemContainerUnoTunnelId.getSeq();
-}
-
 // XElementAccess
 sal_Bool SAL_CALL ConstItemContainer::hasElements()
 {
diff --git a/framework/source/fwi/uielement/itemcontainer.cxx 
b/framework/source/fwi/uielement/itemcontainer.cxx
index 389bbaeaaf9d..bc0116b2f3f7 100644
--- a/framework/source/fwi/uielement/itemcontainer.cxx
+++ b/framework/source/fwi/uielement/itemcontainer.cxx
@@ -122,7 +122,7 @@ Reference< XIndexAccess > ItemContainer::deepCopyContainer( 
const Reference< XIn
 Reference< XIndexAccess > xReturn;
 if ( rSubContainer.is() )
 {
-ConstItemContainer* pSource = 
comphelper::getFromUnoTunnel( rSubContainer );
+ConstItemContainer* pSource = dynamic_cast( 
rSubContainer.get() );
 rtl::Reference pSubContainer;
 if ( pSource )
 pSubContainer = new ItemContainer( *pSource, rMutex );
@@ -134,12 +134,6 @@ Reference< 

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

2022-12-16 Thread Stephan Bergmann (via logerrit)
 framework/inc/dispatch/interceptionhelper.hxx   |9 ++---
 framework/source/dispatch/interceptionhelper.cxx|3 ++-
 framework/source/services/ContextChangeEventMultiplexer.cxx |1 +
 framework/source/services/frame.cxx |3 +--
 4 files changed, 10 insertions(+), 6 deletions(-)

New commits:
commit 60a96f41f0d050ec05bfcb337edf3717689adacb
Author: Stephan Bergmann 
AuthorDate: Wed Dec 14 19:08:56 2022 +0100
Commit: Stephan Bergmann 
CommitDate: Fri Dec 16 12:14:09 2022 +

Use rtl::Reference to avoid a dynamic_cast

Change-Id: I1a439df62a33c7edccbbe62e373690b17b2f6161
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/144315
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann 

diff --git a/framework/inc/dispatch/interceptionhelper.hxx 
b/framework/inc/dispatch/interceptionhelper.hxx
index 681f69c6d013..89339b1f8455 100644
--- a/framework/inc/dispatch/interceptionhelper.hxx
+++ b/framework/inc/dispatch/interceptionhelper.hxx
@@ -26,6 +26,7 @@
 #include 
 #include 
 
+#include 
 #include 
 #include 
 #include 
@@ -35,6 +36,8 @@
 
 namespace framework{
 
+class DispatchProvider;
+
 /** @short  implements a helper to support interception with additional 
functionality.
 
 @descr  This helper implements the complete 
XDispatchProviderInterception interface with
@@ -129,7 +132,7 @@ class InterceptionHelper final : public  
::cppu::WeakImplHelper<
 
 /** @short this interception helper implements the top level master of 
an interceptor list ...
but this member is the lowest possible slave! */
-css::uno::Reference< css::frame::XDispatchProvider > m_xSlave;
+rtl::Reference< DispatchProvider > m_xSlave;
 
 /** @short contains all registered interceptor objects. */
 InterceptorList m_lInterceptionRegs;
@@ -147,7 +150,7 @@ class InterceptionHelper final : public  
::cppu::WeakImplHelper<
 an outside creates dispatch provider, which has to be used 
here as lowest slave "interceptor".
  */
 InterceptionHelper(const css::uno::Reference< css::frame::XFrame >&
xOwner,
-   css::uno::Reference< css::frame::XDispatchProvider 
>  xSlave);
+   rtl::Reference< DispatchProvider >  xSlave);
 
 private:
 
@@ -244,7 +247,7 @@ class InterceptionHelper final : public  
::cppu::WeakImplHelper<
  */
 virtual void SAL_CALL disposing(const css::lang::EventObject& aEvent) 
override;
 
-css::uno::Reference GetSlave() const { 
return m_xSlave; }
+rtl::Reference GetSlave() const { return m_xSlave; }
 
 }; // class InterceptionHelper
 
diff --git a/framework/source/dispatch/interceptionhelper.cxx 
b/framework/source/dispatch/interceptionhelper.cxx
index addb02ba685b..40cfe404edc3 100644
--- a/framework/source/dispatch/interceptionhelper.cxx
+++ b/framework/source/dispatch/interceptionhelper.cxx
@@ -17,6 +17,7 @@
  *   the License at http://www.apache.org/licenses/LICENSE-2.0 .
  */
 
+#include 
 #include 
 
 #include 
@@ -31,7 +32,7 @@ using namespace com::sun::star;
 namespace framework{
 
 InterceptionHelper::InterceptionHelper(const css::uno::Reference< 
css::frame::XFrame >&xOwner,
-   css::uno::Reference< 
css::frame::XDispatchProvider >  xSlave)
+   rtl::Reference< DispatchProvider >  
xSlave)
 : m_xOwnerWeak  (xOwner   )
 , m_xSlave  (std::move(xSlave   ))
 {
diff --git a/framework/source/services/ContextChangeEventMultiplexer.cxx 
b/framework/source/services/ContextChangeEventMultiplexer.cxx
index b2f6db457fac..1cf4a670cf5a 100644
--- a/framework/source/services/ContextChangeEventMultiplexer.cxx
+++ b/framework/source/services/ContextChangeEventMultiplexer.cxx
@@ -322,6 +322,7 @@ static uno::Reference 
GetFirstListenerWith_Impl
 uno::Reference xRet;
 
 rtl::Reference pMultiplexer =
+// [-loplugin:unocast]
 dynamic_cast(ui::ContextChangeEventMultiplexer::get(xComponentContext).get());
 assert(pMultiplexer);
 
diff --git a/framework/source/services/frame.cxx 
b/framework/source/services/frame.cxx
index b658874b865f..3721f8e40462 100644
--- a/framework/source/services/frame.cxx
+++ b/framework/source/services/frame.cxx
@@ -1477,8 +1477,7 @@ sal_Bool SAL_CALL XFrameImpl::setComponent(const 
css::uno::Reference< css::awt::
 auto pInterceptionHelper = 
dynamic_cast(m_xDispatchHelper.get());
 if (pInterceptionHelper)
 {
-css::uno::Reference 
xDispatchProvider = pInterceptionHelper->GetSlave();
-auto pDispatchProvider = 
dynamic_cast(xDispatchProvider.get());
+rtl::Reference pDispatchProvider = 
pInterceptionHelper->GetSlave();
 if (pDispatchProvider)
 {
  

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

2022-12-14 Thread Stephan Bergmann (via logerrit)
 framework/inc/uielement/addonstoolbarwrapper.hxx|8 +++-
 framework/source/layoutmanager/toolbarlayoutmanager.cxx |3 ++-
 framework/source/uielement/addonstoolbarwrapper.cxx |   12 +++-
 3 files changed, 20 insertions(+), 3 deletions(-)

New commits:
commit 840154daf934d8df52ead1cb7acd798c4d30f007
Author: Stephan Bergmann 
AuthorDate: Tue Dec 13 11:08:06 2022 +0100
Commit: Stephan Bergmann 
CommitDate: Wed Dec 14 11:59:44 2022 +

loplugin:unocast (framework::AddonsToolBarWrapper)

(See the upcoming commit introducing that loplugin:unocast on why such
dynamic_casts from UNO types are dangerous.)

Change-Id: I8014f683b939da9d638545c77dbddb3e478a385e
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/144143
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann 

diff --git a/framework/inc/uielement/addonstoolbarwrapper.hxx 
b/framework/inc/uielement/addonstoolbarwrapper.hxx
index 68cfc0ff31d0..1d189662feee 100644
--- a/framework/inc/uielement/addonstoolbarwrapper.hxx
+++ b/framework/inc/uielement/addonstoolbarwrapper.hxx
@@ -22,12 +22,15 @@
 #include 
 
 #include 
+#include 
 #include 
+#include 
 
 namespace framework
 {
 
-class AddonsToolBarWrapper final : public UIElementWrapperBase
+class AddonsToolBarWrapper final :
+public cppu::ImplInheritanceHelper
 {
 public:
 AddonsToolBarWrapper( const css::uno::Reference< 
css::uno::XComponentContext >& xContext );
@@ -45,6 +48,9 @@ class AddonsToolBarWrapper final : public UIElementWrapperBase
 // cf. ToolbarLayoutManager
 void populateImages();
 
+sal_Int64 SAL_CALL getSomething(css::uno::Sequence const & 
aIdentifier) override;
+static css::uno::Sequence const & getUnoTunnelId();
+
 private:
 css::uno::Reference< css::uno::XComponentContext > 
   m_xContext;
 css::uno::Reference< css::lang::XComponent >   
   m_xToolBarManager;
diff --git a/framework/source/layoutmanager/toolbarlayoutmanager.cxx 
b/framework/source/layoutmanager/toolbarlayoutmanager.cxx
index cf444b5ab31d..9ec6bdbfe52b 100644
--- a/framework/source/layoutmanager/toolbarlayoutmanager.cxx
+++ b/framework/source/layoutmanager/toolbarlayoutmanager.cxx
@@ -34,6 +34,7 @@
 #include 
 
 #include 
+#include 
 #include 
 #include 
 #include 
@@ -668,7 +669,7 @@ bool ToolbarLayoutManager::showToolbar( std::u16string_view 
rResourceURL )
 // Addons appear to need to be populated at start, but we don't
 // want to populate them with (scaled) images until later.
 AddonsToolBarWrapper *pAddOns;
-pAddOns = dynamic_cast( 
aUIElement.m_xUIElement.get());
+pAddOns = comphelper::getFromUnoTunnel( 
aUIElement.m_xUIElement);
 if (pAddOns)
 pAddOns->populateImages();
 
diff --git a/framework/source/uielement/addonstoolbarwrapper.cxx 
b/framework/source/uielement/addonstoolbarwrapper.cxx
index 6547d1c6bcde..6a8984ab654c 100644
--- a/framework/source/uielement/addonstoolbarwrapper.cxx
+++ b/framework/source/uielement/addonstoolbarwrapper.cxx
@@ -23,6 +23,7 @@
 #include 
 #include 
 
+#include 
 #include 
 
 #include 
@@ -40,7 +41,7 @@ namespace framework
 {
 
 AddonsToolBarWrapper::AddonsToolBarWrapper( const Reference< XComponentContext 
>& xContext ) :
-UIElementWrapperBase( UIElementType::TOOLBAR ),
+ImplInheritanceHelper( UIElementType::TOOLBAR ),
 m_xContext( xContext ),
 m_bCreatedImages( false )
 {
@@ -166,6 +167,15 @@ void AddonsToolBarWrapper::populateImages()
 }
 }
 
+sal_Int64 AddonsToolBarWrapper::getSomething(css::uno::Sequence 
const & aIdentifier) {
+return comphelper::getSomethingImpl(aIdentifier, this);
+}
+
+css::uno::Sequence const & AddonsToolBarWrapper::getUnoTunnelId() {
+static comphelper::UnoIdInit const id;
+return id.getSeq();
+}
+
 } // namespace framework
 
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */


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

2022-12-12 Thread Miklos Vajna (via logerrit)
 framework/inc/dispatch/dispatchprovider.hxx   |2 ++
 framework/inc/dispatch/interceptionhelper.hxx |2 ++
 framework/source/services/frame.cxx   |   11 +++
 3 files changed, 15 insertions(+)

New commits:
commit 4bcf6d9c905e7b5558ee8d9f7f616ce61eadb8f8
Author: Miklos Vajna 
AuthorDate: Mon Dec 12 16:10:05 2022 +0100
Commit: Miklos Vajna 
CommitDate: Mon Dec 12 22:45:11 2022 +

tdf#151376 framework: fix calling in-document macros with reused frames

The bugdoc has a macro in it, and after closing the document -> start
center -> opening it again, you could no longer trigger the macro by
clicking on the URL field in the Calc cell.

The problem is that we cache protocol handler instances since
3f768cddd28a2f04eb1ffa30bed4474deb6fbfc4 (framework: avoid re-creating
protocol handler instances all the time, 2022-05-02) in frames, but we
failed to invalidate this cache when the component of the frame changes.

Fix the problem by clearing the cache in XFrameImpl::setComponent(),
which gets called in this somewhat rare case when a frame gets reused to
host a different component.

[ No testcase, I'm not sure how to close a document without disposing
its XFrame from code. ]

Change-Id: I73ee83ec017f476803010cbf9e514315fc797371
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/143998
Reviewed-by: Miklos Vajna 
Tested-by: Jenkins

diff --git a/framework/inc/dispatch/dispatchprovider.hxx 
b/framework/inc/dispatch/dispatchprovider.hxx
index 3b544807337c..c6656948ebee 100644
--- a/framework/inc/dispatch/dispatchprovider.hxx
+++ b/framework/inc/dispatch/dispatchprovider.hxx
@@ -88,6 +88,8 @@ class DispatchProvider final : public ::cppu::WeakImplHelper< 
css::frame::XDispa

sal_Int32   
  nSearchFlags ) override;
 virtual css::uno::Sequence< css::uno::Reference< css::frame::XDispatch 
> > SAL_CALL queryDispatches( const css::uno::Sequence< 
css::frame::DispatchDescriptor >& lDescriptions) override;
 
+void ClearProtocolHandlers() { m_aProtocolHandlers.clear(); }
+
 /* helper */
 private:
 // Let him protected! So nobody can use us as base ...
diff --git a/framework/inc/dispatch/interceptionhelper.hxx 
b/framework/inc/dispatch/interceptionhelper.hxx
index 391986ff549f..681f69c6d013 100644
--- a/framework/inc/dispatch/interceptionhelper.hxx
+++ b/framework/inc/dispatch/interceptionhelper.hxx
@@ -244,6 +244,8 @@ class InterceptionHelper final : public  
::cppu::WeakImplHelper<
  */
 virtual void SAL_CALL disposing(const css::lang::EventObject& aEvent) 
override;
 
+css::uno::Reference GetSlave() const { 
return m_xSlave; }
+
 }; // class InterceptionHelper
 
 } // namespace framework
diff --git a/framework/source/services/frame.cxx 
b/framework/source/services/frame.cxx
index 7e8ea9b8823b..b658874b865f 100644
--- a/framework/source/services/frame.cxx
+++ b/framework/source/services/frame.cxx
@@ -1473,6 +1473,17 @@ sal_Bool SAL_CALL XFrameImpl::setComponent(const 
css::uno::Reference< css::awt::
 {
 SolarMutexGuard aWriteLock;
 m_xController = nullptr;
+
+auto pInterceptionHelper = 
dynamic_cast(m_xDispatchHelper.get());
+if (pInterceptionHelper)
+{
+css::uno::Reference 
xDispatchProvider = pInterceptionHelper->GetSlave();
+auto pDispatchProvider = 
dynamic_cast(xDispatchProvider.get());
+if (pDispatchProvider)
+{
+pDispatchProvider->ClearProtocolHandlers();
+}
+}
 }
 /* } SAFE */
 


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

2022-09-28 Thread Noel Grandin (via logerrit)
 framework/inc/helper/mischelper.hxx   |   26 

 framework/inc/jobs/jobdata.hxx|2 
 framework/source/jobs/jobdata.cxx |4 -
 framework/source/uiconfiguration/moduleuiconfigurationmanager.cxx |   32 
+-
 framework/source/uiconfiguration/uiconfigurationmanager.cxx   |   23 
+++
 5 files changed, 44 insertions(+), 43 deletions(-)

New commits:
commit 949f0fca3cbe3d80c4aaebe6b7d7f4a8beb2fc13
Author: Noel Grandin 
AuthorDate: Tue Sep 27 09:38:00 2022 +0200
Commit: Noel Grandin 
CommitDate: Wed Sep 28 08:42:54 2022 +0200

use more string_view in framework

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

diff --git a/framework/inc/helper/mischelper.hxx 
b/framework/inc/helper/mischelper.hxx
index 7e028d18e446..04284e8ff866 100644
--- a/framework/inc/helper/mischelper.hxx
+++ b/framework/inc/helper/mischelper.hxx
@@ -31,6 +31,7 @@
 #include 
 
 #include 
+#include 
 #include 
 #include 
 
@@ -82,24 +83,25 @@ inline bool IsScriptTypeMatchingToLanguage( SvtScriptType 
nScriptType, LanguageT
 return bool(nScriptType & SvtLanguageOptions::GetScriptTypeOfLanguage( 
nLang ));
 }
 
-inline void RetrieveTypeNameFromResourceURL( const OUString& aResourceURL, 
OUString& aType, OUString& aName )
+inline void RetrieveTypeNameFromResourceURL( std::u16string_view aResourceURL, 
OUString& aType, OUString& aName )
 {
-static const char  RESOURCEURL_PREFIX[] = "private:resource/";
-static const sal_Int32 RESOURCEURL_PREFIX_SIZE = 
strlen(RESOURCEURL_PREFIX);
+static constexpr std::u16string_view RESOURCEURL_PREFIX = 
u"private:resource/";
 
-if (aResourceURL.startsWith( RESOURCEURL_PREFIX ))
+if (o3tl::starts_with(aResourceURL, RESOURCEURL_PREFIX ))
 {
-sal_Int32 nIdx{ RESOURCEURL_PREFIX_SIZE };
-while (nIdx=aResourceURL.getLength())
+size_t nIdx = RESOURCEURL_PREFIX.size();
+while (nIdx < aResourceURL.size() && aResourceURL[nIdx]=='/')
+++nIdx;
+if (nIdx >= aResourceURL.size())
 return;
-aType = aResourceURL.getToken(0, '/', nIdx);
-if (nIdx<0)
+aType = o3tl::getToken(aResourceURL, u'/', nIdx);
+if (nIdx == std::u16string_view::npos)
 return;
-while (nIdx=aResourceURL.getLength())
+while (nIdx < aResourceURL.size() && aResourceURL[nIdx]=='/')
+++nIdx;
+if (nIdx >= aResourceURL.size())
 return;
-aName = aResourceURL.getToken(0, '/', nIdx);
+aName = o3tl::getToken(aResourceURL, u'/', nIdx);
 }
 }
 
diff --git a/framework/inc/jobs/jobdata.hxx b/framework/inc/jobs/jobdata.hxx
index fd23a665e2d8..050bce6a84a9 100644
--- a/framework/inc/jobs/jobdata.hxx
+++ b/framework/inc/jobs/jobdata.hxx
@@ -180,7 +180,7 @@ class JobData final
 std::vector< css::beans::NamedValue >getJobConfig() 
const;
 
 bool hasConfig   () 
const;
-bool hasCorrectContext   ( 
const OUString& rModuleIdent ) const;
+bool hasCorrectContext   ( 
std::u16string_view rModuleIdent ) const;
 
 void setEnvironment (   
EEnvironment  eEnvironment );
 void setAlias   ( const 
OUString&  sAlias   );
diff --git a/framework/source/jobs/jobdata.cxx 
b/framework/source/jobs/jobdata.cxx
index 863bc8c4b4ca..ded3570e8dbf 100644
--- a/framework/source/jobs/jobdata.cxx
+++ b/framework/source/jobs/jobdata.cxx
@@ -448,10 +448,10 @@ void JobData::appendEnabledJobsForEvent( const 
css::uno::Reference< css::uno::XC
 }
 }
 
-bool JobData::hasCorrectContext(const OUString& rModuleIdent) const
+bool JobData::hasCorrectContext(std::u16string_view rModuleIdent) const
 {
 sal_Int32 nContextLen  = m_sContext.getLength();
-sal_Int32 nModuleIdLen = rModuleIdent.getLength();
+sal_Int32 nModuleIdLen = rModuleIdent.size();
 
 if ( nContextLen == 0 )
 return true;
diff --git a/framework/source/uiconfiguration/moduleuiconfigurationmanager.cxx 
b/framework/source/uiconfiguration/moduleuiconfigurationmanager.cxx
index ded9d777080c..235190ac9d0d 100644
--- a/framework/source/uiconfiguration/moduleuiconfigurationmanager.cxx
+++ b/framework/source/uiconfiguration/moduleuiconfigurationmanager.cxx
@@ -236,16 +236,15 @@ std::u16string_view UIELEMENTTYPENAMES[] =
 u"" UIELEMENTTYPE_TOOLPANEL_NAME
 };
 
-const char   RESOURCEURL_PREFIX[] = "private:resource/";
-const sal_Int32  RESOURCEURL_PREFIX_SIZE = strlen(RESOURCEURL_PREFIX);
+constexpr std::u16string_view 

[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/vcl vcl/source

2022-08-30 Thread Maxim Monastirsky (via logerrit)
 framework/inc/uielement/toolbarmanager.hxx|1 
 framework/source/uielement/toolbarmanager.cxx |9 -
 include/vcl/toolbox.hxx   |9 -
 vcl/source/window/builder.cxx |2 -
 vcl/source/window/toolbox.cxx |   40 --
 5 files changed, 61 deletions(-)

New commits:
commit 2958e4c92f15652c424765f02c87518011eb2406
Author: Maxim Monastirsky 
AuthorDate: Fri Jul 29 00:08:46 2022 +0300
Commit: Maxim Monastirsky 
CommitDate: Tue Aug 30 13:07:36 2022 +0200

tdf#149956 Remove previous vcl only solution

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

diff --git a/framework/inc/uielement/toolbarmanager.hxx 
b/framework/inc/uielement/toolbarmanager.hxx
index 162e14aca4e3..865a1b54d5b4 100644
--- a/framework/inc/uielement/toolbarmanager.hxx
+++ b/framework/inc/uielement/toolbarmanager.hxx
@@ -82,7 +82,6 @@ public:
 virtual void Clear() = 0;
 virtual void SetName(const OUString& rName) = 0;
 virtual void SetHelpId(const OString& rHelpId) = 0;
-virtual void TrackImageOrientation(const 
css::uno::Reference& rFrame) = 0;
 virtual bool WillUsePopupMode() = 0;
 virtual bool IsReallyVisible() = 0;
 virtual void SetIconSize(ToolBoxButtonSize eSize) = 0;
diff --git a/framework/source/uielement/toolbarmanager.cxx 
b/framework/source/uielement/toolbarmanager.cxx
index 86a6c161900d..d1251f96cb84 100644
--- a/framework/source/uielement/toolbarmanager.cxx
+++ b/framework/source/uielement/toolbarmanager.cxx
@@ -292,11 +292,6 @@ public:
 m_pToolBar->SetHelpId( rHelpId );
 }
 
-virtual void TrackImageOrientation(const 
css::uno::Reference& rFrame) override
-{
-m_pToolBar->TrackImageOrientation(rFrame);
-}
-
 virtual bool WillUsePopupMode() override
 {
 return m_pToolBar->WillUsePopupMode();
@@ -483,8 +478,6 @@ public:
 
 virtual void SetHelpId(const OString& /*rHelpId*/) override {}
 
-virtual void TrackImageOrientation(const 
css::uno::Reference&) override {}
-
 virtual bool WillUsePopupMode() override { return true; }
 
 virtual bool IsReallyVisible() override { return true; }
@@ -1669,8 +1662,6 @@ void ToolBarManager::RequestImages()
 ++pIter;
 ++i;
 }
-
-m_pImpl->TrackImageOrientation(m_xFrame);
 }
 
 void ToolBarManager::notifyRegisteredControllers( const OUString& 
aUIElementName, const OUString& aCommand )
diff --git a/include/vcl/toolbox.hxx b/include/vcl/toolbox.hxx
index f89cb335b541..055d82f1e722 100644
--- a/include/vcl/toolbox.hxx
+++ b/include/vcl/toolbox.hxx
@@ -34,8 +34,6 @@
 #include 
 
 namespace com::sun::star::frame { class XFrame; }
-namespace com::sun::star::frame { struct FeatureStateEvent; }
-template  class VclStatusListener;
 
 class Timer;
 struct ImplToolItem;
@@ -116,7 +114,6 @@ private:
 tools::LongmnBottomBorder;
 tools::LongmnLastResizeDY;
 tools::LongmnActivateCount;
-Degree10mnImagesRotationAngle;
 ToolBoxItemId   mnLastFocusItemId;
 ToolBoxItemId   mnHighItemId;
 ToolBoxItemId   mnCurItemId;
@@ -143,7 +140,6 @@ private:
 mbDragging:1,
 mbIsKeyEvent:1,
 mbChangingHighlight:1,
-mbImagesMirrored:1,
 mbLineSpacing:1,
 mbIsArranged:1;
 WindowAlign meAlign;
@@ -161,8 +157,6 @@ private:
 Link maMenuButtonHdl;
 Link maStateChangedHandler;
 Link maDataChangedHandler;
-/** StatusListener. Notifies about rotated images etc */
-rtl::Reference> mpStatusListener;
 
 public:
 using Window::ImplInit;
@@ -504,14 +498,11 @@ public:
 
 
 void SetToolbarLayoutMode( ToolBoxLayoutMode eLayout );
-void statusChanged(const css::frame::FeatureStateEvent& rEvent);
 
 void SetToolBoxTextPosition( ToolBoxTextPosition ePosition );
 
 void SetLineSpacing(bool b) { mbLineSpacing = b; }
 
-void TrackImageOrientation(const css::uno::Reference& 
rFrame);
-
 virtual void DumpAsPropertyTree(tools::JsonWriter&) override;
 };
 
diff --git a/vcl/source/window/builder.cxx b/vcl/source/window/builder.cxx
index f1a31674e19e..441680aec077 100644
--- a/vcl/source/window/builder.cxx
+++ b/vcl/source/window/builder.cxx
@@ -2155,8 +2155,6 @@ VclPtr VclBuilder::makeObject(vcl::Window 
*pParent, const OString &
 m_pParserState->m_aButtonMenuMaps.emplace_back(id, sMenu);
 setupFromActionName(static_cast(xWindow.get()), rMap, 
m_xFrame);
 }
-else if (xWindow->GetType() == WindowType::TOOLBOX)
-
static_cast(xWindow.get())->TrackImageOrientation(m_xFrame);
 }
 }
 
diff --git a/vcl/source/window/toolbox.cxx 

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

2022-08-10 Thread Maxim Monastirsky (via logerrit)
 framework/inc/uielement/toolbarmanager.hxx|1 -
 framework/source/uielement/toolbarmanager.cxx |   10 +++---
 2 files changed, 3 insertions(+), 8 deletions(-)

New commits:
commit 085abe2b7187f2cfd69a5a1c6e84ef0c9c214f78
Author: Maxim Monastirsky 
AuthorDate: Thu Jul 28 01:08:31 2022 +0300
Commit: Maxim Monastirsky 
CommitDate: Wed Aug 10 08:24:27 2022 +0200

Unnecessary ToolBox::SetItemText call

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

diff --git a/framework/inc/uielement/toolbarmanager.hxx 
b/framework/inc/uielement/toolbarmanager.hxx
index 2e7cd1c01a9a..162e14aca4e3 100644
--- a/framework/inc/uielement/toolbarmanager.hxx
+++ b/framework/inc/uielement/toolbarmanager.hxx
@@ -65,7 +65,6 @@ public:
 virtual void Destroy() = 0;
 virtual css::uno::Reference GetInterface() = 0;
 virtual void InsertItem(ToolBoxItemId nId,
-const OUString& rString,
 const OUString& rCommandURL,
 const OUString& rTooltip,
 const OUString& rLabel,
diff --git a/framework/source/uielement/toolbarmanager.cxx 
b/framework/source/uielement/toolbarmanager.cxx
index b2efe27c2f0a..7dbee84c1072 100644
--- a/framework/source/uielement/toolbarmanager.cxx
+++ b/framework/source/uielement/toolbarmanager.cxx
@@ -216,16 +216,14 @@ public:
 }
 
 virtual void InsertItem(ToolBoxItemId nId,
-const OUString& rString,
 const OUString& rCommandURL,
 const OUString& rTooltip,
 const OUString& rLabel,
 ToolBoxItemBits nItemBits) override
 {
-m_pToolBar->InsertItem( nId, rString, nItemBits );
+m_pToolBar->InsertItem( nId, rLabel, nItemBits );
 m_pToolBar->SetItemCommand( nId, rCommandURL );
 m_pToolBar->SetQuickHelpText(nId, rTooltip);
-m_pToolBar->SetItemText( nId, rLabel );
 m_pToolBar->EnableItem( nId );
 m_pToolBar->SetItemState( nId, TRISTATE_FALSE );
 }
@@ -420,7 +418,6 @@ public:
 }
 
 virtual void InsertItem(ToolBoxItemId nId,
-const OUString& /*rString*/,
 const OUString& rCommandURL,
 const OUString& rTooltip,
 const OUString& rLabel,
@@ -1410,7 +1407,6 @@ void ToolBarManager::FillToolbarFromContainer( const 
Reference< XIndexAccess >&
 auto aProperties = 
vcl::CommandInfoProvider::GetCommandProperties(aCommandURL, 
m_aModuleIdentifier);
 if (!aProperties.hasElements()) // E.g., user-provided 
macro command?
 aProperties = aProps; // Use existing info, including 
user-provided Label
-OUString 
aString(vcl::CommandInfoProvider::GetLabelForCommand(aProperties));
 
 ToolBoxItemBits nItemBits = ConvertStyleToToolboxItemBits( 
nStyle );
 
@@ -1418,9 +1414,9 @@ void ToolBarManager::FillToolbarFromContainer( const 
Reference< XIndexAccess >&
 aTooltip = 
vcl::CommandInfoProvider::GetTooltipForCommand(aCommandURL, aProperties, 
m_xFrame);
 
 if ( aLabel.isEmpty() )
-aLabel = aString;
+aLabel = 
vcl::CommandInfoProvider::GetLabelForCommand(aProperties);
 
-m_pImpl->InsertItem(nId, aString, aCommandURL, aTooltip, 
aLabel, nItemBits);
+m_pImpl->InsertItem(nId, aCommandURL, aTooltip, aLabel, 
nItemBits);
 
 // Fill command map. It stores all our commands and from 
what
 // image manager we got our image. So we can decide if we 
have to use an


[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 

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

2022-06-13 Thread Maxim Monastirsky (via logerrit)
 framework/inc/uielement/toolbarmanager.hxx|   10 +
 framework/inc/uielement/toolbarmerger.hxx |2 
 framework/inc/uielement/toolbarwrapper.hxx|   16 -
 framework/source/uielement/toolbarmanager.cxx |  224 ++
 framework/source/uielement/toolbarmerger.cxx  |8 
 framework/source/uielement/toolbarwrapper.cxx |  116 +
 include/sfx2/notebookbar/SfxNotebookBar.hxx   |2 
 sfx2/source/appl/workwin.cxx  |2 
 sfx2/source/notebookbar/SfxNotebookBar.cxx|5 
 9 files changed, 233 insertions(+), 152 deletions(-)

New commits:
commit 9bc1ffa2153d2474b023e0860d3c9c68ee18727b
Author: Maxim Monastirsky 
AuthorDate: Mon Jun 6 22:50:14 2022 +0300
Commit: Maxim Monastirsky 
CommitDate: Mon Jun 13 18:47:01 2022 +0200

tdf#125040 Make single mode toolbar context aware

This patch modifies the "Standard (Single Mode)" toolbar
to have an optional context-aware section, given that a
corresponding singlemode-.xml files exist.
This is a lot like the "Contextual Single" NB, except
that it's implemented with regular toolbars, so docking/
customization/extensions/uno api etc. are all working.

In addition, the "Single Toolbar" mode was modified to
not show any other contextual toolbar. (But of course the
single mode toolbar itself is perfectly usable outside of
this mode.)

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

diff --git a/framework/inc/uielement/toolbarmanager.hxx 
b/framework/inc/uielement/toolbarmanager.hxx
index 1cfddd99ef45..746b40ebc787 100644
--- a/framework/inc/uielement/toolbarmanager.hxx
+++ b/framework/inc/uielement/toolbarmanager.hxx
@@ -94,6 +94,7 @@ public:
 virtual void ConnectCallbacks(ToolBarManager* pManager) = 0;
 virtual void SetMenuType(ToolBoxMenuType eType) = 0;
 virtual void MergeToolbar(ToolBoxItemId & rItemId,
+  sal_uInt16 nFirstItem,
   const OUString& rModuleIdentifier,
   CommandToInfoMap& rCommandMap,
   MergeToolbarInstruction& rInstruction) = 0;
@@ -144,7 +145,9 @@ class ToolBarManager final : public ToolbarManager_Base
 
 void CheckAndUpdateImages();
 void RequestImages();
-void FillToolbar( const css::uno::Reference< 
css::container::XIndexAccess >& rToolBarData );
+void FillToolbar( const css::uno::Reference< 
css::container::XIndexAccess >& rToolBarData,
+  const css::uno::Reference< 
css::container::XIndexAccess >& rContextData,
+  const OUString& rContextToolbarName );
 void FillAddonToolbar( const css::uno::Sequence< css::uno::Sequence< 
css::beans::PropertyValue > >& rAddonToolbar );
 void FillOverflowToolbar( ToolBox const * pParent );
 void notifyRegisteredControllers( const OUString& aUIElementName, 
const OUString& aCommand );
@@ -193,6 +196,9 @@ class ToolBarManager final : public ToolbarManager_Base
 
 private:
 void Init();
+void FillToolbarFromContainer(const css::uno::Reference< 
css::container::XIndexAccess >& rItemContainer,
+  const OUString& rResourceName, 
ToolBoxItemId& nId, ToolBoxItemId& nAddonId);
+void ToggleButton(const OUString& rResourceName, std::u16string_view 
rCommand);
 void AddCustomizeMenuItems(ToolBox const * pToolBar);
 void InitImageManager();
 void RemoveControllers();
@@ -219,12 +225,14 @@ class ToolBarManager final : public ToolbarManager_Base
  m_bUpdateControllers : 1;
 
 sal_Int16 m_eSymbolSize;
+sal_uInt16 m_nContextMinPos;
 
 std::unique_ptr  m_pImpl;
 VclPtr  
m_pToolBar;
 
 OUString 
m_aModuleIdentifier;
 OUString 
m_aResourceName;
+OUString 
m_aContextResourceName;
 
 css::uno::Reference< css::util::XURLTransformer >
m_xURLTransformer;
 css::uno::Reference< css::frame::XFrame >m_xFrame;
diff --git a/framework/inc/uielement/toolbarmerger.hxx 
b/framework/inc/uielement/toolbarmerger.hxx
index 837507baa386..b84ca2005e39 100644
--- a/framework/inc/uielement/toolbarmerger.hxx
+++ b/framework/inc/uielement/toolbarmerger.hxx
@@ -75,7 +75,7 @@ class ToolBarMerger
OUString& rControlType,
sal_uInt16& rWidth );
 
-static ReferenceToolbarPathInfo FindReferencePoint( const ToolBox* 
pToolbar,
+static 

[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 -
 

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

2022-05-08 Thread Noel Grandin (via logerrit)
 framework/inc/uielement/toolbarmanager.hxx|7 ---
 framework/source/uielement/toolbarmanager.cxx |   16 +---
 2 files changed, 13 insertions(+), 10 deletions(-)

New commits:
commit df63d1aa9ca0676e3df7b68dc8dc99246aa44240
Author: Noel Grandin 
AuthorDate: Sat May 7 14:09:51 2022 +0200
Commit: Noel Grandin 
CommitDate: Sun May 8 12:34:40 2022 +0200

osl::Mutex->std::mutex in framework::ToolBarManager

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

diff --git a/framework/inc/uielement/toolbarmanager.hxx 
b/framework/inc/uielement/toolbarmanager.hxx
index a12528415184..3ac9ef15012a 100644
--- a/framework/inc/uielement/toolbarmanager.hxx
+++ b/framework/inc/uielement/toolbarmanager.hxx
@@ -37,7 +37,7 @@
 
 #include 
 #include 
-#include 
+#include 
 
 #include 
 #include 
@@ -45,6 +45,7 @@
 #include 
 #include 
 
+#include 
 #include 
 
 class PopupMenu;
@@ -228,8 +229,8 @@ class ToolBarManager final : public ToolbarManager_Base
 css::uno::Reference< css::util::XURLTransformer >
m_xURLTransformer;
 css::uno::Reference< css::frame::XFrame >m_xFrame;
 ToolBarControllerMap 
m_aControllerMap;
-osl::Mutex   m_mutex;
-comphelper::OMultiTypeInterfaceContainerHelper2  
m_aListenerContainer;   /// container for ALL Listener
+std::mutex   m_mutex;
+comphelper::OInterfaceContainerHelper4   
m_aListenerContainer;
 css::uno::Reference< css::uno::XComponentContext >   
m_xContext;
 css::uno::Reference< css::frame::XUIControllerFactory >  
m_xToolbarControllerFactory;
 css::uno::Reference< css::ui::XImageManager >
m_xModuleImageManager;
diff --git a/framework/source/uielement/toolbarmanager.cxx 
b/framework/source/uielement/toolbarmanager.cxx
index 88bba421ff1c..4213271f2cf1 100644
--- a/framework/source/uielement/toolbarmanager.cxx
+++ b/framework/source/uielement/toolbarmanager.cxx
@@ -575,7 +575,6 @@ ToolBarManager::ToolBarManager( const Reference< 
XComponentContext >& rxContext,
 m_pToolBar( pToolBar ),
 m_aResourceName( rResourceName ),
 m_xFrame( rFrame ),
-m_aListenerContainer( m_mutex ),
 m_xContext( rxContext ),
 m_aAsyncUpdateControllersTimer( "framework::ToolBarManager 
m_aAsyncUpdateControllersTimer" ),
 m_sIconTheme( SvtMiscOptions().GetIconTheme() )
@@ -596,7 +595,6 @@ ToolBarManager::ToolBarManager( const Reference< 
XComponentContext >& rxContext,
 m_pToolBar( nullptr ),
 m_aResourceName( rResourceName ),
 m_xFrame( rFrame ),
-m_aListenerContainer( m_mutex ),
 m_xContext( rxContext ),
 m_aAsyncUpdateControllersTimer( "framework::ToolBarManager 
m_aAsyncUpdateControllersTimer" ),
 m_sIconTheme( SvtMiscOptions().GetIconTheme() )
@@ -844,9 +842,11 @@ void SAL_CALL ToolBarManager::dispose()
 {
 Reference< XComponent > xThis(this);
 
-EventObject aEvent( xThis );
-m_aListenerContainer.disposeAndClear( aEvent );
-
+{
+EventObject aEvent( xThis );
+std::unique_lock aGuard(m_mutex);
+m_aListenerContainer.disposeAndClear( aGuard, aEvent );
+}
 {
 SolarMutexGuard g;
 
@@ -922,12 +922,14 @@ void SAL_CALL ToolBarManager::addEventListener( const 
Reference< XEventListener
 if ( m_bDisposed )
 throw DisposedException();
 
-m_aListenerContainer.addInterface( cppu::UnoType::get(), 
xListener );
+std::unique_lock aGuard(m_mutex);
+m_aListenerContainer.addInterface( aGuard, xListener );
 }
 
 void SAL_CALL ToolBarManager::removeEventListener( const Reference< 
XEventListener >& xListener )
 {
-m_aListenerContainer.removeInterface( 
cppu::UnoType::get(), xListener );
+std::unique_lock aGuard(m_mutex);
+m_aListenerContainer.removeInterface( aGuard, xListener );
 }
 
 // XUIConfigurationListener


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

2022-05-07 Thread Noel Grandin (via logerrit)
 framework/inc/uielement/statusbarmanager.hxx|7 ---
 framework/source/uielement/statusbarmanager.cxx |   15 +--
 2 files changed, 13 insertions(+), 9 deletions(-)

New commits:
commit e35d97c96139b836d71abd486644f2d576288e8c
Author: Noel Grandin 
AuthorDate: Sat May 7 14:12:03 2022 +0200
Commit: Noel Grandin 
CommitDate: Sat May 7 20:55:33 2022 +0200

osl::Mutex->std::mutex in framework::StatusBarManager

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

diff --git a/framework/inc/uielement/statusbarmanager.hxx 
b/framework/inc/uielement/statusbarmanager.hxx
index 99cf94ea1d59..ba2dbd9a31c0 100644
--- a/framework/inc/uielement/statusbarmanager.hxx
+++ b/framework/inc/uielement/statusbarmanager.hxx
@@ -26,10 +26,11 @@
 #include 
 
 #include 
-#include 
+#include 
 #include 
 #include 
 #include 
+#include 
 
 namespace framework
 {
@@ -92,8 +93,8 @@ class StatusBarManager final: public ::cppu::WeakImplHelper<
 VclPtr 
m_pStatusBar;
 css::uno::Reference< css::frame::XFrame > 
m_xFrame;
 StatusBarControllerMap
m_aControllerMap;
-osl::Mutex
m_mutex;
-comphelper::OMultiTypeInterfaceContainerHelper2   
m_aListenerContainer;   /// container for ALL Listener
+std::mutex
m_mutex;
+comphelper::OInterfaceContainerHelper4
m_aListenerContainer;
 css::uno::Reference< css::uno::XComponentContext >
m_xContext;
 css::uno::Reference< css::frame::XUIControllerFactory >   
m_xStatusbarControllerFactory;
 };
diff --git a/framework/source/uielement/statusbarmanager.cxx 
b/framework/source/uielement/statusbarmanager.cxx
index 929afb24ca94..b54f57ff098f 100644
--- a/framework/source/uielement/statusbarmanager.cxx
+++ b/framework/source/uielement/statusbarmanager.cxx
@@ -128,7 +128,6 @@ StatusBarManager::StatusBarManager(
 m_bUpdateControllers( false ),
 m_pStatusBar( pStatusBar ),
 m_xFrame( rFrame ),
-m_aListenerContainer( m_mutex ),
 m_xContext( rxContext )
 {
 
@@ -177,9 +176,11 @@ void SAL_CALL StatusBarManager::dispose()
 {
 uno::Reference< lang::XComponent > xThis(this );
 
-lang::EventObject aEvent( xThis );
-m_aListenerContainer.disposeAndClear( aEvent );
-
+{
+lang::EventObject aEvent( xThis );
+std::unique_lock aGuard(m_mutex);
+m_aListenerContainer.disposeAndClear( aGuard, aEvent );
+}
 {
 SolarMutexGuard g;
 if ( m_bDisposed )
@@ -223,12 +224,14 @@ void SAL_CALL StatusBarManager::addEventListener( const 
uno::Reference< lang::XE
 if ( m_bDisposed )
 throw lang::DisposedException();
 
-m_aListenerContainer.addInterface( 
cppu::UnoType::get(), xListener );
+std::unique_lock aGuard(m_mutex);
+m_aListenerContainer.addInterface( aGuard, xListener );
 }
 
 void SAL_CALL StatusBarManager::removeEventListener( const uno::Reference< 
lang::XEventListener >& xListener )
 {
-m_aListenerContainer.removeInterface( 
cppu::UnoType::get(), xListener );
+std::unique_lock aGuard(m_mutex);
+m_aListenerContainer.removeInterface( aGuard, xListener );
 }
 
 // XUIConfigurationListener


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

2022-05-02 Thread Miklos Vajna (via logerrit)
 framework/inc/dispatch/dispatchprovider.hxx|2 ++
 framework/source/dispatch/dispatchprovider.cxx |   22 +-
 2 files changed, 19 insertions(+), 5 deletions(-)

New commits:
commit 3f768cddd28a2f04eb1ffa30bed4474deb6fbfc4
Author: Miklos Vajna 
AuthorDate: Mon May 2 16:25:31 2022 +0200
Commit: Miklos Vajna 
CommitDate: Mon May 2 21:59:28 2022 +0200

framework: avoid re-creating protocol handler instances all the time

Once you install an extension that adds its own protocol handlers (e.g.
), DispatchProvider
re-creates this protocol handler every time the custom menu gets opened
or a command gets dispatched.

This allows the dispatch provider to avoid managing the lifecycle of
those protocol handler instances, but in case the constructor of those
handlers is expensive, this leads to performance problems.

Introduce a map of handler instances in DispatchProvider to avoid
unnecessary re-creation and re-initialization: these instances get the
same XFrame anyway (the DispatchProvider is owned by the frame), so this
is meant to be safe.

No testcase for this -- the problem is only visible if you have an UNO
service registered in the global UNO service registry, but by the time
our cppunit tests run, that is already a fixed list, so this would be
hard to test from code.

Change-Id: I6d69906a795a2d5a67706002d635b6cb3091b856
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/133706
Reviewed-by: Miklos Vajna 
Tested-by: Jenkins

diff --git a/framework/inc/dispatch/dispatchprovider.hxx 
b/framework/inc/dispatch/dispatchprovider.hxx
index 804df44abc0c..4552e0580d2c 100644
--- a/framework/inc/dispatch/dispatchprovider.hxx
+++ b/framework/inc/dispatch/dispatchprovider.hxx
@@ -74,6 +74,8 @@ class DispatchProvider final : public ::cppu::WeakImplHelper< 
css::frame::XDispa
 css::uno::WeakReference< css::frame::XFrame > m_xFrame;
 /// cache of some other dispatch provider which are registered inside 
configuration to handle special URL protocols
 HandlerCache m_aProtocolHandlerCache;
+std::unordered_map>
+m_aProtocolHandlers;
 
 /* interface */
 public:
diff --git a/framework/source/dispatch/dispatchprovider.cxx 
b/framework/source/dispatch/dispatchprovider.cxx
index 578170227578..bcfa07bb333a 100644
--- a/framework/source/dispatch/dispatchprovider.cxx
+++ b/framework/source/dispatch/dispatchprovider.cxx
@@ -440,18 +440,30 @@ css::uno::Reference< css::frame::XDispatch > 
DispatchProvider::implts_searchProt
 SolarMutexGuard g;
 
 // create it
+bool bInitialize = true;
 try
 {
-xHandler.set(
-
css::uno::Reference(m_xContext->getServiceManager(),
 css::uno::UNO_QUERY_THROW)
-  ->createInstance(aHandler.m_sUNOName),
-css::uno::UNO_QUERY);
+// Only create the protocol handler instance once, the 
creation is expensive.
+auto it = m_aProtocolHandlers.find(aHandler.m_sUNOName);
+if (it == m_aProtocolHandlers.end())
+{
+xHandler.set(
+
css::uno::Reference(m_xContext->getServiceManager(),
 css::uno::UNO_QUERY_THROW)
+  ->createInstance(aHandler.m_sUNOName),
+css::uno::UNO_QUERY);
+m_aProtocolHandlers.emplace(aHandler.m_sUNOName, xHandler);
+}
+else
+{
+xHandler = it->second;
+bInitialize = false;
+}
 }
 catch(const css::uno::Exception&) {}
 
 // look if initialization is necessary
 css::uno::Reference< css::lang::XInitialization > xInit( xHandler, 
css::uno::UNO_QUERY );
-if (xInit.is())
+if (xInit.is() && bInitialize)
 {
 css::uno::Reference< css::frame::XFrame > xOwner( 
m_xFrame.get(), css::uno::UNO_QUERY );
 SAL_WARN_IF(!xOwner.is(), "fwk", 
"DispatchProvider::implts_searchProtocolHandler(): Couldn't get reference to my 
owner frame. So I can't set may needed context information for this protocol 
handler.");


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

2022-03-25 Thread Stephan Bergmann (via logerrit)
 framework/inc/uielement/menubarmanager.hxx|2 --
 framework/source/uielement/menubarmanager.cxx |   16 +---
 2 files changed, 5 insertions(+), 13 deletions(-)

New commits:
commit 47e6bf0109c686f71b48c550667af707705a777b
Author: Stephan Bergmann 
AuthorDate: Fri Mar 25 12:18:05 2022 +0100
Commit: Stephan Bergmann 
CommitDate: Fri Mar 25 15:38:42 2022 +0100

Fold MenuBarManager::Destroy into its only call site

...mainly to demonstrate that its SolarMutexGuard was redundant and that
replacing it with DBG_TESTSOLARMUTEX() would be overkill

Change-Id: I82f00873cd99cb5da1b644c40ba25f8c210503cd
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/132112
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann 

diff --git a/framework/inc/uielement/menubarmanager.hxx 
b/framework/inc/uielement/menubarmanager.hxx
index 079d127d4d83..710c788f2dcc 100644
--- a/framework/inc/uielement/menubarmanager.hxx
+++ b/framework/inc/uielement/menubarmanager.hxx
@@ -127,8 +127,6 @@ class MenuBarManager final :
 static bool MustBeHidden( PopupMenu* pPopupMenu, const 
css::uno::Reference< css::util::XURLTransformer >& rTransformer );
 OUString RetrieveLabelFromCommand(const OUString& rCmdURL);
 
-void Destroy();
-
 struct MenuItemHandler
 {
 MenuItemHandler( sal_uInt16 aItemId,
diff --git a/framework/source/uielement/menubarmanager.cxx 
b/framework/source/uielement/menubarmanager.cxx
index 49b4092f6d46..c363ccffb9b6 100644
--- a/framework/source/uielement/menubarmanager.cxx
+++ b/framework/source/uielement/menubarmanager.cxx
@@ -136,9 +136,12 @@ MenuBarManager::~MenuBarManager()
 SAL_WARN_IF( OWeakObject::m_refCount != 0, "fwk.uielement", "Who wants to 
delete an object with refcount > 0!" );
 }
 
-void MenuBarManager::Destroy()
+// XComponent
+void MenuBarManager::disposing(std::unique_lock& )
 {
-SolarMutexGuard aGuard;
+Reference< XComponent > xThis( this );
+
+SolarMutexGuard g;
 
 // stop asynchronous settings timer and
 // release deferred item container reference
@@ -152,15 +155,6 @@ void MenuBarManager::Destroy()
 {
 m_pVCLMenu.disposeAndClear();
 }
-}
-
-// XComponent
-void MenuBarManager::disposing(std::unique_lock& )
-{
-Reference< XComponent > xThis( this );
-
-SolarMutexGuard g;
-Destroy();
 
 if ( m_xDocImageManager.is() )
 {


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

2022-01-15 Thread Caolán McNamara (via logerrit)
 framework/inc/uielement/toolbarwrapper.hxx |2 ++
 1 file changed, 2 insertions(+)

New commits:
commit 4342717dcd580d5aea4e35636d4e35a4ea055d36
Author: Caolán McNamara 
AuthorDate: Sat Jan 15 14:19:33 2022 +
Commit: Caolán McNamara 
CommitDate: Sat Jan 15 17:35:16 2022 +0100

include memory for std::unique_ptr

Change-Id: I15f78ecfc53e75403bb8edbcd6e5400e8ecaaa44
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/128465
Tested-by: Jenkins
Reviewed-by: Caolán McNamara 

diff --git a/framework/inc/uielement/toolbarwrapper.hxx 
b/framework/inc/uielement/toolbarwrapper.hxx
index 55142f98d500..da90455b21da 100644
--- a/framework/inc/uielement/toolbarwrapper.hxx
+++ b/framework/inc/uielement/toolbarwrapper.hxx
@@ -25,6 +25,8 @@
 #include 
 #include 
 
+#include 
+
 namespace weld
 {
 class Builder;


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

2021-12-25 Thread Noel Grandin (via logerrit)
 framework/inc/uielement/statusbaritem.hxx|   10 --
 framework/source/uielement/statusbaritem.cxx |   12 +---
 2 files changed, 9 insertions(+), 13 deletions(-)

New commits:
commit 8566b3f8d2c89ac408e5a66335f978848bfc9e9f
Author: Noel Grandin 
AuthorDate: Fri Dec 24 20:42:20 2021 +0200
Commit: Noel Grandin 
CommitDate: Sun Dec 26 08:23:53 2021 +0100

use comphelper::WeakComponentImplHelper in StatusbarItem

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

diff --git a/framework/inc/uielement/statusbaritem.hxx 
b/framework/inc/uielement/statusbaritem.hxx
index 62e3c1f4e62e..44fecd1dff68 100644
--- a/framework/inc/uielement/statusbaritem.hxx
+++ b/framework/inc/uielement/statusbaritem.hxx
@@ -19,8 +19,7 @@
 #pragma once
 
 #include 
-#include 
-#include 
+#include 
 #include 
 
 class StatusBar;
@@ -30,10 +29,9 @@ namespace framework
 
 struct AddonStatusbarItemData;
 
-typedef cppu::WeakComponentImplHelper< css::ui::XStatusbarItem > 
StatusbarItem_Base;
+typedef comphelper::WeakComponentImplHelper< css::ui::XStatusbarItem > 
StatusbarItem_Base;
 
-class StatusbarItem final : protected cppu::BaseMutex,
-  public StatusbarItem_Base
+class StatusbarItem final : public StatusbarItem_Base
 {
 public:
 explicit StatusbarItem(
@@ -42,7 +40,7 @@ public:
 const OUString&   aCommand );
 virtual ~StatusbarItem() override;
 
-void SAL_CALL disposing() override;
+void disposing(std::unique_lock&) override;
 
 // css::ui::XStatusbarItem Attributes
 virtual OUString SAL_CALL getCommand() override;
diff --git a/framework/source/uielement/statusbaritem.cxx 
b/framework/source/uielement/statusbaritem.cxx
index a453f0079fc0..27985791ae86 100644
--- a/framework/source/uielement/statusbaritem.cxx
+++ b/framework/source/uielement/statusbaritem.cxx
@@ -62,8 +62,7 @@ StatusbarItem::StatusbarItem(
 StatusBar  *pStatusBar,
 sal_uInt16  nId,
 const OUString&aCommand )
-: StatusbarItem_Base( m_aMutex )
-, m_pStatusBar( pStatusBar )
+: m_pStatusBar( pStatusBar )
 , m_nId( nId )
 , m_nStyle( 0 )
 , m_aCommand( aCommand )
@@ -77,21 +76,20 @@ StatusbarItem::~StatusbarItem()
 {
 }
 
-void SAL_CALL StatusbarItem::disposing()
+void StatusbarItem::disposing(std::unique_lock&)
 {
-osl::MutexGuard aGuard( m_aMutex );
 m_pStatusBar = nullptr;
 }
 
 OUString SAL_CALL StatusbarItem::getCommand()
 {
-osl::MutexGuard aGuard( m_aMutex );
+std::unique_lock aGuard( m_aMutex );
 return m_aCommand;
 }
 
 ::sal_uInt16 SAL_CALL StatusbarItem::getItemId()
 {
-osl::MutexGuard aGuard( m_aMutex );
+std::unique_lock aGuard( m_aMutex );
 return m_nId;
 }
 
@@ -106,7 +104,7 @@ OUString SAL_CALL StatusbarItem::getCommand()
 
 ::sal_uInt16 SAL_CALL StatusbarItem::getStyle()
 {
-osl::MutexGuard aGuard( m_aMutex );
+std::unique_lock aGuard( m_aMutex );
 return m_nStyle;
 }
 


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

2021-12-25 Thread Noel Grandin (via logerrit)
 framework/inc/uielement/uicommanddescription.hxx|8 +++-
 framework/source/uielement/uicommanddescription.cxx |   14 ++
 2 files changed, 9 insertions(+), 13 deletions(-)

New commits:
commit a839a6afada46b44095be184548f6fa75d80e961
Author: Noel Grandin 
AuthorDate: Fri Dec 24 20:46:01 2021 +0200
Commit: Noel Grandin 
CommitDate: Sun Dec 26 08:23:14 2021 +0100

use comphelper::WeakComponentImplHelper in UICommandDescription

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

diff --git a/framework/inc/uielement/uicommanddescription.hxx 
b/framework/inc/uielement/uicommanddescription.hxx
index 146b4f42db3a..aeeb1f9aa216 100644
--- a/framework/inc/uielement/uicommanddescription.hxx
+++ b/framework/inc/uielement/uicommanddescription.hxx
@@ -26,19 +26,17 @@
 #include 
 #include 
 
-#include 
-#include 
+#include 
 #include 
 #include 
 #include 
 
 namespace framework
 {
-typedef ::cppu::WeakComponentImplHelper< css::lang::XServiceInfo,
+typedef comphelper::WeakComponentImplHelper< css::lang::XServiceInfo,
 css::container::XNameAccess > UICommandDescription_BASE;
 
-class UICommandDescription : private cppu::BaseMutex,
- public UICommandDescription_BASE
+class UICommandDescription : public UICommandDescription_BASE
 {
 public:
 UICommandDescription( const css::uno::Reference< 
css::uno::XComponentContext >& rxContext );
diff --git a/framework/source/uielement/uicommanddescription.cxx 
b/framework/source/uielement/uicommanddescription.cxx
index 682b482766fc..9f81afced1a7 100644
--- a/framework/source/uielement/uicommanddescription.cxx
+++ b/framework/source/uielement/uicommanddescription.cxx
@@ -565,8 +565,7 @@ void 
UICommandDescription::ensureGenericUICommandsForLanguage(const LanguageTag&
 }
 
 UICommandDescription::UICommandDescription(const Reference< XComponentContext 
>& rxContext)
-: UICommandDescription_BASE(m_aMutex)
-, m_aPrivateResourceURL(PRIVATE_RESOURCE_URL)
+: m_aPrivateResourceURL(PRIVATE_RESOURCE_URL)
 , m_xContext(rxContext)
 {
 SvtSysLocale aSysLocale;
@@ -584,14 +583,13 @@ UICommandDescription::UICommandDescription(const 
Reference< XComponentContext >&
 }
 
 UICommandDescription::UICommandDescription(const Reference< XComponentContext 
>& rxContext, bool)
-: UICommandDescription_BASE(m_aMutex)
-, m_xContext(rxContext)
+: m_xContext(rxContext)
 {
 }
 
 UICommandDescription::~UICommandDescription()
 {
-osl::MutexGuard g(rBHelper.rMutex);
+std::unique_lock g(m_aMutex);
 m_aModuleToCommandFileMap.clear();
 m_aUICommandsHashMap.clear();
 m_xGenericUICommands.clear();
@@ -637,7 +635,7 @@ Any SAL_CALL UICommandDescription::getByName( const 
OUString& aName )
 const LanguageTag& rCurrentLanguage = aSysLocale.GetUILanguageTag();
 Any a;
 
-osl::MutexGuard g(rBHelper.rMutex);
+std::unique_lock g(m_aMutex);
 
 ModuleToCommandFileMap::const_iterator pM2CIter = 
m_aModuleToCommandFileMap.find( aName );
 if ( pM2CIter != m_aModuleToCommandFileMap.end() )
@@ -682,14 +680,14 @@ Any SAL_CALL UICommandDescription::getByName( const 
OUString& aName )
 
 Sequence< OUString > SAL_CALL UICommandDescription::getElementNames()
 {
-osl::MutexGuard g(rBHelper.rMutex);
+std::unique_lock g(m_aMutex);
 
 return comphelper::mapKeysToSequence( m_aModuleToCommandFileMap );
 }
 
 sal_Bool SAL_CALL UICommandDescription::hasByName( const OUString& aName )
 {
-osl::MutexGuard g(rBHelper.rMutex);
+std::unique_lock g(m_aMutex);
 
 ModuleToCommandFileMap::const_iterator pIter = 
m_aModuleToCommandFileMap.find( aName );
 return ( pIter != m_aModuleToCommandFileMap.end() );


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

2021-12-20 Thread Noel Grandin (via logerrit)
 framework/inc/dispatch/oxt_handler.hxx|3 ++-
 framework/source/dispatch/oxt_handler.cxx |2 +-
 2 files changed, 3 insertions(+), 2 deletions(-)

New commits:
commit 599cb40c92f2d758d21c7040790cbf2ceab213f3
Author: Noel Grandin 
AuthorDate: Sat Dec 18 18:55:02 2021 +0200
Commit: Noel Grandin 
CommitDate: Mon Dec 20 09:47:16 2021 +0100

osl::Mutex->std::mutex in Oxt_Handler

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

diff --git a/framework/inc/dispatch/oxt_handler.hxx 
b/framework/inc/dispatch/oxt_handler.hxx
index 162821bc1aa8..85c6312efbf9 100644
--- a/framework/inc/dispatch/oxt_handler.hxx
+++ b/framework/inc/dispatch/oxt_handler.hxx
@@ -28,6 +28,7 @@
 #include 
 
 #include 
+#include 
 
 namespace framework{
 
@@ -78,7 +79,7 @@ class Oxt_Handler final  :  public  ::cppu::WeakImplHelper<
 virtual OUString SAL_CALL detect (css::uno::Sequence< 
css::beans::PropertyValue >&lDescriptor ) override;
 
 private:
-osl::Mutex m_mutex;
+std::mutex m_mutex;
 
 css::uno::Reference< css::uno::XComponentContext > m_xContext;   
/// global uno service factory to create new services
 
diff --git a/framework/source/dispatch/oxt_handler.cxx 
b/framework/source/dispatch/oxt_handler.cxx
index 8c806dd9a2cc..35d196ee046f 100644
--- a/framework/source/dispatch/oxt_handler.cxx
+++ b/framework/source/dispatch/oxt_handler.cxx
@@ -91,7 +91,7 @@ void SAL_CALL Oxt_Handler::dispatchWithNotification( const 
css::util::URL& aURL,
  const css::uno::Sequence< 
css::beans::PropertyValue >&/*lArguments*/,
  const 
css::uno::Reference< css::frame::XDispatchResultListener >& xListener )
 {
-osl::MutexGuard g(m_mutex);
+std::unique_lock g(m_mutex);
 
 css::uno::Sequence< css::uno::Any > lParams{ css::uno::Any(aURL.Main) };
 


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

2021-12-20 Thread Noel Grandin (via logerrit)
 framework/inc/helper/wakeupthread.hxx|9 -
 framework/source/helper/wakeupthread.cxx |   12 +++-
 2 files changed, 11 insertions(+), 10 deletions(-)

New commits:
commit 95b7ecbbdb445a8f2408d1b0b3d32cb799d15568
Author: Noel Grandin 
AuthorDate: Sat Dec 18 19:03:44 2021 +0200
Commit: Noel Grandin 
CommitDate: Mon Dec 20 09:25:41 2021 +0100

osl::Mutex->std::mutex in WakeUpThread

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

diff --git a/framework/inc/helper/wakeupthread.hxx 
b/framework/inc/helper/wakeupthread.hxx
index f9099180d03f..cdc8700a5266 100644
--- a/framework/inc/helper/wakeupthread.hxx
+++ b/framework/inc/helper/wakeupthread.hxx
@@ -23,8 +23,8 @@
 
 #include 
 #include 
-#include 
-#include 
+#include 
+#include 
 #include 
 
 namespace com::sun::star::util
@@ -37,9 +37,8 @@ namespace framework
 class WakeUpThread final : public salhelper::Thread
 {
 css::uno::WeakReference updatable_;
-osl::Condition condition_;
-
-osl::Mutex mutex_;
+std::condition_variable condition_;
+std::mutex mutex_;
 bool terminate_;
 
 void execute() override;
diff --git a/framework/source/helper/wakeupthread.cxx 
b/framework/source/helper/wakeupthread.cxx
index 503f6707a010..556d59dbb581 100644
--- a/framework/source/helper/wakeupthread.cxx
+++ b/framework/source/helper/wakeupthread.cxx
@@ -25,13 +25,15 @@
 #include 
 
 #include 
+#include 
+
+using namespace std::chrono_literals;
 
 void framework::WakeUpThread::execute() {
 for (;;) {
-TimeValue t{0, 2500}; // 25 msec
-condition_.wait();
 {
-osl::MutexGuard g(mutex_);
+std::unique_lock g(mutex_);
+condition_.wait_for(g, 25ms, [this] { return terminate_; });
 if (terminate_) {
 break;
 }
@@ -50,10 +52,10 @@ framework::WakeUpThread::WakeUpThread(
 
 void framework::WakeUpThread::stop() {
 {
-osl::MutexGuard g(mutex_);
+std::unique_lock g(mutex_);
 terminate_ = true;
 }
-condition_.set();
+condition_.notify_one();
 join();
 }
 


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

2021-12-19 Thread Noel Grandin (via logerrit)
 framework/inc/jobs/helponstartup.hxx|3 ++-
 framework/source/jobs/helponstartup.cxx |   18 +-
 2 files changed, 11 insertions(+), 10 deletions(-)

New commits:
commit 7e44d8d78a3c58a5468c4c3331992a0c472560c6
Author: Noel Grandin 
AuthorDate: Sat Dec 18 18:57:12 2021 +0200
Commit: Noel Grandin 
CommitDate: Mon Dec 20 08:34:04 2021 +0100

osl::Mutex->std::mutex in HelpOnStartup

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

diff --git a/framework/inc/jobs/helponstartup.hxx 
b/framework/inc/jobs/helponstartup.hxx
index 63326f00454d..6df378c726b9 100644
--- a/framework/inc/jobs/helponstartup.hxx
+++ b/framework/inc/jobs/helponstartup.hxx
@@ -21,6 +21,7 @@
 
 #include 
 
+#include 
 #include 
 
 #include 
@@ -44,7 +45,7 @@ class HelpOnStartup final : public ::cppu::WeakImplHelper< 
css::lang::XServiceIn
 
 // member
 private:
-osl::Mutex m_mutex;
+std::mutex m_mutex;
 
 /** @short  reference to a uno service manager. */
 css::uno::Reference< css::uno::XComponentContext > m_xContext;
diff --git a/framework/source/jobs/helponstartup.cxx 
b/framework/source/jobs/helponstartup.cxx
index 41c6c3dc3e1e..968a3aa10577 100644
--- a/framework/source/jobs/helponstartup.cxx
+++ b/framework/source/jobs/helponstartup.cxx
@@ -133,7 +133,7 @@ css::uno::Any SAL_CALL HelpOnStartup::execute(const 
css::uno::Sequence< css::bea
 
 void SAL_CALL HelpOnStartup::disposing(const css::lang::EventObject& aEvent)
 {
-osl::MutexGuard g(m_mutex);
+std::unique_lock g(m_mutex);
 if (aEvent.Source == m_xModuleManager)
 m_xModuleManager.clear();
 else if (aEvent.Source == m_xDesktop)
@@ -174,9 +174,9 @@ OUString HelpOnStartup::its_getModuleIdFromEnv(const 
css::uno::Sequence< css::be
 // OK - now we are sure this document is a top level document.
 // Classify it.
 // SAFE ->
-osl::ClearableMutexGuard aLock(m_mutex);
+std::unique_lock aLock(m_mutex);
 css::uno::Reference< css::frame::XModuleManager2 > xModuleManager = 
m_xModuleManager;
-aLock.clear();
+aLock.unlock();
 // <- SAFE
 
 OUString sModuleId;
@@ -195,9 +195,9 @@ OUString HelpOnStartup::its_getModuleIdFromEnv(const 
css::uno::Sequence< css::be
 OUString HelpOnStartup::its_getCurrentHelpURL()
 {
 // SAFE ->
-osl::ClearableMutexGuard aLock(m_mutex);
+std::unique_lock aLock(m_mutex);
 css::uno::Reference< css::frame::XDesktop2 > xDesktop = m_xDesktop;
-aLock.clear();
+aLock.unlock();
 // <- SAFE
 
 if (!xDesktop.is())
@@ -239,11 +239,11 @@ bool 
HelpOnStartup::its_isHelpUrlADefaultOne(std::u16string_view sHelpURL)
 return false;
 
 // SAFE ->
-osl::ClearableMutexGuard aLock(m_mutex);
+std::unique_lock aLock(m_mutex);
 css::uno::Reference< css::container::XNameAccess > xConfig = m_xConfig;
 OUStringsLocale = m_sLocale;
 OUStringsSystem = m_sSystem;
-aLock.clear();
+aLock.unlock();
 // <- SAFE
 
 if (!xConfig.is())
@@ -282,11 +282,11 @@ bool 
HelpOnStartup::its_isHelpUrlADefaultOne(std::u16string_view sHelpURL)
 OUString HelpOnStartup::its_checkIfHelpEnabledAndGetURL(const OUString& 
sModule)
 {
 // SAFE ->
-osl::ClearableMutexGuard aLock(m_mutex);
+std::unique_lock aLock(m_mutex);
 css::uno::Reference< css::container::XNameAccess > xConfig = m_xConfig;
 OUStringsLocale = m_sLocale;
 OUStringsSystem = m_sSystem;
-aLock.clear();
+aLock.unlock();
 // <- SAFE
 
 OUString sHelpURL;


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

2021-12-02 Thread Noel Grandin (via logerrit)
 framework/inc/stdtypes.h   |9 -
 framework/source/services/autorecovery.cxx |9 +
 framework/source/services/frame.cxx|   23 +--
 3 files changed, 14 insertions(+), 27 deletions(-)

New commits:
commit 95266ea93458644c89f1ac7bf924c5323ed64544
Author: Noel Grandin 
AuthorDate: Wed Dec 1 20:28:29 2021 +0200
Commit: Noel Grandin 
CommitDate: Fri Dec 3 08:40:02 2021 +0100

use OMultiTypeInterfaceContainerHelperVar3 in framework

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

diff --git a/framework/inc/stdtypes.h b/framework/inc/stdtypes.h
index feec3ef92ceb..0ccc056cf605 100644
--- a/framework/inc/stdtypes.h
+++ b/framework/inc/stdtypes.h
@@ -21,7 +21,6 @@
 
 #include 
 
-#include 
 #include 
 
 namespace framework{
@@ -55,14 +54,6 @@ struct KeyEventEqualsFunc
 }
 };
 
-/**
-It can be used to map names (e.g. of properties) to her corresponding 
handles.
-Our helper class OPropertySetHelper works optimized with handles but 
sometimes we have only a property name.
-Mapping between these two parts of a property should be done in the 
fastest way :-)
-*/
-
-typedef comphelper::OMultiTypeInterfaceContainerHelperVar2 
ListenerHash;
-
 }   // namespace framework
 
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/framework/source/services/autorecovery.cxx 
b/framework/source/services/autorecovery.cxx
index ebcae2a0862b..724d09204f68 100644
--- a/framework/source/services/autorecovery.cxx
+++ b/framework/source/services/autorecovery.cxx
@@ -75,6 +75,7 @@
 #include 
 #include 
 #include 
+#include 
 #include 
 #include 
 #include 
@@ -419,7 +420,7 @@ private:
 
 /** @short  contains all status listener registered at this instance.
  */
-ListenerHash m_lListener;
+
comphelper::OMultiTypeInterfaceContainerHelperVar3 m_lListener;
 
 /** @descr  This member is used to prevent us against re-entrance problems.
 A mutex can't help to prevent us from concurrent using of 
members
@@ -3477,7 +3478,7 @@ void AutoRecovery::implts_informListener(  Job
  eJob  ,
  const css::frame::FeatureStateEvent& 
aEvent)
 {
 // Helper shares mutex with us -> threadsafe!
-::comphelper::OInterfaceContainerHelper2* pListenerForURL = nullptr;
+::comphelper::OInterfaceContainerHelper3* 
pListenerForURL = nullptr;
 OUString   sJob= 
AutoRecovery::implst_getJobDescription(eJob);
 
 // inform listener, which are registered for any URLs(!)
@@ -3485,12 +3486,12 @@ void AutoRecovery::implts_informListener(  Job  
eJob  ,
 if(pListenerForURL == nullptr)
 return;
 
-::comphelper::OInterfaceIteratorHelper2 pIt(*pListenerForURL);
+::comphelper::OInterfaceIteratorHelper3 pIt(*pListenerForURL);
 while(pIt.hasMoreElements())
 {
 try
 {
-
static_cast(pIt.next())->statusChanged(aEvent);
+pIt.next()->statusChanged(aEvent);
 }
 catch(const css::uno::RuntimeException&)
 {
diff --git a/framework/source/services/frame.cxx 
b/framework/source/services/frame.cxx
index 991a7b58131b..fde9da72234a 100644
--- a/framework/source/services/frame.cxx
+++ b/framework/source/services/frame.cxx
@@ -68,6 +68,7 @@
 
 #include 
 #include 
+#include 
 #include 
 #include 
 #include 
@@ -418,8 +419,8 @@ private:
 typedef std::unordered_map TPropInfoHash;
 TPropInfoHash m_lProps;
 
-ListenerHash m_lSimpleChangeListener;
-ListenerHash m_lVetoChangeListener;
+
comphelper::OMultiTypeInterfaceContainerHelperVar3 m_lSimpleChangeListener;
+
comphelper::OMultiTypeInterfaceContainerHelperVar3 m_lVetoChangeListener;
 
 // hold it weak ... otherwise this helper has to be "killed" explicitly .-)
 css::uno::WeakReference< css::uno::XInterface > m_xBroadcaster;
@@ -2860,19 +2861,16 @@ bool XFrameImpl::impl_existsVeto(const 
css::beans::PropertyChangeEvent& aEvent)
 The used helper is threadsafe and it lives for the whole lifetime of
 our own object.
 */
-::comphelper::OInterfaceContainerHelper2* pVetoListener = 
m_lVetoChangeListener.getContainer(aEvent.PropertyName);
+
::comphelper::OInterfaceContainerHelper3* 
pVetoListener = m_lVetoChangeListener.getContainer(aEvent.PropertyName);
 if (! pVetoListener)
 return false;
 
-::comphelper::OInterfaceIteratorHelper2 pListener(*pVetoListener);
+::comphelper::OInterfaceIteratorHelper3 pListener(*pVetoListener);
 while (pListener.hasMoreElements())
 {
 try
 {
-css::uno::Reference< css::beans::XVetoableChangeListener > 
xListener(
-
static_cast(pListener.next()),
-css::uno::UNO_QUERY_THROW);
- 

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

2021-11-26 Thread Noel Grandin (via logerrit)
 framework/inc/properties.h |   45 -
 1 file changed, 45 deletions(-)

New commits:
commit f4253900e26e0c1434c19f6af74930a8b5b470b9
Author: Noel Grandin 
AuthorDate: Fri Nov 26 10:54:35 2021 +0200
Commit: Noel Grandin 
CommitDate: Fri Nov 26 11:55:04 2021 +0100

remove unused defines

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

diff --git a/framework/inc/properties.h b/framework/inc/properties.h
index 3af932eeab8d..fead8e3e1fad 100644
--- a/framework/inc/properties.h
+++ b/framework/inc/properties.h
@@ -34,7 +34,6 @@ inline constexpr OUStringLiteral FRAME_PROPNAME_ASCII_URL = 
u"URL";
 
 // Please add new entries alphabetical sorted and correct all other handles!
 // Start counting with 0, so it can be used as direct index into an array too.
-// Don't forget updating of define FRAME_PROPCOUNT below!!!
 #define FRAME_PROPHANDLE_DISPATCHRECORDERSUPPLIER   0
 #define FRAME_PROPHANDLE_ISHIDDEN   1
 #define FRAME_PROPHANDLE_LAYOUTMANAGER  2
@@ -42,36 +41,6 @@ inline constexpr OUStringLiteral FRAME_PROPNAME_ASCII_URL = 
u"URL";
 #define FRAME_PROPHANDLE_INDICATORINTERCEPTION  4
 #define FRAME_PROPHANDLE_URL 5
 
-#define FRAME_PROPCOUNT 6
-
-/** properties for "PathSettings" class */
-
-#define PATHSETTINGS_PROPNAME_ASCII_ADDIN   "Addin"
-#define PATHSETTINGS_PROPNAME_ASCII_AUTOCORRECT "AutoCorrect"
-#define PATHSETTINGS_PROPNAME_ASCII_AUTOTEXT"AutoText"
-#define PATHSETTINGS_PROPNAME_ASCII_BACKUP  "Backup"
-#define PATHSETTINGS_PROPNAME_ASCII_BASIC   "Basic"
-#define PATHSETTINGS_PROPNAME_ASCII_BITMAP  "Bitmap"
-#define PATHSETTINGS_PROPNAME_ASCII_CONFIG  "Config"
-#define PATHSETTINGS_PROPNAME_ASCII_DICTIONARY  "Dictionary"
-#define PATHSETTINGS_PROPNAME_ASCII_FAVORITE"Favorite"
-#define PATHSETTINGS_PROPNAME_ASCII_FILTER  "Filter"
-#define PATHSETTINGS_PROPNAME_ASCII_GALLERY "Gallery"
-#define PATHSETTINGS_PROPNAME_ASCII_GRAPHIC "Graphic"
-#define PATHSETTINGS_PROPNAME_ASCII_HELP"Help"
-#define PATHSETTINGS_PROPNAME_ASCII_LINGUISTIC  "Linguistic"
-#define PATHSETTINGS_PROPNAME_ASCII_MODULE  "Module"
-#define PATHSETTINGS_PROPNAME_ASCII_PALETTE "Palette"
-#define PATHSETTINGS_PROPNAME_ASCII_PLUGIN  "Plugin"
-#define PATHSETTINGS_PROPNAME_ASCII_STORAGE "Storage"
-#define PATHSETTINGS_PROPNAME_ASCII_TEMP"Temp"
-#define PATHSETTINGS_PROPNAME_ASCII_TEMPLATE"Template"
-#define PATHSETTINGS_PROPNAME_ASCII_UICONFIG"UIConfig"
-#define PATHSETTINGS_PROPNAME_ASCII_USERCONFIG  "UserConfig"
-#define PATHSETTINGS_PROPNAME_ASCII_USERDICTIONARY  "UserDictionary"
-#define PATHSETTINGS_PROPNAME_ASCII_WORK"Work"
-
-
 /** properties for "LayoutManager" class */
 
 inline constexpr OUStringLiteral LAYOUTMANAGER_PROPNAME_ASCII_MENUBARCLOSER = 
u"MenuBarCloser";
@@ -112,8 +81,6 @@ inline constexpr OUStringLiteral 
AUTORECOVERY_PROPNAME_ASCII_CRASHED = u"Crashed
 #define AUTORECOVERY_PROPHANDLE_EXISTS_SESSIONDATA  1
 #define AUTORECOVERY_PROPHANDLE_CRASHED 2
 
-#define AUTORECOVERY_PROPCOUNT  3
-
 /** properties for Filter config */
 
 inline constexpr OUStringLiteral FILTER_PROPNAME_ASCII_DOCUMENTSERVICE = 
u"DocumentService";
@@ -123,18 +90,6 @@ inline constexpr OUStringLiteral 
FILTER_PROPNAME_ASCII_DOCUMENTSERVICE = u"Docum
 inline constexpr OUStringLiteral OFFICEFACTORY_PROPNAME_ASCII_UINAME = 
u"ooSetupFactoryUIName";
 inline constexpr OUStringLiteral OFFICEFACTORY_PROPNAME_ASCII_ICON = 
u"ooSetupFactoryIcon";
 
-/** properties for tab window (old) */
-#define TABWINDOW_PROPNAME_ASCII_PARENTWINDOW   "ParentWindow"
-#define TABWINDOW_PROPNAME_ASCII_TOPWINDOW  "TopWindow"
-#define TABWINDOW_PROPNAME_PARENTWINDOW 
TABWINDOW_PROPNAME_ASCII_PARENTWINDOW
-#define TABWINDOW_PROPNAME_TOPWINDOW
TABWINDOW_PROPNAME_ASCII_TOPWINDOW
-
-#define TABWINDOW_PROPHANDLE_PARENTWINDOW   0
-#define TABWINDOW_PROPHANDLE_TOPWINDOW  1
-#define TABWINDOW_PROPCOUNT 2
-
-#define TABWINDOWSERVICE_PROPHANDLE_WINDOW  0
-
 /** provides some helper methods to implement property sets. */
 
 class PropHelper


[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 

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

2021-11-21 Thread Noel Grandin (via logerrit)
 framework/inc/uifactory/configurationaccessfactorymanager.hxx |3 +
 framework/source/uifactory/uielementfactorymanager.cxx|   20 +-
 2 files changed, 12 insertions(+), 11 deletions(-)

New commits:
commit d54a1380d13d8d832841cdc33440aac2e14d3300
Author: Noel Grandin 
AuthorDate: Sun Nov 21 12:03:13 2021 +0200
Commit: Noel Grandin 
CommitDate: Sun Nov 21 19:42:48 2021 +0100

osl::Mutex->std::mutex in ConfigurationAccess_FactoryManager

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

diff --git a/framework/inc/uifactory/configurationaccessfactorymanager.hxx 
b/framework/inc/uifactory/configurationaccessfactorymanager.hxx
index 7b12048e1223..9f710d235c8d 100644
--- a/framework/inc/uifactory/configurationaccessfactorymanager.hxx
+++ b/framework/inc/uifactory/configurationaccessfactorymanager.hxx
@@ -30,6 +30,7 @@
 #include 
 #include 
 
+#include 
 #include 
 #include 
 
@@ -64,7 +65,7 @@ class ConfigurationAccess_FactoryManager final : public 
::cppu::WeakImplHelper<
 
 bool impl_getElementProps( const css::uno::Any& rElement, OUString& 
rType, OUString& rName, OUString& rModule, OUString& rServiceSpecifier ) const;
 
-mutable osl::Mutex   m_aMutex;
+mutable std::mutex   m_aMutex;
 OUString m_aPropType;
 OUString m_aPropName;
 OUString m_aPropModule;
diff --git a/framework/source/uifactory/uielementfactorymanager.cxx 
b/framework/source/uifactory/uielementfactorymanager.cxx
index 029d8790943f..a8c40552609f 100644
--- a/framework/source/uifactory/uielementfactorymanager.cxx
+++ b/framework/source/uifactory/uielementfactorymanager.cxx
@@ -78,7 +78,7 @@ 
ConfigurationAccess_FactoryManager::ConfigurationAccess_FactoryManager( const Re
 ConfigurationAccess_FactoryManager::~ConfigurationAccess_FactoryManager()
 {
 // SAFE
-osl::MutexGuard g(m_aMutex);
+std::unique_lock g(m_aMutex);
 
 Reference< XContainer > xContainer( m_xConfigAccess, UNO_QUERY );
 if ( xContainer.is() )
@@ -88,7 +88,7 @@ 
ConfigurationAccess_FactoryManager::~ConfigurationAccess_FactoryManager()
 OUString 
ConfigurationAccess_FactoryManager::getFactorySpecifierFromTypeNameModule( 
std::u16string_view rType, const OUString& rName, std::u16string_view rModule ) 
const
 {
 // SAFE
-osl::MutexGuard g(m_aMutex);
+std::unique_lock g(m_aMutex);
 
 FactoryManagerMap::const_iterator pIter =
 m_aFactoryManagerMap.find( getHashKeyFromStrings( rType, rName, 
rModule ));
@@ -124,7 +124,7 @@ OUString 
ConfigurationAccess_FactoryManager::getFactorySpecifierFromTypeNameModu
 void ConfigurationAccess_FactoryManager::addFactorySpecifierToTypeNameModule( 
std::u16string_view rType, std::u16string_view rName, std::u16string_view 
rModule, const OUString& rServiceSpecifier )
 {
 // SAFE
-osl::MutexGuard g(m_aMutex);
+std::unique_lock g(m_aMutex);
 
 OUString aHashKey = getHashKeyFromStrings( rType, rName, rModule );
 
@@ -138,7 +138,7 @@ void 
ConfigurationAccess_FactoryManager::addFactorySpecifierToTypeNameModule( st
 void 
ConfigurationAccess_FactoryManager::removeFactorySpecifierFromTypeNameModule( 
std::u16string_view rType, std::u16string_view rName, std::u16string_view 
rModule )
 {
 // SAFE
-osl::MutexGuard g(m_aMutex);
+std::unique_lock g(m_aMutex);
 
 OUString aHashKey = getHashKeyFromStrings( rType, rName, rModule );
 
@@ -152,7 +152,7 @@ void 
ConfigurationAccess_FactoryManager::removeFactorySpecifierFromTypeNameModul
 Sequence< Sequence< PropertyValue > > 
ConfigurationAccess_FactoryManager::getFactoriesDescription() const
 {
 // SAFE
-osl::MutexGuard g(m_aMutex);
+std::unique_lock g(m_aMutex);
 
 Sequence< Sequence< PropertyValue > > aSeqSeq;
 
@@ -198,7 +198,7 @@ void SAL_CALL 
ConfigurationAccess_FactoryManager::elementInserted( const Contain
 OUString   aService;
 
 // SAFE
-osl::MutexGuard g(m_aMutex);
+std::unique_lock g(m_aMutex);
 
 if ( impl_getElementProps( aEvent.Element, aType, aName, aModule, aService 
))
 {
@@ -217,7 +217,7 @@ void SAL_CALL 
ConfigurationAccess_FactoryManager::elementRemoved ( const Contain
 OUString   aService;
 
 // SAFE
-osl::MutexGuard g(m_aMutex);
+std::unique_lock g(m_aMutex);
 
 if ( impl_getElementProps( aEvent.Element, aType, aName, aModule, aService 
))
 {
@@ -236,7 +236,7 @@ void SAL_CALL 
ConfigurationAccess_FactoryManager::elementReplaced( const Contain
 OUString   aService;
 
 // SAFE
-osl::MutexGuard g(m_aMutex);
+std::unique_lock g(m_aMutex);
 
 if ( impl_getElementProps( aEvent.Element, aType, aName, aModule, aService 
))
 {
@@ -253,14 +253,14 @@ void SAL_CALL 
ConfigurationAccess_FactoryManager::disposing( const EventObject&
 {
 // SAFE
 // remove our 

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

2021-11-21 Thread Noel Grandin (via logerrit)
 framework/inc/uifactory/factoryconfiguration.hxx|6 ++--
 framework/source/uifactory/factoryconfiguration.cxx |   28 
 2 files changed, 16 insertions(+), 18 deletions(-)

New commits:
commit c33b0e928e07387bf60708be3f3dc07d9840663c
Author: Noel Grandin 
AuthorDate: Sun Nov 21 12:07:29 2021 +0200
Commit: Noel Grandin 
CommitDate: Sun Nov 21 15:47:48 2021 +0100

osl::Mutex->std::mutex in ConfigurationAccess_ControllerFactory

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

diff --git a/framework/inc/uifactory/factoryconfiguration.hxx 
b/framework/inc/uifactory/factoryconfiguration.hxx
index 1ba2a622c74c..9cfed290f3ce 100644
--- a/framework/inc/uifactory/factoryconfiguration.hxx
+++ b/framework/inc/uifactory/factoryconfiguration.hxx
@@ -27,6 +27,7 @@
 #include 
 #include 
 
+#include 
 #include 
 #include 
 
@@ -45,7 +46,6 @@ public:
 virtual   ~ConfigurationAccess_ControllerFactory() override;
 
 void  readConfigurationData();
-void  updateConfigurationData();
 
 OUString getServiceFromCommandModule( std::u16string_view rCommandURL, 
std::u16string_view rModule ) const;
 OUString getValueFromCommandModule( std::u16string_view rCommandURL, 
std::u16string_view rModule ) const;
@@ -61,6 +61,8 @@ public:
 virtual void SAL_CALL disposing( const css::lang::EventObject& Source ) 
override;
 
 private:
+void  updateConfigurationDataImpl();
+
 struct ControllerInfo
 {
 OUString m_aImplementationName;
@@ -75,7 +77,7 @@ private:
 
 bool impl_getElementProps( const css::uno::Any& aElement, OUString& 
aCommand, OUString& aModule, OUString& aServiceSpecifier,OUString& aValue ) 
const;
 
-mutable osl::Mutex   m_mutex;
+mutable std::mutex   m_mutex;
 OUString m_aPropCommand;
 OUString m_aPropModule;
 OUString m_aPropController;
diff --git a/framework/source/uifactory/factoryconfiguration.cxx 
b/framework/source/uifactory/factoryconfiguration.cxx
index c0c75db7bba8..d27cdb145dbd 100644
--- a/framework/source/uifactory/factoryconfiguration.cxx
+++ b/framework/source/uifactory/factoryconfiguration.cxx
@@ -66,7 +66,7 @@ 
ConfigurationAccess_ControllerFactory::ConfigurationAccess_ControllerFactory( co
 
 ConfigurationAccess_ControllerFactory::~ConfigurationAccess_ControllerFactory()
 {
-osl::MutexGuard g(m_mutex);
+std::unique_lock g(m_mutex);
 
 Reference< XContainer > xContainer( m_xConfigAccess, UNO_QUERY );
 if ( xContainer.is() )
@@ -75,7 +75,7 @@ 
ConfigurationAccess_ControllerFactory::~ConfigurationAccess_ControllerFactory()
 
 OUString ConfigurationAccess_ControllerFactory::getServiceFromCommandModule( 
std::u16string_view rCommandURL, std::u16string_view rModule ) const
 {
-osl::MutexGuard g(m_mutex);
+std::unique_lock g(m_mutex);
 MenuControllerMap::const_iterator pIter = m_aMenuControllerMap.find( 
getHashKeyFromStrings( rCommandURL, rModule ));
 
 if ( pIter != m_aMenuControllerMap.end() )
@@ -94,7 +94,7 @@ OUString 
ConfigurationAccess_ControllerFactory::getServiceFromCommandModule( std
 }
 OUString ConfigurationAccess_ControllerFactory::getValueFromCommandModule( 
std::u16string_view rCommandURL, std::u16string_view rModule ) const
 {
-osl::MutexGuard g(m_mutex);
+std::unique_lock g(m_mutex);
 
 MenuControllerMap::const_iterator pIter = m_aMenuControllerMap.find( 
getHashKeyFromStrings( rCommandURL, rModule ));
 
@@ -118,7 +118,7 @@ void 
ConfigurationAccess_ControllerFactory::addServiceToCommandModule(
 std::u16string_view rModule,
 const OUString& rServiceSpecifier )
 {
-osl::MutexGuard g(m_mutex);
+std::unique_lock g(m_mutex);
 
 OUString aHashKey = getHashKeyFromStrings( rCommandURL, rModule );
 m_aMenuControllerMap.emplace( 
aHashKey,ControllerInfo(rServiceSpecifier,OUString()) );
@@ -128,7 +128,7 @@ void 
ConfigurationAccess_ControllerFactory::removeServiceFromCommandModule(
 std::u16string_view rCommandURL,
 std::u16string_view rModule )
 {
-osl::MutexGuard g(m_mutex);
+std::unique_lock g(m_mutex);
 
 OUString aHashKey = getHashKeyFromStrings( rCommandURL, rModule );
 m_aMenuControllerMap.erase( aHashKey );
@@ -142,7 +142,7 @@ void SAL_CALL 
ConfigurationAccess_ControllerFactory::elementInserted( const Cont
 OUString   aService;
 OUString   aValue;
 
-osl::MutexGuard g(m_mutex);
+std::unique_lock g(m_mutex);
 
 if ( impl_getElementProps( aEvent.Element, aCommand, aModule, aService, 
aValue ))
 {
@@ -162,7 +162,7 @@ void SAL_CALL 
ConfigurationAccess_ControllerFactory::elementRemoved ( const Cont
 OUString   aService;
 OUString   aValue;
 
-osl::MutexGuard g(m_mutex);
+std::unique_lock g(m_mutex);
 
 if ( impl_getElementProps( 

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

2021-11-12 Thread Noel Grandin (via logerrit)
 framework/inc/xml/toolboxconfigurationdefines.hxx   |   18 +-
 framework/source/fwe/xml/toolboxdocumenthandler.cxx |6 +--
 include/rtl/ustring.hxx |   35 
 3 files changed, 47 insertions(+), 12 deletions(-)

New commits:
commit a4d4286a6ae5ad7f57db4f34380ed170b92ced06
Author: Noel Grandin 
AuthorDate: Fri Nov 12 12:20:18 2021 +0200
Commit: Noel Grandin 
CommitDate: Fri Nov 12 18:37:38 2021 +0100

introduce OUStringConstExpr

so we can declare compile-time constant arrays and structs
containing OUStringLiteral

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

diff --git a/framework/inc/xml/toolboxconfigurationdefines.hxx 
b/framework/inc/xml/toolboxconfigurationdefines.hxx
index c84adff58e8b..b4aca76a6bef 100644
--- a/framework/inc/xml/toolboxconfigurationdefines.hxx
+++ b/framework/inc/xml/toolboxconfigurationdefines.hxx
@@ -52,14 +52,14 @@
 #define ATTRIBUTE_BOOLEAN_TRUE  "true"
 #define ATTRIBUTE_BOOLEAN_FALSE "false"
 
-#define ATTRIBUTE_ITEMSTYLE_RADIO   "radio"
-#define ATTRIBUTE_ITEMSTYLE_AUTO"auto"
-#define ATTRIBUTE_ITEMSTYLE_LEFT"left"
-#define ATTRIBUTE_ITEMSTYLE_AUTOSIZE"autosize"
-#define ATTRIBUTE_ITEMSTYLE_DROPDOWN"dropdown"
-#define ATTRIBUTE_ITEMSTYLE_REPEAT  "repeat"
-#define ATTRIBUTE_ITEMSTYLE_TEXT"text"
-#define ATTRIBUTE_ITEMSTYLE_DROPDOWNONLY"dropdownonly"
-#define ATTRIBUTE_ITEMSTYLE_IMAGE"image"
+constexpr OUStringLiteral ATTRIBUTE_ITEMSTYLE_RADIO = u"radio";
+constexpr OUStringLiteral ATTRIBUTE_ITEMSTYLE_AUTO = u"auto";
+constexpr OUStringLiteral ATTRIBUTE_ITEMSTYLE_LEFT = u"left";
+constexpr OUStringLiteral ATTRIBUTE_ITEMSTYLE_AUTOSIZE = u"autosize";
+constexpr OUStringLiteral ATTRIBUTE_ITEMSTYLE_DROPDOWN = u"dropdown";
+constexpr OUStringLiteral ATTRIBUTE_ITEMSTYLE_REPEAT = u"repeat";
+constexpr OUStringLiteral ATTRIBUTE_ITEMSTYLE_TEXT = u"text";
+constexpr OUStringLiteral ATTRIBUTE_ITEMSTYLE_DROPDOWNONLY = u"dropdownonly";
+constexpr OUStringLiteral ATTRIBUTE_ITEMSTYLE_IMAGE = u"image";
 
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/framework/source/fwe/xml/toolboxdocumenthandler.cxx 
b/framework/source/fwe/xml/toolboxdocumenthandler.cxx
index 4fd152a6f03e..11385edd9b5c 100644
--- a/framework/source/fwe/xml/toolboxdocumenthandler.cxx
+++ b/framework/source/fwe/xml/toolboxdocumenthandler.cxx
@@ -85,12 +85,12 @@ namespace {
 struct ToolboxStyleItem
 {
 sal_Int16 nBit;
-const char* attrName;
+rtl::OUStringConstExpr attrName;
 };
 
 }
 
-const ToolboxStyleItem Styles[ ] = {
+constexpr ToolboxStyleItem Styles[ ] = {
 { css::ui::ItemStyle::RADIO_CHECK,   ATTRIBUTE_ITEMSTYLE_RADIO },
 { css::ui::ItemStyle::ALIGN_LEFT,ATTRIBUTE_ITEMSTYLE_LEFT },
 { css::ui::ItemStyle::AUTO_SIZE, ATTRIBUTE_ITEMSTYLE_AUTO },
@@ -703,7 +703,7 @@ void OWriteToolBoxDocumentHandler::WriteToolBoxItem(
 {
 if ( !aValue.isEmpty() )
 aValue.append(" ");
-aValue.appendAscii( pStyle->attrName );
+aValue.append( OUString(pStyle->attrName) );
 }
 }
 pList->AddAttribute( m_aXMLToolbarNS + ATTRIBUTE_ITEMSTYLE,
diff --git a/include/rtl/ustring.hxx b/include/rtl/ustring.hxx
index 1a5ff2d97d6c..6cf92e1d3599 100644
--- a/include/rtl/ustring.hxx
+++ b/include/rtl/ustring.hxx
@@ -84,6 +84,7 @@ template class SAL_WARN_UNUSED OUStringLiteral 
{
 static_assert(N != 0);
 static_assert(N - 1 <= std::numeric_limits::max(), "literal too 
long");
 friend class OUString;
+friend class OUStringConstExpr;
 
 public:
 #if HAVE_CPP_CONSTEVAL
@@ -138,6 +139,34 @@ template struct 
ExceptCharArrayDetector> {};
 }
 #endif
 
+/**
+  This is intended to be used when declaring compile-time-constant structs or 
arrays
+  that can be initialised from named OUStringLiteral e.g.
+
+constexpr OUStringLiteral AAA = u"aaa";
+constexpr OUStringLiteral BBB = u"bbb";
+constexpr OUStringConstExpr FOO[] { AAA, BBB };
+*/
+class OUString;
+class OUStringConstExpr
+{
+public:
+template constexpr OUStringConstExpr(OUStringLiteral 
const & literal):
+pData(const_cast()) {}
+
+// prevent mis-use
+template constexpr OUStringConstExpr(OUStringLiteral && 
literal)
+= delete;
+
+// no destructor necessary because we know we are pointing at a 
compile-time
+// constant OUStringLiteral, which bypasses ref-counting.
+
+inline operator OUString() const;
+
+private:
+rtl_uString* pData;
+};
+
 /// @endcond
 #endif
 
@@ -3268,6 +3297,11 @@ private:
 
 };
 
+#if defined LIBO_INTERNAL_ONLY
+// Can only define this after we define OUString
+inline OUStringConstExpr::operator OUString() const { return 
OUString::unacquired(); }
+#endif
+
 #if defined 

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

2021-11-10 Thread Andrea Gelmini (via logerrit)
 framework/inc/helper/ocomponentenumeration.hxx |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit c57865d249a7d9760f4147e3a2379c9ca5a82a96
Author: Andrea Gelmini 
AuthorDate: Wed Nov 10 05:41:43 2021 +0100
Commit: Julien Nabet 
CommitDate: Wed Nov 10 20:49:45 2021 +0100

Fix typos

Change-Id: I697591f867fee5332913ee534b9f0ba754239e58
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/124943
Tested-by: Jenkins
Reviewed-by: Julien Nabet 

diff --git a/framework/inc/helper/ocomponentenumeration.hxx 
b/framework/inc/helper/ocomponentenumeration.hxx
index af48cdfe042f..5791b38779e3 100644
--- a/framework/inc/helper/ocomponentenumeration.hxx
+++ b/framework/inc/helper/ocomponentenumeration.hxx
@@ -126,7 +126,7 @@ class OComponentEnumeration final : public 
::cppu::WeakImplHelper< css::containe
 @descr  There are two ways to delete an instance of this 
class.
 1) delete with destructor
 2) dispose from parent or factory or...
-This method do the same for both ways! It frees used 
memory and release references...
+This method does the same for both ways! It frees used 
memory and releases references...
 
 @seealsomethod dispose()
 @seealsodestructor ~TaskEnumeration()


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

2021-10-12 Thread Andrea Gelmini (via logerrit)
 framework/inc/helper/ocomponentenumeration.hxx |4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

New commits:
commit 164ec9281aa57d52763e9622adb6e2e37d14bff8
Author: Andrea Gelmini 
AuthorDate: Tue Oct 12 11:09:55 2021 +0200
Commit: Julien Nabet 
CommitDate: Tue Oct 12 19:24:36 2021 +0200

Fix typo

Change-Id: I95bd5418d45ec4a0d0ff403244b7727e37b7d075
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/123443
Tested-by: Julien Nabet 
Reviewed-by: Julien Nabet 

diff --git a/framework/inc/helper/ocomponentenumeration.hxx 
b/framework/inc/helper/ocomponentenumeration.hxx
index 98f126bbc8d7..af48cdfe042f 100644
--- a/framework/inc/helper/ocomponentenumeration.hxx
+++ b/framework/inc/helper/ocomponentenumeration.hxx
@@ -125,8 +125,8 @@ class OComponentEnumeration final : public 
::cppu::WeakImplHelper< css::containe
 
 @descr  There are two ways to delete an instance of this 
class.
 1) delete with destructor
-2) dispose from parent or factory ore ...
-This method do the same for both ways! It free used 
memory and release references ...
+2) dispose from parent or factory or...
+This method do the same for both ways! It frees used 
memory and release references...
 
 @seealsomethod dispose()
 @seealsodestructor ~TaskEnumeration()


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

2021-09-22 Thread Stephan Bergmann (via logerrit)
 framework/inc/protocols.h   |   43 
 framework/source/layoutmanager/toolbarlayoutmanager.cxx |5 +
 framework/source/layoutmanager/toolbarlayoutmanager.hxx |3 -
 3 files changed, 29 insertions(+), 22 deletions(-)

New commits:
commit cb3058aa4e3155d97d47d1444b808da7297b5794
Author: Stephan Bergmann 
AuthorDate: Wed Sep 22 23:25:16 2021 +0200
Commit: Stephan Bergmann 
CommitDate: Thu Sep 23 07:25:40 2021 +0200

Extend loplugin:stringviewparam to starts/endsWith: framework

Change-Id: Idc92058e7d2ff63d55e97e6b2fee83314fc0334c
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/122498
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann 

diff --git a/framework/inc/protocols.h b/framework/inc/protocols.h
index f9dfffd85a3d..30d87cc59336 100644
--- a/framework/inc/protocols.h
+++ b/framework/inc/protocols.h
@@ -21,6 +21,11 @@
 
 #pragma once
 
+#include 
+
+#include 
+
+#include 
 #include 
 
 namespace framework{
@@ -34,23 +39,23 @@ namespace framework{
 // indicates a loadable content in general!
 #define SPECIALPROTOCOL_PRIVATE   "private:"
 // indicates loading of components using a model directly
-#define SPECIALPROTOCOL_PRIVATE_OBJECT"private:object"
+#define SPECIALPROTOCOL_PRIVATE_OBJECTu"private:object"
 // indicates loading of components using a stream only
-#define SPECIALPROTOCOL_PRIVATE_STREAM"private:stream"
+#define SPECIALPROTOCOL_PRIVATE_STREAMu"private:stream"
 // indicates creation of empty documents
-#define SPECIALPROTOCOL_PRIVATE_FACTORY   "private:factory"
+#define SPECIALPROTOCOL_PRIVATE_FACTORY   u"private:factory"
 // internal protocol of the sfx project for generic dispatch functionality
-#define SPECIALPROTOCOL_SLOT  "slot:"
+#define SPECIALPROTOCOL_SLOT  u"slot:"
 // external representation of the slot protocol using names instead of id's
-#define SPECIALPROTOCOL_UNO   ".uno:"
+#define SPECIALPROTOCOL_UNO   u".uno:"
 // special sfx protocol to execute macros
-#define SPECIALPROTOCOL_MACRO "macro:"
+#define SPECIALPROTOCOL_MACRO u"macro:"
 // generic way to start uno services during dispatch
-#define SPECIALPROTOCOL_SERVICE   "service:"
+#define SPECIALPROTOCOL_SERVICE   u"service:"
 // for sending mails
-#define SPECIALPROTOCOL_MAILTO"mailto:;
+#define SPECIALPROTOCOL_MAILTOu"mailto:;
 // for sending news
-#define SPECIALPROTOCOL_NEWS  "news:;
+#define SPECIALPROTOCOL_NEWS  u"news:;
 
 /** well known protocols */
 enum class EProtocol
@@ -75,37 +80,37 @@ class ProtocolCheck
 It should be used instead of specifyProtocol() if only this question
 is interesting to perform the code. We must not check for all possible 
protocols here...
  */
-static bool isProtocol( const OUString& sURL, EProtocol eRequired )
+static bool isProtocol( std::u16string_view sURL, EProtocol eRequired )
 {
 bool bRet = false;
 switch(eRequired)
 {
 case EProtocol::PrivateObject:
-bRet = sURL.startsWith(SPECIALPROTOCOL_PRIVATE_OBJECT);
+bRet = o3tl::starts_with(sURL, SPECIALPROTOCOL_PRIVATE_OBJECT);
 break;
 case EProtocol::PrivateStream:
-bRet = sURL.startsWith(SPECIALPROTOCOL_PRIVATE_STREAM);
+bRet = o3tl::starts_with(sURL, SPECIALPROTOCOL_PRIVATE_STREAM);
 break;
 case EProtocol::PrivateFactory:
-bRet = sURL.startsWith(SPECIALPROTOCOL_PRIVATE_FACTORY);
+bRet = o3tl::starts_with(sURL, 
SPECIALPROTOCOL_PRIVATE_FACTORY);
 break;
 case EProtocol::Slot:
-bRet = sURL.startsWith(SPECIALPROTOCOL_SLOT);
+bRet = o3tl::starts_with(sURL, SPECIALPROTOCOL_SLOT);
 break;
 case EProtocol::Uno:
-bRet = sURL.startsWith(SPECIALPROTOCOL_UNO);
+bRet = o3tl::starts_with(sURL, SPECIALPROTOCOL_UNO);
 break;
 case EProtocol::Macro:
-bRet = sURL.startsWith(SPECIALPROTOCOL_MACRO);
+bRet = o3tl::starts_with(sURL, SPECIALPROTOCOL_MACRO);
 break;
 case EProtocol::Service:
-bRet = sURL.startsWith(SPECIALPROTOCOL_SERVICE);
+bRet = o3tl::starts_with(sURL, SPECIALPROTOCOL_SERVICE);
 break;
 case EProtocol::MailTo:
-bRet = sURL.startsWith(SPECIALPROTOCOL_MAILTO);
+bRet = o3tl::starts_with(sURL, SPECIALPROTOCOL_MAILTO);
 break;
 case EProtocol::News:
-bRet = sURL.startsWith(SPECIALPROTOCOL_NEWS);
+bRet = o3tl::starts_with(sURL, SPECIALPROTOCOL_NEWS);
 break;
 default:
 bRet = false;
diff --git 

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

2021-09-21 Thread Stephan Bergmann (via logerrit)
 framework/inc/helper/propertysetcontainer.hxx   |5 ++---
 framework/inc/helper/statusindicatorfactory.hxx |4 ++--
 framework/inc/recording/dispatchrecorder.hxx|5 ++---
 framework/inc/uielement/menubarmanager.hxx  |5 ++---
 framework/source/fwe/xml/saxnamespacefilter.cxx |5 ++---
 framework/source/layoutmanager/toolbarlayoutmanager.hxx |5 ++---
 6 files changed, 12 insertions(+), 17 deletions(-)

New commits:
commit 504d2209e47ffeb223b2bcde9fc24e828cc5cd6f
Author: Stephan Bergmann 
AuthorDate: Mon Sep 20 21:56:37 2021 +0200
Commit: Stephan Bergmann 
CommitDate: Tue Sep 21 08:24:19 2021 +0200

Remove some "Attention" comments of little value

...and rather add sal/config.h includes, while at it

Change-Id: I0ea917b101d89f16228bea6b3102b630c8202e07
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/122369
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann 

diff --git a/framework/inc/helper/propertysetcontainer.hxx 
b/framework/inc/helper/propertysetcontainer.hxx
index f943a112a7ac..75c8414c3698 100644
--- a/framework/inc/helper/propertysetcontainer.hxx
+++ b/framework/inc/helper/propertysetcontainer.hxx
@@ -19,9 +19,8 @@
 
 #pragma once
 
-/** Attention: stl headers must(!) be included at first. Otherwise it can make 
trouble
-   with solaris headers ...
-*/
+#include 
+
 #include 
 #include 
 #include 
diff --git a/framework/inc/helper/statusindicatorfactory.hxx 
b/framework/inc/helper/statusindicatorfactory.hxx
index 3443bd881d25..b3f3984f7a2c 100644
--- a/framework/inc/helper/statusindicatorfactory.hxx
+++ b/framework/inc/helper/statusindicatorfactory.hxx
@@ -19,8 +19,8 @@
 
 #pragma once
 
-// Attention: stl headers must(!) be included at first. Otherwise it can make 
trouble
-// with solaris headers ...
+#include 
+
 #include 
 #include 
 
diff --git a/framework/inc/recording/dispatchrecorder.hxx 
b/framework/inc/recording/dispatchrecorder.hxx
index e8ba276da891..ec03189d3cb4 100644
--- a/framework/inc/recording/dispatchrecorder.hxx
+++ b/framework/inc/recording/dispatchrecorder.hxx
@@ -19,9 +19,8 @@
 
 #pragma once
 
-/** Attention: stl headers must(!) be included at first. Otherwise it can make 
trouble
-   with solaris headers ...
-*/
+#include 
+
 #include 
 
 #include 
diff --git a/framework/inc/uielement/menubarmanager.hxx 
b/framework/inc/uielement/menubarmanager.hxx
index e9fb1a9c32ae..a77552a67213 100644
--- a/framework/inc/uielement/menubarmanager.hxx
+++ b/framework/inc/uielement/menubarmanager.hxx
@@ -19,9 +19,8 @@
 
 #pragma once
 
-/** Attention: stl headers must(!) be included at first. Otherwise it can make 
trouble
-   with solaris headers ...
-*/
+#include 
+
 #include 
 #include 
 
diff --git a/framework/source/fwe/xml/saxnamespacefilter.cxx 
b/framework/source/fwe/xml/saxnamespacefilter.cxx
index 18baa687422b..ac1ff571c26a 100644
--- a/framework/source/fwe/xml/saxnamespacefilter.cxx
+++ b/framework/source/fwe/xml/saxnamespacefilter.cxx
@@ -17,9 +17,8 @@
  *   the License at http://www.apache.org/licenses/LICENSE-2.0 .
  */
 
-/** Attention: stl headers must(!) be included at first. Otherwise it can make 
trouble
-   with solaris headers ...
-*/
+#include 
+
 #include 
 
 #include 
diff --git a/framework/source/layoutmanager/toolbarlayoutmanager.hxx 
b/framework/source/layoutmanager/toolbarlayoutmanager.hxx
index 3741875c1d3f..d91938a55d47 100644
--- a/framework/source/layoutmanager/toolbarlayoutmanager.hxx
+++ b/framework/source/layoutmanager/toolbarlayoutmanager.hxx
@@ -19,9 +19,8 @@
 
 #pragma once
 
-/** Attention: stl headers must(!) be included at first. Otherwise it can make 
trouble
-   with solaris headers ...
-*/
+#include 
+
 #include 
 
 #include 


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

2021-08-12 Thread Zeynep Yavuz (via logerrit)
 framework/inc/helper/statusindicatorfactory.hxx |3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

New commits:
commit d55de29c165e34b8a9ccb7ebf79f76a601103977
Author: Zeynep Yavuz 
AuthorDate: Wed Aug 11 00:22:51 2021 +0300
Commit: Ilmari Lauhakangas 
CommitDate: Thu Aug 12 18:03:20 2021 +0200

tdf#88205: Adapt uses of css::uno::Sequence to use initialize_list ctor

Change-Id: I3c01bb8abeee949bcd1aae861aeb1b1ac516ec58
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/120299
Tested-by: Ilmari Lauhakangas 
Reviewed-by: Ilmari Lauhakangas 

diff --git a/framework/inc/helper/statusindicatorfactory.hxx 
b/framework/inc/helper/statusindicatorfactory.hxx
index ca8cef12d5fe..3443bd881d25 100644
--- a/framework/inc/helper/statusindicatorfactory.hxx
+++ b/framework/inc/helper/statusindicatorfactory.hxx
@@ -184,8 +184,7 @@ class StatusIndicatorFactory final : public  
::cppu::WeakImplHelper<
 
 virtual css::uno::Sequence SAL_CALL 
getSupportedServiceNames() override
 {
-css::uno::Sequence< OUString > aSeq { 
"com.sun.star.task.StatusIndicatorFactory" };
-return aSeq;
+   return { "com.sun.star.task.StatusIndicatorFactory" };
 }
 
 // XInitialization


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

2021-07-22 Thread Noel Grandin (via logerrit)
 framework/inc/helper/statusindicatorfactory.hxx|3 
 framework/source/helper/statusindicatorfactory.cxx |  196 +++--
 2 files changed, 108 insertions(+), 91 deletions(-)

New commits:
commit 9ca9d364581e64b8e7ba9b4cd8d745ba22b2a2d8
Author: Noel Grandin 
AuthorDate: Wed Jul 21 21:47:21 2021 +0200
Commit: Noel Grandin 
CommitDate: Thu Jul 22 21:16:54 2021 +0200

osl::Mutex->std::mutex in StatusIndicatorFactory

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

diff --git a/framework/inc/helper/statusindicatorfactory.hxx 
b/framework/inc/helper/statusindicatorfactory.hxx
index f0f46a26ee95..ca8cef12d5fe 100644
--- a/framework/inc/helper/statusindicatorfactory.hxx
+++ b/framework/inc/helper/statusindicatorfactory.hxx
@@ -22,6 +22,7 @@
 // Attention: stl headers must(!) be included at first. Otherwise it can make 
trouble
 // with solaris headers ...
 #include 
+#include 
 
 // include files of own module
 #include 
@@ -124,7 +125,7 @@ class StatusIndicatorFactory final : public  
::cppu::WeakImplHelper<
 
 // member
 private:
-osl::Mutex m_mutex;
+std::mutex m_mutex;
 
 /** stack with all current indicator children. */
 IndicatorStack m_aStack;
diff --git a/framework/source/helper/statusindicatorfactory.cxx 
b/framework/source/helper/statusindicatorfactory.cxx
index addda602667f..702436b1dc61 100644
--- a/framework/source/helper/statusindicatorfactory.cxx
+++ b/framework/source/helper/statusindicatorfactory.cxx
@@ -66,7 +66,7 @@ StatusIndicatorFactory::~StatusIndicatorFactory()
 void SAL_CALL StatusIndicatorFactory::initialize(const css::uno::Sequence< 
css::uno::Any >& lArguments)
 {
 if (lArguments.hasElements()) {
-osl::MutexGuard g(m_mutex);
+std::lock_guard g(m_mutex);
 
 css::uno::Reference< css::frame::XFrame > xTmpFrame;
 css::uno::Reference< css::awt::XWindow > xTmpWindow;
@@ -103,7 +103,7 @@ css::uno::Reference< css::task::XStatusIndicator > SAL_CALL 
StatusIndicatorFacto
 
 void SAL_CALL StatusIndicatorFactory::update()
 {
-osl::MutexGuard g(m_mutex);
+std::lock_guard g(m_mutex);
 m_bAllowReschedule = true;
 }
 
@@ -111,20 +111,21 @@ void StatusIndicatorFactory::start(const 
css::uno::Reference< css::task::XStatus
const OUString& 
   sText ,
  sal_Int32 
  nRange)
 {
+css::uno::Reference< css::task::XStatusIndicator > xProgress;
 // SAFE -> --
-osl::ClearableMutexGuard aWriteLock(m_mutex);
-
-// create new info structure for this child or move it to the front of our 
stack
-IndicatorStack::iterator pItem = ::std::find(m_aStack.begin(), 
m_aStack.end(), xChild);
-if (pItem != m_aStack.end())
-m_aStack.erase(pItem);
-IndicatorInfo aInfo(xChild, sText);
-m_aStack.push_back (aInfo);
+{
+std::lock_guard aWriteLock(m_mutex);
 
-m_xActiveChild = xChild;
-css::uno::Reference< css::task::XStatusIndicator > xProgress = m_xProgress;
+// create new info structure for this child or move it to the front of 
our stack
+IndicatorStack::iterator pItem = ::std::find(m_aStack.begin(), 
m_aStack.end(), xChild);
+if (pItem != m_aStack.end())
+m_aStack.erase(pItem);
+IndicatorInfo aInfo(xChild, sText);
+m_aStack.push_back (aInfo);
 
-aWriteLock.clear();
+m_xActiveChild = xChild;
+xProgress = m_xProgress;
+}
 // <- SAFE --
 
 implts_makeParentVisibleIfAllowed();
@@ -138,21 +139,23 @@ void StatusIndicatorFactory::start(const 
css::uno::Reference< css::task::XStatus
 
 void StatusIndicatorFactory::reset(const css::uno::Reference< 
css::task::XStatusIndicator >& xChild)
 {
+css::uno::Reference< css::task::XStatusIndicator > xActive;
+css::uno::Reference< css::task::XStatusIndicator > xProgress;
 // SAFE -> --
-osl::ClearableMutexGuard aReadLock(m_mutex);
-
-// reset the internal info structure related to this child
-IndicatorStack::iterator pItem = ::std::find(m_aStack.begin(), 
m_aStack.end(), xChild);
-if (pItem != m_aStack.end())
 {
-pItem->m_nValue = 0;
-pItem->m_sText.clear();
-}
+std::lock_guard aReadLock(m_mutex);
 
-css::uno::Reference< css::task::XStatusIndicator > xActive   = 
m_xActiveChild;
-css::uno::Reference< css::task::XStatusIndicator > xProgress = m_xProgress;
+// reset the internal info structure related to this child
+IndicatorStack::iterator pItem = ::std::find(m_aStack.begin(), 
m_aStack.end(), xChild);
+if (pItem != m_aStack.end())
+{
+   

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

2021-07-19 Thread Noel Grandin (via logerrit)
 framework/Library_fwk.mk  |1 
 framework/inc/uiconfiguration/imagemanager.hxx|2 
 framework/inc/uiconfiguration/moduleimagemanager.hxx  |   73 
 framework/source/uiconfiguration/imagemanager.cxx |6 
 framework/source/uiconfiguration/moduleimagemanager.cxx   |  155 
--
 framework/source/uiconfiguration/moduleuiconfigurationmanager.cxx |   12 
 framework/source/uiconfiguration/uiconfigurationmanager.cxx   |   18 -
 7 files changed, 15 insertions(+), 252 deletions(-)

New commits:
commit ef19c82f6ade323e2708b93d77cf50ffe8b9fcfd
Author: Noel Grandin 
AuthorDate: Mon Jul 19 09:14:21 2021 +0200
Commit: Noel Grandin 
CommitDate: Mon Jul 19 10:55:10 2021 +0200

merge ModuleImageManager into ImageManager

they share an underlying impl, so no need to have separate classes

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

diff --git a/framework/Library_fwk.mk b/framework/Library_fwk.mk
index 2d4fdda1c1ef..c8ffb1f1b36b 100644
--- a/framework/Library_fwk.mk
+++ b/framework/Library_fwk.mk
@@ -168,7 +168,6 @@ $(eval $(call gb_Library_add_exception_objects,fwk,\
 framework/source/uiconfiguration/graphicnameaccess \
 framework/source/uiconfiguration/imagemanager \
 framework/source/uiconfiguration/imagemanagerimpl \
-framework/source/uiconfiguration/moduleimagemanager \
 framework/source/uiconfiguration/moduleuicfgsupplier \
 framework/source/uiconfiguration/moduleuiconfigurationmanager \
 framework/source/uiconfiguration/uicategorydescription \
diff --git a/framework/inc/uiconfiguration/imagemanager.hxx 
b/framework/inc/uiconfiguration/imagemanager.hxx
index 1688ba44c10c..aacc8bbd3c72 100644
--- a/framework/inc/uiconfiguration/imagemanager.hxx
+++ b/framework/inc/uiconfiguration/imagemanager.hxx
@@ -35,7 +35,7 @@ namespace framework
 class ImageManager final : public ::cppu::WeakImplHelper< 
css::ui::XImageManager, css::lang::XServiceInfo>
 {
 public:
-ImageManager( const css::uno::Reference< 
css::uno::XComponentContext >& rxContext );
+ImageManager( const css::uno::Reference< 
css::uno::XComponentContext >& rxContext, bool bForModule );
 virtual ~ImageManager() override;
 
 virtual OUString SAL_CALL getImplementationName() override
diff --git a/framework/inc/uiconfiguration/moduleimagemanager.hxx 
b/framework/inc/uiconfiguration/moduleimagemanager.hxx
deleted file mode 100644
index d9fc98971b9d..
--- a/framework/inc/uiconfiguration/moduleimagemanager.hxx
+++ /dev/null
@@ -1,73 +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 .
- */
-
-#pragma once
-
-#include 
-#include 
-
-#include 
-#include 
-
-#include 
-
-namespace framework
-{
-class ImageManagerImpl;
-
-class ModuleImageManager final : public ::cppu::WeakImplHelper< 
css::ui::XImageManager>
-{
-public:
-ModuleImageManager( const css::uno::Reference< 
css::uno::XComponentContext >& xContext );
-virtual ~ModuleImageManager() override;
-
-// XComponent
-virtual void SAL_CALL dispose() override;
-virtual void SAL_CALL addEventListener( const css::uno::Reference< 
css::lang::XEventListener >& xListener ) override;
-virtual void SAL_CALL removeEventListener( const 
css::uno::Reference< css::lang::XEventListener >& aListener ) override;
-
-// XInitialization
-virtual void SAL_CALL initialize( const css::uno::Sequence< 
css::uno::Any >& aArguments ) override;
-
-// XImageManager
-virtual void SAL_CALL reset() override;
-virtual css::uno::Sequence< OUString > SAL_CALL getAllImageNames( 
::sal_Int16 nImageType ) override;
-virtual sal_Bool SAL_CALL hasImage( ::sal_Int16 nImageType, const 
OUString& aCommandURL ) override;
-virtual css::uno::Sequence< css::uno::Reference< 

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

2021-07-07 Thread Noel Grandin (via logerrit)
 framework/inc/helper/tagwindowasmodified.hxx|8 +-
 framework/source/helper/tagwindowasmodified.cxx |   96 +++-
 2 files changed, 36 insertions(+), 68 deletions(-)

New commits:
commit 3e942e40a6c175e4e42a16be83191bc5e01f43b9
Author: Noel Grandin 
AuthorDate: Tue Jul 6 18:53:35 2021 +0200
Commit: Noel Grandin 
CommitDate: Wed Jul 7 12:08:47 2021 +0200

tdf#132740 improve TagWindowAsModified

makes a small difference

(*) Use strong ref instead of weak ref, because weak ref is expensive to
access
(*) to make that work, fix dispose()
(*) cache the vcl::Window to avoid expensive VCLUnoHelper::GetWindow

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

diff --git a/framework/inc/helper/tagwindowasmodified.hxx 
b/framework/inc/helper/tagwindowasmodified.hxx
index ee06ed6d6e44..1528c63c5b18 100644
--- a/framework/inc/helper/tagwindowasmodified.hxx
+++ b/framework/inc/helper/tagwindowasmodified.hxx
@@ -23,9 +23,11 @@
 #include 
 #include 
 #include 
+#include 
 
 #include 
 #include 
+#include 
 
 namespace framework{
 
@@ -51,13 +53,13 @@ class TagWindowAsModified final : public  
::cppu::WeakImplHelper<
 private:
 
 /// reference to the frame, where we listen for new loaded documents 
for updating our own xModel reference
-css::uno::WeakReference< css::frame::XFrame > m_xFrame;
+css::uno::Reference< css::frame::XFrame > m_xFrame;
 
 /// reference to the frame container window, where we must set the tag
-css::uno::WeakReference< css::awt::XWindow > m_xWindow;
+VclPtr m_xWindow;
 
 /// we list on the model for modify events
-css::uno::WeakReference< css::frame::XModel > m_xModel;
+css::uno::Reference< css::util::XModifiable > m_xModel;
 
 // interface
 
diff --git a/framework/source/helper/tagwindowasmodified.cxx 
b/framework/source/helper/tagwindowasmodified.cxx
index 93f2ace64c99..33a722a725eb 100644
--- a/framework/source/helper/tagwindowasmodified.cxx
+++ b/framework/source/helper/tagwindowasmodified.cxx
@@ -22,7 +22,6 @@
 #include 
 
 #include 
-#include 
 #include 
 
 #include 
@@ -47,52 +46,31 @@ void SAL_CALL TagWindowAsModified::initialize(const 
css::uno::Sequence< css::uno
 if (lArguments.hasElements())
 lArguments[0] >>= xFrame;
 
-if ( ! xFrame.is ())
+if (!xFrame)
 return;
 
-{
-SolarMutexGuard g;
-m_xFrame = xFrame;
-}
-
+m_xFrame = xFrame;
 xFrame->addFrameActionListener(this);
 impl_update (xFrame);
 }
 
 void SAL_CALL TagWindowAsModified::modified(const css::lang::EventObject& 
aEvent)
 {
-css::uno::Reference< css::util::XModifiable > xModel;
-css::uno::Reference< css::awt::XWindow >  xWindow;
-{
-SolarMutexGuard g;
-xModel.set(m_xModel.get (), css::uno::UNO_QUERY);
-xWindow.set(m_xWindow.get(), css::uno::UNO_QUERY);
-if (
-( ! xModel.is  ()   ) ||
-( ! xWindow.is ()   ) ||
-(aEvent.Source != xModel)
-)
-return;
-}
+if (!m_xModel || !m_xWindow || aEvent.Source != m_xModel)
+return;
 
-bool bModified = xModel->isModified ();
+bool bModified = m_xModel->isModified ();
 
 // SYNCHRONIZED ->
 SolarMutexGuard aSolarGuard;
 
-VclPtr pWindow = VCLUnoHelper::GetWindow(xWindow);
-if ( ! pWindow)
-return;
-
-bool bSystemWindow = pWindow->IsSystemWindow();
-bool bWorkWindow   = (pWindow->GetType() == WindowType::WORKWINDOW);
-if (!bSystemWindow && !bWorkWindow)
+if (m_xWindow->isDisposed())
 return;
 
 if (bModified)
-pWindow->SetExtendedStyle(WindowExtendedStyle::DocModified);
+m_xWindow->SetExtendedStyle(WindowExtendedStyle::DocModified);
 else
-pWindow->SetExtendedStyle(WindowExtendedStyle::NONE);
+m_xWindow->SetExtendedStyle(WindowExtendedStyle::NONE);
 // <- SYNCHRONIZED
 }
 
@@ -104,43 +82,26 @@ void SAL_CALL TagWindowAsModified::frameAction(const 
css::frame::FrameActionEven
)
 return;
 
-css::uno::Reference< css::frame::XFrame > xFrame;
-{
-SolarMutexGuard g;
-xFrame.set(m_xFrame.get(), css::uno::UNO_QUERY);
-if (
-( ! xFrame.is ()) ||
-(aEvent.Source != xFrame)
-)
-return;
-}
+if ( aEvent.Source != m_xFrame )
+return;
 
-impl_update (xFrame);
+impl_update (m_xFrame);
 }
 
 void SAL_CALL TagWindowAsModified::disposing(const css::lang::EventObject& 
aEvent)
 {
 SolarMutexGuard g;
 
-css::uno::Reference< css::frame::XFrame > xFrame(m_xFrame.get(), 
css::uno::UNO_QUERY);
-if (xFrame.is())
-xFrame->addFrameActionListener(this);
-
-if (
-(xFrame.is ()   ) &&
-(aEvent.Source 

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

2021-06-26 Thread Noel Grandin (via logerrit)
 framework/inc/classes/protocolhandlercache.hxx |2 +-
 framework/inc/uielement/statusbar.hxx  |2 +-
 framework/source/inc/dispatch/dispatchdisabler.hxx |2 +-
 framework/source/inc/dispatch/loaddispatcher.hxx   |2 +-
 4 files changed, 4 insertions(+), 4 deletions(-)

New commits:
commit 66fec11a62b692cc00cf0c1332d841906abfaea8
Author: Noel Grandin 
AuthorDate: Fri Jun 25 09:32:22 2021 +0200
Commit: Noel Grandin 
CommitDate: Sat Jun 26 13:14:18 2021 +0200

loplugin:finalclasses in framework

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

diff --git a/framework/inc/classes/protocolhandlercache.hxx 
b/framework/inc/classes/protocolhandlercache.hxx
index d29ba6795248..25e315025dc3 100644
--- a/framework/inc/classes/protocolhandlercache.hxx
+++ b/framework/inc/classes/protocolhandlercache.hxx
@@ -125,7 +125,7 @@ class HandlerCache final
 @devstatus  ready to use
 @threadsafe no
 */
-class HandlerCFGAccess : public ::utl::ConfigItem
+class HandlerCFGAccess final : public ::utl::ConfigItem
 {
 private:
 HandlerCache* m_pCache;
diff --git a/framework/inc/uielement/statusbar.hxx 
b/framework/inc/uielement/statusbar.hxx
index 28e2e2b49487..6d33396dbecd 100644
--- a/framework/inc/uielement/statusbar.hxx
+++ b/framework/inc/uielement/statusbar.hxx
@@ -26,7 +26,7 @@
 namespace framework
 {
 
-class FrameworkStatusBar : public StatusBar
+class FrameworkStatusBar final : public StatusBar
 {
 public:
 
diff --git a/framework/source/inc/dispatch/dispatchdisabler.hxx 
b/framework/source/inc/dispatch/dispatchdisabler.hxx
index 5b9be47dd1f3..662eeb5d7c2d 100644
--- a/framework/source/inc/dispatch/dispatchdisabler.hxx
+++ b/framework/source/inc/dispatch/dispatchdisabler.hxx
@@ -31,7 +31,7 @@ namespace framework {
  * of functionality included, and disabling elements remotely one
  * by one performs poorly.
  */
-class DispatchDisabler : public ::cppu::WeakImplHelper<
+class DispatchDisabler final : public ::cppu::WeakImplHelper<
 css::lang::XInitialization,
 css::container::XNameContainer,
 
css::frame::XDispatchProviderInterceptor,
diff --git a/framework/source/inc/dispatch/loaddispatcher.hxx 
b/framework/source/inc/dispatch/loaddispatcher.hxx
index 99f27d968640..ef7b9860f5e5 100644
--- a/framework/source/inc/dispatch/loaddispatcher.hxx
+++ b/framework/source/inc/dispatch/loaddispatcher.hxx
@@ -33,7 +33,7 @@ namespace framework{
 non-visible components (by using the mechanism of 
ContentHandler)
 or visible-components (by using the mechanism of FrameLoader).
  */
-class LoadDispatcher : public  ::cppu::WeakImplHelper< 
css::frame::XNotifyingDispatch,  // => XDispatch => XInterface
+class LoadDispatcher final : public  ::cppu::WeakImplHelper< 
css::frame::XNotifyingDispatch,  // => XDispatch => XInterface
 
css::frame::XSynchronousDispatch >
 {
 
___
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/sfx2 include/svtools officecfg/registry sfx2/sdi sfx2/source svtools/source svtools/uiconfig

2021-06-08 Thread Heiko Tietze (via logerrit)
 framework/inc/strings.hrc |1 
 framework/source/uielement/toolbarmanager.cxx |3 
 framework/source/uielement/toolbarsmenucontroller.cxx |3 
 include/sfx2/sfxsids.hrc  |1 
 include/svtools/restartdialog.hxx |3 
 officecfg/registry/data/org/openoffice/Office/UI/GenericCommands.xcu  |   11 
 officecfg/registry/schema/org/openoffice/Office/UI/GlobalSettings.xcs |2 
 sfx2/sdi/appslots.sdi |5 
 sfx2/sdi/sfx.sdi  |   16 +
 sfx2/source/appl/appserv.cxx  |   34 ++
 svtools/source/dialogs/restartdialog.cxx  |3 
 svtools/uiconfig/ui/restartdialog.ui  |  138 
+-
 12 files changed, 152 insertions(+), 68 deletions(-)

New commits:
commit 086fa727cabf46eacfec1a0fd4f6dfe916aa2f04
Author: Heiko Tietze 
AuthorDate: Wed May 19 13:21:00 2021 +0200
Commit: Heiko Tietze 
CommitDate: Tue Jun 8 15:28:56 2021 +0200

Resolves tdf#131817 - Option to globally switch toolbar locking on/off

Reverts 6993d5d0f1079fe720a7da004b70b57361c99fc6 and
sets Locked in GlobalSettings to true
New UNO command ToolbarLock to toggle the state added to
the toolbars menu

Change-Id: I246280b2b7930f2bf686e6fc26383da4799b5028
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/115797
Tested-by: Jenkins
Reviewed-by: Heiko Tietze 

diff --git a/framework/inc/strings.hrc b/framework/inc/strings.hrc
index 8216bb623eb3..796517bdc130 100644
--- a/framework/inc/strings.hrc
+++ b/framework/inc/strings.hrc
@@ -41,6 +41,7 @@
 #define STR_FULL_DISC_RETRY_BUTTON  
NC_("STR_FULL_DISC_RETRY_BUTTON", "Retry" )
 #define STR_FULL_DISC_MSG   NC_("STR_FULL_DISC_MSG", 
"%PRODUCTNAME could not save important internal information due to insufficient 
free disk space at the following location:\n%PATH\n\nYou will not be able to 
continue working with %PRODUCTNAME without allocating more free disk space at 
that location.\n\nPress the 'Retry' button after you have allocated more free 
disk space to retry saving the data.\n\n" )
 #define STR_RESTORE_TOOLBARS
NC_("STR_RESTORE_TOOLBARS", "~Reset" )
+#define STR_LOCK_TOOLBARS   NC_("STR_LOCK_TOOLBARS", 
"~Lock Toolbars" )
 #define STR_CORRUPT_UICFG_SHARE 
NC_("STR_CORRUPT_UICFG_SHARE", "An error occurred while loading the user 
interface configuration data. The application will be terminated now.\nPlease 
try to reinstall the application." )
 #define STR_CORRUPT_UICFG_USER  
NC_("STR_CORRUPT_UICFG_USER", "An error occurred while loading the user 
interface configuration data. The application will be terminated now.\nPlease 
try to remove your user profile for the application." )
 #define STR_CORRUPT_UICFG_GENERAL   
NC_("STR_CORRUPT_UICFG_GENERAL", "An error occurred while loading the user 
interface configuration data. The application will be terminated now.\nPlease 
try to remove your user profile for the application first or try to reinstall 
the application." )
diff --git a/framework/source/uielement/toolbarmanager.cxx 
b/framework/source/uielement/toolbarmanager.cxx
index 2d88db04ae67..ad52608c5b0c 100644
--- a/framework/source/uielement/toolbarmanager.cxx
+++ b/framework/source/uielement/toolbarmanager.cxx
@@ -1943,10 +1943,7 @@ void ToolBarManager::AddCustomizeMenuItems(ToolBox const 
* pToolBar)
 pMenu->EnableItem(MENUITEM_TOOLBAR_DOCKALLTOOLBAR, false);
 Reference< XDockableWindow > xDockable( 
VCLUnoHelper::GetInterface( m_pToolBar ), UNO_QUERY );
 if( xDockable.is() )
-{
 pMenu->CheckItem(MENUITEM_TOOLBAR_LOCKTOOLBARPOSITION, 
xDockable->isLocked());
-pMenu->EnableItem(MENUITEM_TOOLBAR_UNDOCKTOOLBAR, 
!xDockable->isLocked());
-}
 }
 else
 pMenu->EnableItem(MENUITEM_TOOLBAR_LOCKTOOLBARPOSITION, false);
diff --git a/framework/source/uielement/toolbarsmenucontroller.cxx 
b/framework/source/uielement/toolbarsmenucontroller.cxx
index 1498cb1ed3e6..83816bc64bdb 100644
--- a/framework/source/uielement/toolbarsmenucontroller.cxx
+++ b/framework/source/uielement/toolbarsmenucontroller.cxx
@@ -69,6 +69,7 @@ using namespace ::com::sun::star::container;
 using namespace ::com::sun::star::ui;
 
 constexpr OUStringLiteral CMD_RESTOREVISIBILITY = u".cmd:RestoreVisibility";
+constexpr OUStringLiteral CMD_LOCKTOOLBARS = u".uno:ToolbarLock";
 
 constexpr OUStringLiteral STATIC_CMD_PART= 
u".uno:AvailableToolbars?Toolbar:string=";
 const char STATIC_INTERNAL_CMD_PART[]= ".cmd:";
@@ -461,6 +462,8 @@ void 

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

2021-05-31 Thread Noel Grandin (via logerrit)
 framework/inc/classes/protocolhandlercache.hxx|7 +++--
 framework/source/fwi/classes/protocolhandlercache.cxx |   24 +-
 2 files changed, 16 insertions(+), 15 deletions(-)

New commits:
commit d1dfb7d56137ea62d6f3cdfb07f3ee841eb28f9e
Author: Noel Grandin 
AuthorDate: Mon May 31 11:11:30 2021 +0200
Commit: Noel Grandin 
CommitDate: Mon May 31 21:36:25 2021 +0200

no need to allocate these separately

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

diff --git a/framework/inc/classes/protocolhandlercache.hxx 
b/framework/inc/classes/protocolhandlercache.hxx
index 78a3449f8aa9..d29ba6795248 100644
--- a/framework/inc/classes/protocolhandlercache.hxx
+++ b/framework/inc/classes/protocolhandlercache.hxx
@@ -20,6 +20,7 @@
 #pragma once
 
 #include 
+#include 
 
 #include 
 
@@ -90,9 +91,9 @@ class HandlerCache final
 private:
 
 /// list of all registered handler registered by her uno 
implementation names
-static std::unique_ptr s_pHandler;
+static std::optional s_pHandler;
 /// maps URL pattern to handler names
-static std::unique_ptr s_pPattern;
+static std::optional s_pPattern;
 /// informs about config updates
 static HandlerCFGAccess* s_pConfig;
 /// ref count to construct/destruct internal member lists on demand by 
using singleton mechanism
@@ -107,7 +108,7 @@ class HandlerCache final
 bool search( const OUString& sURL, ProtocolHandler* pReturn ) const;
 bool search( const css::util::URL&  aURL, ProtocolHandler* pReturn ) 
const;
 
-void takeOver(std::unique_ptr pHandler, 
std::unique_ptr pPattern);
+void takeOver(HandlerHash aHandler, PatternHash aPattern);
 };
 
 /**
diff --git a/framework/source/fwi/classes/protocolhandlercache.cxx 
b/framework/source/fwi/classes/protocolhandlercache.cxx
index 9288536480d9..1879554c7bed 100644
--- a/framework/source/fwi/classes/protocolhandlercache.cxx
+++ b/framework/source/fwi/classes/protocolhandlercache.cxx
@@ -68,8 +68,8 @@ PatternHash::const_iterator findPatternKey(PatternHash const 
* hash, const OUStr
 That means it use two static member list to hold all necessary 
information
 and a ref count mechanism to create/destroy it on demand.
  */
-std::unique_ptr HandlerCache::s_pHandler;
-std::unique_ptr HandlerCache::s_pPattern;
+std::optional HandlerCache::s_pHandler;
+std::optional HandlerCache::s_pPattern;
 sal_Int32HandlerCache::m_nRefCount = 0;
 HandlerCFGAccess* HandlerCache::s_pConfig = nullptr;
 
@@ -86,8 +86,8 @@ HandlerCache::HandlerCache()
 
 if (m_nRefCount==0)
 {
-s_pHandler.reset(new HandlerHash);
-s_pPattern.reset(new PatternHash);
+s_pHandler.emplace();
+s_pPattern.emplace();
 s_pConfig = new HandlerCFGAccess(PACKAGENAME_PROTOCOLHANDLER);
 s_pConfig->read(*s_pHandler, *s_pPattern);
 s_pConfig->setCache(this);
@@ -129,7 +129,7 @@ bool HandlerCache::search( const OUString& sURL, 
ProtocolHandler* pReturn ) cons
 
 SolarMutexGuard aGuard;
 
-PatternHash::const_iterator pItem = findPatternKey(s_pPattern.get(), sURL);
+PatternHash::const_iterator pItem = findPatternKey(s_pPattern ? 
&*s_pPattern : nullptr, sURL);
 if (pItem != s_pPattern->end())
 {
 *pReturn = (*s_pHandler)[pItem->second];
@@ -150,12 +150,12 @@ bool HandlerCache::search( const css::util::URL& aURL, 
ProtocolHandler* pReturn
 return search( aURL.Complete, pReturn );
 }
 
-void HandlerCache::takeOver(std::unique_ptr pHandler, 
std::unique_ptr pPattern)
+void HandlerCache::takeOver(HandlerHash aHandler, PatternHash aPattern)
 {
 SolarMutexGuard aGuard;
 
-s_pHandler = std::move(pHandler);
-s_pPattern = std::move(pPattern);
+s_pHandler = std::move(aHandler);
+s_pPattern = std::move(aPattern);
 }
 
 /**
@@ -240,12 +240,12 @@ void HandlerCFGAccess::read( HandlerHash& rHandlerHash, 
PatternHash& rPatternHas
 
 void HandlerCFGAccess::Notify(const css::uno::Sequence< OUString >& 
/*lPropertyNames*/)
 {
-std::unique_ptr pHandler(new HandlerHash);
-std::unique_ptr pPattern(new PatternHash);
+HandlerHash aHandler;
+PatternHash aPattern;
 
-read(*pHandler, *pPattern);
+read(aHandler, aPattern);
 if (m_pCache)
-m_pCache->takeOver(std::move(pHandler), std::move(pPattern));
+m_pCache->takeOver(std::move(aHandler), std::move(aPattern));
 }
 
 void HandlerCFGAccess::ImplCommit()
___
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 framework/uiconfig framework/UIConfig_startmodule.mk include/framework include/sfx2 include/vcl sfx2/source svtools/source vcl/inc vcl/so

2021-04-06 Thread Szymon Kłos (via logerrit)
 framework/UIConfig_startmodule.mk   |1 
 framework/inc/uielement/toolbarmanager.hxx  |   76 ++
 framework/inc/uielement/toolbarwrapper.hxx  |   11 
 framework/source/fwe/classes/sfxhelperfunctions.cxx |   23 
 framework/source/uielement/subtoolbarcontroller.cxx |   14 
 framework/source/uielement/toolbarmanager.cxx   |  713 +++-
 framework/source/uielement/toolbarwrapper.cxx   |   30 
 framework/uiconfig/startmodule/ui/managedtoolbar.ui |   21 
 include/framework/sfxhelperfunctions.hxx|   19 
 include/sfx2/tbxctrl.hxx|1 
 include/vcl/weld.hxx|1 
 sfx2/source/appl/app.cxx|   12 
 sfx2/source/toolbox/tbxitem.cxx |1 
 svtools/source/control/toolbarmenu.cxx  |2 
 vcl/inc/salvtables.hxx  |2 
 vcl/source/app/salvtables.cxx   |9 
 vcl/unx/gtk3/gtk3gtkinst.cxx|   14 
 17 files changed, 780 insertions(+), 170 deletions(-)

New commits:
commit ac1aefd5174258d9bcb41465ce566ed1a0819f3d
Author: Szymon Kłos 
AuthorDate: Wed Mar 10 16:20:07 2021 +0100
Commit: Szymon Kłos 
CommitDate: Tue Apr 6 11:58:20 2021 +0200

Extend ToolBarManager to build weld::Toolbar

- used for SubToolBarController eg. framework shape toolbar popup
present in the sidebar fontwork panel
- add separate implementation for vcl and weld based ToolBarManager
- provide basic functionality for weld based (just inserting standard items 
with icons
and controllers)
- not implemented: addons items merging etc.

Change-Id: I8e460f34abd512d70e95a1d484d728b7d809ce9d
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/113387
Tested-by: Jenkins
Reviewed-by: Szymon Kłos 

diff --git a/framework/UIConfig_startmodule.mk 
b/framework/UIConfig_startmodule.mk
index 14cf6283493f..8ead37282e8e 100644
--- a/framework/UIConfig_startmodule.mk
+++ b/framework/UIConfig_startmodule.mk
@@ -14,6 +14,7 @@ $(eval $(call 
gb_UIConfig_add_menubarfiles,modules/StartModule,\
 ))
 
 $(eval $(call gb_UIConfig_add_uifiles,modules/StartModule,\
+   framework/uiconfig/startmodule/ui/managedtoolbar \
framework/uiconfig/startmodule/ui/subtoolbar \
 ))
 
diff --git a/framework/inc/uielement/toolbarmanager.hxx 
b/framework/inc/uielement/toolbarmanager.hxx
index e9578bda6aad..8a87c2a6b78a 100644
--- a/framework/inc/uielement/toolbarmanager.hxx
+++ b/framework/inc/uielement/toolbarmanager.hxx
@@ -33,11 +33,14 @@
 #include 
 #include 
 
+#include 
+
 #include 
 #include 
 #include 
 
 #include 
+#include 
 #include 
 #include 
 #include 
@@ -51,6 +54,55 @@ class Menu;
 namespace framework
 {
 
+class ToolBarManager;
+
+class ToolBarManagerImpl
+{
+public:
+virtual ~ToolBarManagerImpl() = default;
+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,
+const OUString& rTooltip,
+const OUString& rLabel,
+ToolBoxItemBits nItemBits) = 0;
+virtual void InsertSeparator() = 0;
+virtual void InsertSpace() = 0;
+virtual void InsertBreak() = 0;
+virtual ToolBoxItemId GetItemId(sal_uInt16 nPos) = 0;
+virtual ToolBoxItemId GetCurItemId() = 0;
+virtual OUString GetItemCommand(ToolBoxItemId nId) = 0;
+virtual sal_uInt16 GetItemCount() = 0;
+virtual void SetItemCheckable(ToolBoxItemId nId) = 0;
+virtual void HideItem(ToolBoxItemId nId, const OUString& rCommandURL) = 0;
+virtual bool IsItemVisible(ToolBoxItemId nId, const OUString& rCommandURL) 
= 0;
+virtual void Clear() = 0;
+virtual void SetName(const OUString& rName) = 0;
+virtual void SetHelpId(const OString& rHelpId) = 0;
+virtual bool WillUsePopupMode() = 0;
+virtual bool IsReallyVisible() = 0;
+virtual void SetIconSize(ToolBoxButtonSize eSize) = 0;
+virtual vcl::ImageType GetImageSize() = 0;
+virtual void ConnectCallbacks(ToolBarManager* pManager) = 0;
+virtual void SetMenuType(ToolBoxMenuType eType) = 0;
+virtual void MergeToolbar(ToolBoxItemId nItemId,
+  const OUString& rModuleIdentifier,
+  CommandToInfoMap& rCommandMap,
+  MergeToolbarInstruction& rInstruction) = 0;
+virtual void SetItemImage(ToolBoxItemId nId,
+  const OUString& rCommandURL,
+  

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

2021-03-23 Thread Noel Grandin (via logerrit)
 framework/inc/helper/mischelper.hxx |2 +
 framework/source/fwe/classes/sfxhelperfunctions.cxx |3 +
 framework/source/fwi/helper/mischelper.cxx  |4 +-
 framework/source/services/ContextChangeEventMultiplexer.cxx |   24 +++-
 framework/util/fwk.component|3 +
 include/framework/ContextChangeEventMultiplexerTunnel.hxx   |2 +
 sfx2/source/sidebar/SidebarController.cxx   |4 +-
 7 files changed, 20 insertions(+), 22 deletions(-)

New commits:
commit a9493229bb453a8f437c45d838777e2ba8217b76
Author: Noel Grandin 
AuthorDate: Sun Mar 21 13:41:39 2021 +0200
Commit: Noel Grandin 
CommitDate: Tue Mar 23 09:33:43 2021 +0100

use single-use attribute for ContextChangeEventMultiplexer

instead of rtl::Instance, which means it will get
cleaned up when UNO shuts down

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

diff --git a/framework/inc/helper/mischelper.hxx 
b/framework/inc/helper/mischelper.hxx
index 4dcb94003449..d05ae360a082 100644
--- a/framework/inc/helper/mischelper.hxx
+++ b/framework/inc/helper/mischelper.hxx
@@ -246,10 +246,12 @@ class WeakDocumentEventListener final : public 
::cppu::WeakImplHelper
 GetFirstListenerWith_Impl(
+css::uno::Reference const & xComponentContext,
 css::uno::Reference const& xEventFocus,
 std::function const&)> const& 
rPredicate);
 
 extern auto (*g_pGetMultiplexerListener)(
+css::uno::Reference const & xComponentContext,
 css::uno::Reference const&,
 std::function const&)> const&)
 -> css::uno::Reference;
diff --git a/framework/source/fwe/classes/sfxhelperfunctions.cxx 
b/framework/source/fwe/classes/sfxhelperfunctions.cxx
index e456a7a42460..9adc5931a7e3 100644
--- a/framework/source/fwe/classes/sfxhelperfunctions.cxx
+++ b/framework/source/fwe/classes/sfxhelperfunctions.cxx
@@ -146,10 +146,11 @@ bool IsDockingWindowVisible( const css::uno::Reference< 
css::frame::XFrame >& rF
 
 using namespace ::com::sun::star;
 uno::Reference GetFirstListenerWith(
+css::uno::Reference const & xComponentContext,
 uno::Reference const& xEventFocus,
 std::function 
const&)> const& rPredicate)
 {
-return GetFirstListenerWith_Impl(xEventFocus, rPredicate);
+return GetFirstListenerWith_Impl(xComponentContext, xEventFocus, 
rPredicate);
 }
 
 }
diff --git a/framework/source/fwi/helper/mischelper.cxx 
b/framework/source/fwi/helper/mischelper.cxx
index b53cd0f2672d..e9c664d474df 100644
--- a/framework/source/fwi/helper/mischelper.cxx
+++ b/framework/source/fwi/helper/mischelper.cxx
@@ -133,17 +133,19 @@ void FillLangItems( std::set< OUString > ,
 }
 
 auto (*g_pGetMultiplexerListener)(
+css::uno::Reference const & xComponentContext,
 uno::Reference const&,
 std::function 
const&)> const&)
 -> uno::Reference = nullptr;
 
 uno::Reference
 GetFirstListenerWith_Impl(
+css::uno::Reference const & xComponentContext,
 uno::Reference const& xEventFocus,
 std::function 
const&)> const& rPredicate)
 {
 assert(g_pGetMultiplexerListener != nullptr); // should not be called too 
early, nor too late
-return g_pGetMultiplexerListener(xEventFocus, rPredicate);
+return g_pGetMultiplexerListener(xComponentContext, xEventFocus, 
rPredicate);
 }
 
 
diff --git a/framework/source/services/ContextChangeEventMultiplexer.cxx 
b/framework/source/services/ContextChangeEventMultiplexer.cxx
index fe24c2b6d770..3e647985cb40 100644
--- a/framework/source/services/ContextChangeEventMultiplexer.cxx
+++ b/framework/source/services/ContextChangeEventMultiplexer.cxx
@@ -23,11 +23,13 @@
 #include 
 #include 
 #include 
+#include 
 #include 
 
 #include 
 #include 
 #include 
+#include 
 
 #include 
 #include 
@@ -324,34 +326,21 @@ void SAL_CALL ContextChangeEventMultiplexer::disposing ( 
const css::lang::EventO
 maListeners.erase(iDescriptor);
 }
 
-struct Instance {
-explicit Instance():
-instance(static_cast(
-new ContextChangeEventMultiplexer()))
-{
-}
-
-css::uno::Reference instance;
-};
-
-struct Singleton:
-public rtl::Static
-{};
-
 }
 
 namespace framework {
 
 // right now we assume there's one matching listener
 static uno::Reference 
GetFirstListenerWith_ImplImpl(
+css::uno::Reference const & xComponentContext,
 uno::Reference const& xEventFocus,
 std::function 
const&)> const& rPredicate)
 {
 assert(xEventFocus.is()); // in current usage it's a bug if the 
XController is null here
 uno::Reference xRet;
 
-ContextChangeEventMultiplexer *const pMultiplexer(
-dynamic_cast(Singleton::get().instance.get()));
+rtl::Reference pMultiplexer =
+dynamic_cast(ui::ContextChangeEventMultiplexer::get(xComponentContext).get());
 assert(pMultiplexer);
 
 

[Libreoffice-commits] core.git: framework/inc framework/source svx/uiconfig svx/UIConfig_svx.mk

2021-02-23 Thread Caolán McNamara (via logerrit)
 framework/inc/strings.hrc|   22 ++
 framework/source/uielement/controlmenucontroller.cxx |  157 ++-
 svx/UIConfig_svx.mk  |1 
 svx/uiconfig/ui/convertmenu.ui   |  189 ---
 4 files changed, 84 insertions(+), 285 deletions(-)

New commits:
commit a54ccd575ccfe82444e3ad26cb543622cbff9e22
Author: Caolán McNamara 
AuthorDate: Tue Feb 23 17:28:45 2021 +
Commit: Caolán McNamara 
CommitDate: Tue Feb 23 20:19:30 2021 +0100

fill convert menu via the css::awt::XPopupMenu apis

don't poke around at it via vcl

Change-Id: I3c7cdc76c9efd45084294cd6f001ded8e3ebe793
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/111411
Tested-by: Jenkins
Reviewed-by: Caolán McNamara 

diff --git a/framework/inc/strings.hrc b/framework/inc/strings.hrc
index d3f28fcc9e21..23cb9bbed357 100644
--- a/framework/inc/strings.hrc
+++ b/framework/inc/strings.hrc
@@ -54,6 +54,28 @@
 #define STR_SET_LANGUAGE_FOR_PARAGRAPH  
NC_("STR_SET_LANGUAGE_FOR_PARAGRAPH", "Set Language for Paragraph" )
 #define STR_LANGSTATUS_HINT NC_("STR_LANGSTATUS_HINT", 
"Text Language. Right-click to set character or paragraph language" )
 
+#define RID_STR_PROPTITLE_EDIT  
NC_("RID_STR_PROPTITLE_EDIT", "Text Box")
+#define RID_STR_PROPTITLE_CHECKBOX  
NC_("RID_STR_PROPTITLE_CHECKBOX", "Check Box")
+#define RID_STR_PROPTITLE_COMBOBOX  
NC_("RID_STR_PROPTITLE_COMBOBOX", "Combo Box")
+#define RID_STR_PROPTITLE_LISTBOX   
NC_("RID_STR_PROPTITLE_LISTBOX", "List Box")
+#define RID_STR_PROPTITLE_DATEFIELD 
NC_("RID_STR_PROPTITLE_DATEFIELD", "Date Field")
+#define RID_STR_PROPTITLE_TIMEFIELD 
NC_("RID_STR_PROPTITLE_TIMEFIELD", "Time Field")
+#define RID_STR_PROPTITLE_NUMERICFIELD  
NC_("RID_STR_PROPTITLE_NUMERICFIELD", "Numeric Field")
+#define RID_STR_PROPTITLE_CURRENCYFIELD 
NC_("RID_STR_PROPTITLE_CURRENCYFIELD", "Currency Field")
+#define RID_STR_PROPTITLE_PATTERNFIELD  
NC_("RID_STR_PROPTITLE_PATTERNFIELD", "Pattern Field")
+#define RID_STR_PROPTITLE_FORMATTED 
NC_("RID_STR_PROPTITLE_FORMATTED", "Formatted Field")
+
+#define RID_STR_PROPTITLE_PUSHBUTTON
NC_("RID_STR_PROPTITLE_PUSHBUTTON", "Push Button")
+#define RID_STR_PROPTITLE_RADIOBUTTON   
NC_("RID_STR_PROPTITLE_RADIOBUTTON", "Option Button")
+#define RID_STR_PROPTITLE_FIXEDTEXT 
NC_("RID_STR_PROPTITLE_FIXEDTEXT", "Label Field")
+#define RID_STR_PROPTITLE_GROUPBOX  
NC_("RID_STR_PROPTITLE_GROUPBOX", "Group Box")
+#define RID_STR_PROPTITLE_IMAGEBUTTON   
NC_("RID_STR_PROPTITLE_IMAGEBUTTON", "Image Button")
+#define RID_STR_PROPTITLE_IMAGECONTROL  
NC_("RID_STR_PROPTITLE_IMAGECONTROL", "Image Control")
+#define RID_STR_PROPTITLE_FILECONTROL   
NC_("RID_STR_PROPTITLE_FILECONTROL", "File Selection")
+#define RID_STR_PROPTITLE_SCROLLBAR 
NC_("RID_STR_PROPTITLE_SCROLLBAR", "Scrollbar")
+#define RID_STR_PROPTITLE_SPINBUTTON
NC_("RID_STR_PROPTITLE_SPINBUTTON", "Spin Button")
+#define RID_STR_PROPTITLE_NAVBAR
NC_("RID_STR_PROPTITLE_NAVBAR", "Navigation Bar")
+
 #endif
 
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/framework/source/uielement/controlmenucontroller.cxx 
b/framework/source/uielement/controlmenucontroller.cxx
index fb5362307068..6af67e7a30a9 100644
--- a/framework/source/uielement/controlmenucontroller.cxx
+++ b/framework/source/uielement/controlmenucontroller.cxx
@@ -26,21 +26,19 @@
 #include 
 
 #include 
-#include 
-#include 
+#include 
 #include 
 #include 
 #include 
 #include 
-#include 
 #include 
 #include 
 #include 
 #include 
 
+#include 
 #include 
-
-// See svx/source/form/fmshimp.cxx for other use of this .ui
+#include 
 
 static const char* aCommands[] =
 {
@@ -66,6 +64,30 @@ static const char* aCommands[] =
 ".uno:ConvertToNavigationBar"
 };
 
+static const char* aLabels[] =
+{
+RID_STR_PROPTITLE_EDIT,
+RID_STR_PROPTITLE_PUSHBUTTON,
+RID_STR_PROPTITLE_FIXEDTEXT,
+RID_STR_PROPTITLE_LISTBOX,
+RID_STR_PROPTITLE_CHECKBOX,
+RID_STR_PROPTITLE_RADIOBUTTON,
+RID_STR_PROPTITLE_GROUPBOX,
+RID_STR_PROPTITLE_COMBOBOX,
+RID_STR_PROPTITLE_IMAGEBUTTON,
+RID_STR_PROPTITLE_FILECONTROL,
+RID_STR_PROPTITLE_DATEFIELD,
+RID_STR_PROPTITLE_TIMEFIELD,
+RID_STR_PROPTITLE_NUMERICFIELD,
+RID_STR_PROPTITLE_CURRENCYFIELD,
+RID_STR_PROPTITLE_PATTERNFIELD,
+RID_STR_PROPTITLE_IMAGECONTROL,
+RID_STR_PROPTITLE_FORMATTED,
+RID_STR_PROPTITLE_SCROLLBAR,
+RID_STR_PROPTITLE_SPINBUTTON,
+RID_STR_PROPTITLE_NAVBAR
+};
+
 const std::u16string_view aImgIds[] =
 {
 u"" RID_SVXBMP_EDITBOX,
@@ -137,8 +159,6 @@ public:
 virtual void SAL_CALL 

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

2021-02-21 Thread Noel (via logerrit)
 framework/inc/uielement/toolbarmerger.hxx  |2 
 framework/source/accelerators/acceleratorconfiguration.cxx |8 --
 framework/source/accelerators/documentacceleratorconfiguration.cxx |4 -
 framework/source/accelerators/moduleacceleratorconfiguration.cxx   |4 -
 framework/source/dispatch/dispatchinformationprovider.cxx  |6 -
 framework/source/dispatch/dispatchprovider.cxx |   30 
+---
 framework/source/fwe/xml/menudocumenthandler.cxx   |   13 +--
 framework/source/fwe/xml/saxnamespacefilter.cxx|3 
 framework/source/fwe/xml/statusbardocumenthandler.cxx  |8 --
 framework/source/fwe/xml/toolboxdocumenthandler.cxx|8 --
 framework/source/fwi/uielement/constitemcontainer.cxx  |5 -
 framework/source/fwi/uielement/itemcontainer.cxx   |5 -
 framework/source/fwi/uielement/rootitemcontainer.cxx   |5 -
 framework/source/helper/ocomponentaccess.cxx   |3 
 framework/source/helper/statusindicatorfactory.cxx |8 --
 framework/source/layoutmanager/layoutmanager.cxx   |4 -
 framework/source/loadenv/loadenv.cxx   |   16 +---
 framework/source/services/desktop.cxx  |   17 +---
 framework/source/services/frame.cxx|   27 
++-
 framework/source/services/modulemanager.cxx|5 -
 framework/source/services/taskcreatorsrv.cxx   |   15 +---
 framework/source/uiconfiguration/globalsettings.cxx|5 -
 framework/source/uiconfiguration/imagemanagerimpl.cxx  |   35 
--
 framework/source/uiconfiguration/windowstateconfiguration.cxx  |4 -
 framework/source/uielement/addonstoolbarwrapper.cxx|4 -
 framework/source/uielement/menubarmanager.cxx  |8 +-
 framework/source/uielement/menubarwrapper.cxx  |8 --
 framework/source/uielement/progressbarwrapper.cxx  |4 -
 framework/source/uielement/statusbarmanager.cxx|   10 +-
 framework/source/uielement/statusbarwrapper.cxx|6 -
 framework/source/uielement/toolbarmanager.cxx  |2 
 framework/source/uielement/toolbarmerger.cxx   |4 -
 framework/source/uielement/toolbarwrapper.cxx  |4 -
 framework/source/uielement/uicommanddescription.cxx|8 --
 framework/source/uifactory/addonstoolbarfactory.cxx|7 --
 framework/source/xml/acceleratorconfigurationwriter.cxx|   11 +--
 framework/source/xml/imagesdocumenthandler.cxx |   13 +--
 37 files changed, 128 insertions(+), 201 deletions(-)

New commits:
commit 897970cd0b9709258b6b5b5fc05dba2e74a72b7c
Author: Noel 
AuthorDate: Sun Feb 21 13:32:15 2021 +0200
Commit: Noel Grandin 
CommitDate: Sun Feb 21 16:11:48 2021 +0100

loplugin:refcounting in framework

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

diff --git a/framework/inc/uielement/toolbarmerger.hxx 
b/framework/inc/uielement/toolbarmerger.hxx
index b62e3be6972c..bd07bb17e7e4 100644
--- a/framework/inc/uielement/toolbarmerger.hxx
+++ b/framework/inc/uielement/toolbarmerger.hxx
@@ -115,7 +115,7 @@ class ToolBarMerger
ToolBox::ImplToolItems::size_type nPos,
const OUString&
rMergeCommandParameter );
 
-static ::cppu::OWeakObject* CreateController(
+static rtl::Reference<::cppu::OWeakObject> CreateController(
 const css::uno::Reference< css::uno::XComponentContext > & 
rxContext,
 const css::uno::Reference< css::frame::XFrame > & xFrame,
 ToolBox*pToolbar,
diff --git a/framework/source/accelerators/acceleratorconfiguration.cxx 
b/framework/source/accelerators/acceleratorconfiguration.cxx
index 96c0056d35c0..821b1137259c 100644
--- a/framework/source/accelerators/acceleratorconfiguration.cxx
+++ b/framework/source/accelerators/acceleratorconfiguration.cxx
@@ -384,14 +384,12 @@ void XMLBasedAcceleratorConfiguration::impl_ts_load(const 
css::uno::Reference< c
 // Note: Use special filter object between parser and reader
 // to get filtered xml with right namespaces ...
 // Use further a temp cache for reading!
-AcceleratorConfigurationReader*pReader = new 
AcceleratorConfigurationReader(m_aReadCache);
-css::uno::Reference< css::xml::sax::XDocumentHandler > xReader 
(static_cast< ::cppu::OWeakObject* >(pReader), css::uno::UNO_QUERY_THROW);
-SaxNamespaceFilter*

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

2021-01-19 Thread Rizal Muttaqin (via logerrit)
 framework/inc/bitmaps.hlst |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit 3d3a0c412500a2b57ff1d49f05506ee62ef9d4c7
Author: Rizal Muttaqin 
AuthorDate: Wed Jan 20 06:17:01 2021 +0700
Commit: Rizal Muttaqin 
CommitDate: Wed Jan 20 04:54:17 2021 +0100

tdf#139774 fix wrong use List Box icon in Combo Box right click menu

Change-Id: I23e48ea99f05c38c68747218a3191e76c715f0c9
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/109660
Tested-by: Jenkins
Reviewed-by: Rizal Muttaqin 

diff --git a/framework/inc/bitmaps.hlst b/framework/inc/bitmaps.hlst
index 71a3efe823d1..b7e3fdd064e1 100644
--- a/framework/inc/bitmaps.hlst
+++ b/framework/inc/bitmaps.hlst
@@ -21,7 +21,7 @@
 #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/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"
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2020-12-02 Thread cu-16bcs1798 (via logerrit)
 framework/inc/uifactory/configurationaccessfactorymanager.hxx |5 +
 framework/inc/uifactory/factoryconfiguration.hxx  |4 +---
 framework/inc/uifactory/menubarfactory.hxx|5 +
 3 files changed, 3 insertions(+), 11 deletions(-)

New commits:
commit 1d3d958e0089429e05265cfd13dc540fce5887d1
Author: cu-16bcs1798 
AuthorDate: Thu Dec 3 01:34:39 2020 +0530
Commit: Ilmari Lauhakangas 
CommitDate: Thu Dec 3 08:41:11 2020 +0100

tdf#124176 Use #pragma once in framework/inc/uifactory

Change-Id: Ibb2d7c8a8fac7fabace2d751f0082533ce2c1f50
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/107132
Tested-by: Jenkins
Reviewed-by: Ilmari Lauhakangas 

diff --git a/framework/inc/uifactory/configurationaccessfactorymanager.hxx 
b/framework/inc/uifactory/configurationaccessfactorymanager.hxx
index 4f186107a729..cf4f151f40dc 100644
--- a/framework/inc/uifactory/configurationaccessfactorymanager.hxx
+++ b/framework/inc/uifactory/configurationaccessfactorymanager.hxx
@@ -17,8 +17,7 @@
  *   the License at http://www.apache.org/licenses/LICENSE-2.0 .
  */
 
-#ifndef INCLUDED_FRAMEWORK_INC_UIFACTORY_CONFIGURATIONACCESSFACTORYMANAGER_HXX
-#define INCLUDED_FRAMEWORK_INC_UIFACTORY_CONFIGURATIONACCESSFACTORYMANAGER_HXX
+#pragma once
 
 #include 
 
@@ -79,6 +78,4 @@ class ConfigurationAccess_FactoryManager final : public 
::cppu::WeakImplHelper<
 
 } // namespace framework
 
-#endif // 
INCLUDED_FRAMEWORK_INC_UIFACTORY_CONFIGURATIONACCESSFACTORYMANAGER_HXX
-
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/framework/inc/uifactory/factoryconfiguration.hxx 
b/framework/inc/uifactory/factoryconfiguration.hxx
index fad809575c2a..9a8112702ec0 100644
--- a/framework/inc/uifactory/factoryconfiguration.hxx
+++ b/framework/inc/uifactory/factoryconfiguration.hxx
@@ -17,8 +17,7 @@
  *   the License at http://www.apache.org/licenses/LICENSE-2.0 .
  */
 
-#ifndef INCLUDED_FRAMEWORK_INC_UIFACTORY_FACTORYCONFIGURATION_HXX
-#define INCLUDED_FRAMEWORK_INC_UIFACTORY_FACTORYCONFIGURATION_HXX
+#pragma once
 
 #include 
 #include 
@@ -88,6 +87,5 @@ private:
 };
 
 } // namespace framework
-#endif // INCLUDED_FRAMEWORK_INC_UIFACTORY_FACTORYCONFIGURATION_HXX
 
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/framework/inc/uifactory/menubarfactory.hxx 
b/framework/inc/uifactory/menubarfactory.hxx
index 661b5887760f..9019928182d7 100644
--- a/framework/inc/uifactory/menubarfactory.hxx
+++ b/framework/inc/uifactory/menubarfactory.hxx
@@ -17,8 +17,7 @@
  *   the License at http://www.apache.org/licenses/LICENSE-2.0 .
  */
 
-#ifndef INCLUDED_FRAMEWORK_INC_UIFACTORY_MENUBARFACTORY_HXX
-#define INCLUDED_FRAMEWORK_INC_UIFACTORY_MENUBARFACTORY_HXX
+#pragma once
 
 #include 
 #include 
@@ -71,6 +70,4 @@ typedef ::cppu::WeakImplHelper<
 };
 }
 
-#endif // INCLUDED_FRAMEWORK_INC_UIFACTORY_MENUBARFACTORY_HXX
-
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
___
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 solenv/clang-format

2020-11-13 Thread Philipp Hofer (via logerrit)
 framework/inc/helper/wakeupthread.hxx |   15 +--
 framework/inc/jobs/jobconst.hxx   |   12 +-
 framework/inc/services/uriabbreviation.hxx|   18 ++--
 framework/source/classes/framecontainer.cxx   |   60 +++---
 framework/source/dispatch/isstartmoduledispatch.hxx   |8 -
 framework/source/fwe/classes/fwkresid.cxx |5 -
 framework/source/fwe/xml/toolboxconfiguration.cxx |   44 --
 framework/source/fwi/helper/shareablemutex.cxx|   16 ---
 framework/source/helper/statusindicator.cxx   |   27 ++
 framework/source/jobs/jobresult.cxx   |   27 +++---
 framework/source/uiconfiguration/CommandImageResolver.hxx |8 -
 framework/source/xml/imagesconfiguration.cxx  |   41 -
 solenv/clang-format/excludelist   |   12 --
 13 files changed, 132 insertions(+), 161 deletions(-)

New commits:
commit 49494bb703107835f83671d9272a0326feec8bb4
Author: Philipp Hofer 
AuthorDate: Thu Nov 12 12:58:48 2020 +0100
Commit: Christian Lohmaier 
CommitDate: Fri Nov 13 15:18:12 2020 +0100

tdf#123936 Formatting files in module framework with clang-format

Change-Id: I8210a1d4bb51519f59265f370f5e8bab8a3c4179
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/105674
Tested-by: Jenkins
Reviewed-by: Christian Lohmaier 

diff --git a/framework/inc/helper/wakeupthread.hxx 
b/framework/inc/helper/wakeupthread.hxx
index 51cf859f0462..49f268a821e8 100644
--- a/framework/inc/helper/wakeupthread.hxx
+++ b/framework/inc/helper/wakeupthread.hxx
@@ -28,13 +28,15 @@
 #include 
 #include 
 
-namespace com::sun::star::util {
-class XUpdatable;
+namespace com::sun::star::util
+{
+class XUpdatable;
 }
 
-namespace framework{
-
-class WakeUpThread final : public salhelper::Thread {
+namespace framework
+{
+class WakeUpThread final : public salhelper::Thread
+{
 css::uno::WeakReference updatable_;
 osl::Condition condition_;
 
@@ -44,11 +46,10 @@ class WakeUpThread final : public salhelper::Thread {
 void execute() override;
 
 public:
-WakeUpThread(css::uno::Reference const & updatable);
+WakeUpThread(css::uno::Reference const& updatable);
 
 void stop();
 };
-
 }
 
 #endif
diff --git a/framework/inc/jobs/jobconst.hxx b/framework/inc/jobs/jobconst.hxx
index b2efb749e3a9..31a504a9d360 100644
--- a/framework/inc/jobs/jobconst.hxx
+++ b/framework/inc/jobs/jobconst.hxx
@@ -22,8 +22,8 @@
 
 #include 
 
-namespace framework{
-
+namespace framework
+{
 /**
 @short  defines all constant values used within a job environment.
 
@@ -34,10 +34,10 @@ namespace framework{
  */
 class JobConst
 {
-public:
-static constexpr OUStringLiteral ANSWER_DEACTIVATE_JOB = u"Deactivate";
-static constexpr OUStringLiteral ANSWER_SAVE_ARGUMENTS = 
u"SaveArguments";
-static constexpr OUStringLiteral ANSWER_SEND_DISPATCHRESULT = 
u"SendDispatchResult";
+public:
+static constexpr OUStringLiteral ANSWER_DEACTIVATE_JOB = u"Deactivate";
+static constexpr OUStringLiteral ANSWER_SAVE_ARGUMENTS = u"SaveArguments";
+static constexpr OUStringLiteral ANSWER_SEND_DISPATCHRESULT = 
u"SendDispatchResult";
 };
 
 } // namespace framework
diff --git a/framework/inc/services/uriabbreviation.hxx 
b/framework/inc/services/uriabbreviation.hxx
index 200296da2df9..f4e3ef10dc4b 100644
--- a/framework/inc/services/uriabbreviation.hxx
+++ b/framework/inc/services/uriabbreviation.hxx
@@ -28,23 +28,25 @@
 
 namespace framework
 {
-
-class UriAbbreviation final : public ::cppu::WeakImplHelper< 
css::util::XStringAbbreviation, css::lang::XServiceInfo>
+class UriAbbreviation final
+: public ::cppu::WeakImplHelper
 {
 public:
-explicit UriAbbreviation(css::uno::Reference< css::uno::XComponentContext 
> const & context);
+explicit UriAbbreviation(css::uno::Reference 
const& context);
 
 /* interface XServiceInfo */
 virtual OUString SAL_CALL getImplementationName() override;
-virtual sal_Bool SAL_CALL supportsService( const OUString& sServiceName ) 
override;
-virtual css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames() 
override;
+virtual sal_Bool SAL_CALL supportsService(const OUString& sServiceName) 
override;
+virtual css::uno::Sequence SAL_CALL getSupportedServiceNames() 
override;
 
 // css::util::XStringAbbreviation:
-virtual OUString SAL_CALL abbreviateString(const css::uno::Reference< 
css::util::XStringWidth > & xStringWidth, ::sal_Int32 nWidth, const OUString & 
aString) override;
+virtual OUString SAL_CALL
+abbreviateString(const css::uno::Reference& 
xStringWidth,
+ ::sal_Int32 nWidth, const OUString& aString) override;
 
 private:
-UriAbbreviation(UriAbbreviation const &) = delete;
-UriAbbreviation& operator =(UriAbbreviation const &) = delete;
+UriAbbreviation(UriAbbreviation const&) = 

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

2020-09-18 Thread Szymon Kłos (via logerrit)
 framework/inc/uielement/uicommanddescription.hxx   |7 +
 framework/source/uiconfiguration/uicategorydescription.cxx |   12 ++-
 framework/source/uielement/uicommanddescription.cxx|   50 +
 3 files changed, 50 insertions(+), 19 deletions(-)

New commits:
commit 8de58b6fd63302544affb90df347323b82b7d259
Author: Szymon Kłos 
AuthorDate: Thu Sep 3 21:07:22 2020 +0200
Commit: Szymon Kłos 
CommitDate: Fri Sep 18 13:30:37 2020 +0200

lok: make labels and tooltips translated for commands

In the online we can have multiple sessions with
different languages so load cached translations only
if match current language

Change-Id: I6fcf23f1c340c0c0daffa8862f0b74e4e458c1fc
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/102016
Tested-by: Jenkins CollaboraOffice 
Reviewed-by: Szymon Kłos 
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/102960
Tested-by: Jenkins
Tested-by: Szymon Kłos 

diff --git a/framework/inc/uielement/uicommanddescription.hxx 
b/framework/inc/uielement/uicommanddescription.hxx
index 6886224ceb00..146b4f42db3a 100644
--- a/framework/inc/uielement/uicommanddescription.hxx
+++ b/framework/inc/uielement/uicommanddescription.hxx
@@ -20,6 +20,7 @@
 #pragma once
 
 #include 
+#include 
 #include 
 #include 
 #include 
@@ -29,6 +30,7 @@
 #include 
 #include 
 #include 
+#include 
 
 namespace framework
 {
@@ -80,12 +82,13 @@ public:
 protected:
 UICommandDescription( const css::uno::Reference< 
css::uno::XComponentContext>& rxContext, bool  );
 void impl_fillElements(const char* _pName);
+void ensureGenericUICommandsForLanguage(const LanguageTag& rLanguage);
 
 OUString  
m_aPrivateResourceURL;
 css::uno::Reference< css::uno::XComponentContext >m_xContext;
 ModuleToCommandFileMap
m_aModuleToCommandFileMap;
-UICommandsHashMap 
m_aUICommandsHashMap;
-css::uno::Reference< css::container::XNameAccess >
m_xGenericUICommands;
+std::map  
m_aUICommandsHashMap;
+std::map > m_xGenericUICommands;
 css::uno::Reference< css::frame::XModuleManager2 >
m_xModuleManager;
 };
 
diff --git a/framework/source/uiconfiguration/uicategorydescription.cxx 
b/framework/source/uiconfiguration/uicategorydescription.cxx
index 517a8d47f5b4..471bd67ca7c7 100644
--- a/framework/source/uiconfiguration/uicategorydescription.cxx
+++ b/framework/source/uiconfiguration/uicategorydescription.cxx
@@ -29,6 +29,8 @@
 #include 
 #include 
 #include 
+#include 
+#include 
 
 #include 
 
@@ -362,16 +364,18 @@ public:
 UICategoryDescription::UICategoryDescription( const Reference< 
XComponentContext >& rxContext ) :
 UICommandDescription(rxContext,true)
 {
+LanguageTag aCurrentLanguage = SvtSysLocale().GetUILanguageTag();
 Reference< XNameAccess > xEmpty;
 OUString aGenericCategories( "GenericCategories" );
-m_xGenericUICommands = new ConfigurationAccess_UICategory( 
aGenericCategories, xEmpty, rxContext );
+m_xGenericUICommands[aCurrentLanguage] = new 
ConfigurationAccess_UICategory( aGenericCategories, xEmpty, rxContext );
 
 // insert generic categories mappings
 m_aModuleToCommandFileMap.emplace( OUString("generic"), aGenericCategories 
);
 
-UICommandsHashMap::iterator pCatIter = m_aUICommandsHashMap.find( 
aGenericCategories );
-if ( pCatIter != m_aUICommandsHashMap.end() )
-pCatIter->second = m_xGenericUICommands;
+auto& rMap = m_aUICommandsHashMap[aCurrentLanguage];
+UICommandsHashMap::iterator pCatIter = rMap.find( aGenericCategories );
+if ( pCatIter != rMap.end() )
+pCatIter->second = m_xGenericUICommands[aCurrentLanguage];
 
 impl_fillElements("ooSetupFactoryCmdCategoryConfigRef");
 }
diff --git a/framework/source/uielement/uicommanddescription.cxx 
b/framework/source/uielement/uicommanddescription.cxx
index f53c2a5cb1fc..28c606ea96a4 100644
--- a/framework/source/uielement/uicommanddescription.cxx
+++ b/framework/source/uielement/uicommanddescription.cxx
@@ -31,6 +31,7 @@
 
 #include 
 #include 
+#include 
 
 #include 
 #include 
@@ -552,21 +553,32 @@ void SAL_CALL ConfigurationAccess_UICommand::disposing( 
const EventObject& aEven
 }
 }
 
+void UICommandDescription::ensureGenericUICommandsForLanguage(const 
LanguageTag& rLanguage)
+{
+auto xGenericUICommands = m_xGenericUICommands.find(rLanguage);
+if (xGenericUICommands == m_xGenericUICommands.end())
+{
+Reference< XNameAccess > xEmpty;
+m_xGenericUICommands[rLanguage] = new ConfigurationAccess_UICommand( 
"GenericCommands", xEmpty, m_xContext );
+}
+}
+
 UICommandDescription::UICommandDescription(const Reference< XComponentContext 
>& rxContext)
 : UICommandDescription_BASE(m_aMutex)
 , 

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

2020-09-07 Thread Maxim Monastirsky (via logerrit)
 framework/inc/uielement/menubarmanager.hxx|4 +
 framework/source/uielement/menubarmanager.cxx |   37 +-
 framework/source/uielement/resourcemenucontroller.cxx |   11 +++--
 3 files changed, 30 insertions(+), 22 deletions(-)

New commits:
commit f1a7b8275e9c301bbfa3a7a0df3a5209ca3cff62
Author: Maxim Monastirsky 
AuthorDate: Mon Sep 7 11:59:25 2020 +0300
Commit: Maxim Monastirsky 
CommitDate: Mon Sep 7 15:10:31 2020 +0200

Pass correct module id and dispatch provider to the window menu

This matters in a merged menu bar (e.g. insert chart), where the
Window menu belongs to the container rather than to the embedded
object. (Same as for the File menu, see also commit
94a7a71b070d3911b39d1026ba266768b71ba8a6 - "MenuBarManager:
Actually use xPopupMenuDispatchProvider".)

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

diff --git a/framework/inc/uielement/menubarmanager.hxx 
b/framework/inc/uielement/menubarmanager.hxx
index 67f5d95dd87c..9cb47eedc7d3 100644
--- a/framework/inc/uielement/menubarmanager.hxx
+++ b/framework/inc/uielement/menubarmanager.hxx
@@ -162,7 +162,9 @@ class MenuBarManager final :
 static void  MergeAddonMenus( Menu* pMenuBar, const 
MergeMenuInstructionContainer&, const OUString& aModuleIdentifier );
 
 MenuItemHandler* GetMenuItemHandler( sal_uInt16 nItemId );
-bool CreatePopupMenuController( MenuItemHandler* 
pMenuItemHandler );
+bool CreatePopupMenuController( MenuItemHandler* 
pMenuItemHandler,
+const css::uno::Reference< 
css::frame::XDispatchProvider >& rDispatchProvider,
+const OUString& 
rModuleIdentifier );
 void AddMenu(MenuBarManager* pSubMenuManager,const 
OUString& _sItemCommand,sal_uInt16 _nItemId);
 sal_uInt16   FillItemCommand(OUString& _rItemCommand, Menu* 
_pMenu,sal_uInt16 _nIndex) const;
 void SetHdl();
diff --git a/framework/source/uielement/menubarmanager.cxx 
b/framework/source/uielement/menubarmanager.cxx
index 6bcee628e1df..46e32ae1f2a2 100644
--- a/framework/source/uielement/menubarmanager.cxx
+++ b/framework/source/uielement/menubarmanager.cxx
@@ -43,7 +43,7 @@
 #include 
 
 #include 
-#include 
+#include 
 #include 
 #include 
 #include 
@@ -683,7 +683,7 @@ IMPL_LINK( MenuBarManager, Activate, Menu *, pMenu, bool )
  m_xPopupMenuControllerFactory->hasController( 
menuItemHandler->aMenuItemURL, m_aModuleIdentifier ) )
 {
 if( xMenuItemDispatch.is() || 
menuItemHandler->aMenuItemURL != ".uno:RecentFileList" )
-bPopupMenu = 
CreatePopupMenuController(menuItemHandler.get());
+bPopupMenu = 
CreatePopupMenuController(menuItemHandler.get(), m_xDispatchProvider, 
m_aModuleIdentifier);
 }
 else if ( menuItemHandler->xPopupMenuController.is() )
 {
@@ -880,7 +880,9 @@ OUString MenuBarManager::RetrieveLabelFromCommand(const 
OUString& rCmdURL)
 return vcl::CommandInfoProvider::GetMenuLabelForCommand(aProperties);
 }
 
-bool MenuBarManager::CreatePopupMenuController( MenuItemHandler* 
pMenuItemHandler )
+bool MenuBarManager::CreatePopupMenuController( MenuItemHandler* 
pMenuItemHandler,
+const css::uno::Reference< 
css::frame::XDispatchProvider >& rDispatchProvider,
+const OUString& 
rModuleIdentifier )
 {
 OUString aItemCommand( pMenuItemHandler->aMenuItemURL );
 
@@ -888,10 +890,12 @@ bool MenuBarManager::CreatePopupMenuController( 
MenuItemHandler* pMenuItemHandle
 if ( !m_xPopupMenuControllerFactory.is() )
 return false;
 
-Sequence< Any > aSeq( 3 );
-aSeq[0] <<= comphelper::makePropertyValue( "ModuleIdentifier", 
m_aModuleIdentifier );
-aSeq[1] <<= comphelper::makePropertyValue( "Frame", m_xFrame );
-aSeq[2] <<= comphelper::makePropertyValue( "InToolbar", !m_bHasMenuBar );
+auto aSeq( comphelper::InitAnyPropertySequence( {
+{ "DispatchProvider", makeAny(rDispatchProvider) },
+{ "ModuleIdentifier", makeAny(rModuleIdentifier) },
+{ "Frame", makeAny(m_xFrame) },
+{ "InToolbar", makeAny(!m_bHasMenuBar) }
+} ) );
 
 Reference< XPopupMenuController > xPopupMenuController(
 
m_xPopupMenuControllerFactory->createInstanceWithArgumentsAndContext(
@@ -992,8 +996,14 @@ void MenuBarManager::FillMenuManager( Menu* pMenu, const 
Reference< XFrame >& rF
 pMenu->SetHelpCommand( nItemId, "" );
 }
 
+// Retrieve 

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

2020-09-06 Thread Maxim Monastirsky (via logerrit)
 framework/inc/uielement/menubarmanager.hxx|1 
 framework/source/uielement/menubarmanager.cxx |   59 ++
 2 files changed, 6 insertions(+), 54 deletions(-)

New commits:
commit 34a09c9c61bff30e8c4d16132bb47b2b1b16e422
Author: Maxim Monastirsky 
AuthorDate: Wed Sep 2 02:05:54 2020 +0300
Commit: Maxim Monastirsky 
CommitDate: Mon Sep 7 00:19:24 2020 +0200

MenuBarManager: Simplify module id handling

Now that we have a single ctor, which always calls
FillMenuManager.

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

diff --git a/framework/inc/uielement/menubarmanager.hxx 
b/framework/inc/uielement/menubarmanager.hxx
index c688994313b8..67f5d95dd87c 100644
--- a/framework/inc/uielement/menubarmanager.hxx
+++ b/framework/inc/uielement/menubarmanager.hxx
@@ -172,7 +172,6 @@ class MenuBarManager final :
 bool 
m_bShowMenuImages;
 bool 
m_bRetrieveImages;
 bool 
m_bAcceleratorCfg;
-bool 
m_bModuleIdentified;
 bool 
m_bHasMenuBar;
 OUString 
m_aModuleIdentifier;
 VclPtr 
m_pVCLMenu;
diff --git a/framework/source/uielement/menubarmanager.cxx 
b/framework/source/uielement/menubarmanager.cxx
index 21817bd36b93..6bcee628e1df 100644
--- a/framework/source/uielement/menubarmanager.cxx
+++ b/framework/source/uielement/menubarmanager.cxx
@@ -36,7 +36,6 @@
 #include 
 #include 
 #include 
-#include 
 #include 
 #include 
 #include 
@@ -92,7 +91,6 @@ MenuBarManager::MenuBarManager(
 WeakComponentImplHelper( m_aMutex )
 , m_bRetrieveImages( false )
 , m_bAcceleratorCfg( false )
-, m_bModuleIdentified( false )
 , m_bHasMenuBar( bHasMenuBar )
 , m_xContext(rxContext)
 , m_xURLTransformer(_xURLTransformer)
@@ -927,6 +925,12 @@ void MenuBarManager::FillMenuManager( Menu* pMenu, const 
Reference< XFrame >& rF
 m_bShowMenuImages   = rSettings.GetUseImagesInMenus();
 m_bRetrieveImages   = false;
 
+// Set module identifier when provided from outside
+if (!rModuleIdentifier.isEmpty())
+m_aModuleIdentifier = rModuleIdentifier;
+else
+m_aModuleIdentifier = 
vcl::CommandInfoProvider::GetModuleIdentifier(m_xFrame);
+
 // Add root as ui configuration listener
 RetrieveImageManagers();
 
@@ -958,13 +962,6 @@ void MenuBarManager::FillMenuManager( Menu* pMenu, const 
Reference< XFrame >& rF
 {
 sal_uInt16 nItemId = FillItemCommand(aItemCommand,pMenu, i );
 
-// Set module identifier when provided from outside
-if ( !rModuleIdentifier.isEmpty() )
-{
-m_aModuleIdentifier = rModuleIdentifier;
-m_bModuleIdentified = true;
-}
-
 if (( pMenu->IsMenuBar() || bAccessibilityEnabled ) &&
 ( pMenu->GetItemText( nItemId ).isEmpty() ))
 {
@@ -1128,23 +1125,6 @@ void 
MenuBarManager::impl_RetrieveShortcutsFromConfiguration(
 
 void MenuBarManager::RetrieveShortcuts( std::vector< 
std::unique_ptr >& aMenuShortCuts )
 {
-if ( !m_bModuleIdentified )
-{
-m_bModuleIdentified = true;
-Reference< XModuleManager2 > xModuleManager = ModuleManager::create( 
m_xContext );
-
-try
-{
-m_aModuleIdentifier = xModuleManager->identify( m_xFrame );
-}
-catch( const Exception& )
-{
-}
-}
-
-if ( !m_bModuleIdentified )
-return;
-
 Reference< XAcceleratorConfiguration > xDocAccelCfg( 
m_xDocAcceleratorManager );
 Reference< XAcceleratorConfiguration > xModuleAccelCfg( 
m_xModuleAcceleratorManager );
 Reference< XAcceleratorConfiguration > xGlobalAccelCfg( 
m_xGlobalAcceleratorManager );
@@ -1251,19 +1231,6 @@ void MenuBarManager::RetrieveImageManagers()
 }
 }
 
-Reference< XModuleManager2 > xModuleManager;
-if ( m_aModuleIdentifier.isEmpty() )
-xModuleManager.set( ModuleManager::create( m_xContext ) );
-
-try
-{
-if ( xModuleManager.is() )
-m_aModuleIdentifier = xModuleManager->identify( Reference< 
XInterface >( m_xFrame, UNO_QUERY ) );
-}
-catch( const Exception& )
-{
-}
-
 if ( !m_xModuleImageManager.is() )
 {
 Reference< XModuleUIConfigurationManagerSupplier > 
xModuleCfgMgrSupplier =
@@ -1483,20 +1450,6 @@ void MenuBarManager::SetItemContainer( const Reference< 
XIndexAccess >& rItemCon
 
 Reference< XFrame > xFrame = m_xFrame;
 
-if ( !m_bModuleIdentified )
-{
-

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

2020-09-06 Thread Maxim Monastirsky (via logerrit)
 framework/inc/menuconfiguration.hxx   |2 
 framework/inc/uielement/menubarmanager.hxx|9 -
 framework/source/uielement/menubarmanager.cxx |  130 ++
 3 files changed, 12 insertions(+), 129 deletions(-)

New commits:
commit 34f37ce6b9feef6091e0f27a2618e3f812f42008
Author: Maxim Monastirsky 
AuthorDate: Tue Sep 1 23:25:41 2020 +0300
Commit: Maxim Monastirsky 
CommitDate: Mon Sep 7 00:18:43 2020 +0200

MenuBarManager: Simplify addon menu creation

Addon menus were created with a different ctor, which called
Init instead of FillMenuManager. But the former is just a
subset of the latter, and I don't see in the latter anything
particularly harmful for addon menus.

There was however the bool _bHandlePopUp parameter, which
controlled whether to create popup menus to be used by popup
menu controllers, but: (a) it doesn't make any sense to me to
allow controllers in some addon menus but not in others, and
(b) the Activate method creates controllers unconditionally,
which means that a controller might still be created, but
then get nullptr for the popup menu, and crash.

There was also m_bIsBookmarkMenu, which was set to true for
addon menus, and used in the Select method to add Referer
argument to the executed command. As a matter of fact, this
argument is useless, as the referer is never evaluated for any
command or macro execution. Only affected case might be when
content URLs used directly as menu commands. But such usage
isn't common, and even then an empty referer is similarly
accepted by SvtSecurityOptions::isUntrustedReferer. However
seeing the message of f0a9ca24fd4bf79cac908bf0d6fdb8905dc504db
("rhbz#887420 Implement "block untrusted referer links" feature")
it appears that it's better to have the explicit referer anyway
(but with a different check, as m_bIsBookmarkMenu is now gone).

(Historically, the referer argument wasn't even introduced for
addon menus, but for the new document and wizards menus, which
used to be managed by the menu manager back then. This can be
seen in commit 40fefd8e0d5937666129278fe2b27c36cb58033c ("support
for images and target frames"). Only later this code path was
reused for addon menus. That's why the member was called
m_bIsBookmarkMenu, as "bookmark menu" was the term used for the
new and wizard menus, and there was also a related BmkMenu class.)

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

diff --git a/framework/inc/menuconfiguration.hxx 
b/framework/inc/menuconfiguration.hxx
index 84943f5326a6..ea3acc41a2f0 100644
--- a/framework/inc/menuconfiguration.hxx
+++ b/framework/inc/menuconfiguration.hxx
@@ -29,8 +29,6 @@ namespace com::sun::star::io { class XInputStream; }
 namespace com::sun::star::io { class XOutputStream; }
 namespace com::sun::star::uno { class XComponentContext; }
 
-const sal_uInt16 ITEMID_ADDONLIST   = 6678; // used to be a SID in 
sfx2, now just a unique id...
-
 namespace framework
 {
 
diff --git a/framework/inc/uielement/menubarmanager.hxx 
b/framework/inc/uielement/menubarmanager.hxx
index eb2cb24a85b2..c688994313b8 100644
--- a/framework/inc/uielement/menubarmanager.hxx
+++ b/framework/inc/uielement/menubarmanager.hxx
@@ -65,13 +65,6 @@ class MenuBarManager final :
 css::ui::XUIConfigurationListener,
 css::awt::XSystemDependentMenuPeer>
 {
-MenuBarManager(
-const css::uno::Reference< css::uno::XComponentContext >& xContext,
-const css::uno::Reference< css::frame::XFrame >& rFrame,
-const css::uno::Reference< css::util::XURLTransformer >& 
_xURLTransformer,
-Menu*   pAddonMenu,
-boolpopup);
-
 public:
 MenuBarManager(
 const css::uno::Reference< css::uno::XComponentContext >& xContext,
@@ -172,12 +165,10 @@ class MenuBarManager final :
 bool CreatePopupMenuController( MenuItemHandler* 
pMenuItemHandler );
 void AddMenu(MenuBarManager* pSubMenuManager,const 
OUString& _sItemCommand,sal_uInt16 _nItemId);
 sal_uInt16   FillItemCommand(OUString& _rItemCommand, Menu* 
_pMenu,sal_uInt16 _nIndex) const;
-void Init(const css::uno::Reference< css::frame::XFrame >& 
rFrame,Menu* pAddonMenu,bool _bHandlePopUp);
 void SetHdl();
 
 bool 
m_bDeleteMenu;
 bool m_bActive;
-bool 
m_bIsBookmarkMenu;
 bool 
m_bShowMenuImages;
 bool  

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

2020-09-01 Thread Andrea Gelmini (via logerrit)
 framework/inc/uielement/menubarmanager.hxx|2 +-
 framework/source/uielement/menubarmanager.cxx |   14 +++---
 2 files changed, 8 insertions(+), 8 deletions(-)

New commits:
commit 01b91d1597661cfc32c7b9f57d7837e25bd7d418
Author: Andrea Gelmini 
AuthorDate: Mon Aug 31 15:44:23 2020 +0200
Commit: Julien Nabet 
CommitDate: Tue Sep 1 08:51:34 2020 +0200

Fix typo in code

It passed "make check" on linux

Change-Id: I275334508796c38c7eaaf6a99e435b4ed7b56f4b
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/101787
Tested-by: Jenkins
Reviewed-by: Julien Nabet 

diff --git a/framework/inc/uielement/menubarmanager.hxx 
b/framework/inc/uielement/menubarmanager.hxx
index 60baef602fc7..eb2cb24a85b2 100644
--- a/framework/inc/uielement/menubarmanager.hxx
+++ b/framework/inc/uielement/menubarmanager.hxx
@@ -196,7 +196,7 @@ class MenuBarManager final :
 css::uno::Reference< css::ui::XAcceleratorConfiguration >
m_xGlobalAcceleratorManager;
 css::uno::Reference< css::uno::XComponentContext >   
m_xContext;
 css::uno::Reference< css::util::XURLTransformer >
m_xURLTransformer;
-css::uno::Reference< css::container::XIndexAccess >  
m_xDeferedItemContainer;
+css::uno::Reference< css::container::XIndexAccess >  
m_xDeferredItemContainer;
 OUString 
m_sIconTheme;
 Timer
m_aAsyncSettingsTimer;
 };
diff --git a/framework/source/uielement/menubarmanager.cxx 
b/framework/source/uielement/menubarmanager.cxx
index 6b892148b29f..413f77fe3ed2 100644
--- a/framework/source/uielement/menubarmanager.cxx
+++ b/framework/source/uielement/menubarmanager.cxx
@@ -152,7 +152,7 @@ Any SAL_CALL MenuBarManager::getMenuHandle( const Sequence< 
sal_Int8 >& /*Proces
 MenuBarManager::~MenuBarManager()
 {
 // stop asynchronous settings timer
-m_xDeferedItemContainer.clear();
+m_xDeferredItemContainer.clear();
 m_aAsyncSettingsTimer.Stop();
 
 SAL_WARN_IF( OWeakObject::m_refCount != 0, "fwk.uielement", "Who wants to 
delete an object with refcount > 0!" );
@@ -168,7 +168,7 @@ void MenuBarManager::Destroy()
 // stop asynchronous settings timer and
 // release deferred item container reference
 m_aAsyncSettingsTimer.Stop();
-m_xDeferedItemContainer.clear();
+m_xDeferredItemContainer.clear();
 RemoveListener();
 
 m_aMenuItemHandlerVector.clear();
@@ -771,7 +771,7 @@ IMPL_LINK( MenuBarManager, Deactivate, Menu *, pMenu, bool )
 if ( pMenu == m_pVCLMenu )
 {
 m_bActive = false;
-if ( pMenu->IsMenuBar() && m_xDeferedItemContainer.is() )
+if ( pMenu->IsMenuBar() && m_xDeferredItemContainer.is() )
 {
 // Start timer to handle settings asynchronous
 // Changing the menu inside this handler leads to
@@ -792,10 +792,10 @@ IMPL_LINK_NOARG( MenuBarManager, AsyncSettingsHdl, 
Timer*, void)
 static_cast< ::cppu::OWeakObject* >( this ), UNO_QUERY_THROW );
 
 m_aAsyncSettingsTimer.Stop();
-if ( !m_bActive && m_xDeferedItemContainer.is() )
+if ( !m_bActive && m_xDeferredItemContainer.is() )
 {
-SetItemContainer( m_xDeferedItemContainer );
-m_xDeferedItemContainer.clear();
+SetItemContainer( m_xDeferredItemContainer );
+m_xDeferredItemContainer.clear();
 }
 }
 
@@ -1536,7 +1536,7 @@ void MenuBarManager::SetItemContainer( const Reference< 
XIndexAccess >& rItemCon
 // Check active state as we cannot change our VCL menu during 
activation by the user
 if ( m_bActive )
 {
-m_xDeferedItemContainer = rItemContainer;
+m_xDeferredItemContainer = rItemContainer;
 return;
 }
 
___
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/vcl odk/examples officecfg/registry pyuno/demo sfx2/source vcl/source

2020-08-31 Thread Maxim Monastirsky (via logerrit)
 framework/inc/addonmenu.hxx |1 
 framework/inc/uielement/toolbarmerger.hxx   |2 
 framework/source/fwe/classes/addonmenu.cxx  |   10 ---
 framework/source/uielement/menubarmanager.cxx   |   32 
+-
 framework/source/uielement/toolbarmanager.cxx   |3 
 framework/source/uielement/toolbarmerger.cxx|   11 ---
 include/vcl/NotebookBarAddonsMerger.hxx |8 --
 odk/examples/DevelopersGuide/Components/Addons/JobsAddon/Addons.xcu |   15 
 officecfg/registry/schema/org/openoffice/Office/Addons.xcs  |   12 ++-
 pyuno/demo/Addons.xcu   |3 
 sfx2/source/notebookbar/SfxNotebookBar.cxx  |   15 
 vcl/source/window/NotebookBarAddonsMerger.cxx   |7 --
 12 files changed, 20 insertions(+), 99 deletions(-)

New commits:
commit 3e4968e6761c816c0a6aedf59485191af8a0fa4e
Author: Maxim Monastirsky 
AuthorDate: Sun Aug 23 19:18:33 2020 +0300
Commit: Maxim Monastirsky 
CommitDate: Mon Aug 31 15:19:43 2020 +0200

Remove remains of private:image/ via ImageIdentifier addon property

This is broken since commit 5c39b28a87060f80404079ab77604f664addb063
("tdf#96059 Replaced imageproducer with CommandInfoProvider") but so
far no one complained (maybe because the usefulness of such internal
images from extensions is questionable at least). Given also that
the whole ImageIdentifier feature (even its still working part) is
obsolete since OOo 2.0.3 (according to the OOo dev guide), and that
the availability of a particular image from an internal hardcoded
image list by a particular numerical id is more an implementation
detail, let's just remove the broken code instead of fixing it.

In the meantime, the code was also copied into the newly introduced
notebookbar addon code, so I handled it there too.

There are also the registry schema and a sdk example that mention this
feature, and need to be adjusted. Interesting that the particular
example used there - private:image/3216 is actually broken since 2011
with commit 2559cab126f81375197051fb5b07ba6abb9efc77
("FDO#42454 - EasyHack: remove code associated with unused icons").

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

diff --git a/framework/inc/addonmenu.hxx b/framework/inc/addonmenu.hxx
index dbffa8c1e495..0b778b705afe 100644
--- a/framework/inc/addonmenu.hxx
+++ b/framework/inc/addonmenu.hxx
@@ -74,7 +74,6 @@ class AddonMenuManager
 OUString& rTitle,
 OUString& rURL,
 OUString& rTarget,
-OUString& rImageId,
 OUString& rContext,
 css::uno::Sequence< 
css::uno::Sequence< css::beans::PropertyValue > >& rAddonSubMenu );
 };
diff --git a/framework/inc/uielement/toolbarmerger.hxx 
b/framework/inc/uielement/toolbarmerger.hxx
index f89bd8c6a1c3..d3ccc1c8cbcb 100644
--- a/framework/inc/uielement/toolbarmerger.hxx
+++ b/framework/inc/uielement/toolbarmerger.hxx
@@ -42,7 +42,6 @@ struct AddonToolbarItem
 {
 OUString aCommandURL;
 OUString aLabel;
-OUString aImageIdentifier;
 OUString aTarget;
 OUString aContext;
 OUString aControlType;
@@ -68,7 +67,6 @@ class ToolBarMerger
 static void   ConvertSequenceToValues( const css::uno::Sequence< 
css::beans::PropertyValue >& rSequence,
OUString& rCommandURL,
OUString& rLabel,
-   OUString& rImageIdentifier,
OUString& rTarget,
OUString& rContext,
OUString& rControlType,
diff --git a/framework/source/fwe/classes/addonmenu.cxx 
b/framework/source/fwe/classes/addonmenu.cxx
index 80ac7c0e0850..22e24655350b 100644
--- a/framework/source/fwe/classes/addonmenu.cxx
+++ b/framework/source/fwe/classes/addonmenu.cxx
@@ -144,7 +144,6 @@ void AddonMenuManager::MergeAddonPopupMenus( const 
Reference< XFrame >& rFrame,
 OUString  aTitle;
 OUString  aURL;
 OUString  aTarget;
-OUString  aImageId;
 OUString  aContext;
 Sequence< Sequence< PropertyValue > > aAddonSubMenu;
 sal_uInt16

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

2020-08-27 Thread Maxim Monastirsky (via logerrit)
 framework/inc/menuconfiguration.hxx |2 
 framework/inc/uielement/menubarmanager.hxx  |1 
 framework/source/uielement/menubarmanager.cxx   |  227 
++
 framework/source/uielement/resourcemenucontroller.cxx   |  161 +++
 framework/util/fwk.component|4 
 officecfg/registry/data/org/openoffice/Office/UI/Controller.xcu |   11 
 6 files changed, 230 insertions(+), 176 deletions(-)

New commits:
commit 3a46e402adfd8e0ac1f162de382e03ba92842bcb
Author: Maxim Monastirsky 
AuthorDate: Wed Aug 26 14:00:50 2020 +0300
Commit: Maxim Monastirsky 
CommitDate: Fri Aug 28 00:17:07 2020 +0200

MenuBarManager: Extract the window list to own controller

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

diff --git a/framework/inc/menuconfiguration.hxx 
b/framework/inc/menuconfiguration.hxx
index 0c8ae43545bd..84943f5326a6 100644
--- a/framework/inc/menuconfiguration.hxx
+++ b/framework/inc/menuconfiguration.hxx
@@ -29,8 +29,6 @@ namespace com::sun::star::io { class XInputStream; }
 namespace com::sun::star::io { class XOutputStream; }
 namespace com::sun::star::uno { class XComponentContext; }
 
-const sal_uInt16 START_ITEMID_WINDOWLIST= 4600;
-const sal_uInt16 END_ITEMID_WINDOWLIST  = 4699;
 const sal_uInt16 ITEMID_ADDONLIST   = 6678; // used to be a SID in 
sfx2, now just a unique id...
 
 namespace framework
diff --git a/framework/inc/uielement/menubarmanager.hxx 
b/framework/inc/uielement/menubarmanager.hxx
index 4fa42c8e8fd1..698b46341579 100644
--- a/framework/inc/uielement/menubarmanager.hxx
+++ b/framework/inc/uielement/menubarmanager.hxx
@@ -162,7 +162,6 @@ class MenuBarManager final :
 };
 
 void RetrieveShortcuts( std::vector< 
std::unique_ptr >& aMenuShortCuts );
-static void  UpdateSpecialWindowMenu( Menu* pMenu, const 
css::uno::Reference< css::uno::XComponentContext >& xContext );
 static void  FillMenuImages( css::uno::Reference< 
css::frame::XFrame > const & xFrame, Menu* _pMenu, bool bShowMenuImages );
 static void  impl_RetrieveShortcutsFromConfiguration( const 
css::uno::Reference< css::ui::XAcceleratorConfiguration >& rAccelCfg,
   const 
css::uno::Sequence< OUString >& rCommands,
diff --git a/framework/source/uielement/menubarmanager.cxx 
b/framework/source/uielement/menubarmanager.cxx
index 5359bc712f53..eb3fe530acce 100644
--- a/framework/source/uielement/menubarmanager.cxx
+++ b/framework/source/uielement/menubarmanager.cxx
@@ -28,7 +28,6 @@
 #include 
 #include 
 #include 
-#include 
 #include 
 #include 
 #include 
@@ -51,10 +50,8 @@
 #include 
 #include 
 #include 
-#include 
 #include 
 #include 
-#include 
 #include 
 #include 
 #include 
@@ -615,9 +612,6 @@ IMPL_LINK( MenuBarManager, Activate, Menu *, pMenu, bool )
 
 m_bActive = true;
 
-if ( m_aMenuItemCommand == aSpecialWindowCommand )
-UpdateSpecialWindowMenu( pMenu, m_xContext );
-
 // Check if some modes have changed so we have to update our menu 
images
 OUString sIconTheme = SvtMiscOptions().GetIconTheme();
 
@@ -687,64 +681,57 @@ IMPL_LINK( MenuBarManager, Activate, Menu *, pMenu, bool )
 if ( !menuItemHandler->xMenuItemDispatch.is() &&
  !menuItemHandler->xSubMenuManager.is()  )
 {
-// There is no dispatch mechanism for the special 
window list menu items,
-// because they are handled directly through 
XFrame->activate!!!
-// Don't update dispatches for special file menu items.
-if ( menuItemHandler->nItemId < 
START_ITEMID_WINDOWLIST ||
- menuItemHandler->nItemId >= END_ITEMID_WINDOWLIST 
)
-{
-Reference< XDispatch > xMenuItemDispatch;
+Reference< XDispatch > xMenuItemDispatch;
 
-aTargetURL.Complete = 
menuItemHandler->aMenuItemURL;
+aTargetURL.Complete = menuItemHandler->aMenuItemURL;
 
-m_xURLTransformer->parseStrict( aTargetURL );
+m_xURLTransformer->parseStrict( aTargetURL );
 
-if ( bHasDisabledEntries )
-{
-if ( aCmdOptions.Lookup( 
SvtCommandOptions::CMDOPTION_DISABLED, aTargetURL.Path ))
-pMenu->HideItem( menuItemHandler->nItemId 
);
-}
+if ( bHasDisabledEntries )
+{
+if ( 

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

2020-08-20 Thread Maxim Monastirsky (via logerrit)
 framework/Library_fwk.mk|1 
 framework/inc/uielement/addonstoolbarmanager.hxx|   64 --
 framework/inc/uielement/addonstoolbarwrapper.hxx|1 
 framework/inc/uielement/toolbarmanager.hxx  |   12 
 framework/source/uielement/addonstoolbarmanager.cxx |  430 
 framework/source/uielement/addonstoolbarwrapper.cxx |   14 
 framework/source/uielement/toolbarmanager.cxx   |  171 +--
 solenv/clang-format/excludelist |2 
 8 files changed, 132 insertions(+), 563 deletions(-)

New commits:
commit 37892578e97ea0f0c948116d639797060ac5f21f
Author: Maxim Monastirsky 
AuthorDate: Thu Aug 20 12:07:24 2020 +0300
Commit: Maxim Monastirsky 
CommitDate: Thu Aug 20 16:42:52 2020 +0200

Base addon toolbars on the regular ToolBarManager

ToolBarManager already supported addon buttons because of the
toolbar merging feature. Besides the cleanup, this gives access to
addon devs to all toolbar features like aliases or style buttons.

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

diff --git a/framework/Library_fwk.mk b/framework/Library_fwk.mk
index 12434b7a4b74..754090d5512f 100644
--- a/framework/Library_fwk.mk
+++ b/framework/Library_fwk.mk
@@ -175,7 +175,6 @@ $(eval $(call gb_Library_add_exception_objects,fwk,\
 framework/source/uiconfiguration/uicategorydescription \
 framework/source/uiconfiguration/uiconfigurationmanager \
 framework/source/uiconfiguration/windowstateconfiguration \
-framework/source/uielement/addonstoolbarmanager \
 framework/source/uielement/addonstoolbarwrapper \
 framework/source/uielement/buttontoolbarcontroller \
 framework/source/uielement/comboboxtoolbarcontroller \
diff --git a/framework/inc/uielement/addonstoolbarmanager.hxx 
b/framework/inc/uielement/addonstoolbarmanager.hxx
deleted file mode 100644
index d13c3f14b58a..
--- a/framework/inc/uielement/addonstoolbarmanager.hxx
+++ /dev/null
@@ -1,64 +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 .
- */
-
-#ifndef INCLUDED_FRAMEWORK_INC_UIELEMENT_ADDONSTOOLBARMANAGER_HXX
-#define INCLUDED_FRAMEWORK_INC_UIELEMENT_ADDONSTOOLBARMANAGER_HXX
-
-#include 
-
-#include 
-
-#include 
-
-class ToolBox;
-
-namespace framework
-{
-
-class AddonsToolBarManager final : public ToolBarManager
-{
-public:
-AddonsToolBarManager( const css::uno::Reference< 
css::uno::XComponentContext >& rxContext,
-  const css::uno::Reference< css::frame::XFrame >& 
rFrame,
-  const OUString& rResourceName,
-  ToolBox* pToolBar );
-virtual ~AddonsToolBarManager() override;
-
-// XComponent
-void SAL_CALL dispose() override;
-
-virtual void RefreshImages() override;
-using ToolBarManager::FillToolbar;
-void FillToolbar( const css::uno::Sequence< css::uno::Sequence< 
css::beans::PropertyValue > >& rAddonToolbar );
-
-private:
-DECL_LINK(Click, ToolBox *, void);
-DECL_LINK(DoubleClick, ToolBox *, void);
-DECL_LINK(Select, ToolBox *, void);
-DECL_LINK(StateChanged, StateChangedType const *, void );
-DECL_LINK(DataChanged, DataChangedEvent const *, void );
-
-virtual bool MenuItemAllowed( sal_uInt16 ) const override;
-};
-
-}
-
-#endif // INCLUDED_FRAMEWORK_INC_UIELEMENT_ADDONSTOOLBARMANAGER_HXX
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/framework/inc/uielement/addonstoolbarwrapper.hxx 
b/framework/inc/uielement/addonstoolbarwrapper.hxx
index 6d6fee13f4c4..2970ce6d13fa 100644
--- a/framework/inc/uielement/addonstoolbarwrapper.hxx
+++ b/framework/inc/uielement/addonstoolbarwrapper.hxx
@@ -28,7 +28,6 @@
 namespace framework
 {
 
-class AddonsToolBarManager;
 class AddonsToolBarWrapper final : public UIElementWrapperBase
 {
 public:
diff --git a/framework/inc/uielement/toolbarmanager.hxx 

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

2020-08-14 Thread Maxim Monastirsky (via logerrit)
 framework/inc/uielement/generictoolbarcontroller.hxx|   22 ---
 framework/source/uielement/generictoolbarcontroller.cxx |   95 
 framework/source/uielement/popuptoolbarcontroller.cxx   |   33 -
 framework/source/uielement/resourcemenucontroller.cxx   |4 
 framework/source/uielement/toolbarmanager.cxx   |3 
 5 files changed, 33 insertions(+), 124 deletions(-)

New commits:
commit c5301f215fec9016c3a75ff4a6a0c6c22f152718
Author: Maxim Monastirsky 
AuthorDate: Wed Aug 12 23:36:52 2020 +0300
Commit: Maxim Monastirsky 
CommitDate: Fri Aug 14 17:03:41 2020 +0200

Replace MenuToolbarController with the usual approach for menu buttons

i.e. ResourceMenuController + GenericPopupToolbarController.
(Decl. of both isn't available in a header file, so they are instantiated
via the service manager for now. This is a bit weird for something from
the same module, but should not make any difference in practice.)

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

diff --git a/framework/inc/uielement/generictoolbarcontroller.hxx 
b/framework/inc/uielement/generictoolbarcontroller.hxx
index eac6e8276b50..35934818ccb7 100644
--- a/framework/inc/uielement/generictoolbarcontroller.hxx
+++ b/framework/inc/uielement/generictoolbarcontroller.hxx
@@ -21,13 +21,8 @@
 #define INCLUDED_FRAMEWORK_INC_UIELEMENT_GENERICTOOLBARCONTROLLER_HXX
 
 #include 
-#include 
-
-#include 
-#include 
 #include 
 
-class PopupMenu;
 class ToolBox;
 
 namespace framework
@@ -69,23 +64,6 @@ class GenericToolbarController final : public 
svt::ToolboxController
 OUStringm_aEnumCommand;
 };
 
-class MenuToolbarController final : public svt::ToolboxController
-{
-css::uno::Reference< css::container::XIndexAccess > m_xMenuDesc;
-VclPtr   pMenu;
-css::uno::Reference< css::lang::XComponent >m_xMenuManager;
-
-public:
-// XStatusListener
-virtual void SAL_CALL statusChanged( const css::frame::FeatureStateEvent& 
) override {}
-// XComponent
-virtual void SAL_CALL dispose() override;
-// XInitialization
-virtual void SAL_CALL initialize( const css::uno::Sequence< css::uno::Any 
>& rArgs ) override;
-// XToolbarController
-virtual css::uno::Reference< css::awt::XWindow > SAL_CALL 
createPopupWindow() override;
-};
-
 }
 
 #endif // INCLUDED_FRAMEWORK_INC_UIELEMENT_GENERICTOOLBARCONTROLLER_HXX
diff --git a/framework/source/uielement/generictoolbarcontroller.cxx 
b/framework/source/uielement/generictoolbarcontroller.cxx
index b13739932b32..8bea883d90d6 100644
--- a/framework/source/uielement/generictoolbarcontroller.cxx
+++ b/framework/source/uielement/generictoolbarcontroller.cxx
@@ -21,30 +21,22 @@
 
 #include 
 #include 
-#include 
 #include 
 #include 
 #include 
-#include 
-#include 
 #include 
 
-#include 
 #include 
 #include 
 #include 
 #include 
 #include 
-#include 
 
-using namespace ::com::sun::star::awt;
 using namespace ::com::sun::star::uno;
 using namespace ::com::sun::star::beans;
 using namespace ::com::sun::star::lang;
 using namespace ::com::sun::star::frame;
 using namespace ::com::sun::star::frame::status;
-using namespace ::com::sun::star::util;
-using namespace ::com::sun::star::container;
 
 namespace framework
 {
@@ -281,93 +273,6 @@ IMPL_STATIC_LINK( GenericToolbarController, 
ExecuteHdl_Impl, void*, p, void )
delete pExecuteInfo;
 }
 
-void MenuToolbarController::dispose()
-{
-try
-{
-if ( m_xMenuManager.is() )
-m_xMenuManager->dispose();
-}
-catch( const Exception& ) {}
-
-m_xMenuManager.clear();
-m_xMenuDesc.clear();
-pMenu.disposeAndClear();
-}
-
-void MenuToolbarController::initialize( const css::uno::Sequence< 
css::uno::Any >& rArgs )
-{
-ToolboxController::initialize( rArgs );
-
-css::uno::Reference< css::container::XIndexAccess > xMenuContainer;
-try
-{
-css::uno::Reference< css::frame::XController > xController( 
m_xFrame->getController() );
-css::uno::Reference< css::ui::XUIConfigurationManagerSupplier > 
xSupplier( xController->getModel(), css::uno::UNO_QUERY_THROW );
-css::uno::Reference< css::ui::XUIConfigurationManager > 
xConfigManager( xSupplier->getUIConfigurationManager() );
-xMenuContainer.set( xConfigManager->getSettings( m_aCommandURL, false 
) );
-}
-catch( const css::uno::Exception& )
-{}
-
-if ( !xMenuContainer.is() )
-{
-try
-{
-css::uno::Reference< 
css::ui::XModuleUIConfigurationManagerSupplier > xSupplier(
-css::ui::theModuleUIConfigurationManagerSupplier::get( 
m_xContext ) );
-css::uno::Reference< css::ui::XUIConfigurationManager > 
xConfigManager(
-xSupplier->getUIConfigurationManager( m_sModuleName ) );
-   

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

2020-08-11 Thread Maxim Monastirsky (via logerrit)
 framework/inc/uielement/toolbarmodemenucontroller.hxx|9 -
 framework/source/uielement/toolbarmodemenucontroller.cxx |   82 ---
 sfx2/sdi/sfx.sdi |2 
 sfx2/source/appl/appserv.cxx |8 -
 4 files changed, 8 insertions(+), 93 deletions(-)

New commits:
commit 3239708375c81005d66627c09d1907848cd0cfda
Author: Maxim Monastirsky 
AuthorDate: Mon Aug 10 18:35:22 2020 +0300
Commit: Maxim Monastirsky 
CommitDate: Tue Aug 11 10:33:00 2020 +0200

Simplify toolbar mode switching

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

diff --git a/framework/inc/uielement/toolbarmodemenucontroller.hxx 
b/framework/inc/uielement/toolbarmodemenucontroller.hxx
index 6fe03f455206..44f667dcb8d2 100644
--- a/framework/inc/uielement/toolbarmodemenucontroller.hxx
+++ b/framework/inc/uielement/toolbarmodemenucontroller.hxx
@@ -53,15 +53,6 @@ namespace framework
 // XEventListener
 virtual void SAL_CALL disposing( const css::lang::EventObject& 
Source ) override;
 
-struct ExecuteInfo
-{
-css::uno::Reference< css::frame::XDispatch > xDispatch;
-css::util::URL   aTargetURL;
-css::uno::Sequence< css::beans::PropertyValue >  aArgs;
-};
-
-DECL_STATIC_LINK( ToolbarModeMenuController, ExecuteHdl_Impl, 
void*, void );
-
 private:
 void fillPopupMenu( css::uno::Reference< css::awt::XPopupMenu > 
const & rPopupMenu );
 
diff --git a/framework/source/uielement/toolbarmodemenucontroller.cxx 
b/framework/source/uielement/toolbarmodemenucontroller.cxx
index c2f48162145d..86dbda38f5b9 100644
--- a/framework/source/uielement/toolbarmodemenucontroller.cxx
+++ b/framework/source/uielement/toolbarmodemenucontroller.cxx
@@ -36,6 +36,7 @@
 #include 
 #include 
 #include 
+#include 
 #include 
 #include 
 #include 
@@ -226,65 +227,8 @@ void SAL_CALL ToolbarModeMenuController::statusChanged( 
const FeatureStateEvent&
 // XMenuListener
 void SAL_CALL ToolbarModeMenuController::itemSelected( const 
css::awt::MenuEvent& rEvent )
 {
-Reference< css::awt::XPopupMenu >   xPopupMenu;
-Reference< XURLTransformer >xURLTransformer;
-Reference< XFrame > xFrame;
-
-{
-osl::MutexGuard aLock(m_aMutex);
-xPopupMenu = m_xPopupMenu;
-xURLTransformer = m_xURLTransformer;
-xFrame = m_xFrame;
-}
-
-if ( !xPopupMenu.is() )
-return;
-
-VCLXPopupMenu* pPopupMenu = static_cast(comphelper::getUnoTunnelImplementation( xPopupMenu ));
-if ( !pPopupMenu )
-return;
-
-SolarMutexGuard aSolarMutexGuard;
-PopupMenu* pVCLPopupMenu = static_cast(pPopupMenu->GetMenu());
-OUString aCmd( pVCLPopupMenu->GetItemCommand( rEvent.MenuId ));
-
-{
-URL aTargetURL;
-Sequence aArgs;
-
-aTargetURL.Complete = ".uno:Notebookbar?File:string=" + aCmd;
-xURLTransformer->parseStrict( aTargetURL );
-Reference< XDispatchProvider > xDispatchProvider( m_xFrame, UNO_QUERY 
);
-if ( xDispatchProvider.is() )
-{
-Reference< XDispatch > xDispatch = 
xDispatchProvider->queryDispatch(
-aTargetURL, OUString(), 0 );
-
-ExecuteInfo* pExecuteInfo = new ExecuteInfo;
-pExecuteInfo->xDispatch = xDispatch;
-pExecuteInfo->aTargetURL= aTargetURL;
-pExecuteInfo->aArgs = aArgs;
-Application::PostUserEvent( 
LINK(nullptr,ToolbarModeMenuController, ExecuteHdl_Impl), pExecuteInfo );
-}
-}
-
-URL aTargetURL;
-Sequence aArgs;
-
-aTargetURL.Complete = ".uno:ToolbarMode?Mode:string=" + aCmd;
-xURLTransformer->parseStrict( aTargetURL );
-Reference< XDispatchProvider > xDispatchProvider( m_xFrame, UNO_QUERY );
-if ( xDispatchProvider.is() )
-{
-Reference< XDispatch > xDispatch = xDispatchProvider->queryDispatch(
-aTargetURL, OUString(), 0 );
-
-ExecuteInfo* pExecuteInfo = new ExecuteInfo;
-pExecuteInfo->xDispatch = xDispatch;
-pExecuteInfo->aTargetURL= aTargetURL;
-pExecuteInfo->aArgs = aArgs;
-Application::PostUserEvent( LINK(nullptr, ToolbarModeMenuController, 
ExecuteHdl_Impl), pExecuteInfo );
-}
+auto aArgs(comphelper::InitPropertySequence({{"Mode", 
makeAny(m_xPopupMenu->getCommand(rEvent.MenuId))}}));
+dispatchCommand(m_aCommandURL, aArgs);
 }
 
 void SAL_CALL ToolbarModeMenuController::itemActivated( const 
css::awt::MenuEvent& )
@@ -351,26 +295,6 @@ void SAL_CALL ToolbarModeMenuController::setPopupMenu( 
const Reference< css::awt
 }
 }
 

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

2020-07-09 Thread Noel Grandin (via logerrit)
 framework/Library_fwk.mk   |1 
 framework/inc/recording/dispatchrecorder.hxx   |   10 --
 framework/inc/services.h   |1 
 framework/inc/uielement/langselectionmenucontroller.hxx|   10 --
 framework/source/recording/dispatchrecorder.cxx|   34 ---
 framework/source/register/registertemp.cxx |   63 -
 framework/source/uielement/langselectionmenucontroller.cxx |   30 --
 framework/util/fwk.component   |8 +
 8 files changed, 60 insertions(+), 97 deletions(-)

New commits:
commit c435ee5c9c9882d0817039d5e53990418c3d1066
Author: Noel Grandin 
AuthorDate: Wed Jul 8 18:39:27 2020 +0200
Commit: Noel Grandin 
CommitDate: Thu Jul 9 08:46:19 2020 +0200

framework: create instances with uno constructors

See tdf#74608 for motivation

Change-Id: Ia2d9447b687f0792d9d3a98d30cd2b8fe54049ee
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/98388
Tested-by: Noel Grandin 
Reviewed-by: Noel Grandin 

diff --git a/framework/Library_fwk.mk b/framework/Library_fwk.mk
index 61bb9d825906..12434b7a4b74 100644
--- a/framework/Library_fwk.mk
+++ b/framework/Library_fwk.mk
@@ -150,7 +150,6 @@ $(eval $(call gb_Library_add_exception_objects,fwk,\
 framework/source/loadenv/targethelper \
 framework/source/recording/dispatchrecorder \
 framework/source/recording/dispatchrecordersupplier \
-framework/source/register/registertemp \
 framework/source/services/ContextChangeEventMultiplexer \
 framework/source/services/autorecovery \
 framework/source/services/desktop \
diff --git a/framework/inc/recording/dispatchrecorder.hxx 
b/framework/inc/recording/dispatchrecorder.hxx
index 54a9cb0e2185..806fe3cb2f22 100644
--- a/framework/inc/recording/dispatchrecorder.hxx
+++ b/framework/inc/recording/dispatchrecorder.hxx
@@ -57,12 +57,10 @@ class DispatchRecorder final
 DispatchRecorder( const css::uno::Reference< 
css::uno::XComponentContext >& xSMGR );
 virtual ~DispatchRecorder() override;
 
-// XInterface, XTypeProvider, XServiceInfo
-DECLARE_XSERVICEINFO_NOFACTORY
-/* Helper for registry */
-/// @throws css::uno::Exception
-static css::uno::Reference< css::uno::XInterface > 
SAL_CALL impl_createInstance( const css::uno::Reference< 
css::lang::XMultiServiceFactory >& xServiceManager );
-static css::uno::Reference< css::lang::XSingleServiceFactory > 
impl_createFactory ( const css::uno::Reference< 
css::lang::XMultiServiceFactory >& xServiceManager );
+/* interface XServiceInfo */
+virtual OUString SAL_CALL getImplementationName() override;
+virtual sal_Bool SAL_CALL supportsService( const OUString& 
sServiceName ) override;
+virtual css::uno::Sequence< OUString > SAL_CALL 
getSupportedServiceNames() override;
 
 // XDispatchRecorder
 virtual void SAL_CALLstartRecording ( const 
css::uno::Reference< css::frame::XFrame >& xFrame ) override;
diff --git a/framework/inc/services.h b/framework/inc/services.h
index 8e1044811157..01a93213abd9 100644
--- a/framework/inc/services.h
+++ b/framework/inc/services.h
@@ -35,7 +35,6 @@ namespace framework{
 
 #define IMPLEMENTATIONNAME_QUICKLAUNCHER
"com.sun.star.comp.desktop.QuickstartWrapper"
 #define IMPLEMENTATIONNAME_FWK_TASKCREATOR  
"com.sun.star.comp.framework.TaskCreator"
-#define IMPLEMENTATIONNAME_LANGUAGESELECTIONMENUCONTROLLER  
"com.sun.star.comp.framework.LanguageSelectionMenuController"
 
 }   //  namespace framework
 
diff --git a/framework/inc/uielement/langselectionmenucontroller.hxx 
b/framework/inc/uielement/langselectionmenucontroller.hxx
index cdf682e3e02b..32f2a45bac9c 100644
--- a/framework/inc/uielement/langselectionmenucontroller.hxx
+++ b/framework/inc/uielement/langselectionmenucontroller.hxx
@@ -38,12 +38,10 @@ namespace framework
 LanguageSelectionMenuController( const css::uno::Reference< 
css::uno::XComponentContext >& xContext );
 virtual ~LanguageSelectionMenuController() override;
 
-// XServiceInfo
-DECLARE_XSERVICEINFO_NOFACTORY
-/* Helper for registry */
-/// @throws css::uno::Exception
-static css::uno::Reference< css::uno::XInterface > 
SAL_CALL impl_createInstance( const css::uno::Reference< 
css::lang::XMultiServiceFactory >& xServiceManager );
-static css::uno::Reference< css::lang::XSingleServiceFactory > 
impl_createFactory ( const css::uno::Reference< 
css::lang::XMultiServiceFactory >& xServiceManager );
+/* interface XServiceInfo */
+virtual OUString SAL_CALL getImplementationName() override;
+virtual sal_Bool SAL_CALL 

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

2020-07-09 Thread Noel Grandin (via logerrit)
 framework/IwyuFilter_framework.yaml|   25 -
 framework/inc/dispatch/mailtodispatcher.hxx|4 
 framework/inc/dispatch/oxt_handler.hxx |4 
 framework/inc/dispatch/popupmenudispatcher.hxx |4 
 framework/inc/dispatch/servicehandler.hxx  |4 
 framework/inc/dispatch/systemexec.hxx  |4 
 framework/inc/jobs/helponstartup.hxx   |4 
 framework/inc/jobs/shelljob.hxx|4 
 framework/inc/macros/registration.hxx  |   90 --
 framework/inc/macros/xinterface.hxx|  145 --
 framework/inc/macros/xserviceinfo.hxx  |  183 -
 framework/inc/macros/xtypeprovider.hxx |  119 
 framework/inc/recording/dispatchrecorder.hxx   |3 
 framework/inc/recording/dispatchrecordersupplier.hxx   |4 
 framework/inc/services.h   |2 
 framework/inc/services/mediatypedetectionhelper.hxx|4 
 framework/inc/services/uriabbreviation.hxx |2 
 framework/inc/uielement/fontmenucontroller.hxx |2 
 framework/inc/uielement/fontsizemenucontroller.hxx |2 
 framework/inc/uielement/headermenucontroller.hxx   |2 
 framework/inc/uielement/langselectionmenucontroller.hxx|2 
 framework/inc/uielement/macrosmenucontroller.hxx   |1 
 framework/inc/uielement/menubarwrapper.hxx |   10 
 framework/inc/uielement/newmenucontroller.hxx  |2 
 framework/inc/uielement/toolbarmodemenucontroller.hxx  |2 
 framework/inc/uielement/toolbarsmenucontroller.hxx |2 
 framework/source/dispatch/dispatchdisabler.cxx |1 
 framework/source/dispatch/mailtodispatcher.cxx |1 
 framework/source/dispatch/oxt_handler.cxx  |3 
 framework/source/dispatch/servicehandler.cxx   |1 
 framework/source/dispatch/systemexec.cxx   |1 
 framework/source/inc/dispatch/dispatchdisabler.hxx |4 
 framework/source/jobs/helponstartup.cxx|1 
 framework/source/jobs/shelljob.cxx |1 
 framework/source/recording/dispatchrecorder.cxx|1 
 framework/source/recording/dispatchrecordersupplier.cxx|1 
 framework/source/services/dispatchhelper.cxx   |2 
 framework/source/services/mediatypedetectionhelper.cxx |1 
 framework/source/services/uriabbreviation.cxx  |3 
 framework/source/uielement/fontmenucontroller.cxx  |1 
 framework/source/uielement/fontsizemenucontroller.cxx  |1 
 framework/source/uielement/footermenucontroller.cxx|1 
 framework/source/uielement/headermenucontroller.cxx|1 
 framework/source/uielement/langselectionmenucontroller.cxx |1 
 framework/source/uielement/macrosmenucontroller.cxx|2 
 framework/source/uielement/menubarwrapper.cxx  |   92 --
 framework/source/uielement/newmenucontroller.cxx   |1 
 framework/source/uielement/toolbarmodemenucontroller.cxx   |2 
 framework/source/uielement/toolbarsmenucontroller.cxx  |1 
 49 files changed, 115 insertions(+), 639 deletions(-)

New commits:
commit 6653107b838be22da2ceb6e9123dafe67b45dd91
Author: Noel Grandin 
AuthorDate: Wed Jul 8 20:31:00 2020 +0200
Commit: Noel Grandin 
CommitDate: Thu Jul 9 08:27:53 2020 +0200

clean up macro usage

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

diff --git a/framework/IwyuFilter_framework.yaml 
b/framework/IwyuFilter_framework.yaml
index 1b648d7cee43..35fe8d254351 100644
--- a/framework/IwyuFilter_framework.yaml
+++ b/framework/IwyuFilter_framework.yaml
@@ -4,31 +4,6 @@ blacklist:
 framework/inc/stdtypes.h:
 #  Don't propose hxx -> h change in URE libs
 - cppuhelper/interfacecontainer.hxx
-framework/inc/macros/xinterface.hxx:
-# Used in macros
-- com/sun/star/uno/Any.hxx
-- com/sun/star/uno/Type.hxx
-- cppuhelper/queryinterface.hxx
-framework/inc/macros/xserviceinfo.hxx:
-# Used in macros
-- com/sun/star/lang/XServiceInfo.hpp
-- com/sun/star/lang/XSingleServiceFactory.hpp
-- com/sun/star/uno/Reference.hxx
-- com/sun/star/uno/Sequence.hxx
-- com/sun/star/uno/XComponentContext.hpp
-- comphelper/processfactory.hxx
-- cppuhelper/factory.hxx
-- cppuhelper/supportsservice.hxx
-- rtl/ustring.hxx
-framework/inc/macros/registration.hxx:
-# Used in macros
-- com/sun/star/lang/XMultiServiceFactory.hpp
-framework/inc/macros/xtypeprovider.hxx:
-# Used in macros
-- com/sun/star/lang/XTypeProvider.hpp
- 

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

2020-07-08 Thread Noel Grandin (via logerrit)
 framework/inc/dispatch/mailtodispatcher.hxx |   10 +--
 framework/inc/recording/dispatchrecordersupplier.hxx|   13 +---
 framework/inc/services.h|8 --
 framework/inc/services/mediatypedetectionhelper.hxx |   27 +
 framework/inc/uielement/fontmenucontroller.hxx  |   10 +--
 framework/inc/uielement/fontsizemenucontroller.hxx  |   10 +--
 framework/inc/uielement/footermenucontroller.hxx|   15 +
 framework/inc/uielement/headermenucontroller.hxx|   10 +--
 framework/inc/uielement/macrosmenucontroller.hxx|   10 +--
 framework/source/dispatch/mailtodispatcher.cxx  |   36 +++-
 framework/source/recording/dispatchrecordersupplier.cxx |   45 
 framework/source/register/registertemp.cxx  |8 --
 framework/source/services/mediatypedetectionhelper.cxx  |   35 
 framework/source/uielement/fontmenucontroller.cxx   |   28 +++--
 framework/source/uielement/fontsizemenucontroller.cxx   |   26 +++--
 framework/source/uielement/footermenucontroller.cxx |   28 -
 framework/source/uielement/headermenucontroller.cxx |   28 +++--
 framework/source/uielement/macrosmenucontroller.cxx |   30 --
 framework/util/fwk.component|   24 +---
 19 files changed, 230 insertions(+), 171 deletions(-)

New commits:
commit 1a90b1aa64866950cf9ad7032a8240b0c072e671
Author: Noel Grandin 
AuthorDate: Wed Jul 8 18:13:39 2020 +0200
Commit: Noel Grandin 
CommitDate: Wed Jul 8 21:12:50 2020 +0200

framework: create instances with uno constructors

See tdf#74608 for motivation

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

diff --git a/framework/inc/dispatch/mailtodispatcher.hxx 
b/framework/inc/dispatch/mailtodispatcher.hxx
index a830822cde81..e76fadfb6b2b 100644
--- a/framework/inc/dispatch/mailtodispatcher.hxx
+++ b/framework/inc/dispatch/mailtodispatcher.hxx
@@ -61,12 +61,10 @@ class MailToDispatcher final : public  
::cppu::WeakImplHelper<
  MailToDispatcher( const css::uno::Reference< 
css::uno::XComponentContext >& rxContext );
 virtual ~MailToDispatcher( 
) override;
 
-// XInterface, XTypeProvider, XServiceInfo
-DECLARE_XSERVICEINFO_NOFACTORY
-/* Helper for registry */
-/// @throws css::uno::Exception
-static css::uno::Reference< css::uno::XInterface > 
SAL_CALL impl_createInstance( const css::uno::Reference< 
css::lang::XMultiServiceFactory >& xServiceManager );
-static css::uno::Reference< css::lang::XSingleServiceFactory > 
impl_createFactory ( const css::uno::Reference< 
css::lang::XMultiServiceFactory >& xServiceManager );
+/* interface XServiceInfo */
+virtual OUString SAL_CALL getImplementationName() override;
+virtual sal_Bool SAL_CALL supportsService( const OUString& 
sServiceName ) override;
+virtual css::uno::Sequence< OUString > SAL_CALL 
getSupportedServiceNames() override;
 
 // XDispatchProvider
 virtual css::uno::Reference< css::frame::XDispatch > SAL_CALL  
 queryDispatch  ( const css::util::URL& 
  aURL,
diff --git a/framework/inc/recording/dispatchrecordersupplier.hxx 
b/framework/inc/recording/dispatchrecordersupplier.hxx
index b8eb844dbd1d..83517137df98 100644
--- a/framework/inc/recording/dispatchrecordersupplier.hxx
+++ b/framework/inc/recording/dispatchrecordersupplier.hxx
@@ -59,13 +59,10 @@ class DispatchRecorderSupplier final : public  
::cppu::WeakImplHelper<
 
 public:
 
-// XInterface, XTypeProvider, XServiceInfo
-
-DECLARE_XSERVICEINFO_NOFACTORY
-/* Helper for registry */
-/// @throws css::uno::Exception
-static css::uno::Reference< css::uno::XInterface > 
SAL_CALL impl_createInstance( const css::uno::Reference< 
css::lang::XMultiServiceFactory >& xServiceManager );
-static css::uno::Reference< css::lang::XSingleServiceFactory > 
impl_createFactory ( const css::uno::Reference< 
css::lang::XMultiServiceFactory >& xServiceManager );
+/* interface XServiceInfo */
+virtual OUString SAL_CALL getImplementationName() override;
+virtual sal_Bool SAL_CALL supportsService( const OUString& 
sServiceName ) override;
+virtual css::uno::Sequence< OUString > SAL_CALL 
getSupportedServiceNames() override;
 
 // XDispatchRecorderSupplier
 
@@ -79,7 +76,7 @@ class DispatchRecorderSupplier final : public  
::cppu::WeakImplHelper<
 
 public:
 
- DispatchRecorderSupplier( const css::uno::Reference< 

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

2020-07-07 Thread Noel Grandin (via logerrit)
 framework/inc/dispatch/oxt_handler.hxx   |   15 +-
 framework/inc/dispatch/popupmenudispatcher.hxx   |   10 -
 framework/inc/dispatch/servicehandler.hxx|   14 +-
 framework/inc/dispatch/systemexec.hxx|   10 -
 framework/inc/jobs/helponstartup.hxx |   10 -
 framework/inc/jobs/shelljob.hxx  |   10 -
 framework/inc/services.h |   12 --
 framework/inc/services/uriabbreviation.hxx   |9 -
 framework/inc/uielement/newmenucontroller.hxx|   10 -
 framework/inc/uielement/toolbarmodemenucontroller.hxx|   10 -
 framework/inc/uielement/toolbarsmenucontroller.hxx   |   10 -
 framework/source/dispatch/dispatchdisabler.cxx   |   28 -
 framework/source/dispatch/oxt_handler.cxx|   39 ---
 framework/source/dispatch/popupmenudispatcher.cxx|   58 +-
 framework/source/dispatch/servicehandler.cxx |   46 
 framework/source/dispatch/systemexec.cxx |   35 +++---
 framework/source/inc/dispatch/dispatchdisabler.hxx   |9 -
 framework/source/jobs/helponstartup.cxx  |   81 ---
 framework/source/jobs/shelljob.cxx   |   38 ---
 framework/source/register/registertemp.cxx   |   14 --
 framework/source/services/dispatchhelper.cxx |   24 +++-
 framework/source/services/uriabbreviation.cxx|   31 +++--
 framework/source/uielement/newmenucontroller.cxx |   27 +++--
 framework/source/uielement/toolbarmodemenucontroller.cxx |   29 -
 framework/source/uielement/toolbarsmenucontroller.cxx|   28 -
 framework/util/fwk.component |   36 --
 include/framework/dispatchhelper.hxx |   12 --
 27 files changed, 354 insertions(+), 301 deletions(-)

New commits:
commit 71227e2306987cb8aa5fbda2943e73237674e9ba
Author: Noel Grandin 
AuthorDate: Tue Jul 7 20:02:18 2020 +0200
Commit: Noel Grandin 
CommitDate: Tue Jul 7 22:13:02 2020 +0200

framework: create instances with uno constructors

See tdf#74608 for motivation

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

diff --git a/framework/inc/dispatch/oxt_handler.hxx 
b/framework/inc/dispatch/oxt_handler.hxx
index 69bc07074c3e..bc9c24070cde 100644
--- a/framework/inc/dispatch/oxt_handler.hxx
+++ b/framework/inc/dispatch/oxt_handler.hxx
@@ -52,16 +52,13 @@ class Oxt_Handler final  :  public  ::cppu::WeakImplHelper<
 
 public:
 
- Oxt_Handler( const css::uno::Reference< 
css::lang::XMultiServiceFactory >& xFactory );
+ Oxt_Handler( const css::uno::Reference< 
css::uno::XComponentContext >&  );
 virtual ~Oxt_Handler(  
  ) override;
 
-//  XInterface, XTypeProvider, XServiceInfo
-
-DECLARE_XSERVICEINFO_NOFACTORY
-/* Helper for registry */
-/// @throws css::uno::Exception
-static css::uno::Reference< css::uno::XInterface > 
SAL_CALL impl_createInstance( const css::uno::Reference< 
css::lang::XMultiServiceFactory >& xServiceManager );
-static css::uno::Reference< css::lang::XSingleServiceFactory > 
impl_createFactory ( const css::uno::Reference< 
css::lang::XMultiServiceFactory >& xServiceManager );
+/* interface XServiceInfo */
+virtual OUString SAL_CALL getImplementationName() override;
+virtual sal_Bool SAL_CALL supportsService( const OUString& 
sServiceName ) override;
+virtual css::uno::Sequence< OUString > SAL_CALL 
getSupportedServiceNames() override;
 
 //  XNotifyingDispatch
 
@@ -85,7 +82,7 @@ class Oxt_Handler final  :  public  ::cppu::WeakImplHelper<
 private:
 osl::Mutex m_mutex;
 
-css::uno::Reference< css::lang::XMultiServiceFactory > m_xFactory; 
  /// global uno service factory to create new services
+css::uno::Reference< css::uno::XComponentContext > m_xContext;   
/// global uno service factory to create new services
 
 };
 
diff --git a/framework/inc/dispatch/popupmenudispatcher.hxx 
b/framework/inc/dispatch/popupmenudispatcher.hxx
index 869ee956e4a4..845e5c92592d 100644
--- a/framework/inc/dispatch/popupmenudispatcher.hxx
+++ b/framework/inc/dispatch/popupmenudispatcher.hxx
@@ -68,12 +68,10 @@ class PopupMenuDispatcher final : public  
::cppu::WeakImplHelper<
 //  constructor / destructor
 PopupMenuDispatcher( const css::uno::Reference< 
css::uno::XComponentContext >& xContext );
 
-// XInterface, XTypeProvider, XServiceInfo
-DECLARE_XSERVICEINFO_NOFACTORY
-/* Helper for registry */
-/// @throws 

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

2020-07-07 Thread Andrea Gelmini (via logerrit)
 framework/inc/pch/precompiled_fwk.hxx |1 -
 1 file changed, 1 deletion(-)

New commits:
commit eccb763146325bd44a84b6a1698109ebd1bcf35e
Author: Andrea Gelmini 
AuthorDate: Sat Jul 4 21:02:22 2020 +0200
Commit: Julien Nabet 
CommitDate: Tue Jul 7 12:41:11 2020 +0200

Removed duplicated include

Change-Id: I33b3a56d9727dea2cbafcfbf73f5d4c08069ba34
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/98030
Tested-by: Jenkins
Reviewed-by: Julien Nabet 

diff --git a/framework/inc/pch/precompiled_fwk.hxx 
b/framework/inc/pch/precompiled_fwk.hxx
index 39c7a24e7361..b8109e1107e0 100644
--- a/framework/inc/pch/precompiled_fwk.hxx
+++ b/framework/inc/pch/precompiled_fwk.hxx
@@ -251,7 +251,6 @@
 #if PCH_LEVEL >= 4
 #include 
 #include 
-#include 
 #include 
 #include 
 #endif // PCH_LEVEL >= 4
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2020-06-26 Thread Caolán McNamara (via logerrit)
 framework/inc/uielement/FixedTextToolbarController.hxx |1 -
 1 file changed, 1 deletion(-)

New commits:
commit a4eebe2cf65f84daca56414d5a84f27ee38e5087
Author: Caolán McNamara 
AuthorDate: Fri Jun 26 15:26:47 2020 +0100
Commit: Caolán McNamara 
CommitDate: Fri Jun 26 20:37:04 2020 +0200

drop unnecessary include

Change-Id: I8d0dd93a2bcf8c4ea1bf1f6a5ed7a866e181127b
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/97237
Tested-by: Jenkins
Reviewed-by: Caolán McNamara 

diff --git a/framework/inc/uielement/FixedTextToolbarController.hxx 
b/framework/inc/uielement/FixedTextToolbarController.hxx
index ceecade1db5c..3d257414b6d2 100644
--- a/framework/inc/uielement/FixedTextToolbarController.hxx
+++ b/framework/inc/uielement/FixedTextToolbarController.hxx
@@ -24,7 +24,6 @@
 #include 
 
 #include 
-#include 
 
 class ToolBox;
 
___
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 svtools/uiconfig svtools/UIConfig_svt.mk

2020-06-26 Thread Caolán McNamara (via logerrit)
 framework/inc/uielement/FixedTextToolbarController.hxx|5 -
 framework/source/uielement/FixedTextToolbarController.cxx |   51 --
 svtools/UIConfig_svt.mk   |1 
 svtools/uiconfig/ui/fixedtextcontrol.ui   |   22 ++
 4 files changed, 71 insertions(+), 8 deletions(-)

New commits:
commit dc960e30ee24eb60da919c718ebfee142872f43a
Author: Caolán McNamara 
AuthorDate: Fri Jun 26 15:08:01 2020 +0100
Commit: Caolán McNamara 
CommitDate: Fri Jun 26 20:36:23 2020 +0200

weld FixedTextControl

Change-Id: I0a2983aa4d389aa0e65aa117d576295d02460b4a
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/97236
Tested-by: Jenkins
Reviewed-by: Caolán McNamara 

diff --git a/framework/inc/uielement/FixedTextToolbarController.hxx 
b/framework/inc/uielement/FixedTextToolbarController.hxx
index 299bb80982b3..ceecade1db5c 100644
--- a/framework/inc/uielement/FixedTextToolbarController.hxx
+++ b/framework/inc/uielement/FixedTextToolbarController.hxx
@@ -27,10 +27,11 @@
 #include 
 
 class ToolBox;
-class FixedText;
 
 namespace framework
 {
+class FixedTextControl;
+
 class FixedTextToolbarController final : public ComplexToolbarController
 {
 public:
@@ -46,7 +47,7 @@ private:
 virtual css::uno::Sequence
 getExecuteArgs(sal_Int16 KeyModifier) const override;
 
-VclPtr m_pFixedTextControl;
+VclPtr m_pFixedTextControl;
 };
 }
 
diff --git a/framework/source/uielement/FixedTextToolbarController.cxx 
b/framework/source/uielement/FixedTextToolbarController.cxx
index 531c0f8b64a5..a6bb5d25ad88 100644
--- a/framework/source/uielement/FixedTextToolbarController.cxx
+++ b/framework/source/uielement/FixedTextToolbarController.cxx
@@ -20,7 +20,7 @@
 #include 
 
 #include 
-#include 
+#include 
 #include 
 
 using namespace ::com::sun::star;
@@ -33,13 +33,52 @@ using namespace ::com::sun::star::util;
 
 namespace framework
 {
+class FixedTextControl final : public InterimItemWindow
+{
+public:
+FixedTextControl(vcl::Window* pParent);
+virtual ~FixedTextControl() override;
+virtual void dispose() override;
+virtual void GetFocus() override
+{
+if (m_xWidget)
+m_xWidget->grab_focus();
+InterimItemWindow::GetFocus();
+}
+OUString get_label() const { return m_xWidget->get_label(); }
+void set_label(const OUString& rLabel) { return 
m_xWidget->set_label(rLabel); }
+DECL_LINK(KeyInputHdl, const ::KeyEvent&, bool);
+
+private:
+std::unique_ptr m_xWidget;
+};
+
+FixedTextControl::FixedTextControl(vcl::Window* pParent)
+: InterimItemWindow(pParent, "svt/ui/fixedtextcontrol.ui", 
"FixedTextControl")
+, m_xWidget(m_xBuilder->weld_label("label"))
+{
+m_xWidget->connect_key_press(LINK(this, FixedTextControl, KeyInputHdl));
+}
+
+IMPL_LINK(FixedTextControl, KeyInputHdl, const ::KeyEvent&, rKEvt, bool)
+{
+return ChildKeyInput(rKEvt);
+}
+
+FixedTextControl::~FixedTextControl() { disposeOnce(); }
+
+void FixedTextControl::dispose()
+{
+m_xWidget.reset();
+InterimItemWindow::dispose();
+}
+
 FixedTextToolbarController::FixedTextToolbarController(
 const Reference& rxContext, const Reference& 
rFrame,
 ToolBox* pToolbar, sal_uInt16 nID, const OUString& aCommand)
 : ComplexToolbarController(rxContext, rFrame, pToolbar, nID, aCommand)
 {
-m_pFixedTextControl = VclPtr::Create(m_xToolbar, WB_NOMULTILINE 
| WB_VCENTER
-| WB_LEFT 
| WB_NOPOINTERFOCUS);
+m_pFixedTextControl = VclPtr::Create(m_xToolbar);
 m_xToolbar->SetItemWindow(m_nID, m_pFixedTextControl);
 m_xToolbar->SetItemBits(m_nID, ToolBoxItemBits::AUTOSIZE | 
m_xToolbar->GetItemBits(m_nID));
 }
@@ -55,7 +94,7 @@ void SAL_CALL FixedTextToolbarController::dispose()
 Sequence FixedTextToolbarController::getExecuteArgs(sal_Int16 
KeyModifier) const
 {
 Sequence aArgs(2);
-const OUString aSelectedText = m_pFixedTextControl->GetText();
+const OUString aSelectedText = m_pFixedTextControl->get_label();
 
 // Add key modifier to argument list
 aArgs[0].Name = "KeyModifier";
@@ -79,8 +118,8 @@ void FixedTextToolbarController::executeControlCommand(
 {
 OUString aText;
 rArg.Value >>= aText;
-m_pFixedTextControl->SetText(aText);
-
m_pFixedTextControl->SetSizePixel(m_pFixedTextControl->GetOptimalSize());
+m_pFixedTextControl->set_label(aText);
+
m_pFixedTextControl->SetSizePixel(m_pFixedTextControl->get_preferred_size());
 
 // send notification
 notifyTextChanged(aText);
diff --git a/svtools/UIConfig_svt.mk b/svtools/UIConfig_svt.mk
index cca4c8c824e9..4c2a7cfd0703 100644
--- a/svtools/UIConfig_svt.mk
+++ b/svtools/UIConfig_svt.mk
@@ -18,6 +18,7 @@ $(eval $(call gb_UIConfig_add_uifiles,svt,\
svtools/uiconfig/ui/emptypage \
svtools/uiconfig/ui/fileviewmenu \

[Libreoffice-commits] core.git: framework/inc framework/source svtools/uiconfig svtools/UIConfig_svt.mk

2020-06-26 Thread Caolán McNamara (via logerrit)
 framework/inc/uielement/FixedImageToolbarController.hxx|7 -
 framework/inc/uielement/spinfieldtoolbarcontroller.hxx |5 
 framework/source/uielement/FixedImageToolbarController.cxx |   67 +
 svtools/UIConfig_svt.mk|1 
 svtools/uiconfig/ui/fixedimagecontrol.ui   |   24 
 5 files changed, 80 insertions(+), 24 deletions(-)

New commits:
commit b08292b918f264c4f012ef8c543062cb23ad3b7b
Author: Caolán McNamara 
AuthorDate: Fri Jun 26 14:28:29 2020 +0100
Commit: Caolán McNamara 
CommitDate: Fri Jun 26 18:13:10 2020 +0200

weld FixedImageControl

Change-Id: I13f3480794232a9c203ae047a4fcad372988b8b8
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/97235
Tested-by: Jenkins
Reviewed-by: Caolán McNamara 

diff --git a/framework/inc/uielement/FixedImageToolbarController.hxx 
b/framework/inc/uielement/FixedImageToolbarController.hxx
index 2f10503e5343..66533fbc9cde 100644
--- a/framework/inc/uielement/FixedImageToolbarController.hxx
+++ b/framework/inc/uielement/FixedImageToolbarController.hxx
@@ -23,13 +23,14 @@
 #include 
 
 #include 
-#include 
+#include 
 
 class ToolBox;
-class FixedImage;
 
 namespace framework
 {
+class FixedImageControl;
+
 class FixedImageToolbarController final : public ComplexToolbarController
 {
 public:
@@ -47,7 +48,7 @@ private:
 
 DECL_LINK(MiscOptionsChanged, LinkParamNone*, void);
 
-VclPtr m_pFixedImageControl;
+VclPtr m_pFixedImageControl;
 sal_Int16 m_eSymbolSize;
 };
 } // namespace framework
diff --git a/framework/inc/uielement/spinfieldtoolbarcontroller.hxx 
b/framework/inc/uielement/spinfieldtoolbarcontroller.hxx
index 3e2af6c78719..8085c68c1cbf 100644
--- a/framework/inc/uielement/spinfieldtoolbarcontroller.hxx
+++ b/framework/inc/uielement/spinfieldtoolbarcontroller.hxx
@@ -23,7 +23,6 @@
 #include 
 
 #include 
-#include 
 #include 
 
 class ToolBox;
@@ -49,10 +48,6 @@ class SpinfieldToolbarController final : public 
ComplexToolbarController
 virtual void SAL_CALL dispose() override;
 
 // called from SpinfieldControl
-void Up();
-void Down();
-void First();
-void Last();
 void Modify();
 void GetFocus();
 void LoseFocus();
diff --git a/framework/source/uielement/FixedImageToolbarController.cxx 
b/framework/source/uielement/FixedImageToolbarController.cxx
index cfc987d97d3f..a666261b0f03 100644
--- a/framework/source/uielement/FixedImageToolbarController.cxx
+++ b/framework/source/uielement/FixedImageToolbarController.cxx
@@ -19,9 +19,10 @@
 
 #include 
 
+#include 
 #include 
 #include 
-#include 
+#include 
 #include 
 #include 
 #include 
@@ -36,21 +37,60 @@ using namespace ::com::sun::star::util;
 
 namespace framework
 {
+class FixedImageControl final : public InterimItemWindow
+{
+public:
+FixedImageControl(vcl::Window* pParent, const OUString& rCommand);
+virtual ~FixedImageControl() override;
+virtual void dispose() override;
+virtual void GetFocus() override
+{
+if (m_xWidget)
+m_xWidget->grab_focus();
+InterimItemWindow::GetFocus();
+}
+DECL_LINK(KeyInputHdl, const ::KeyEvent&, bool);
+
+private:
+std::unique_ptr m_xWidget;
+};
+
+FixedImageControl::FixedImageControl(vcl::Window* pParent, const OUString& 
rCommand)
+: InterimItemWindow(pParent, "svt/ui/fixedimagecontrol.ui", 
"FixedImageControl")
+, m_xWidget(m_xBuilder->weld_image("image"))
+{
+m_xWidget->connect_key_press(LINK(this, FixedImageControl, KeyInputHdl));
+
+bool bBigImages(SvtMiscOptions().AreCurrentSymbolsLarge());
+auto xImage
+= Graphic(AddonsOptions().GetImageFromURL(rCommand, bBigImages, 
true)).GetXGraphic();
+m_xWidget->set_image(xImage);
+
+SetSizePixel(get_preferred_size());
+}
+
+IMPL_LINK(FixedImageControl, KeyInputHdl, const ::KeyEvent&, rKEvt, bool)
+{
+return ChildKeyInput(rKEvt);
+}
+
+FixedImageControl::~FixedImageControl() { disposeOnce(); }
+
+void FixedImageControl::dispose()
+{
+m_xWidget.reset();
+InterimItemWindow::dispose();
+}
+
 FixedImageToolbarController::FixedImageToolbarController(
 const Reference& rxContext, const Reference& 
rFrame,
-ToolBox* pToolbar, sal_uInt16 nID, const OUString& aCommand)
-: ComplexToolbarController(rxContext, rFrame, pToolbar, nID, aCommand)
+ToolBox* pToolbar, sal_uInt16 nID, const OUString& rCommand)
+: ComplexToolbarController(rxContext, rFrame, pToolbar, nID, rCommand)
 , m_eSymbolSize(SvtMiscOptions().GetCurrentSymbolsSize())
 {
-m_pFixedImageControl = VclPtr::Create(m_xToolbar, 0);
+m_pFixedImageControl = VclPtr::Create(m_xToolbar, 
rCommand);
 m_xToolbar->SetItemWindow(m_nID, m_pFixedImageControl);
 
-bool bBigImages(SvtMiscOptions().AreCurrentSymbolsLarge());
-
-Image aImage(AddonsOptions().GetImageFromURL(aCommand, bBigImages, true));
-m_pFixedImageControl->SetImage(aImage);
-

[Libreoffice-commits] core.git: framework/inc framework/source solenv/sanitizers svtools/uiconfig svtools/UIConfig_svt.mk

2020-06-26 Thread Caolán McNamara (via logerrit)
 framework/inc/uielement/spinfieldtoolbarcontroller.hxx|4 
 framework/source/uielement/spinfieldtoolbarcontroller.cxx |  249 ++
 solenv/sanitizers/ui/svt.suppr|1 
 svtools/UIConfig_svt.mk   |1 
 svtools/uiconfig/ui/spinfieldcontrol.ui   |   29 +
 5 files changed, 146 insertions(+), 138 deletions(-)

New commits:
commit 07875e36f7f8aab16e5a1e5e78c189e572d57bf8
Author: Caolán McNamara 
AuthorDate: Thu Jun 25 21:24:03 2020 +0100
Commit: Caolán McNamara 
CommitDate: Fri Jun 26 15:44:11 2020 +0200

weld SpinfieldControl

Change-Id: I1696105ead648c86076f05f50f6286e9a3a932d4
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/97218
Tested-by: Jenkins
Reviewed-by: Caolán McNamara 

diff --git a/framework/inc/uielement/spinfieldtoolbarcontroller.hxx 
b/framework/inc/uielement/spinfieldtoolbarcontroller.hxx
index 8445110b896b..3e2af6c78719 100644
--- a/framework/inc/uielement/spinfieldtoolbarcontroller.hxx
+++ b/framework/inc/uielement/spinfieldtoolbarcontroller.hxx
@@ -56,14 +56,14 @@ class SpinfieldToolbarController final : public 
ComplexToolbarController
 void Modify();
 void GetFocus();
 void LoseFocus();
-bool PreNotify( NotifyEvent const & rNEvt );
+void Activate();
 
+OUString FormatOutputString(double fValue);
 private:
 virtual void executeControlCommand( const css::frame::ControlCommand& 
rControlCommand ) override;
 virtual css::uno::Sequence< css::beans::PropertyValue> 
getExecuteArgs(sal_Int16 KeyModifier) const override;
 
 bool impl_getValue( const css::uno::Any& rAny, sal_Int32& nValue, 
double& fValue, bool& bFloat );
-OUString impl_formatOutputString( double fValue );
 
 bool  m_bFloat,
   m_bMaxSet,
diff --git a/framework/source/uielement/spinfieldtoolbarcontroller.cxx 
b/framework/source/uielement/spinfieldtoolbarcontroller.cxx
index db3f9d67781c..1dad7b918683 100644
--- a/framework/source/uielement/spinfieldtoolbarcontroller.cxx
+++ b/framework/source/uielement/spinfieldtoolbarcontroller.cxx
@@ -26,8 +26,8 @@
 #include 
 
 #include 
+#include 
 #include 
-#include 
 #include 
 #include 
 #include 
@@ -46,101 +46,135 @@ namespace framework
 // Unfortunaltly the events are notified through virtual methods instead
 // of Listeners.
 
-class SpinfieldControl : public SpinField
+class SpinfieldControl final : public InterimItemWindow
 {
-public:
-SpinfieldControl( vcl::Window* pParent, WinBits nStyle, 
SpinfieldToolbarController* pSpinfieldToolbarController );
-virtual ~SpinfieldControl() override;
-virtual void dispose() override;
-
-virtual void Up() override;
-virtual void Down() override;
-virtual void First() override;
-virtual void Last() override;
-virtual void Modify() override;
-virtual void GetFocus() override;
-virtual void LoseFocus() override;
-virtual bool PreNotify( NotifyEvent& rNEvt ) override;
-
-private:
-SpinfieldToolbarController* m_pSpinfieldToolbarController;
-};
+public:
+SpinfieldControl(vcl::Window* pParent, SpinfieldToolbarController* 
pSpinfieldToolbarController);
+virtual ~SpinfieldControl() override;
+virtual void dispose() override;
 
-SpinfieldControl::SpinfieldControl( vcl::Window* pParent, WinBits nStyle, 
SpinfieldToolbarController* pSpinfieldToolbarController ) :
-SpinField( pParent, nStyle )
-, m_pSpinfieldToolbarController( pSpinfieldToolbarController )
-{
-}
+void set_value(double fValue);
 
-SpinfieldControl::~SpinfieldControl()
+void set_digits(int nDigits)
+{
+m_xWidget->set_digits(nDigits);
+}
+
+void set_min(double fMin)
+{
+m_xWidget->set_min(fMin);
+}
+
+void set_max(double fMax)
+{
+m_xWidget->set_max(fMax);
+}
+
+void set_step(double fStep)
+{
+m_xWidget->set_increments(fStep, fStep * 10);
+}
+
+OUString get_entry_text() const { return m_xWidget->get_text(); }
+
+DECL_LINK(ValueChangedHdl, weld::FormattedSpinButton&, void);
+DECL_LINK(FormatOutputHdl, weld::FormattedSpinButton&, void);
+DECL_LINK(ParseInputHdl, double*, bool);
+DECL_LINK(ModifyHdl, weld::Entry&, void);
+DECL_LINK(ActivateHdl, weld::Entry&, bool);
+DECL_LINK(FocusInHdl, weld::Widget&, void);
+DECL_LINK(FocusOutHdl, weld::Widget&, void);
+
+private:
+std::unique_ptr m_xWidget;
+SpinfieldToolbarController* m_pSpinfieldToolbarController;
+};
+
+SpinfieldControl::SpinfieldControl(vcl::Window* pParent, 
SpinfieldToolbarController* pSpinfieldToolbarController)
+: InterimItemWindow(pParent, "svt/ui/spinfieldcontrol.ui", 
"SpinFieldControl")
+, m_xWidget(m_xBuilder->weld_formatted_spin_button("spinbutton"))
+, m_pSpinfieldToolbarController(pSpinfieldToolbarController)
 {
-

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

2020-05-31 Thread Jan-Marek Glogowski (via logerrit)
 framework/inc/services/desktop.hxx|   12 ---
 framework/source/services/desktop.cxx |   23 ---
 svx/source/form/fmscriptingenv.cxx|  106 --
 3 files changed, 141 deletions(-)

New commits:
commit a97e344ba06b92e5f1fc96062a5ad03fb732615e
Author: Jan-Marek Glogowski 
AuthorDate: Mon Feb 17 00:12:12 2020 +0100
Commit: Jan-Marek Glogowski 
CommitDate: Sun May 31 22:21:35 2020 +0200

Revert "tdf#88985 block app from exiting during macro execution"

This isn't needed anymore with the fixes for tdf#127205.

Reverts commit 68cf256f506d4601a2d2cf3ec2d56713afd491e6.

Change-Id: I1a7944632af8330f68d451d2c293143233039b34
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/88837
Tested-by: Jenkins
Reviewed-by: Jan-Marek Glogowski 

diff --git a/framework/inc/services/desktop.hxx 
b/framework/inc/services/desktop.hxx
index 1f0f7911e98f..0cf9cb355fe4 100644
--- a/framework/inc/services/desktop.hxx
+++ b/framework/inc/services/desktop.hxx
@@ -418,18 +418,6 @@ class Desktop final : private cppu::BaseMutex,
   */
 css::uno::Reference< css::frame::XTerminateListener > m_xQuickLauncher;
 
-/** special terminate listener active when a macro is executing.
-  * Because basic runs Application::Yield internally the application 
may quit
-  * while running inside the internal basic event loop. So all the 
basic
-  * infrastructure may be deleted while the call is executing, leading 
to
-  * a variant of crashes. So this special terminate listener will
-  * veto the current quit attempt, stop basic execution, which will
-  * cause the inner event loop to quit, and on return to the outer 
normal
-  * application event loop then resend the quit attempt.
-  * So these implementation must be a special terminate listener too 
.-(
-  */
-css::uno::Reference< css::frame::XTerminateListener > 
m_xStarBasicQuitGuard;
-
 /** special terminate listener which loads images asynchronous for 
current open documents.
   * Because internally it uses blocking system APIs... it can't be 
guaranteed that
   * running jobs can be cancelled successfully if the corresponding 
document will be closed...
diff --git a/framework/source/services/desktop.cxx 
b/framework/source/services/desktop.cxx
index 260ddcb5dd43..28f5015203e3 100644
--- a/framework/source/services/desktop.cxx
+++ b/framework/source/services/desktop.cxx
@@ -161,7 +161,6 @@ Desktop::Desktop( const css::uno::Reference< 
css::uno::XComponentContext >& xCon
 ,   m_xDispatchRecorderSupplier(   
 )
 ,   m_xPipeTerminator   (  
 )
 ,   m_xQuickLauncher(  
 )
-,   m_xStarBasicQuitGuard   (  
 )
 ,   m_xSWThreadManager  (  
 )
 ,   m_xSfxTerminator(  
 )
 ,   m_xTitleNumberGenerator (  
 )
@@ -206,7 +205,6 @@ sal_Bool SAL_CALL Desktop::terminate()
 
 css::uno::Reference< css::frame::XTerminateListener > xPipeTerminator= 
m_xPipeTerminator;
 css::uno::Reference< css::frame::XTerminateListener > xQuickLauncher = 
m_xQuickLauncher;
-css::uno::Reference< css::frame::XTerminateListener > xStarBasicQuitGuard 
= m_xStarBasicQuitGuard;
 css::uno::Reference< css::frame::XTerminateListener > xSWThreadManager   = 
m_xSWThreadManager;
 css::uno::Reference< css::frame::XTerminateListener > xSfxTerminator = 
m_xSfxTerminator;
 
@@ -257,12 +255,6 @@ sal_Bool SAL_CALL Desktop::terminate()
 lCalledTerminationListener.push_back( xQuickLauncher );
 }
 
-if ( xStarBasicQuitGuard.is() )
-{
-xStarBasicQuitGuard->queryTermination( aEvent );
-lCalledTerminationListener.push_back( xStarBasicQuitGuard );
-}
-
 if ( xSWThreadManager.is() )
 {
 xSWThreadManager->queryTermination( aEvent );
@@ -308,9 +300,6 @@ sal_Bool SAL_CALL Desktop::terminate()
 if( bAskQuickStart && xQuickLauncher.is() )
 xQuickLauncher->notifyTermination( aEvent );
 
-if ( xStarBasicQuitGuard.is() )
-xStarBasicQuitGuard->notifyTermination( aEvent );
-
 if ( xSWThreadManager.is() )
 xSWThreadManager->notifyTermination( aEvent );
 
@@ -416,11 +405,6 @@ void SAL_CALL Desktop::addTerminateListener( const 
css::uno::Reference< css::fra
 m_xQuickLauncher = xListener;
 return;
 }
-if( sImplementationName == "com.sun.star.comp.svx.StarBasicQuitGuard" )
-{
-m_xStarBasicQuitGuard = xListener;
-return;
-}
   

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

2020-04-26 Thread Andrea Gelmini (via logerrit)
 framework/inc/uielement/uicommanddescription.hxx |5 +
 1 file changed, 1 insertion(+), 4 deletions(-)

New commits:
commit 83de7f38b7ae3c0b357974a536ae53fd6a2d231e
Author: Andrea Gelmini 
AuthorDate: Sun Apr 26 13:26:08 2020 +0200
Commit: Julien Nabet 
CommitDate: Sun Apr 26 15:35:36 2020 +0200

tdf#124176: Use pragma once instead of include guards

Started to fix typo
DESCRPTION

ended with #pragma

Change-Id: I0a99e0d1f0696cfbf2cd54e97b8b346bbe8e7e4e
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/92925
Tested-by: Jenkins
Reviewed-by: Julien Nabet 

diff --git a/framework/inc/uielement/uicommanddescription.hxx 
b/framework/inc/uielement/uicommanddescription.hxx
index 652a8966805c..6886224ceb00 100644
--- a/framework/inc/uielement/uicommanddescription.hxx
+++ b/framework/inc/uielement/uicommanddescription.hxx
@@ -17,8 +17,7 @@
  *   the License at http://www.apache.org/licenses/LICENSE-2.0 .
  */
 
-#ifndef INCLUDED_FRAMEWORK_INC_UIELEMENT_UICOMMANDDESCRIPTION_HXX
-#define INCLUDED_FRAMEWORK_INC_UIELEMENT_UICOMMANDDESCRIPTION_HXX
+#pragma once
 
 #include 
 #include 
@@ -92,6 +91,4 @@ public:
 
 } // namespace framework
 
-#endif // __FRAMEWORK_SERVICES_UICOMMANDDESCRPTION_HXX_
-
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
___
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

2020-04-23 Thread Caolán McNamara (via logerrit)
 framework/inc/uielement/spinfieldtoolbarcontroller.hxx|1 +
 framework/source/uielement/spinfieldtoolbarcontroller.cxx |9 +++--
 2 files changed, 8 insertions(+), 2 deletions(-)

New commits:
commit f6e7ff90718f7991bce6c642b9baef707e561ea5
Author: Caolán McNamara 
AuthorDate: Thu Apr 23 12:22:14 2020 +0100
Commit: Caolán McNamara 
CommitDate: Thu Apr 23 21:09:57 2020 +0200

LoseFocus incorrectly calling notifyFocusGet

looks like a cut and paste error from initial checkin

Change-Id: I816ad85c564b0ca31833da17bbe760101ed3231d
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/92757
Tested-by: Jenkins
Reviewed-by: Caolán McNamara 

diff --git a/framework/inc/uielement/spinfieldtoolbarcontroller.hxx 
b/framework/inc/uielement/spinfieldtoolbarcontroller.hxx
index bcf710fb24f3..8445110b896b 100644
--- a/framework/inc/uielement/spinfieldtoolbarcontroller.hxx
+++ b/framework/inc/uielement/spinfieldtoolbarcontroller.hxx
@@ -55,6 +55,7 @@ class SpinfieldToolbarController final : public 
ComplexToolbarController
 void Last();
 void Modify();
 void GetFocus();
+void LoseFocus();
 bool PreNotify( NotifyEvent const & rNEvt );
 
 private:
diff --git a/framework/source/uielement/spinfieldtoolbarcontroller.cxx 
b/framework/source/uielement/spinfieldtoolbarcontroller.cxx
index 0f329d9681ec..684c5b419f1f 100644
--- a/framework/source/uielement/spinfieldtoolbarcontroller.cxx
+++ b/framework/source/uielement/spinfieldtoolbarcontroller.cxx
@@ -127,9 +127,9 @@ void SpinfieldControl::GetFocus()
 
 void SpinfieldControl::LoseFocus()
 {
-SpinField::GetFocus();
+SpinField::LoseFocus();
 if ( m_pSpinfieldToolbarController )
-m_pSpinfieldToolbarController->GetFocus();
+m_pSpinfieldToolbarController->LoseFocus();
 }
 
 bool SpinfieldControl::PreNotify( NotifyEvent& rNEvt )
@@ -261,6 +261,11 @@ void SpinfieldToolbarController::GetFocus()
 notifyFocusGet();
 }
 
+void SpinfieldToolbarController::LoseFocus()
+{
+notifyFocusLost();
+}
+
 bool SpinfieldToolbarController::PreNotify( NotifyEvent const & rNEvt )
 {
 if( rNEvt.GetType() == MouseNotifyEvent::KEYINPUT )
___
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 svtools/uiconfig svtools/UIConfig_svt.mk

2020-04-23 Thread Caolán McNamara (via logerrit)
 framework/inc/uielement/comboboxtoolbarcontroller.hxx|2 
 framework/source/uielement/comboboxtoolbarcontroller.cxx |  185 +++
 framework/source/uielement/edittoolbarcontroller.cxx |1 
 svtools/UIConfig_svt.mk  |1 
 svtools/uiconfig/ui/combocontrol.ui  |   29 ++
 5 files changed, 120 insertions(+), 98 deletions(-)

New commits:
commit 424ffd5ea25d03b3c8628a273a1cf9794f6e1f52
Author: Caolán McNamara 
AuthorDate: Wed Apr 22 16:06:41 2020 +0100
Commit: Caolán McNamara 
CommitDate: Thu Apr 23 13:57:57 2020 +0200

weld ComboBoxControl

Change-Id: Ifdb76cc61e6270f8a04fec2534dcd29d27e8281f
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/92724
Tested-by: Jenkins
Reviewed-by: Caolán McNamara 

diff --git a/framework/inc/uielement/comboboxtoolbarcontroller.hxx 
b/framework/inc/uielement/comboboxtoolbarcontroller.hxx
index e3fc3687d836..df14769caa07 100644
--- a/framework/inc/uielement/comboboxtoolbarcontroller.hxx
+++ b/framework/inc/uielement/comboboxtoolbarcontroller.hxx
@@ -51,7 +51,7 @@ class ComboboxToolbarController final : public 
ComplexToolbarController
 void Modify();
 void GetFocus();
 void LoseFocus();
-bool PreNotify( NotifyEvent const & rNEvt );
+void Activate();
 
 private:
 virtual void executeControlCommand( const css::frame::ControlCommand& 
rControlCommand ) override;
diff --git a/framework/source/uielement/comboboxtoolbarcontroller.cxx 
b/framework/source/uielement/comboboxtoolbarcontroller.cxx
index 11e775fd9911..352fe7bd0833 100644
--- a/framework/source/uielement/comboboxtoolbarcontroller.cxx
+++ b/framework/source/uielement/comboboxtoolbarcontroller.cxx
@@ -22,10 +22,10 @@
 #include 
 #include 
 
+#include 
 #include 
 #include 
 #include 
-#include 
 
 using namespace ::com::sun::star;
 using namespace css::uno;
@@ -41,27 +41,54 @@ namespace framework
 // Unfortunately the events are notified through virtual methods instead
 // of Listeners.
 
-class ComboBoxControl : public ComboBox
+class ComboBoxControl final : public InterimItemWindow
 {
-public:
-ComboBoxControl( vcl::Window* pParent, WinBits nStyle, 
ComboboxToolbarController* pComboboxToolbarController );
-virtual ~ComboBoxControl() override;
-virtual void dispose() override;
-
-virtual void Select() override;
-virtual void Modify() override;
-virtual void GetFocus() override;
-virtual void LoseFocus() override;
-virtual bool PreNotify( NotifyEvent& rNEvt ) override;
-
-private:
-ComboboxToolbarController* m_pComboboxToolbarController;
+public:
+ComboBoxControl(vcl::Window* pParent, ComboboxToolbarController* 
pComboboxToolbarController);
+virtual ~ComboBoxControl() override;
+virtual void dispose() override;
+
+void set_active_or_entry_text(const OUString& rText);
+OUString get_active_text() const { return m_xWidget->get_active_text(); }
+
+void clear() { m_xWidget->clear(); }
+void remove(int nIndex) { m_xWidget->remove(nIndex); }
+void append_text(const OUString& rStr) { m_xWidget->append_text(rStr); }
+void insert_text(int pos, const OUString& rStr) { 
m_xWidget->insert_text(pos, rStr); }
+int get_count() const { return m_xWidget->get_count(); }
+int find_text(const OUString& rStr) const { return 
m_xWidget->find_text(rStr); }
+
+DECL_LINK(FocusInHdl, weld::Widget&, void);
+DECL_LINK(FocusOutHdl, weld::Widget&, void);
+DECL_LINK(ModifyHdl, weld::ComboBox&, void);
+DECL_LINK(ActivateHdl, weld::ComboBox&, bool);
+
+private:
+std::unique_ptr m_xWidget;
+ComboboxToolbarController* m_pComboboxToolbarController;
 };
 
-ComboBoxControl::ComboBoxControl( vcl::Window* pParent, WinBits nStyle, 
ComboboxToolbarController* pComboboxToolbarController ) :
-ComboBox( pParent, nStyle )
-, m_pComboboxToolbarController( pComboboxToolbarController )
+ComboBoxControl::ComboBoxControl(vcl::Window* pParent, 
ComboboxToolbarController* pComboboxToolbarController)
+: InterimItemWindow(pParent, "svt/ui/combocontrol.ui", "ComboControl")
+, m_xWidget(m_xBuilder->weld_combo_box("combobox"))
+, m_pComboboxToolbarController(pComboboxToolbarController)
 {
+m_xWidget->connect_focus_in(LINK(this, ComboBoxControl, FocusInHdl));
+m_xWidget->connect_focus_out(LINK(this, ComboBoxControl, FocusOutHdl));
+m_xWidget->connect_changed(LINK(this, ComboBoxControl, ModifyHdl));
+m_xWidget->connect_entry_activate(LINK(this, ComboBoxControl, 
ActivateHdl));
+
+m_xWidget->set_entry_width_chars(1); // so a smaller that default width 
can be used by ComboboxToolbarController
+SetSizePixel(get_preferred_size());
+}
+
+void ComboBoxControl::set_active_or_entry_text(const OUString& rText)
+{
+const int nFound = m_xWidget->find_text(rText);
+if (nFound != -1)
+m_xWidget->set_active(nFound);
+else
+

[Libreoffice-commits] core.git: framework/inc framework/source solenv/sanitizers svtools/uiconfig svtools/UIConfig_svt.mk

2020-04-22 Thread Caolán McNamara (via logerrit)
 framework/inc/uielement/edittoolbarcontroller.hxx|2 
 framework/source/uielement/edittoolbarcontroller.cxx |  102 ---
 solenv/sanitizers/ui/svt.suppr   |1 
 svtools/UIConfig_svt.mk  |1 
 svtools/uiconfig/ui/editcontrol.ui   |   26 
 5 files changed, 77 insertions(+), 55 deletions(-)

New commits:
commit 0ea8aab3ed9defd45de4b64d7bfbbd05b3053e0a
Author: Caolán McNamara 
AuthorDate: Wed Apr 22 14:17:20 2020 +0100
Commit: Caolán McNamara 
CommitDate: Wed Apr 22 20:10:56 2020 +0200

weld EditControl

as used by the LibreLogo toolbar

Change-Id: Ice60d1f5146a58cab5bab44a12a2bdcf4dbd77ec
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/92703
Tested-by: Jenkins
Reviewed-by: Caolán McNamara 

diff --git a/framework/inc/uielement/edittoolbarcontroller.hxx 
b/framework/inc/uielement/edittoolbarcontroller.hxx
index 3344ed1319f2..193af5920634 100644
--- a/framework/inc/uielement/edittoolbarcontroller.hxx
+++ b/framework/inc/uielement/edittoolbarcontroller.hxx
@@ -51,7 +51,7 @@ class EditToolbarController final : public 
ComplexToolbarController
 void Modify();
 void GetFocus();
 void LoseFocus();
-bool PreNotify( NotifyEvent const & rNEvt );
+void Activate();
 
 private:
 virtual void executeControlCommand( const css::frame::ControlCommand& 
rControlCommand ) override;
diff --git a/framework/source/uielement/edittoolbarcontroller.cxx 
b/framework/source/uielement/edittoolbarcontroller.cxx
index 5b6cd39cd45d..52c5164629db 100644
--- a/framework/source/uielement/edittoolbarcontroller.cxx
+++ b/framework/source/uielement/edittoolbarcontroller.cxx
@@ -20,12 +20,11 @@
 #include 
 
 #include 
-
+#include 
 #include 
 #include 
 #include 
 #include 
-#include 
 
 using namespace ::com::sun::star;
 using namespace css::uno;
@@ -41,26 +40,37 @@ namespace framework
 // Unfortunaltly the events are notified through virtual methods instead
 // of Listeners.
 
-class EditControl : public Edit
+class EditControl : public InterimItemWindow
 {
-public:
-EditControl( vcl::Window* pParent, WinBits nStyle, 
EditToolbarController* pEditToolbarController );
-virtual ~EditControl() override;
-virtual void dispose() override;
+public:
+EditControl(vcl::Window* pParent, EditToolbarController* 
pEditToolbarController);
+virtual ~EditControl() override;
+virtual void dispose() override;
+
+OUString get_text() const { return m_xWidget->get_text(); }
+void set_text(const OUString& rText) { m_xWidget->set_text(rText); }
 
-virtual void Modify() override;
-virtual void GetFocus() override;
-virtual void LoseFocus() override;
-virtual bool PreNotify( NotifyEvent& rNEvt ) override;
+private:
+std::unique_ptr m_xWidget;
+EditToolbarController* m_pEditToolbarController;
 
-private:
-EditToolbarController* m_pEditToolbarController;
+DECL_LINK(FocusInHdl, weld::Widget&, void);
+DECL_LINK(FocusOutHdl, weld::Widget&, void);
+DECL_LINK(ModifyHdl, weld::Entry&, void);
+DECL_LINK(ActivateHdl, weld::Entry&, bool);
 };
 
-EditControl::EditControl( vcl::Window* pParent, WinBits nStyle, 
EditToolbarController* pEditToolbarController ) :
-Edit( pParent, nStyle )
-, m_pEditToolbarController( pEditToolbarController )
+EditControl::EditControl(vcl::Window* pParent, EditToolbarController* 
pEditToolbarController)
+: InterimItemWindow(pParent, "svt/ui/editcontrol.ui", "EditControl")
+, m_xWidget(m_xBuilder->weld_entry("entry"))
+, m_pEditToolbarController(pEditToolbarController)
 {
+m_xWidget->connect_focus_in(LINK(this, EditControl, FocusInHdl));
+m_xWidget->connect_focus_out(LINK(this, EditControl, FocusOutHdl));
+m_xWidget->connect_changed(LINK(this, EditControl, ModifyHdl));
+m_xWidget->connect_activate(LINK(this, EditControl, ActivateHdl));
+
+SetSizePixel(get_preferred_size());
 }
 
 EditControl::~EditControl()
@@ -71,39 +81,34 @@ EditControl::~EditControl()
 void EditControl::dispose()
 {
 m_pEditToolbarController = nullptr;
-Edit::dispose();
+m_xWidget.reset();
+InterimItemWindow::dispose();
 }
 
-void EditControl::Modify()
+IMPL_LINK_NOARG(EditControl, ModifyHdl, weld::Entry&, void)
 {
-Edit::Modify();
-if ( m_pEditToolbarController )
+if (m_pEditToolbarController)
 m_pEditToolbarController->Modify();
 }
 
-void EditControl::GetFocus()
+IMPL_LINK_NOARG(EditControl, FocusInHdl, weld::Widget&, void)
 {
-Edit::GetFocus();
-if ( m_pEditToolbarController )
+if (m_pEditToolbarController)
 m_pEditToolbarController->GetFocus();
 }
 
-void EditControl::LoseFocus()
+IMPL_LINK_NOARG(EditControl, FocusOutHdl, weld::Widget&, void)
 {
-Edit::LoseFocus();
 if ( m_pEditToolbarController )
 m_pEditToolbarController->LoseFocus();
 }
 
-bool 

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

2020-02-23 Thread Jim Raykowski (via logerrit)
 framework/inc/classes/resource.hxx|9 +++---
 framework/inc/strings.hrc |1 
 framework/inc/uielement/toolbarmanager.hxx|1 
 framework/source/uielement/toolbarmanager.cxx |   36 +++---
 4 files changed, 40 insertions(+), 7 deletions(-)

New commits:
commit 0fb4f2107d08febd4925dce6d96b41da9917e9ae
Author: Jim Raykowski 
AuthorDate: Sat Dec 21 14:54:28 2019 -0900
Commit: Noel Grandin 
CommitDate: Mon Feb 24 08:00:46 2020 +0100

tdf#130163 Show undock or dock menu item in toolbar menu

This patch removes toolbar menu item 'Dock Toolbar' enable state and
shows 'Undock Toolbar' menu item when toolbar is docked and 'Dock
Toolbar' menu item when toolbar is undocked. It also sets the
accelerator key displayed for these items to Shift+Ctrl+F10

Change-Id: I0e4673529438c42452026602785857066ea7874a
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/85673
Tested-by: Noel Grandin 
Reviewed-by: Noel Grandin 

diff --git a/framework/inc/classes/resource.hxx 
b/framework/inc/classes/resource.hxx
index a9f98e607baa..04f00677c69d 100644
--- a/framework/inc/classes/resource.hxx
+++ b/framework/inc/classes/resource.hxx
@@ -22,10 +22,11 @@
 
 #define MENUITEM_TOOLBAR_VISIBLEBUTTON  1
 #define MENUITEM_TOOLBAR_CUSTOMIZETOOLBAR   2
-#define MENUITEM_TOOLBAR_DOCKTOOLBAR3
-#define MENUITEM_TOOLBAR_DOCKALLTOOLBAR 4
-#define MENUITEM_TOOLBAR_LOCKTOOLBARPOSITION5
-#define MENUITEM_TOOLBAR_CLOSE  6
+#define MENUITEM_TOOLBAR_UNDOCKTOOLBAR  3
+#define MENUITEM_TOOLBAR_DOCKTOOLBAR4
+#define MENUITEM_TOOLBAR_DOCKALLTOOLBAR 5
+#define MENUITEM_TOOLBAR_LOCKTOOLBARPOSITION6
+#define MENUITEM_TOOLBAR_CLOSE  7
 
 #endif
 
diff --git a/framework/inc/strings.hrc b/framework/inc/strings.hrc
index ef3ad73c1956..d3f28fcc9e21 100644
--- a/framework/inc/strings.hrc
+++ b/framework/inc/strings.hrc
@@ -27,6 +27,7 @@
 #define STR_CLOSEDOC_ANDRETURN  
NC_("STR_CLOSEDOC_ANDRETURN", "~Close & Return to " )
 #define STR_TOOLBAR_VISIBLE_BUTTONS 
NC_("STR_TOOLBAR_VISIBLE_BUTTONS", "Visible ~Buttons")
 #define STR_TOOLBAR_CUSTOMIZE_TOOLBAR   
NC_("STR_TOOLBAR_CUSTOMIZE_TOOLBAR", "~Customize Toolbar...")
+#define STR_TOOLBAR_UNDOCK_TOOLBAR  
NC_("STR_TOOLBAR_UNDOCK_TOOLBAR", "U~ndock Toolbar" )
 #define STR_TOOLBAR_DOCK_TOOLBAR
NC_("STR_TOOLBAR_DOCK_TOOLBAR", "~Dock Toolbar" )
 #define STR_TOOLBAR_DOCK_ALL_TOOLBARS   
NC_("STR_TOOLBAR_DOCK_ALL_TOOLBARS", "Dock ~All Toolbars" )
 #define STR_TOOLBAR_LOCK_TOOLBAR
NC_("STR_TOOLBAR_LOCK_TOOLBAR", "~Lock Toolbar Position" )
diff --git a/framework/inc/uielement/toolbarmanager.hxx 
b/framework/inc/uielement/toolbarmanager.hxx
index f43a3511b85d..8f3eb4c2b2eb 100644
--- a/framework/inc/uielement/toolbarmanager.hxx
+++ b/framework/inc/uielement/toolbarmanager.hxx
@@ -94,6 +94,7 @@ class ToolBarManager : public ToolbarManager_Base
 enum ExecuteCommand
 {
 EXEC_CMD_CLOSETOOLBAR,
+EXEC_CMD_UNDOCKTOOLBAR,
 EXEC_CMD_DOCKTOOLBAR,
 EXEC_CMD_DOCKALLTOOLBARS
 };
diff --git a/framework/source/uielement/toolbarmanager.cxx 
b/framework/source/uielement/toolbarmanager.cxx
index 78a5c1198584..d224cfc2a955 100644
--- a/framework/source/uielement/toolbarmanager.cxx
+++ b/framework/source/uielement/toolbarmanager.cxx
@@ -1447,8 +1447,22 @@ void ToolBarManager::AddCustomizeMenuItems(ToolBox const 
* pToolBar)
 nGroupLen = pMenu->GetItemCount();
 }
 
-if (MenuItemAllowed(MENUITEM_TOOLBAR_DOCKTOOLBAR))
-pMenu->InsertItem(MENUITEM_TOOLBAR_DOCKTOOLBAR, 
FwkResId(STR_TOOLBAR_DOCK_TOOLBAR));
+if (pToolBar->IsFloatingMode())
+{
+if (MenuItemAllowed(MENUITEM_TOOLBAR_DOCKTOOLBAR))
+{
+pMenu->InsertItem(MENUITEM_TOOLBAR_DOCKTOOLBAR, 
FwkResId(STR_TOOLBAR_DOCK_TOOLBAR));
+pMenu->SetAccelKey(MENUITEM_TOOLBAR_DOCKTOOLBAR, 
vcl::KeyCode(KEY_F10, true, true, false, false));
+}
+}
+else
+{
+if (MenuItemAllowed(MENUITEM_TOOLBAR_UNDOCKTOOLBAR))
+{
+pMenu->InsertItem(MENUITEM_TOOLBAR_UNDOCKTOOLBAR, 
FwkResId(STR_TOOLBAR_UNDOCK_TOOLBAR));
+pMenu->SetAccelKey(MENUITEM_TOOLBAR_UNDOCKTOOLBAR, 
vcl::KeyCode(KEY_F10, true, true, false, false));
+}
+}
 
 if (MenuItemAllowed(MENUITEM_TOOLBAR_DOCKALLTOOLBAR))
 pMenu->InsertItem(MENUITEM_TOOLBAR_DOCKALLTOOLBAR, 
FwkResId(STR_TOOLBAR_DOCK_ALL_TOOLBARS));
@@ -1475,7 +1489,6 @@ void ToolBarManager::AddCustomizeMenuItems(ToolBox const 
* pToolBar)
 
 if ( !bIsFloating )
 {
-pMenu->EnableItem(MENUITEM_TOOLBAR_DOCKTOOLBAR, false);
 pMenu->EnableItem(MENUITEM_TOOLBAR_DOCKALLTOOLBAR, false);
 Reference< XDockableWindow 

[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 

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

2020-01-30 Thread Noel Grandin (via logerrit)
 framework/inc/dispatch/oxt_handler.hxx |1 
 framework/source/dispatch/oxt_handler.cxx  |7 
 include/sfx2/sidebar/ControllerItem.hxx|4 --
 include/svtools/asynclink.hxx  |1 
 include/svx/linectrl.hxx   |2 -
 sfx2/source/sidebar/ControllerItem.cxx |   12 ---
 svtools/source/control/asynclink.cxx   |6 ---
 svx/source/tbxctrls/extrusioncontrols.cxx  |5 ---
 svx/source/tbxctrls/extrusioncontrols.hxx  |3 -
 sw/source/uibase/sidebar/WrapPropertyPanel.cxx |1 
 sw/source/uibase/sidebar/WrapPropertyPanel.hxx |1 
 vcl/source/window/splitwin.cxx |   39 +
 12 files changed, 11 insertions(+), 71 deletions(-)

New commits:
commit facc94bb0aef58353d54e14f948790643ccbec32
Author: Noel Grandin 
AuthorDate: Thu Jan 30 14:36:57 2020 +0200
Commit: Noel Grandin 
CommitDate: Thu Jan 30 16:17:45 2020 +0100

loplugin:unusedfields

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

diff --git a/framework/inc/dispatch/oxt_handler.hxx 
b/framework/inc/dispatch/oxt_handler.hxx
index 73b83d3f8dd4..69bc07074c3e 100644
--- a/framework/inc/dispatch/oxt_handler.hxx
+++ b/framework/inc/dispatch/oxt_handler.hxx
@@ -86,7 +86,6 @@ class Oxt_Handler final  :  public  ::cppu::WeakImplHelper<
 osl::Mutex m_mutex;
 
 css::uno::Reference< css::lang::XMultiServiceFactory > m_xFactory; 
  /// global uno service factory to create new services
-css::uno::Reference< css::frame::XDispatchResultListener > m_xListener;
 
 };
 
diff --git a/framework/source/dispatch/oxt_handler.cxx 
b/framework/source/dispatch/oxt_handler.cxx
index 8eed74832b3c..8bc67abf9105 100644
--- a/framework/source/dispatch/oxt_handler.cxx
+++ b/framework/source/dispatch/oxt_handler.cxx
@@ -59,13 +59,6 @@ Oxt_Handler::Oxt_Handler( const css::uno::Reference< 
css::lang::XMultiServiceFac
 
*//*-*/
 Oxt_Handler::~Oxt_Handler()
 {
-if ( m_xListener.is() )
-{
-css::frame::DispatchResultEvent aEvent;
-aEvent.State = css::frame::DispatchResultState::FAILURE;
-m_xListener->dispatchFinished( aEvent );
-m_xListener.clear();
-}
 }
 
 
/*-
diff --git a/include/sfx2/sidebar/ControllerItem.hxx 
b/include/sfx2/sidebar/ControllerItem.hxx
index 6b55fc173dfa..51befddff94d 100644
--- a/include/sfx2/sidebar/ControllerItem.hxx
+++ b/include/sfx2/sidebar/ControllerItem.hxx
@@ -57,9 +57,6 @@ public:
 SfxBindings ,
 ItemUpdateReceiverInterface& rItemUpdateReceiver);
 
-/// releases our action listener
-virtual void dispose() override;
-
 virtual ~ControllerItem() override;
 
 /** Force the controller item to call its NotifyItemUpdate
@@ -72,7 +69,6 @@ private:
 virtual void StateChanged (sal_uInt16 nSId, SfxItemState eState, const 
SfxPoolItem* pState) override;
 
 ItemUpdateReceiverInterface& mrItemUpdateReceiver;
-css::uno::Reference mxFrameActionListener;
 };
 
 } } // end of namespace sfx2::sidebar
diff --git a/include/svtools/asynclink.hxx b/include/svtools/asynclink.hxx
index 9c72c42e8abf..0d9f88f4e588 100644
--- a/include/svtools/asynclink.hxx
+++ b/include/svtools/asynclink.hxx
@@ -35,7 +35,6 @@ class SVT_DLLPUBLIC AsynchronLink
 {
 Link _aLink;
 ImplSVEvent* _nEventId;
-std::unique_ptr _pIdle;
 bool _bInCall;
 bool*_pDeleted;
 void*_pArg;
diff --git a/include/svx/linectrl.hxx b/include/svx/linectrl.hxx
index 7fc9fc742cea..d44682f395d8 100644
--- a/include/svx/linectrl.hxx
+++ b/include/svx/linectrl.hxx
@@ -37,8 +37,6 @@ typedef std::function LineStyleSele
 class SVX_DLLPUBLIC SvxLineStyleToolBoxControl final : public 
svt::PopupWindowController
 {
 private:
-std::unique_ptr  pStyleItem;
-std::unique_ptr   pDashItem;
 std::unique_ptr m_xBtnUpdater;
 
 LineStyleSelectFunction m_aLineStyleSelectFunction;
diff --git a/sfx2/source/sidebar/ControllerItem.cxx 
b/sfx2/source/sidebar/ControllerItem.cxx
index 11698a1c264f..7e1a0ae88925 100644
--- a/sfx2/source/sidebar/ControllerItem.cxx
+++ b/sfx2/source/sidebar/ControllerItem.cxx
@@ -33,8 +33,7 @@ ControllerItem::ControllerItem (
 SfxBindings ,
 ItemUpdateReceiverInterface& rItemUpdateReceiver)
 : SfxControllerItem(nSlotId, rBindings),
-  mrItemUpdateReceiver(rItemUpdateReceiver),
-  mxFrameActionListener()
+  mrItemUpdateReceiver(rItemUpdateReceiver)
 {
 }
 
@@ -43,15 +42,6 @@ ControllerItem::~ControllerItem()
 dispose();
 }
 
-void ControllerItem::dispose()
-{
-if (mxFrameActionListener.is())
-

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

2020-01-17 Thread Noel Grandin (via logerrit)
 framework/inc/dispatch/popupmenudispatcher.hxx|4 
 framework/source/dispatch/popupmenudispatcher.cxx |   17 -
 2 files changed, 4 insertions(+), 17 deletions(-)

New commits:
commit e579e4998389a06c04b550c7e70495b31a9a92d1
Author: Noel Grandin 
AuthorDate: Fri Jan 17 14:42:24 2020 +0200
Commit: Noel Grandin 
CommitDate: Fri Jan 17 18:39:46 2020 +0100

m_aListenerContainer is effectively unused here

ever since initial commit

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

diff --git a/framework/inc/dispatch/popupmenudispatcher.hxx 
b/framework/inc/dispatch/popupmenudispatcher.hxx
index c383d015629d..929350853408 100644
--- a/framework/inc/dispatch/popupmenudispatcher.hxx
+++ b/framework/inc/dispatch/popupmenudispatcher.hxx
@@ -39,9 +39,6 @@
 
 namespace framework{
 
-typedef cppu::OMultiTypeInterfaceContainerHelperVar
-IMPL_ListenerHashContainer;
-
 
/*-
 @short  helper for desktop only(!) to create new tasks on demand 
for dispatches
 @descr  Use this class as member only! Never use it as baseclass.
@@ -115,7 +112,6 @@ class PopupMenuDispatcher final : public  
::cppu::WeakImplHelper<
 css::uno::Reference< css::uri::XUriReferenceFactory >   
m_xUriRefFactory;   /// reference to the uri reference factory
 css::uno::Reference< css::uno::XComponentContext >  m_xContext;   
/// factory shared with our owner to create new services!
 osl::Mutex  m_mutex;
-IMPL_ListenerHashContainer  
m_aListenerContainer;   /// hash table for listener at specified URLs
 bool
m_bAlreadyDisposed;   /// Protection against multiple disposing calls.
 bool
m_bActivateListener;   /// dispatcher is listener for frame activation
 
diff --git a/framework/source/dispatch/popupmenudispatcher.cxx 
b/framework/source/dispatch/popupmenudispatcher.cxx
index 94ba14418118..caa3170c53bd 100644
--- a/framework/source/dispatch/popupmenudispatcher.cxx
+++ b/framework/source/dispatch/popupmenudispatcher.cxx
@@ -47,7 +47,6 @@ using namespace ::osl;
 PopupMenuDispatcher::PopupMenuDispatcher(
 const uno::Reference< XComponentContext >& xContext )
 :   m_xContext  ( xContext   )
-,   m_aListenerContainer( m_mutex )
 ,   m_bAlreadyDisposed  ( false  )
 ,   m_bActivateListener ( false  )
 {
@@ -224,22 +223,14 @@ void SAL_CALL PopupMenuDispatcher::dispatch( const URL& 
/*aURL*/, const Sequence
 {
 }
 
-void SAL_CALL PopupMenuDispatcher::addStatusListener( const uno::Reference< 
XStatusListener >& xControl,
-  const URL& aURL )
+void SAL_CALL PopupMenuDispatcher::addStatusListener( const uno::Reference< 
XStatusListener >& /*xControl*/,
+  const URL& /*aURL*/ )
 {
-SolarMutexGuard g;
-// Safe impossible cases
-// Add listener to container.
-m_aListenerContainer.addInterface( aURL.Complete, xControl );
 }
 
-void SAL_CALL PopupMenuDispatcher::removeStatusListener( const uno::Reference< 
XStatusListener >& xControl,
- const URL& aURL )
+void SAL_CALL PopupMenuDispatcher::removeStatusListener( const uno::Reference< 
XStatusListener >& /*xControl*/,
+ const URL& /*aURL*/ )
 {
-SolarMutexGuard g;
-// Safe impossible cases
-// Add listener to container.
-m_aListenerContainer.removeInterface( aURL.Complete, xControl );
 }
 
 void SAL_CALL PopupMenuDispatcher::frameAction( const FrameActionEvent& aEvent 
)
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2020-01-14 Thread Noel Grandin (via logerrit)
 framework/inc/classes/actiontriggercontainer.hxx  |2 +-
 framework/inc/classes/actiontriggerpropertyset.hxx|2 +-
 framework/inc/classes/actiontriggerseparatorpropertyset.hxx   |2 +-
 framework/inc/classes/imagewrapper.hxx|2 +-
 framework/inc/classes/rootactiontriggercontainer.hxx  |2 +-
 framework/inc/dispatch/closedispatcher.hxx|2 +-
 framework/inc/dispatch/dispatchinformationprovider.hxx|2 +-
 framework/inc/dispatch/dispatchprovider.hxx   |5 ++---
 framework/inc/dispatch/interceptionhelper.hxx |4 ++--
 framework/inc/dispatch/mailtodispatcher.hxx   |2 +-
 framework/inc/dispatch/oxt_handler.hxx|2 +-
 framework/inc/dispatch/servicehandler.hxx |2 +-
 framework/inc/dispatch/startmoduledispatcher.hxx  |2 +-
 framework/inc/dispatch/systemexec.hxx |2 +-
 framework/inc/helper/dockingareadefaultacceptor.hxx   |2 +-
 framework/inc/helper/mischelper.hxx   |6 +++---
 framework/inc/helper/ocomponentaccess.hxx |6 ++
 framework/inc/helper/persistentwindowstate.hxx|2 +-
 framework/inc/helper/statusindicator.hxx  |2 +-
 framework/inc/helper/statusindicatorfactory.hxx   |5 ++---
 framework/inc/helper/tagwindowasmodified.hxx  |2 +-
 framework/inc/helper/titlebarupdate.hxx   |2 +-
 framework/inc/helper/vclstatusindicator.hxx   |2 +-
 framework/inc/helper/wakeupthread.hxx |2 +-
 framework/inc/interaction/quietinteraction.hxx|2 +-
 framework/inc/jobs/helponstartup.hxx  |2 +-
 framework/inc/jobs/job.hxx|2 +-
 framework/inc/jobs/shelljob.hxx   |2 +-
 framework/inc/recording/dispatchrecorder.hxx  |2 +-
 framework/inc/recording/dispatchrecordersupplier.hxx  |2 +-
 framework/inc/services/desktop.hxx|9 ++---
 framework/inc/services/mediatypedetectionhelper.hxx   |2 +-
 framework/inc/services/uriabbreviation.hxx|2 +-
 framework/inc/tabwin/tabwinfactory.hxx|2 +-
 framework/inc/uiconfiguration/graphicnameaccess.hxx   |2 +-
 framework/inc/uiconfiguration/imagemanager.hxx|2 +-
 framework/inc/uiconfiguration/moduleimagemanager.hxx  |2 +-
 framework/inc/uielement/FixedImageToolbarController.hxx   |6 ++
 framework/inc/uielement/FixedTextToolbarController.hxx|5 ++---
 framework/inc/uielement/addonstoolbarwrapper.hxx  |2 +-
 framework/inc/uielement/buttontoolbarcontroller.hxx   |2 +-
 framework/inc/uielement/comboboxtoolbarcontroller.hxx |5 ++---
 framework/inc/uielement/constitemcontainer.hxx|2 +-
 framework/inc/uielement/dropdownboxtoolbarcontroller.hxx  |5 ++---
 framework/inc/uielement/edittoolbarcontroller.hxx |5 ++---
 framework/inc/uielement/fontmenucontroller.hxx|2 +-
 framework/inc/uielement/fontsizemenucontroller.hxx|2 +-
 framework/inc/uielement/footermenucontroller.hxx  |2 +-
 framework/inc/uielement/generictoolbarcontroller.hxx  |2 +-
 framework/inc/uielement/imagebuttontoolbarcontroller.hxx  |5 ++---
 framework/inc/uielement/itemcontainer.hxx |2 +-
 framework/inc/uielement/langselectionmenucontroller.hxx   |2 +-
 framework/inc/uielement/macrosmenucontroller.hxx  |2 +-
 framework/inc/uielement/menubarwrapper.hxx|2 +-
 framework/inc/uielement/newmenucontroller.hxx |2 +-
 framework/inc/uielement/progressbarwrapper.hxx|2 +-
 framework/inc/uielement/spinfieldtoolbarcontroller.hxx|5 ++---
 framework/inc/uielement/statusbaritem.hxx |2 +-
 framework/inc/uielement/statusbarwrapper.hxx  |2 +-
 framework/inc/uielement/statusindicatorinterfacewrapper.hxx   |2 +-
 framework/inc/uielement/styletoolbarcontroller.hxx|4 ++--
 framework/inc/uielement/togglebuttontoolbarcontroller.hxx |5 ++---
 framework/inc/uielement/toolbarmodemenucontroller.hxx |2 +-
 framework/inc/uielement/toolbarsmenucontroller.hxx|2 +-
 framework/inc/uielement/toolbarwrapper.hxx|7 ++-
 framework/inc/uifactory/configurationaccessfactorymanager.hxx |2 +-
 framework/inc/uifactory/factoryconfiguration.hxx  |2 +-
 

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

2020-01-07 Thread Andrea Gelmini (via logerrit)
 framework/inc/taskcreatordefs.hxx |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit c85c31b59a58accfb3766760705816d3dd4ecfd8
Author: Andrea Gelmini 
AuthorDate: Mon Jan 6 19:58:32 2020 +0100
Commit: Julien Nabet 
CommitDate: Tue Jan 7 16:06:13 2020 +0100

Fix typo

Change-Id: I0cf1ab7a86fd3b9323f1b5d219b6943b2f61884c
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/86300
Tested-by: Jenkins
Reviewed-by: Julien Nabet 

diff --git a/framework/inc/taskcreatordefs.hxx 
b/framework/inc/taskcreatordefs.hxx
index b0044d958462..1b63cd28105b 100644
--- a/framework/inc/taskcreatordefs.hxx
+++ b/framework/inc/taskcreatordefs.hxx
@@ -28,7 +28,7 @@ const char ARGUMENT_PARENTFRAME[] = "ParentFrame"; // XFrame
  */
 const char ARGUMENT_FRAMENAME[] = "FrameName"; // OUString
 
-/// [sal_Bool] If its set to sal_True we will make the new created frame 
visible.
+/// [sal_Bool] If it's set to sal_True we will make the new created frame 
visible.
 const char ARGUMENT_MAKEVISIBLE[] = "MakeVisible"; // sal_Bool
 
 /** [sal_Bool] If not "ContainerWindow" property is set it force creation of a
___
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

2019-12-22 Thread Julien Nabet (via logerrit)
 framework/inc/properties.h   |1 -
 framework/source/loadenv/loadenv.cxx |   34 ++
 2 files changed, 10 insertions(+), 25 deletions(-)

New commits:
commit f3e0595fcba689b07f6419c2fb540731a3aadecf
Author: Julien Nabet 
AuthorDate: Sun Dec 22 17:05:22 2019 +0100
Commit: Noel Grandin 
CommitDate: Mon Dec 23 07:41:49 2019 +0100

tdf#46037: use officecfg/Setup

+ replace define OFFICEFACTORY_PROPNAME_ASCII_WINDOWATTRIBUTES used once

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

diff --git a/framework/inc/properties.h b/framework/inc/properties.h
index 8cb35b1ac5f7..5977b7b760bb 100644
--- a/framework/inc/properties.h
+++ b/framework/inc/properties.h
@@ -119,7 +119,6 @@ namespace framework{
 
 /** properties for office module config (Setup.xcu) */
 
-#define OFFICEFACTORY_PROPNAME_ASCII_WINDOWATTRIBUTES   
"ooSetupFactoryWindowAttributes"
 #define OFFICEFACTORY_PROPNAME_ASCII_UINAME "ooSetupFactoryUIName"
 #define OFFICEFACTORY_PROPNAME_ASCII_ICON   "ooSetupFactoryIcon"
 
diff --git a/framework/source/loadenv/loadenv.cxx 
b/framework/source/loadenv/loadenv.cxx
index 96e9b6f2a970..89c64e10a15c 100644
--- a/framework/source/loadenv/loadenv.cxx
+++ b/framework/source/loadenv/loadenv.cxx
@@ -35,10 +35,13 @@
 #include 
 #include 
 #include 
+#include 
 
 #include 
+#include 
 #include 
 #include 
+#include 
 #include 
 #include 
 #include 
@@ -915,21 +918,15 @@ bool LoadEnv::impl_furtherDocsAllowed()
 
 try
 {
-css::uno::Any aVal = ::comphelper::ConfigurationHelper::readDirectKey(
-xContext,
-"org.openoffice.Office.Common/",
-"Misc",
-"MaxOpenDocuments",
-::comphelper::EConfigurationModes::ReadOnly);
+o3tl::optional 
x(officecfg::Office::Common::Misc::MaxOpenDocuments::get(xContext));
 
 // NIL means: count of allowed documents = infinite !
-// => return sal_True
-if ( ! aVal.hasValue())
+// => return true
+if ( !x)
 bAllowed = true;
 else
 {
-sal_Int32 nMaxOpenDocuments = 0;
-aVal >>= nMaxOpenDocuments;
+sal_Int32 nMaxOpenDocuments(*x);
 
 css::uno::Reference< css::frame::XFramesSupplier > xDesktop(
 css::frame::Desktop::create(xContext),
@@ -1687,14 +1684,7 @@ void LoadEnv::impl_makeFrameWindowVisible(const 
css::uno::Reference< css::awt::X
 bool bForceFrontAndFocus(false);
 if ( !preview )
 {
-css::uno::Any const a =
-::comphelper::ConfigurationHelper::readDirectKey(
-  xContext,
-  "org.openoffice.Office.Common/View",
-  "NewDocumentHandling",
-  "ForceFocusAndToFront",
-  ::comphelper::EConfigurationModes::ReadOnly);
-a >>= bForceFrontAndFocus;
+bForceFrontAndFocus = 
officecfg::Office::Common::View::NewDocumentHandling::ForceFocusAndToFront::get(xContext);
 }
 
 if( pWindow->IsVisible() && (bForceFrontAndFocus || bForceToFront) )
@@ -1765,11 +1755,7 @@ void LoadEnv::impl_applyPersistentWindowState(const 
css::uno::Reference< css::aw
 OUString sModule = 
lProps.getUnpackedValueOrDefault(FILTER_PROPNAME_ASCII_DOCUMENTSERVICE, 
OUString());
 
 // get access to the configuration of this office module
-css::uno::Reference< css::container::XNameAccess > 
xModuleCfg(::comphelper::ConfigurationHelper::openConfig(
-
xContext,
-
"/org.openoffice.Setup/Office/Factories",
-
::comphelper::EConfigurationModes::ReadOnly),
-  
css::uno::UNO_QUERY_THROW);
+css::uno::Reference< css::container::XNameAccess > 
xModuleCfg(officecfg::Setup::Office::Factories::get(xContext));
 
 // read window state from the configuration
 // and apply it on the window.
@@ -1778,7 +1764,7 @@ void LoadEnv::impl_applyPersistentWindowState(const 
css::uno::Reference< css::aw
 
 // Don't look for persistent window attributes when used through 
LibreOfficeKit
 if( !comphelper::LibreOfficeKit::isActive() )
-comphelper::ConfigurationHelper::readRelativeKey(xModuleCfg, 
sModule, OFFICEFACTORY_PROPNAME_ASCII_WINDOWATTRIBUTES) >>= sWindowState;
+comphelper::ConfigurationHelper::readRelativeKey(xModuleCfg, 
sModule, "ooSetupFactoryWindowAttributes") >>= sWindowState;
 
 if 

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

2019-12-12 Thread Stephan Bergmann (via logerrit)
 framework/inc/helper/statusindicatorfactory.hxx |7 ---
 1 file changed, 7 deletions(-)

New commits:
commit 7612651a1c51c1c86788c637ef4ab2db7751cc10
Author: Stephan Bergmann 
AuthorDate: Thu Dec 12 11:15:12 2019 +0100
Commit: Stephan Bergmann 
CommitDate: Thu Dec 12 14:58:07 2019 +0100

Remove redundant member clear() from dtor

...and then remove newly-redundant user-provided dtor completely, similar to
 "Remove some redundant 
user-provided
dtors"

Change-Id: I185d3aa7c16b5d4e6e64345c7fa221b9ed0cde6e
Reviewed-on: https://gerrit.libreoffice.org/85038
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann 

diff --git a/framework/inc/helper/statusindicatorfactory.hxx 
b/framework/inc/helper/statusindicatorfactory.hxx
index da02dbfc626a..467c1ccd84bf 100644
--- a/framework/inc/helper/statusindicatorfactory.hxx
+++ b/framework/inc/helper/statusindicatorfactory.hxx
@@ -86,13 +86,6 @@ struct IndicatorInfo
 m_nValue = 0;
 }
 
-/** @short  Don't forget to free used references!
- */
-~IndicatorInfo()
-{
-m_xIndicator.clear();
-}
-
 /** @short  Used to locate an info struct inside a stl structure...
 
 @descr  The indicator object itself is used as key. Its values
___
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

2019-12-02 Thread Noel Grandin (via logerrit)
 framework/inc/services/desktop.hxx   |5 +-
 framework/inc/threadhelp/transactionbase.hxx |   51 ---
 framework/source/services/desktop.cxx|3 -
 3 files changed, 4 insertions(+), 55 deletions(-)

New commits:
commit c5f8cca27aedff9a936cdbd3e0d258f0bbf3f146
Author: Noel Grandin 
AuthorDate: Mon Dec 2 10:03:24 2019 +0200
Commit: Noel Grandin 
CommitDate: Mon Dec 2 13:36:19 2019 +0100

loplugin:mergeclasses TransactionBase with Desktop

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

diff --git a/framework/inc/services/desktop.hxx 
b/framework/inc/services/desktop.hxx
index c49b62f4cf14..68dc24da2abd 100644
--- a/framework/inc/services/desktop.hxx
+++ b/framework/inc/services/desktop.hxx
@@ -26,7 +26,6 @@
 #include 
 
 #include 
-#include 
 
 #include 
 #include 
@@ -49,6 +48,7 @@
 #include 
 #include 
 #include 
+#include 
 #include 
 
 namespace framework{
@@ -95,7 +95,6 @@ typedef cppu::WeakComponentImplHelper<
css::frame::XUntitledNumbers > Desktop_BASE;
 
 class Desktop : private cppu::BaseMutex,
-private TransactionBase,
 public Desktop_BASE,
 public cppu::OPropertySetHelper
 {
@@ -377,6 +376,8 @@ class Desktop : private cppu::BaseMutex,
 
 private:
 
+mutable TransactionManagerm_aTransactionManager;
+
 /** check flag to protect us against dispose before terminate!
   *   see dispose() for further information!
   */
diff --git a/framework/inc/threadhelp/transactionbase.hxx 
b/framework/inc/threadhelp/transactionbase.hxx
deleted file mode 100644
index 236a0c7c04e6..
--- a/framework/inc/threadhelp/transactionbase.hxx
+++ /dev/null
@@ -1,51 +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 .
- */
-
-#ifndef INCLUDED_FRAMEWORK_INC_THREADHELP_TRANSACTIONBASE_HXX
-#define INCLUDED_FRAMEWORK_INC_THREADHELP_TRANSACTIONBASE_HXX
-
-#include 
-
-namespace framework{
-
-/*-
-@short  make it possible to instantiate a transaction manager as 
first member!
-@descr  If you use a transaction manager as a member of your class 
and wish to use it earlier then other ones
-you should have a look on this implementation. You must 
use it as the first base class
-of your implementation - because base classes are 
initialized by his order and before your
-member! That's why is a good place to declare this member.
-@devstatus  ready to use
-*//*-*/
-struct TransactionBase
-{
-
-//  public member
-
-public:
-
-mutable TransactionManagerm_aTransactionManager;   /// "your" 
public manager-member!
-   /// Make it 
mutable for using in const functions!
-
-};  //  struct TransactionBase
-
-}   //  namespace framework
-
-#endif // INCLUDED_FRAMEWORK_INC_THREADHELP_TRANSACTIONBASE_HXX
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/framework/source/services/desktop.cxx 
b/framework/source/services/desktop.cxx
index 2a8947d36669..03e6bf2750f1 100644
--- a/framework/source/services/desktop.cxx
+++ b/framework/source/services/desktop.cxx
@@ -143,8 +143,7 @@ void Desktop::constructorInit()
 @onerrorWe throw an ASSERT in debug version or do nothing in release 
version.
 
*//*-*/
 Desktop::Desktop( const css::uno::Reference< css::uno::XComponentContext >& 
xContext )
-:   TransactionBase (  
 )
-,   Desktop_BASE( m_aMutex )
+:   Desktop_BASE( m_aMutex )
 ,   

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

2019-11-20 Thread Gabor Kelemen (via logerrit)
 framework/IwyuFilter_framework.yaml|   90 
++
 framework/inc/general.h|   32 ---
 framework/inc/pch/precompiled_fwk.hxx  |1 
 framework/inc/pch/precompiled_fwl.hxx  |1 
 framework/inc/uielement/FixedImageToolbarController.hxx|2 
 framework/inc/uielement/FixedTextToolbarController.hxx |5 
 framework/source/accelerators/acceleratorcache.cxx |4 
 framework/source/accelerators/acceleratorconfiguration.cxx |5 
 framework/source/accelerators/documentacceleratorconfiguration.cxx |8 
 framework/source/accelerators/globalacceleratorconfiguration.cxx   |5 
 framework/source/accelerators/moduleacceleratorconfiguration.cxx   |7 
 framework/source/accelerators/presethandler.cxx|4 
 framework/source/accelerators/storageholder.cxx|   13 -
 framework/source/classes/taskcreator.cxx   |2 
 framework/source/dispatch/closedispatcher.cxx  |1 
 framework/source/dispatch/dispatchinformationprovider.cxx  |3 
 framework/source/dispatch/dispatchprovider.cxx |9 -
 framework/source/dispatch/mailtodispatcher.cxx |3 
 framework/source/dispatch/oxt_handler.cxx  |4 
 framework/source/dispatch/popupmenudispatcher.cxx  |   14 -
 framework/source/dispatch/servicehandler.cxx   |3 
 framework/source/dispatch/startmoduledispatcher.cxx|7 
 framework/source/dispatch/systemexec.cxx   |3 
 framework/source/dispatch/windowcommanddispatch.cxx|1 
 framework/source/fwe/classes/addonmenu.cxx |8 
 framework/source/fwe/classes/framelistanalyzer.cxx |3 
 framework/source/fwe/classes/imagewrapper.cxx  |1 
 framework/source/fwe/classes/sfxhelperfunctions.cxx|2 
 framework/source/fwe/dispatch/interaction.cxx  |1 
 framework/source/fwe/helper/configimporter.cxx |2 
 framework/source/fwe/helper/titlehelper.cxx|3 
 framework/source/fwe/xml/menuconfiguration.cxx |2 
 framework/source/fwe/xml/menudocumenthandler.cxx   |1 
 framework/source/fwe/xml/saxnamespacefilter.cxx|2 
 framework/source/fwe/xml/statusbarconfiguration.cxx|5 
 framework/source/fwe/xml/toolboxconfiguration.cxx  |5 
 framework/source/fwe/xml/toolboxdocumenthandler.cxx|1 
 framework/source/fwi/classes/protocolhandlercache.cxx  |1 
 framework/source/fwi/helper/mischelper.cxx |2 
 framework/source/fwi/jobs/configaccess.cxx |7 
 framework/source/fwi/threadhelp/transactionmanager.cxx |2 
 framework/source/fwi/uielement/constitemcontainer.cxx  |4 
 framework/source/fwi/uielement/rootitemcontainer.cxx   |3 
 framework/source/helper/dockingareadefaultacceptor.cxx |1 
 framework/source/helper/persistentwindowstate.cxx  |2 
 framework/source/helper/statusindicatorfactory.cxx |9 -
 framework/source/helper/tagwindowasmodified.cxx|5 
 framework/source/helper/titlebarupdate.cxx |8 
 framework/source/helper/uiconfigelementwrapperbase.cxx |2 
 framework/source/helper/uielementwrapperbase.cxx   |3 
 framework/source/interaction/quietinteraction.cxx  |3 
 framework/source/jobs/helponstartup.cxx|3 
 framework/source/jobs/job.cxx  |3 
 framework/source/jobs/jobdata.cxx  |2 
 framework/source/jobs/jobdispatch.cxx  |3 
 framework/source/jobs/jobexecutor.cxx  |6 
 framework/source/jobs/jobresult.cxx|3 
 framework/source/jobs/joburl.cxx   |2 
 framework/source/jobs/shelljob.cxx |3 
 framework/source/layoutmanager/helpers.cxx |1 
 framework/source/layoutmanager/layoutmanager.cxx   |   17 -
 framework/source/layoutmanager/toolbarlayoutmanager.cxx|3 
 framework/source/loadenv/loadenv.cxx   |6 
 framework/source/recording/dispatchrecorder.cxx|1 
 framework/source/services/autorecovery.cxx |8 
 framework/source/services/desktop.cxx  

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

2019-11-07 Thread Maxim Monastirsky (via logerrit)
 framework/inc/uielement/menubarmanager.hxx|2 ++
 framework/source/uielement/menubarmanager.cxx |   18 ++
 2 files changed, 12 insertions(+), 8 deletions(-)

New commits:
commit f17fb8824ce511270f23b00a425e0b839f77a46c
Author: Maxim Monastirsky 
AuthorDate: Wed Nov 6 15:07:42 2019 +0200
Commit: Maxim Monastirsky 
CommitDate: Thu Nov 7 23:57:05 2019 +0100

MenuBarManager: Honor visible property of menu items

This became a problem recently with the introduction of
notebookbar customization, as it allows to hide menu items.

As a solution, use the same approach as for toolbars (see
GenericToolbarController::statusChanged): Force menu item
visibility only if it was previously hidden via a special
status update of css::frame::status::Visibility.

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

diff --git a/framework/inc/uielement/menubarmanager.hxx 
b/framework/inc/uielement/menubarmanager.hxx
index a1fbdb82d0fe..407814a7640b 100644
--- a/framework/inc/uielement/menubarmanager.hxx
+++ b/framework/inc/uielement/menubarmanager.hxx
@@ -153,10 +153,12 @@ class MenuBarManager final :
  css::uno::Reference< css::frame::XStatusListener 
> const & xManager,
  css::uno::Reference< css::frame::XDispatch > 
const & rDispatch ) :
  nItemId( aItemId ),
+ bMadeInvisible ( false ),
  xSubMenuManager( xManager ),
  xMenuItemDispatch( rDispatch ) {}
 
 sal_uInt16
nItemId;
+bool  
bMadeInvisible;
 OUString  
aTargetFrame;
 OUString  
aMenuItemURL;
 OUString  
aParsedItemURL;
diff --git a/framework/source/uielement/menubarmanager.cxx 
b/framework/source/uielement/menubarmanager.cxx
index 316cd2e6d2c9..ea679171f898 100644
--- a/framework/source/uielement/menubarmanager.cxx
+++ b/framework/source/uielement/menubarmanager.cxx
@@ -338,13 +338,14 @@ void SAL_CALL MenuBarManager::statusChanged( const 
FeatureStateEvent& Event )
 if ( Event.State >>= bCheckmark )
 {
 // Checkmark or RadioButton
-m_pVCLMenu->ShowItem( menuItemHandler->nItemId );
 m_pVCLMenu->CheckItem( menuItemHandler->nItemId, 
bCheckmark );
-
+// If not already designated RadioButton set as CheckMark
 MenuItemBits nBits = m_pVCLMenu->GetItemBits( 
menuItemHandler->nItemId );
-//If not already designated RadioButton set as CheckMark
 if (!(nBits & MenuItemBits::RADIOCHECK))
 m_pVCLMenu->SetItemBits( menuItemHandler->nItemId, 
nBits | MenuItemBits::CHECKABLE );
+
+if ( menuItemHandler->bMadeInvisible )
+m_pVCLMenu->ShowItem( menuItemHandler->nItemId );
 }
 else if ( Event.State >>= aItemText )
 {
@@ -353,11 +354,9 @@ void SAL_CALL MenuBarManager::statusChanged( const 
FeatureStateEvent& Event )
 if ( !aEnumPart.isEmpty() && aURL.GetProtocol() == 
INetProtocol::Uno )
 {
 // Checkmark or RadioButton
-m_pVCLMenu->ShowItem( menuItemHandler->nItemId );
 m_pVCLMenu->CheckItem( menuItemHandler->nItemId, 
aItemText == aEnumPart );
-
+// If not already designated RadioButton set as 
CheckMark
 MenuItemBits nBits = m_pVCLMenu->GetItemBits( 
menuItemHandler->nItemId );
-//If not already designated RadioButton set as 
CheckMark
 if (!(nBits & MenuItemBits::RADIOCHECK))
 m_pVCLMenu->SetItemBits( menuItemHandler->nItemId, 
nBits | MenuItemBits::CHECKABLE );
 }
@@ -377,16 +376,19 @@ void SAL_CALL MenuBarManager::statusChanged( const 
FeatureStateEvent& Event )
 aItemText = FwkResId(STR_SAVECOPYDOC) + 
aItemText.copy( 4 );
 }
 
-m_pVCLMenu->ShowItem( menuItemHandler->nItemId );
 m_pVCLMenu->SetItemText( menuItemHandler->nItemId, 
aItemText );
 }
+
+if ( menuItemHandler->bMadeInvisible )
+m_pVCLMenu->ShowItem( menuItemHandler->nItemId );
 }
 else if ( Event.State >>= 

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

2019-11-04 Thread Serge Krot (via logerrit)
 framework/Library_fwk.mk   |1 
 framework/inc/uielement/FixedImageToolbarController.hxx|   59 ++
 framework/inc/uielement/toolbarmerger.hxx  |1 
 framework/source/uielement/FixedImageToolbarController.cxx |  113 +
 framework/source/uielement/toolbarmerger.cxx   |3 
 5 files changed, 177 insertions(+)

New commits:
commit 2187cff2d452e20aa1fdfd5d8aa7473242cd1eb6
Author: Serge Krot 
AuthorDate: Fri Oct 18 17:40:11 2019 +0200
Commit: Thorsten Behrens 
CommitDate: Mon Nov 4 01:20:00 2019 +0100

Toolbar: Added usage of ImageControl as toolbar control

Reviewed-on: https://gerrit.libreoffice.org/81064
Reviewed-by: Serge Krot (CIB) 
Tested-by: Serge Krot (CIB) 
(cherry picked from commit 48f945a3be16ee0eba0c526e51280dc8deafc316)

Change-Id: I2536a505650b6e4c98e79f749c3b237518cc995d
Reviewed-on: https://gerrit.libreoffice.org/81872
Tested-by: Jenkins
Reviewed-by: Thorsten Behrens 

diff --git a/framework/Library_fwk.mk b/framework/Library_fwk.mk
index 5d59402c2be5..1fe75ccab4b7 100644
--- a/framework/Library_fwk.mk
+++ b/framework/Library_fwk.mk
@@ -132,6 +132,7 @@ $(eval $(call gb_Library_add_exception_objects,fwk,\
 framework/source/uielement/controlmenucontroller \
 framework/source/uielement/dropdownboxtoolbarcontroller \
 framework/source/uielement/edittoolbarcontroller \
+framework/source/uielement/FixedImageToolbarController \
 framework/source/uielement/FixedTextToolbarController \
 framework/source/uielement/genericstatusbarcontroller \
 framework/source/uielement/generictoolbarcontroller \
diff --git a/framework/inc/uielement/FixedImageToolbarController.hxx 
b/framework/inc/uielement/FixedImageToolbarController.hxx
new file mode 100644
index ..2fa55e4e8cc5
--- /dev/null
+++ b/framework/inc/uielement/FixedImageToolbarController.hxx
@@ -0,0 +1,59 @@
+/* -*- 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 .
+ */
+
+#ifndef INCLUDED_FRAMEWORK_INC_UIELEMENT_FIXEDIMAGETOOLBARCONTROLLER_HXX
+#define INCLUDED_FRAMEWORK_INC_UIELEMENT_FIXEDIMAGETOOLBARCONTROLLER_HXX
+
+#include 
+#include 
+
+#include 
+
+class ToolBox;
+class ImageControl;
+
+namespace framework
+{
+class FixedImageToolbarController : public ComplexToolbarController
+{
+public:
+FixedImageToolbarController(const 
css::uno::Reference& rxContext,
+const css::uno::Reference& 
rFrame,
+ToolBox* pToolBar, sal_uInt16 nID, const 
OUString& aCommand);
+
+// XComponent
+virtual void SAL_CALL dispose() override;
+
+void CheckAndUpdateImages();
+
+protected:
+virtual void executeControlCommand(const css::frame::ControlCommand& 
rControlCommand) override;
+
+protected:
+DECL_LINK(MiscOptionsChanged, LinkParamNone*, void);
+
+private:
+VclPtr m_pFixedImageControl;
+sal_Int16 m_eSymbolSize;
+};
+} // namespace framework
+
+#endif // INCLUDED_FRAMEWORK_INC_UIELEMENT_FIXEDIMAGETOOLBARCONTROLLER_HXX
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
\ No newline at end of file
diff --git a/framework/inc/uielement/toolbarmerger.hxx 
b/framework/inc/uielement/toolbarmerger.hxx
index cfe236f8328a..bb41a2bece60 100644
--- a/framework/inc/uielement/toolbarmerger.hxx
+++ b/framework/inc/uielement/toolbarmerger.hxx
@@ -27,6 +27,7 @@
 #include 
 #include 
 #include 
+#include 
 #include 
 #include 
 
diff --git a/framework/source/uielement/FixedImageToolbarController.cxx 
b/framework/source/uielement/FixedImageToolbarController.cxx
new file mode 100644
index ..6338287a8dd9
--- /dev/null
+++ b/framework/source/uielement/FixedImageToolbarController.cxx
@@ -0,0 +1,113 @@
+/* -*- 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 

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

2019-11-01 Thread Andrea Gelmini (via logerrit)
 0 files changed

New commits:
commit 9495b7c935097a7f18896b3835e3a8cc6b0db2ce
Author: Andrea Gelmini 
AuthorDate: Fri Nov 1 08:07:34 2019 +0100
Commit: Julien Nabet 
CommitDate: Fri Nov 1 22:55:04 2019 +0100

Removed executable permission on src file

Change-Id: Id4dc99968fc453f5ab3ee5e7b30bfacf79e843b7
Reviewed-on: https://gerrit.libreoffice.org/81867
Tested-by: Jenkins
Reviewed-by: Julien Nabet 

diff --git a/framework/inc/uielement/togglebuttontoolbarcontroller.hxx 
b/framework/inc/uielement/togglebuttontoolbarcontroller.hxx
old mode 100755
new mode 100644
diff --git a/framework/source/uielement/complextoolbarcontroller.cxx 
b/framework/source/uielement/complextoolbarcontroller.cxx
old mode 100755
new mode 100644
diff --git a/framework/source/uielement/generictoolbarcontroller.cxx 
b/framework/source/uielement/generictoolbarcontroller.cxx
old mode 100755
new mode 100644
diff --git a/vcl/source/app/help.cxx b/vcl/source/app/help.cxx
old mode 100755
new mode 100644
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

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

2019-10-31 Thread Serge Krot (via logerrit)
 framework/Library_fwk.mk  |1 
 framework/inc/uielement/FixedTextToolbarController.hxx|   55 +++
 framework/inc/uielement/toolbarmerger.hxx |1 
 framework/source/uielement/FixedTextToolbarController.cxx |   98 ++
 framework/source/uielement/toolbarmerger.cxx  |3 
 5 files changed, 158 insertions(+)

New commits:
commit c538764082f29ef98fb859cae37a895cee2de889
Author: Serge Krot 
AuthorDate: Fri Oct 18 13:57:22 2019 +0200
Commit: Thorsten Behrens 
CommitDate: Fri Nov 1 00:24:05 2019 +0100

Toolbar: add usage of FixedText as toolbar control

Change-Id: I26a79c485fa2e168058025e058bcfb793af7515f
Reviewed-on: https://gerrit.libreoffice.org/81039
Reviewed-by: Serge Krot (CIB) 
Tested-by: Serge Krot (CIB) 
(cherry picked from commit c2682ba52ea0cbb7af95e80f6d67b286061aeae2)
Reviewed-on: https://gerrit.libreoffice.org/81643
Reviewed-by: Thorsten Behrens 
Tested-by: Thorsten Behrens 

diff --git a/framework/Library_fwk.mk b/framework/Library_fwk.mk
index 665df00be044..5d59402c2be5 100644
--- a/framework/Library_fwk.mk
+++ b/framework/Library_fwk.mk
@@ -132,6 +132,7 @@ $(eval $(call gb_Library_add_exception_objects,fwk,\
 framework/source/uielement/controlmenucontroller \
 framework/source/uielement/dropdownboxtoolbarcontroller \
 framework/source/uielement/edittoolbarcontroller \
+framework/source/uielement/FixedTextToolbarController \
 framework/source/uielement/genericstatusbarcontroller \
 framework/source/uielement/generictoolbarcontroller \
 framework/source/uielement/imagebuttontoolbarcontroller \
diff --git a/framework/inc/uielement/FixedTextToolbarController.hxx 
b/framework/inc/uielement/FixedTextToolbarController.hxx
new file mode 100644
index ..cd8afb9499eb
--- /dev/null
+++ b/framework/inc/uielement/FixedTextToolbarController.hxx
@@ -0,0 +1,55 @@
+/* -*- 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 .
+ */
+
+#ifndef INCLUDED_FRAMEWORK_INC_UIELEMENT_FIXEDTEXTTOOLBARCONTROLLER_HXX
+#define INCLUDED_FRAMEWORK_INC_UIELEMENT_FIXEDTEXTTOOLBARCONTROLLER_HXX
+
+#include 
+#include 
+
+#include 
+
+class ToolBox;
+class FixedText;
+
+namespace framework
+{
+class FixedTextToolbarController : public ComplexToolbarController
+{
+public:
+FixedTextToolbarController(const 
css::uno::Reference& rxContext,
+   const css::uno::Reference& 
rFrame,
+   ToolBox* pToolBar, sal_uInt16 nID, const 
OUString& aCommand);
+
+// XComponent
+virtual void SAL_CALL dispose() override;
+
+protected:
+virtual void executeControlCommand(const css::frame::ControlCommand& 
rControlCommand) override;
+virtual css::uno::Sequence
+getExecuteArgs(sal_Int16 KeyModifier) const override;
+
+private:
+VclPtr m_pFixedTextControl;
+};
+}
+
+#endif // INCLUDED_FRAMEWORK_INC_UIELEMENT_FIXEDTEXTTOOLBARCONTROLLER_HXX
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
\ No newline at end of file
diff --git a/framework/inc/uielement/toolbarmerger.hxx 
b/framework/inc/uielement/toolbarmerger.hxx
index cc0448a8f76f..cfe236f8328a 100644
--- a/framework/inc/uielement/toolbarmerger.hxx
+++ b/framework/inc/uielement/toolbarmerger.hxx
@@ -27,6 +27,7 @@
 #include 
 #include 
 #include 
+#include 
 #include 
 
 #include 
diff --git a/framework/source/uielement/FixedTextToolbarController.cxx 
b/framework/source/uielement/FixedTextToolbarController.cxx
new file mode 100644
index ..7a2a41ae9c0f
--- /dev/null
+++ b/framework/source/uielement/FixedTextToolbarController.cxx
@@ -0,0 +1,98 @@
+/* -*- 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 

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

2019-10-31 Thread Serge Krot (via logerrit)
 framework/inc/uielement/togglebuttontoolbarcontroller.hxx|9 ++
 framework/source/uielement/togglebuttontoolbarcontroller.cxx |   44 ---
 2 files changed, 40 insertions(+), 13 deletions(-)

New commits:
commit c720ad95d0c375d217db2816877a6d25d825163a
Author: Serge Krot 
AuthorDate: Wed Oct 16 16:03:41 2019 +0200
Commit: Thorsten Behrens 
CommitDate: Fri Nov 1 00:22:26 2019 +0100

ToggleButton: add ability to set tooltip text for pop-up menu items

Change-Id: Iacd5c97438782ffddc8a9196688e1d58abce9abe
Reviewed-on: https://gerrit.libreoffice.org/80906
Reviewed-by: Serge Krot (CIB) 
Tested-by: Serge Krot (CIB) 
(cherry picked from commit 8f79936d5278fd5172f5864f99befaa878de5f5d)
Reviewed-on: https://gerrit.libreoffice.org/81642
Reviewed-by: Thorsten Behrens 
Tested-by: Thorsten Behrens 

diff --git a/framework/inc/uielement/togglebuttontoolbarcontroller.hxx 
b/framework/inc/uielement/togglebuttontoolbarcontroller.hxx
old mode 100644
new mode 100755
index 1550e554d59f..ae532858d25b
--- a/framework/inc/uielement/togglebuttontoolbarcontroller.hxx
+++ b/framework/inc/uielement/togglebuttontoolbarcontroller.hxx
@@ -36,6 +36,13 @@ class ToggleButtonToolbarController : public 
ComplexToolbarController
 
 {
 public:
+class DropdownMenuItem
+{
+public:
+OUString mLabel;
+OUString mTipHelpText;
+};
+
 enum class Style
 {
 DropDownButton,
@@ -64,7 +71,7 @@ class ToggleButtonToolbarController : public 
ComplexToolbarController
 DECL_LINK( MenuSelectHdl, Menu *, bool);
 
 OUStringm_aCurrentSelection;
-std::vector< OUString > m_aDropdownMenuList;
+std::vector< DropdownMenuItem > m_aDropdownMenuList;
 };
 
 }
diff --git a/framework/source/uielement/togglebuttontoolbarcontroller.cxx 
b/framework/source/uielement/togglebuttontoolbarcontroller.cxx
index 92818083c1f7..f884bb23e8cc 100644
--- a/framework/source/uielement/togglebuttontoolbarcontroller.cxx
+++ b/framework/source/uielement/togglebuttontoolbarcontroller.cxx
@@ -97,12 +97,15 @@ uno::Reference< awt::XWindow > SAL_CALL 
ToggleButtonToolbarController::createPop
 const sal_uInt32 nCount = m_aDropdownMenuList.size();
 for ( sal_uInt32 i = 0; i < nCount; i++ )
 {
-OUString aLabel( m_aDropdownMenuList[i] );
-aPopup->InsertItem( sal_uInt16( i+1 ), aLabel );
-if ( aLabel == m_aCurrentSelection )
+const OUString & rLabel = m_aDropdownMenuList[i].mLabel;
+aPopup->InsertItem( sal_uInt16( i+1 ), rLabel );
+if ( rLabel == m_aCurrentSelection )
 aPopup->CheckItem( sal_uInt16( i+1 ) );
 else
 aPopup->CheckItem( sal_uInt16( i+1 ), false );
+
+if ( !m_aDropdownMenuList[i].mTipHelpText.isEmpty() )
+aPopup->SetTipHelpText( sal_uInt16( i+1 ), 
m_aDropdownMenuList[i].mTipHelpText );
 }
 
 m_pToolbar->SetItemDown( m_nID, true );
@@ -125,10 +128,14 @@ void 
ToggleButtonToolbarController::executeControlCommand( const css::frame::Con
 {
 Sequence< OUString > aList;
 m_aDropdownMenuList.clear();
+m_aCurrentSelection.clear();
 
 rControlCommand.Arguments[i].Value >>= aList;
 for ( sal_Int32 j = 0; j < aList.getLength(); j++ )
-m_aDropdownMenuList.push_back( aList[j] );
+{
+m_aDropdownMenuList.push_back( DropdownMenuItem() );
+m_aDropdownMenuList.back().mLabel = aList[j];
+}
 
 // send notification
 uno::Sequence< beans::NamedValue > aInfo { { "List", 
css::uno::makeAny(aList) } };
@@ -153,7 +160,7 @@ void ToggleButtonToolbarController::executeControlCommand( 
const css::frame::Con
  ( sal::static_int_cast< sal_uInt32 >(nPos)
< m_aDropdownMenuList.size() ) )
 {
-m_aCurrentSelection = m_aDropdownMenuList[nPos];
+m_aCurrentSelection = m_aDropdownMenuList[nPos].mLabel;
 
 // send notification
 uno::Sequence< beans::NamedValue > aInfo { { 
"ItemChecked", css::uno::makeAny(nPos) } };
@@ -168,15 +175,26 @@ void 
ToggleButtonToolbarController::executeControlCommand( const css::frame::Con
 else if ( rControlCommand.Command == "AddEntry" )
 {
 OUString   aText;
+OUString   aTipHelpText;
+
 for ( sal_Int32 i = 0; i < rControlCommand.Arguments.getLength(); i++ )
 {
 if ( rControlCommand.Arguments[i].Name == "Text" )
 {
-if ( rControlCommand.Arguments[i].Value >>= aText )
-m_aDropdownMenuList.push_back( aText );
-break;
+rControlCommand.Arguments[i].Value >>= aText;
+}
+else if ( 

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

2019-09-11 Thread Arkadiy Illarionov (via logerrit)
 framework/inc/uielement/rootitemcontainer.hxx |3 --
 framework/source/fwi/uielement/rootitemcontainer.cxx  |   11 
+-
 framework/source/uiconfiguration/moduleuiconfigurationmanager.cxx |7 +++---
 framework/source/uiconfiguration/uiconfigurationmanager.cxx   |7 +++---
 4 files changed, 11 insertions(+), 17 deletions(-)

New commits:
commit 8f35bb1fcc9c1efd7edc52efbfc33509de2c00f2
Author: Arkadiy Illarionov 
AuthorDate: Sat Sep 7 16:25:24 2019 +0300
Commit: Stephan Bergmann 
CommitDate: Wed Sep 11 23:45:08 2019 +0200

tdf#39593 Drop RootItemContainer::GetImplementation

Replace with comphelper::getUnoTunnelImplementation.
Also use isUnoTunnelId().

Change-Id: I014d27fd985836e9232b7f4772696b946eec907e
Reviewed-on: https://gerrit.libreoffice.org/78745
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann 

diff --git a/framework/inc/uielement/rootitemcontainer.hxx 
b/framework/inc/uielement/rootitemcontainer.hxx
index ce0aa4a426ec..a0238b94579e 100644
--- a/framework/inc/uielement/rootitemcontainer.hxx
+++ b/framework/inc/uielement/rootitemcontainer.hxx
@@ -69,8 +69,7 @@ class RootItemContainer final : private cppu::BaseMutex,
 virtual css::uno::Sequence< css::uno::Type > SAL_CALL getTypes(  ) 
override;
 
 // XUnoTunnel
-static FWI_DLLPUBLIC const css::uno::Sequence< sal_Int8 >&   
GetUnoTunnelId() throw();
-static FWI_DLLPUBLIC RootItemContainer*
   GetImplementation( const css::uno::Reference< css::uno::XInterface >& 
rxIFace ) throw();
+static FWI_DLLPUBLIC const css::uno::Sequence< sal_Int8 >&   
getUnoTunnelId() throw();
 sal_Int64   SAL_CALL 
getSomething( const css::uno::Sequence< sal_Int8 >& rIdentifier ) override;
 
 // XIndexContainer
diff --git a/framework/source/fwi/uielement/rootitemcontainer.cxx 
b/framework/source/fwi/uielement/rootitemcontainer.cxx
index 4571b3b61603..f7e7eb28dbb7 100644
--- a/framework/source/fwi/uielement/rootitemcontainer.cxx
+++ b/framework/source/fwi/uielement/rootitemcontainer.cxx
@@ -142,7 +142,7 @@ Reference< XIndexAccess > 
RootItemContainer::deepCopyContainer( const Reference<
 // XUnoTunnel
 sal_Int64 RootItemContainer::getSomething( const css::uno::Sequence< sal_Int8 
>& rIdentifier )
 {
-if( ( rIdentifier.getLength() == 16 ) && ( 0 == memcmp( 
RootItemContainer::GetUnoTunnelId().getConstArray(), 
rIdentifier.getConstArray(), 16 ) ) )
+if( isUnoTunnelId(rIdentifier) )
 return sal::static_int_cast< sal_Int64 >( reinterpret_cast< sal_IntPtr 
>( this ));
 return 0;
 }
@@ -152,18 +152,11 @@ namespace
 class theRootItemContainerUnoTunnelId : public rtl::Static< 
UnoTunnelIdInit, theRootItemContainerUnoTunnelId > {};
 }
 
-const Sequence< sal_Int8 >& RootItemContainer::GetUnoTunnelId() throw()
+const Sequence< sal_Int8 >& RootItemContainer::getUnoTunnelId() throw()
 {
 return theRootItemContainerUnoTunnelId::get().getSeq();
 }
 
-RootItemContainer* RootItemContainer::GetImplementation( const 
css::uno::Reference< css::uno::XInterface >& rxIFace ) throw()
-{
-css::uno::Reference< css::lang::XUnoTunnel > xUT( rxIFace, 
css::uno::UNO_QUERY );
-return xUT.is() ? reinterpret_cast< RootItemContainer* 
>(sal::static_int_cast< sal_IntPtr >(
-  xUT->getSomething( 
RootItemContainer::GetUnoTunnelId() ))) : nullptr;
-}
-
 // XElementAccess
 sal_Bool SAL_CALL RootItemContainer::hasElements()
 {
diff --git a/framework/source/uiconfiguration/moduleuiconfigurationmanager.cxx 
b/framework/source/uiconfiguration/moduleuiconfigurationmanager.cxx
index b629dbaefca3..36631222539e 100644
--- a/framework/source/uiconfiguration/moduleuiconfigurationmanager.cxx
+++ b/framework/source/uiconfiguration/moduleuiconfigurationmanager.cxx
@@ -60,6 +60,7 @@
 #include 
 #include 
 #include 
+#include 
 #include 
 
 using namespace css;
@@ -427,7 +428,7 @@ void 
ModuleUIConfigurationManager::impl_requestUIElementData( sal_Int16 nElement
 {
 MenuConfiguration aMenuCfg( m_xContext );
 Reference< XIndexAccess > xContainer( 
aMenuCfg.CreateMenuBarConfigurationFromXML( xInputStream ));
-RootItemContainer* pRootItemContainer = 
RootItemContainer::GetImplementation( xContainer );
+auto pRootItemContainer = 
comphelper::getUnoTunnelImplementation( xContainer );
 if ( pRootItemContainer )
 aUIElementData.xSettings.set( static_cast< 
OWeakObject * >( new ConstItemContainer( pRootItemContainer, true ) ), 
UNO_QUERY );
 else
@@ -446,7 +447,7 @@ void 
ModuleUIConfigurationManager::impl_requestUIElementData( sal_Int16 nElement
 {
 Reference< XIndexContainer > 

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

2019-08-20 Thread Noel Grandin (via logerrit)
 framework/Library_fwk.mk   |1 
 framework/inc/helper/statusindicatorfactory.hxx|7 --
 framework/inc/helper/wakeupthread.hxx  |   57 +++
 framework/source/helper/statusindicatorfactory.cxx |   25 
 framework/source/helper/wakeupthread.cxx   |   60 +
 5 files changed, 132 insertions(+), 18 deletions(-)

New commits:
commit d3b03032b7140a98946bfe8fc475a322e6eb6f9a
Author: Noel Grandin 
AuthorDate: Tue Aug 20 10:14:19 2019 +0200
Commit: Noel Grandin 
CommitDate: Tue Aug 20 11:13:46 2019 +0200

tdf#125869 LibreOffice UI freezes (shows not responding) while exporting a 
pdf

Revert "use vcl::Timer in StatusIndicatorFactory"
This reverts commit 848058625c7fad21e2469c95c2a2078678925a5a,
which seems to have been a bad idea

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

diff --git a/framework/Library_fwk.mk b/framework/Library_fwk.mk
index 7a433735ce43..6d1f124f2f5a 100644
--- a/framework/Library_fwk.mk
+++ b/framework/Library_fwk.mk
@@ -88,6 +88,7 @@ $(eval $(call gb_Library_add_exception_objects,fwk,\
 framework/source/helper/uiconfigelementwrapperbase \
 framework/source/helper/uielementwrapperbase \
 framework/source/helper/vclstatusindicator \
+framework/source/helper/wakeupthread \
 framework/source/interaction/quietinteraction \
 framework/source/jobs/job \
 framework/source/jobs/jobdata \
diff --git a/framework/inc/helper/statusindicatorfactory.hxx 
b/framework/inc/helper/statusindicatorfactory.hxx
index a2a073821d8e..4f6e183e8a54 100644
--- a/framework/inc/helper/statusindicatorfactory.hxx
+++ b/framework/inc/helper/statusindicatorfactory.hxx
@@ -25,6 +25,7 @@
 #include 
 
 // include files of own module
+#include 
 #include 
 
 // include uno interfaces
@@ -44,9 +45,7 @@
 #include 
 
 #include 
-#include 
 #include 
-#include 
 #include 
 #include 
 
@@ -166,7 +165,7 @@ class StatusIndicatorFactory : public  
::cppu::WeakImplHelper<
 
 /** Notify us if a fix time is over. We use it to implement an
 intelligent "Reschedule" ... */
-boost::optional m_xWakeUpTimer;
+rtl::Reference m_pWakeUp;
 
 /** Our WakeUpThread calls us in our interface method 
"XUpdatable::update().
 There we set this member m_bAllowReschedule to sal_True. Next time 
if our impl_reschedule()
@@ -183,8 +182,6 @@ class StatusIndicatorFactory : public  
::cppu::WeakImplHelper<
 /** prevent recursive calling of Application::Reschedule(). */
 static sal_Int32 m_nInReschedule;
 
-DECL_LINK( WakeupTimerHdl, Timer*, void );
-
 // interface
 
 public:
diff --git a/framework/inc/helper/wakeupthread.hxx 
b/framework/inc/helper/wakeupthread.hxx
new file mode 100644
index ..50e234f23713
--- /dev/null
+++ b/framework/inc/helper/wakeupthread.hxx
@@ -0,0 +1,57 @@
+/* -*- 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 .
+ */
+
+#ifndef INCLUDED_FRAMEWORK_INC_HELPER_WAKEUPTHREAD_HXX
+#define INCLUDED_FRAMEWORK_INC_HELPER_WAKEUPTHREAD_HXX
+
+#include 
+
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+
+namespace com { namespace sun { namespace star { namespace util {
+class XUpdatable;
+} } } }
+
+namespace framework{
+
+class WakeUpThread: public salhelper::Thread {
+css::uno::WeakReference updatable_;
+osl::Condition condition_;
+
+osl::Mutex mutex_;
+bool terminate_;
+
+void execute() override;
+
+public:
+WakeUpThread(css::uno::Reference const & updatable);
+
+void stop();
+};
+
+}
+
+#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/framework/source/helper/statusindicatorfactory.cxx 
b/framework/source/helper/statusindicatorfactory.cxx
index ee33a646cadd..5e4ba3adf4e3 100644
--- a/framework/source/helper/statusindicatorfactory.cxx
+++ b/framework/source/helper/statusindicatorfactory.cxx
@@ -537,27 +537,26 @@ void StatusIndicatorFactory::impl_startWakeUpThread()
 

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

2019-08-19 Thread Andrea Gelmini (via logerrit)
 framework/inc/dispatch/interceptionhelper.hxx 
|4 ++--
 framework/source/services/desktop.cxx 
|2 +-
 include/unotools/cmdoptions.hxx   
|2 +-
 odk/examples/DevelopersGuide/OfficeDev/DesktopEnvironment/DocumentView.java   
|2 +-
 odk/examples/DevelopersGuide/OfficeDev/DesktopEnvironment/OnewayExecutor.java 
|4 ++--
 odk/examples/DevelopersGuide/OfficeDev/DesktopEnvironment/ViewContainer.java  
|4 ++--
 6 files changed, 9 insertions(+), 9 deletions(-)

New commits:
commit b11611ffac5223f62bdecde023b6f3c456d327f2
Author: Andrea Gelmini 
AuthorDate: Fri Aug 16 15:50:41 2019 +0200
Commit: Samuel Mehrbrodt 
CommitDate: Mon Aug 19 11:34:21 2019 +0200

Fix typos

To complete
https://gerrit.libreoffice.org/#/c/77567/

Change-Id: I9f56eb308ff9b23c4259a0abae60ac2f97038393
Reviewed-on: https://gerrit.libreoffice.org/77589
Reviewed-by: Julien Nabet 
Tested-by: Jenkins
Reviewed-by: Samuel Mehrbrodt 

diff --git a/framework/inc/dispatch/interceptionhelper.hxx 
b/framework/inc/dispatch/interceptionhelper.hxx
index fd8e342c4c34..fbc8c33927bc 100644
--- a/framework/inc/dispatch/interceptionhelper.hxx
+++ b/framework/inc/dispatch/interceptionhelper.hxx
@@ -221,7 +221,7 @@ class InterceptionHelper : public  ::cppu::WeakImplHelper<
 @attention  We don't check for double registrations here!
 
 @param  xInterceptor
-reference to interceptor, which wish to be registered 
here.
+reference to interceptor, which wishes to be 
registered here.
 
 @throw  A RuntimeException if the given reference is NULL!
  */
@@ -235,7 +235,7 @@ class InterceptionHelper : public  ::cppu::WeakImplHelper<
 and delete all special information about it.
 
 @param  xInterceptor
-reference to the interceptor, which wish to be 
deregistered.
+reference to the interceptor, which wishes to be 
deregistered.
 
 @throw  A RuntimeException if the given reference is NULL!
  */
diff --git a/framework/source/services/desktop.cxx 
b/framework/source/services/desktop.cxx
index 22dbfcd30e35..7e0052bf57a6 100644
--- a/framework/source/services/desktop.cxx
+++ b/framework/source/services/desktop.cxx
@@ -733,7 +733,7 @@ css::uno::Sequence< css::uno::Reference< 
css::frame::XDispatch > > SAL_CALL Desk
 
 @descr  It's really provided by an internal helper, which is used 
inside the dispatch API too.
 @param  xInterceptor
-the interceptor object, which wish to be (de)registered.
+the interceptor object, which wishes to be (de)registered.
 
 @threadsafe yes
 
*//*-*/
diff --git a/include/unotools/cmdoptions.hxx b/include/unotools/cmdoptions.hxx
index b2134a60c5de..6beadc644de9 100644
--- a/include/unotools/cmdoptions.hxx
+++ b/include/unotools/cmdoptions.hxx
@@ -95,7 +95,7 @@ class SAL_WARN_UNUSED UNOTOOLS_DLLPUBLIC SvtCommandOptions : 
public utl::detail:
 deregistration mechanism too, we use weak references to
 the given frames.
 
-@param  "xFrame"points to the frame, which wish to 
be
+@param  "xFrame"points to the frame, which wishes 
to be
 notified, if configuration was 
changed.
 
*//*-*/
 
diff --git 
a/odk/examples/DevelopersGuide/OfficeDev/DesktopEnvironment/DocumentView.java 
b/odk/examples/DevelopersGuide/OfficeDev/DesktopEnvironment/DocumentView.java
index 0f885f636934..57ac4e77951e 100644
--- 
a/odk/examples/DevelopersGuide/OfficeDev/DesktopEnvironment/DocumentView.java
+++ 
b/odk/examples/DevelopersGuide/OfficeDev/DesktopEnvironment/DocumentView.java
@@ -359,7 +359,7 @@ public class DocumentView extendsJFrame
 
 /**
  * callback from our internal saved frame
- * which wish to die. It's not necessary to remove listener connections
+ * which wishes to die. It's not necessary to remove listener connections
  * here. Because the broadcaster do it automatically.
  * We have to release all references to him only.
  *
diff --git 
a/odk/examples/DevelopersGuide/OfficeDev/DesktopEnvironment/OnewayExecutor.java 
b/odk/examples/DevelopersGuide/OfficeDev/DesktopEnvironment/OnewayExecutor.java
index 8da2103aaa61..4eb7f80a76f8 100644
--- 
a/odk/examples/DevelopersGuide/OfficeDev/DesktopEnvironment/OnewayExecutor.java
+++ 
b/odk/examples/DevelopersGuide/OfficeDev/DesktopEnvironment/OnewayExecutor.java
@@ -70,7 +70,7 @@ class OnewayExecutor 

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

2019-08-18 Thread Andrea Gelmini (via logerrit)
 framework/inc/dispatch/closedispatcher.hxx |4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

New commits:
commit 5f367bb7e66ca1f86557ee6770f9c50e298dba69
Author: Andrea Gelmini 
AuthorDate: Sun Aug 18 15:51:10 2019 +0200
Commit: Julien Nabet 
CommitDate: Sun Aug 18 16:54:52 2019 +0200

Fix typo

Change-Id: Icb8ed2dcaecc718137646236274f3a5d3df47531
Reviewed-on: https://gerrit.libreoffice.org/73694
Reviewed-by: Julien Nabet 
Tested-by: Julien Nabet 

diff --git a/framework/inc/dispatch/closedispatcher.hxx 
b/framework/inc/dispatch/closedispatcher.hxx
index 54224b7af9a0..d0ed8e8bbf87 100644
--- a/framework/inc/dispatch/closedispatcher.hxx
+++ b/framework/inc/dispatch/closedispatcher.hxx
@@ -86,8 +86,8 @@ class CloseDispatcher : public  ::cppu::WeakImplHelper<
 css::uno::WeakReference< css::frame::XFrame > m_xCloseFrame;
 
 /** @short  used for asynchronous callbacks within the main thread.
-@descr  Internally we work asynchronous. Because our callis
-are not aware, that her request can kill its own 
environment... */
+@descr  Internally we work asynchronously. Because our callees
+are not aware that their request can kill its own 
environment... */
 std::unique_ptr m_aAsyncCallback;
 
 /** @short  used inside asynchronous callback to decide,
___
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

2019-07-23 Thread Noel Grandin (via logerrit)
 framework/inc/xml/imagesconfiguration.hxx |   19 -
 framework/inc/xml/imagesdocumenthandler.hxx   |   11 +--
 framework/source/uiconfiguration/imagemanagerimpl.cxx |   25 ++-
 framework/source/xml/imagesconfiguration.cxx  |4 -
 framework/source/xml/imagesdocumenthandler.cxx|   59 +++---
 5 files changed, 31 insertions(+), 87 deletions(-)

New commits:
commit 35614ba0eb64e40ec37f1c28e59b7fc04b88
Author: Noel Grandin 
AuthorDate: Tue Jul 23 09:53:18 2019 +0200
Commit: Noel Grandin 
CommitDate: Tue Jul 23 19:52:33 2019 +0200

simplify framework image manager load/save code

most of this stuff is unused, and we only ever have one image-list

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

diff --git a/framework/inc/xml/imagesconfiguration.hxx 
b/framework/inc/xml/imagesconfiguration.hxx
index 983a16d66c9b..1e3ec096e7f7 100644
--- a/framework/inc/xml/imagesconfiguration.hxx
+++ b/framework/inc/xml/imagesconfiguration.hxx
@@ -39,20 +39,7 @@ struct ImageItemDescriptor
 OUString  aCommandURL;// URL command to dispatch
 };
 
-typedef std::vector > 
ImageItemListDescriptor;
-
-struct ImageListItemDescriptor
-{
-std::unique_ptr
-pImageItemList;   // an array of 
ImageItemDescriptors that describes every image
-};
-
-typedef std::vector > 
ImageListDescriptor;
-
-struct ImageListsDescriptor
-{
-std::unique_ptr pImageList;
-};
+typedef std::vector ImageItemDescriptorList;
 
 class ImagesConfiguration
 {
@@ -60,12 +47,12 @@ class ImagesConfiguration
 static bool LoadImages(
 const css::uno::Reference< css::uno::XComponentContext >& 
rxContext,
 const css::uno::Reference< css::io::XInputStream >& rInputStream,
-ImageListsDescriptor& rItems );
+ImageItemDescriptorList& rItems );
 
 static bool StoreImages(
 const css::uno::Reference< css::uno::XComponentContext >& 
rxContext,
 const css::uno::Reference< css::io::XOutputStream >& rOutputStream,
-const ImageListsDescriptor& rItems );
+const ImageItemDescriptorList& rItems );
 };
 
 } // namespace framework
diff --git a/framework/inc/xml/imagesdocumenthandler.hxx 
b/framework/inc/xml/imagesdocumenthandler.hxx
index 720071d0632e..2df23a205cd3 100644
--- a/framework/inc/xml/imagesdocumenthandler.hxx
+++ b/framework/inc/xml/imagesdocumenthandler.hxx
@@ -62,7 +62,7 @@ class OReadImagesDocumentHandler : public 
::cppu::WeakImplHelper< css::xml::sax:
 IMG_NS_XLINK
 };
 
-OReadImagesDocumentHandler( ImageListsDescriptor& aItems );
+OReadImagesDocumentHandler( ImageItemDescriptorList& aItems );
 virtual ~OReadImagesDocumentHandler() override;
 
 // XDocumentHandler
@@ -101,8 +101,7 @@ class OReadImagesDocumentHandler : public 
::cppu::WeakImplHelper< css::xml::sax:
 sal_Int32   
m_nHashMaskModeBitmap;
 sal_Int32   
m_nHashMaskModeColor;
 ImageHashMapm_aImageMap;
-ImageListsDescriptor&   m_aImageList;
-ImageListItemDescriptor*m_pImages;
+ImageItemDescriptorList&m_rImageList;
 css::uno::Reference< css::xml::sax::XLocator >  m_xLocator;
 };
 
@@ -110,7 +109,7 @@ class OWriteImagesDocumentHandler final
 {
 public:
 OWriteImagesDocumentHandler(
-const ImageListsDescriptor& aItems,
+const ImageItemDescriptorList& aItems,
 css::uno::Reference< css::xml::sax::XDocumentHandler > const &
 rWriteDocumentHandler);
 ~OWriteImagesDocumentHandler();
@@ -122,13 +121,13 @@ class OWriteImagesDocumentHandler final
 private:
 /// @throws css::xml::sax::SAXException
 /// @throws css::uno::RuntimeException
-void WriteImageList( const ImageListItemDescriptor* );
+void WriteImageList( const ImageItemDescriptorList* );
 
 /// @throws css::xml::sax::SAXException
 /// @throws css::uno::RuntimeException
 void WriteImage( const ImageItemDescriptor* );
 
-const ImageListsDescriptor&   
m_aImageListsItems;
+const ImageItemDescriptorList&
m_rImageItemList;
 css::uno::Reference< css::xml::sax::XDocumentHandler >
m_xWriteDocumentHandler;
 css::uno::Reference< css::xml::sax::XAttributeList >  m_xEmptyList;
 OUString  
m_aXMLXlinkNS;
diff --git a/framework/source/uiconfiguration/imagemanagerimpl.cxx 

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

2019-06-18 Thread Arkadiy Illarionov (via logerrit)
 framework/inc/uielement/constitemcontainer.hxx|3 +--
 framework/inc/uielement/itemcontainer.hxx |3 +--
 framework/source/fwi/uielement/constitemcontainer.cxx |   13 +++--
 framework/source/fwi/uielement/itemcontainer.cxx  |   11 ++-
 framework/source/fwi/uielement/rootitemcontainer.cxx  |2 +-
 5 files changed, 8 insertions(+), 24 deletions(-)

New commits:
commit 60271c4433372097ef5ecc74e522532ebf5af8e0
Author: Arkadiy Illarionov 
AuthorDate: Wed Jun 19 00:10:12 2019 +0300
Commit: Stephan Bergmann 
CommitDate: Wed Jun 19 07:53:35 2019 +0200

tdf#39593 Remove GetImplementation from ConstItemContainer and ItemContainer

Replace with comphelper::getUnoTunnelImplementation.

Change-Id: I87e1d3afd3a742926c7054179092d3b58b6b4563
Reviewed-on: https://gerrit.libreoffice.org/74310
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann 

diff --git a/framework/inc/uielement/constitemcontainer.hxx 
b/framework/inc/uielement/constitemcontainer.hxx
index 5efc22b30fdb..9ed27693829d 100644
--- a/framework/inc/uielement/constitemcontainer.hxx
+++ b/framework/inc/uielement/constitemcontainer.hxx
@@ -56,8 +56,7 @@ class FWI_DLLPUBLIC ConstItemContainer : public 
::cppu::WeakImplHelper<
 virtual ~ConstItemContainer() override;
 
 // XUnoTunnel
-static const css::uno::Sequence< sal_Int8 >&   GetUnoTunnelId() 
throw();
-static ConstItemContainer*  
GetImplementation( const css::uno::Reference< css::uno::XInterface >& rxIFace ) 
throw();
+static const css::uno::Sequence< sal_Int8 >&   getUnoTunnelId() 
throw();
 sal_Int64   SAL_CALL 
getSomething( const css::uno::Sequence< sal_Int8 >& rIdentifier ) override;
 
 // XIndexAccess
diff --git a/framework/inc/uielement/itemcontainer.hxx 
b/framework/inc/uielement/itemcontainer.hxx
index d3fb00b56952..156d7ffd4904 100644
--- a/framework/inc/uielement/itemcontainer.hxx
+++ b/framework/inc/uielement/itemcontainer.hxx
@@ -48,8 +48,7 @@ class FWI_DLLPUBLIC ItemContainer :   public 
::cppu::WeakImplHelper< css::contai
 //  XInterface, XTypeProvider
 
 // XUnoTunnel
-static const css::uno::Sequence< sal_Int8 >&   GetUnoTunnelId() 
throw();
-static ItemContainer*   
GetImplementation( const css::uno::Reference< css::uno::XInterface >& rxIFace ) 
throw();
+static const css::uno::Sequence< sal_Int8 >&   getUnoTunnelId() 
throw();
 
 // XIndexContainer
 virtual void SAL_CALL insertByIndex( sal_Int32 Index, const 
css::uno::Any& Element ) override;
diff --git a/framework/source/fwi/uielement/constitemcontainer.cxx 
b/framework/source/fwi/uielement/constitemcontainer.cxx
index d1e45af96492..03d638f10ae6 100644
--- a/framework/source/fwi/uielement/constitemcontainer.cxx
+++ b/framework/source/fwi/uielement/constitemcontainer.cxx
@@ -151,7 +151,7 @@ Reference< XIndexAccess > 
ConstItemContainer::deepCopyContainer( const Reference
 Reference< XIndexAccess > xReturn;
 if ( rSubContainer.is() )
 {
-ItemContainer*  pSource = ItemContainer::GetImplementation( 
rSubContainer );
+ItemContainer*  pSource = 
comphelper::getUnoTunnelImplementation( rSubContainer );
 ConstItemContainer* pSubContainer( nullptr );
 if ( pSource )
 pSubContainer = new ConstItemContainer( *pSource );
@@ -166,7 +166,7 @@ Reference< XIndexAccess > 
ConstItemContainer::deepCopyContainer( const Reference
 // XUnoTunnel
 sal_Int64 ConstItemContainer::getSomething( const css::uno::Sequence< sal_Int8 
>& rIdentifier )
 {
-if( ( rIdentifier.getLength() == 16 ) && ( 0 == memcmp( 
ConstItemContainer::GetUnoTunnelId().getConstArray(), 
rIdentifier.getConstArray(), 16 ) ) )
+if( ( rIdentifier.getLength() == 16 ) && ( 0 == memcmp( 
ConstItemContainer::getUnoTunnelId().getConstArray(), 
rIdentifier.getConstArray(), 16 ) ) )
 {
 return reinterpret_cast< sal_Int64 >( this );
 }
@@ -178,18 +178,11 @@ namespace
 class theConstItemContainerUnoTunnelId : public rtl::Static< 
UnoTunnelIdInit, theConstItemContainerUnoTunnelId > {};
 }
 
-const Sequence< sal_Int8 >& ConstItemContainer::GetUnoTunnelId() throw()
+const Sequence< sal_Int8 >& ConstItemContainer::getUnoTunnelId() throw()
 {
 return theConstItemContainerUnoTunnelId::get().getSeq();
 }
 
-ConstItemContainer* ConstItemContainer::GetImplementation( const 
css::uno::Reference< css::uno::XInterface >& rxIFace ) throw()
-{
-css::uno::Reference< css::lang::XUnoTunnel > xUT( rxIFace, 
css::uno::UNO_QUERY );
-return xUT.is() ? reinterpret_cast< ConstItemContainer* 
>(sal::static_int_cast< sal_IntPtr >(
-  xUT->getSomething( 
ConstItemContainer::GetUnoTunnelId() ))) : nullptr;
-}
-
 // XElementAccess
 sal_Bool SAL_CALL ConstItemContainer::hasElements()
 {
diff --git 

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

2019-06-13 Thread Andrea Gelmini (via logerrit)
 framework/inc/services/desktop.hxx |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit f3fe9ddfcfb7bae86f53eb26fb65e41b5946af2b
Author: Andrea Gelmini 
AuthorDate: Mon Jun 10 16:56:31 2019 +
Commit: Jens Carl 
CommitDate: Fri Jun 14 04:07:33 2019 +0200

Fix typo

Change-Id: I3a1ac3d9799629ddeaeebea1ad152c0f4deaa592
Reviewed-on: https://gerrit.libreoffice.org/74001
Tested-by: Jenkins
Reviewed-by: Jens Carl 

diff --git a/framework/inc/services/desktop.hxx 
b/framework/inc/services/desktop.hxx
index faf93a6e0126..fd952e74f348 100644
--- a/framework/inc/services/desktop.hxx
+++ b/framework/inc/services/desktop.hxx
@@ -382,7 +382,7 @@ class Desktop : private cppu::BaseMutex,
   */
 bool m_bIsTerminated;
 
-/** when true, the call came form session manager
+/** when true, the call came from session manager
   *   the method is Desktop::terminateQuickstarterToo()
   *   this the only one place where set this to true
   *   In this case,  when one frame break, not make
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

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

2019-06-08 Thread Andrea Gelmini (via logerrit)
 framework/inc/helper/ocomponentaccess.hxx |4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

New commits:
commit d674e5fdb40f7c7fdc1fcc5be7da0c74c7cfb89d
Author: Andrea Gelmini 
AuthorDate: Sat Jun 8 13:38:33 2019 +
Commit: Julien Nabet 
CommitDate: Sat Jun 8 16:46:44 2019 +0200

Fix typos

Change-Id: If9ac60fd2e6b0bccd2f7f68b2acd573fac0371de
Reviewed-on: https://gerrit.libreoffice.org/73702
Reviewed-by: Julien Nabet 
Tested-by: Julien Nabet 

diff --git a/framework/inc/helper/ocomponentaccess.hxx 
b/framework/inc/helper/ocomponentaccess.hxx
index 1a9b326603a6..4e0751905a85 100644
--- a/framework/inc/helper/ocomponentaccess.hxx
+++ b/framework/inc/helper/ocomponentaccess.hxx
@@ -37,7 +37,7 @@ namespace framework{
 
 
/*-
 @short  implement XEnumerationAccess interface as helper to create 
many oneway enumeration of components
-@descr  We share mutex and framecontainer with our owner and have 
full access to his child tasks.
+@descr  We share mutex and framecontainer with our owner and have 
full access to its child tasks.
 (Our owner can be the Desktop only!) We create oneway 
enumerations on demand. These "lists"
 can be used for one time only. Step during the list from 
first to last element.
 (The type of created enumerations is 
OComponentEnumeration.)
@@ -65,7 +65,7 @@ class OComponentAccess  :   public ::cppu::WeakImplHelper< 
css::container::XEnum
 @short  constructor to initialize this instance
 @descr  A desktop will create an enumeration-access-object. An 
enumeration is a oneway-list and a
 snapshot of the components of current tasks under the 
desktop.
-But we need a instance to create more than one 
enumerations at different times!
+But we need an instance to create more than one 
enumerations at different times!
 
 @seealsoclass Desktop
 @seealsoclass OComponentEnumeration
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

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

2019-06-08 Thread Andrea Gelmini (via logerrit)
 framework/inc/jobs/jobdata.hxx |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit a0254104ba59029bfd08889d00946a6df02373c5
Author: Andrea Gelmini 
AuthorDate: Tue May 14 21:23:01 2019 +
Commit: Julien Nabet 
CommitDate: Sat Jun 8 16:46:07 2019 +0200

Fix typo

Change-Id: I4bb4fed0575e677898d351781b2ed5f44e4ad3d9
Reviewed-on: https://gerrit.libreoffice.org/73703
Reviewed-by: Julien Nabet 
Tested-by: Julien Nabet 

diff --git a/framework/inc/jobs/jobdata.hxx b/framework/inc/jobs/jobdata.hxx
index af48cea7b242..02d0075be05c 100644
--- a/framework/inc/jobs/jobdata.hxx
+++ b/framework/inc/jobs/jobdata.hxx
@@ -36,7 +36,7 @@ namespace framework{
 /**
 @short  holds all necessary information about a job and
 handle it's configuration (if any exist!)
-@descr  It can be used rom different use cases as a container
+@descr  It can be used from different use cases as a container
 (or proxy) for all config data of a registered job.
 But it doesn't implement any execute functionality!
  */
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

  1   2   3   >