Skip to content

Commit bb1f156

Browse files
caolanms8321414
authored andcommitted
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]>
1 parent 043beaa commit bb1f156

File tree

1 file changed

+16
-7
lines changed

1 file changed

+16
-7
lines changed

svx/source/dialog/srchdlg.cxx

Lines changed: 16 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -344,7 +344,10 @@ SvxSearchDialog::SvxSearchDialog(weld::Window* pParent, SfxChildWindow* pChildWi
344344

345345
m_xSearchLabel->set_font_color(Color(0x00, 0x47, 0x85));
346346
this->SetSearchLabel(""); // hide the message but keep the box height
347-
m_xSearchIcon->set_size_request(24, 24); // vcl/res/infobar.png is 32x32 - too large here
347+
348+
//weird findreplacedialog-mobile.ui case doesn't have searchicon or searchbox
349+
if (m_xSearchIcon)
350+
m_xSearchIcon->set_size_request(24, 24); // vcl/res/infobar.png is 32x32 - too large here
348351

349352
m_xReplaceTmplLB->make_sorted();
350353
m_xReplaceAttrText->hide();
@@ -588,16 +591,22 @@ void SvxSearchDialog::SetSearchLabel(const OUString& rStr)
588591
if (!rStr.isEmpty())
589592
{
590593
m_xSearchLabel->show();
591-
m_xSearchIcon->show();
592-
m_xSearchBox->set_background(Color(0xBD, 0xE5, 0xF8)); // same as InfobarType::INFO
594+
if (m_xSearchIcon)
595+
{
596+
m_xSearchIcon->show();
597+
m_xSearchBox->set_background(Color(0xBD, 0xE5, 0xF8)); // same as InfobarType::INFO
598+
}
593599
}
594600
else
595601
{
596-
const Size aSize = m_xSearchBox->get_preferred_size();
597602
m_xSearchLabel->hide();
598-
m_xSearchIcon->hide();
599-
m_xSearchBox->set_size_request(-1, aSize.Height());
600-
m_xSearchBox->set_background(COL_TRANSPARENT);
603+
if (m_xSearchIcon)
604+
{
605+
const Size aSize = m_xSearchBox->get_preferred_size();
606+
m_xSearchIcon->hide();
607+
m_xSearchBox->set_size_request(-1, aSize.Height());
608+
m_xSearchBox->set_background(COL_TRANSPARENT);
609+
}
601610
}
602611
}
603612

0 commit comments

Comments
 (0)