svx/source/dialog/srchdlg.cxx |   31 ++++++++++++++++++++-----------
 1 file changed, 20 insertions(+), 11 deletions(-)

New commits:
commit c2580f1e9d51dc64f3571a2dfa49438537f98c24
Author:     Caolán McNamara <caolan.mcnam...@collabora.com>
AuthorDate: Tue May 6 16:38:57 2025 +0100
Commit:     Michael Meeks <michael.me...@collabora.com>
CommitDate: Tue May 6 19:24:20 2025 +0200

    no searchicon (or searchbox) in mobile version of search dialog
    
     #0  0x00007f7a68c0c0e7 in SvxSearchDialog::SetSearchLabel 
(this=0x377326e0, rStr=...)
         at /opt/rh/devtoolset-12/root/usr/include/c++/12/bits/unique_ptr.h:461
     #1  0x00007f7a68c1645c in SvxSearchDialog::SvxSearchDialog(weld::Window*, 
SfxChildWindow*, SfxBindings&) ()
         at 
/home/collabora/jenkins/workspace/build_core_co-25.04_for_online_snapshot/include/rtl/ustring.hxx:3957
     #2  0x00007f7a68c16a33 in std::_Construct<SvxSearchDialog, weld::Window*, 
SvxSearchDialogWrapper*, SfxBindings&> (__p=0x377326e0)
         at 
/opt/rh/devtoolset-12/root/usr/include/c++/12/bits/stl_construct.h:109
    
    I'm not sure whether this dialog even makes sense anymore, but lets not
    crash for now.
    
    Change-Id: I7c8bb0a317a2b058402194234a1daea5bac0b4de
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/184997
    Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoff...@gmail.com>
    Reviewed-by: Michael Meeks <michael.me...@collabora.com>

diff --git a/svx/source/dialog/srchdlg.cxx b/svx/source/dialog/srchdlg.cxx
index 6d9d597e90d1..07a02d60f300 100644
--- a/svx/source/dialog/srchdlg.cxx
+++ b/svx/source/dialog/srchdlg.cxx
@@ -318,7 +318,10 @@ SvxSearchDialog::SvxSearchDialog(weld::Window* pParent, 
SfxChildWindow* pChildWi
     m_xSearchAttrText->hide();
 
     this->SetSearchLabel(u""_ustr); // hide the message but keep the box height
-    m_xSearchIcon->set_size_request(24, 24); // vcl/res/infobar.png is 32x32 - 
too large here
+
+    //weird findreplacedialog-mobile.ui case doesn't have searchicon or 
searchbox
+    if (m_xSearchIcon)
+        m_xSearchIcon->set_size_request(24, 24); // vcl/res/infobar.png is 
32x32 - too large here
 
     m_xReplaceTmplLB->make_sorted();
     m_xReplaceAttrText->hide();
@@ -562,20 +565,26 @@ void SvxSearchDialog::SetSearchLabel(const OUString& rStr)
     if (!rStr.isEmpty())
     {
         m_xSearchLabel->show();
-        m_xSearchIcon->show();
-        const StyleSettings& rStyleSettings = 
Application::GetSettings().GetStyleSettings();
-        if (rStyleSettings.GetDialogColor().IsDark())
-            m_xSearchBox->set_background(Color(0x00, 0x56, 0x80));
-        else
-            m_xSearchBox->set_background(Color(0xBD, 0xE5, 0xF8)); // same as 
InfobarType::INFO
+        if (m_xSearchIcon)
+        {
+            m_xSearchIcon->show();
+            const StyleSettings& rStyleSettings = 
Application::GetSettings().GetStyleSettings();
+            if (rStyleSettings.GetDialogColor().IsDark())
+                m_xSearchBox->set_background(Color(0x00, 0x56, 0x80));
+            else
+                m_xSearchBox->set_background(Color(0xBD, 0xE5, 0xF8)); // same 
as InfobarType::INFO
+        }
     }
     else
     {
-        const Size aSize = m_xSearchBox->get_preferred_size();
         m_xSearchLabel->hide();
-        m_xSearchIcon->hide();
-        m_xSearchBox->set_size_request(-1, aSize.Height());
-        m_xSearchBox->set_background(COL_TRANSPARENT);
+        if (m_xSearchIcon)
+        {
+            const Size aSize = m_xSearchBox->get_preferred_size();
+            m_xSearchIcon->hide();
+            m_xSearchBox->set_size_request(-1, aSize.Height());
+            m_xSearchBox->set_background(COL_TRANSPARENT);
+        }
     }
 
     if (rStr == SvxResId(RID_SVXSTR_SEARCH_NOT_FOUND))

Reply via email to