[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 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 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 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 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 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/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 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/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/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 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 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 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 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/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/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/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/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 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 framework/source sfx2/source

2019-06-08 Thread Julien Nabet (via logerrit)
 framework/inc/jobs/jobdata.hxx|4 ++--
 framework/source/services/desktop.cxx |2 +-
 sfx2/source/doc/objstor.cxx   |4 ++--
 3 files changed, 5 insertions(+), 5 deletions(-)

New commits:
commit 4195323c05244688a093e95bd75c1e4d504a1a60
Author: Julien Nabet 
AuthorDate: Sat Jun 8 10:18:48 2019 +0200
Commit: Julien Nabet 
CommitDate: Sat Jun 8 10:19:32 2019 +0200

Typos

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

diff --git a/framework/inc/jobs/jobdata.hxx b/framework/inc/jobs/jobdata.hxx
index 5a8f9ce12d9d..af48cea7b242 100644
--- a/framework/inc/jobs/jobdata.hxx
+++ b/framework/inc/jobs/jobdata.hxx
@@ -151,9 +151,9 @@ class JobData final
 a job can be registered for an event.
 It can be an empty value! But it will be set from outside any 
times.
 Because it's not clear which job this instance should represent if 
an event
-(instaed of an alias) comes in. Because there can be multiple 
registrations
+(instead of an alias) comes in. Because there can be multiple 
registrations
 for this event. We use this information only, to merge it with the 
job specific
-arguments. A job can be called so, with a) it's onw config data 
and b) some dynamic
+arguments. A job can be called so, with a) its own config data and 
b) some dynamic
 environment data.
  */
 OUString m_sEvent;
diff --git a/framework/source/services/desktop.cxx 
b/framework/source/services/desktop.cxx
index 8a91db555c14..5f0ebc707292 100644
--- a/framework/source/services/desktop.cxx
+++ b/framework/source/services/desktop.cxx
@@ -182,7 +182,7 @@ Desktop::Desktop( const css::uno::Reference< 
css::uno::XComponentContext >& xCon
 
 
/*-
 @short  standard destructor
-@descr  This one do NOTHING! Use dispose() instaed of this.
+@descr  This one do NOTHING! Use dispose() instead of this.
 
 @seealsomethod dispose()
 
*//*-*/
diff --git a/sfx2/source/doc/objstor.cxx b/sfx2/source/doc/objstor.cxx
index e0feb44ccfae..009f48b27ba5 100644
--- a/sfx2/source/doc/objstor.cxx
+++ b/sfx2/source/doc/objstor.cxx
@@ -2081,7 +2081,7 @@ bool SfxObjectShell::ConvertFrom
 
 Files which are to be opened here should be opened through 'rMedium'
 to guarantee the right open modes. Especially if the format is retained
-(only possible with SfxFilterFlags::SIMULATE or SfxFilterFlags::ONW) file 
which must
+(only possible with SfxFilterFlags::SIMULATE or SfxFilterFlags::OWN) file 
which must
 be opened STREAM_SHARE_DENYWRITE.
 
 [Return value]
@@ -2444,7 +2444,7 @@ bool SfxObjectShell::ConvertTo
 
 Files which are to be opened here should be opened through 'rMedium'
 to guarantee the right open modes. Especially if the format is retained
-(only possible with SfxFilterFlags::SIMULATE or SfxFilterFlags::ONW) file 
which must
+(only possible with SfxFilterFlags::SIMULATE or SfxFilterFlags::OWN) file 
which must
 be opened STREAM_SHARE_DENYWRITE.
 
 [Return value]
___
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

2018-12-19 Thread Libreoffice Gerrit user
 framework/inc/classes/protocolhandlercache.hxx|3 +--
 framework/source/fwi/classes/protocolhandlercache.cxx |   17 -
 2 files changed, 9 insertions(+), 11 deletions(-)

New commits:
commit f9de7c851ed0326177f3f77af855bfc13b62cecd
Author: Noel Grandin 
AuthorDate: Wed Dec 19 09:34:36 2018 +0200
Commit: Noel Grandin 
CommitDate: Wed Dec 19 09:52:03 2018 +0100

HandlerCFGAccess::read should take references

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

diff --git a/framework/inc/classes/protocolhandlercache.hxx 
b/framework/inc/classes/protocolhandlercache.hxx
index 6c3d7c677ad7..7f5af88f342e 100644
--- a/framework/inc/classes/protocolhandlercache.hxx
+++ b/framework/inc/classes/protocolhandlercache.hxx
@@ -137,8 +137,7 @@ class FWI_DLLPUBLIC HandlerCFGAccess : public 
::utl::ConfigItem
 /* interface */
 public:
  HandlerCFGAccess( const OUString& sPackage  );
-void read(   std::unique_ptr& 
ppHandler ,
- std::unique_ptr& 
ppPattern );
+void read( HandlerHash& rHandlerHash, PatternHash& 
rPatternHash );
 
 void setCache(HandlerCache* pCache) {m_pCache = pCache;};
 virtual void Notify(const css::uno::Sequence< OUString >& 
lPropertyNames) override;
diff --git a/framework/source/fwi/classes/protocolhandlercache.cxx 
b/framework/source/fwi/classes/protocolhandlercache.cxx
index 6070d5c2407c..41a8d5005602 100644
--- a/framework/source/fwi/classes/protocolhandlercache.cxx
+++ b/framework/source/fwi/classes/protocolhandlercache.cxx
@@ -94,7 +94,7 @@ HandlerCache::HandlerCache()
 m_pHandler.reset(new HandlerHash);
 m_pPattern.reset(new PatternHash);
 m_pConfig.reset(new HandlerCFGAccess(PACKAGENAME_PROTOCOLHANDLER));
-m_pConfig->read(m_pHandler,m_pPattern);
+m_pConfig->read(*m_pHandler, *m_pPattern);
 m_pConfig->setCache(this);
 }
 
@@ -183,14 +183,13 @@ HandlerCFGAccess::HandlerCFGAccess( const OUString& 
sPackage )
 @descr  User use us as a wrapper between configuration api and his 
internal structures.
 He give us some pointer to his member and we fill it.
 
-@param  pHandler
-pointer to a list of protocol handler infos
+@param  rHandlerHash
+list of protocol handler infos
 
-@param  pPattern
+@param  rPatternHash
 reverse map of handler pattern to her uno names
  */
-void HandlerCFGAccess::read( std::unique_ptr& ppHandler ,
- std::unique_ptr& ppPattern )
+void HandlerCFGAccess::read( HandlerHash& rHandlerHash, PatternHash& 
rPatternHash )
 {
 // list of all uno implementation names without encoding
 css::uno::Sequence< OUString > lNames = GetNodeNames( SETNAME_HANDLER, 
::utl::ConfigNameFormat::LocalPath );
@@ -234,11 +233,11 @@ void HandlerCFGAccess::read( 
std::unique_ptr& ppHandler ,
 // register his pattern into the performance search hash
 for (auto const& item : aHandler.m_lProtocols)
 {
-(*ppPattern)[item] = lNames[nSource];
+rPatternHash[item] = lNames[nSource];
 }
 
 // insert the handler info into the normal handler cache
-(*ppHandler)[lNames[nSource]] = aHandler;
+rHandlerHash[lNames[nSource]] = aHandler;
 ++nSource;
 }
 }
