[Libreoffice-commits] core.git: Branch 'feature/qt5+kde5' - 2 commits - vcl/inc vcl/qt5
Katarina Behrens
Katarina.Behrens at cib.de
Tue May 22 07:57:12 UTC 2018
vcl/inc/qt5/Qt5Menu.hxx | 2 ++
vcl/qt5/Qt5Menu.cxx | 8 ++++++++
2 files changed, 10 insertions(+)
New commits:
commit a8780a356ac1ce0d45a6114b2a631fdf93ba2502
Author: Katarina Behrens <Katarina.Behrens at cib.de>
Date: Thu May 17 16:48:53 2018 +0200
Clear menubar before opening a new app
Change-Id: Icab19e31f7aa737351460790d2028114b24284ad
diff --git a/vcl/qt5/Qt5Menu.cxx b/vcl/qt5/Qt5Menu.cxx
index e70e2d1896a9..586130925356 100644
--- a/vcl/qt5/Qt5Menu.cxx
+++ b/vcl/qt5/Qt5Menu.cxx
@@ -91,6 +91,9 @@ void Qt5Menu::Update()
{
Menu* pVCLMenu = mpVCLMenu;
+ if ( mbMenuBar && mpQMenuBar )
+ mpQMenuBar->clear();
+
for ( sal_Int32 nItem = 0; nItem < static_cast<sal_Int32>(GetItemCount()); nItem++ )
{
Qt5MenuItem *pSalMenuItem = GetItemAtPos( nItem );
commit d66f970aace835e921d8ac62ed7837255eea0396
Author: Katarina Behrens <Katarina.Behrens at cib.de>
Date: Thu May 17 15:09:48 2018 +0200
Replace ~ with & (Qt accelerator marker) in menu entries
Change-Id: Ie7866357d4e74b778849262c1c2b60605a26faad
diff --git a/vcl/inc/qt5/Qt5Menu.hxx b/vcl/inc/qt5/Qt5Menu.hxx
index 1d1048881fbc..aa3948ce6d2d 100644
--- a/vcl/inc/qt5/Qt5Menu.hxx
+++ b/vcl/inc/qt5/Qt5Menu.hxx
@@ -30,6 +30,8 @@ private:
void ActivateAllSubMenus( Menu* pMenuBar );
void Update();
+ void NativeItemText( OUString &rItemText );
+
public:
Qt5Menu( bool bMenuBar );
virtual ~Qt5Menu() override;
diff --git a/vcl/qt5/Qt5Menu.cxx b/vcl/qt5/Qt5Menu.cxx
index b82b525462c0..e70e2d1896a9 100644
--- a/vcl/qt5/Qt5Menu.cxx
+++ b/vcl/qt5/Qt5Menu.cxx
@@ -99,6 +99,7 @@ void Qt5Menu::Update()
if (mbMenuBar && mpQMenuBar)
{
+ NativeItemText( aText );
mpQMenuBar->addMenu( toQString(aText) );
}
}
@@ -132,6 +133,10 @@ void Qt5Menu::GetSystemMenuData( SystemMenuData* pData )
{
}
+void Qt5Menu::NativeItemText( OUString& rItemText )
+{
+ rItemText = rItemText.replace( '~', '&' );
+}
Qt5MenuItem::Qt5MenuItem( const SalItemParams* pItemData ) :
mnId( pItemData->nId ),
More information about the Libreoffice-commits
mailing list