svx/source/dialog/srchdlg.cxx |   23 ++++++++++++++++-------
 1 file changed, 16 insertions(+), 7 deletions(-)

New commits:
commit f2bb782f2e8bd0d0fa717093df4ae40efd04ed1e
Author:     Caolán McNamara <[email protected]>
AuthorDate: Tue May 6 16:38:57 2025 +0100
Commit:     Miklos Vajna <[email protected]>
CommitDate: Wed May 7 13:57:59 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/+/185002
    Reviewed-by: Miklos Vajna <[email protected]>
    Tested-by: Jenkins CollaboraOffice <[email protected]>

diff --git a/svx/source/dialog/srchdlg.cxx b/svx/source/dialog/srchdlg.cxx
index f06822ceaf0b..cdbc4068cc97 100644
--- a/svx/source/dialog/srchdlg.cxx
+++ b/svx/source/dialog/srchdlg.cxx
@@ -344,7 +344,10 @@ SvxSearchDialog::SvxSearchDialog(weld::Window* pParent, 
SfxChildWindow* pChildWi
 
     m_xSearchLabel->set_font_color(Color(0x00, 0x47, 0x85));
     this->SetSearchLabel(""); // 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();
@@ -588,16 +591,22 @@ void SvxSearchDialog::SetSearchLabel(const OUString& rStr)
     if (!rStr.isEmpty())
     {
         m_xSearchLabel->show();
-        m_xSearchIcon->show();
-        m_xSearchBox->set_background(Color(0xBD, 0xE5, 0xF8)); // same as 
InfobarType::INFO
+        if (m_xSearchIcon)
+        {
+            m_xSearchIcon->show();
+            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);
+        }
     }
 }
 

Reply via email to