@@ -248,7 +247,7 @@ void HandlerCFGAccess::Notify(const css::uno::Sequence< 
OUString >& /*lPropertyN
 std::unique_ptr pHandler(new HandlerHash);
 std::unique_ptr pPattern(new PatternHash);
 
-read(pHandler, pPattern);
+read(*pHandler, *pPattern);
 if (m_pCache)
 m_pCache->takeOver(std::move(pHandler), std::move(pPattern));
 }
___
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/source vcl/source

2018-11-28 Thread Libreoffice Gerrit user
 framework/inc/classes/framecontainer.hxx |2 +-
 framework/source/services/frame.cxx  |2 +-
 svtools/source/contnr/iconview.cxx   |4 ++--
 vcl/source/treelist/treelistbox.cxx  |4 ++--
 4 files changed, 6 insertions(+), 6 deletions(-)

New commits:
commit f0bf6a4178dfb3a75d01c4b8b48531a079b75b5b
Author: Andrea Gelmini 
AuthorDate: Fri Nov 9 07:49:16 2018 +0100
Commit: Olivier Hallot 
CommitDate: Wed Nov 28 15:33:45 2018 +0100

Fix typo deactive

Change-Id: I68a87a9435784f949f1e7b730270641bd8e05b43
Reviewed-on: https://gerrit.libreoffice.org/63149
Tested-by: Jenkins
Reviewed-by: Olivier Hallot 

diff --git a/framework/inc/classes/framecontainer.hxx 
b/framework/inc/classes/framecontainer.hxx
index 5da67fcf49ba..5a82d3f9a315 100644
--- a/framework/inc/classes/framecontainer.hxx
+++ b/framework/inc/classes/framecontainer.hxx
@@ -45,7 +45,7 @@ typedef ::std::vector< css::uno::Reference< 
css::frame::XFrame > >  TFrameContai
 @descr  Every object of frame, task or desktop hold reference to 
his children. These container is used as helper
 to do this. Some helper-classes like OFrames or 
OTasksAccess use it to. They hold a pointer to an instance
 of this class, which is a member of a frame, task or 
desktop! You can append and remove frames.
-It's possible to set one of these frames as active or 
deactive. You could have full index-access to
+It's possible to set one of these frames as active or 
deactivate. You could have full index-access to
 container-items.
 
 @devstatus  ready to use
diff --git a/framework/source/services/frame.cxx 
b/framework/source/services/frame.cxx
index 66fe3032356a..8f3c36fefbcb 100644
--- a/framework/source/services/frame.cxx
+++ b/framework/source/services/frame.cxx
@@ -2111,7 +2111,7 @@ void SAL_CALL Frame::disposing()
 // If somewhere called dispose() whitout close() before - normally no 
dialogs
 // should exist. Otherwise it's the problem of the outside caller.
 // Note:
-//  (a) Do it after stopWindowListening(). May that force some 
active/deactive
+//  (a) Do it after stopWindowListening(). May that force some 
active/deactivate
 //  notifications which we don't need here really.
 //  (b) Don't forget to save the old value of IsDialogCancelEnabled() 
to
 //  restore it afterwards (to not kill headless mode).
diff --git a/svtools/source/contnr/iconview.cxx 
b/svtools/source/contnr/iconview.cxx
index 31f80325f40d..c323a693f045 100644
--- a/svtools/source/contnr/iconview.cxx
+++ b/svtools/source/contnr/iconview.cxx
@@ -141,8 +141,8 @@ void IconView::PaintEntry(SvTreeListEntry& rEntry, long nX, 
long nY,
 if (pViewDataEntry->IsHighlighted())
 {
 Color aNewWallColor = rSettings.GetHighlightColor();
-// if the face color is bright then the deactive color is also 
bright
-// -> so you can't see any deactive selection
+// if the face color is bright then the deactivate color is also 
bright
+// -> so you can't see any deactivate selection
 if (bHideSelection && !rSettings.GetFaceColor().IsBright()
&& aWallpaper.GetColor().IsBright() != 
rSettings.GetDeactiveColor().IsBright())
 {
diff --git a/vcl/source/treelist/treelistbox.cxx 
b/vcl/source/treelist/treelistbox.cxx
index 8962b8410664..fe09ca2494cb 100644
--- a/vcl/source/treelist/treelistbox.cxx
+++ b/vcl/source/treelist/treelistbox.cxx
@@ -2715,8 +2715,8 @@ void SvTreeListBox::PaintEntry1(SvTreeListEntry& rEntry, 
long nLine, vcl::Render
 if (pViewDataEntry->IsHighlighted() && bSelTab)
 {
 Color aNewWallColor = rSettings.GetHighlightColor();
-// if the face color is bright then the deactive color is also 
bright
-// -> so you can't see any deactive selection
+// if the face color is bright then the deactivate color is also 
bright
+// -> so you can't see any deactivate selection
 if (bHideSelection && !rSettings.GetFaceColor().IsBright()
&& aWallpaper.GetColor().IsBright() != 
rSettings.GetDeactiveColor().IsBright())
 {
___
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

2018-09-04 Thread Libreoffice Gerrit user
 framework/inc/classes/protocolhandlercache.hxx|   12 +--
 framework/source/fwi/classes/protocolhandlercache.cxx |   58 ++
 2 files changed, 28 insertions(+), 42 deletions(-)

New commits:
commit d587931fba77246db3a2ccc6ab61ca77446d23f4
Author: Noel Grandin 
AuthorDate: Mon Sep 3 16:52:39 2018 +0200
Commit: Noel Grandin 
CommitDate: Tue Sep 4 09:28:20 2018 +0200

loplugin:useuniqueptr in HandlerCache

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

diff --git a/framework/inc/classes/protocolhandlercache.hxx 
b/framework/inc/classes/protocolhandlercache.hxx
index 31859fea13e0..6c3d7c677ad7 100644
--- a/framework/inc/classes/protocolhandlercache.hxx
+++ b/framework/inc/classes/protocolhandlercache.hxx
@@ -93,11 +93,11 @@ class FWI_DLLPUBLIC HandlerCache final
 private:
 
 /// list of all registered handler registered by her uno 
implementation names
-static HandlerHash* m_pHandler;
+static std::unique_ptr m_pHandler;
 /// maps URL pattern to handler names
-static PatternHash* m_pPattern;
+static std::unique_ptr m_pPattern;
 /// informs about config updates
-static HandlerCFGAccess* m_pConfig;
+static std::unique_ptr m_pConfig;
 /// ref count to construct/destruct internal member lists on demand by 
using singleton mechanism
 static sal_Int32 m_nRefCount;
 
@@ -110,7 +110,7 @@ class FWI_DLLPUBLIC HandlerCache final
 bool search( const OUString& sURL, ProtocolHandler* pReturn ) const;
 bool search( const css::util::URL&  aURL, ProtocolHandler* pReturn ) 
const;
 
-void takeOver(HandlerHash* pHandler, PatternHash* pPattern);
+void takeOver(std::unique_ptr pHandler, 
std::unique_ptr pPattern);
 };
 
 /**
@@ -137,8 +137,8 @@ class FWI_DLLPUBLIC HandlerCFGAccess : public 
::utl::ConfigItem
 /* interface */
 public:
  HandlerCFGAccess( const OUString& sPackage  );
-void read(   HandlerHash**ppHandler ,
- PatternHash**ppPattern );
+void read(   std::unique_ptr& 
ppHandler ,
+ std::unique_ptr& 
ppPattern );
 
 void setCache(HandlerCache* pCache) {m_pCache = pCache;};
 virtual void Notify(const css::uno::Sequence< OUString >& 
lPropertyNames) override;
diff --git a/framework/source/fwi/classes/protocolhandlercache.cxx 
b/framework/source/fwi/classes/protocolhandlercache.cxx
index 67cf91f4f0df..6070d5c2407c 100644
--- a/framework/source/fwi/classes/protocolhandlercache.cxx
+++ b/framework/source/fwi/classes/protocolhandlercache.cxx
@@ -73,10 +73,10 @@ 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.
  */
-HandlerHash* HandlerCache::m_pHandler  = nullptr;
-PatternHash* HandlerCache::m_pPattern  = nullptr;
+std::unique_ptr HandlerCache::m_pHandler;
+std::unique_ptr HandlerCache::m_pPattern;
 sal_Int32HandlerCache::m_nRefCount = 0;
-HandlerCFGAccess* HandlerCache::m_pConfig = nullptr;
+std::unique_ptr HandlerCache::m_pConfig;
 
 /**
 @short  ctor of the cache of all registered protocol handler
@@ -91,10 +91,10 @@ HandlerCache::HandlerCache()
 
 if (m_nRefCount==0)
 {
-m_pHandler = new HandlerHash;
-m_pPattern = new PatternHash;
-m_pConfig  = new HandlerCFGAccess(PACKAGENAME_PROTOCOLHANDLER);
-m_pConfig->read(_pHandler,_pPattern);
+m_pHandler.reset(new HandlerHash);
+m_pPattern.reset(new PatternHash);
+m_pConfig.reset(new HandlerCFGAccess(PACKAGENAME_PROTOCOLHANDLER));
+m_pConfig->read(m_pHandler,m_pPattern);
 m_pConfig->setCache(this);
 }
 
@@ -114,12 +114,9 @@ HandlerCache::~HandlerCache()
 {
 m_pConfig->setCache(nullptr);
 
-delete m_pConfig;
-delete m_pHandler;
-delete m_pPattern;
-m_pConfig = nullptr;
-m_pHandler= nullptr;
-m_pPattern= nullptr;
+m_pConfig.reset();
+m_pHandler.reset();
+m_pPattern.reset();
 }
 
 --m_nRefCount;
@@ -136,7 +133,7 @@ bool HandlerCache::search( const OUString& sURL, 
ProtocolHandler* pReturn ) cons
 
 SolarMutexGuard aGuard;
 
-PatternHash::const_iterator pItem = findPatternKey(m_pPattern, sURL);
+PatternHash::const_iterator pItem = findPatternKey(m_pPattern.get(), sURL);
 if (pItem!=m_pPattern->end())
 {
 *pReturn = (*m_pHandler)[pItem->second];
@@ -157,18 +154,12 @@ bool HandlerCache::search( const css::util::URL& aURL, 
ProtocolHandler* pReturn
 return search( aURL.Complete, pReturn );
 }
 
-void 

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

2018-08-15 Thread Libreoffice Gerrit user
 framework/inc/uielement/menubarmanager.hxx|6 +--
 framework/source/uielement/menubarmanager.cxx |   47 +-
 2 files changed, 20 insertions(+), 33 deletions(-)

New commits:
commit a84abd9e29b1920af87a1c7510bd92355594f9af
Author: Noel Grandin 
AuthorDate: Mon Aug 13 15:11:23 2018 +0200
Commit: Noel Grandin 
CommitDate: Wed Aug 15 10:10:39 2018 +0200

loplugin:useuniqueptr in MenuBarManager

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

diff --git a/framework/inc/uielement/menubarmanager.hxx 
b/framework/inc/uielement/menubarmanager.hxx
index ba77df9457ab..a1fbdb82d0fe 100644
--- a/framework/inc/uielement/menubarmanager.hxx
+++ b/framework/inc/uielement/menubarmanager.hxx
@@ -167,12 +167,12 @@ class MenuBarManager final :
 vcl::KeyCode  
aKeyCode;
 };
 
-void RetrieveShortcuts( std::vector< MenuItemHandler* >& 
aMenuShortCuts );
+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,
-  std::vector< 
MenuItemHandler* >& aMenuShortCuts );
+  std::vector< 
std::unique_ptr >& aMenuShortCuts );
 static void  MergeAddonMenus( Menu* pMenuBar, const 
MergeMenuInstructionContainer&, const OUString& aModuleIdentifier );
 
 MenuItemHandler* GetMenuItemHandler( sal_uInt16 nItemId );
@@ -195,7 +195,7 @@ class MenuBarManager final :
 VclPtr 
m_pVCLMenu;
 css::uno::Reference< css::frame::XFrame >m_xFrame;
 css::uno::Reference< css::frame::XUIControllerFactory >  
m_xPopupMenuControllerFactory;
-::std::vector< MenuItemHandler* >
m_aMenuItemHandlerVector;
+::std::vector< std::unique_ptr >
m_aMenuItemHandlerVector;
 css::uno::Reference< css::frame::XDispatchProvider > 
m_xDispatchProvider;
 css::uno::Reference< css::ui::XImageManager >
m_xDocImageManager;
 css::uno::Reference< css::ui::XImageManager >
m_xModuleImageManager;
diff --git a/framework/source/uielement/menubarmanager.cxx 
b/framework/source/uielement/menubarmanager.cxx
index a5b77e6e72f3..93c458ec15e3 100644
--- a/framework/source/uielement/menubarmanager.cxx
+++ b/framework/source/uielement/menubarmanager.cxx
@@ -184,13 +184,6 @@ void MenuBarManager::Destroy()
 m_xDeferedItemContainer.clear();
 RemoveListener();
 
-for (auto const& menuItemHandler : m_aMenuItemHandlerVector)
-{
-menuItemHandler->xMenuItemDispatch.clear();
-menuItemHandler->xSubMenuManager.clear();
-menuItemHandler->xPopupMenu.clear();
-delete menuItemHandler;
-}
 m_aMenuItemHandlerVector.clear();
 
 if ( m_bDeleteMenu )
@@ -420,7 +413,7 @@ MenuBarManager::MenuItemHandler* 
MenuBarManager::GetMenuItemHandler( sal_uInt16
 for (auto const& menuItemHandler : m_aMenuItemHandlerVector)
 {
 if ( menuItemHandler->nItemId == nItemId )
-return menuItemHandler;
+return menuItemHandler.get();
 }
 
 return nullptr;
@@ -527,7 +520,7 @@ void SAL_CALL MenuBarManager::disposing( const EventObject& 
Source )
  menuItemHandler->xMenuItemDispatch == Source.Source )
 {
 // disposing called from menu item dispatcher, remove listener
-pMenuItemDisposing = menuItemHandler;
+pMenuItemDisposing = menuItemHandler.get();
 break;
 }
 }
@@ -741,7 +734,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);
+bPopupMenu = 
CreatePopupMenuController(menuItemHandler.get());
 }
   

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

2018-07-31 Thread Libreoffice Gerrit user
 framework/inc/services/desktop.hxx |4 ++--
 framework/source/jobs/job.cxx  |8 
 framework/source/services/desktop.cxx  |8 
 framework/source/services/frame.cxx|4 ++--
 reportdesign/source/core/sdr/RptObject.cxx |4 ++--
 sot/source/sdstor/ucbstorage.cxx   |6 +++---
 sw/source/filter/ww8/docxexport.cxx|2 +-
 7 files changed, 18 insertions(+), 18 deletions(-)

New commits:
commit 1de9dc5ff788105a6de7988e5ed5cbad84e807b7
Author: Andrea Gelmini 
AuthorDate: Tue Jul 31 10:21:14 2018 +0200
Commit: Julien Nabet 
CommitDate: Tue Jul 31 11:30:58 2018 +0200

Fix typos

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

diff --git a/framework/inc/services/desktop.hxx 
b/framework/inc/services/desktop.hxx
index 09a9318a2906..04438ecc14d9 100644
--- a/framework/inc/services/desktop.hxx
+++ b/framework/inc/services/desktop.hxx
@@ -153,7 +153,7 @@ class Desktop : private cppu::BaseMutex,
 @seealsoXTerminateListener
 @seealsoXTerminateListener2
 
-@return true if all open frames could be closed and no 
listener throwed
+@return true if all open frames could be closed and no 
listener threw
 a veto exception; false otherwise.
 
 @onerrorFalse will be returned.
@@ -318,7 +318,7 @@ class Desktop : private cppu::BaseMutex,
  *  about cancel this termination request.
  *
  *  @param  [out] bVeto
- *  will be true if at least one listener throwed a veto 
exception;
+ *  will be true if at least one listener threw a veto 
exception;
  *  false otherwise.
  *
  *  @seeimpl_sendCancelTerminationEvent()
diff --git a/framework/source/jobs/job.cxx b/framework/source/jobs/job.cxx
index 047bb7170004..3082526bfb71 100644
--- a/framework/source/jobs/job.cxx
+++ b/framework/source/jobs/job.cxx
@@ -229,9 +229,9 @@ void Job::execute( /*IN*/ const css::uno::Sequence< 
css::beans::NamedValue >& lD
 if (m_eRunState == E_RUNNING)
 m_eRunState = E_STOPPED_OR_FINISHED;
 
-// If we got a close request from our frame or model ...
+// If we got a close request from our frame or model...
 // but we disagreed wit that by throwing a veto exception...
-// and got the ownership ...
+// and got the ownership...
 // we have to close the resource frame or model now -
 // and to disable ourself!
 if (m_bPendingCloseFrame)
@@ -686,8 +686,8 @@ void SAL_CALL Job::queryTermination( /*IN*/ const 
css::lang::EventObject& )
 @short  inform us about office termination
 @descr  Instead of the method queryTermination(), here is no chance to 
disagree with that.
 We have to accept it and cancel all current processes inside.
-It can occur only, if job was not already started if 
queryTermination() was called here ..
-Then we had not throwed a veto exception. But now we must agree 
with this situation and break
+It can occur only, if job was not already started if 
queryTermination() was called here.
+Then we had not thrown a veto exception. But now we must agree 
with this situation and break
 all our internal processes. It's not a good idea to mark this 
instance as non startable any longer
 inside queryTermination() if no job was running too. Because that 
would disable this job and may
 the office does not really shutdown, because another listener has 
thrown the suitable exception.
diff --git a/framework/source/services/desktop.cxx 
b/framework/source/services/desktop.cxx
index 17856a70a81b..111a3a8f0a7e 100644
--- a/framework/source/services/desktop.cxx
+++ b/framework/source/services/desktop.cxx
@@ -1748,15 +1748,15 @@ bool Desktop::impl_closeFrames(bool bAllowUI)
 ++nNonClosedFrames;
 
 // Reactivate controller.
-// It can happen that XController.suspend() returned true 
... but a registered close listener
-// throwed these veto exception. Then the controller has 
to be reactivated. Otherwise
+// It can happen that XController.suspend() returned 
true... but a registered close listener
+// threw these veto exception. Then the controller has to 
be reactivated. Otherwise
 // these document doesn't work any more.
 if ( bSuspended && xController.is())
 xController->suspend(false);
 }
 
-// If interface XClosable interface exists and was used ...
-// it's not allowed to use XComponent->dispose() also !
+// If interface XClosable interface exists and was 

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

2018-07-27 Thread Libreoffice Gerrit user
 framework/inc/dispatch/startmoduledispatcher.hxx  |5 -
 framework/inc/uielement/toolbarmerger.hxx |8 +-
 framework/source/dispatch/startmoduledispatcher.cxx   |8 +-
 framework/source/uiconfiguration/imagemanagerimpl.cxx |6 --
 framework/source/uiconfiguration/imagemanagerimpl.hxx |2 
 framework/source/uielement/toolbarmerger.cxx  |   52 +-
 6 files changed, 28 insertions(+), 53 deletions(-)

New commits:
commit a4901e73b7ec1acab95fec7a04b688368786a234
Author: Noel Grandin 
AuthorDate: Thu Jul 26 14:36:12 2018 +0200
Commit: Noel Grandin 
CommitDate: Fri Jul 27 12:24:04 2018 +0200

loplugin:returnconstant in framework

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

diff --git a/framework/inc/dispatch/startmoduledispatcher.hxx 
b/framework/inc/dispatch/startmoduledispatcher.hxx
index 6dc49f794135..8c5dc34dace6 100644
--- a/framework/inc/dispatch/startmoduledispatcher.hxx
+++ b/framework/inc/dispatch/startmoduledispatcher.hxx
@@ -105,11 +105,8 @@ class StartModuleDispatcher : public  
::cppu::WeakImplHelper<
 bool implts_isBackingModePossible();
 
 /** @short  open the special BackingComponent (now StartModule)
-
-@return [bool]
-sal_True if operation was successfully.
  */
