[Libreoffice-commits] core.git: Branch 'libreoffice-7-0' - include/vcl vcl/inc vcl/source

Caolán McNamara (via logerrit) logerrit at kemper.freedesktop.org
Sun Jan 17 23:44:30 UTC 2021


 include/vcl/toolkit/roadmap.hxx      |    2 +-
 vcl/inc/wizdlg.hxx                   |    2 +-
 vcl/source/app/salvtables.cxx        |    2 +-
 vcl/source/control/roadmap.cxx       |    5 +++--
 vcl/source/control/roadmapwizard.cxx |    4 ++--
 5 files changed, 8 insertions(+), 7 deletions(-)

New commits:
commit d11b11c39b2451b26daac4383d29eaa83dcc2bf5
Author:     Caolán McNamara <caolanm at redhat.com>
AuthorDate: Fri Jan 15 16:39:08 2021 +0000
Commit:     Adolfo Jayme Barrientos <fitojb at ubuntu.com>
CommitDate: Mon Jan 18 00:43:53 2021 +0100

    tdf#138829 don't grab focus to roadmap label when sync timer fires
    
    Change-Id: Icc8a03a2ce5d63f3a2c477671a9aa52aefd1df96
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/109392
    Tested-by: Jenkins
    Reviewed-by: Adolfo Jayme Barrientos <fitojb at ubuntu.com>

diff --git a/include/vcl/toolkit/roadmap.hxx b/include/vcl/toolkit/roadmap.hxx
index c2654c1fd56e..7cfd6d7bd290 100644
--- a/include/vcl/toolkit/roadmap.hxx
+++ b/include/vcl/toolkit/roadmap.hxx
@@ -73,7 +73,7 @@ public:
     void            DeleteRoadmapItem( ItemIndex _nIndex );
 
     ItemId          GetCurrentRoadmapItemID() const;
-    bool            SelectRoadmapItemByID( ItemId _nItemID );
+    bool            SelectRoadmapItemByID(ItemId nItemID, bool bGrabFocus = true);
 
     void            SetItemSelectHdl( const Link<LinkParamNone*,void>& _rHdl );
     Link<LinkParamNone*,void> const & GetItemSelectHdl( ) const;
diff --git a/vcl/inc/wizdlg.hxx b/vcl/inc/wizdlg.hxx
index 2c82b3ab8dd3..f728f2f5225f 100644
--- a/vcl/inc/wizdlg.hxx
+++ b/vcl/inc/wizdlg.hxx
@@ -145,7 +145,7 @@ namespace vcl
         void            InsertRoadmapItem(int nIndex, const OUString& rLabel, int nId, bool bEnabled);
         void            DeleteRoadmapItems();
         int             GetCurrentRoadmapItemID() const;
-        void            SelectRoadmapItemByID(int nId);
+        void            SelectRoadmapItemByID(int nId, bool bGrabFocus = true);
         void            SetItemSelectHdl( const Link<LinkParamNone*,void>& _rHdl );
         void            ShowRoadmap(bool bShow);
 
diff --git a/vcl/source/app/salvtables.cxx b/vcl/source/app/salvtables.cxx
index d7c93164a676..758473e5b69c 100644
--- a/vcl/source/app/salvtables.cxx
+++ b/vcl/source/app/salvtables.cxx
@@ -1824,7 +1824,7 @@ IMPL_LINK_NOARG(SalInstanceAssistant, UpdateRoadmap_Hdl, Timer*, void)
         m_xWizard->InsertRoadmapItem(nPos++, rLabel, m_aIds[i], bSensitive);
     }
 
-    m_xWizard->SelectRoadmapItemByID(m_aIds[get_current_page()]);
+    m_xWizard->SelectRoadmapItemByID(m_aIds[get_current_page()], false);
 
     m_xWizard->ShowRoadmap(nPos != 0);
 
diff --git a/vcl/source/control/roadmap.cxx b/vcl/source/control/roadmap.cxx
index 9f7e6a0e12ef..1658869cfca7 100644
--- a/vcl/source/control/roadmap.cxx
+++ b/vcl/source/control/roadmap.cxx
@@ -523,7 +523,7 @@ void ORoadmap::GetFocus()
         pCurHyperLabel->GrabFocus();
 }
 
-bool ORoadmap::SelectRoadmapItemByID( ItemId _nNewID )
+bool ORoadmap::SelectRoadmapItemByID(ItemId _nNewID, bool bGrabFocus)
 {
     DeselectOldRoadmapItems();
     RoadmapItem* pItem = GetByID( _nNewID );
@@ -534,7 +534,8 @@ bool ORoadmap::SelectRoadmapItemByID( ItemId _nNewID )
             const StyleSettings& rStyleSettings = GetSettings().GetStyleSettings();
             pItem->ToggleBackgroundColor( rStyleSettings.GetHighlightColor() ); //HighlightColor
 
-            pItem->GrabFocus();
+            if (bGrabFocus)
+                pItem->GrabFocus();
             m_pImpl->setCurItemID(_nNewID);
 
             Select();
diff --git a/vcl/source/control/roadmapwizard.cxx b/vcl/source/control/roadmapwizard.cxx
index d73cc1a18a5b..1b24e39cc4fc 100644
--- a/vcl/source/control/roadmapwizard.cxx
+++ b/vcl/source/control/roadmapwizard.cxx
@@ -827,9 +827,9 @@ namespace vcl
         m_xRoadmapImpl->pRoadmap->InsertRoadmapItem(nItemIndex, rText, nItemId, bEnable);
     }
 
-    void RoadmapWizard::SelectRoadmapItemByID(int nItemId)
+    void RoadmapWizard::SelectRoadmapItemByID(int nItemId, bool bGrabFocus)
     {
-        m_xRoadmapImpl->pRoadmap->SelectRoadmapItemByID(nItemId);
+        m_xRoadmapImpl->pRoadmap->SelectRoadmapItemByID(nItemId, bGrabFocus);
     }
 
     void RoadmapWizard::DeleteRoadmapItems()


More information about the Libreoffice-commits mailing list