sfx2/source/commandpopup/CommandPopup.cxx |    7 +++++--
 xmloff/source/draw/ximpshap.cxx           |    2 +-
 2 files changed, 6 insertions(+), 3 deletions(-)

New commits:
commit 7113a11a3cfa38a27dde4779b6565cf723b4b0d2
Author:     Dung.Saga <dung.saga+documentfoundat...@gmail.com>
AuthorDate: Wed Sep 6 19:23:16 2023 +0700
Commit:     Tomaž Vajngerl <qui...@gmail.com>
CommitDate: Thu Sep 7 10:51:38 2023 +0200

    tdf#157114 The popup "Search Commands" should also search by sub-menu
    
    Currently, the popup "Search Commands" only search by menu item. For 
example,
    searching for "right" yields "Format / Align Text / Right", but searching 
for
    "align" yields nothing.
    
    I updated function findInMenu to search in both sub-menus and menu items. 
This
    makes it easier to discover related actions in the same sub-menu.
    
    Change-Id: I8aa03619c5a3db9c95b09600a80caed1e029d1af
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/156617
    Tested-by: Jenkins
    Reviewed-by: Tomaž Vajngerl <qui...@gmail.com>

diff --git a/sfx2/source/commandpopup/CommandPopup.cxx 
b/sfx2/source/commandpopup/CommandPopup.cxx
index f4cdf92436c7..8d68bd62bd76 100644
--- a/sfx2/source/commandpopup/CommandPopup.cxx
+++ b/sfx2/source/commandpopup/CommandPopup.cxx
@@ -83,11 +83,11 @@ void MenuContentHandler::gatherMenuContent(
             aNewContent.m_aCommandURL, m_sModuleLongName);
         OUString aLabel = 
vcl::CommandInfoProvider::GetLabelForCommand(aCommandProperties);
         aNewContent.m_aMenuLabel = aLabel;
-        aNewContent.m_aSearchableMenuLabel = toLower(aLabel);
 
         if (!rMenuContent.m_aFullLabelWithPath.isEmpty())
             aNewContent.m_aFullLabelWithPath = 
rMenuContent.m_aFullLabelWithPath + " / ";
         aNewContent.m_aFullLabelWithPath += aNewContent.m_aMenuLabel;
+        aNewContent.m_aSearchableMenuLabel = 
toLower(aNewContent.m_aFullLabelWithPath);
 
         aNewContent.m_aTooltip = 
vcl::CommandInfoProvider::GetTooltipForCommand(
             aNewContent.m_aCommandURL, aCommandProperties, m_xFrame);
@@ -107,13 +107,16 @@ void MenuContentHandler::findInMenu(OUString const& rText,
 
     OUString aLowerCaseText = toLower(rText);
 
+    // find submenus and menu items that start with the searched text
     auto aTextStartCriterium = [](MenuContent const& rMenuContent, OUString 
const& rSearchText) {
-        return rMenuContent.m_aSearchableMenuLabel.startsWith(rSearchText);
+        OUString aSearchText = " / " + rSearchText;
+        return rMenuContent.m_aSearchableMenuLabel.indexOf(aSearchText) > 0;
     };
 
     findInMenuRecursive(m_aMenuContent, aLowerCaseText, rpCommandTreeView, 
rCommandList,
                         aTextStartCriterium);
 
+    // find submenus and menu items that contain the searched text
     auto aTextAllCriterium = [](MenuContent const& rMenuContent, OUString 
const& rSearchText) {
         return rMenuContent.m_aSearchableMenuLabel.indexOf(rSearchText) > 0;
     };
commit a24b2c9ec7f57f2dafa92564860878e829967341
Author:     Andrea Gelmini <andrea.gelm...@gelma.net>
AuthorDate: Thu Sep 7 08:45:10 2023 +0200
Commit:     Julien Nabet <serval2...@yahoo.fr>
CommitDate: Thu Sep 7 10:51:26 2023 +0200

    Fix typo
    
    Change-Id: I330ff642b93e07c402f8dbb2fa0cefb1af1a7671
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/156634
    Tested-by: Julien Nabet <serval2...@yahoo.fr>
    Reviewed-by: Julien Nabet <serval2...@yahoo.fr>

diff --git a/xmloff/source/draw/ximpshap.cxx b/xmloff/source/draw/ximpshap.cxx
index 1dc5a2618d16..7532b4320099 100644
--- a/xmloff/source/draw/ximpshap.cxx
+++ b/xmloff/source/draw/ximpshap.cxx
@@ -1627,7 +1627,7 @@ void SdXMLTextBoxShapeContext::startFastElement 
(sal_Int32 nElement,
 //A     if(!bIsPresShape || mbIsUserTransformed)
 //A     {
 //A         // set pos and size on shape, this should remove binding
-//A         // to pres object on masterpage
+//A         // to presentation object on masterpage
 //A         SetSizeAndPosition();
 //A     }
 

Reply via email to