-bool implts_establishBackingMode();
+void implts_establishBackingMode();
 
 /** @short  notify a DispatchResultListener.
 
diff --git a/framework/inc/uielement/toolbarmerger.hxx 
b/framework/inc/uielement/toolbarmerger.hxx
index 2c2890fb4e1d..802b9bd080cb 100644
--- a/framework/inc/uielement/toolbarmerger.hxx
+++ b/framework/inc/uielement/toolbarmerger.hxx
@@ -72,7 +72,7 @@ class ToolBarMerger
 public:
 static bool   IsCorrectContext( const OUString& aContext, const 
OUString& aModuleIdentifier );
 
-static bool   ConvertSeqSeqToVector( const css::uno::Sequence< 
css::uno::Sequence< css::beans::PropertyValue > >& rSequence,
+static void   ConvertSeqSeqToVector( const css::uno::Sequence< 
css::uno::Sequence< css::beans::PropertyValue > >& rSequence,
  AddonToolbarItemContainer& 
rContainer );
 
 static void   ConvertSequenceToValues( const css::uno::Sequence< 
css::beans::PropertyValue >& rSequence,
@@ -104,7 +104,7 @@ class ToolBarMerger
 const OUString&   
rMergeFallback,
 const 
AddonToolbarItemContainer& rItems );
 
-static bool   MergeItems( ToolBox*  pToolbar,
+static void   MergeItems( ToolBox*  pToolbar,
   ToolBox::ImplToolItems::size_type nPos,
   sal_uInt16nModIndex,
   sal_uInt16&   rItemId,
@@ -112,14 +112,14 @@ class ToolBarMerger
   const OUString&   
rModuleIdentifier,
   const AddonToolbarItemContainer& 
rAddonToolbarItems );
 
-static bool   ReplaceItem( ToolBox*  pToolbar,
+static void   ReplaceItem( ToolBox*  pToolbar,
ToolBox::ImplToolItems::size_type nPos,
sal_uInt16&   rItemId,
CommandToInfoMap& rCommandMap,
const OUString&   
rModuleIdentifier,
const AddonToolbarItemContainer& 
rAddonToolbarItems );
 
-static bool   RemoveItems( ToolBox*   pToolbar,
+static void   RemoveItems( ToolBox*   pToolbar,
ToolBox::ImplToolItems::size_type nPos,
const OUString&
rMergeCommandParameter );
 
diff --git a/framework/source/dispatch/startmoduledispatcher.cxx 
b/framework/source/dispatch/startmoduledispatcher.cxx
index 69dadf214b6d..f6538f701be3 100644
--- a/framework/source/dispatch/startmoduledispatcher.cxx
+++ b/framework/source/dispatch/startmoduledispatcher.cxx
@@ -67,8 +67,8 @@ void SAL_CALL 
StartModuleDispatcher::dispatchWithNotification(const css::util::U
 nResult = css::frame::DispatchResultState::FAILURE;
 if (implts_isBackingModePossible ())
 {
-if (implts_establishBackingMode ())
-nResult = css::frame::DispatchResultState::SUCCESS;
+implts_establishBackingMode ();
+nResult = css::frame::DispatchResultState::SUCCESS;
 }
 }
 
@@ -119,7 +119,7 @@ bool 

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

2018-07-26 Thread Libreoffice Gerrit user
 framework/inc/uielement/uielement.hxx|1 -
 framework/source/layoutmanager/uielement.cxx |   22 --
 framework/source/services/pathsettings.cxx   |5 -
 3 files changed, 28 deletions(-)

New commits:
commit 1d42b3da3a0649c45ec030242668e1bc159cb37c
Author: Stephan Bergmann 
AuthorDate: Thu Jul 26 12:24:10 2018 +0200
Commit: Stephan Bergmann 
CommitDate: Thu Jul 26 21:42:55 2018 +0200

framework: avoid -Werror=deprecated-copy (GCC trunk towards GCC 9)

...by removing explicitly user-provided functions that do the same as their
implicitly-defined counterparts, but may prevent implicitly declared copy
functions from being defined as non-deleted in the future.  (Even if such a
user-provided function was declared non-inline in an include file, the
apparently-used implicitly-defined copy functions are already inline, so why
bother with non-inline functions.)

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

diff --git a/framework/inc/uielement/uielement.hxx 
b/framework/inc/uielement/uielement.hxx
index 777485ce1bc5..9e63b1c0f68f 100644
--- a/framework/inc/uielement/uielement.hxx
+++ b/framework/inc/uielement/uielement.hxx
@@ -82,7 +82,6 @@ struct UIElement
m_nStyle( ButtonType::SYMBOLONLY ) {}
 
 bool operator< ( const UIElement& aUIElement ) const;
-UIElement& operator=( const UIElement& rUIElement );
 
 OUString  m_aType;
 OUString  m_aName;
diff --git a/framework/source/layoutmanager/uielement.cxx 
b/framework/source/layoutmanager/uielement.cxx
index 097911b16441..58218751528d 100644
--- a/framework/source/layoutmanager/uielement.cxx
+++ b/framework/source/layoutmanager/uielement.cxx
@@ -94,28 +94,6 @@ namespace framework
 }
 }
 
-UIElement& UIElement::operator= ( const UIElement& rUIElement )
-{
-if ( != this)
-{
-m_aType = rUIElement.m_aType;
-m_aName = rUIElement.m_aName;
-m_aUIName   = rUIElement.m_aUIName;
-m_xUIElement= rUIElement.m_xUIElement;
-m_bFloating = rUIElement.m_bFloating;
-m_bVisible  = rUIElement.m_bVisible;
-m_bUserActive   = rUIElement.m_bUserActive;
-m_bMasterHide   = rUIElement.m_bMasterHide;
-m_bContextSensitive = rUIElement.m_bContextSensitive;
-m_bNoClose  = rUIElement.m_bNoClose;
-m_bStateRead= rUIElement.m_bStateRead;
-m_nStyle= rUIElement.m_nStyle;
-m_aDockedData   = rUIElement.m_aDockedData;
-m_aFloatingData = rUIElement.m_aFloatingData;
-}
-return *this;
-}
-
 } // namespace framework
 
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/framework/source/services/pathsettings.cxx 
b/framework/source/services/pathsettings.cxx
index e047ee53057e..e3466af842ba 100644
--- a/framework/source/services/pathsettings.cxx
+++ b/framework/source/services/pathsettings.cxx
@@ -102,11 +102,6 @@ class PathSettings : private cppu::BaseMutex
 , bIsReadonly   (false)
 {}
 
-PathInfo(const PathInfo& rCopy)
-{
-takeOver(rCopy);
-}
-
 void takeOver(const PathInfo& rCopy)
 {
 sPathName  = rCopy.sPathName;
___
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

2018-06-26 Thread Stephan Bergmann
 framework/inc/xml/xmlnamespaces.hxx|5 -
 framework/source/fwe/xml/xmlnamespaces.cxx |   20 +++-
 2 files changed, 3 insertions(+), 22 deletions(-)

New commits:
commit f7aad844aab5fe424afd71b71133c74d473c5030
Author: Stephan Bergmann 
Date:   Tue Jun 26 14:05:24 2018 +0200

Clean up XMLNamespaces

...so that it no longer has a m_aXMLAttributeNamespace member that the user-
provided copy ctor did not copy.  (Which was presumably by accident, but 
appears
to not have had bad consequences due to how XMLNamespaces::adNamespace is 
only
called before the copy ctor is called in SaxNamespaceFilter::startElement,
framework/source/fwe/xml/saxnamespacefilter.cxx).

Found by new -Wdeprecated-copy of GCC trunk towards GCC 9.

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

diff --git a/framework/inc/xml/xmlnamespaces.hxx 
b/framework/inc/xml/xmlnamespaces.hxx
index f8e1369bad8a..0343f42ce6c4 100644
--- a/framework/inc/xml/xmlnamespaces.hxx
+++ b/framework/inc/xml/xmlnamespaces.hxx
@@ -31,10 +31,6 @@ namespace framework
 class FWE_DLLPUBLIC XMLNamespaces final
 {
 public:
-XMLNamespaces();
-XMLNamespaces( const XMLNamespaces& );
-~XMLNamespaces();
-
 /// @throws css::xml::sax::SAXException
 void addNamespace( const OUString& aName, const OUString& aValue );
 
@@ -50,7 +46,6 @@ class FWE_DLLPUBLIC XMLNamespaces final
 OUString const & getNamespaceValue( const OUString& aNamespace ) const;
 
 OUStringm_aDefaultNamespace;
-OUStringm_aXMLAttributeNamespace;
 NamespaceMapm_aNamespaceMap;
 };
 
diff --git a/framework/source/fwe/xml/xmlnamespaces.cxx 
b/framework/source/fwe/xml/xmlnamespaces.cxx
index 94a97eaa1f03..d56f92d4ca6a 100644
--- a/framework/source/fwe/xml/xmlnamespaces.cxx
+++ b/framework/source/fwe/xml/xmlnamespaces.cxx
@@ -25,30 +25,16 @@ using namespace ::com::sun::star::uno;
 namespace framework
 {
 
-XMLNamespaces::XMLNamespaces()
-: m_aXMLAttributeNamespace( "xmlns" )
-{
-}
-
-XMLNamespaces::XMLNamespaces( const XMLNamespaces& aXMLNamespaces )
-{
-m_aDefaultNamespace = aXMLNamespaces.m_aDefaultNamespace;
-m_aNamespaceMap = aXMLNamespaces.m_aNamespaceMap;
-}
-
-XMLNamespaces::~XMLNamespaces()
-{
-}
-
 void XMLNamespaces::addNamespace( const OUString& aName, const OUString& 
aValue )
 {
 NamespaceMap::iterator p;
 OUString aNamespaceName( aName );
-sal_Int32 nXMLNamespaceLength = m_aXMLAttributeNamespace.getLength();
 
 // delete preceding "xmlns"
-if ( aNamespaceName.startsWith( m_aXMLAttributeNamespace ) )
+constexpr char aXMLAttributeNamespace[] = "xmlns";
+if ( aNamespaceName.startsWith( aXMLAttributeNamespace ) )
 {
+constexpr sal_Int32 nXMLNamespaceLength = 
RTL_CONSTASCII_LENGTH(aXMLAttributeNamespace);
 if ( aNamespaceName.getLength() == nXMLNamespaceLength )
 {
 aNamespaceName.clear();
___
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 sfx2/source vcl/inc vcl/osx

2018-05-30 Thread Tor Lillqvist
 framework/inc/helper/persistentwindowstate.hxx|2 
 framework/source/dispatch/closedispatcher.cxx |   17 ---
 framework/source/helper/persistentwindowstate.cxx |   29 -
 sfx2/source/view/viewfrm.cxx  |   17 ---
 vcl/inc/osx/salframe.h|2 
 vcl/osx/salframe.cxx  |  118 ++
 vcl/osx/salframeview.mm   |   34 +++---
 vcl/osx/vclnsapp.mm   |2 
 8 files changed, 108 insertions(+), 113 deletions(-)

New commits:
commit c1452e73091412ba0bb72306329e1912df2ba513
Author: Tor Lillqvist 
Date:   Wed May 30 11:37:19 2018 +0300

tdf#117872: Revert "tdf#115284: Unify LibreOffice and system full-screen..."

Instead, never participate in the macOS system full-screen mode. There
is just too much complexity involved, and the way LibreOffice works
really isn't prepared for the concept of windows having the option
from a system point of view to being full-screenable or not.

This means that the green bubble in window title bars changes from
being a (system) full-screen toggle to being a maximize/restore
toggle. Sure, the "maximize" concept also probably can be confused
with LibreOffice's own full-screen concept.

For instance, the Start Centre window is not expecting to be made
full-screen. Still, when you from the Start Centre open a Writer
document, it is the *same* window that is re-used as the Writer
window, and then suddenly should be prepared to handle going
full-screen.

Also, it is up to each separate kind of document window whether it can
be made full-screen (from the LibreOffice point of view) or not.
Writer windows can, but Impress windows can't, for example. The
View>Full Screen menu entry is added separately each case.

Maybe I will come back to this mess later, or not. Anybody else is
welcome to have a go, too, of course.

This reverts commit 4b42fd7e9516fbbd8a92d97680524f32dd260fb2.

Change-Id: I6983481cbd30c0e5190c450483b1246006c80632
Reviewed-on: https://gerrit.libreoffice.org/55049
Reviewed-by: Tor Lillqvist 
Tested-by: Tor Lillqvist 

diff --git a/framework/inc/helper/persistentwindowstate.hxx 
b/framework/inc/helper/persistentwindowstate.hxx
index f9062d4344c4..e6b5c47d8c72 100644
--- a/framework/inc/helper/persistentwindowstate.hxx
+++ b/framework/inc/helper/persistentwindowstate.hxx
@@ -119,8 +119,6 @@ class PersistentWindowState :   public  
::cppu::WeakImplHelper<
 static OUString implst_getWindowStateFromConfig(const 
css::uno::Reference< css::uno::XComponentContext >& rxContext  ,
const OUString& 
   sModuleName);
 
-static bool implst_isWindowFullScreen(const css::uno::Reference< 
css::awt::XWindow >& xWindow);
-
 /** @short  retrieve the window state from the container window.
 
 @param  xWindow
diff --git a/framework/source/dispatch/closedispatcher.cxx 
b/framework/source/dispatch/closedispatcher.cxx
index 1fc959734168..ed79058194ab 100644
--- a/framework/source/dispatch/closedispatcher.cxx
+++ b/framework/source/dispatch/closedispatcher.cxx
@@ -1,4 +1,4 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4; 
fill-column: 100 -*- */
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
 /*
  * This file is part of the LibreOffice project.
  *
@@ -38,7 +38,6 @@
 #include 
 #include 
 #include 
-#include 
 #include 
 
 using namespace com::sun::star;
@@ -177,20 +176,6 @@ void SAL_CALL 
CloseDispatcher::dispatchWithNotification(const css::util::URL&
 return;
 }
 
-#ifdef MACOSX
-// FIXME: In full-screen mode, if we call ShowFullScreenMode(false) here, 
it leads to a crash
-// later, so disallow closing for now. And yes, if we don't allow closing 
a window that is in
-// full-screen mode, the menu entry should be greyed out then, too. But 
doing that looks
-// insanely hard, too. I am so tempted to just abort this and instead just 
don't even try to
-// support the system full-screen mode.
-if (m_pSysWindow)
-{
-WorkWindow *pWorkWindow = 
dynamic_cast(m_pSysWindow.get());
-if (pWorkWindow && pWorkWindow->IsFullScreenMode())
-return;
-}
-#endif
-
 if (m_pSysWindow && m_pSysWindow->GetCloseHdl().IsSet())
 {
 // The closing frame has its own close handler.  Call it instead.
diff --git a/framework/source/helper/persistentwindowstate.cxx 
b/framework/source/helper/persistentwindowstate.cxx
index e20a152a19d2..ecec7f39d63c 100644
--- a/framework/source/helper/persistentwindowstate.cxx
+++ b/framework/source/helper/persistentwindowstate.cxx
@@ -1,4 +1,4 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4; 
fill-column: 100 

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

2018-05-24 Thread Tor Lillqvist
 framework/inc/helper/persistentwindowstate.hxx|2 
 framework/source/dispatch/closedispatcher.cxx |   17 ++-
 framework/source/helper/persistentwindowstate.cxx |   29 +
 sfx2/source/view/viewfrm.cxx  |   17 ++-
 vcl/inc/osx/salframe.h|2 
 vcl/osx/salframe.cxx  |  118 +++---
 vcl/osx/salframeview.mm   |   28 ++---
 vcl/osx/vclnsapp.mm   |2 
 8 files changed, 113 insertions(+), 102 deletions(-)

New commits:
commit 4b42fd7e9516fbbd8a92d97680524f32dd260fb2
Author: Tor Lillqvist 
Date:   Wed May 23 23:21:21 2018 +0300

tdf#115284: Unify LibreOffice and system full-screen concepts on macOS

Also tdf#76476, and probably more.

Make it so that when a window is in full-screen mode from
LibreOffice's point of view, it is also full-screen from the system's
point of view, and vice versa.

All three ways to enter and leave full-screen mode can now be used
with the same end result: The Ctrl-Cmd-F shortcut, the "View > Full
Screen" menu entry, and the green bubble on the title bar.

Don't disable/deactivate/etc menus while in full-screen mode. The menu
auto-hides so there is no harm in having it function normally.

Don't display the floating toolbar with a single "Full Screen" button
in it as the way to leave full-screen mode. Instead, the same three
ways that can be used to enter full-screen mode work to leave it, too.

Sadly I could not figure out a way to set a window properly to
full-screen at the point where a document window is created and set to
be the same size as that kind of document window was the previous time
it was open in LibreOffice. Thus don't save state for full-screen
windows as we can't properly restore them. At least not for macOS. It
is not good to just restore them as non-full-screened but still at the
size they had when full-screen.

One irritating glitch remains, and I was unable to fix that properly:
I now prevent closing the document window that is in full-screen mode.
Otherwise, if it is closed, the full-screen mode remains even if no
window is open there; the desktop is completely black. Moving the
cursor to the top edge, the LibreOffice menu is there, though. I tried
to fix that but with no fully satisfying result. (Some attempts even
lead to crashes, so just disabling closing is better than crashing at
least.)

Change-Id: Id909077ef9de9f19d48c8b9ad10d748a65b2417f
Reviewed-on: https://gerrit.libreoffice.org/54760
Tested-by: Jenkins 
Reviewed-by: Tor Lillqvist 

diff --git a/framework/inc/helper/persistentwindowstate.hxx 
b/framework/inc/helper/persistentwindowstate.hxx
index e6b5c47d8c72..f9062d4344c4 100644
--- a/framework/inc/helper/persistentwindowstate.hxx
+++ b/framework/inc/helper/persistentwindowstate.hxx
@@ -119,6 +119,8 @@ class PersistentWindowState :   public  
::cppu::WeakImplHelper<
 static OUString implst_getWindowStateFromConfig(const 
css::uno::Reference< css::uno::XComponentContext >& rxContext  ,
const OUString& 
   sModuleName);
 
+static bool implst_isWindowFullScreen(const css::uno::Reference< 
css::awt::XWindow >& xWindow);
+
 /** @short  retrieve the window state from the container window.
 
 @param  xWindow
diff --git a/framework/source/dispatch/closedispatcher.cxx 
b/framework/source/dispatch/closedispatcher.cxx
index ed79058194ab..1fc959734168 100644
--- a/framework/source/dispatch/closedispatcher.cxx
+++ b/framework/source/dispatch/closedispatcher.cxx
@@ -1,4 +1,4 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4; 
fill-column: 100 -*- */
 /*
  * This file is part of the LibreOffice project.
  *
@@ -38,6 +38,7 @@
 #include 
 #include 
 #include 
+#include 
 #include 
 
 using namespace com::sun::star;
@@ -176,6 +177,20 @@ void SAL_CALL 
CloseDispatcher::dispatchWithNotification(const css::util::URL&
 return;
 }
 
+#ifdef MACOSX
+// FIXME: In full-screen mode, if we call ShowFullScreenMode(false) here, 
it leads to a crash
+// later, so disallow closing for now. And yes, if we don't allow closing 
a window that is in
+// full-screen mode, the menu entry should be greyed out then, too. But 
doing that looks
+// insanely hard, too. I am so tempted to just abort this and instead just 
don't even try to
+// support the system full-screen mode.
+if (m_pSysWindow)
+{
+WorkWindow *pWorkWindow = 
dynamic_cast(m_pSysWindow.get());
+if (pWorkWindow && pWorkWindow->IsFullScreenMode())

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

2018-04-03 Thread Stephan Bergmann
 framework/inc/uielement/notebookbarmenucontroller.hxx |   87 --
 framework/source/register/registertemp.cxx|1 
 solenv/clang-format/blacklist |1 
 3 files changed, 89 deletions(-)

New commits:
commit 96300e3292217a7c1f3ab2a302be7c7ace445e81
Author: Stephan Bergmann 
Date:   Tue Apr 3 16:43:28 2018 +0200

Remove leftover framework/inc/uielement/notebookbarmenucontroller.hxx

...after 5c573a2f7473bae7bb965ca36557cd1b0bf7b9c9 "tdf#115131 made a common
submenu for toolbars and notebookbars"

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

diff --git a/framework/inc/uielement/notebookbarmenucontroller.hxx 
b/framework/inc/uielement/notebookbarmenucontroller.hxx
deleted file mode 100644
index d06b84f766b8..
--- a/framework/inc/uielement/notebookbarmenucontroller.hxx
+++ /dev/null
@@ -1,87 +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_NOTEBOOKBARMENUCONTROLLER_HXX
-#define INCLUDED_FRAMEWORK_INC_UIELEMENT_NOTEBOOKBARMENUCONTROLLER_HXX
-
-#include 
-#include 
-
-#include 
-#include 
-#include 
-#include 
-#include 
-
-#include 
-#include 
-#include 
-#include 
-
-#include 
-
-namespace framework
-{
-class NotebookbarMenuController : public svt::PopupMenuControllerBase
-{
-using svt::PopupMenuControllerBase::disposing;
-
-public:
-NotebookbarMenuController( const css::uno::Reference< 
css::uno::XComponentContext >& xContext );
-virtual ~NotebookbarMenuController() 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 );
-
-// XPopupMenuController
-virtual void SAL_CALL setPopupMenu( const css::uno::Reference< 
css::awt::XPopupMenu >& PopupMenu ) override;
-
-// XStatusListener
-virtual void SAL_CALL statusChanged( const 
css::frame::FeatureStateEvent& Event ) override;
-
-// XMenuListener
-virtual void SAL_CALL itemSelected( const css::awt::MenuEvent& 
rEvent ) override;
-virtual void SAL_CALL itemActivated( const css::awt::MenuEvent& 
rEvent ) override;
-
-// 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( NotebookbarMenuController, ExecuteHdl_Impl, 
void*, void );
-
-private:
-void fillPopupMenu( css::uno::Reference< css::awt::XPopupMenu > 
const & rPopupMenu );
-
-css::uno::Reference< css::uno::XComponentContext >
m_xContext;
-};
-}
-
-#endif // INCLUDED_FRAMEWORK_INC_UIELEMENT_NOTEBOOKBARMENUCONTROLLER_HXX
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/framework/source/register/registertemp.cxx 
b/framework/source/register/registertemp.cxx
index c7a6000acbbc..35add0a5ef31 100644
--- a/framework/source/register/registertemp.cxx
+++ b/framework/source/register/registertemp.cxx
@@ -51,7 +51,6 @@
 #include 
 #include 
 #include 
-#include 
 
 COMPONENTGETFACTORY ( fwl,
 IFFACTORY( ::framework::MediaTypeDetectionHelper  

[Libreoffice-commits] core.git: framework/inc framework/source include/comphelper include/filter include/unotools lingucomponent/source stoc/source vcl/source

2018-02-05 Thread Manuj Vashist
 framework/inc/jobs/helponstartup.hxx |2 --
 framework/inc/jobs/shelljob.hxx  |2 --
 framework/source/inc/loadenv/targethelper.hxx|2 --
 include/comphelper/processfactory.hxx|4 
 include/comphelper/streamsection.hxx |3 ---
 include/filter/msfilter/util.hxx |3 ---
 include/unotools/streamhelper.hxx|3 ---
 include/unotools/streamsection.hxx   |3 ---
 lingucomponent/source/languageguessing/guess.hxx |3 ---
 lingucomponent/source/languageguessing/simpleguesser.hxx |3 ---
 stoc/source/corereflection/lrucache.hxx  |1 -
 vcl/source/fontsubset/ttcr.cxx   |3 ---
 12 files changed, 32 deletions(-)

New commits:
commit 68d9583db4226a61ba23398928b9416c5d8745c8
Author: Manuj Vashist 
Date:   Mon Feb 5 15:27:22 2018 +0530

tdf#108523 Removed @author annotations.

Change-Id: I6a60128c413beab6cabb857c073607e15ddbc98f
Reviewed-on: https://gerrit.libreoffice.org/49215
Reviewed-by: Samuel Mehrbrodt 
Tested-by: Samuel Mehrbrodt 

diff --git a/framework/inc/jobs/helponstartup.hxx 
b/framework/inc/jobs/helponstartup.hxx
index 4550f962e2e7..1fc65b4dd6f6 100644
--- a/framework/inc/jobs/helponstartup.hxx
+++ b/framework/inc/jobs/helponstartup.hxx
@@ -35,8 +35,6 @@ namespace framework{
 /** @short  implements a job component, which handle the special
 feature to show a suitable help page for every (visible!)
 loaded document.
-
-@author as96863
  */
 class HelpOnStartup : public ::cppu::WeakImplHelper< 
