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

2021-07-08 Thread Caolán McNamara (via logerrit)
 framework/source/uielement/toolbarmanager.cxx |3 ---
 include/vcl/window.hxx|2 +-
 svtools/source/uno/popupwindowcontroller.cxx  |3 ---
 3 files changed, 1 insertion(+), 7 deletions(-)

New commits:
commit 3175a7684982e7812e8071c595395eb3da3035fc
Author: Caolán McNamara 
AuthorDate: Thu Jul 8 14:28:25 2021 +0100
Commit: Caolán McNamara 
CommitDate: Thu Jul 8 22:26:51 2021 +0200

make SetParentToDefaultWindow available from vcl only

rechecked tdf#119390. If I tear off the color popdown in writer, click
in the combobox and shift-tab to put focus in the button (where focus is
more visible) and close the torn off window then focus continues to
return to the main document as wanted.

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

diff --git a/framework/source/uielement/toolbarmanager.cxx 
b/framework/source/uielement/toolbarmanager.cxx
index 0bd0d627ff9d..f08cfe60a6d8 100644
--- a/framework/source/uielement/toolbarmanager.cxx
+++ b/framework/source/uielement/toolbarmanager.cxx
@@ -182,9 +182,6 @@ public:
 delete static_cast< AddonsParams* >( m_pToolBar->GetItemData( 
nItemId ));
 }
 
-// tdf#119390 this will reparent the toolbar, so focus is restored 
from a
-// floating toolbar to the last focused control of the application 
window.
-m_pToolBar->SetParentToDefaultWindow();
 // #i93173# note we can still be in one of the toolbar's handlers
 m_pToolBar->SetSelectHdl( Link() );
 m_pToolBar->SetActivateHdl( Link() );
diff --git a/include/vcl/window.hxx b/include/vcl/window.hxx
index 1cdb347a486e..0deb36dad6fd 100644
--- a/include/vcl/window.hxx
+++ b/include/vcl/window.hxx
@@ -1455,7 +1455,7 @@ public:
  * document window and not the first widget in the current parent of the 
floating
  * window.
 */
-void SetParentToDefaultWindow();
+SAL_DLLPRIVATE void SetParentToDefaultWindow();
 
 
 //  Keyboard access functions
diff --git a/svtools/source/uno/popupwindowcontroller.cxx 
b/svtools/source/uno/popupwindowcontroller.cxx
index 17b432c445e5..8d3efd838bd1 100644
--- a/svtools/source/uno/popupwindowcontroller.cxx
+++ b/svtools/source/uno/popupwindowcontroller.cxx
@@ -80,9 +80,6 @@ void PopupWindowControllerImpl::SetFloatingWindow()
 if( mpFloatingWindow )
 {
 mpFloatingWindow->RemoveEventListener( LINK( this, 
PopupWindowControllerImpl, WindowEventListener ) );
-// tdf#119390 reparent the window, so focus is restored
-// to the last focused control of the application window.
-mpFloatingWindow->SetParentToDefaultWindow();
 mpFloatingWindow.disposeAndClear();
 }
 mpFloatingWindow = mpPopupWindow;
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2013-07-31 Thread Kohei Yoshida
 framework/source/uielement/menubarmanager.cxx |6 
 include/vcl/menu.hxx  |   28 ++--
 include/vcl/outdev.hxx|4 
 svtools/source/uno/contextmenuhelper.cxx  |2 
 vcl/source/gdi/outdev3.cxx|   24 +--
 vcl/source/gdi/pdfwriter_impl.cxx |2 
 vcl/source/window/menu.cxx|  159 +-
 7 files changed, 115 insertions(+), 110 deletions(-)

New commits:
commit f89637e329e765bce0bd513c843e4e2b673c38fd
Author: Kohei Yoshida 
Date:   Wed Jul 31 13:01:36 2013 -0400

Revert "convert vcl/menu.hxx from XubString to OUString"

This reverts commit 43b1ac3651732a1ceb193268ab72b4aaa90dee65.

