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

2023-11-10 Thread Noel Grandin (via logerrit)
 framework/inc/uielement/addonstoolbarwrapper.hxx|5 ++--
 framework/inc/uielement/menubarmanager.hxx  |4 +--
 framework/source/uielement/addonstoolbarwrapper.cxx |   20 
 framework/source/uielement/menubarmanager.cxx   |   25 +++-
 4 files changed, 20 insertions(+), 34 deletions(-)

New commits:
commit 28756e84e48330b12087f6fc7d043c2fc5d67f28
Author: Noel Grandin 
AuthorDate: Wed Nov 8 15:18:22 2023 +0200
Commit: Noel Grandin 
CommitDate: Fri Nov 10 12:36:48 2023 +0100

loplugin:fieldcast in framework::AddonsToolBarWrapper

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

diff --git a/framework/inc/uielement/addonstoolbarwrapper.hxx 
b/framework/inc/uielement/addonstoolbarwrapper.hxx
index 68cfc0ff31d0..fc09465eea5a 100644
--- a/framework/inc/uielement/addonstoolbarwrapper.hxx
+++ b/framework/inc/uielement/addonstoolbarwrapper.hxx
@@ -20,12 +20,13 @@
 #pragma once
 
 #include 
-
+#include 
 #include 
 #include 
 
 namespace framework
 {
+class ToolBarManager;
 
 class AddonsToolBarWrapper final : public UIElementWrapperBase
 {
@@ -47,7 +48,7 @@ class AddonsToolBarWrapper final : public UIElementWrapperBase
 
 private:
 css::uno::Reference< css::uno::XComponentContext > 
   m_xContext;
-css::uno::Reference< css::lang::XComponent >   
   m_xToolBarManager;
+rtl::Reference< ToolBarManager >   
   m_xToolBarManager;
 css::uno::Sequence< css::uno::Sequence< css::beans::PropertyValue > >  
   m_aConfigData;
 bool   
   m_bCreatedImages;
 };
diff --git a/framework/source/uielement/addonstoolbarwrapper.cxx 
b/framework/source/uielement/addonstoolbarwrapper.cxx
index 6547d1c6bcde..f0bb99549fcf 100644
--- a/framework/source/uielement/addonstoolbarwrapper.cxx
+++ b/framework/source/uielement/addonstoolbarwrapper.cxx
@@ -134,14 +134,10 @@ Reference< XInterface > SAL_CALL 
AddonsToolBarWrapper::getRealInterface()
 {
 SolarMutexGuard g;
 
-if ( m_xToolBarManager.is() )
+if ( m_xToolBarManager )
 {
-ToolBarManager* pToolBarManager = static_cast< ToolBarManager *>( 
m_xToolBarManager.get() );
-if ( pToolBarManager )
-{
-vcl::Window* pWindow = pToolBarManager->GetToolBar();
-return Reference< XInterface >( VCLUnoHelper::GetInterface( 
pWindow ), UNO_QUERY );
-}
+vcl::Window* pWindow = m_xToolBarManager->GetToolBar();
+return Reference< XInterface >( VCLUnoHelper::GetInterface( pWindow ), 
UNO_QUERY );
 }
 
 return Reference< XInterface >();
@@ -155,14 +151,10 @@ void AddonsToolBarWrapper::populateImages()
 if (m_bCreatedImages)
 return;
 
-if ( m_xToolBarManager.is() )
+if (m_xToolBarManager)
 {
-ToolBarManager* pToolBarManager = static_cast< ToolBarManager *>( 
m_xToolBarManager.get() );
-if (pToolBarManager)
-{
-pToolBarManager->RequestImages();
-m_bCreatedImages = true;
-}
+m_xToolBarManager->RequestImages();
+m_bCreatedImages = true;
 }
 }
 
commit e88c98f81c7ff515c3cf44db43c4961a1050a03b
Author: Noel Grandin 
AuthorDate: Wed Nov 8 15:17:02 2023 +0200
Commit: Noel Grandin 
CommitDate: Fri Nov 10 12:36:41 2023 +0100

loplugin:fieldcast in framework::MenuBarManager::MenuItemHandler

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

diff --git a/framework/inc/uielement/menubarmanager.hxx 
b/framework/inc/uielement/menubarmanager.hxx
index 61bec0443240..7036be08a21b 100644
--- a/framework/inc/uielement/menubarmanager.hxx
+++ b/framework/inc/uielement/menubarmanager.hxx
@@ -131,7 +131,7 @@ class MenuBarManager final :
 struct MenuItemHandler
 {
 MenuItemHandler( sal_uInt16 aItemId,
- css::uno::Reference< css::frame::XStatusListener 
> xManager,
+ rtl::Reference< MenuBarManager > xManager,
  css::uno::Reference< css::frame::XDispatch > 
xDispatch ) :
  nItemId( aItemId ),
  bMadeInvisible ( false ),
@@ -143,7 +143,7 @@ class MenuBarManager final :
 OUString  
aTargetFrame;
 OUString  
aMenuItemURL;
 OUString  
aParsedItemURL;
-css::uno::Reference< css::frame::XStatusListener >
xSubMenuManager;
+

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

2023-11-10 Thread Noel Grandin (via logerrit)
 framework/inc/uielement/menubarwrapper.hxx|4 ++--
 framework/source/uielement/menubarwrapper.cxx |   17 ++---
 include/xmloff/XMLPageExport.hxx  |4 ++--
 xmloff/source/style/XMLPageExport.cxx |3 +--
 4 files changed, 11 insertions(+), 17 deletions(-)

New commits:
commit d294d1a32d88174559bd4490a8ee44bc5bb604ea
Author: Noel Grandin 
AuthorDate: Wed Nov 8 13:38:47 2023 +0200
Commit: Noel Grandin 
CommitDate: Fri Nov 10 12:35:26 2023 +0100

loplugin:fieldcast in XMLPageExport

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

diff --git a/include/xmloff/XMLPageExport.hxx b/include/xmloff/XMLPageExport.hxx
index ba06efc38e08..0a1d7c1cfd23 100644
--- a/include/xmloff/XMLPageExport.hxx
+++ b/include/xmloff/XMLPageExport.hxx
@@ -38,7 +38,7 @@ class SvXMLExport;
 class XMLPropertyHandlerFactory;
 class XMLPropertySetMapper;
 class SvXMLExportPropertyMapper;
-
+class XMLPageMasterExportPropMapper;
 
 struct XMLPageExportNameEntry
 {
@@ -58,7 +58,7 @@ class XMLOFF_DLLPUBLIC XMLPageExport : public 
salhelper::SimpleReferenceObject
 
 rtl::Reference < XMLPropertyHandlerFactory > m_xPageMasterPropHdlFactory;
 rtl::Reference < XMLPropertySetMapper > m_xPageMasterPropSetMapper;
-rtl::Reference < SvXMLExportPropertyMapper > m_xPageMasterExportPropMapper;
+rtl::Reference < XMLPageMasterExportPropMapper > 
m_xPageMasterExportPropMapper;
 rtl::Reference m_xPageMasterDrawingPagePropSetMapper;
 rtl::Reference 
m_xPageMasterDrawingPageExportPropMapper;
 
diff --git a/xmloff/source/style/XMLPageExport.cxx 
b/xmloff/source/style/XMLPageExport.cxx
index 500f9463b68e..c827eb14bdde 100644
--- a/xmloff/source/style/XMLPageExport.cxx
+++ b/xmloff/source/style/XMLPageExport.cxx
@@ -242,8 +242,7 @@ XMLPageExport::XMLPageExport(SvXMLExport & rExp)
 xProps->getPropertyValue("GutterAtTop") >>= bGutterAtTop;
 if (bGutterAtTop)
 {
-
static_cast(m_xPageMasterExportPropMapper.get())
-->SetGutterAtTop(true);
+m_xPageMasterExportPropMapper->SetGutterAtTop(true);
 }
 }
 
commit 86441791e2ace0517025649ae4bbc33c371e5947
Author: Noel Grandin 
AuthorDate: Wed Nov 8 15:13:20 2023 +0200
Commit: Noel Grandin 
CommitDate: Fri Nov 10 12:35:17 2023 +0100

loplugin:fieldcast in framework::MenuBarWrapper

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

diff --git a/framework/inc/uielement/menubarwrapper.hxx 
b/framework/inc/uielement/menubarwrapper.hxx
index c764ecdf14b8..848af5c693f7 100644
--- a/framework/inc/uielement/menubarwrapper.hxx
+++ b/framework/inc/uielement/menubarwrapper.hxx
@@ -36,7 +36,7 @@ class MenuBarWrapper final : public MenuBarWrapper_Base
 MenuBarWrapper( css::uno::Reference< css::uno::XComponentContext > 
xContext );
 virtual ~MenuBarWrapper() override;
 
-MenuBarManager* GetMenuBarManager() const { return static_cast< 
MenuBarManager* >( m_xMenuBarManager.get() ); }
+MenuBarManager* GetMenuBarManager() const { return 
m_xMenuBarManager.get(); }
 
 // XComponent
 virtual void SAL_CALL dispose() override;
@@ -64,7 +64,7 @@ class MenuBarWrapper final : public MenuBarWrapper_Base
 void fillPopupControllerCache();
 
 bool
m_bRefreshPopupControllerCache : 1;
-css::uno::Reference< css::lang::XComponent >
m_xMenuBarManager;
+rtl::Reference< MenuBarManager >
m_xMenuBarManager;
 PopupControllerCache
m_aPopupControllerCache;
 css::uno::Reference< css::uno::XComponentContext >  
m_xContext;
 };
diff --git a/framework/source/uielement/menubarwrapper.cxx 
b/framework/source/uielement/menubarwrapper.cxx
index c1ac0025d55e..24f4d738bf7f 100644
--- a/framework/source/uielement/menubarwrapper.cxx
+++ b/framework/source/uielement/menubarwrapper.cxx
@@ -175,11 +175,9 @@ void SAL_CALL MenuBarWrapper::updateSettings()
 {
 try
 {
-MenuBarManager* pMenuBarManager = static_cast< MenuBarManager *>( 
m_xMenuBarManager.get() );
-
 m_xConfigData = m_xConfigSource->getSettings( m_aResourceURL, 
false );
 if ( m_xConfigData.is() )
-pMenuBarManager->SetItemContainer( m_xConfigData );
+m_xMenuBarManager->SetItemContainer( m_xConfigData );
 }
 catch ( const NoSuchElementException& )
 {
@@ -193,19 +191,16 @@ void SAL_CALL MenuBarWrapper::updateSettings()
 void MenuBarWrapper::impl_fillNewData()
 {
 // Transient menubar => Fill menubar with new data
-MenuBarManager* pMenuBarManager = 

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

2023-11-10 Thread Noel Grandin (via logerrit)
 framework/inc/uielement/statusbarwrapper.hxx|5 ++-
 framework/inc/uielement/toolbarwrapper.hxx  |5 ++-
 framework/source/uielement/statusbarwrapper.cxx |   16 +++
 framework/source/uielement/toolbarwrapper.cxx   |   33 
 4 files changed, 22 insertions(+), 37 deletions(-)

New commits:
commit ba1c844fe8735702af31f79843221c5b94af8fe1
Author: Noel Grandin 
AuthorDate: Wed Nov 8 15:11:43 2023 +0200
Commit: Noel Grandin 
CommitDate: Fri Nov 10 09:53:17 2023 +0100

loplugin:fieldcast in framework::StatusBarWrapper

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

diff --git a/framework/inc/uielement/statusbarwrapper.hxx 
b/framework/inc/uielement/statusbarwrapper.hxx
index 203ae6956a16..c281b4f4866f 100644
--- a/framework/inc/uielement/statusbarwrapper.hxx
+++ b/framework/inc/uielement/statusbarwrapper.hxx
@@ -20,12 +20,13 @@
 #pragma once
 
 #include 
-
+#include 
 #include 
 #include 
 
 namespace framework
 {
+class StatusBarManager;
 
 class StatusBarWrapper final : public UIConfigElementWrapperBase
 {
@@ -47,7 +48,7 @@ class StatusBarWrapper final : public 
UIConfigElementWrapperBase
 virtual void SAL_CALL updateSettings() override;
 
 private:
-css::uno::Reference< css::lang::XComponent > 
m_xStatusBarManager;
+rtl::Reference< StatusBarManager >   
m_xStatusBarManager;
 css::uno::Reference< css::uno::XComponentContext >   m_xContext;
 };
 
diff --git a/framework/source/uielement/statusbarwrapper.cxx 
b/framework/source/uielement/statusbarwrapper.cxx
index 8ce6e48e5eb1..845a0b9269cf 100644
--- a/framework/source/uielement/statusbarwrapper.cxx
+++ b/framework/source/uielement/statusbarwrapper.cxx
@@ -137,11 +137,9 @@ void SAL_CALL StatusBarWrapper::updateSettings()
 
 try
 {
-StatusBarManager* pStatusBarManager = static_cast< StatusBarManager 
*>( m_xStatusBarManager.get() );
-
 m_xConfigData = m_xConfigSource->getSettings( m_aResourceURL, false );
 if ( m_xConfigData.is() )
-pStatusBarManager->FillStatusBar( m_xConfigData );
+m_xStatusBarManager->FillStatusBar( m_xConfigData );
 }
 catch ( const NoSuchElementException& )
 {
@@ -152,15 +150,11 @@ Reference< XInterface > SAL_CALL 
StatusBarWrapper::getRealInterface()
 {
 SolarMutexGuard g;
 
-if ( m_xStatusBarManager.is() )
+if ( m_xStatusBarManager )
 {
-StatusBarManager* pStatusBarManager = static_cast< StatusBarManager 
*>( m_xStatusBarManager.get() );
-if ( pStatusBarManager )
-{
-vcl::Window* pWindow = pStatusBarManager->GetStatusBar();
-if ( pWindow )
-return Reference< XInterface >( VCLUnoHelper::GetInterface( 
pWindow ), UNO_QUERY );
-}
+vcl::Window* pWindow = m_xStatusBarManager->GetStatusBar();
+if ( pWindow )
+return Reference< XInterface >( VCLUnoHelper::GetInterface( 
pWindow ), UNO_QUERY );
 }
 
 return Reference< XInterface >();
commit 11a97db6c8552b3b4a6e312268ddc5f8ade0ee4e
Author: Noel Grandin 
AuthorDate: Wed Nov 8 15:10:10 2023 +0200
Commit: Noel Grandin 
CommitDate: Fri Nov 10 09:53:09 2023 +0100

loplugin:fieldcast in framework::ToolBarWrapper

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

diff --git a/framework/inc/uielement/toolbarwrapper.hxx 
b/framework/inc/uielement/toolbarwrapper.hxx
index a1bfbd0b09c9..6325c0b54183 100644
--- a/framework/inc/uielement/toolbarwrapper.hxx
+++ b/framework/inc/uielement/toolbarwrapper.hxx
@@ -25,7 +25,7 @@
 #include 
 #include 
 #include 
-
+#include 
 #include 
 
 namespace weld
@@ -37,6 +37,7 @@ namespace weld
 
 namespace framework
 {
+class ToolBarManager;
 
 class ToolBarWrapper final : public 
cppu::ImplInheritanceHelper
m_xToolBarManager;
+rtl::Reference< ToolBarManager >
m_xToolBarManager;
 css::uno::Reference< css::uno::XComponentContext >  m_xContext;
 css::uno::Reference< css::ui::XUIElement >  m_xSubElement;
 
diff --git a/framework/source/uielement/toolbarwrapper.cxx 
b/framework/source/uielement/toolbarwrapper.cxx
index 8f3937ef094f..ae988744c142 100644
--- a/framework/source/uielement/toolbarwrapper.cxx
+++ b/framework/source/uielement/toolbarwrapper.cxx
@@ -214,9 +214,8 @@ void SAL_CALL ToolBarWrapper::update()
 if ( m_bDisposed )
 throw DisposedException();
 
-ToolBarManager* pToolBarManager = static_cast< ToolBarManager *>( 
m_xToolBarManager.get() );
-if ( pToolBarManager )
-pToolBarManager->CheckAndUpdateImages();
+if ( m_xToolBarManager )
+

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

2022-07-13 Thread Maxim Monastirsky (via logerrit)
 framework/inc/uielement/toolbarmanager.hxx|1 +
 framework/source/uielement/toolbarmanager.cxx |9 +
 include/vcl/toolbox.hxx   |2 ++
 include/vcl/toolkit/button.hxx|4 ++--
 vcl/inc/vclstatuslistener.hxx |   20 +---
 vcl/source/control/button.cxx |4 ++--
 vcl/source/window/builder.cxx |4 +++-
 vcl/source/window/toolbox.cxx |   12 +---
 vcl/source/window/toolbox2.cxx|   23 +--
 9 files changed, 46 insertions(+), 33 deletions(-)

New commits:
commit e695b6d89a00c86fc35332213be42d5b29196eae
Author: Maxim Monastirsky 
AuthorDate: Wed Jul 13 09:50:17 2022 +0300
Commit: Maxim Monastirsky 
CommitDate: Wed Jul 13 14:52:28 2022 +0200

Related: tdf#149956 Keep in sync after icon theme change

We can't just refresh the listener for .uno:ImageOrientation,
as that won't work for tdf#149741.

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

diff --git a/vcl/source/window/toolbox2.cxx b/vcl/source/window/toolbox2.cxx
index 5237aec9365f..3913b5ee6321 100644
--- a/vcl/source/window/toolbox2.cxx
+++ b/vcl/source/window/toolbox2.cxx
@@ -943,6 +943,15 @@ void* ToolBox::GetItemData( ToolBoxItemId nItemId ) const
 return nullptr;
 }
 
+static Image ImplMirrorImage( const Image& rImage )
+{
+BitmapExaMirrBitmapEx( rImage.GetBitmapEx() );
+
+aMirrBitmapEx.Mirror( BmpMirrorFlags::Horizontal );
+
+return Image( aMirrBitmapEx );
+}
+
 void ToolBox::SetItemImage( ToolBoxItemId nItemId, const Image& rImage )
 {
 ImplToolItems::size_type nPos = GetItemPos( nItemId );
@@ -953,7 +962,10 @@ void ToolBox::SetItemImage( ToolBoxItemId nItemId, const 
Image& rImage )
 ImplToolItem* pItem = >m_aItems[nPos];
 Size aOldSize = pItem->maImage.GetSizePixel();
 
-pItem->maImage = rImage;
+if (pItem->mbMirrorMode)
+pItem->maImage = ImplMirrorImage(rImage);
+else
+pItem->maImage = rImage;
 
 // only once all is calculated, do extra work
 if (!mbCalc)
@@ -1003,15 +1015,6 @@ void ToolBox::SetItemImageAngle( ToolBoxItemId nItemId, 
Degree10 nAngle10 )
 }
 }
 
-static Image ImplMirrorImage( const Image& rImage )
-{
-BitmapExaMirrBitmapEx( rImage.GetBitmapEx() );
-
-aMirrBitmapEx.Mirror( BmpMirrorFlags::Horizontal );
-
-return Image( aMirrBitmapEx );
-}
-
 void ToolBox::SetItemImageMirrorMode( ToolBoxItemId nItemId, bool bMirror )
 {
 ImplToolItems::size_type nPos = GetItemPos( nItemId );
commit 421688a4c2fc64e64ce211d579bad2174e005db4
Author: Maxim Monastirsky 
AuthorDate: Tue Jul 12 23:19:47 2022 +0300
Commit: Maxim Monastirsky 
CommitDate: Wed Jul 13 14:52:18 2022 +0200

tdf#149956 Pass the correct frame to VclStatusListener

Starting directly to Writer (i.e. with "--writer") will attempt
to create VclStatusListeners for .uno:ImageOrientation before
the frame is activated, causing the dispatcher to not be found.

Also defer that stuff to after a toolbar is filled, so we get a
correct initial state for toolbars which shown when the current
paragraph is rtl already. (There is a similar problem with the
NB, but it isn't handled in this patch.)

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

diff --git a/framework/inc/uielement/toolbarmanager.hxx 
b/framework/inc/uielement/toolbarmanager.hxx
index 746b40ebc787..17840c46fe95 100644
--- a/framework/inc/uielement/toolbarmanager.hxx
+++ b/framework/inc/uielement/toolbarmanager.hxx
@@ -87,6 +87,7 @@ 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 e9de797e689a..a632828b5c8c 100644
--- a/framework/source/uielement/toolbarmanager.cxx
+++ b/framework/source/uielement/toolbarmanager.cxx
@@ -308,6 +308,11 @@ 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();
@@ -508,6 +513,8 @@ public:
 
 virtual void SetHelpId(const OString& /*rHelpId*/) override {}
 
+virtual void TrackImageOrientation(const 

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

2021-12-25 Thread Noel Grandin (via logerrit)
 framework/inc/uielement/menubarmanager.hxx  |9 +++---
 framework/source/services/ContextChangeEventMultiplexer.cxx |   16 ++--
 framework/source/uielement/menubarmanager.cxx   |   15 +--
 3 files changed, 19 insertions(+), 21 deletions(-)

New commits:
commit d4257daba1155ebccbfebea99bad0e4152ca9b08
Author: Noel Grandin 
AuthorDate: Fri Dec 24 20:58:28 2021 +0200
Commit: Noel Grandin 
CommitDate: Sat Dec 25 19:34:05 2021 +0100

use comphelper::WeakComponentImplHelper in MenuBarManager

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

diff --git a/framework/inc/uielement/menubarmanager.hxx 
b/framework/inc/uielement/menubarmanager.hxx
index a77552a67213..079d127d4d83 100644
--- a/framework/inc/uielement/menubarmanager.hxx
+++ b/framework/inc/uielement/menubarmanager.hxx
@@ -41,8 +41,8 @@
 #include 
 #include 
 #include 
-#include 
-#include 
+#include 
+#include 
 #include 
 
 namespace framework
@@ -56,8 +56,7 @@ struct PopupControllerEntry
 typedef std::unordered_map< OUString, PopupControllerEntry > 
PopupControllerCache;
 
 class MenuBarManager final :
-protected cppu::BaseMutex,
-public cppu::WeakComponentImplHelper<
+public comphelper::WeakComponentImplHelper<
 css::frame::XStatusListener,
 css::frame::XFrameActionListener,
 css::ui::XUIConfigurationListener,
@@ -121,7 +120,7 @@ class MenuBarManager final :
 DECL_LINK( Deactivate, Menu *, bool );
 DECL_LINK( AsyncSettingsHdl, Timer *, void );
 
-void SAL_CALL disposing() override;
+void disposing(std::unique_lock&) override;
 void RemoveListener();
 void RequestImages();
 void RetrieveImageManagers();
diff --git a/framework/source/uielement/menubarmanager.cxx 
b/framework/source/uielement/menubarmanager.cxx
index 08998a4b8fe8..7b856a01d43d 100644
--- a/framework/source/uielement/menubarmanager.cxx
+++ b/framework/source/uielement/menubarmanager.cxx
@@ -87,8 +87,7 @@ MenuBarManager::MenuBarManager(
 const Reference< XDispatchProvider >& rDispatchProvider,
 const OUString& rModuleIdentifier,
 Menu* pMenu, bool bDelete, bool bHasMenuBar ):
-WeakComponentImplHelper( m_aMutex )
-, m_bRetrieveImages( false )
+  m_bRetrieveImages( false )
 , m_bAcceleratorCfg( false )
 , m_bHasMenuBar( bHasMenuBar )
 , m_xContext(rxContext)
@@ -104,7 +103,7 @@ Any SAL_CALL MenuBarManager::getMenuHandle( const Sequence< 
sal_Int8 >& /*Proces
 {
 SolarMutexGuard aSolarGuard;
 
-if ( rBHelper.bDisposed || rBHelper.bInDispose )
+if ( m_bDisposed )
 throw css::lang::DisposedException();
 
 Any a;
@@ -141,7 +140,7 @@ void MenuBarManager::Destroy()
 {
 SolarMutexGuard aGuard;
 
-if ( rBHelper.bDisposed )
+if ( m_bDisposed )
 return;
 
 // stop asynchronous settings timer and
@@ -159,7 +158,7 @@ void MenuBarManager::Destroy()
 }
 
 // XComponent
-void SAL_CALL MenuBarManager::disposing()
+void MenuBarManager::disposing(std::unique_lock& )
 {
 Reference< XComponent > xThis( this );
 
@@ -202,7 +201,7 @@ void SAL_CALL MenuBarManager::elementInserted( const 
css::ui::ConfigurationEvent
 SolarMutexGuard g;
 
 /* SAFE AREA 
---
 */
-if ( rBHelper.bDisposed || rBHelper.bInDispose )
+if ( m_bDisposed )
 return;
 
 sal_Int16 nImageType = sal_Int16();
@@ -225,7 +224,7 @@ void SAL_CALL MenuBarManager::frameAction( const 
FrameActionEvent& Action )
 {
 SolarMutexGuard g;
 
-if ( rBHelper.bDisposed || rBHelper.bInDispose )
+if ( m_bDisposed )
 throw css::lang::DisposedException();
 
 if ( Action.Action != FrameAction_CONTEXT_CHANGED )
@@ -253,7 +252,7 @@ void SAL_CALL MenuBarManager::statusChanged( const 
FeatureStateEvent& Event )
 
 SolarMutexGuard aSolarGuard;
 {
-if ( rBHelper.bDisposed || rBHelper.bInDispose )
+if ( m_bDisposed )
 return;
 
 // We have to check all menu entries as there can be identical entries 
in a popup menu.
commit 98dbe250d7d5e3ebe626e8c8650e7fdccd399869
Author: Noel Grandin 
AuthorDate: Fri Dec 24 21:01:56 2021 +0200
Commit: Noel Grandin 
CommitDate: Sat Dec 25 19:33:53 2021 +0100

use comphelper::WeakComponentImplHelper in ContextChangeEventMultiplexer

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

diff --git a/framework/source/services/ContextChangeEventMultiplexer.cxx 
b/framework/source/services/ContextChangeEventMultiplexer.cxx
index 0dea0823c52b..76424b3aea03 100644
--- a/framework/source/services/ContextChangeEventMultiplexer.cxx
+++ 

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

2021-11-30 Thread Caolán McNamara (via logerrit)
 framework/inc/uielement/macrosmenucontroller.hxx  |1 -
 framework/source/uielement/fontmenucontroller.cxx |1 -
 framework/source/uielement/toolbarsmenucontroller.cxx |1 -
 3 files changed, 3 deletions(-)

New commits:
commit a12b14c1806609fbf31ec9ff37c794e7acb5fe99
Author: Caolán McNamara 
AuthorDate: Mon Nov 29 21:10:54 2021 +
Commit: Caolán McNamara 
CommitDate: Tue Nov 30 09:48:06 2021 +0100

drop unneeded include

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

diff --git a/framework/inc/uielement/macrosmenucontroller.hxx 
b/framework/inc/uielement/macrosmenucontroller.hxx
index beb9779efb66..7419f02a7059 100644
--- a/framework/inc/uielement/macrosmenucontroller.hxx
+++ b/framework/inc/uielement/macrosmenucontroller.hxx
@@ -20,7 +20,6 @@
 #pragma once
 
 #include 
-#include 
 
 namespace framework
 {
commit 1fbbfc24199f8d46e7b28b77cb9deb003708512c
Author: Caolán McNamara 
AuthorDate: Mon Nov 29 16:44:51 2021 +
Commit: Caolán McNamara 
CommitDate: Tue Nov 30 09:47:50 2021 +0100

remove out of date comments

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

diff --git a/framework/source/uielement/fontmenucontroller.cxx 
b/framework/source/uielement/fontmenucontroller.cxx
index ce89834c5035..5dfdb4cb7f72 100644
--- a/framework/source/uielement/fontmenucontroller.cxx
+++ b/framework/source/uielement/fontmenucontroller.cxx
@@ -101,7 +101,6 @@ void FontMenuController::fillPopupMenu( const Sequence< 
OUString >& rFontNameSeq
 m_xPopupMenu->insertItem( i+1, rName, 
css::awt::MenuItemStyle::RADIOCHECK | css::awt::MenuItemStyle::AUTOCHECK, i );
 if ( rName == m_aFontFamilyName )
 m_xPopupMenu->checkItem( i+1, true );
-// use VCL popup menu pointer to set vital information that are not 
part of the awt implementation
 OUString aFontNameCommand = aFontNameCommandPrefix + 
INetURLObject::encode( rName, INetURLObject::PART_HTTP_QUERY, 
INetURLObject::EncodeMechanism::All );
 m_xPopupMenu->setCommand(i + 1, aFontNameCommand); // Store font name 
into item command.
 }
diff --git a/framework/source/uielement/toolbarsmenucontroller.cxx 
b/framework/source/uielement/toolbarsmenucontroller.cxx
index b7096c075605..78a1a2aa9b52 100644
--- a/framework/source/uielement/toolbarsmenucontroller.cxx
+++ b/framework/source/uielement/toolbarsmenucontroller.cxx
@@ -395,7 +395,6 @@ void ToolbarsMenuController::fillPopupMenu( Reference< 
css::awt::XPopupMenu > co
 if ( aSortedTbs[i].bVisible )
 m_xPopupMenu->checkItem( nIndex, true );
 
-// use VCL popup menu pointer to set vital information that are not 
part of the awt implementation
 OUStringBuffer aStrBuf( aStaticCmdPart );
 
 sal_Int32 n = aSortedTbs[i].aCommand.lastIndexOf( '/' );


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

2021-11-29 Thread Caolán McNamara (via logerrit)
 framework/inc/uielement/newmenucontroller.hxx |4 -
 framework/source/uielement/newmenucontroller.cxx  |   39 +-
 framework/source/uielement/toolbarsmenucontroller.cxx |   11 -
 toolkit/source/awt/vclxmenu.cxx   |2 
 4 files changed, 23 insertions(+), 33 deletions(-)

New commits:
commit 88b69059c34a6ff85f1e61d9bc8906bfd8e432aa
Author: Caolán McNamara 
AuthorDate: Mon Nov 29 11:57:55 2021 +
Commit: Caolán McNamara 
CommitDate: Mon Nov 29 21:21:12 2021 +0100

use more XPopupMenu methods over PopupMenu ones

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

diff --git a/framework/inc/uielement/newmenucontroller.hxx 
b/framework/inc/uielement/newmenucontroller.hxx
index 2c745cc2b64d..57e58239fc19 100644
--- a/framework/inc/uielement/newmenucontroller.hxx
+++ b/framework/inc/uielement/newmenucontroller.hxx
@@ -60,8 +60,8 @@ namespace framework
 void retrieveShortcutsFromConfiguration( const 
css::uno::Reference< css::ui::XAcceleratorConfiguration >& rAccelCfg,
  const css::uno::Sequence< 
OUString >& rCommands,
  std::vector< vcl::KeyCode 
>& aMenuShortCuts );
-void setAccelerators( PopupMenu* pPopupMenu );
-void determineAndSetNewDocAccel( PopupMenu* pPopupMenu, const 
vcl::KeyCode& rKeyCode );
+void setAccelerators();
+void determineAndSetNewDocAccel(const css::awt::KeyEvent& 
rKeyCode);
 void setMenuImages( PopupMenu* pPopupMenu, bool bSetImages );
 
 private:
diff --git a/framework/source/uielement/newmenucontroller.cxx 
b/framework/source/uielement/newmenucontroller.cxx
index 710f49c264d4..59e9160f8ced 100644
--- a/framework/source/uielement/newmenucontroller.cxx
+++ b/framework/source/uielement/newmenucontroller.cxx
@@ -22,6 +22,7 @@
 
 #include 
 
+#include 
 #include 
 #include 
 #include 
@@ -106,10 +107,10 @@ void NewMenuController::setMenuImages( PopupMenu* 
pPopupMenu, bool bSetImages )
 }
 }
 
-void NewMenuController::determineAndSetNewDocAccel( PopupMenu* pPopupMenu, 
const vcl::KeyCode& rKeyCode )
+void NewMenuController::determineAndSetNewDocAccel(const css::awt::KeyEvent& 
rKeyCode)
 {
-sal_uInt16nCount( pPopupMenu->GetItemCount() );
-sal_uInt16nId( 0 );
+sal_uInt16 nCount(m_xPopupMenu->getItemCount());
+sal_uInt16 nId( 0 );
 bool  bFound( false );
 OUString aCommand;
 
@@ -119,13 +120,13 @@ void NewMenuController::determineAndSetNewDocAccel( 
PopupMenu* pPopupMenu, const
 
 for ( sal_uInt16 i = 0; i < nCount; i++ )
 {
-if ( pPopupMenu->GetItemType( i ) != MenuItemType::SEPARATOR )
+if (m_xPopupMenu->getItemType(i) != 
css::awt::MenuItemType_SEPARATOR)
 {
-nId = pPopupMenu->GetItemId( i );
-aCommand = pPopupMenu->GetItemCommand( nId );
+nId = m_xPopupMenu->getItemId(i);
+aCommand = m_xPopupMenu->getCommand(nId);
 if ( aCommand.startsWith( m_aEmptyDocURL ) )
 {
-pPopupMenu->SetAccelKey( nId, rKeyCode );
+m_xPopupMenu->setAcceleratorKeyEvent(nId, rKeyCode);
 bFound = true;
 break;
 }
@@ -143,20 +144,20 @@ void NewMenuController::determineAndSetNewDocAccel( 
PopupMenu* pPopupMenu, const
 
 for ( sal_uInt16 i = 0; i < nCount; i++ )
 {
-if ( pPopupMenu->GetItemType( i ) != MenuItemType::SEPARATOR )
+if (m_xPopupMenu->getItemType(i) != css::awt::MenuItemType_SEPARATOR)
 {
-nId = pPopupMenu->GetItemId( i );
-aCommand = pPopupMenu->GetItemCommand( nId );
+nId = m_xPopupMenu->getItemId(i);
+aCommand = m_xPopupMenu->getCommand(nId);
 if ( aCommand.indexOf( aDefaultModuleName ) >= 0 )
 {
-pPopupMenu->SetAccelKey( nId, rKeyCode );
+m_xPopupMenu->setAcceleratorKeyEvent(nId, rKeyCode);
 break;
 }
 }
 }
 }
 
-void NewMenuController::setAccelerators( PopupMenu* pPopupMenu )
+void NewMenuController::setAccelerators()
 {
 if ( !m_bModuleIdentified )
 return;
@@ -212,18 +213,18 @@ void NewMenuController::setAccelerators( PopupMenu* 
pPopupMenu )
 }
 
 vcl::KeyCodeaEmptyKeyCode;
-sal_uInt16  nItemCount( pPopupMenu->GetItemCount() );
+sal_uInt16  nItemCount(m_xPopupMenu->getItemCount());
 std::vector< vcl::KeyCode > aMenuShortCuts;
 std::vector< OUString >aCmds;
 std::vector< sal_uInt16 >   aIds;
 for ( sal_uInt16 i = 0; i < nItemCount; i++ )
 {
- 

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

2021-11-29 Thread Caolán McNamara (via logerrit)
 framework/inc/uielement/macrosmenucontroller.hxx|4 ++--
 framework/source/uielement/headermenucontroller.cxx |   15 ++-
 framework/source/uielement/macrosmenucontroller.cxx |   10 ++
 3 files changed, 14 insertions(+), 15 deletions(-)

New commits:
commit a5792c32f342b3d5087c62c7a65deed4c1d1dc1c
Author: Caolán McNamara 
AuthorDate: Mon Nov 29 11:07:23 2021 +
Commit: Caolán McNamara 
CommitDate: Mon Nov 29 18:43:19 2021 +0100

use css::awt::XPopupMenu api instead of PopupMenu

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

diff --git a/framework/inc/uielement/macrosmenucontroller.hxx 
b/framework/inc/uielement/macrosmenucontroller.hxx
index 7e70f0f0a3bb..beb9779efb66 100644
--- a/framework/inc/uielement/macrosmenucontroller.hxx
+++ b/framework/inc/uielement/macrosmenucontroller.hxx
@@ -46,8 +46,8 @@ namespace framework
 virtual void SAL_CALL disposing( const css::lang::EventObject& 
Source ) override;
 
 private:
-void fillPopupMenu( css::uno::Reference< css::awt::XPopupMenu > 
const & rPopupMenu );
-void addScriptItems( PopupMenu* pPopupMenu, sal_uInt16 startItemId 
);
+void fillPopupMenu(const 
css::uno::Reference& rPopupMenu);
+void addScriptItems(const 
css::uno::Reference& rPopupMenu, sal_uInt16 startItemId);
 };
 }
 
diff --git a/framework/source/uielement/macrosmenucontroller.cxx 
b/framework/source/uielement/macrosmenucontroller.cxx
index a4c5123f50c7..cddfed74c693 100644
--- a/framework/source/uielement/macrosmenucontroller.cxx
+++ b/framework/source/uielement/macrosmenucontroller.cxx
@@ -94,7 +94,7 @@ void MacrosMenuController::fillPopupMenu( Reference< 
css::awt::XPopupMenu > cons
 pPopupMenu->SetItemCommand( 2, aCommand );
 
 // insert providers but not basic or java
-addScriptItems( pPopupMenu, 4);
+addScriptItems(rPopupMenu, 4);
 }
 
 // XEventListener
@@ -124,7 +124,7 @@ void SAL_CALL MacrosMenuController::statusChanged( const 
FeatureStateEvent& )
 }
 }
 
-void MacrosMenuController::addScriptItems( PopupMenu* pPopupMenu, sal_uInt16 
startItemId )
+void MacrosMenuController::addScriptItems(const 
Reference& rPopupMenu, sal_uInt16 startItemId)
 {
 static const OUStringLiteral 
aCmdBase(u".uno:ScriptOrganizer?ScriptOrganizer.Language:string=");
 static const OUStringLiteral ellipsis( u"..." );
@@ -133,6 +133,8 @@ void MacrosMenuController::addScriptItems( PopupMenu* 
pPopupMenu, sal_uInt16 sta
 Reference< XContentEnumerationAccess > xEnumAccess( 
m_xContext->getServiceManager(), UNO_QUERY_THROW );
 Reference< XEnumeration > xEnum = xEnumAccess->createContentEnumeration ( 
"com.sun.star.script.provider.LanguageScriptProvider" );
 
+sal_Int16 nPos = rPopupMenu->getItemCount();
+
 while ( xEnum->hasMoreElements() )
 {
 Reference< XServiceInfo > xServiceInfo;
@@ -155,8 +157,8 @@ void MacrosMenuController::addScriptItems( PopupMenu* 
pPopupMenu, sal_uInt16 sta
 }
 aCommand += aDisplayName;
 aDisplayName += ellipsis;
-pPopupMenu->InsertItem( itemId, aDisplayName );
-pPopupMenu->SetItemCommand( itemId, aCommand );
+rPopupMenu->insertItem(itemId, aDisplayName, 0, nPos++);
+rPopupMenu->setCommand(itemId, aCommand);
 itemId++;
 break;
 }
commit 50dc11ef9b0d5e3e2e08ecc1a2267c79f6ef8fb2
Author: Caolán McNamara 
AuthorDate: Mon Nov 29 11:02:34 2021 +
Commit: Caolán McNamara 
CommitDate: Mon Nov 29 18:42:55 2021 +0100

can use css::awt::XPopupMenu::setCommand

instead of PopupMenu::SetItemCommand since...

commit 9aa4101c53e483be1d25c1e5aaad2cf542540a56
Date:   Wed Feb 25 16:57:46 2004 +

INTEGRATION: CWS layoutmanager (1.3.146); FILE MERGED
2004/01/19 10:03:03 cd 1.3.146.2: #111899# Added new interface
to support set/get commands/help URL

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

diff --git a/framework/source/uielement/headermenucontroller.cxx 
b/framework/source/uielement/headermenucontroller.cxx
index 34476f9c2100..14a661e6f3a0 100644
--- a/framework/source/uielement/headermenucontroller.cxx
+++ b/framework/source/uielement/headermenucontroller.cxx
@@ -29,7 +29,6 @@
 #include 
 #include 
 
-#include 
 #include 
 #include 
 #include 
@@ -81,8 +80,6 @@ HeaderMenuController::~HeaderMenuController()
 // private function
 void HeaderMenuController::fillPopupMenu( const Reference< css::frame::XModel 
>& rModel, Reference< css::awt::XPopupMenu > const & rPopupMenu )
 {
-VCLXPopupMenu*   pPopupMenu= 

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

2021-11-29 Thread Caolán McNamara (via logerrit)
 framework/inc/uielement/fontsizemenucontroller.hxx|2 
 framework/source/uielement/fontsizemenucontroller.cxx |   67 --
 2 files changed, 19 insertions(+), 50 deletions(-)

New commits:
commit 7e40111f3c5258cbe884c19bcb6617ad342aa5f3
Author: Caolán McNamara 
AuthorDate: Mon Nov 29 10:53:14 2021 +
Commit: Caolán McNamara 
CommitDate: Mon Nov 29 18:42:15 2021 +0100

pAry is always FontList::GetStdSizeAry()

so the other branch is bogus, this is (more obvious) since...

commit f5a81a119cb63152c2c2e2473a1ea183a30c8db9
Date:   Tue Sep 21 07:19:15 2021 +1000

vcl: remove OutputDevice's GetDevFontSizeCount() and GetDevFontSize()

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

diff --git a/framework/source/uielement/fontsizemenucontroller.cxx 
b/framework/source/uielement/fontsizemenucontroller.cxx
index bc9f0b28b779..4c5c686888a9 100644
--- a/framework/source/uielement/fontsizemenucontroller.cxx
+++ b/framework/source/uielement/fontsizemenucontroller.cxx
@@ -153,9 +153,6 @@ void FontSizeMenuController::fillPopupMenu( Reference< 
css::awt::XPopupMenu > co
 // setup font size array
 m_aHeightArray.clear();
 
-const int* pTempAry;
-const int* pAry = FontList::GetStdSizeAry();
-
 sal_uInt16 nPos = 0; // Id is nPos+1
 static const OUStringLiteral aFontHeightCommand( 
u".uno:FontHeight?FontHeight.Height:float=" );
 
@@ -163,54 +160,30 @@ void FontSizeMenuController::fillPopupMenu( Reference< 
css::awt::XPopupMenu > co
 FontSizeNames   aFontSizeNames( 
Application::GetSettings().GetUILanguageTag().getLanguageType() );
 OUString   aCommand;
 
-if ( !aFontSizeNames.IsEmpty() )
+if (!aFontSizeNames.IsEmpty())
 {
-if ( pAry == FontList::GetStdSizeAry() )
+// for scalable fonts all font size names
+sal_Int32 nCount = aFontSizeNames.Count();
+for( sal_Int32 i = 0; i < nCount; i++ )
 {
-// for scalable fonts all font size names
-sal_Int32 nCount = aFontSizeNames.Count();
-for( sal_Int32 i = 0; i < nCount; i++ )
-{
-OUString aSizeName = aFontSizeNames.GetIndexName( i );
-sal_Int32 nSize = aFontSizeNames.GetIndexSize( i );
-m_aHeightArray.push_back(nSize);
-rPopupMenu->insertItem(nPos + 1, aSizeName, 
css::awt::MenuItemStyle::RADIOCHECK | css::awt::MenuItemStyle::AUTOCHECK, nPos);
+OUString aSizeName = aFontSizeNames.GetIndexName( i );
+sal_Int32 nSize = aFontSizeNames.GetIndexSize( i );
+m_aHeightArray.push_back(nSize);
+rPopupMenu->insertItem(nPos + 1, aSizeName, 
css::awt::MenuItemStyle::RADIOCHECK | css::awt::MenuItemStyle::AUTOCHECK, nPos);
 
-// Create dispatchable .uno command and set it
-float fPoint = float(nSize) / 10;
-aCommand = aFontHeightCommand + OUString::number( fPoint );
-rPopupMenu->setCommand(nPos + 1, aCommand);
+// Create dispatchable .uno command and set it
+float fPoint = float(nSize) / 10;
+aCommand = aFontHeightCommand + OUString::number( fPoint );
+rPopupMenu->setCommand(nPos + 1, aCommand);
 
-++nPos;
-}
-}
-else
-{
-// for fixed size fonts only selectable font size names
-pTempAry = pAry;
-while ( *pTempAry )
-{
-OUString aSizeName = aFontSizeNames.Size2Name( *pTempAry );
-if ( !aSizeName.isEmpty() )
-{
-m_aHeightArray.push_back(*pTempAry);
-rPopupMenu->insertItem(nPos + 1, aSizeName, 
css::awt::MenuItemStyle::RADIOCHECK | css::awt::MenuItemStyle::AUTOCHECK, nPos);
-
-// Create dispatchable .uno command and set it
-float fPoint = float(*pTempAry) / 10;
-aCommand = aFontHeightCommand + OUString::number( fPoint );
-rPopupMenu->setCommand(nPos + 1, aCommand);
-
-++nPos;
-}
-pTempAry++;
-}
+++nPos;
 }
 }
 
 // then insert numerical font size values
 const vcl::I18nHelper& rI18nHelper = 
Application::GetSettings().GetUILocaleI18nHelper();
-pTempAry = pAry;
+const int* pAry = FontList::GetStdSizeAry();
+const int* pTempAry = pAry;
 while ( *pTempAry )
 {
 m_aHeightArray.push_back(*pTempAry);
commit 20685a37e53bbe82bf4d3d6b0b7d94b104dfdfb9
Author: Caolán McNamara 
AuthorDate: Mon Nov 29 10:45:42 2021 +
Commit: Caolán McNamara 
CommitDate: Mon Nov 29 18:41:58 2021 +0100

m_pHeightArray can be a std::vector

Change-Id: 

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

2021-11-21 Thread Noel Grandin (via logerrit)
 framework/inc/jobs/configaccess.hxx|5 +++--
 framework/source/fwi/jobs/configaccess.cxx |   13 +
 framework/source/helper/statusindicatorfactory.cxx |   10 +-
 3 files changed, 17 insertions(+), 11 deletions(-)

New commits:
commit efd95650cba2460bc153de00f8eb27785ad0e18a
Author: Noel Grandin 
AuthorDate: Sun Nov 21 11:53:36 2021 +0200
Commit: Noel Grandin 
CommitDate: Sun Nov 21 15:47:17 2021 +0100

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

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

diff --git a/framework/inc/jobs/configaccess.hxx 
b/framework/inc/jobs/configaccess.hxx
index 4d73df2e1c46..19d9265f952a 100644
--- a/framework/inc/jobs/configaccess.hxx
+++ b/framework/inc/jobs/configaccess.hxx
@@ -20,8 +20,8 @@
 #pragma once
 
 #include 
-
 #include 
+#include 
 
 namespace framework{
 
@@ -50,7 +50,7 @@ class ConfigAccess final
 // member
 
 private:
-mutable osl::Mutex m_mutex;
+mutable std::mutex m_mutex;
 
 /**
 reference to the uno service manager
@@ -69,6 +69,7 @@ class ConfigAccess final
 
 // native interface methods
 
+void  closeImpl();
 public:
 
  ConfigAccess( const css::uno::Reference< 
css::uno::XComponentContext >& rxContext,
diff --git a/framework/source/fwi/jobs/configaccess.cxx 
b/framework/source/fwi/jobs/configaccess.cxx
index d3ce0e5f70a1..27f2c3dd9572 100644
--- a/framework/source/fwi/jobs/configaccess.cxx
+++ b/framework/source/fwi/jobs/configaccess.cxx
@@ -67,7 +67,7 @@ ConfigAccess::~ConfigAccess()
  */
 ConfigAccess::EOpenMode ConfigAccess::getMode() const
 {
-osl::MutexGuard g(m_mutex);
+std::unique_lock g(m_mutex);
 return m_eMode;
 }
 
@@ -87,7 +87,7 @@ ConfigAccess::EOpenMode ConfigAccess::getMode() const
  */
 void ConfigAccess::open( /*IN*/ EOpenMode eMode )
 {
-osl::MutexGuard g(m_mutex);
+std::unique_lock g(m_mutex);
 
 // check if configuration is already open in the right mode.
 // By the way: Don't allow closing by using this method!
@@ -99,7 +99,7 @@ void ConfigAccess::open( /*IN*/ EOpenMode eMode )
 // can be called without checks! It does the checks by itself ...
 // e.g. for already closed or not opened configuration.
 // Flushing of all made changes will be done here too.
-close();
+closeImpl();
 
 // create the configuration provider, which provides sub access points
 css::uno::Reference< css::lang::XMultiServiceFactory > xConfigProvider = 
css::configuration::theDefaultProvider::get(m_xContext);
@@ -135,7 +135,12 @@ void ConfigAccess::open( /*IN*/ EOpenMode eMode )
  */
 void ConfigAccess::close()
 {
-osl::MutexGuard g(m_mutex);
+std::unique_lock g(m_mutex);
+closeImpl();
+}
+
+void ConfigAccess::closeImpl()
+{
 // check already closed configuration
 if (m_xConfig.is())
 {
commit c3b968a2f1e8e824ace86c37d0e500440374bd09
Author: Noel Grandin 
AuthorDate: Sun Nov 21 12:35:24 2021 +0200
Commit: Noel Grandin 
CommitDate: Sun Nov 21 15:47:05 2021 +0100

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

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

diff --git a/framework/source/helper/statusindicatorfactory.cxx 
b/framework/source/helper/statusindicatorfactory.cxx
index 285d53fb683f..0a87c9bea258 100644
--- a/framework/source/helper/statusindicatorfactory.cxx
+++ b/framework/source/helper/statusindicatorfactory.cxx
@@ -33,7 +33,7 @@
 #include 
 #include 
 #include 
-#include 
+#include 
 #include 
 
 #include 
@@ -512,15 +512,15 @@ void StatusIndicatorFactory::impl_reschedule(bool bForce)
 if (!bReschedule)
 return;
 
-static osl::Mutex rescheduleLock;
+static std::mutex rescheduleLock;
 // SAFE ->
-osl::ResettableMutexGuard aRescheduleGuard(rescheduleLock);
+std::unique_lock aRescheduleGuard(rescheduleLock);
 
 if (m_nInReschedule != 0)
 return;
 
 ++m_nInReschedule;
-aRescheduleGuard.clear();
+aRescheduleGuard.unlock();
 // <- SAFE
 
 {
@@ -529,7 +529,7 @@ void StatusIndicatorFactory::impl_reschedule(bool bForce)
 }
 
 // SAFE ->
-aRescheduleGuard.reset();
+aRescheduleGuard.lock();
 --m_nInReschedule;
 }
 


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

2021-10-11 Thread Noel Grandin (via logerrit)
 framework/inc/helper/ocomponentenumeration.hxx|2 +-
 framework/inc/jobs/jobdata.hxx|2 +-
 framework/source/helper/ocomponentaccess.cxx  |2 +-
 framework/source/helper/ocomponentenumeration.cxx |4 ++--
 framework/source/jobs/jobdata.cxx |4 ++--
 package/source/manifest/ManifestImport.cxx|2 +-
 package/source/manifest/ManifestImport.hxx|4 ++--
 7 files changed, 10 insertions(+), 10 deletions(-)

New commits:
commit 8a499b4364dfdf3f921c9ea0cca71dd7bca32cb4
Author: Noel Grandin 
AuthorDate: Mon Oct 11 16:10:08 2021 +0200
Commit: Noel Grandin 
CommitDate: Mon Oct 11 18:36:53 2021 +0200

loplugin:moveparam in framework

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

diff --git a/framework/inc/helper/ocomponentenumeration.hxx 
b/framework/inc/helper/ocomponentenumeration.hxx
index 008b688dec1a..98f126bbc8d7 100644
--- a/framework/inc/helper/ocomponentenumeration.hxx
+++ b/framework/inc/helper/ocomponentenumeration.hxx
@@ -62,7 +62,7 @@ class OComponentEnumeration final : public 
::cppu::WeakImplHelper< css::containe
 @onerrorDo nothing and reset this object to default with an 
empty list.
 
*//*-*/
 
- OComponentEnumeration( const std::vector< css::uno::Reference< 
css::lang::XComponent > >& seqComponents );
+ OComponentEnumeration( std::vector< css::uno::Reference< 
css::lang::XComponent > >&& seqComponents );
 
 //  XEventListener
 
diff --git a/framework/inc/jobs/jobdata.hxx b/framework/inc/jobs/jobdata.hxx
index 392b2512453e..48004d279ab8 100644
--- a/framework/inc/jobs/jobdata.hxx
+++ b/framework/inc/jobs/jobdata.hxx
@@ -186,7 +186,7 @@ class JobData final
 void setService ( const 
OUString&  sService );
 void setEvent   ( const 
OUString&  sEvent   ,
   const 
OUString&  sAlias   );
-void setJobConfig   ( const 
std::vector< css::beans::NamedValue >& lArguments   );
+void setJobConfig   ( 
std::vector< css::beans::NamedValue >&& lArguments   );
 void disableJob (  
);
 
 static std::vector< OUString > getEnabledJobsForEvent( const 
css::uno::Reference< css::uno::XComponentContext >& rxContext,
diff --git a/framework/source/helper/ocomponentaccess.cxx 
b/framework/source/helper/ocomponentaccess.cxx
index bfb4113eab4d..ad7409990d25 100644
--- a/framework/source/helper/ocomponentaccess.cxx
+++ b/framework/source/helper/ocomponentaccess.cxx
@@ -68,7 +68,7 @@ css::uno::Reference< XEnumeration > SAL_CALL 
OComponentAccess::createEnumeration
 
 std::vector< css::uno::Reference< XComponent > > seqComponents;
 impl_collectAllChildComponents( css::uno::Reference< XFramesSupplier 
>( xLock, UNO_QUERY ), seqComponents );
-xReturn = new OComponentEnumeration( seqComponents );
+xReturn = new OComponentEnumeration( std::move(seqComponents) );
 }
 
 // Return result of this operation.
diff --git a/framework/source/helper/ocomponentenumeration.cxx 
b/framework/source/helper/ocomponentenumeration.cxx
index 2a06c558c3e4..3d00f75e56c0 100644
--- a/framework/source/helper/ocomponentenumeration.cxx
+++ b/framework/source/helper/ocomponentenumeration.cxx
@@ -32,9 +32,9 @@ using namespace ::osl;
 
 //  constructor
 
-OComponentEnumeration::OComponentEnumeration( const std::vector< 
css::uno::Reference< XComponent > >& seqComponents )
+OComponentEnumeration::OComponentEnumeration( std::vector< 
css::uno::Reference< XComponent > >&& seqComponents )
 :   m_nPosition ( 0 )   // 0 is the 
first position for a valid list and the right value for an invalid list to!
-,   m_seqComponents ( seqComponents )
+,   m_seqComponents ( std::move(seqComponents)  )
 {}
 
 //  destructor
diff --git a/framework/source/jobs/jobdata.cxx 
b/framework/source/jobs/jobdata.cxx
index 1101d77a94da..a516abdadd7c 100644
--- a/framework/source/jobs/jobdata.cxx
+++ b/framework/source/jobs/jobdata.cxx
@@ -225,12 +225,12 @@ void JobData::setEvent( const OUString& sEvent ,
 @param  lArguments
 list of arguments, which should be set for this job
  */
-void JobData::setJobConfig( const std::vector< css::beans::NamedValue >& 
lArguments )
+void JobData::setJobConfig( 

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

2021-07-20 Thread Michael Stahl (via logerrit)
 framework/inc/uielement/toolbarmanager.hxx|2 
 framework/source/uielement/toolbarmanager.cxx |8 -
 framework/source/uielement/toolbarmerger.cxx  |2 
 include/svx/fillctrl.hxx  |3 
 svx/source/tbxctrls/fillctrl.cxx  |  165 ++
 5 files changed, 149 insertions(+), 31 deletions(-)

New commits:
commit 7d1175c46588c246c455cd7c8874136bf61197fd
Author: Michael Stahl 
AuthorDate: Mon Jul 19 17:33:04 2021 +0200
Commit: Michael Stahl 
CommitDate: Tue Jul 20 11:59:24 2021 +0200

framework: fix multiple-free in VclToolBarManager::Destroy()

Multiple ImplToolItem with mnId 1000 are inserted in the same ToolBox
and the problem is that only the first one gets its mpUserData set,
because setting and getting that is based on the assumption that mnId is
unique per container.

So in Destroy() for every item with mnId 1000 the same AddonsParams
object is deleted.

The problem is that in ToolBarManager::FillToolbar() the local nItemId
is copied, so its value never changes when iterating the loop because
only its copy is incremented.

(regression from ac1aefd5174258d9bcb41465ce566ed1a0819f3d)

Change-Id: Ica47051f9447c2b9d1981f8373d754874f0f31b0
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/119228
Tested-by: Jenkins
Reviewed-by: Michael Stahl 

diff --git a/framework/inc/uielement/toolbarmanager.hxx 
b/framework/inc/uielement/toolbarmanager.hxx
index 8a87c2a6b78a..6de526423d38 100644
--- a/framework/inc/uielement/toolbarmanager.hxx
+++ b/framework/inc/uielement/toolbarmanager.hxx
@@ -92,7 +92,7 @@ public:
 virtual vcl::ImageType GetImageSize() = 0;
 virtual void ConnectCallbacks(ToolBarManager* pManager) = 0;
 virtual void SetMenuType(ToolBoxMenuType eType) = 0;
-virtual void MergeToolbar(ToolBoxItemId nItemId,
+virtual void MergeToolbar(ToolBoxItemId & rItemId,
   const OUString& rModuleIdentifier,
   CommandToInfoMap& rCommandMap,
   MergeToolbarInstruction& rInstruction) = 0;
diff --git a/framework/source/uielement/toolbarmanager.cxx 
b/framework/source/uielement/toolbarmanager.cxx
index f08cfe60a6d8..e85de886b442 100644
--- a/framework/source/uielement/toolbarmanager.cxx
+++ b/framework/source/uielement/toolbarmanager.cxx
@@ -333,7 +333,7 @@ public:
 m_pToolBar->SetMenuType( eType );
 }
 
-virtual void MergeToolbar(ToolBoxItemId nItemId,
+virtual void MergeToolbar(ToolBoxItemId & rItemId,
   const OUString& rModuleIdentifier,
   CommandToInfoMap& rCommandMap,
   MergeToolbarInstruction& rInstruction) override
@@ -349,7 +349,7 @@ public:
 {
 ToolBarMerger::ProcessMergeOperation( m_pToolBar,
 aRefPoint.nPos,
-nItemId,
+rItemId,
 rCommandMap,
 rModuleIdentifier,
 rInstruction.aMergeCommand,
@@ -359,7 +359,7 @@ public:
 else
 {
 ToolBarMerger::ProcessMergeFallback( m_pToolBar,
-nItemId,
+rItemId,
 rCommandMap,
 rModuleIdentifier,
 rInstruction.aMergeCommand,
@@ -521,7 +521,7 @@ public:
 
 virtual void SetMenuType(ToolBoxMenuType /*eType*/) override {}
 
-virtual void MergeToolbar(ToolBoxItemId /*nItemId*/,
+virtual void MergeToolbar(ToolBoxItemId & /*rItemId*/,
   const OUString& /*rModuleIdentifier*/,
   CommandToInfoMap& /*rCommandMap*/,
   MergeToolbarInstruction& /*rInstruction*/) 
override {}
diff --git a/framework/source/uielement/toolbarmerger.cxx 
b/framework/source/uielement/toolbarmerger.cxx
index 652383988bcd..faba3cb4e8d9 100644
--- a/framework/source/uielement/toolbarmerger.cxx
+++ b/framework/source/uielement/toolbarmerger.cxx
@@ -623,6 +623,8 @@ rtl::Reference<::cppu::OWeakObject> 
ToolBarMerger::CreateController(
 
 void ToolBarMerger::CreateToolbarItem( ToolBox* pToolbar, 
ToolBox::ImplToolItems::size_type nPos, ToolBoxItemId nItemId, const 
AddonToolbarItem& rItem )
 {
+assert(pToolbar->GetItemData(nItemId) == nullptr); // that future would 
contain a double free
+
 pToolbar->InsertItem( nItemId, rItem.aLabel, ToolBoxItemBits::NONE, nPos );
 pToolbar->SetItemCommand( nItemId, rItem.aCommandURL );
 

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

2019-11-04 Thread Caolán McNamara (via logerrit)
 framework/inc/uielement/FixedImageToolbarController.hxx|6 +++---
 framework/source/uielement/FixedImageToolbarController.cxx |4 ++--
 include/vcl/toolkit/group.hxx  |5 -
 include/vcl/toolkit/imgctrl.hxx|6 --
 include/vcl/toolkit/morebtn.hxx|4 
 include/vcl/toolkit/prgsbar.hxx|4 
 include/vcl/toolkit/roadmap.hxx|4 
 include/vcl/toolkit/spin.hxx   |5 -
 include/vcl/toolkit/tabdlg.hxx |4 
 include/vcl/toolkit/throbber.hxx   |4 
 include/vcl/toolkit/unowrap.hxx|4 
 solenv/clang-format/blacklist  |2 +-
 toolkit/source/awt/vclxtoolkit.cxx |2 +-
 toolkit/source/awt/vclxwindows.cxx |2 +-
 vcl/source/app/salvtables.cxx  |2 +-
 vcl/source/control/prgsbar.cxx |2 +-
 vcl/source/window/builder.cxx  |2 +-
 vcl/workben/svpclient.cxx  |8 +++-
 18 files changed, 50 insertions(+), 20 deletions(-)

New commits:
commit 074cab391c20be872a4b5d14a342eda5c541b6fd
Author: Caolán McNamara 
AuthorDate: Mon Nov 4 12:07:22 2019 +
Commit: Caolán McNamara 
CommitDate: Mon Nov 4 16:45:12 2019 +0100

ProgressBar now only use in vcl and toolkit

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

diff --git a/include/vcl/prgsbar.hxx b/include/vcl/toolkit/prgsbar.hxx
similarity index 95%
rename from include/vcl/prgsbar.hxx
rename to include/vcl/toolkit/prgsbar.hxx
index 292c54a13254..9b9f251c81d2 100644
--- a/include/vcl/prgsbar.hxx
+++ b/include/vcl/toolkit/prgsbar.hxx
@@ -20,6 +20,10 @@
 #ifndef INCLUDED_VCL_PRGSBAR_HXX
 #define INCLUDED_VCL_PRGSBAR_HXX
 
+#if !defined(VCL_DLLIMPLEMENTATION) && !defined(TOOLKIT_DLLIMPLEMENTATION)
+#error "don't use this in new code"
+#endif
+
 #include 
 #include 
 
diff --git a/solenv/clang-format/blacklist b/solenv/clang-format/blacklist
index cbc4723e32b8..081e8b37fca3 100644
--- a/solenv/clang-format/blacklist
+++ b/solenv/clang-format/blacklist
@@ -7855,7 +7855,6 @@ include/vcl/pngread.hxx
 include/vcl/pngwrite.hxx
 include/vcl/popupmenuwindow.hxx
 include/vcl/ppdparser.hxx
-include/vcl/prgsbar.hxx
 include/vcl/print.hxx
 include/vcl/prntypes.hxx
 include/vcl/ptrstyle.hxx
@@ -7901,6 +7900,7 @@ include/vcl/toolkit/fixedhyper.hxx
 include/vcl/toolkit/group.hxx
 include/vcl/toolkit/imgctrl.hxx
 include/vcl/toolkit/morebtn.hxx
+include/vcl/toolkit/prgsbar.hxx
 include/vcl/toolkit/roadmap.hxx
 include/vcl/toolkit/spin.hxx
 include/vcl/toolkit/tabdlg.hxx
diff --git a/toolkit/source/awt/vclxtoolkit.cxx 
b/toolkit/source/awt/vclxtoolkit.cxx
index a32c26cc5765..c73e2fca05fd 100644
--- a/toolkit/source/awt/vclxtoolkit.cxx
+++ b/toolkit/source/awt/vclxtoolkit.cxx
@@ -90,7 +90,7 @@
 #include 
 #include 
 #include 
-#include 
+#include 
 #include 
 #include 
 #include 
diff --git a/toolkit/source/awt/vclxwindows.cxx 
b/toolkit/source/awt/vclxwindows.cxx
index 69f391824723..5645bf099288 100644
--- a/toolkit/source/awt/vclxwindows.cxx
+++ b/toolkit/source/awt/vclxwindows.cxx
@@ -49,7 +49,7 @@
 #include 
 #include 
 #include 
-#include 
+#include 
 #include 
 #include 
 #include 
diff --git a/vcl/source/app/salvtables.cxx b/vcl/source/app/salvtables.cxx
index 2c59c5868c3d..bd367355eb62 100644
--- a/vcl/source/app/salvtables.cxx
+++ b/vcl/source/app/salvtables.cxx
@@ -53,7 +53,7 @@
 #include 
 #include 
 #include 
-#include 
+#include 
 #include 
 #include 
 #include 
diff --git a/vcl/source/control/prgsbar.cxx b/vcl/source/control/prgsbar.cxx
index 2531423a922f..16ec32de0597 100644
--- a/vcl/source/control/prgsbar.cxx
+++ b/vcl/source/control/prgsbar.cxx
@@ -19,7 +19,7 @@
 
 #include 
 #include 
-#include 
+#include 
 #include 
 #include 
 #include 
diff --git a/vcl/source/window/builder.cxx b/vcl/source/window/builder.cxx
index c06fa544e54a..35758ce26ac2 100644
--- a/vcl/source/window/builder.cxx
+++ b/vcl/source/window/builder.cxx
@@ -34,7 +34,7 @@
 #include 
 #include 
 #include 
-#include 
+#include 
 #include 
 #include 
 #include 
commit 57aa9ea3a6d178fcea016fadb005dfbcc2ca2e8d
Author: Caolán McNamara 
AuthorDate: Mon Nov 4 10:04:25 2019 +
Commit: Caolán McNamara 
CommitDate: Mon Nov 4 16:44:54 2019 +0100

readme not a sufficient indicator

Change-Id: Idd5cd004b873280e202b16c182356977045bdab4
Reviewed-on: https://gerrit.libreoffice.org/81993
Tested-by: Jenkins
Reviewed-by: Caolán McNamara 
Tested-by: Caolán McNamara 

diff --git 

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

2019-08-24 Thread Noel Grandin (via logerrit)
 framework/inc/classes/actiontriggerpropertyset.hxx |2 -
 framework/inc/classes/actiontriggerseparatorpropertyset.hxx|2 -
 framework/inc/helper/uiconfigelementwrapperbase.hxx|2 -
 framework/inc/helper/uielementwrapperbase.hxx  |2 -
 framework/inc/jobs/jobconst.hxx|6 +--
 framework/inc/tabwin/tabwindow.hxx |2 -
 framework/inc/uielement/constitemcontainer.hxx |2 -
 framework/inc/uielement/rootitemcontainer.hxx  |2 -
 framework/source/fwe/classes/actiontriggerpropertyset.cxx  |   10 +
 framework/source/fwe/classes/actiontriggerseparatorpropertyset.cxx |   10 +
 framework/source/fwe/classes/addonsoptions.cxx |   12 
+++
 framework/source/fwi/jobs/jobconst.cxx |   17 
++
 framework/source/fwi/uielement/constitemcontainer.cxx  |9 +
 framework/source/fwi/uielement/rootitemcontainer.cxx   |9 +
 framework/source/helper/uiconfigelementwrapperbase.cxx |   10 +
 framework/source/helper/uielementwrapperbase.cxx   |9 +
 framework/source/jobs/jobresult.cxx|6 +--
 framework/source/jobs/shelljob.cxx |2 -
 framework/source/services/autorecovery.cxx |6 +--
 framework/source/tabwin/tabwindow.cxx  |   10 +
 include/framework/addonsoptions.hxx|4 +-
 include/svtools/langtab.hxx|2 -
 svtools/source/misc/langtab.cxx|6 +--
 23 files changed, 48 insertions(+), 94 deletions(-)

New commits:
commit d53144e9d185b7b0b41d887c689c13bf27cd9906
Author: Noel Grandin 
AuthorDate: Sat Aug 24 09:23:13 2019 +0200
Commit: Noel Grandin 
CommitDate: Sat Aug 24 14:25:55 2019 +0200

loplugin:returnconstval in svtools

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

diff --git a/include/svtools/langtab.hxx b/include/svtools/langtab.hxx
index a53e928c9998..9038fb24d421 100644
--- a/include/svtools/langtab.hxx
+++ b/include/svtools/langtab.hxx
@@ -42,7 +42,7 @@ public:
 
 // Add LRE or RLE embedding characters to the string based on the
 // String content (see #i78466#, #i32179#)
-SVT_DLLPUBLIC const OUString ApplyLreOrRleEmbedding( const OUString  );
+SVT_DLLPUBLIC OUString ApplyLreOrRleEmbedding( const OUString  );
 
 #endif
 
diff --git a/svtools/source/misc/langtab.cxx b/svtools/source/misc/langtab.cxx
index c10561f8f87c..1e04933cd377 100644
--- a/svtools/source/misc/langtab.cxx
+++ b/svtools/source/misc/langtab.cxx
@@ -47,7 +47,7 @@ public:
 SvtLanguageTableImpl();
 
 boolHasType( const LanguageType eType ) const;
-const OUString  GetString( const LanguageType eType ) const;
+OUStringGetString( const LanguageType eType ) const;
 LanguageTypeGetType( const OUString& rStr ) const;
 sal_uInt32  GetEntryCount() const;
 LanguageTypeGetTypeAtIndex( sal_uInt32 nIndex ) const;
@@ -76,7 +76,7 @@ namespace {
 struct theLanguageTable : public rtl::Static< SvtLanguageTableImpl, 
theLanguageTable > {};
 }
 
-const OUString ApplyLreOrRleEmbedding( const OUString  )
+OUString ApplyLreOrRleEmbedding( const OUString  )
 {
 const sal_Int32 nLen = rText.getLength();
 if (nLen == 0)
@@ -207,7 +207,7 @@ bool SvtLanguageTable::HasLanguageType( const LanguageType 
eType )
 return theLanguageTable::get().HasType( eType );
 }
 
-const OUString SvtLanguageTableImpl::GetString( const LanguageType eType ) 
const
+OUString SvtLanguageTableImpl::GetString( const LanguageType eType ) const
 {
 LanguageType eLang = MsLangId::getReplacementForObsoleteLanguage( eType );
 sal_uInt32 nPos = FindIndex(eLang);
commit d4f9f4b2d57c4f51c026fd114934dd63f4ece13e
Author: Noel Grandin 
AuthorDate: Sat Aug 24 09:22:40 2019 +0200
Commit: Noel Grandin 
CommitDate: Sat Aug 24 14:25:42 2019 +0200

loplugin:returnconstval in framework

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

diff --git a/framework/inc/classes/actiontriggerpropertyset.hxx 
b/framework/inc/classes/actiontriggerpropertyset.hxx
index 15cacb23e7cc..19a2a5e0dfd3 100644
--- a/framework/inc/classes/actiontriggerpropertyset.hxx
+++ b/framework/inc/classes/actiontriggerpropertyset.hxx
@@ -80,7 +80,7 @@ class ActionTriggerPropertySet :  private cppu::BaseMutex,
 
 virtual css::uno::Reference< css::beans::XPropertySetInfo > SAL_CALL 
getPropertySetInfo() override;
 
-static const 

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

2019-07-19 Thread Noel Grandin (via logerrit)
 framework/inc/dispatch/interceptionhelper.hxx |3 
 framework/source/accelerators/presethandler.cxx   |   16 +---
 framework/source/dispatch/closedispatcher.cxx |2 
 framework/source/dispatch/dispatchprovider.cxx|6 -
 framework/source/dispatch/interceptionhelper.cxx  |6 -
 framework/source/dispatch/startmoduledispatcher.cxx   |4 -
 framework/source/fwe/classes/framelistanalyzer.cxx|2 
 framework/source/fwe/classes/rootactiontriggercontainer.cxx   |3 
 framework/source/fwe/helper/titlehelper.cxx   |8 +-
 framework/source/fwi/helper/mischelper.cxx|2 
 framework/source/helper/ocomponentaccess.cxx  |8 +-
 framework/source/helper/oframes.cxx   |4 -
 framework/source/jobs/helponstartup.cxx   |5 -
 framework/source/layoutmanager/helpers.cxx|4 -
 framework/source/layoutmanager/layoutmanager.cxx  |   16 ++--
 framework/source/layoutmanager/toolbarlayoutmanager.cxx   |   11 +--
 framework/source/loadenv/loadenv.cxx  |   16 ++--
 framework/source/services/autorecovery.cxx|6 -
 framework/source/services/desktop.cxx |   17 ++--
 framework/source/services/dispatchhelper.cxx  |2 
 framework/source/services/frame.cxx   |   28 
+++-
 framework/source/tabwin/tabwindow.cxx |   17 ++--
 framework/source/uiconfiguration/moduleuicfgsupplier.cxx  |3 
 framework/source/uiconfiguration/moduleuiconfigurationmanager.cxx |   25 
++-
 framework/source/uiconfiguration/uiconfigurationmanager.cxx   |   25 
++-
 framework/source/uielement/buttontoolbarcontroller.cxx|2 
 framework/source/uielement/menubarmanager.cxx |   14 ++--
 framework/source/uielement/menubarwrapper.cxx |2 
 framework/source/uielement/newmenucontroller.cxx  |2 
 framework/source/uielement/popuptoolbarcontroller.cxx |2 
 framework/source/uielement/progressbarwrapper.cxx |   10 +-
 framework/source/uielement/statusbarmanager.cxx   |3 
 framework/source/uielement/toolbarmanager.cxx |2 
 linguistic/source/convdic.cxx |3 
 linguistic/source/convdiclist.cxx |8 +-
 linguistic/source/dlistimp.cxx|7 --
 linguistic/source/gciterator.cxx  |4 -
 linguistic/source/lngsvcmgr.cxx   |   35 
++
 linguistic/source/misc.cxx|2 
 linguistic/source/spelldta.cxx|2 
 40 files changed, 142 insertions(+), 195 deletions(-)

New commits:
commit defdd8bebe40b48d8abc4d893ac9a82b550c5d19
Author: Noel Grandin 
AuthorDate: Fri Jul 19 20:07:42 2019 +0200
Commit: Noel Grandin 
CommitDate: Sat Jul 20 07:55:53 2019 +0200

loplugin:referencecasting in linguistic

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

diff --git a/linguistic/source/convdic.cxx b/linguistic/source/convdic.cxx
index 7c2c602a79fa..482ae2f2c880 100644
--- a/linguistic/source/convdic.cxx
+++ b/linguistic/source/convdic.cxx
@@ -257,8 +257,7 @@ void ConvDic::Save()
 xSaxWriter->setOutputStream( xStream->getOutputStream() );
 
 // prepare arguments (prepend doc handler to given arguments)
-uno::Reference< xml::sax::XDocumentHandler > xDocHandler( xSaxWriter, 
UNO_QUERY );
-rtl::Reference pExport = new ConvDicXMLExport( 
*this, aMainURL, xDocHandler );
+rtl::Reference pExport = new ConvDicXMLExport( 
*this, aMainURL, xSaxWriter );
 bool bRet = pExport->Export(); // write entries to file
 DBG_ASSERT( !pStream->GetError(), "I/O error while writing to stream" 
);
 if (bRet)
diff --git a/linguistic/source/convdiclist.cxx 
b/linguistic/source/convdiclist.cxx
index 50f1799423d2..da4236dc610c 100644
--- a/linguistic/source/convdiclist.cxx
+++ b/linguistic/source/convdiclist.cxx
@@ -391,10 +391,10 @@ ConvDicNameContainer & ConvDicList::GetNameContainer()
 
 // since there is no UI to active/deactivate the dictionaries
 // for chinese text conversion they should be activated by default
-uno::Reference< XConversionDictionary > xS2TDic(
-mxNameContainer->GetByName( "ChineseS2T" ), UNO_QUERY );
-uno::Reference< XConversionDictionary > xT2SDic(
-

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

2019-02-23 Thread Libreoffice Gerrit user
 framework/inc/helper/titlebarupdate.hxx |2 -
 framework/inc/helper/vclstatusindicator.hxx |3 -
 framework/inc/jobs/jobdata.hxx  |   10 -
 framework/inc/services/desktop.hxx  |1 
 framework/inc/services/layoutmanager.hxx|1 
 framework/inc/uielement/toolbarmerger.hxx   |2 -
 framework/source/accelerators/presethandler.cxx |   13 --
 framework/source/helper/titlebarupdate.cxx  |1 
 framework/source/helper/vclstatusindicator.cxx  |3 -
 framework/source/inc/accelerators/presethandler.hxx |   32 
 framework/source/jobs/job.cxx   |1 
 framework/source/jobs/jobdata.cxx   |   25 
 framework/source/layoutmanager/layoutmanager.cxx|1 
 framework/source/layoutmanager/toolbarlayoutmanager.cxx |1 
 framework/source/layoutmanager/toolbarlayoutmanager.hxx |1 
 framework/source/services/desktop.cxx   |2 -
 framework/source/uielement/addonstoolbarmanager.cxx |1 
 framework/source/uielement/toolbarmerger.cxx|2 -
 sdext/source/presenter/PresenterController.cxx  |4 --
 sdext/source/presenter/PresenterPaneBase.cxx|8 
 sdext/source/presenter/PresenterPaneBase.hxx|2 -
 sdext/source/presenter/PresenterPaneContainer.cxx   |9 
 sdext/source/presenter/PresenterPaneContainer.hxx   |6 ---
 sdext/source/presenter/PresenterPaneFactory.cxx |   11 -
 sdext/source/presenter/PresenterScreen.cxx  |3 -
 sdext/source/presenter/PresenterScreen.hxx  |1 
 sdext/source/presenter/PresenterToolBar.cxx |3 -
 sdext/source/presenter/PresenterToolBar.hxx |1 
 28 files changed, 5 insertions(+), 145 deletions(-)

New commits:
commit d55fb1552f6ecd5c2f9e817d2b820e1a66410840
Author: Noel Grandin 
AuthorDate: Fri Feb 22 15:50:53 2019 +0200
Commit: Noel Grandin 
CommitDate: Sun Feb 24 07:39:23 2019 +0100

loplugin:unusedfields in framework

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

diff --git a/framework/inc/helper/titlebarupdate.hxx 
b/framework/inc/helper/titlebarupdate.hxx
index ab93896ec273..f835b915d89f 100644
--- a/framework/inc/helper/titlebarupdate.hxx
+++ b/framework/inc/helper/titlebarupdate.hxx
@@ -54,8 +54,6 @@ class TitleBarUpdate : public  ::cppu::WeakImplHelper<
 {
 /// internal id of this module
 OUString sID;
-/// localized name for this module
-OUString sUIName;
 /// configured icon for this module
 ::sal_Int32 nIcon;
 };
diff --git a/framework/inc/helper/vclstatusindicator.hxx 
b/framework/inc/helper/vclstatusindicator.hxx
index 5665b2a394ee..1462616d7793 100644
--- a/framework/inc/helper/vclstatusindicator.hxx
+++ b/framework/inc/helper/vclstatusindicator.hxx
@@ -52,9 +52,6 @@ class VCLStatusIndicator : public  ::cppu::WeakImplHelper< 
css::task::XStatusInd
 */
 VclPtr m_pStatusBar;
 
-/** knows the current info text of the progress. */
-OUString m_sText;
-
 /** knows the current range of the progress. */
 sal_Int32 m_nRange;
 
diff --git a/framework/inc/jobs/jobdata.hxx b/framework/inc/jobs/jobdata.hxx
index 1b5ec7c41dc6..5f36411463c5 100644
--- a/framework/inc/jobs/jobdata.hxx
+++ b/framework/inc/jobs/jobdata.hxx
@@ -164,15 +164,6 @@ class JobData final
  */
 std::vector< css::beans::NamedValue > m_lArguments;
 
-/**
-after a job was successfully executed (by any outside code using 
our
-information) it can return a result. This member make it part of 
this
-container too. So it can be used for further things.
-We use it also to update our internal state and the configuration
-of the job. But note: only the last result will be saved here!
- */
-JobResult m_aLastExecutionResult;
-
 // native interface
 
 public:
@@ -200,7 +191,6 @@ class JobData final
 void setEvent   ( const 
OUString&  sEvent   ,
   const 
OUString&  sAlias   );
 void setJobConfig   ( const 
std::vector< css::beans::NamedValue >& lArguments   );
-void setResult  ( const 
JobResult&aResult  );
 void disableJob (  

[Libreoffice-commits] core.git: 2 commits - framework/inc framework/source officecfg/registry sw/uiconfig sw/UIConfig_swriter.mk

2019-02-16 Thread Libreoffice Gerrit user
 framework/inc/services/layoutmanager.hxx |2 
 framework/source/layoutmanager/layoutmanager.cxx |  169 
+++---
 officecfg/registry/data/org/openoffice/Office/UI/GenericCommands.xcu |5 
 sw/UIConfig_swriter.mk   |1 
 sw/uiconfig/swriter/menubar/mscompatibleformsmenu.xml|   29 +
 5 files changed, 158 insertions(+), 48 deletions(-)

New commits:
commit dc3a2546bd0ad0afe20cba9940934405174fd593
Author: Tamás Zolnai 
AuthorDate: Fri Feb 15 18:37:40 2019 +0100
Commit: Tamás Zolnai 
CommitDate: Sat Feb 16 16:12:48 2019 +0100

MSForms: Introduce a new Forms menu which is compatible with MS Word

* It's a Writer only menu by now
* Displayed when the compatibility option is set
* The menubar is changed during creation, so the option
has an effect only after a restart.
* MS compatible Forms menu contains only some ActiveX controls now

Change-Id: I459f489c15ea7a25514f379b1800b926cc2087ce
Reviewed-on: https://gerrit.libreoffice.org/67904
Tested-by: Jenkins
Reviewed-by: Tamás Zolnai 

diff --git a/framework/inc/services/layoutmanager.hxx 
b/framework/inc/services/layoutmanager.hxx
index 1cd9f1d99ff7..6e15d58e2442 100644
--- a/framework/inc/services/layoutmanager.hxx
+++ b/framework/inc/services/layoutmanager.hxx
@@ -178,6 +178,7 @@ namespace framework
 void implts_reset( bool bAttach );
 void implts_updateMenuBarClose();
 bool implts_resetMenuBar();
+void implts_createMSCompatibleMenuBar(const OUString& rName);
 
 //  locking
 
diff --git a/framework/source/layoutmanager/layoutmanager.cxx 
b/framework/source/layoutmanager/layoutmanager.cxx
index b48e69c3b9e6..5cb364df9285 100644
--- a/framework/source/layoutmanager/layoutmanager.cxx
+++ b/framework/source/layoutmanager/layoutmanager.cxx
@@ -74,6 +74,7 @@
 #include 
 #include 
 #include 
+#include 
 
 #include 
 #include 
@@ -157,6 +158,14 @@ void LayoutManager::implts_createMenuBar(const OUString& 
rMenuBarName)
 {
 SolarMutexClearableGuard aWriteLock;
 
+// Create a customized menu if compatibility mode is on
+SvtCompatibilityViewOptions aCompOptions;
+if( aCompOptions.HasMSOCompatibleFormsMenu() && m_aModuleIdentifier == 
"com.sun.star.text.TextDocument" )
+{
+implts_createMSCompatibleMenuBar(rMenuBarName);
+}
+
+// Create the default menubar otherwise
 if (!m_bInplaceMenuSet && !m_xMenuBar.is())
 {
 m_xMenuBar = implts_createElement( rMenuBarName );
@@ -209,6 +218,8 @@ void LayoutManager::impl_clearUpMenuBar()
 {
 implts_lock();
 
+implts_resetInplaceMenuBar();
+
 // Clear up VCL menu bar to prepare shutdown
 if ( m_xContainerWindow.is() )
 {
@@ -2524,6 +2535,60 @@ bool LayoutManager::implts_resetMenuBar()
 return false;
 }
 
+void LayoutManager::implts_createMSCompatibleMenuBar( const OUString& aName )
+{
+SolarMutexClearableGuard aWriteLock;
+
+// Find Forms menu in the original menubar
+m_xMenuBar = implts_createElement( aName );
+uno::Reference< XUIElementSettings > xMenuBarSettings(m_xMenuBar, 
UNO_QUERY);
+uno::Reference< container::XIndexReplace > 
xMenuIndex(xMenuBarSettings->getSettings(true), UNO_QUERY);
+
+sal_Int32 nFormsMenu = -1;
+for (sal_Int32 nIndex = 0; nIndex < xMenuIndex->getCount(); ++nIndex)
+{
+uno::Sequence< beans::PropertyValue > aProps;
+xMenuIndex->getByIndex( nIndex ) >>= aProps;
+OUString aCommand;
+for (sal_Int32 nSeqInd = 0; nSeqInd < aProps.getLength(); ++nSeqInd)
+{
+if (aProps[nSeqInd].Name == "CommandURL")
+{
+aProps[nSeqInd].Value >>= aCommand;
+break;
+}
+}
+
+if (aCommand == ".uno:FormatFormMenu")
+nFormsMenu = nIndex;
+}
+assert(nFormsMenu != -1);
+
+// Create the MS compatible Forms menu
+css::uno::Reference< css::ui::XUIElement > xFormsMenu = 
implts_createElement( "private:resource/menubar/mscompatibleformsmenu" );
+if(!xFormsMenu.is())
+return;
+
+// Merge the MS compatible Forms menu into the menubar
+uno::Reference< XUIElementSettings > xFormsMenuSettings(xFormsMenu, 
UNO_QUERY);
+uno::Reference< container::XIndexAccess > 
xFormsMenuIndex(xFormsMenuSettings->getSettings(true));
+
+assert(xFormsMenuIndex->getCount() >= 1);
+uno::Sequence< beans::PropertyValue > aNewFormsMenu;
+xFormsMenuIndex->getByIndex( 0 ) >>= aNewFormsMenu;
+xMenuIndex->replaceByIndex(nFormsMenu, uno::makeAny(aNewFormsMenu));
+
+setMergedMenuBar( xMenuIndex );
+
+// Clear up the temporal forms menubar
+Reference< XComponent > xFormsMenuComp( xFormsMenu, UNO_QUERY );
+if ( xFormsMenuComp.is() )
+xFormsMenuComp->dispose();
+xFormsMenu.clear();
+
+aWriteLock.clear();
+}
+
 

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

2018-01-23 Thread Noel Grandin
 framework/inc/services/layoutmanager.hxx|4 ++--
 framework/inc/xml/imagesconfiguration.hxx   |8 +++-
 framework/source/layoutmanager/layoutmanager.cxx|   11 +--
 framework/source/layoutmanager/toolbarlayoutmanager.cxx |7 +++
 framework/source/layoutmanager/toolbarlayoutmanager.hxx |4 ++--
 framework/source/uiconfiguration/imagemanagerimpl.cxx   |2 +-
 framework/source/xml/imagesdocumenthandler.cxx  |8 
 7 files changed, 20 insertions(+), 24 deletions(-)

New commits:
commit cfb598178b2b38023c9237578904303bea7962e7
Author: Noel Grandin 
Date:   Wed Jan 17 13:24:50 2018 +0200

loplugin:useuniqueptr in ImageListsDescriptor

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

diff --git a/framework/inc/xml/imagesconfiguration.hxx 
b/framework/inc/xml/imagesconfiguration.hxx
index 68291bea7a26..1ead958915cc 100644
--- a/framework/inc/xml/imagesconfiguration.hxx
+++ b/framework/inc/xml/imagesconfiguration.hxx
@@ -76,12 +76,10 @@ typedef 
std::vector ImageListDescript
 
 struct ImageListsDescriptor
 {
-ImageListsDescriptor() : pImageList( nullptr ),
- pExternalImageList( nullptr ) {}
-~ImageListsDescriptor() { delete pImageList; delete pExternalImageList; }
+ImageListsDescriptor() {}
 
-ImageListDescriptor*pImageList;
-ExternalImageItemListDescriptor*pExternalImageList;
+std::unique_ptr pImageList;
+std::unique_ptr pExternalImageList;
 };
 
 class ImagesConfiguration
diff --git a/framework/source/uiconfiguration/imagemanagerimpl.cxx 
b/framework/source/uiconfiguration/imagemanagerimpl.cxx
index f47666b5270f..ee88e2756541 100644
--- a/framework/source/uiconfiguration/imagemanagerimpl.cxx
+++ b/framework/source/uiconfiguration/imagemanagerimpl.cxx
@@ -400,7 +400,7 @@ bool ImageManagerImpl::implts_storeUserImages(
 if ( pImageList->GetImageCount() > 0 )
 {
 ImageListsDescriptor aUserImageListInfo;
-aUserImageListInfo.pImageList = new ImageListDescriptor;
+aUserImageListInfo.pImageList.reset( new ImageListDescriptor );
 
 ImageListItemDescriptor* pList = new ImageListItemDescriptor;
 aUserImageListInfo.pImageList->push_back( 
std::unique_ptr(pList) );
diff --git a/framework/source/xml/imagesdocumenthandler.cxx 
b/framework/source/xml/imagesdocumenthandler.cxx
index cc0278807052..327e666fde9d 100644
--- a/framework/source/xml/imagesdocumenthandler.cxx
+++ b/framework/source/xml/imagesdocumenthandler.cxx
@@ -197,7 +197,7 @@ void SAL_CALL OReadImagesDocumentHandler::startElement(
 }
 
 if ( !m_aImageList.pImageList )
-m_aImageList.pImageList = new ImageListDescriptor;
+m_aImageList.pImageList.reset( new ImageListDescriptor );
 
 m_bImagesStartFound = true;
 m_pImages = new ImageListItemDescriptor;
@@ -511,7 +511,7 @@ void SAL_CALL OReadImagesDocumentHandler::endElement(const 
OUString& aName)
 if ( m_pExternalImages && !m_aImageList.pExternalImageList )
 {
 if ( !m_aImageList.pExternalImageList )
-m_aImageList.pExternalImageList = m_pExternalImages;
+m_aImageList.pExternalImageList.reset( 
m_pExternalImages );
 }
 
 m_bExternalImagesStartFound = false;
@@ -614,7 +614,7 @@ void OWriteImagesDocumentHandler::WriteImagesDocument()
 
 if ( m_aImageListsItems.pImageList )
 {
-ImageListDescriptor* pImageList = m_aImageListsItems.pImageList;
+ImageListDescriptor* pImageList = m_aImageListsItems.pImageList.get();
 
 for ( size_t i = 0; i < m_aImageListsItems.pImageList->size(); i++ )
 {
@@ -625,7 +625,7 @@ void OWriteImagesDocumentHandler::WriteImagesDocument()
 
 if ( m_aImageListsItems.pExternalImageList )
 {
-WriteExternalImageList( m_aImageListsItems.pExternalImageList );
+WriteExternalImageList( m_aImageListsItems.pExternalImageList.get() );
 }
 
 m_xWriteDocumentHandler->ignorableWhitespace( OUString() );
commit 570786e75add710df9bf77fa53b75e22dc29de89
Author: Noel Grandin 
Date:   Wed Jan 17 13:14:38 2018 +0200

loplugin:useuniqueptr in LayoutManager

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

diff --git a/framework/inc/services/layoutmanager.hxx 
b/framework/inc/services/layoutmanager.hxx
index 8ef46a21de72..eaecc6fa8e87 100644
--- 

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

2018-01-18 Thread Miklos Vajna
 framework/inc/classes/taskcreator.hxx|3 ++-
 framework/source/classes/taskcreator.cxx |   10 --
 framework/source/loadenv/loadenv.cxx |4 +++-
 framework/source/services/desktop.cxx|4 ++--
 framework/source/services/frame.cxx  |   23 ---
 framework/source/services/taskcreatorsrv.cxx |9 +
 include/vcl/window.hxx   |7 ++-
 solenv/clang-format/reformat-formatted-files |   18 --
 8 files changed, 62 insertions(+), 16 deletions(-)

New commits:
commit abe4eaf57be93300be4710aee0bc283055403f4b
Author: Miklos Vajna 
Date:   Wed Jan 17 23:07:50 2018 +0100

clang-format: allow just listing formatted files

Without running clang-format on them. Also format one file at a time, so
we don't run into command line length limits as the number of formatted
files grows.

Change-Id: Ie559d566db784e04965678f056dcb81cefe95378
Reviewed-on: https://gerrit.libreoffice.org/48085
Reviewed-by: Miklos Vajna 
Tested-by: Jenkins 

diff --git a/solenv/clang-format/reformat-formatted-files 
b/solenv/clang-format/reformat-formatted-files
index 5059251682d3..04b0adde8e4e 100755
--- a/solenv/clang-format/reformat-formatted-files
+++ b/solenv/clang-format/reformat-formatted-files
@@ -7,6 +7,7 @@
 
 # Reformat files which are not blacklisted. This is interesting if the
 # clang-format version or config changes.
+# -n allows just listing the formatted files.
 
 use strict;
 use warnings;
@@ -17,6 +18,7 @@ my $clang_format = ClangFormat::find();
 my $src = ClangFormat::get_extension_regex();
 my $blacklist_names = ClangFormat::get_blacklist();
 my @filenames = ();
+my $dry_run = 0;
 
 # Get a list of files.
 open (FILES, "git ls-files |") ||  die "Cannot run git ls-files.";
@@ -29,7 +31,19 @@ while (my $filename = )
 }
 }
 
-print("$clang_format -i " . join(" ", @filenames) . "\n");
-system("$clang_format -i " . join(" ", @filenames) . "\n");
+if ($#ARGV ge 0 && $ARGV[0] eq "-n")
+{
+$dry_run = 1;
+}
+
+foreach my $filename (@filenames)
+{
+my $command = $clang_format . " -i " . $filename;
+print($filename . "\n");
+if (!$dry_run)
+{
+system($command);
+}
+}
 
 # vim: set shiftwidth=4 softtabstop=4 expandtab:
commit 4a0f506f0d8c2a017f0cf880481d3c0c32a48909
Author: Miklos Vajna 
Date:   Wed Jan 17 17:24:35 2018 +0100

framework: disable layout manager in hidden frames

The point of hidden frames is that they are not visible on the UI, only 
their
doc model / layout is accessible via the API or file format conversion. That
means that laying out the UI elements like menus and toolbars is pointless.

So change Frame::initialize() and Frame::setLayoutManager() to not enable 
the
layout manager for hidden frames. To do this, we need a new window style 
flag,
as both hidden and visible frames have an underlying hidden window at the 
time
the framework layout manager would be enabled.

Times for 200 hello world inputs: 5780 -> 5054 ms is spent in XHTML-load + 
ODT
export + close (87% of original).

Change-Id: I841507bbb62f8fc2979d20e2d579d0bb47b98f37
Reviewed-on: https://gerrit.libreoffice.org/48068
Reviewed-by: Miklos Vajna 
Tested-by: Jenkins 

diff --git a/framework/inc/classes/taskcreator.hxx 
b/framework/inc/classes/taskcreator.hxx
index 3c34bb00e1ad..ee8056f13812 100644
--- a/framework/inc/classes/taskcreator.hxx
+++ b/framework/inc/classes/taskcreator.hxx
@@ -27,6 +27,7 @@
 
 #include 
 #include 
+#include 
 
 namespace framework{
 
@@ -53,7 +54,7 @@ class TaskCreator final
  TaskCreator( const css::uno::Reference< 
css::uno::XComponentContext >& xContext );
  ~TaskCreator( 
);
 
-css::uno::Reference< css::frame::XFrame > createTask( const OUString& 
sName );
+css::uno::Reference< css::frame::XFrame > createTask( const OUString& 
sName, const utl::MediaDescriptor& rDesciprtor );
 
 }; // class TaskCreator
 
diff --git a/framework/source/classes/taskcreator.cxx 
b/framework/source/classes/taskcreator.cxx
index 612ab433e7e3..0bf720b510ac 100644
--- a/framework/source/classes/taskcreator.cxx
+++ b/framework/source/classes/taskcreator.cxx
@@ -57,7 +57,7 @@ TaskCreator::~TaskCreator()
 
/*-
 TODO document me
 
*//*-*/
-css::uno::Reference< css::frame::XFrame > TaskCreator::createTask( const 
OUString& sName )
+css::uno::Reference< css::frame::XFrame > TaskCreator::createTask( const 
OUString& sName, const 

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

2017-04-14 Thread Caolán McNamara
 framework/inc/classes/resource.hrc|8 +
 framework/source/classes/resource.src |   75 +--
 framework/source/uielement/toolbarmanager.cxx |  126 +++---
 include/svtools/helpid.hrc|5 -
 include/svtools/svtools.hrc   |2 
 svtools/UIConfig_svt.mk   |1 
 svtools/source/contnr/fileview.cxx|   36 +++
 svtools/source/contnr/fileview.hrc|   23 
 svtools/source/contnr/fileview.src|   22 
 svtools/uiconfig/ui/fileviewmenu.ui   |   25 +
 10 files changed, 151 insertions(+), 172 deletions(-)

New commits:
commit c6e96bb4519176edc8668e5a8ec20b43863cd61b
Author: Caolán McNamara 
Date:   Fri Apr 14 11:49:47 2017 +0100

rework POPUPMENU_TOOLBAR_QUICKCUSTOMIZATION

don't create a menu in order to copy certain entries under certain
conditions to another menu, just insert the specific entries
from more elemental parts

Change-Id: I2254753fdc374742422afdb40fed7e78ae5dfbb2

diff --git a/framework/inc/classes/resource.hrc 
b/framework/inc/classes/resource.hrc
index 6075d10293cb..b4325e7f23ec 100644
--- a/framework/inc/classes/resource.hrc
+++ b/framework/inc/classes/resource.hrc
@@ -49,13 +49,17 @@
 #define STR_LANGSTATUS_HINT (RID_STR_START+25)
 #define STR_REMOTE_TITLE(RID_STR_START+26)
 #define STR_SAFEMODE_TITLE  (RID_STR_START+27)
+#define STR_TOOLBAR_VISIBLE_BUTTONS (RID_STR_START+28)
+#define STR_TOOLBAR_CUSTOMIZE_TOOLBAR   (RID_STR_START+29)
+#define STR_TOOLBAR_DOCK_TOOLBAR(RID_STR_START+30)
+#define STR_TOOLBAR_DOCK_ALL_TOOLBARS   (RID_STR_START+31)
+#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 POPUPMENU_TOOLBAR_QUICKCUSTOMIZATION(RID_MENU_START+0)
-
 #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 998d3721797c..b045b6d9e029 100644
--- a/framework/source/classes/resource.src
+++ b/framework/source/classes/resource.src
@@ -39,53 +39,34 @@ String STR_CLOSEDOC_ANDRETURN
 Text [ en-US ] = "~Close & Return to " ;
 };
 
-Menu POPUPMENU_TOOLBAR_QUICKCUSTOMIZATION
-{
-ItemList =
-{
-MenuItem
-{
-Identifier = MENUITEM_TOOLBAR_VISIBLEBUTTON;
-SubMenu = Menu
-{
-};
-Text[ en-US ] = "Visible ~Buttons";
-};
-MenuItem
-{
-Identifier = MENUITEM_TOOLBAR_CUSTOMIZETOOLBAR;
-Command = ".uno:ConfigureToolboxVisible" ;
-Text[ en-US ] = "~Customize Toolbar...";
-};
-MenuItem
-{
-Separator = TRUE ;
-};
-MenuItem
-{
-Identifier = MENUITEM_TOOLBAR_DOCKTOOLBAR;
-Text[ en-US ] = "~Dock Toolbar" ;
-};
-MenuItem
-{
-Identifier = MENUITEM_TOOLBAR_DOCKALLTOOLBAR;
-Text[ en-US ] = "Dock ~All Toolbars" ;
-};
-MenuItem
-{
-Separator = TRUE ;
-};
-MenuItem
-{
-Identifier = MENUITEM_TOOLBAR_LOCKTOOLBARPOSITION;
-Text[ en-US ] = "~Lock Toolbar Position" ;
-};
-MenuItem
-{
-Identifier = MENUITEM_TOOLBAR_CLOSE;
-Text[ en-US ] = "Close ~Toolbar" ;
-};
-};
+String STR_TOOLBAR_VISIBLE_BUTTONS
+{
+Text[ en-US ] = "Visible ~Buttons";
+};
+
+String STR_TOOLBAR_CUSTOMIZE_TOOLBAR
+{
+Text[ en-US ] = "~Customize Toolbar...";
+};
+
+String STR_TOOLBAR_DOCK_TOOLBAR
+{
+Text[ en-US ] = "~Dock Toolbar" ;
+};
+
+String STR_TOOLBAR_DOCK_ALL_TOOLBARS
+{
+Text[ en-US ] = "Dock ~All Toolbars" ;
+};
+
+String STR_TOOLBAR_LOCK_TOOLBAR
+{
+Text[ en-US ] = "~Lock Toolbar Position" ;
+};
+
+String STR_TOOLBAR_CLOSE_TOOLBAR
+{
+Text[ en-US ] = "Close ~Toolbar" ;
 };
 
 String STR_SAVECOPYDOC
diff --git a/framework/source/uielement/toolbarmanager.cxx 
b/framework/source/uielement/toolbarmanager.cxx
index 0ad9f1a01f85..0f792ccb0519 100644
--- a/framework/source/uielement/toolbarmanager.cxx
+++ b/framework/source/uielement/toolbarmanager.cxx
@@ -1399,8 +1399,6 @@ bool ToolBarManager::MenuItemAllowed( sal_uInt16 ) const
 
 void ToolBarManager::AddCustomizeMenuItems(ToolBox* pToolBar)
 {
-::PopupMenu *pMenu = pToolBar->GetMenu();
-
 // No config menu entries if command ".uno:ConfigureDialog" is 

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

2016-11-06 Thread Noel Grandin
 framework/inc/helper/mischelper.hxx   |4 
 framework/source/fwe/helper/configimporter.cxx|8 
 framework/source/fwe/xml/menudocumenthandler.cxx  |9 -
 framework/source/jobs/jobdata.cxx |3 
 framework/source/jobs/jobexecutor.cxx |   12 -
 framework/source/jobs/shelljob.cxx|   25 --
 framework/source/layoutmanager/layoutmanager.cxx  |3 
 framework/source/loadenv/loadenv.cxx  |   10 -
 framework/source/uiconfiguration/globalsettings.cxx   |   17 --
 framework/source/uiconfiguration/imagemanagerimpl.cxx |4 
 framework/source/uiconfiguration/moduleuiconfigurationmanager.cxx |5 
 framework/source/uiconfiguration/uicategorydescription.cxx|   14 -
 framework/source/uielement/addonstoolbarmanager.cxx   |4 
 framework/source/uielement/recentfilesmenucontroller.cxx  |9 -
 framework/source/uielement/statusbarmanager.cxx   |   20 --
 framework/source/uielement/statusbarmerger.cxx|   39 +---
 framework/source/uielement/toolbarmanager.cxx |   23 --
 framework/source/uielement/toolbarsmenucontroller.cxx |   24 --
 framework/source/uielement/uicommanddescription.cxx   |   52 +-
 sc/inc/attarray.hxx   |1 
 sc/inc/cellsuno.hxx   |3 
 sc/inc/chgtrack.hxx   |   10 -
 sc/inc/column.hxx |1 
 sc/inc/dociter.hxx|1 
 sc/inc/document.hxx   |4 
 sc/inc/dptabsrc.hxx   |4 
 sc/inc/edittextiterator.hxx   |4 
 sc/inc/filtopt.hxx|2 
 sc/source/core/data/attarray.cxx  |   10 -
 sc/source/core/data/column.cxx|   23 --
 sc/source/core/data/column2.cxx   |5 
 sc/source/core/data/dociter.cxx   |7 
 sc/source/core/data/documen2.cxx  |5 
 sc/source/core/data/documen3.cxx  |7 
 sc/source/core/data/documen9.cxx  |   34 +---
 sc/source/core/data/dptabsrc.cxx  |   28 ---
 sc/source/core/data/edittextiterator.cxx  |   17 --
 sc/source/core/data/poolhelp.cxx  |   10 -
 sc/source/core/inc/poolhelp.hxx   |2 
 sc/source/core/tool/chgtrack.cxx  |   23 --
 sc/source/core/tool/filtopt.cxx   |   11 -
 sc/source/filter/excel/excimp8.cxx|   27 ---
 sc/source/filter/excel/xepivot.cxx|7 
 sc/source/filter/excel/xestyle.cxx|   12 -
 sc/source/filter/excel/xichart.cxx|   12 -
 sc/source/filter/excel/xihelper.cxx   |7 
 sc/source/filter/excel/xipivot.cxx|   23 --
 sc/source/filter/excel/xistream.cxx   |9 -
 sc/source/filter/excel/xistring.cxx   |2 
 sc/source/filter/excel/xistyle.cxx|7 
 sc/source/filter/html/htmlimp.cxx |2 
 sc/source/filter/inc/XclImpChangeTrack.hxx|   12 -
 sc/source/filter/inc/excimp8.hxx  |4 
 sc/source/filter/inc/htmlimp.hxx  |1 
 sc/source/filter/inc/sheetdatabuffer.hxx  |4 
 sc/source/filter/inc/viewsettings.hxx |2 
 sc/source/filter/inc/xepivot.hxx  |3 
 sc/source/filter/inc/xestyle.hxx  |   11 -
 sc/source/filter/inc/xichart.hxx  |   10 -
 sc/source/filter/inc/xihelper.hxx |2 
 sc/source/filter/inc/xipivot.hxx  |4 
 sc/source/filter/inc/xistream.hxx |6 
 sc/source/filter/inc/xistring.hxx |2 
 sc/source/filter/inc/xistyle.hxx  |2 
 sc/source/filter/oox/pagesettings.cxx |9 -
 sc/source/filter/oox/sheetdatabuffer.cxx  |  

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

2016-11-06 Thread Maxim Monastirsky
 framework/inc/uielement/newmenucontroller.hxx|2 
 framework/source/uielement/newmenucontroller.cxx |   82 ---
 include/svtools/popupmenucontrollerbase.hxx  |2 
 svtools/source/uno/popupmenucontrollerbase.cxx   |6 +
 4 files changed, 20 insertions(+), 72 deletions(-)

New commits:
commit cea3b8762bfb7f0da19bab8a3d468bcbf987eb0f
Author: Maxim Monastirsky 
Date:   Sun Nov 6 21:31:15 2016 +0200

NewMenuController: Fix template manager icon

The current logic is swapped. MenuAttributes::aImageId can be
only handled by SvFileInformationManager, while the menu item
command is what might be (in case of .uno command) handled
by CommandInfoProvider.

This gone wrong in tdf#96059 which wrongly assumed that
GetImageFromURL is equivalent to what's provided by
CommandInfoProvider (so other places should be checked too).

Change-Id: Ia487c602753dde3fb0d0462ef4b3d63209398b36

diff --git a/framework/source/uielement/newmenucontroller.cxx 
b/framework/source/uielement/newmenucontroller.cxx
index 09ca33e..e8963fd 100644
--- a/framework/source/uielement/newmenucontroller.cxx
+++ b/framework/source/uielement/newmenucontroller.cxx
@@ -72,7 +72,6 @@ DEFINE_INIT_SERVICE (   
NewMenuController, {} )
 void NewMenuController::setMenuImages( PopupMenu* pPopupMenu, bool bSetImages )
 {
 sal_uInt16 nItemCount = pPopupMenu->GetItemCount();
-Image   aImage;
 Reference< XFrame > xFrame( m_xFrame );
 
 for ( sal_uInt16 i = 0; i < nItemCount; i++ )
@@ -82,39 +81,23 @@ void NewMenuController::setMenuImages( PopupMenu* 
pPopupMenu, bool bSetImages )
 {
 if ( bSetImages )
 {
-boolbImageSet( false );
 OUString aImageId;
-
+OUString aCmd( pPopupMenu->GetItemCommand( nItemId ) );
 sal_uLong nAttributePtr = 
pPopupMenu->GetUserValue(sal::static_int_cast(i));
 MenuAttributes* pAttributes = reinterpret_cast(nAttributePtr);
 if (pAttributes)
 aImageId = pAttributes->aImageId;
 
-if ( !aImageId.isEmpty() )
-{
-aImage = 
vcl::CommandInfoProvider::Instance().GetImageForCommand(aImageId, xFrame);
-if ( !!aImage )
-{
-bImageSet = true;
-pPopupMenu->SetItemImage( nItemId, aImage );
-}
-}
-
-if ( !bImageSet )
-{
-OUString aCmd( pPopupMenu->GetItemCommand( nItemId ) );
-if ( !aCmd.isEmpty() )
-{
-INetURLObject aURLObj( aCmd );
-aImage = SvFileInformationManager::GetImageNoDefault( 
aURLObj );
-}
+INetURLObject aURLObj( aImageId.isEmpty() ? aCmd : aImageId );
+Image aImage = SvFileInformationManager::GetImageNoDefault( 
aURLObj );
+if ( !aImage )
+aImage = 
vcl::CommandInfoProvider::Instance().GetImageForCommand(aCmd, xFrame);
 
-if ( !!aImage )
-pPopupMenu->SetItemImage( nItemId, aImage );
-}
+if ( !!aImage )
+pPopupMenu->SetItemImage( nItemId, aImage );
 }
 else
-pPopupMenu->SetItemImage( nItemId, aImage );
+pPopupMenu->SetItemImage( nItemId, Image() );
 }
 }
 }
commit 5bd6b61a7cad81d8385e5bc4ea0e6546b1eb7314
Author: Maxim Monastirsky 
Date:   Sun Nov 6 20:46:04 2016 +0200

NewMenuController: Remove duplicate async dispatch handling

Change-Id: I881e6781c5ba82b0b998891532f8b7c281567b73

diff --git a/framework/inc/uielement/newmenucontroller.hxx 
b/framework/inc/uielement/newmenucontroller.hxx
index 869650e..8b52dbb 100644
--- a/framework/inc/uielement/newmenucontroller.hxx
+++ b/framework/inc/uielement/newmenucontroller.hxx
@@ -77,8 +77,6 @@ namespace framework
 // XEventListener
 virtual void SAL_CALL disposing( const css::lang::EventObject& 
Source ) throw ( css::uno::RuntimeException, std::exception ) override;
 
-DECL_STATIC_LINK( NewMenuController, ExecuteHdl_Impl, void*, void 
);
-
 private:
 virtual void impl_setPopupMenu() override;
 
diff --git a/framework/source/uielement/newmenucontroller.cxx 
b/framework/source/uielement/newmenucontroller.cxx
index 971e5f5..09ca33e 100644
--- a/framework/source/uielement/newmenucontroller.cxx
+++ b/framework/source/uielement/newmenucontroller.cxx
@@ -407,58 +407,38 @@ void SAL_CALL NewMenuController::statusChanged( const 
FeatureStateEvent& ) throw
 void SAL_CALL NewMenuController::itemSelected( const css::awt::MenuEvent& 
rEvent ) throw (RuntimeException, 

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

2016-10-30 Thread Maxim Monastirsky
 framework/inc/uielement/menubarmanager.hxx  |   12 +---
 framework/source/layoutmanager/layoutmanager.cxx|2 
 framework/source/uielement/generictoolbarcontroller.cxx |2 
 framework/source/uielement/menubarmanager.cxx   |   43 +---
 framework/source/uielement/menubarwrapper.cxx   |3 -
 framework/source/uielement/resourcemenucontroller.cxx   |2 
 framework/source/uielement/toolbarmanager.cxx   |   20 ---
 sc/source/ui/navipi/content.cxx |4 -
 sfx2/source/doc/templatedlg.cxx |2 
 svtools/source/control/calendar.cxx |   15 +
 svx/source/gallery2/galbrws2.cxx|4 -
 sw/source/uibase/utlui/unotools.cxx |2 
 vcl/source/window/menu.cxx  |   17 ++
 vcl/workben/vcldemo.cxx |9 +--
 14 files changed, 43 insertions(+), 94 deletions(-)

New commits:
commit 94876fe2704cb5107234ad76c86122ac9d95f866
Author: Maxim Monastirsky 
Date:   Sun Oct 30 14:34:18 2016 +0200

Let Menu dispose submenus

(I'm not sure about how good are the changes from ScopedVclPtr
to non-scoped, and disposeAndClear to clear. They aren't really
needed, because of the VclReferenceBase::mbDisposed logic. But
at least they should be safe, as long as we have disposeOnce
calls in Menu's dtor.)

See also previous commits:

4433d95b374c13a3501cdf3a6e273f68eb49873a
("MenuItemData now properly disposes the submenu")

89c23b4aaef931b5d6009efaf44ce6e6c976e8d4
("Sub menus no longer need manual disposing")

Change-Id: I9d455a94590f5eec9b097947f6984f1b3e477b52

diff --git a/framework/inc/uielement/menubarmanager.hxx 
b/framework/inc/uielement/menubarmanager.hxx
index b462d8d..e8f1e65 100644
--- a/framework/inc/uielement/menubarmanager.hxx
+++ b/framework/inc/uielement/menubarmanager.hxx
@@ -81,9 +81,7 @@ class MenuBarManager : public css::frame::XStatusListener 
   ,
 const css::uno::Reference< css::frame::XFrame >& rFrame,
 const css::uno::Reference< css::util::XURLTransformer >& 
_xURLTransformer,
 Menu*   pAddonMenu,
-boolbDelete,
-boolbDeleteChildren,
-bool popup);
+boolpopup);
 
 public:
 MenuBarManager(
@@ -94,7 +92,6 @@ class MenuBarManager : public css::frame::XStatusListener 
   ,
 const OUString& aModuleIdentifier,
 Menu* pMenu,
 bool bDelete,
-bool bDeleteChildren,
 bool bHasMenuBar = true );
 
 virtual ~MenuBarManager() override;
@@ -145,8 +142,7 @@ class MenuBarManager : public css::frame::XStatusListener   
 ,
   const css::uno::Reference< css::frame::XFrame >& 
rFrame,
   const css::uno::Reference< 
css::frame::XDispatchProvider >& rDispatchProvider,
   const OUString& rModuleIdentifier,
-  bool bDelete,
-  bool bDeleteChildren );
+  bool bDelete );
 void SetItemContainer( const css::uno::Reference< 
css::container::XIndexAccess >& rItemContainer );
 void GetPopupController( PopupControllerCache& rPopupController );
 
@@ -197,12 +193,11 @@ class MenuBarManager : public css::frame::XStatusListener 
   ,
 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 bDelete,bool bDeleteChildren,bool _bHandlePopUp);
+void Init(const css::uno::Reference< css::frame::XFrame >& 
rFrame,Menu* pAddonMenu,bool _bHandlePopUp);
 void SetHdl();
 
 bool 
m_bDisposed;
 bool 
m_bDeleteMenu;
-bool 
m_bDeleteChildren;
 bool m_bActive;
 bool 
m_bIsBookmarkMenu;
 bool 
m_bShowMenuImages;
diff --git a/framework/source/layoutmanager/layoutmanager.cxx 
b/framework/source/layoutmanager/layoutmanager.cxx
index 6c5c669..2b011bc 100644
--- a/framework/source/layoutmanager/layoutmanager.cxx
+++ 

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

2016-05-25 Thread Noel Grandin
 framework/inc/uiconfiguration/imagetype.hxx   |7 -
 framework/source/uiconfiguration/imagemanagerimpl.cxx |   79 +-
 framework/source/uiconfiguration/imagemanagerimpl.hxx |   18 ++--
 include/vcl/CommandImageResolver.hxx  |   15 +--
 vcl/source/bitmap/CommandImageResolver.cxx|6 -
 vcl/source/opengl/OpenGLHelper.cxx|4 
 6 files changed, 62 insertions(+), 67 deletions(-)

New commits:
commit 0788f65f4643d2e10cd13277725247010dc4425e
Author: Noel Grandin 
Date:   Tue May 24 11:18:07 2016 +0200

convert ImageType to scoped enum

and drop duplicate definition in framework.

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

diff --git a/framework/inc/uiconfiguration/imagetype.hxx 
b/framework/inc/uiconfiguration/imagetype.hxx
index 219eb9a..d759674 100644
--- a/framework/inc/uiconfiguration/imagetype.hxx
+++ b/framework/inc/uiconfiguration/imagetype.hxx
@@ -26,13 +26,6 @@
 namespace framework
 {
 
-enum ImageType
-{
-ImageType_Color = 0,
-ImageType_Color_Large,
-ImageType_COUNT
-};
-
 typedef std::unordered_map< OUString,
 OUString,
 OUStringHash > CommandToImageNameMap;
diff --git a/framework/source/uiconfiguration/imagemanagerimpl.cxx 
b/framework/source/uiconfiguration/imagemanagerimpl.cxx
index f833625..8eeac59 100644
--- a/framework/source/uiconfiguration/imagemanagerimpl.cxx
+++ b/framework/source/uiconfiguration/imagemanagerimpl.cxx
@@ -36,6 +36,7 @@
 
 #include 
 #include 
+#include 
 #include 
 #include 
 #include 
@@ -73,13 +74,13 @@ static const char   BITMAPS_FOLDER[]  = "Bitmaps";
 
 static const char   ModuleImageList[] = 
"private:resource/images/moduleimages";
 
-static const char*  IMAGELIST_XML_FILE[]  =
+static const o3tl::enumarray IMAGELIST_XML_FILE =
 {
 "sc_imagelist.xml",
 "lc_imagelist.xml"
 };
 
-static const char*  BITMAP_FILE_NAMES[]   =
+static const o3tl::enumarray BITMAP_FILE_NAMES =
 {
 "sc_userimages.png",
 "lc_userimages.png"
@@ -171,13 +172,13 @@ void CmdImageList::initialize()
 }
 
 
-Image CmdImageList::getImageFromCommandURL(sal_Int16 nImageType, const 
OUString& rCommandURL)
+Image CmdImageList::getImageFromCommandURL(vcl::ImageType nImageType, const 
OUString& rCommandURL)
 {
 initialize();
 return m_aResolver.getImageFromCommandURL(nImageType, rCommandURL);
 }
 
-bool CmdImageList::hasImage(sal_Int16 /*nImageType*/, const OUString& 
rCommandURL)
+bool CmdImageList::hasImage(vcl::ImageType /*nImageType*/, const OUString& 
rCommandURL)
 {
 initialize();
 return m_aResolver.hasImage(rCommandURL);
@@ -200,13 +201,13 @@ GlobalImageList::~GlobalImageList()
 pGlobalImageList = nullptr;
 }
 
-Image GlobalImageList::getImageFromCommandURL( sal_Int16 nImageType, const 
OUString& rCommandURL )
+Image GlobalImageList::getImageFromCommandURL( vcl::ImageType nImageType, 
const OUString& rCommandURL )
 {
 osl::MutexGuard guard( getGlobalImageListMutex() );
 return CmdImageList::getImageFromCommandURL( nImageType, rCommandURL );
 }
 
-bool GlobalImageList::hasImage( sal_Int16 nImageType, const OUString& 
rCommandURL )
+bool GlobalImageList::hasImage( vcl::ImageType nImageType, const OUString& 
rCommandURL )
 {
 osl::MutexGuard guard( getGlobalImageListMutex() );
 return CmdImageList::hasImage( nImageType, rCommandURL );
@@ -218,7 +219,7 @@ bool GlobalImageList::hasImage( sal_Int16 nImageType, const 
OUString& rCommandUR
 return CmdImageList::getImageCommandNames();
 }
 
-static bool implts_checkAndScaleGraphic( uno::Reference< XGraphic >& 
rOutGraphic, const uno::Reference< XGraphic >& rInGraphic, sal_Int16 nImageType 
)
+static bool implts_checkAndScaleGraphic( uno::Reference< XGraphic >& 
rOutGraphic, const uno::Reference< XGraphic >& rInGraphic, vcl::ImageType 
nImageType )
 {
 static Size   aNormSize( IMAGE_SIZE_NORMAL, IMAGE_SIZE_NORMAL );
 static Size   aLargeSize( IMAGE_SIZE_LARGE, IMAGE_SIZE_LARGE );
@@ -234,7 +235,7 @@ static bool implts_checkAndScaleGraphic( uno::Reference< 
XGraphic >& rOutGraphic
 Size   aSize = aImage.GetSizePixel();
 bool   bMustScale( false );
 
-if ( nImageType == ImageType_Color_Large )
+if ( nImageType == vcl::ImageType::Color_Large )
 bMustScale = ( aSize != aLargeSize );
 else
 bMustScale = ( aSize != aNormSize );
@@ -251,15 +252,15 @@ static bool implts_checkAndScaleGraphic( uno::Reference< 
XGraphic >& rOutGraphic
 return true;
 }
 
-static sal_Int16 implts_convertImageTypeToIndex( sal_Int16 nImageType )
+static vcl::ImageType implts_convertImageTypeToIndex( sal_Int16 nImageType )
 {
-sal_Int16 nIndex( 0 );
+vcl::ImageType nIndex( 

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

2015-11-17 Thread Samuel Mehrbrodt
 framework/inc/uielement/toolbarmanager.hxx|4 -
 framework/source/uielement/toolbarmanager.cxx |   74 --
 include/vcl/commandinfoprovider.hxx   |4 +
 vcl/source/helper/commandinfoprovider.cxx |   19 ++
 4 files changed, 24 insertions(+), 77 deletions(-)

New commits:
commit 0c48c809f09e74e79c9f8dc4c22958147f591921
Author: Samuel Mehrbrodt 
Date:   Tue Nov 17 11:08:46 2015 +0100

tdf#95845 Use CommandInfoProvider to receive command properties

Change-Id: I41f9a661b7a5b355e50910d7f58f0d9d55dc62a6

diff --git a/framework/source/uielement/toolbarmanager.cxx 
b/framework/source/uielement/toolbarmanager.cxx
index 76fa331..e4f2979 100644
--- a/framework/source/uielement/toolbarmanager.cxx
+++ b/framework/source/uielement/toolbarmanager.cxx
@@ -773,62 +773,8 @@ void ToolBarManager::RemoveControllers()
 m_aControllerMap.clear();
 }
 
-uno::Sequence< beans::PropertyValue > ToolBarManager::GetPropsForCommand( 
const OUString& rCmdURL )
-{
-Sequence< PropertyValue > aPropSeq;
-
-// Retrieve properties for command
-try
-{
-if ( !m_bModuleIdentified )
-{
-Reference< XModuleManager2 > xModuleManager = 
ModuleManager::create( m_xContext );
-Reference< XInterface > xIfac( m_xFrame, UNO_QUERY );
-
-m_bModuleIdentified = true;
-m_aModuleIdentifier = xModuleManager->identify( xIfac );
-
-if ( !m_aModuleIdentifier.isEmpty() )
-{
-Reference< XNameAccess > xNameAccess = 
frame::theUICommandDescription::get( m_xContext );
-xNameAccess->getByName( m_aModuleIdentifier ) >>= 
m_xUICommandLabels;
-}
-}
-
-if ( m_xUICommandLabels.is() )
-{
-if ( !rCmdURL.isEmpty() )
-m_xUICommandLabels->getByName( rCmdURL ) >>= aPropSeq;
-}
-}
-catch (const Exception&)
-{
-}
-
-return aPropSeq;
-}
-
-sal_Int32 ToolBarManager::RetrievePropertiesFromCommand( const OUString& 
aCmdURL )
-{
-sal_Int32 nProperties(0);
-Sequence< PropertyValue > aPropSeq;
-
-// Retrieve popup menu labels
-aPropSeq = GetPropsForCommand( aCmdURL );
-for ( sal_Int32 i = 0; i < aPropSeq.getLength(); i++ )
-{
-if ( aPropSeq[i].Name == "Properties" )
-{
-aPropSeq[i].Value >>= nProperties;
-break;
-}
-}
-return nProperties;
-}
-
 void ToolBarManager::CreateControllers()
 {
-
 Reference< XWindow > xToolbarWindow = VCLUnoHelper::GetInterface( 
m_pToolBar );
 
 css::util::URL  aURL;
@@ -932,7 +878,7 @@ void ToolBarManager::CreateControllers()
 new GenericToolbarController( m_xContext, 
m_xFrame, m_pToolBar, nId, aCommandURL ));
 
 // Accessibility support: Set toggle button role for 
specific commands
-sal_Int32 nProps = RetrievePropertiesFromCommand( 
aCommandURL );
+sal_Int32 nProps = 
vcl::CommandInfoProvider::Instance().GetPropertiesForCommand(aCommandURL, 
m_xFrame);
 if ( nProps & 
UICOMMANDDESCRIPTION_PROPERTIES_TOGGLEBUTTON )
 m_pToolBar->SetItemBits( nId, 
m_pToolBar->GetItemBits( nId ) | ToolBoxItemBits::CHECKABLE );
 }
diff --git a/include/vcl/commandinfoprovider.hxx 
b/include/vcl/commandinfoprovider.hxx
index 0dc69f8..3d98296 100644
--- a/include/vcl/commandinfoprovider.hxx
+++ b/include/vcl/commandinfoprovider.hxx
@@ -84,6 +84,10 @@ public:
 bool bLarge,
 const css::uno::Reference& rxFrame);
 
+sal_Int32 GetPropertiesForCommand(
+const OUString& rsCommandName,
+const css::uno::Reference& rxFrame);
+
 /** Do not call.  Should be part of a local and hidden interface.
 */
 void SetFrame (const css::uno::Reference& rxFrame);
diff --git a/vcl/source/helper/commandinfoprovider.cxx 
b/vcl/source/helper/commandinfoprovider.cxx
index 4eef99c..cb0378c 100644
--- a/vcl/source/helper/commandinfoprovider.cxx
+++ b/vcl/source/helper/commandinfoprovider.cxx
@@ -214,6 +214,25 @@ Image CommandInfoProvider::GetImageForCommand(const 
OUString& rsCommandName, boo
 return Image();
 }
 
+sal_Int32 CommandInfoProvider::GetPropertiesForCommand (
+const OUString& rsCommandName,
+const Reference& rxFrame)
+{
+SetFrame(rxFrame);
+
+const Sequence aProperties 
(GetCommandProperties(rsCommandName));
+for (sal_Int32 nIndex=0; nIndex>= nValue;
+return nValue;
+}
+}
+return 0;
+}
+
 void CommandInfoProvider::SetFrame (const Reference& rxFrame)
 {
 if (rxFrame != mxCachedDataFrame)
commit 16f85dc485970f34c2abd06fb5379b426d3a83bc
Author: Samuel 

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

2015-11-12 Thread Samuel Mehrbrodt
 framework/inc/uielement/toolbarmanager.hxx   |2 -
 framework/source/uielement/toolbarmanager.cxx|   11 
+
 framework/source/uielement/uicommanddescription.cxx  |   12 
+-
 officecfg/registry/data/org/openoffice/Office/UI/GenericCommands.xcu |3 ++
 officecfg/registry/schema/org/openoffice/Office/UI/Commands.xcs  |   11 
++---
 5 files changed, 30 insertions(+), 9 deletions(-)

New commits:
commit 25f6ef3d0c55685da8f0f36e7bc6db407720c146
Author: Samuel Mehrbrodt 
Date:   Thu Nov 12 17:08:44 2015 +0100

Clone formatting: Usage description should be only in the tooltip

Not in the button name

Change-Id: I7cf570ce692f33980e0a5d58be0fbccd5ebe0120

diff --git 
a/officecfg/registry/data/org/openoffice/Office/UI/GenericCommands.xcu 
b/officecfg/registry/data/org/openoffice/Office/UI/GenericCommands.xcu
index cab5cbe..e7297aa 100644
--- a/officecfg/registry/data/org/openoffice/Office/UI/GenericCommands.xcu
+++ b/officecfg/registry/data/org/openoffice/Office/UI/GenericCommands.xcu
@@ -3663,6 +3663,9 @@
   
   
 
+  Clone Formatting
+
+
   Clone Formatting (double click for 
multi-selection)
 
 
commit 9c2f197e8e945f584e718e889938c06fbf644897
Author: Samuel Mehrbrodt 
Date:   Thu Nov 12 17:04:36 2015 +0100

Add a new TooltipLabel property for uno commands

This allows buttons to have different labels and tooltips.

Change-Id: Icbc3fe5f3b4db8a2e6b7177c21341f2df3520f19

diff --git a/framework/inc/uielement/toolbarmanager.hxx 
b/framework/inc/uielement/toolbarmanager.hxx
index fa62c63..0870d7d 100644
--- a/framework/inc/uielement/toolbarmanager.hxx
+++ b/framework/inc/uielement/toolbarmanager.hxx
@@ -144,7 +144,7 @@ class ToolBarManager : public ToolbarManager_Base
 virtual bool MenuItemAllowed( sal_uInt16 ) const;
 
 void RemoveControllers();
-OUString RetrieveLabelFromCommand( const OUString& aCmdURL );
+OUString RetrieveFromCommand( const OUString aName, const OUString& 
aCmdURL );
 sal_Int32 RetrievePropertiesFromCommand( const OUString& aCmdURL );
 css::uno::Sequence< css::beans::PropertyValue > GetPropsForCommand( 
const OUString& rCmdURL );
 void CreateControllers();
diff --git a/framework/source/uielement/toolbarmanager.cxx 
b/framework/source/uielement/toolbarmanager.cxx
index 3847e2d..efc6a48 100644
--- a/framework/source/uielement/toolbarmanager.cxx
+++ b/framework/source/uielement/toolbarmanager.cxx
@@ -809,7 +809,7 @@ uno::Sequence< beans::PropertyValue > 
ToolBarManager::GetPropsForCommand( const
 return aPropSeq;
 }
 
-OUString ToolBarManager::RetrieveLabelFromCommand( const OUString& aCmdURL )
+OUString ToolBarManager::RetrieveFromCommand( const OUString aName, const 
OUString& aCmdURL )
 {
 OUString aLabel;
 Sequence< PropertyValue > aPropSeq;
@@ -818,7 +818,7 @@ OUString ToolBarManager::RetrieveLabelFromCommand( const 
OUString& aCmdURL )
 aPropSeq = GetPropsForCommand( aCmdURL );
 for ( sal_Int32 i = 0; i < aPropSeq.getLength(); i++ )
 {
-if ( aPropSeq[i].Name == "Name" )
+if ( aPropSeq[i].Name == aName )
 {
 aPropSeq[i].Value >>= aLabel;
 break;
@@ -1272,7 +1272,8 @@ void ToolBarManager::FillToolbar( const Reference< 
XIndexAccess >& rItemContaine
 
 if (( nType == css::ui::ItemType::DEFAULT ) && 
!aCommandURL.isEmpty() )
 {
-OUString aString( RetrieveLabelFromCommand( aCommandURL ));
+OUString aString( RetrieveFromCommand( "Label", 
aCommandURL ));
+OUString aTooltipFromCommand( RetrieveFromCommand( 
"TooltipLabel", aCommandURL ));
 
 ToolBoxItemBits nItemBits = ConvertStyleToToolboxItemBits( 
nStyle );
 if ( aMenuDesc.is() )
@@ -1284,8 +1285,10 @@ void ToolBarManager::FillToolbar( const Reference< 
XIndexAccess >& rItemContaine
 m_pToolBar->SetItemCommand( nId, aCommandURL );
 OUString sQuickHelp( aString );
 // Use custom tooltip if available
-if ( !aTooltip.isEmpty() )
+if ( !aTooltip.isEmpty() ) // Tooltip from menu xml file 
(toolbar:tooltip)
 sQuickHelp = aTooltip;
+else if ( !aTooltipFromCommand.isEmpty() ) // Tooltip from 
uno command (TooltipLabel)
+sQuickHelp = aTooltipFromCommand;
 OUString sShortCut;
 if( RetrieveShortcut( aCommandURL, sShortCut ) )
 {
diff --git a/framework/source/uielement/uicommanddescription.cxx 
b/framework/source/uielement/uicommanddescription.cxx
index 3f6bc54..926f5c0 100644
--- a/framework/source/uielement/uicommanddescription.cxx
+++ 

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

2015-06-13 Thread Julien Nabet
 framework/inc/threadhelp/transactionguard.hxx  |2 +-
 framework/source/fwi/threadhelp/transactionmanager.cxx |2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

New commits:
commit 278e0083e9ece037581713994423a169357ef2ae
Author: Julien Nabet serval2...@yahoo.fr
Date:   Sat Jun 13 23:22:19 2015 +0200

It's E_BEFORECLOSE not E_CLOSING

Change-Id: Ia53f9aa8bb3c7fd1dd5c0190624a667b65996ca2

diff --git a/framework/source/fwi/threadhelp/transactionmanager.cxx 
b/framework/source/fwi/threadhelp/transactionmanager.cxx
index 784266a..1c5e213 100644
--- a/framework/source/fwi/threadhelp/transactionmanager.cxx
+++ b/framework/source/fwi/threadhelp/transactionmanager.cxx
@@ -49,7 +49,7 @@ TransactionManager::~TransactionManager()
 
 
/*-
 @short  set new working mode
-@descr  These implementation knows for states of working: E_INIT, 
E_WORK, E_CLOSING, E_CLOSE
+@descr  These implementation knows for states of working: E_INIT, 
E_WORK, E_BEFORECLOSE, E_CLOSE
 You can step during this ones only from the left to the right 
side and start at left side again!
 (This is necessary e.g. for refcounted objects!)
 This call will block till all current existing transactions 
was finished.
commit 0b6f51feae1299aca213169d79e24aac2118de28
Author: Julien Nabet serval2...@yahoo.fr
Date:   Sat Jun 13 23:21:21 2015 +0200

Typo: E_HARDEXCETIONS-E_HARDEXCEPTIONS

Change-Id: I482d8fdb549d2a9c79bb68bd910e761f61337fb6

diff --git a/framework/inc/threadhelp/transactionguard.hxx 
b/framework/inc/threadhelp/transactionguard.hxx
index 83cc301..543fe05 100644
--- a/framework/inc/threadhelp/transactionguard.hxx
+++ b/framework/inc/threadhelp/transactionguard.hxx
@@ -59,7 +59,7 @@ class TransactionGuard : private boost::noncopyable
 inline TransactionGuard( TransactionManager rManager, EExceptionMode 
eMode, ERejectReason* eReason = NULL )
 : m_pManager( rManager )
 {
-// If exception mode is set to E_HARDEXCETIONS we don't need a 
buffer to return reason!
+// If exception mode is set to E_HARDEXCEPTIONS we don't need a 
buffer to return reason!
 // We handle it private. If a call is rejected, our manager throw 
some exceptions ... and the reason
 // could be ignorable ...
 if( eReason == NULL )
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: 2 commits - framework/inc framework/source officecfg/registry sfx2/source vcl/source

2015-01-21 Thread Caolán McNamara
 framework/inc/uielement/newmenucontroller.hxx|9 +++--
 framework/source/uielement/newmenucontroller.cxx |   13 ++---
 framework/source/uielement/popuptoolbarcontroller.cxx|1 +
 officecfg/registry/data/org/openoffice/Office/Common.xcu |2 +-
 sfx2/source/appl/shutdownicon.cxx|7 ++-
 sfx2/source/dialog/backingwindow.cxx |2 +-
 vcl/source/window/window.cxx |2 +-
 7 files changed, 15 insertions(+), 21 deletions(-)

New commits:
commit b97d9a1238a82461e64717757a4527565f879ee2
Author: Caolán McNamara caol...@redhat.com
Date:   Wed Jan 21 14:33:43 2015 +

slot:5500 - .uno:NewDoc(FromTemplate)

try and strip out the slot:5500 magic/lunacy

Change-Id: I7236c83fba6cb8264f76aca90242775a3de58645

diff --git a/officecfg/registry/data/org/openoffice/Office/Common.xcu 
b/officecfg/registry/data/org/openoffice/Office/Common.xcu
index 8895602..ffca153 100644
--- a/officecfg/registry/data/org/openoffice/Office/Common.xcu
+++ b/officecfg/registry/data/org/openoffice/Office/Common.xcu
@@ -342,7 +342,7 @@
   /node
   node oor:name=m14 oor:op=replace
 prop oor:name=URL oor:type=xs:string
-  valueslot:5500/value
+  value.uno:NewDoc/value
 /prop
 prop oor:name=Title
   value xml:lang=en-USTemplates/value
diff --git a/sfx2/source/appl/shutdownicon.cxx 
b/sfx2/source/appl/shutdownicon.cxx
index f6bca87..d4ef0bb 100644
--- a/sfx2/source/appl/shutdownicon.cxx
+++ b/sfx2/source/appl/shutdownicon.cxx
@@ -286,7 +286,7 @@ void ShutdownIcon::FromTemplate()
 xFrame = ::com::sun::star::uno::Reference  
::com::sun::star::frame::XFrame ( xDesktop, UNO_QUERY );
 
 URL aTargetURL;
-aTargetURL.Complete = slot:5500;
+aTargetURL.Complete = .uno:NewDoc;
 ::com::sun::star::uno::Reference util::XURLTransformer  xTrans( 
util::URLTransformer::create( ::comphelper::getProcessComponentContext() ) );
 xTrans-parseStrict( aTargetURL );
 
@@ -294,10 +294,7 @@ void ShutdownIcon::FromTemplate()
 ::com::sun::star::uno::Reference  ::com::sun::star::frame::XDispatch 
 xDisp;
 if ( xProv.is() )
 {
-if (aTargetURL.Protocol == slot:)
-xDisp = xProv-queryDispatch( aTargetURL, OUString(), 0 );
-else
-xDisp = xProv-queryDispatch( aTargetURL, OUString(_blank), 
0 );
+xDisp = xProv-queryDispatch( aTargetURL, OUString(_self), 0 );
 }
 if ( xDisp.is() )
 {
diff --git a/sfx2/source/dialog/backingwindow.cxx 
b/sfx2/source/dialog/backingwindow.cxx
index ce33bae..e0074b5 100644
--- a/sfx2/source/dialog/backingwindow.cxx
+++ b/sfx2/source/dialog/backingwindow.cxx
@@ -67,7 +67,7 @@ const char IMPRESS_WIZARD_URL[] = 
private:factory/simpress?slot=6686;
 const char DRAW_URL[] =   private:factory/sdraw;
 const char BASE_URL[] =   private:factory/sdatabase?Interactive;
 const char MATH_URL[] =   private:factory/smath;
-const char TEMPLATE_URL[] =   slot:5500;
+const char TEMPLATE_URL[] =   .uno:NewDoc;
 const char OPEN_URL[] =   .uno:Open;
 const char SERVICENAME_CFGREADACCESS[] = 
com.sun.star.configuration.ConfigurationAccess;
 
diff --git a/vcl/source/window/window.cxx b/vcl/source/window/window.cxx
index d63aaa0..cc49cab 100644
--- a/vcl/source/window/window.cxx
+++ b/vcl/source/window/window.cxx
@@ -2413,7 +2413,7 @@ void Window::Show( bool bVisible, sal_uInt16 nFlags )
 else if ( !ImplIsWindowOrChild( pSVData-mpIntroWindow ) )
 {
 // ... but the VCL splash is broken, and it needs this
-// (for ./soffice slot:5500)
+// (for ./soffice .uno:NewDoc)
 pSVData-mpIntroWindow-Hide();
 }
 
commit 1dbc6d05ded0dc1df75f7b9ff779571c98800035
Author: Caolán McNamara caol...@redhat.com
Date:   Wed Jan 21 12:41:39 2015 +

Resolves: fdo#87636 New button not clickable when Templates preselected

regression from

commit 57207cab004cb78c3fa6d9ed43cc4bf81f4e6981
Author: Ariel Constenla-Haile arie...@apache.org
Date:   Tue May 28 10:01:32 2013 +

Add missing copypaste of SfxAppToolBoxControl_Impl::Select

(cherry picked from commit 47204c74d9e52f54f6983af19b66af2a96b42e61)

Conflicts:
framework/inc/uielement/popuptoolbarcontroller.hxx
svtools/inc/svtools/toolboxcontroller.hxx

The menu shown in the ui is a copy of a menu. The original menu has UserData
set on it which contains the target for the command, but the copy doesn't, 
so
looking up the target always fails and ses the _default frame and not the
correct _self required for the template menu

Change-Id: Ic1887467bf15f081d27286bd284929c17a2b19ad

diff --git a/framework/inc/uielement/newmenucontroller.hxx 

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

2014-09-12 Thread Jan Holesovsky
 framework/inc/services/layoutmanager.hxx |2 
 framework/source/layoutmanager/layoutmanager.cxx |   12 +--
 include/vcl/menu.hxx |   22 +++---
 vcl/inc/brdwin.hxx   |2 
 vcl/source/window/brdwin.cxx |2 
 vcl/source/window/dialog.cxx |2 
 vcl/source/window/menu.cxx   |   24 +++---
 vcl/source/window/menubarwindow.cxx  |   84 +++
 vcl/source/window/menubarwindow.hxx  |4 -
 vcl/source/window/msgbox.cxx |2 
 10 files changed, 77 insertions(+), 79 deletions(-)

New commits:
commit d22edd44b59df11df94dc10f9678973b0f04557c
Author: Jan Holesovsky ke...@collabora.com
Date:   Fri Sep 12 06:32:46 2014 +0200

vcl: It's a close button, there is no such a thing as a 'closer'.

Clean up at least vcl + what depends on that, but unfortunately there are
still some Closer's left elsewhere...

Change-Id: I019c863d07ee62d701ff01c8d871334012c105f1

diff --git a/framework/inc/services/layoutmanager.hxx 
b/framework/inc/services/layoutmanager.hxx
index 88e3364..0dcfc45 100644
--- a/framework/inc/services/layoutmanager.hxx
+++ b/framework/inc/services/layoutmanager.hxx
@@ -295,7 +295,7 @@ namespace framework
 bool   
 m_bHideCurrentUI;
 bool   
 m_bGlobalSettings;
 bool   
 m_bPreserveContentSize;
-bool   
 m_bMenuBarCloser;
+bool   
 m_bMenuBarCloseButton;
 css::awt::Rectangle
 m_aDockingArea;
 css::uno::Reference ::com::sun::star::ui::XDockingAreaAcceptor   
 m_xDockingAreaAcceptor;
 css::uno::Reference ::com::sun::star::lang::XComponent   
 m_xInplaceMenuBar;
diff --git a/framework/source/layoutmanager/layoutmanager.cxx 
b/framework/source/layoutmanager/layoutmanager.cxx
index 3efe650..b3487c9 100644
--- a/framework/source/layoutmanager/layoutmanager.cxx
+++ b/framework/source/layoutmanager/layoutmanager.cxx
@@ -118,7 +118,7 @@ LayoutManager::LayoutManager( const Reference 
XComponentContext  xContext ) :
 , m_bHideCurrentUI( false )
 , m_bGlobalSettings( false )
 , m_bPreserveContentSize( false )
-, m_bMenuBarCloser( false )
+, m_bMenuBarCloseButton( false )
 , m_pInplaceMenuBar( NULL )
 , m_xModuleManager( ModuleManager::create( xContext ))
 , m_xUIElementFactoryManager( 
ui::theUIElementFactoryManager::get(xContext) )
@@ -144,7 +144,7 @@ LayoutManager::LayoutManager( const Reference 
XComponentContext  xContext ) :
 registerProperty( LAYOUTMANAGER_PROPNAME_AUTOMATICTOOLBARS, 
LAYOUTMANAGER_PROPHANDLE_AUTOMATICTOOLBARS, 
css::beans::PropertyAttribute::TRANSIENT, m_bAutomaticToolbars, ::getCppuType( 
m_bAutomaticToolbars ) );
 registerProperty( LAYOUTMANAGER_PROPNAME_HIDECURRENTUI, 
LAYOUTMANAGER_PROPHANDLE_HIDECURRENTUI, beans::PropertyAttribute::TRANSIENT, 
m_bHideCurrentUI, ::getCppuType( m_bHideCurrentUI ) );
 registerProperty( LAYOUTMANAGER_PROPNAME_LOCKCOUNT, 
LAYOUTMANAGER_PROPHANDLE_LOCKCOUNT, beans::PropertyAttribute::TRANSIENT | 
beans::PropertyAttribute::READONLY, m_nLockCount, getCppuType( m_nLockCount ) 
 );
-registerProperty( LAYOUTMANAGER_PROPNAME_MENUBARCLOSER, 
LAYOUTMANAGER_PROPHANDLE_MENUBARCLOSER, beans::PropertyAttribute::TRANSIENT, 
m_bMenuBarCloser, ::getCppuType( m_bMenuBarCloser ) );
+registerProperty( LAYOUTMANAGER_PROPNAME_MENUBARCLOSER, 
LAYOUTMANAGER_PROPHANDLE_MENUBARCLOSER, beans::PropertyAttribute::TRANSIENT, 
m_bMenuBarCloseButton, ::getCppuType( m_bMenuBarCloseButton ) );
 registerPropertyNoMember( LAYOUTMANAGER_PROPNAME_REFRESHVISIBILITY, 
LAYOUTMANAGER_PROPHANDLE_REFRESHVISIBILITY, 
beans::PropertyAttribute::TRANSIENT, ::getCppuType( bRefreshVisibility ), 
bRefreshVisibility );
 registerProperty( LAYOUTMANAGER_PROPNAME_PRESERVE_CONTENT_SIZE, 
LAYOUTMANAGER_PROPHANDLE_PRESERVE_CONTENT_SIZE, 
beans::PropertyAttribute::TRANSIENT, m_bPreserveContentSize, ::getCppuType( 
m_bPreserveContentSize ) );
 }
@@ -2526,12 +2526,10 @@ void LayoutManager::implts_setDockingAreaWindowSizes( 
const awt::Rectangle /*rB
 }
 }
 
-//  XMenuCloser
-
 void LayoutManager::implts_updateMenuBarClose()
 {
 SolarMutexClearableGuard aWriteLock;
-bool  bShowCloser( m_bMenuBarCloser );
+bool  bShowCloseButton( m_bMenuBarCloseButton );
 Reference awt::XWindow  xContainerWindow( m_xContainerWindow );
 aWriteLock.clear();
 
@@ 

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

2014-07-23 Thread Oliver-Rainer Wittmann
 framework/inc/interaction/quietinteraction.hxx|1 
 framework/inc/pch/precompiled_fwk.hxx |1 
 framework/source/interaction/quietinteraction.cxx |   12 --
 framework/source/services/desktop.cxx |   12 --
 include/framework/interaction.hxx |1 
 uui/inc/pch/precompiled_uui.hxx   |1 
 uui/source/iahndl-filter.cxx  |  122 --
 uui/source/iahndl.cxx |3 
 uui/source/iahndl.hxx |5 
 xmloff/source/draw/shapeexport.cxx|   32 +++--
 10 files changed, 20 insertions(+), 170 deletions(-)

New commits:
commit fd641c7b23ce4205c29fc0c564b73336cb2cfb07
Author: Oliver-Rainer Wittmann o...@apache.org
Date:   Wed Jul 23 08:53:15 2014 +

Resolves: #i125289# do apply possible changed GraphicStreamURL...

only for embedded images which already have its stream inside the package

fixes also issue 125290

(cherry picked from commit 9602a121b458e7456fc533dad86f434f846a72ba)

Conflicts:
xmloff/source/draw/shapeexport2.cxx

Change-Id: I5af0093b20f2f291d3a94c690bfbdb59a59320c3

diff --git a/xmloff/source/draw/shapeexport.cxx 
b/xmloff/source/draw/shapeexport.cxx
index 7f33e58..ba8ce16 100644
--- a/xmloff/source/draw/shapeexport.cxx
+++ b/xmloff/source/draw/shapeexport.cxx
@@ -2256,9 +2256,12 @@ void XMLShapeExport::ImpExportGraphicObjectShape(
 OUString aResolveURL( sImageURL );
 const OUString sPackageURL( vnd.sun.star.Package: );
 
-// trying to preserve the filename
+// trying to preserve the filename for embedded images which 
already have its stream inside the package
+bool bIsEmbeddedImageWithExistingStreamInPackage = false;
 if ( aStreamURL.match( sPackageURL, 0 ) )
 {
+bIsEmbeddedImageWithExistingStreamInPackage = true;
+
 OUString sRequestedName( aStreamURL.copy( 
sPackageURL.getLength(), aStreamURL.getLength() - sPackageURL.getLength() ) );
 sal_Int32 nLastIndex = sRequestedName.lastIndexOf( '/' ) + 
1;
 if ( ( nLastIndex  0 )  ( nLastIndex  
sRequestedName.getLength() ) )
@@ -2278,20 +2281,23 @@ void XMLShapeExport::ImpExportGraphicObjectShape(
 
 if( !aStr.isEmpty() )
 {
-aStreamURL = sPackageURL;
-if( aStr[ 0 ] == '#' )
-{
-aStreamURL = aStreamURL.concat( aStr.copy( 1, 
aStr.getLength() - 1 ) );
-}
-else
+// apply possible changed stream URL to embedded image 
object
+if ( bIsEmbeddedImageWithExistingStreamInPackage )
 {
-aStreamURL = aStreamURL.concat( aStr );
-}
+aStreamURL = sPackageURL;
+if ( aStr[0] == '#' )
+{
+aStreamURL = aStreamURL.concat( aStr.copy( 1, 
aStr.getLength() - 1 ) );
+}
+else
+{
+aStreamURL = aStreamURL.concat( aStr );
+}
 
-// update stream URL for load on demand
-uno::Any aAny;
-aAny = aStreamURL;
-xPropSet-setPropertyValue(GraphicStreamURL, aAny );
+uno::Any aAny;
+aAny = aStreamURL;
+xPropSet-setPropertyValue( 
OUString(GraphicStreamURL), aAny );
+}
 
 mrExport.AddAttribute(XML_NAMESPACE_XLINK, XML_TYPE, 
XML_SIMPLE );
 mrExport.AddAttribute(XML_NAMESPACE_XLINK, XML_SHOW, 
XML_EMBED );
commit 23e818d4f5cb6dff4c2238fa42a38496a9a85255
Author: Caolán McNamara caol...@redhat.com
Date:   Wed Jul 23 10:49:30 2014 +0100

AmbigousFilterRequest is only ever extracted, never created

Change-Id: I79c669c1635192199d6ef135e1ab9b48a9e7e63a

diff --git a/framework/inc/interaction/quietinteraction.hxx 
b/framework/inc/interaction/quietinteraction.hxx
index c2dbeaa..0a990f4 100644
--- a/framework/inc/interaction/quietinteraction.hxx
+++ b/framework/inc/interaction/quietinteraction.hxx
@@ -38,7 +38,6 @@ namespace framework{
 But it can be used to intercept problems e.g. during loading 
of documents.
 
 In current implementation we solve conflicts for following 
situations only:
-- AmbigousFilterRequest
 - InteractiveIOException
 - InteractiveAugmentedIOException
 All other requests will be aborted.
diff --git a/framework/inc/pch/precompiled_fwk.hxx 

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

2014-03-20 Thread Stephan Bergmann
 framework/inc/classes/propertysethelper.hxx |1 
 framework/inc/threadhelp/threadhelpbase.hxx |   66 ---
 framework/source/accelerators/storageholder.cxx |   84 +---
 framework/source/inc/accelerators/storageholder.hxx |4 
 4 files changed, 24 insertions(+), 131 deletions(-)

New commits:
commit 03fc5edba3f34c63315daebd08ae2888bf5332b2
Author: Stephan Bergmann sberg...@redhat.com
Date:   Thu Mar 20 12:02:51 2014 +0100

Remove newly unused framework::ThreadHelpBase

Change-Id: I75e7cfc8aa1f4e4e50a2e21c5f7596363594e179

diff --git a/framework/inc/classes/propertysethelper.hxx 
b/framework/inc/classes/propertysethelper.hxx
index d8baf70..0be92aa 100644
--- a/framework/inc/classes/propertysethelper.hxx
+++ b/framework/inc/classes/propertysethelper.hxx
@@ -20,7 +20,6 @@
 #ifndef INCLUDED_FRAMEWORK_INC_CLASSES_PROPERTYSETHELPER_HXX
 #define INCLUDED_FRAMEWORK_INC_CLASSES_PROPERTYSETHELPER_HXX
 
-#include threadhelp/threadhelpbase.hxx
 #include threadhelp/transactionbase.hxx
 #include general.h
 #include stdtypes.h
diff --git a/framework/inc/threadhelp/threadhelpbase.hxx 
b/framework/inc/threadhelp/threadhelpbase.hxx
deleted file mode 100644
index 4ac22bf..000
--- a/framework/inc/threadhelp/threadhelpbase.hxx
+++ /dev/null
@@ -1,66 +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_THREADHELPBASE_HXX
-#define INCLUDED_FRAMEWORK_INC_THREADHELP_THREADHELPBASE_HXX
-
-#include threadhelp/lockhelper.hxx
-
-namespace framework{
-
-/*-
-@short  baseclass to make own classes threadsafe
-@descr  Sometimes you must share your lock- or mutex member with 
any other baseclasses.
-And baseclasses are initialized erlier then members! 
That's why you should use
-this struct as first of your baseclasses!!!
-Then you will get a public member m_aLock which can be 
used by special guard implementations
-to make your code threadsafe.
-
-@seealsoclass LockHelper
-
-@implements -
-@base   -
-
-@devstatus  ready to use
-*//*-*/
-struct ThreadHelpBase
-{
-
-//  public methods
-
-public:
-ThreadHelpBase( comphelper::SolarMutex* pSolarMutex = NULL )
-:   m_aLock( pSolarMutex )
-{
-}
-
-
-//  public member
-//  Make it mutable for using in const functions!
-
-public:
-
-mutable LockHelper m_aLock;
-};
-
-}   //  namespace framework
-
-#endif // INCLUDED_FRAMEWORK_INC_THREADHELP_THREADHELPBASE_HXX
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
commit c641f300f09ec0e520846b09e12bf8041299a6cf
Author: Stephan Bergmann sberg...@redhat.com
Date:   Thu Mar 20 15:14:42 2014 +0100

Use an osl::Mutex directly

Change-Id: If8ff4fc256e530f6b79cc97cf1f47880c93864bf

diff --git a/framework/source/accelerators/storageholder.cxx 
b/framework/source/accelerators/storageholder.cxx
index 0522770..b19d3e0 100644
--- a/framework/source/accelerators/storageholder.cxx
+++ b/framework/source/accelerators/storageholder.cxx
@@ -19,7 +19,6 @@
 
 #include accelerators/storageholder.hxx
 
-#include threadhelp/guard.hxx
 #include services.h
 
 #include com/sun/star/container/NoSuchElementException.hpp
@@ -49,7 +48,6 @@ namespace framework
 
 
 StorageHolder::StorageHolder()
-: ThreadHelpBase()
 {
 }
 
@@ -63,9 +61,7 @@ StorageHolder::~StorageHolder()
 
 void StorageHolder::forgetCachedStorages()
 {
-// SAFE - --
-Guard aWriteLock(m_aLock);
-
+osl::MutexGuard g(m_mutex);
 TPath2StorageInfo::iterator pIt;
 for (  pIt  = m_lStorages.begin();
pIt != m_lStorages.end()  ;
@@ -76,28 +72,20 @@ void StorageHolder::forgetCachedStorages()
 

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

2013-12-10 Thread Stephan Bergmann
 framework/inc/services/substitutepathvars.hxx|4 
 framework/source/services/substitutepathvars.cxx |  217 +++
 include/rtl/strbuf.hxx   |   12 +
 include/rtl/ustrbuf.hxx  |2 
 4 files changed, 85 insertions(+), 150 deletions(-)

New commits:
commit bcc10ce1a5392c8a8eb4a420d856d55ed532d003
Author: Stephan Bergmann sberg...@redhat.com
Date:   Tue Dec 10 15:55:02 2013 +0100

Some clean-up

Change-Id: Ieefd4653c18dceb5e5300b8411207cca100e4653

diff --git a/framework/inc/services/substitutepathvars.hxx 
b/framework/inc/services/substitutepathvars.hxx
index cda8321..7b5b352 100644
--- a/framework/inc/services/substitutepathvars.hxx
+++ b/framework/inc/services/substitutepathvars.hxx
@@ -269,10 +269,6 @@ class SubstitutePathVariables : private ThreadHelpBase, // 
Struct for right init
 }
 };
 
-// heavy used string
-const OUString  m_aVarStart;
-const OUString  m_aVarEnd;
-
 VarNameToIndexMapm_aPreDefVarMap; // Mapping 
from pre-def variable names to enum for array access
 SubstituteVariables  m_aSubstVarMap;  // Active 
rule set map indexed by variable name!
 PredefinedPathVariables  m_aPreDefVars;   // All 
predefined variables
diff --git a/framework/source/services/substitutepathvars.cxx 
b/framework/source/services/substitutepathvars.cxx
index 1be48e8..7839c1b 100644
--- a/framework/source/services/substitutepathvars.cxx
+++ b/framework/source/services/substitutepathvars.cxx
@@ -50,61 +50,6 @@
 
 #include string.h
 
-//_
-//  Defines
-//_
-
-#define STRPOS_NOTFOUND  (sal_Int32)-1
-
-// Variable start/end characters
-#define SIGN_STARTVARIABLE   $(
-#define SIGN_ENDVARIABLE )
-
-// Length of SUBSTITUTE_... to replace it with real values.
-#define REPLACELENGTH_INST   7
-#define REPLACELENGTH_PROG   7
-#define REPLACELENGTH_USER   7
-#define REPLACELENGTH_WORK   7
-#define REPLACELENGTH_HOME   7
-#define REPLACELENGTH_TEMP   7
-#define REPLACELENGTH_PATH   7
-#define REPLACELENGTH_INSTPATH  11
-#define REPLACELENGTH_PROGPATH  11
-#define REPLACELENGTH_USERPATH  11
-#define REPLACELENGTH_INSTURL   10
-#define REPLACELENGTH_PROGURL   10
-#define REPLACELENGTH_USERURL   10
-#define REPLACELENGTH_LANG   7
-#define REPLACELENGTH_LANGID 9
-#define REPLACELENGTH_VLANG  8
-#define REPLACELENGTH_WORKDIRURL13
-// New variable of hierachy service (#i32656#)
-#define REPLACELENGTH_BASEINSTURL   14
-#define REPLACELENGTH_USERDATAURL   14
-
-// Name of the pre defined path variables
-#define VARIABLE_INST   $(inst)
-#define VARIABLE_PROG   $(prog)
-#define VARIABLE_USER   $(user)
-#define VARIABLE_WORK   $(work)
-#define VARIABLE_HOME   $(home)
-#define VARIABLE_TEMP   $(temp)
-#define VARIABLE_PATH   $(path)
-#define VARIABLE_LANG   $(lang)
-#define VARIABLE_LANGID $(langid)
-#define VARIABLE_VLANG  $(vlang)
-#define VARIABLE_INSTPATH   $(instpath)
-#define VARIABLE_PROGPATH   $(progpath)
-#define VARIABLE_USERPATH   $(userpath)
-#define VARIABLE_INSTURL$(insturl)
-#define VARIABLE_PROGURL$(progurl)
-#define VARIABLE_USERURL$(userurl)
-#define VARIABLE_WORKDIRURL $(workdirurl)
-// New variable of hierachy service (#i32656#)
-#define VARIABLE_BASEINSTURL$(baseinsturl)
-#define VARIABLE_USERDATAURL$(userdataurl)
-#define VARIABLE_BRANDBASEURL   $(brandbaseurl)
-
 using namespace com::sun::star::uno;
 using namespace com::sun::star::beans;
 using namespace com::sun::star::util;
@@ -121,15 +66,15 @@ namespace framework
 struct FixedVariable
 {
 const char* pVarName;
+sal_Int32   nStrLen;
 PreDefVariable  nEnumValue;
-int nStrLen;
 boolbAbsPath;
 };
 
 struct TableEntry
 {
 const char* pOSString;
-int nStrLen;
+sal_Int32   nStrLen;
 };
 
 // Table with valid 

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

2013-09-08 Thread Tor Lillqvist
 framework/inc/macros/debug.hxx|6 --
 framework/inc/macros/debug/registration.hxx   |   63 --
 framework/inc/macros/registration.hxx |5 -
 framework/source/helper/ocomponentenumeration.cxx |6 --
 framework/source/services/frame.cxx   |   24 +---
 5 files changed, 5 insertions(+), 99 deletions(-)

New commits:
commit 895885652eef980338ce7c9231be3f86f8c770d5
Author: Tor Lillqvist t...@collabora.com
Date:   Mon Sep 9 00:06:30 2013 +0300

Fix non-debug build

Change-Id: I5446c7fec62c1a934b1ffb21fefa1279b932ca09

diff --git a/framework/source/helper/ocomponentenumeration.cxx 
b/framework/source/helper/ocomponentenumeration.cxx
index c1b3ea8..1c65873 100644
--- a/framework/source/helper/ocomponentenumeration.cxx
+++ b/framework/source/helper/ocomponentenumeration.cxx
@@ -64,11 +64,7 @@ OComponentEnumeration::~OComponentEnumeration()
 
//*
 //  XEventListener
 
//*
-void SAL_CALL OComponentEnumeration::disposing( const EventObject
-#if OSL_DEBUG_LEVEL  0
-aEvent
-#endif
-) throw( RuntimeException )
+void SAL_CALL OComponentEnumeration::disposing( const EventObject aEvent ) 
throw( RuntimeException )
 {
 // Ready for multithreading
 ResetableGuard aGuard( m_aLock );
diff --git a/framework/source/services/frame.cxx 
b/framework/source/services/frame.cxx
index 9af43fc..15a809b 100644
--- a/framework/source/services/frame.cxx
+++ b/framework/source/services/frame.cxx
@@ -2170,11 +2170,7 @@ css::uno::Sequence css::frame::DispatchInformation  
SAL_CALL Frame::getConfigu
 
 @onerror-
 
*//*-*/
-void SAL_CALL Frame::windowResized( const css::awt::WindowEvent
-#if OSL_DEBUG_LEVEL  0
-aEvent
-#endif
-) throw( css::uno::RuntimeException )
+void SAL_CALL Frame::windowResized( const css::awt::WindowEvent aEvent ) 
throw( css::uno::RuntimeException )
 {
 /* UNSAFE AREA 
-
 */
 // Check incoming parameter.
@@ -2190,11 +2186,7 @@ aEvent
 }
 
 
//*
-void SAL_CALL Frame::focusGained( const css::awt::FocusEvent
-#if OSL_DEBUG_LEVEL  0
-aEvent
-#endif
-) throw( css::uno::RuntimeException )
+void SAL_CALL Frame::focusGained( const css::awt::FocusEvent aEvent ) throw( 
css::uno::RuntimeException )
 {
 /* UNSAFE AREA 
-
 */
 // Check incoming parameter.
@@ -2230,11 +,7 @@ aEvent
 
 @onerror-
 
*//*-*/
-void SAL_CALL Frame::windowActivated( const css::lang::EventObject
-#if OSL_DEBUG_LEVEL  0
-aEvent
-#endif
-) throw( css::uno::RuntimeException )
+void SAL_CALL Frame::windowActivated( const css::lang::EventObject aEvent ) 
throw( css::uno::RuntimeException )
 {
 /* UNSAFE AREA 
-
 */
 // Check incoming parameter.
@@ -2257,11 +2245,7 @@ aEvent
 }
 
 
//*
-void SAL_CALL Frame::windowDeactivated( const css::lang::EventObject
-#if OSL_DEBUG_LEVEL  0
-aEvent
-#endif
-) throw( css::uno::RuntimeException )
+void SAL_CALL Frame::windowDeactivated( const css::lang::EventObject aEvent ) 
throw( css::uno::RuntimeException )
 {
 /* UNSAFE AREA 
-
 */
 // Check incoming parameter.
commit 44d19e119e00e52edd47c01d8d1c3812e8eb4afd
Author: Tor Lillqvist t...@collabora.com
Date:   Mon Sep 9 00:04:56 2013 +0300

Bin the fairly pointless LOG_REGISTRATION_GETFACTORY

Change-Id: Ia73eed753d1c4adc847a190449a18498710c8b40

diff --git a/framework/inc/macros/debug.hxx b/framework/inc/macros/debug.hxx
index 2c2dd85..f456718 100644
--- a/framework/inc/macros/debug.hxx
+++ b/framework/inc/macros/debug.hxx
@@ -39,17 +39,11 @@
 // = product (OSL_DEBUG_LEVEL == 0)
 #else
 
-#undef  ENABLE_REGISTRATIONDEBUG
 #undef  ENABLE_FILTERDBG
 
 #endif
 
 
//*
-//  special macros to debug service registration
-//*
-#include macros/debug/registration.hxx
-

[Libreoffice-commits] core.git: 2 commits - framework/inc framework/source include/svtools offapi/com sw/source

2013-05-31 Thread Michael Stahl
 framework/inc/uielement/statusbarmanager.hxx   |3 
 framework/source/uielement/statusbarmanager.cxx|  122 -
 include/svtools/statusbarcontroller.hxx|1 
 offapi/com/sun/star/frame/XStatusbarController.idl |9 +
 sw/source/core/unocore/unoframe.cxx|5 
 5 files changed, 63 insertions(+), 77 deletions(-)

New commits:
commit f5e8f5b0b5410d29b5cb1fb6fbbd8bf3c48a0201
Author: Michael Stahl mst...@redhat.com
Date:   Fri May 31 12:34:35 2013 +0200

sw: SwXFrame: fix gradient import problem:

BaseFrameProperties_Impl::FillBaseProperties: It may happen that
checkForUniqueItem returns an item with a name that already exists, if
the same gradient appears multiple times; don't crash with unhandled
ElementExistException then.
(can be reproduced with test3.docx from fdo#41466)
(regression from 1a3c90a292c7fc9060604151de9dc51eecf5b6a7)

Change-Id: Iace7af4c5679c1c7e978525fa31abf884038567c

diff --git a/sw/source/core/unocore/unoframe.cxx 
b/sw/source/core/unocore/unoframe.cxx
index d3d5ed5..0273a1e 100644
--- a/sw/source/core/unocore/unoframe.cxx
+++ b/sw/source/core/unocore/unoframe.cxx
@@ -267,7 +267,10 @@ bool BaseFrameProperties_Impl::FillBaseProperties(SwDoc* 
pDoc, SfxItemSet rToSe
 uno::Referenceframe::XModel 
xModel(pDoc-GetDocShell()-GetModel());
 uno::Referencelang::XMultiServiceFactory 
xServiceFact(xModel, uno::UNO_QUERY);
 uno::Reference container::XNameContainer  
xGradients(xServiceFact-createInstance(com.sun.star.drawing.GradientTable), 
uno::UNO_QUERY);
-xGradients-insertByName(pItem-GetName(), *pFillGradient);
+if (!xGradients-hasByName(pItem-GetName()))
+{
+xGradients-insertByName(pItem-GetName(), 
*pFillGradient);
+}
 
 delete pItem;
 }
commit d0508f79c15a5d789f5e6af214d78ce89e05071d
Author: Ariel Constenla-Haile arie...@apache.org
Date:   Mon May 27 05:46:18 2013 +

css::frame::XStatusbarController: add missing interface

Added ::com::sun::star::lang::XComponent. IDL documentation taken from

http://wiki.openoffice.org/wiki/Framework/Tutorial/Statusbar_Controller#Status_bar_controller_service
(cherry picked from commit f3dc398e002926792a0c6160691d46eb75cad236)

Conflicts:
framework/inc/uielement/statusbarmanager.hxx
framework/source/uielement/statusbarmanager.cxx

Change-Id: Id2d768250632b12b834602a33a4e9923cec9bd3f

diff --git a/framework/inc/uielement/statusbarmanager.hxx 
b/framework/inc/uielement/statusbarmanager.hxx
index 71bfc34..b469ad7 100644
--- a/framework/inc/uielement/statusbarmanager.hxx
+++ b/framework/inc/uielement/statusbarmanager.hxx
@@ -27,7 +27,6 @@
 #include stdtypes.h
 
 #include com/sun/star/frame/XFrame.hpp
-#include com/sun/star/frame/XStatusListener.hpp
 #include com/sun/star/frame/XStatusbarController.hpp
 #include com/sun/star/frame/XUIControllerFactory.hpp
 #include com/sun/star/ui/XUIConfiguration.hpp
@@ -104,7 +103,7 @@ class StatusBarManager : public 
::com::sun::star::frame::XFrameActionListener
 void MouseButton( const MouseEvent rMEvt ,sal_Bool ( SAL_CALL 
::com::sun::star::frame::XStatusbarController::*_pMethod )(const 
::com::sun::star::awt::MouseEvent));
 
 protected:
-typedef std::map sal_uInt16, ::com::sun::star::uno::Reference 
com::sun::star::frame::XStatusListener   StatusBarControllerMap;
+typedef std::map sal_uInt16, ::com::sun::star::uno::Reference 
com::sun::star::frame::XStatusbarController   StatusBarControllerMap;
 
 sal_Bool   
 m_bDisposed : 1,

 m_bFrameActionRegistered : 1,
diff --git a/framework/source/uielement/statusbarmanager.cxx 
b/framework/source/uielement/statusbarmanager.cxx
index 2b096a5..5a86dd6 100644
--- a/framework/source/uielement/statusbarmanager.cxx
+++ b/framework/source/uielement/statusbarmanager.cxx
@@ -37,9 +37,7 @@
 #include helper/mischelper.hxx
 
 #include com/sun/star/frame/XFrame.hpp
-#include com/sun/star/frame/XStatusListener.hpp
 #include com/sun/star/frame/StatusbarControllerFactory.hpp
-#include com/sun/star/util/XUpdatable.hpp
 #include com/sun/star/ui/ItemStyle.hpp
 #include com/sun/star/ui/ItemType.hpp
 #include com/sun/star/lang/XMultiComponentFactory.hpp
@@ -81,9 +79,8 @@ struct lcl_UpdateController : public std::unary_function 
typename MAP::value_ty
 {
 try
 {
-uno::Reference util::XUpdatable  xUpdatable( rElement.second, 
uno::UNO_QUERY );
-if ( xUpdatable.is() )
-xUpdatable-update();
+if ( rElement.second.is() )
+rElement.second-update();
 

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

2013-05-21 Thread Andre Fischer
 framework/inc/uifactory/uicontrollerfactory.hxx|  101 +++
 framework/source/uifactory/uicontrollerfactory.cxx |  269 +
 include/sfx2/sidebar/ControlFactory.hxx|   29 ++
 include/sfx2/sidebar/ControllerFactory.hxx |   16 +
 include/sfx2/sidebar/SidebarToolBox.hxx|4 
 include/sfx2/sidebar/Tools.hxx |3 
 sfx2/source/sidebar/ControlFactory.cxx |5 
 sfx2/source/sidebar/ControllerFactory.cxx  |  132 --
 sfx2/source/sidebar/ResourceManager.cxx|   26 --
 sfx2/source/sidebar/ResourceManager.hxx|3 
 sfx2/source/sidebar/SidebarToolBox.cxx |   28 +-
 sfx2/source/sidebar/ToolBoxBackground.cxx  |   13 -
 sfx2/source/sidebar/ToolBoxBackground.hxx  |4 
 sfx2/source/sidebar/Tools.cxx  |   25 +
 svx/source/sidebar/insert/InsertPropertyPanel.hxx  |2 
 15 files changed, 594 insertions(+), 66 deletions(-)

New commits:
commit edaca7c6e1d1ade6bf6cdae753028ee62297f0b1
Author: Andre Fischer a...@apache.org
Date:   Thu May 16 11:43:55 2013 +

Resolves: #i121960# Improve creation of toolbox/toolbar controllers

(cherry picked from commit 3608a33d8362cbc44a2eb7203b7d1bffe481c7ab)

Conflicts:
sfx2/inc/sfx2/sidebar/ControlFactory.hxx
sfx2/inc/sfx2/sidebar/ControllerFactory.hxx
sfx2/inc/sfx2/sidebar/SidebarToolBox.hxx
sfx2/inc/sfx2/sidebar/Tools.hxx
sfx2/source/sidebar/ToolBoxBackground.cxx

Change-Id: I833a33bbc58ebe46bd28c6d97a4d76329f1f0186

diff --git a/include/sfx2/sidebar/ControlFactory.hxx 
b/include/sfx2/sidebar/ControlFactory.hxx
index 3b286e9..b4d329a 100644
--- a/include/sfx2/sidebar/ControlFactory.hxx
+++ b/include/sfx2/sidebar/ControlFactory.hxx
@@ -28,26 +28,49 @@ namespace sfx2 { namespace sidebar {
 
 class ToolBoxBackground;
 
+/** Factory for controls used in sidebar panels.
+The reason to use this factory instead of creating the controls
+directly is that this way the sidebar has a little more control
+over look and feel of its controls.
+*/
 class SFX2_DLLPUBLIC ControlFactory
 {
 public:
+/** Create the menu button for the task bar.
+*/
 static CheckBox* CreateMenuButton (Window* pParentWindow);
+
 static ImageRadioButton* CreateTabItem (Window* pParentWindow);
 
-/** Create a tool box that does *not* handle its items.
+/** Create a tool box that does *not* handle its items.  The
+caller has to register callbacks to process, among others,
+click and selection events.
 */
 static SidebarToolBox* CreateToolBox (
 Window* pParentWindow,
 const ResId rResId);
 
-/** Create a tool box that *does* handle its items.
+/** Create a tool box that *does* handle its items.  All event
+processing is done by toolbox controllers.
 */
 static SidebarToolBox* CreateToolBox (
 Window* pParentWindow,
 const ResId rResId,
 const ::com::sun::star::uno::Referencecom::sun::star::frame::XFrame 
rxFrame);
 
-static Window* CreateToolBoxBackground (Window* pParentWindow);
+/** Create a window that acts as background of a tool box.
+In general it is slightly larger than the tool box.
+@param pParentWindow
+The parent window of the new background control.
+@param bShowBorder
+When TRUE/ then the background control is made slightly
+larger then its tool box child, once that is created.
+Otherwise the background control will not be visible.
+*/
+static Window* CreateToolBoxBackground (
+Window* pParentWindow,
+const bool bShowBorder = true);
+
 static ImageRadioButton* CreateCustomImageRadionButton(
 Window* pParentWindow,
 const ResId rResId );
diff --git a/include/sfx2/sidebar/ControllerFactory.hxx 
b/include/sfx2/sidebar/ControllerFactory.hxx
index 030b050..fa341f1 100644
--- a/include/sfx2/sidebar/ControllerFactory.hxx
+++ b/include/sfx2/sidebar/ControllerFactory.hxx
@@ -19,8 +19,9 @@
 #define SFX_SIDEBAR_CONTROLLER_FACTORY_HXX
 
 #include sfx2/dllapi.h
-#include com/sun/star/frame/XToolbarController.hpp
+#include com/sun/star/awt/XWindow.hpp
 #include com/sun/star/frame/XFrame.hpp
+#include com/sun/star/frame/XToolbarController.hpp
 
 namespace css = ::com::sun::star;
 namespace cssu = ::com::sun::star::uno;
@@ -29,7 +30,7 @@ class ToolBox;
 
 namespace sfx2 { namespace sidebar {
 
-/** Convenience class for easy creation of toolbox controllers.
+/** Convenience class for the easy creation of toolbox controllers.
 */
 class SFX2_DLLPUBLIC ControllerFactory
 {
@@ -38,7 +39,16 @@ public:
 ToolBox* pToolBox,
 const sal_uInt16 nItemId,
 const ::rtl::OUString rsCommandName,
-const cssu::Referencecss::frame::XFrame rxFrame);
+const cssu::Referencecss::frame::XFrame rxFrame,
+const