css::lang::XServiceInfo,css::lang::XEventListener,css::task::XJob >
 {
diff --git a/framework/inc/jobs/shelljob.hxx b/framework/inc/jobs/shelljob.hxx
index 4ff90039cac9..a25eb448ceb8 100644
--- a/framework/inc/jobs/shelljob.hxx
+++ b/framework/inc/jobs/shelljob.hxx
@@ -38,8 +38,6 @@ namespace framework{
 registered for. Further there is a generic
 way to configure the shell command and it's list
 of arguments.
-
-@author as96863
  */
 class ShellJob : public ::cppu::WeakImplHelper< 
css::lang::XServiceInfo,css::task::XJob >
 {
diff --git a/framework/source/inc/loadenv/targethelper.hxx 
b/framework/source/inc/loadenv/targethelper.hxx
index afa968645f66..b35caf80d04d 100644
--- a/framework/source/inc/loadenv/targethelper.hxx
+++ b/framework/source/inc/loadenv/targethelper.hxx
@@ -28,8 +28,6 @@ namespace framework{
 
 /** @short  can be used to detect, if a target name (used e.g. for 
XFrame.findFrame())
 has a special meaning or can be used as normal frame name (e.g. 
for XFrame.setName()).
-
-@author as96863
  */
 class TargetHelper
 {
diff --git a/include/comphelper/processfactory.hxx 
b/include/comphelper/processfactory.hxx
index bf4645124c12..51ba33754a98 100644
--- a/include/comphelper/processfactory.hxx
+++ b/include/comphelper/processfactory.hxx
@@ -32,8 +32,6 @@ namespace comphelper
 
 /**
  * This function set the process service factory.
- *
- * @author Juergen Schmidt
  */
 COMPHELPER_DLLPUBLIC void setProcessServiceFactory(const css::uno::Reference< 
css::lang::XMultiServiceFactory >& xSMgr);
 
@@ -41,8 +39,6 @@ COMPHELPER_DLLPUBLIC void setProcessServiceFactory(const 
css::uno::Reference< cs
  * This function gets the process service factory.
  *
  * If no service factory is set the function throws a RuntimeException.
- *
- * @author Juergen Schmidt
  */
 COMPHELPER_DLLPUBLIC css::uno::Reference< css::lang::XMultiServiceFactory > 
getProcessServiceFactory();
 
diff --git a/include/comphelper/streamsection.hxx 
b/include/comphelper/streamsection.hxx
index 4a53c85a9f8f..6c52892fde6b 100644
--- a/include/comphelper/streamsection.hxx
+++ b/include/comphelper/streamsection.hxx
@@ -31,9 +31,6 @@ namespace comphelper
 /** implements handling for compatibly reading/writing data from/into an 
input/output stream.
 data written in a block secured by this class should be readable by older 
versions which
 use the same mechanism.
-
-@author Frank Schoenheit
-@since  00/26/05
 */
 
 class COMPHELPER_DLLPUBLIC OStreamSection
diff --git a/include/filter/msfilter/util.hxx b/include/filter/msfilter/util.hxx
index 8895a4181bec..50252fc6191a 100644
--- a/include/filter/msfilter/util.hxx
+++ b/include/filter/msfilter/util.hxx
@@ -37,9 +37,6 @@ MSFILTER_DLLPUBLIC rtl_TextEncoding 
getBestTextEncodingFromLocale(const css::lan
 MSFILTER_DLLPUBLIC sal_uInt32 BGRToRGB(sal_uInt32 nColour);
 
 /** Convert from DTTM to Writer's DateTime
-
-  @author
-  mailto:mma...@openoffice.org;>Martin Maher
 {
diff --git a/include/unotools/streamsection.hxx 
b/include/unotools/streamsection.hxx
index ad45b4e12496..74626d2bed4e 100644
--- a/include/unotools/streamsection.hxx
+++ 

[Libreoffice-commits] core.git: framework/inc framework/source offapi/com sal/qa svx/source sw/source

2017-12-17 Thread Andrea Gelmini
 framework/inc/threadhelp/gate.hxx|2 +-
 framework/source/fwe/xml/xmlnamespaces.cxx   |2 +-
 framework/source/jobs/joburl.cxx |   12 ++--
 offapi/com/sun/star/frame/XLayoutManager.idl |2 +-
 sal/qa/osl/file/osl_File.cxx |2 +-
 svx/source/unodraw/unoshape.cxx  |2 +-
 sw/source/filter/ww8/ww8graf.cxx |2 +-
 7 files changed, 12 insertions(+), 12 deletions(-)

New commits:
commit 696bc1e951e785e71de74d61eeafd06c3e8a0283
Author: Andrea Gelmini 
Date:   Sun Dec 17 07:31:26 2017 +0100

Fix typos

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

diff --git a/framework/inc/threadhelp/gate.hxx 
b/framework/inc/threadhelp/gate.hxx
index eb538501b230..5928d3e16444 100644
--- a/framework/inc/threadhelp/gate.hxx
+++ b/framework/inc/threadhelp/gate.hxx
@@ -104,7 +104,7 @@ class Gate
 // Reset condition -> wait blocks now -> gate is closed
 m_aPassage.reset();
 // Check if operation was successful!
-// Check returns false if condition was reseted => m_bClosed will 
be true then => we can return true; closing ok
+// Check returns false if condition was reset => m_bClosed will be 
true then => we can return true; closing ok
 m_bClosed = !m_aPassage.check();
 }
 
diff --git a/framework/source/fwe/xml/xmlnamespaces.cxx 
b/framework/source/fwe/xml/xmlnamespaces.cxx
index 9b57861589c2..4b930ad33f20 100644
--- a/framework/source/fwe/xml/xmlnamespaces.cxx
+++ b/framework/source/fwe/xml/xmlnamespaces.cxx
@@ -66,7 +66,7 @@ void XMLNamespaces::addNamespace( const OUString& aName, 
const OUString& aValue
 
 if ( aValue.isEmpty() && !aNamespaceName.isEmpty() )
 {
-// namespace should be reseted - as xml draft states this is only 
allowed
+// namespace should be reset - as xml draft states this is only allowed
 // for the default namespace - check and throw exception if check fails
 throw SAXException( "Clearing xml namespace only allowed for default 
namespace!", Reference< XInterface >(), Any() );
 }
diff --git a/framework/source/jobs/joburl.cxx b/framework/source/jobs/joburl.cxx
index 62bd3ce8b880..fd30218dd954 100644
--- a/framework/source/jobs/joburl.cxx
+++ b/framework/source/jobs/joburl.cxx
@@ -122,7 +122,7 @@ bool JobURL::isValid() const
 @return  if an event part of the job URL exist and the out 
parameter
 sEvent was filled.
 
-@attention  The out parameter will be reseted every time. Don't use it if 
method returns !
+@attention  The out parameter will be reset every time. Don't use it if 
method returns !
 */
 bool JobURL::getEvent( /*OUT*/ OUString& sEvent ) const
 {
@@ -150,7 +150,7 @@ bool JobURL::getEvent( /*OUT*/ OUString& sEvent ) const
 @return  if an alias part of the job URL exist and the out 
parameter
 sAlias was filled.
 
-@attention  The out parameter will be reseted every time. Don't use it if 
method returns !
+@attention  The out parameter will be reset every time. Don't use it if 
method returns !
 */
 bool JobURL::getAlias( /*OUT*/ OUString& sAlias ) const
 {
@@ -178,7 +178,7 @@ bool JobURL::getAlias( /*OUT*/ OUString& sAlias ) const
 @return  if an service part of the job URL exist and the out 
parameter
 sService was filled.
 
-@attention  The out parameter will be reseted every time. Don't use it if 
method returns !
+@attention  The out parameter will be reset every time. Don't use it if 
method returns !
 */
 bool JobURL::getService( /*OUT*/ OUString& sService ) const
 {
@@ -209,12 +209,12 @@ bool JobURL::getService( /*OUT*/ OUString& sService ) 
const
 the length of the ascii value pPartIdentifier
 
 @param  rPartValue
-returns the part value if sPart was splitted 
successfully
+returns the part value if sPart was split 
successfully
 
 @param  rPartArguments
-returns the part arguments if sPart was 
splitted successfully
+returns the part arguments if sPart was split 
successfully
 
-@return  if the identifier could be found and the string was 
splitted.
+@return  if the identifier could be found and the string was 
split.
  otherwise.
 */
 bool JobURL::implst_split( /*IN*/  const OUString& sPart   ,
diff --git a/offapi/com/sun/star/frame/XLayoutManager.idl 
b/offapi/com/sun/star/frame/XLayoutManager.idl
index a6ba65dae90a..627662d8ea9c 100644
--- a/offapi/com/sun/star/frame/XLayoutManager.idl
+++ b/offapi/com/sun/star/frame/XLayoutManager.idl
@@ -84,7 +84,7 @@ interface XLayoutManager : com::sun::star::uno::XInterface
 
 
 

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

2017-11-28 Thread Henry Castro
 framework/inc/helper/mischelper.hxx |3 
 framework/source/uielement/langselectionstatusbarcontroller.cxx |  103 
+++---
 2 files changed, 78 insertions(+), 28 deletions(-)

New commits:
commit 6db709ba79fec6f75dd7385ce57c65a62fc2254e
Author: Henry Castro 
Date:   Mon Nov 27 16:39:32 2017 -0400

sc, sd: rework UI Text Language "More" button, tdf#113911

Calc and Impress handle different uno command to set language

Change-Id: Ic0ffef6a8fee5078b29873934001819a384c8f3a
Reviewed-on: https://gerrit.libreoffice.org/45366
Tested-by: Jenkins 
Reviewed-by: Henry Castro 

diff --git a/framework/inc/helper/mischelper.hxx 
b/framework/inc/helper/mischelper.hxx
index 47043b5a06bb..bbbc39869ebe 100644
--- a/framework/inc/helper/mischelper.hxx
+++ b/framework/inc/helper/mischelper.hxx
@@ -58,6 +58,9 @@ enum LangMenuIDs
 MID_LANG_SEL_NONE,
 MID_LANG_SEL_RESET,
 MID_LANG_SEL_MORE,
+MID_LANG_DEF_NONE,
+MID_LANG_DEF_RESET,
+MID_LANG_DEF_MORE,
 
 MID_LANG_PARA_SEPARATOR,
 MID_LANG_PARA_STRING,
diff --git a/framework/source/uielement/langselectionstatusbarcontroller.cxx 
b/framework/source/uielement/langselectionstatusbarcontroller.cxx
index 12321574436b..1cc23a8c1006 100644
--- a/framework/source/uielement/langselectionstatusbarcontroller.cxx
+++ b/framework/source/uielement/langselectionstatusbarcontroller.cxx
@@ -128,6 +128,7 @@ void LangSelectionStatusbarController::LangMenu(
 if (!m_bShowMenu)
 return;
 
+const Reference xModuleManager  = ModuleManager::create( 
m_xContext );
 //add context menu
 Reference< awt::XPopupMenu > xPopupMenu( awt::PopupMenu::create( 
m_xContext ) );
 //sub menu that contains all items except the last two items: Separator + 
Set Language for Paragraph
@@ -164,36 +165,65 @@ void LangSelectionStatusbarController::LangMenu(
 }
 }
 
-xPopupMenu->insertItem( MID_LANG_SEL_NONE,  FwkResId(STR_LANGSTATUS_NONE), 
0, MID_LANG_SEL_NONE );
-if ( sNone == m_aCurLang )
-xPopupMenu->checkItem( MID_LANG_SEL_NONE, true );
-xPopupMenu->insertItem( MID_LANG_SEL_RESET, 
FwkResId(STR_RESET_TO_DEFAULT_LANGUAGE), 0, MID_LANG_SEL_RESET );
-xPopupMenu->insertItem( MID_LANG_SEL_MORE,  FwkResId(STR_LANGSTATUS_MORE), 
0, MID_LANG_SEL_MORE );
 
-// add entries to submenu ('set language for paragraph')
-nItemId = static_cast< sal_Int16 >(MID_LANG_PARA_1);
-for (it = aLangItems.begin(); it != aLangItems.end(); ++it)
+if (xModuleManager->identify(m_xFrame) == "com.sun.star.text.TextDocument")
 {
-const OUString & rStr( *it );
-if( rStr != sNone &&
-rStr != sAsterisk &&
-!rStr.isEmpty()) // 'no language found' from language guessing
+xPopupMenu->insertItem( MID_LANG_SEL_NONE,  
FwkResId(STR_LANGSTATUS_NONE), 0, MID_LANG_SEL_NONE );
+if ( sNone == m_aCurLang )
+xPopupMenu->checkItem( MID_LANG_SEL_NONE, true );
+xPopupMenu->insertItem( MID_LANG_SEL_RESET, 
FwkResId(STR_RESET_TO_DEFAULT_LANGUAGE), 0, MID_LANG_SEL_RESET );
+xPopupMenu->insertItem( MID_LANG_SEL_MORE,  
FwkResId(STR_LANGSTATUS_MORE), 0, MID_LANG_SEL_MORE );
+
+// add entries to submenu ('set language for paragraph')
+nItemId = static_cast< sal_Int16 >(MID_LANG_PARA_1);
+for (it = aLangItems.begin(); it != aLangItems.end(); ++it)
 {
-SAL_WARN_IF( MID_LANG_PARA_1 > nItemId || nItemId > 
MID_LANG_PARA_9,
-"fwk.uielement", "nItemId outside of expected range!" );
-subPopupMenu->insertItem( nItemId, rStr, 0, nItemId );
-aLangMap[nItemId] = rStr;
-++nItemId;
+const OUString & rStr( *it );
+if( rStr != sNone &&
+rStr != sAsterisk &&
+!rStr.isEmpty()) // 'no language found' from language guessing
+{
+SAL_WARN_IF( MID_LANG_PARA_1 > nItemId || nItemId > 
MID_LANG_PARA_9,
+"fwk.uielement", "nItemId outside of expected range!" );
+subPopupMenu->insertItem( nItemId, rStr, 0, nItemId );
+aLangMap[nItemId] = rStr;
+++nItemId;
+}
 }
-}
-subPopupMenu->insertItem( MID_LANG_PARA_NONE,  
FwkResId(STR_LANGSTATUS_NONE), 0, MID_LANG_PARA_NONE );
-subPopupMenu->insertItem( MID_LANG_PARA_RESET, 
FwkResId(STR_RESET_TO_DEFAULT_LANGUAGE), 0, MID_LANG_PARA_RESET );
-subPopupMenu->insertItem( MID_LANG_PARA_MORE,  
FwkResId(STR_LANGSTATUS_MORE), 0, MID_LANG_PARA_MORE );
 
-// add last two entries to main menu
-xPopupMenu->insertSeparator( MID_LANG_PARA_SEPARATOR );
-xPopupMenu->insertItem( MID_LANG_PARA_STRING, 
FwkResId(STR_SET_LANGUAGE_FOR_PARAGRAPH), 0, MID_LANG_PARA_STRING );
-xPopupMenu->setPopupMenu( MID_LANG_PARA_STRING, subPopupMenu );
+// add entries to 

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

2017-09-30 Thread Maxim Monastirsky
 framework/inc/uifactory/menubarfactory.hxx  |1 
 framework/source/uielement/subtoolbarcontroller.cxx |2 
 framework/source/uielement/toolbarwrapper.cxx   |   10 +-
 framework/source/uifactory/menubarfactory.cxx   |   69 +++-
 framework/source/uifactory/statusbarfactory.cxx |2 
 framework/source/uifactory/toolbarfactory.cxx   |2 
 6 files changed, 47 insertions(+), 39 deletions(-)

New commits:
commit 4c6f17f730929e630ec2412785e2f4a8964940c7
Author: Maxim Monastirsky 
Date:   Fri Sep 29 10:54:48 2017 +0300

Wayland: Make the shapes popup work in the overflow toolbar

Was failing to show, with this warning:

Gdk-WARNING **: Tried to map a popup with a non-top most parent

To make it work, needed to implement a way to pass as extra
"ParentWindow" property to the ui element. It's documented in the
XUIElementFactory idl, but was not used by the framework impl.

Change-Id: Ifea24fc333709478634f70230699963e952e9157
Reviewed-on: https://gerrit.libreoffice.org/42937
Reviewed-by: Maxim Monastirsky 
Tested-by: Maxim Monastirsky 

diff --git a/framework/inc/uifactory/menubarfactory.hxx 
b/framework/inc/uifactory/menubarfactory.hxx
index c5a7003a2787..78e154813193 100644
--- a/framework/inc/uifactory/menubarfactory.hxx
+++ b/framework/inc/uifactory/menubarfactory.hxx
@@ -63,7 +63,6 @@ typedef ::cppu::WeakImplHelper<
 
 static void CreateUIElement(const OUString& ResourceURL
 ,const css::uno::Sequence< css::beans::PropertyValue 
>& Args
-,const char* _pExtraMode
 ,const OUString& ResourceType
 ,const css::uno::Reference< css::ui::XUIElement >& 
_xMenuBar
 ,const css::uno::Reference< 
css::uno::XComponentContext >& _rxContext);
diff --git a/framework/source/uielement/subtoolbarcontroller.cxx 
b/framework/source/uielement/subtoolbarcontroller.cxx
index 0ef2c4ab8af6..e712dd3801a5 100644
--- a/framework/source/uielement/subtoolbarcontroller.cxx
+++ b/framework/source/uielement/subtoolbarcontroller.cxx
@@ -208,6 +208,7 @@ css::uno::Reference< css::awt::XWindow > 
SubToolBarController::createPopupWindow
 
 auto aPropSeq( comphelper::InitPropertySequence( {
 { "Frame", css::uno::makeAny( xFrame ) },
+{ "ParentWindow", css::uno::makeAny( m_xParentWindow ) },
 { "Persistent", css::uno::makeAny( false ) },
 { "PopupMode", css::uno::makeAny( true ) }
 } ) );
@@ -239,7 +240,6 @@ css::uno::Reference< css::awt::XWindow > 
SubToolBarController::createPopupWindow
 if ( pTbxWindow && pTbxWindow->GetType() == 
WindowType::TOOLBOX )
 {
 ToolBox* pToolBar = static_cast< ToolBox* >( 
pTbxWindow.get() );
-pToolBar->SetParent( pToolBox );
 // calc and set size for popup mode
 Size aSize = pToolBar->CalcPopupWindowSizePixel();
 pToolBar->SetSizePixel( aSize );
diff --git a/framework/source/uielement/toolbarwrapper.cxx 
b/framework/source/uielement/toolbarwrapper.cxx
index 1f090b60760d..b5b56f0ab070 100644
--- a/framework/source/uielement/toolbarwrapper.cxx
+++ b/framework/source/uielement/toolbarwrapper.cxx
@@ -124,16 +124,16 @@ void SAL_CALL ToolBarWrapper::initialize( const Sequence< 
Any >& aArguments )
 UIConfigElementWrapperBase::initialize( aArguments );
 
 bool bPopupMode( false );
+Reference< XWindow > xParentWindow;
 for ( sal_Int32 i = 0; i < aArguments.getLength(); i++ )
 {
 PropertyValue aPropValue;
 if ( aArguments[i] >>= aPropValue )
 {
 if ( aPropValue.Name == "PopupMode" )
-{
 aPropValue.Value >>= bPopupMode;
-break;
-}
+else if ( aPropValue.Name == "ParentWindow" )
+xParentWindow.set( aPropValue.Value, UNO_QUERY );
 }
 }
 
@@ -145,7 +145,9 @@ void SAL_CALL ToolBarWrapper::initialize( const Sequence< 
Any >& aArguments )
 ToolBarManager* pToolBarManager = nullptr;
 {
 SolarMutexGuard aSolarMutexGuard;
-VclPtr pWindow = VCLUnoHelper::GetWindow( 
xFrame->getContainerWindow() );
+if ( !xParentWindow.is() )
+xParentWindow.set( xFrame->getContainerWindow() );
+VclPtr pWindow = VCLUnoHelper::GetWindow( 
xParentWindow );
 if ( pWindow )
 {
 sal_uLong nStyles = WB_LINESPACING | WB_BORDER | WB_SCROLL 
| WB_MOVEABLE | WB_3DLOOK | WB_DOCKABLE | WB_SIZEABLE | WB_CLOSEABLE;
diff --git a/framework/source/uifactory/menubarfactory.cxx 

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

2017-07-01 Thread Markus Mohrhard
 framework/inc/services/desktop.hxx|9 ++
 framework/source/services/desktop.cxx |   44 ++
 include/svtools/transfer.hxx  |8 +-
 svtools/source/misc/transfer.cxx  |   15 +++
 4 files changed, 75 insertions(+), 1 deletion(-)

New commits:
commit 7250bc4721b334714bb0fa1345211c83330f94b2
Author: Markus Mohrhard 
Date:   Fri Jun 30 23:23:36 2017 +0200

notify the clipboard terminate listener before any other terminate listener

Otherwise we may have destroyed a service that is needed to generate
one of the clipboard formats requested by the system clipboard.

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

diff --git a/framework/inc/services/desktop.hxx 
b/framework/inc/services/desktop.hxx
index 2b07a2487d97..a77c816e9d2a 100644
--- a/framework/inc/services/desktop.hxx
+++ b/framework/inc/services/desktop.hxx
@@ -341,6 +341,15 @@ class Desktop : private cppu::BaseMutex,
  */
 void impl_sendCancelTerminationEvent(const TTerminateListenerList& 
lCalledListener);
 
+/** calls notifyTermination() on the clipboard listener
+ *
+ * The system clipboard may decide that it wants copies
+ * in several formats of the clipboard content requiring
+ * nearly all the services
+ *
+ */
+void impl_sendTerminateToClipboard();
+
 /** calls notifyTermination() on every registered termination listener.
  *
  *  Note: Only normal termination listener (registered in list 
m_aListenerContainer
diff --git a/framework/source/services/desktop.cxx 
b/framework/source/services/desktop.cxx
index 7c3c2e4b80d1..e96224815441 100644
--- a/framework/source/services/desktop.cxx
+++ b/framework/source/services/desktop.cxx
@@ -324,6 +324,10 @@ sal_Bool SAL_CALL Desktop::terminate()
 aWriteLock.clear();
 /* UNSAFE AREA 
-
 */
 
+// The clipboard listener needs to be the first. It can create copies 
of the
+// existing document which needs basically all the available 
infrastructure.
+impl_sendTerminateToClipboard();
+
 impl_sendNotifyTerminationEvent();
 {
 SolarMutexGuard aGuard;
@@ -1630,6 +1634,46 @@ void Desktop::impl_sendCancelTerminationEvent(const 
Desktop::TTerminateListenerL
 }
 }
 
+void Desktop::impl_sendTerminateToClipboard()
+{
+TransactionGuard aTransaction( m_aTransactionManager, E_HARDEXCEPTIONS );
+
+::cppu::OInterfaceContainerHelper* pContainer = 
m_aListenerContainer.getContainer( 
cppu::UnoType::get());
+if ( ! pContainer )
+return;
+
+::cppu::OInterfaceIteratorHelper aIterator( *pContainer );
+while ( aIterator.hasMoreElements() )
+{
+try
+{
+css::uno::Reference< css::lang::XServiceInfo > xInfo( 
aIterator.next(), css::uno::UNO_QUERY );
+if ( !xInfo.is() )
+continue;
+
+if ( xInfo->getImplementationName() != 
"com.sun.star.comp.svt.TransferableHelperTerminateListener" )
+continue;
+
+css::uno::Reference< css::frame::XTerminateListener > 
xListener(xInfo, css::uno::UNO_QUERY);
+if ( ! xListener.is() )
+continue;
+
+css::lang::EventObject aEvent( static_cast< ::cppu::OWeakObject* 
>(this) );
+xListener->notifyTermination( aEvent );
+
+// don't notify twice
+aIterator.remove();
+}
+catch( const css::uno::Exception& )
+{
+// clean up container.
+// E.g. dead remote listener objects can make trouble otherwise.
+// Iterator implementation allows removing objects during it's 
used !
+aIterator.remove();
+}
+}
+}
+
 void Desktop::impl_sendNotifyTerminationEvent()
 {
 TransactionGuard aTransaction( m_aTransactionManager, E_HARDEXCEPTIONS );
diff --git a/include/svtools/transfer.hxx b/include/svtools/transfer.hxx
index bc3c6eceacab..f499a2a1fce4 100644
--- a/include/svtools/transfer.hxx
+++ b/include/svtools/transfer.hxx
@@ -29,6 +29,7 @@
 #include 
 #include 
 #include 
+#include 
 #include 
 #include 
 #include 
@@ -127,7 +128,7 @@ class SVT_DLLPUBLIC TransferableHelper : public 
cppu::WeakImplHelper< css::datat
 private:
 
 // nested class to implement the XTerminateListener interface
-class TerminateListener : public cppu::WeakImplHelper< 
css::frame::XTerminateListener >
+class TerminateListener : public cppu::WeakImplHelper< 
css::frame::XTerminateListener, css::lang::XServiceInfo >
 {
 private:
 
@@ -142,6 +143,11 @@ private:
 virtual void SAL_CALL queryTermination( 

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

2017-06-08 Thread Jochen Nitschke
 framework/inc/macros/xtypeprovider.hxx |   31 
 framework/source/fwe/classes/actiontriggercontainer.cxx|   24 ---
 framework/source/fwe/classes/actiontriggerpropertyset.cxx  |   69 
+
 framework/source/fwe/classes/actiontriggerseparatorpropertyset.cxx |   70 
+-
 framework/source/fwe/classes/addonsoptions.cxx |   22 ---
 framework/source/fwe/classes/rootactiontriggercontainer.cxx|   25 ---
 framework/source/fwi/uielement/constitemcontainer.cxx  |   49 
+--
 framework/source/fwi/uielement/rootitemcontainer.cxx   |   49 
+--
 framework/source/helper/uiconfigelementwrapperbase.cxx |   49 
+--
 framework/source/helper/uielementwrapperbase.cxx   |   49 
+--
 framework/source/layoutmanager/layoutmanager.cxx   |   15 --
 framework/source/services/autorecovery.cxx |   26 ---
 framework/source/services/desktop.cxx  |   23 ---
 framework/source/tabwin/tabwindow.cxx  |   49 
+--
 14 files changed, 95 insertions(+), 455 deletions(-)

New commits:
commit e4f6840d0968ff9ea8976fdd735e1ecfe266cdde
Author: Jochen Nitschke 
Date:   Wed Jun 7 19:42:35 2017 +0200

framework: replace double checked locking patterns

with thread safe local statics.

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

diff --git a/framework/inc/macros/xtypeprovider.hxx 
b/framework/inc/macros/xtypeprovider.hxx
index 473e7704869d..27f9a0546b93 100644
--- a/framework/inc/macros/xtypeprovider.hxx
+++ b/framework/inc/macros/xtypeprovider.hxx
@@ -25,7 +25,6 @@
 #include 
 #include 
 #include 
-#include 
 
 namespace framework{
 
@@ -73,31 +72,13 @@ 

 //  private
 //  complete implementation of XTypeProvider with max. 12 interfaces!
 
-#define PRIVATE_DEFINE_XTYPEPROVIDER( CLASS, TYPES )   
 \
-PRIVATE_DEFINE_XTYPEPROVIDER_GETIMPLEMENTATIONID( CLASS )  
 \
+#define PRIVATE_DEFINE_XTYPEPROVIDER( CLASS, TYPES ) \
+PRIVATE_DEFINE_XTYPEPROVIDER_GETIMPLEMENTATIONID( CLASS )\
 css::uno::Sequence< css::uno::Type > SAL_CALL CLASS::getTypes()  \
-{  
 \
-/* Optimize this method !   */ 
 \
-/* We initialize a static variable only one time.   */ 
 \
-/* And we don't must use a mutex at every call! */ 
 \
-/* For the first call; pTypeCollection is NULL -*/ 
 \
-/* for the second call pTypeCollection is different from NULL!  */ 
 \
-static ::cppu::OTypeCollection* pTypeCollection = nullptr; 
   \
-if ( pTypeCollection == nullptr )  
\
-{  
 \
-/* Ready for multithreading; get global mutex for first call of 
this method only! see before   */   \
-::osl::MutexGuard aGuard( ::osl::Mutex::getGlobalMutex() );
 \
-/* Control these pointer again ... it can be, that another 
instance will be faster then these! */   \
-if ( pTypeCollection == nullptr )  
\
-{  
 \
-/* Create a static typecollection ...   */ 
 \
-/* Attention: "TYPES" will expand to "(...)"!   */ 
 

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

2017-06-07 Thread Jochen Nitschke
 framework/inc/helper/statusindicatorfactory.hxx   |1 -
 framework/inc/uiconfiguration/globalsettings.hxx  |2 +-
 framework/inc/uiconfiguration/moduleimagemanager.hxx  |2 +-
 framework/inc/uifactory/factoryconfiguration.hxx  |2 +-
 framework/source/layoutmanager/toolbarlayoutmanager.hxx   |1 -
 framework/source/uiconfiguration/imagemanagerimpl.hxx |2 +-
 framework/source/uiconfiguration/moduleuiconfigurationmanager.cxx |1 +
 framework/source/uielement/langselectionstatusbarcontroller.cxx   |1 -
 framework/source/uifactory/addonstoolbarfactory.cxx   |1 -
 9 files changed, 5 insertions(+), 8 deletions(-)

New commits:
commit 442211903bddac7cb244dfb762623e7046b45da2
Author: Jochen Nitschke 
Date:   Wed Jun 7 16:38:51 2017 +0200

framework: cleanup xserviceinfo.hxx includes

Change-Id: Ie5addc277fd47663726199dd7b94fb7299aa4d9c
Reviewed-on: https://gerrit.libreoffice.org/38539
Tested-by: Jenkins 
Reviewed-by: Jochen Nitschke 

diff --git a/framework/inc/helper/statusindicatorfactory.hxx 
b/framework/inc/helper/statusindicatorfactory.hxx
index 8115f758ea3e..6a4737fa600a 100644
--- a/framework/inc/helper/statusindicatorfactory.hxx
+++ b/framework/inc/helper/statusindicatorfactory.hxx
@@ -26,7 +26,6 @@
 
 // include files of own module
 #include 
-#include 
 #include 
 
 // include uno interfaces
diff --git a/framework/inc/uiconfiguration/globalsettings.hxx 
b/framework/inc/uiconfiguration/globalsettings.hxx
index 56b05bb7030b..c8d87969139d 100644
--- a/framework/inc/uiconfiguration/globalsettings.hxx
+++ b/framework/inc/uiconfiguration/globalsettings.hxx
@@ -20,12 +20,12 @@
 #ifndef INCLUDED_FRAMEWORK_INC_UICONFIGURATION_GLOBALSETTINGS_HXX
 #define INCLUDED_FRAMEWORK_INC_UICONFIGURATION_GLOBALSETTINGS_HXX
 
-#include 
 #include 
 
 #include 
 #include 
 #include 
+#include 
 
 #include 
 #include 
diff --git a/framework/inc/uiconfiguration/moduleimagemanager.hxx 
b/framework/inc/uiconfiguration/moduleimagemanager.hxx
index 84b4e9679c36..c0559bfcba75 100644
--- a/framework/inc/uiconfiguration/moduleimagemanager.hxx
+++ b/framework/inc/uiconfiguration/moduleimagemanager.hxx
@@ -20,7 +20,6 @@
 #ifndef INCLUDED_FRAMEWORK_INC_UICONFIGURATION_MODULEIMAGEMANAGER_HXX
 #define INCLUDED_FRAMEWORK_INC_UICONFIGURATION_MODULEIMAGEMANAGER_HXX
 
-#include 
 #include 
 #include 
 
@@ -33,6 +32,7 @@
 #include 
 #include 
 #include 
+#include 
 #include 
 
 #include 
diff --git a/framework/inc/uifactory/factoryconfiguration.hxx 
b/framework/inc/uifactory/factoryconfiguration.hxx
index 86ee6be1e3af..1b34b38a3cb2 100644
--- a/framework/inc/uifactory/factoryconfiguration.hxx
+++ b/framework/inc/uifactory/factoryconfiguration.hxx
@@ -20,7 +20,6 @@
 #ifndef INCLUDED_FRAMEWORK_INC_UIFACTORY_FACTORYCONFIGURATION_HXX
 #define INCLUDED_FRAMEWORK_INC_UIFACTORY_FACTORYCONFIGURATION_HXX
 
-#include 
 #include 
 
 #include 
@@ -28,6 +27,7 @@
 #include 
 #include 
 #include 
+#include 
 
 #include 
 #include 
diff --git a/framework/source/layoutmanager/toolbarlayoutmanager.hxx 
b/framework/source/layoutmanager/toolbarlayoutmanager.hxx
index 7fa19574128d..5fa25c937041 100644
--- a/framework/source/layoutmanager/toolbarlayoutmanager.hxx
+++ b/framework/source/layoutmanager/toolbarlayoutmanager.hxx
@@ -25,7 +25,6 @@
 */
 #include 
 
-#include 
 #include 
 #include 
 #include 
diff --git a/framework/source/uiconfiguration/imagemanagerimpl.hxx 
b/framework/source/uiconfiguration/imagemanagerimpl.hxx
index 4c65be95afdf..8f4d3942a354 100644
--- a/framework/source/uiconfiguration/imagemanagerimpl.hxx
+++ b/framework/source/uiconfiguration/imagemanagerimpl.hxx
@@ -20,7 +20,6 @@
 #ifndef INCLUDED_FRAMEWORK_SOURCE_UICONFIGURATION_IMAGEMANAGERIMPL_HXX
 #define INCLUDED_FRAMEWORK_SOURCE_UICONFIGURATION_IMAGEMANAGERIMPL_HXX
 
-#include 
 #include 
 #include 
 
@@ -33,6 +32,7 @@
 #include 
 #include 
 #include 
+#include 
 #include 
 
 #include 
diff --git a/framework/source/uiconfiguration/moduleuiconfigurationmanager.cxx 
b/framework/source/uiconfiguration/moduleuiconfigurationmanager.cxx
index a9946b55fd3d..1b791577e438 100644
--- a/framework/source/uiconfiguration/moduleuiconfigurationmanager.cxx
+++ b/framework/source/uiconfiguration/moduleuiconfigurationmanager.cxx
@@ -49,6 +49,7 @@
 #include 
 #include 
 
+#include 
 #include 
 #include 
 #include 
diff --git a/framework/source/uielement/langselectionstatusbarcontroller.cxx 
b/framework/source/uielement/langselectionstatusbarcontroller.cxx
index 375af920..15b0b488833e 100644
--- a/framework/source/uielement/langselectionstatusbarcontroller.cxx
+++ b/framework/source/uielement/langselectionstatusbarcontroller.cxx
@@ -54,7 +54,6 @@
 #include 
 #include 
 
-#include 
 #include 
 
 #include 
diff --git a/framework/source/uifactory/addonstoolbarfactory.cxx 

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

2017-06-07 Thread Jochen Nitschke
 framework/inc/dispatch/closedispatcher.hxx  |1 -
 framework/inc/dispatch/dispatchinformationprovider.hxx  |1 -
 framework/inc/dispatch/dispatchprovider.hxx |1 -
 framework/inc/dispatch/interceptionhelper.hxx   |1 -
 framework/inc/dispatch/mailtodispatcher.hxx |1 -
 framework/inc/dispatch/oxt_handler.hxx  |1 -
 framework/inc/dispatch/popupmenudispatcher.hxx  |1 -
 framework/inc/dispatch/servicehandler.hxx   |1 -
 framework/inc/dispatch/startmoduledispatcher.hxx|1 -
 framework/inc/dispatch/systemexec.hxx   |1 -
 framework/inc/helper/dockingareadefaultacceptor.hxx |1 -
 framework/inc/helper/ocomponentaccess.hxx   |1 -
 framework/inc/helper/ocomponentenumeration.hxx  |1 -
 framework/inc/helper/oframes.hxx|1 -
 framework/inc/helper/persistentwindowstate.hxx  |1 -
 framework/inc/helper/statusindicator.hxx|2 --
 framework/inc/helper/statusindicatorfactory.hxx |1 -
 framework/inc/helper/tagwindowasmodified.hxx|1 -
 framework/inc/helper/titlebarupdate.hxx |1 -
 framework/inc/helper/uiconfigelementwrapperbase.hxx |2 --
 framework/inc/helper/uielementwrapperbase.hxx   |2 --
 framework/inc/helper/vclstatusindicator.hxx |1 -
 framework/inc/interaction/quietinteraction.hxx  |1 -
 framework/inc/jobs/helponstartup.hxx|1 -
 framework/inc/jobs/job.hxx  |1 -
 framework/inc/jobs/shelljob.hxx |1 -
 framework/inc/recording/dispatchrecorder.hxx|1 -
 framework/inc/recording/dispatchrecordersupplier.hxx|1 -
 framework/inc/services/mediatypedetectionhelper.hxx |1 -
 framework/inc/services/uriabbreviation.hxx  |1 -
 framework/inc/tabwin/tabwinfactory.hxx  |1 -
 framework/inc/uiconfiguration/globalsettings.hxx|1 -
 framework/inc/uiconfiguration/moduleimagemanager.hxx|1 -
 framework/inc/uielement/addonstoolbarmanager.hxx|1 -
 framework/inc/uielement/constitemcontainer.hxx  |2 --
 framework/inc/uielement/itemcontainer.hxx   |1 -
 framework/inc/uielement/progressbarwrapper.hxx  |1 -
 framework/inc/uielement/rootitemcontainer.hxx   |1 -
 framework/inc/uielement/statusbarmanager.hxx|1 -
 framework/inc/uielement/statusindicatorinterfacewrapper.hxx |2 --
 framework/inc/uielement/toolbarmanager.hxx  |1 -
 framework/inc/uifactory/factoryconfiguration.hxx|1 -
 framework/inc/xml/acceleratorconfigurationreader.hxx|1 -
 framework/source/inc/accelerators/acceleratorconfiguration.hxx  |1 -
 framework/source/layoutmanager/toolbarlayoutmanager.cxx |1 +
 framework/source/layoutmanager/toolbarlayoutmanager.hxx |1 -
 framework/source/uiconfiguration/imagemanagerimpl.hxx   |1 -
 framework/source/uielement/langselectionstatusbarcontroller.cxx |1 -
 framework/source/uielement/statusbarmanager.cxx |1 -
 framework/source/uielement/toolbarwrapper.cxx   |1 +
 framework/source/uifactory/addonstoolbarfactory.cxx |1 -
 51 files changed, 2 insertions(+), 54 deletions(-)

New commits:
commit f95cb2841a373cd9665f0f0462cec0efd2b544aa
Author: Jochen Nitschke 
Date:   Wed Jun 7 14:19:25 2017 +0200

framework: cleanup xinterface.hxx includes

Change-Id: I66b27e623e411c9ba9c5ba17c46c052336d031b8
Reviewed-on: https://gerrit.libreoffice.org/38503
Tested-by: Jenkins 
Reviewed-by: Jochen Nitschke 

diff --git a/framework/inc/dispatch/closedispatcher.hxx 
b/framework/inc/dispatch/closedispatcher.hxx
index 389903b959cd..2661687b5f7c 100644
--- a/framework/inc/dispatch/closedispatcher.hxx
+++ b/framework/inc/dispatch/closedispatcher.hxx
@@ -20,7 +20,6 @@
 #ifndef INCLUDED_FRAMEWORK_INC_DISPATCH_CLOSEDISPATCHER_HXX
 #define INCLUDED_FRAMEWORK_INC_DISPATCH_CLOSEDISPATCHER_HXX
 
-#include 
 #include 
 #include 
 
diff --git a/framework/inc/dispatch/dispatchinformationprovider.hxx 
b/framework/inc/dispatch/dispatchinformationprovider.hxx
index fa3aa6fc52a2..20161e3ff786 100644
--- a/framework/inc/dispatch/dispatchinformationprovider.hxx
+++ b/framework/inc/dispatch/dispatchinformationprovider.hxx
@@ -20,7 +20,6 @@
 #ifndef 

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

2017-06-07 Thread Jochen Nitschke
 framework/inc/dispatch/closedispatcher.hxx  |1 -
 framework/inc/dispatch/dispatchprovider.hxx |1 -
 framework/inc/dispatch/mailtodispatcher.hxx |1 -
 framework/inc/dispatch/oxt_handler.hxx  |1 -
 framework/inc/dispatch/popupmenudispatcher.hxx  |1 -
 framework/inc/dispatch/servicehandler.hxx   |1 -
 framework/inc/dispatch/startmoduledispatcher.hxx|1 -
 framework/inc/dispatch/systemexec.hxx   |1 -
 framework/inc/helper/dockingareadefaultacceptor.hxx |1 -
 framework/inc/helper/ocomponentaccess.hxx   |1 -
 framework/inc/helper/ocomponentenumeration.hxx  |1 -
 framework/inc/helper/oframes.hxx|1 -
 framework/inc/helper/persistentwindowstate.hxx  |1 -
 framework/inc/helper/statusindicator.hxx|1 -
 framework/inc/helper/statusindicatorfactory.hxx |1 -
 framework/inc/helper/tagwindowasmodified.hxx|1 -
 framework/inc/helper/titlebarupdate.hxx |1 -
 framework/inc/helper/uiconfigelementwrapperbase.hxx |1 -
 framework/inc/helper/uielementwrapperbase.hxx   |1 -
 framework/inc/interaction/quietinteraction.hxx  |1 -
 framework/inc/jobs/helponstartup.hxx|1 -
 framework/inc/jobs/job.hxx  |1 -
 framework/inc/jobs/shelljob.hxx |1 -
 framework/inc/recording/dispatchrecorder.hxx|1 -
 framework/inc/recording/dispatchrecordersupplier.hxx|1 -
 framework/inc/services/layoutmanager.hxx|7 +++
 framework/inc/services/mediatypedetectionhelper.hxx |1 -
 framework/inc/services/uriabbreviation.hxx  |1 -
 framework/inc/tabwin/tabwinfactory.hxx  |1 -
 framework/inc/uiconfiguration/globalsettings.hxx|1 -
 framework/inc/uiconfiguration/moduleimagemanager.hxx|1 -
 framework/inc/uielement/addonstoolbarmanager.hxx|1 -
 framework/inc/uielement/constitemcontainer.hxx  |1 -
 framework/inc/uielement/itemcontainer.hxx   |1 -
 framework/inc/uielement/menubarwrapper.hxx  |2 ++
 framework/inc/uielement/progressbarwrapper.hxx  |1 -
 framework/inc/uielement/rootitemcontainer.hxx   |1 -
 framework/inc/uielement/statusbarmanager.hxx|1 -
 framework/inc/uielement/statusindicatorinterfacewrapper.hxx |1 -
 framework/inc/uielement/toolbarmanager.hxx  |1 -
 framework/inc/uifactory/factoryconfiguration.hxx|1 -
 framework/source/inc/accelerators/acceleratorconfiguration.hxx  |1 -
 framework/source/layoutmanager/toolbarlayoutmanager.hxx |1 -
 framework/source/uiconfiguration/imagemanagerimpl.hxx   |1 -
 framework/source/uielement/langselectionstatusbarcontroller.cxx |1 -
 framework/source/uielement/statusbarmanager.cxx |1 -
 framework/source/uifactory/addonstoolbarfactory.cxx |1 -
 47 files changed, 5 insertions(+), 49 deletions(-)

New commits:
commit a83740ebcf91649ff2611582b124bf2d0ce2e133
Author: Jochen Nitschke 
Date:   Wed Jun 7 12:26:12 2017 +0200

framework: cleanup xtypeprovider.hxx includes

LayoutManager uses macro impl from comphelper, so use declarations
from comphelper too.

Change-Id: I638492849742782d48c3bb5439c2255e72f9f694
Reviewed-on: https://gerrit.libreoffice.org/38496
Reviewed-by: Noel Grandin 
Tested-by: Noel Grandin 

diff --git a/framework/inc/dispatch/closedispatcher.hxx 
b/framework/inc/dispatch/closedispatcher.hxx
index 30f181b09ae2..389903b959cd 100644
--- a/framework/inc/dispatch/closedispatcher.hxx
+++ b/framework/inc/dispatch/closedispatcher.hxx
@@ -21,7 +21,6 @@
 #define INCLUDED_FRAMEWORK_INC_DISPATCH_CLOSEDISPATCHER_HXX
 
 #include 
-#include 
 #include 
 #include 
 
diff --git a/framework/inc/dispatch/dispatchprovider.hxx 
b/framework/inc/dispatch/dispatchprovider.hxx
index 185fe8a9fc42..5e7818159a1d 100644
--- a/framework/inc/dispatch/dispatchprovider.hxx
+++ b/framework/inc/dispatch/dispatchprovider.hxx
@@ -23,7 +23,6 @@
 #include 
 
 #include 
-#include 
 #include 
 
 #include 
diff --git a/framework/inc/dispatch/mailtodispatcher.hxx 
b/framework/inc/dispatch/mailtodispatcher.hxx
index abe0d128c8e0..03084af6d3a4 100644
--- a/framework/inc/dispatch/mailtodispatcher.hxx
+++ 

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

2017-05-02 Thread Noel Grandin
 framework/inc/services/layoutmanager.hxx|2 -
 framework/inc/uielement/statusbarmerger.hxx |1 
 framework/inc/uielement/toolbarmerger.hxx   |1 
 framework/inc/xml/statusbardocumenthandler.hxx  |1 
 framework/source/fwe/xml/statusbardocumenthandler.cxx   |3 --
 framework/source/layoutmanager/layoutmanager.cxx|4 +--
 framework/source/layoutmanager/toolbarlayoutmanager.cxx |3 --
 framework/source/layoutmanager/toolbarlayoutmanager.hxx |2 -
 framework/source/services/autorecovery.cxx  |   20 
 framework/source/services/frame.cxx |   18 +-
 framework/source/services/pathsettings.cxx  |   20 +++-
 framework/source/uielement/statusbarmanager.cxx |1 
 framework/source/uielement/statusbarmerger.cxx  |1 
 framework/source/uielement/toolbarmanager.cxx   |1 
 framework/source/uielement/toolbarmerger.cxx|1 
 15 files changed, 32 insertions(+), 47 deletions(-)

New commits:
commit 666403a4b66fa94d2014b4688b2e6a7b085bd2cc
Author: Noel Grandin 
Date:   Tue May 2 10:43:19 2017 +0200

loplugin:checkunusedparams in framework

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

diff --git a/framework/inc/services/layoutmanager.hxx 
b/framework/inc/services/layoutmanager.hxx
index c24455695c13..6b151785eefa 100644
--- a/framework/inc/services/layoutmanager.hxx
+++ b/framework/inc/services/layoutmanager.hxx
@@ -209,7 +209,7 @@ namespace framework
 bool implts_resizeContainerWindow( const css::awt::Size& 
rContainerSize, const css::awt::Point& rComponentPos );
 ::Size  implts_getContainerWindowOutputSize();
 
-void implts_setDockingAreaWindowSizes( const css::awt::Rectangle& 
rBorderSpace );
+void implts_setDockingAreaWindowSizes();
 css::awt::Rectangle implts_calcDockingAreaSizes();
 bool implts_doLayout( bool bForceRequestBorderSpace, bool 
bOuterResize );
 void implts_doLayout_notify( bool bOuterResize );
diff --git a/framework/inc/uielement/statusbarmerger.hxx 
b/framework/inc/uielement/statusbarmerger.hxx
index fc296d512be8..ab5f532193f8 100644
--- a/framework/inc/uielement/statusbarmerger.hxx
+++ b/framework/inc/uielement/statusbarmerger.hxx
@@ -63,7 +63,6 @@ namespace StatusbarMerger
const AddonStatusbarItemContainer& 
rItems );
 
 bool ProcessMergeFallback( StatusBar* pStatusbar,
-  sal_uInt16 nPos,
   sal_uInt16& rItemId,
   const ::rtl::OUString& rModuleIdentifier,
   const ::rtl::OUString& rMergeCommand,
diff --git a/framework/inc/uielement/toolbarmerger.hxx 
b/framework/inc/uielement/toolbarmerger.hxx
index 665f37b3e086..2c2890fb4e1d 100644
--- a/framework/inc/uielement/toolbarmerger.hxx
+++ b/framework/inc/uielement/toolbarmerger.hxx
@@ -97,7 +97,6 @@ class ToolBarMerger
  const 
AddonToolbarItemContainer& rItems );
 
 static bool   ProcessMergeFallback( ToolBox*   
  pToolbar,
-
ToolBox::ImplToolItems::size_type nPos,
 sal_uInt16&
  rItemId,
 CommandToInfoMap&  
  rCommandMap,
 const OUString&   
rModuleIdentifier,
diff --git a/framework/inc/xml/statusbardocumenthandler.hxx 
b/framework/inc/xml/statusbardocumenthandler.hxx
index 321d3d352d85..896c71ff6fef 100644
--- a/framework/inc/xml/statusbardocumenthandler.hxx
+++ b/framework/inc/xml/statusbardocumenthandler.hxx
@@ -117,7 +117,6 @@ class FWE_DLLPUBLIC OWriteStatusBarDocumentHandler final
 /// @throws css::uno::RuntimeException
 void WriteStatusBarItem(
 const OUString& rCommandURL,
-const OUString& rHelpURL,
 sal_Int16nOffset,
 sal_Int16nStyle,
 sal_Int16nWidth );
diff --git a/framework/source/fwe/xml/statusbardocumenthandler.cxx 
b/framework/source/fwe/xml/statusbardocumenthandler.cxx
index 2122c3949400..9bc38a5d82ec 100644
--- a/framework/source/fwe/xml/statusbardocumenthandler.cxx
+++ b/framework/source/fwe/xml/statusbardocumenthandler.cxx
@@ -541,7 +541,7 @@ void 
OWriteStatusBarDocumentHandler::WriteStatusBarDocument()
 nWidth );
 
 if ( !aCommandURL.isEmpty() )
-WriteStatusBarItem( aCommandURL, aHelpURL, 

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

2017-04-26 Thread Caolán McNamara
 framework/inc/bitmaps.hlst|   19 ++
 framework/inc/classes/resource.hrc|4 ---
 framework/source/classes/resource.src |   15 --
 framework/source/uielement/popuptoolbarcontroller.cxx |7 +++---
 postprocess/CustomTarget_images.mk|1 
 5 files changed, 24 insertions(+), 22 deletions(-)

New commits:
commit 5fc07f0781d864722cc1bacc1357b317b3b5fdbb
Author: Caolán McNamara 
Date:   Tue Apr 25 21:22:07 2017 +0100

remove framework bitmaps from .src files

Change-Id: Iea85517a60874d49cdf60860071f0924b96cbf62
Reviewed-on: https://gerrit.libreoffice.org/36966
Reviewed-by: Caolán McNamara 
Tested-by: Caolán McNamara 

diff --git a/framework/inc/bitmaps.hlst b/framework/inc/bitmaps.hlst
new file mode 100644
index ..0ad598c8cb2c
--- /dev/null
+++ b/framework/inc/bitmaps.hlst
@@ -0,0 +1,19 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4; 
fill-column: 100 -*- */
+/*
+ * 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/.
+ */
+
+#ifndef INCLUDED_FRAMEWORK_INC_BITMAPS_HRC
+#define INCLUDED_FRAMEWORK_INC_BITMAPS_HRC
+
+#define BMP_SAVEMODIFIED_SMALL  "res/savemodified_small.png"
+#define BMP_SAVEMODIFIED_LARGE  "res/savemodified_large.png"
+#define BMP_SAVEMODIFIED_EXTRALARGE "res/savemodified_extralarge.png"
+
+#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab cinoptions=b1,g0,N-s 
cinkeys+=0=break: */
diff --git a/framework/inc/classes/resource.hrc 
b/framework/inc/classes/resource.hrc
index b4325e7f23ec..4c66725c370f 100644
--- a/framework/inc/classes/resource.hrc
+++ b/framework/inc/classes/resource.hrc
@@ -56,10 +56,6 @@
 #define STR_TOOLBAR_LOCK_TOOLBAR(RID_STR_START+32)
 #define STR_TOOLBAR_CLOSE_TOOLBAR   (RID_STR_START+33)
 
-#define BMP_SAVEMODIFIED_SMALL  (RID_IMAGE_START+0)
-#define BMP_SAVEMODIFIED_LARGE  (RID_IMAGE_START+1)
-#define BMP_SAVEMODIFIED_EXTRALARGE (RID_IMAGE_START+2)
-
 #define MENUITEM_TOOLBAR_VISIBLEBUTTON  1
 #define MENUITEM_TOOLBAR_CUSTOMIZETOOLBAR   2
 #define MENUITEM_TOOLBAR_DOCKTOOLBAR3
diff --git a/framework/source/classes/resource.src 
b/framework/source/classes/resource.src
index b045b6d9e029..7cec9dc7b914 100644
--- a/framework/source/classes/resource.src
+++ b/framework/source/classes/resource.src
@@ -170,19 +170,4 @@ String STR_LANGSTATUS_HINT
 Text [ en-US ] = "Text Language. Right-click to set character or paragraph 
language" ;
 };
 
-Bitmap BMP_SAVEMODIFIED_SMALL
-{
-File = "savemodified_small.png";
-};
-
-Bitmap BMP_SAVEMODIFIED_LARGE
-{
-File = "savemodified_large.png";
-};
-
-Bitmap BMP_SAVEMODIFIED_EXTRALARGE
-{
-File = "savemodified_extralarge.png";
-};
-
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/framework/source/uielement/popuptoolbarcontroller.cxx 
b/framework/source/uielement/popuptoolbarcontroller.cxx
index 7227f05bf847..87b8909d40b3 100644
--- a/framework/source/uielement/popuptoolbarcontroller.cxx
+++ b/framework/source/uielement/popuptoolbarcontroller.cxx
@@ -18,6 +18,7 @@
  */
 
 #include 
+#include "bitmaps.hlst"
 #include 
 
 #include 
@@ -496,11 +497,11 @@ void SaveToolbarController::updateImage()
 else if ( m_bModified )
 {
 if (eImageType == vcl::ImageType::Size26)
-aImage = Image(BitmapEx(FwkResId(BMP_SAVEMODIFIED_LARGE)));
+aImage = Image(BitmapEx(BMP_SAVEMODIFIED_LARGE));
 else if (eImageType == vcl::ImageType::Size32)
-aImage = Image(BitmapEx(FwkResId(BMP_SAVEMODIFIED_EXTRALARGE)));
+aImage = Image(BitmapEx(BMP_SAVEMODIFIED_EXTRALARGE));
 else
-aImage = Image(BitmapEx(FwkResId(BMP_SAVEMODIFIED_SMALL)));
+aImage = Image(BitmapEx(BMP_SAVEMODIFIED_SMALL));
 }
 
 if ( !aImage )
diff --git a/postprocess/CustomTarget_images.mk 
b/postprocess/CustomTarget_images.mk
index 17d27b1a483b..46db5aa44132 100644
--- a/postprocess/CustomTarget_images.mk
+++ b/postprocess/CustomTarget_images.mk
@@ -59,6 +59,7 @@ $(packimages_DIR)/sourceimagelist.ilst : \
$(SRCDIR)/filter/inc/bitmaps.hlst \
$(SRCDIR)/formula/inc/bitmaps.hlst \
$(SRCDIR)/fpicker/inc/bitmaps.hlst \
+   $(SRCDIR)/framework/inc/bitmaps.hlst \
$(SRCDIR)/sfx2/inc/bitmaps.hlst \
$(SRCDIR)/vcl/inc/bitmaps.hlst
grep res $^ | cut -d'"' -f2 | sed "s/^/%MODULE%\//" | sed 
"s/%MODULE%.res/%GLOBALRES%/g" > $@
___
Libreoffice-commits mailing list

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

2017-03-05 Thread Maxim Monastirsky
 framework/inc/classes/resource.hrc|1 +
 framework/source/classes/resource.src |5 +
 framework/source/uielement/popuptoolbarcontroller.cxx |8 ++--
 icon-themes/galaxy/res/savemodified_extralarge.png|binary
 4 files changed, 12 insertions(+), 2 deletions(-)

New commits:
commit 98a03d9b0d13b8f811ccf8fc1a9b7f9469ed079c
Author: Maxim Monastirsky 
Date:   Mon Mar 6 00:28:09 2017 +0200

tdf#106224 Support extra large savemodified icon

For now just duplicated the large icon in Galaxy,
to satisfy the resource compiler.

Change-Id: Icf31df0185a1ec7f080d9600b2536bcaa5d0783e

diff --git a/framework/inc/classes/resource.hrc 
b/framework/inc/classes/resource.hrc
index 83656e5..ad3d984 100644
--- a/framework/inc/classes/resource.hrc
+++ b/framework/inc/classes/resource.hrc
@@ -55,6 +55,7 @@
 
 #define BMP_SAVEMODIFIED_SMALL  (RID_IMAGE_START+0)
 #define BMP_SAVEMODIFIED_LARGE  (RID_IMAGE_START+1)
+#define BMP_SAVEMODIFIED_EXTRALARGE (RID_IMAGE_START+2)
 
 #define POPUPMENU_TOOLBAR_QUICKCUSTOMIZATION(RID_MENU_START+0)
 
diff --git a/framework/source/classes/resource.src 
b/framework/source/classes/resource.src
index 745e10e..0d3b02d 100644
--- a/framework/source/classes/resource.src
+++ b/framework/source/classes/resource.src
@@ -214,4 +214,9 @@ Bitmap BMP_SAVEMODIFIED_LARGE
 File = "savemodified_large.png";
 };
 
+Bitmap BMP_SAVEMODIFIED_EXTRALARGE
+{
+File = "savemodified_extralarge.png";
+};
+
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/framework/source/uielement/popuptoolbarcontroller.cxx 
b/framework/source/uielement/popuptoolbarcontroller.cxx
index 3fa27a8..74ff9da 100644
--- a/framework/source/uielement/popuptoolbarcontroller.cxx
+++ b/framework/source/uielement/popuptoolbarcontroller.cxx
@@ -507,8 +507,12 @@ void SaveToolbarController::updateImage()
 }
 else if ( m_bModified )
 {
-Image aResImage(BitmapEx(eImageType == vcl::ImageType::Size16 ? 
FwkResId(BMP_SAVEMODIFIED_SMALL) : FwkResId(BMP_SAVEMODIFIED_LARGE)));
-aImage = aResImage;
+if (eImageType == vcl::ImageType::Size26)
+aImage = Image(BitmapEx(FwkResId(BMP_SAVEMODIFIED_LARGE)));
+else if (eImageType == vcl::ImageType::Size32)
+aImage = Image(BitmapEx(FwkResId(BMP_SAVEMODIFIED_EXTRALARGE)));
+else
+aImage = Image(BitmapEx(FwkResId(BMP_SAVEMODIFIED_SMALL)));
 }
 
 if ( !aImage )
diff --git a/icon-themes/galaxy/res/savemodified_extralarge.png 
b/icon-themes/galaxy/res/savemodified_extralarge.png
new file mode 100644
index 000..c1052e0
Binary files /dev/null and b/icon-themes/galaxy/res/savemodified_extralarge.png 
differ
___
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

2017-02-27 Thread Stephan Bergmann
 framework/inc/uielement/menubarmanager.hxx|   20 ++-
 framework/source/uielement/menubarmanager.cxx |   33 +-
 2 files changed, 10 insertions(+), 43 deletions(-)

New commits:
commit 1683fae27e9019731534190964491b88b68b7a6e
Author: Stephan Bergmann 
Date:   Mon Feb 27 14:32:33 2017 +0100

Use WeakImplHelper to implement MenuBarManager

Change-Id: I3a30bc86796a7ad24616cb11ae10b6886e09c1e9

diff --git a/framework/inc/uielement/menubarmanager.hxx 
b/framework/inc/uielement/menubarmanager.hxx
index 040bb06..7c363dc 100644
--- a/framework/inc/uielement/menubarmanager.hxx
+++ b/framework/inc/uielement/menubarmanager.hxx
@@ -51,7 +51,7 @@
 #include 
 #include 
 #include 
-#include 
+#include 
 #include 
 #include 
 #include 
@@ -68,12 +68,13 @@ typedef std::unordered_map< OUString, PopupControllerEntry, 
OUStringHash > Popup
 
 class AddonMenu;
 class AddonPopupMenu;
-class MenuBarManager : public css::frame::XStatusListener,
-   public css::frame::XFrameActionListener   ,
-   public css::ui::XUIConfigurationListener  ,
-   public css::lang::XComponent  ,
-   public css::awt::XSystemDependentMenuPeer ,
-   public ::cppu::OWeakObject
+class MenuBarManager:
+public cppu::WeakImplHelper<
+css::frame::XStatusListener,
+css::frame::XFrameActionListener,
+css::ui::XUIConfigurationListener,
+css::lang::XComponent,
+css::awt::XSystemDependentMenuPeer>
 {
 protected:
 MenuBarManager(
@@ -96,11 +97,6 @@ class MenuBarManager : public css::frame::XStatusListener
,
 
 virtual ~MenuBarManager() override;
 
-// XInterface
-virtual void SAL_CALL acquire() throw() override;
-virtual void SAL_CALL release() throw() override;
-virtual css::uno::Any SAL_CALL queryInterface( const css::uno::Type & 
rType ) override;
-
 // XComponent
 virtual void SAL_CALL dispose() override;
 virtual void SAL_CALL addEventListener( const css::uno::Reference< 
css::lang::XEventListener >& xListener ) override;
diff --git a/framework/source/uielement/menubarmanager.cxx 
b/framework/source/uielement/menubarmanager.cxx
index 989943e..26bf92e 100644
--- a/framework/source/uielement/menubarmanager.cxx
+++ b/framework/source/uielement/menubarmanager.cxx
@@ -126,8 +126,7 @@ MenuBarManager::MenuBarManager(
 const Reference< XDispatchProvider >& rDispatchProvider,
 const OUString& rModuleIdentifier,
 Menu* pMenu, bool bDelete, bool bHasMenuBar ):
-OWeakObject()
-, m_bDisposed( false )
+m_bDisposed( false )
 , m_bRetrieveImages( false )
 , m_bAcceleratorCfg( false )
 , m_bModuleIdentified( false )
@@ -148,8 +147,7 @@ MenuBarManager::MenuBarManager(
 const Reference< XURLTransformer >& _xURLTransformer,
 Menu* pAddonMenu,
 bool popup):
-OWeakObject()
-, m_bDisposed( false )
+m_bDisposed( false )
 , m_bRetrieveImages( true )
 , m_bAcceleratorCfg( false )
 , m_bModuleIdentified( false )
@@ -163,33 +161,6 @@ MenuBarManager::MenuBarManager(
 Init(rFrame,pAddonMenu, popup);
 }
 
-Any SAL_CALL MenuBarManager::queryInterface( const Type & rType )
-{
-Any a = ::cppu::queryInterface(
-rType ,
-(static_cast< css::frame::XStatusListener* >(this)),
-(static_cast< css::frame::XFrameActionListener* >(this)),
-(static_cast< css::ui::XUIConfigurationListener* >(this)),
-(static_cast< XEventListener* >(static_cast(this))),
-(static_cast< XComponent* >(this)),
-(static_cast< css::awt::XSystemDependentMenuPeer* >(this)));
-
-if ( a.hasValue() )
-return a;
-
-return OWeakObject::queryInterface( rType );
-}
-
-void SAL_CALL MenuBarManager::acquire() throw()
-{
-OWeakObject::acquire();
-}
-
-void SAL_CALL MenuBarManager::release() throw()
-{
-OWeakObject::release();
-}
-
 Any SAL_CALL MenuBarManager::getMenuHandle( const Sequence< sal_Int8 >& 
/*ProcessId*/, sal_Int16 SystemType )
 {
 SolarMutexGuard aSolarGuard;
___
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 vcl/inc vcl/source

2017-02-12 Thread Maxim Monastirsky
 framework/inc/uielement/toolbarmanager.hxx|   11 
 framework/source/uielement/addonstoolbarmanager.cxx   |1 
 framework/source/uielement/popuptoolbarcontroller.cxx |   10 
 framework/source/uielement/subtoolbarcontroller.cxx   |1 
 framework/source/uielement/toolbarmanager.cxx |  217 +-
 include/vcl/toolbox.hxx   |   10 
 vcl/inc/toolbox.h |1 
 vcl/source/window/floatwin.cxx|   14 -
 vcl/source/window/toolbox.cxx |   20 +
 vcl/source/window/toolbox2.cxx|   48 +--
 10 files changed, 185 insertions(+), 148 deletions(-)

New commits:
commit 81d4fbc0daa54889ccb09e6a3fadff9c70d99448
Author: Maxim Monastirsky 
Date:   Sun Feb 12 22:14:48 2017 +0200

tdf#42029 Use a floating toolbar to show clipped items

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

diff --git a/framework/inc/uielement/toolbarmanager.hxx 
b/framework/inc/uielement/toolbarmanager.hxx
index 739d22f..9876d6b 100644
--- a/framework/inc/uielement/toolbarmanager.hxx
+++ b/framework/inc/uielement/toolbarmanager.hxx
@@ -94,6 +94,7 @@ class ToolBarManager : public ToolbarManager_Base
 void CheckAndUpdateImages();
 virtual void RefreshImages();
 void FillToolbar( const css::uno::Reference< 
css::container::XIndexAccess >& rToolBarData );
+void FillOverflowToolbar( ToolBox* pParent );
 void notifyRegisteredControllers( const OUString& aUIElementName, 
const OUString& aCommand );
 void Destroy();
 
@@ -113,8 +114,6 @@ class ToolBarManager : public ToolbarManager_Base
 };
 
 protected:
-DECL_LINK( Command, CommandEvent const *, void );
-PopupMenu * GetToolBarCustomMenu(ToolBox* pToolBar);
 DECL_LINK(Click, ToolBox *, void);
 DECL_LINK(DropdownClick, ToolBox *, void);
 DECL_LINK(DoubleClick, ToolBox *, void);
@@ -124,13 +123,16 @@ class ToolBarManager : public ToolbarManager_Base
 DECL_LINK( MiscOptionsChanged, LinkParamNone*, void );
 
 DECL_LINK( MenuButton, ToolBox *, void );
+DECL_LINK( MenuPreExecute, ToolBox *, void );
 DECL_LINK( MenuSelect, Menu *, bool );
-void MenuDeactivated();
 DECL_LINK(AsyncUpdateControllersHdl, Timer *, void);
+DECL_LINK( OverflowEventListener, VclWindowEvent&, void );
 DECL_STATIC_LINK( ToolBarManager, ExecuteHdl_Impl, void*, void );
 
 virtual bool MenuItemAllowed( sal_uInt16 ) const;
 
+void AddCustomizeMenuItems(ToolBox* pToolBar);
+void InitImageManager();
 void RemoveControllers();
 void CreateControllers();
 void UpdateControllers();
@@ -138,7 +140,6 @@ class ToolBarManager : public ToolbarManager_Base
 void UpdateController( const css::uno::Reference< 
css::frame::XToolbarController >& xController);
 //end
 void AddFrameActionListener();
-void ImplClearPopupMenu( ToolBox *pToolBar );
 void RequestImages();
 ToolBoxItemBits ConvertStyleToToolboxItemBits( sal_Int32 nStyle );
 css::uno::Reference< css::frame::XModel > GetModelFromFrame() const;
@@ -178,6 +179,8 @@ class ToolBarManager : public ToolbarManager_Base
 SubToolBarToSubToolBarControllerMap  
m_aSubToolBarControllerMap;
 Timer
m_aAsyncUpdateControllersTimer;
 OUString 
m_sIconTheme;
+
+rtl::Reference< ToolBarManager > 
m_aOverflowManager;
 };
 
 }
diff --git a/framework/source/uielement/addonstoolbarmanager.cxx 
b/framework/source/uielement/addonstoolbarmanager.cxx
index 9458d2f..4f8a4f6 100644
--- a/framework/source/uielement/addonstoolbarmanager.cxx
+++ b/framework/source/uielement/addonstoolbarmanager.cxx
@@ -82,7 +82,6 @@ AddonsToolBarManager::AddonsToolBarManager( const Reference< 
XComponentContext >
 m_pToolBar->SetSelectHdl( LINK( this, AddonsToolBarManager, Select) );
 m_pToolBar->SetClickHdl( LINK( this, AddonsToolBarManager, Click ) );
 m_pToolBar->SetDoubleClickHdl( LINK( this, AddonsToolBarManager, 
DoubleClick ) );
-m_pToolBar->SetCommandHdl( LINK( this, AddonsToolBarManager, Command ) );
 m_pToolBar->SetStateChangedHdl( LINK( this, AddonsToolBarManager, 
StateChanged ) );
 m_pToolBar->SetDataChangedHdl( LINK( this, AddonsToolBarManager, 
DataChanged ) );
 }
diff --git a/framework/source/uielement/popuptoolbarcontroller.cxx 
b/framework/source/uielement/popuptoolbarcontroller.cxx
index b04c831..34b3a39 100644
--- a/framework/source/uielement/popuptoolbarcontroller.cxx
+++ 

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

2017-02-07 Thread Juergen Funk
 framework/inc/services/desktop.hxx|   17 +++--
 framework/source/services/desktop.cxx |   10 +-
 2 files changed, 24 insertions(+), 3 deletions(-)

New commits:
commit d8ccf8cf7a604cb1df04f23b5b5036fff1d4afdb
Author: Juergen Funk 
Date:   Thu Dec 8 12:25:50 2016 +0100

Stop question in context of session manager when cancel a frame

When shutdown or logout, LO make the question for all open
windows, but when you cancel a window the question for the other
windows are not necessary, this patch breaks the other questions.

 in dependency of tdf#104101

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

diff --git a/framework/inc/services/desktop.hxx 
b/framework/inc/services/desktop.hxx
index ee2d576..4b6dbc0 100644
--- a/framework/inc/services/desktop.hxx
+++ b/framework/inc/services/desktop.hxx
@@ -373,8 +373,21 @@ class Desktop : private cppu::BaseMutex,
 
 private:
 
-bool m_bIsTerminated;  /// check flag to protect us against dispose 
before terminate!
-/// see dispose() for further information!
+/** check flag to protect us against dispose before terminate!
+  *   see dispose() for further information!
+  */
+bool m_bIsTerminated;
+
+/** when true, the call came form session manager
+  *   the methode is Desktop::terminateQuickstarterToo()
+  *   this the only one place where set this to true
+  *   In this case,  when one frame break, not make
+  *   question for other, the break of shutdown or logout
+  *   can be only once.
+  *   In Desktop::impl_closeFrames would be test and break
+  *   the loop and reset to false
+  */
+bool m_bSession;
 
 css::uno::Reference< css::uno::XComponentContext >  
m_xContext;   /// reference to factory, which has create this 
instance
 FrameContainer  
m_aChildTaskContainer;/// array of child tasks (children of desktop are 
tasks; and tasks are also frames - But pure frames are not accepted!)
diff --git a/framework/source/services/desktop.cxx 
b/framework/source/services/desktop.cxx
index e5133a7..b210434 100644
--- a/framework/source/services/desktop.cxx
+++ b/framework/source/services/desktop.cxx
@@ -158,6 +158,7 @@ Desktop::Desktop( const css::uno::Reference< 
css::uno::XComponentContext >& xCon
 ,   cppu::OPropertySetHelper( 
cppu::WeakComponentImplHelperBase::rBHelper   )
 // Init member
 ,   m_bIsTerminated ( false
 )   // see dispose() for further information!
+,   m_bSession  ( false
 )
 ,   m_xContext  ( xContext 
 )
 ,   m_aChildTaskContainer   (  
 )
 ,   m_aListenerContainer( m_aMutex )
@@ -389,6 +390,7 @@ namespace
 bool SAL_CALL Desktop::terminateQuickstarterToo()
 {
 QuickstartSuppressor aQuickstartSuppressor(this, m_xQuickLauncher);
+m_bSession = true;
 return terminate();
 }
 
@@ -1702,7 +1704,10 @@ bool Desktop::impl_closeFrames(bool bAllowUI)
 if ( ! bSuspended )
 {
 ++nNonClosedFrames;
-continue;
+if(m_bSession)
+break;
+else
+continue;
 }
 }
 
@@ -1754,6 +1759,9 @@ bool Desktop::impl_closeFrames(bool bAllowUI)
 }
 }
 
+// reset the session
+m_bSession = false;
+
 return (nNonClosedFrames < 1);
 }
 
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


  1   2   >