diff --git a/framework/source/uielement/menubarmanager.cxx 
b/framework/source/uielement/menubarmanager.cxx
index 23baa74..7f7f69a 100644
--- a/framework/source/uielement/menubarmanager.cxx
+++ b/framework/source/uielement/menubarmanager.cxx
@@ -845,7 +845,7 @@ IMPL_LINK( MenuBarManager, Activate, Menu *, pMenu )
 {
 sal_uInt16 nItemId = pMenu->GetItemId( nPos );
 if (( pMenu->GetItemType( nPos ) != MENUITEM_SEPARATOR ) &&
-( pMenu->GetItemText( nItemId ).isEmpty() ))
+( pMenu->GetItemText( nItemId ).Len() == 0 ))
 {
 String aCommand = pMenu->GetItemCommand( nItemId );
 if ( aCommand.Len() > 0 ) {
@@ -1252,7 +1252,7 @@ void MenuBarManager::FillMenuManager( Menu* pMenu, const 
Reference< XFrame >& rF
 }
 
 if (( pMenu->IsMenuBar() || bAccessibilityEnabled ) &&
-( pMenu->GetItemText( nItemId ).isEmpty() ))
+( pMenu->GetItemText( nItemId ).Len() == 0 ))
 {
 if ( !aItemCommand.isEmpty() )
 pMenu->SetItemText( nItemId, RetrieveLabelFromCommand( 
aItemCommand ));
@@ -1272,7 +1272,7 @@ void MenuBarManager::FillMenuManager( Menu* pMenu, const 
Reference< XFrame >& rF
 {
 // Retrieve module identifier from Help Command entry
 OUString aModuleIdentifier( rModuleIdentifier );
-if ( !pMenu->GetHelpCommand( nItemId ).isEmpty() )
+if ( pMenu->GetHelpCommand( nItemId ).Len() > 0 )
 {
 aModuleIdentifier = pMenu->GetHelpCommand( nItemId );
 pMenu->SetHelpCommand( nItemId, aEmpty );
diff --git a/include/vcl/menu.hxx b/include/vcl/menu.hxx
index 8328166..f05ee5d 100644
--- a/include/vcl/menu.hxx
+++ b/include/vcl/menu.hxx
@@ -164,7 +164,7 @@ protected:
 SAL_DLLPRIVATE void ImplFillLayoutData() const;
 SAL_DLLPRIVATE SalMenu* ImplGetSalMenu() { return mpSalMenu; }
 SAL_DLLPRIVATE void ImplSetSalMenu( SalMenu *pMenu );
-SAL_DLLPRIVATE const OUString&  ImplGetHelpText( sal_uInt16 nItemId ) 
const;
+SAL_DLLPRIVATE const XubString& ImplGetHelpText( sal_uInt16 nItemId ) 
const;
 
 // returns native check and option menu symbol height in rCheckHeight and 
rRadioHeight
 // return value is maximum width and height of checkboxes and radiobuttons
@@ -194,7 +194,7 @@ public:
 virtual voidSelect();
 virtual voidRequestHelp( const HelpEvent& rHEvt );
 
-voidInsertItem( sal_uInt16 nItemId, const OUString& rStr,
+voidInsertItem( sal_uInt16 nItemId, const XubString& rStr,
 MenuItemBits nItemBits = 0,
 const OString &rIdent = OString(),
 sal_uInt16 nPos = MENU_APPEND );
@@ -203,7 +203,7 @@ public:
 const OString &rIdent = OString(),
 sal_uInt16 nPos = MENU_APPEND );
 voidInsertItem( sal_uInt16 nItemId,
-const OUString& rString, const Image& 
rImage,
+const XubString& rString, const Image& 
rImage,
 MenuItemBits nItemBits = 0,
 const OString &rIdent = OString(),
 sal_uInt16 nPos = MENU_APPEND );
@@ -267,8 +267,8 @@ public:
 voidRemoveDisabledEntries( sal_Bool bCheckPopups = 
sal_True, sal_Bool bRemoveEmptyPopups = sal_False );
 sal_BoolHasValidEntries( sal_Bool bCheckPopups = sal_True );
 
-voidSetItemText( sal_uInt16 nItemId, const OUString& rStr 
);
-OUStringGetItemText( sal_uInt16 nItemId ) const;
+voidSetItemText( sal_uInt16 nItemId, const XubString& rStr 
);
+XubString   GetItemText( sal_uInt16 nItemId ) const;
 
 voidSetItemImage( sal_uInt16 nItemId, const Image& rImage 
);
 Image   GetItemImage( sal_uInt16 nItemId ) const;
@@ -280,14 +280,14 @@ public:
 voidSetItemCommand( sal_uInt16 nItemId

[Libreoffice-commits] core.git: framework/source include/vcl svtools/source vcl/README.lifecycle vcl/source

2018-10-16 Thread Libreoffice Gerrit user
 framework/source/uielement/toolbarmanager.cxx |9 -
 include/vcl/lazydelete.hxx|  152 --
 include/vcl/window.hxx|8 -
 svtools/source/uno/popupwindowcontroller.cxx  |3 
 vcl/README.lifecycle  |2 
 vcl/source/app/svapp.cxx  |   11 -
 vcl/source/helper/lazydelete.cxx  |   35 -
 vcl/source/window/menu.cxx|8 -
 vcl/source/window/menubarwindow.cxx   |4 
 vcl/source/window/menufloatingwindow.cxx  |4 
 vcl/source/window/window.cxx  |   14 --
 vcl/source/window/window2.cxx |4 
 12 files changed, 28 insertions(+), 226 deletions(-)

New commits:
commit 8a2f7704cd0e43304e54bf2281232335cc0979a3
Author: Caolán McNamara 
AuthorDate: Fri Oct 12 15:42:59 2018 +0100
Commit: Caolán McNamara 
CommitDate: Tue Oct 16 09:54:13 2018 +0200

drop LazyDeletor

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

diff --git a/framework/source/uielement/toolbarmanager.cxx 
b/framework/source/uielement/toolbarmanager.cxx
index 5ca1bb8daa69..1ee4797d889b 100644
--- a/framework/source/uielement/toolbarmanager.cxx
+++ b/framework/source/uielement/toolbarmanager.cxx
@@ -232,13 +232,10 @@ void ToolBarManager::Destroy()
 delete static_cast< AddonsParams* >( m_pToolBar->GetItemData( 
nItemId ));
 }
 
-// Hide toolbar as lazy delete can destroy the toolbar much later.
-m_pToolBar->Hide();
-// #i93173# delete toolbar lazily as we can still be in one of its handlers
 // tdf#119390 this will reparent the toolbar, so focus is restored from a
 // floating toolbar to the last focused control of the application window.
-m_pToolBar->doLazyDelete();
-
+m_pToolBar->SetParentToDefaultWindow();
+// #i93173# note we can still be in one of the toolbar's handlers
 m_pToolBar->SetSelectHdl( Link() );
 m_pToolBar->SetActivateHdl( Link() );
 m_pToolBar->SetDeactivateHdl( Link() );
@@ -248,7 +245,7 @@ void ToolBarManager::Destroy()
 m_pToolBar->SetStateChangedHdl( Link() );
 m_pToolBar->SetDataChangedHdl( Link() );
 
-m_pToolBar.clear();
+m_pToolBar.disposeAndClear();
 
 SvtMiscOptions().RemoveListenerLink( LINK( this, ToolBarManager, 
MiscOptionsChanged ) );
 }
diff --git a/include/vcl/lazydelete.hxx b/include/vcl/lazydelete.hxx
index 89c88cbf4cc2..f7d74573de66 100644
--- a/include/vcl/lazydelete.hxx
+++ b/include/vcl/lazydelete.hxx
@@ -35,158 +35,8 @@
 
 namespace vcl
 {
-/* Helpers for lazy object deletion
-
-With vcl it is often necessary to delete objects (especially Windows)
-in the right order as well as in a way ensuring that the deleted objects
-are not still on the stack (e.g. deleting a Window in its key handler). To
-make this easier a helper class is given here which takes care of both
-sorting as well as lazy deletion.
-
-The grisly details:
-LazyDelete is a class that LazyDeletor register to. When vcl's event
-loop (that is Application::Yield or Application::Reschedule) comes out
-of the last level, the LazyDelete::flush is called. This will cause
-LazyDelete to delete all registered LazyDeletor objects.
-
-LazyDeletor is a one instance object that contains a list of
- objects to be deleted in sorted order. It is derived from
-LazyDeletorBase as to be able to register itself in LazyDelete.
-
-The user calls the static method LazyDeletor::Delete( T* ) with the
-object to be destroyed lazy. The static method creates the LazyDeletor
-(which in turn registers itself in LazyDelete) if this is the first time
-a T* is to be destroyed lazy. It then inserts the object. When the 
LazyDeletor
-gets delete it will delete the stored objects in a fashion
-that will ensure the correct order of deletion via the specialized is_less 
method
-(e.g. if a Window is a child of another Window and therefore should be 
destroyed
-first it is "less" in this sense)
-
-LazyDelete::flush will be called when the top of the nested event loop is
-reached again and will then destroy each registered LazyDeletor which
-in turn destroys the objects needed to be destroyed lazily. After this
-the state is as before entering the event loop.
-
-Preconditions:
-- The class  of which objects are to be destroyed needs a virtual
-destructor or must be final, else the wrong type will be destroyed.
-- The destructor of  should call LazyDeletor::Undelete( this ). This
-prevents duplicate deletion in case someone destroys the object 
prematurely.
-*/
-
-class LazyDeletorBase;
-class VCL_DLLPUBLIC LazyDelete
-{
-public:
-/** flush all registered object lists
-*/
-stat