tdf#151688 srchdlg: on open, repopulate Replace as well as Search
When the dialog is opened, the last searched for string (from the session, not from stored config) was already restored. However, no attempt was made to restore the last replace string. Although it might feel a little dangerous to provide a restore value, it isn't really dangerous, because the user has to hit the replace button in order for it to do anything. The bug report is worried about replacing with 'nothing' by accident, so I guess the 'danger' goes both ways. Personally, I would like having both last values restored in case I accidentally closed the dialog (or closed it to get it out of the way while I manually made changes and then restarted it to continue my replace task). Only Writer replaces the 'search' content with a user's selection. In this case it seems very wise to clear the replacement string. Change-Id: Id9f40c01724978a2e51f685a60b9e3e75c21135a Reviewed-on: https://gerrit.libreoffice.org/c/core/+/207901 Reviewed-by: Justin Luth <jluth@mail.com> Tested-by: Jenkins
This commit is contained in:
@@ -967,7 +967,11 @@ void SvxSearchDialog::Init_Impl( bool bSearchPattern )
|
||||
if (!comphelper::LibreOfficeKit::isActive())
|
||||
{
|
||||
if (!(m_pSearchItem->GetSearchString().isEmpty()) && bSetSearch)
|
||||
{
|
||||
m_xSearchLB->set_entry_text(m_pSearchItem->GetSearchString());
|
||||
if (bSetReplace)
|
||||
m_xReplaceLB->set_entry_text(m_pSearchItem->GetReplaceString());
|
||||
}
|
||||
else if (!m_aSearchStrings.empty())
|
||||
{
|
||||
bool bAttributes = ((m_pSearchList && m_pSearchList->Count())
|
||||
|
||||
@@ -886,6 +886,7 @@ void SwView::StateSearch(SfxItemSet &rSet)
|
||||
{
|
||||
s_pSrchItem->SetSearchString( aText );
|
||||
s_pSrchItem->SetSelection( false );
|
||||
s_pSrchItem->SetReplaceString("");
|
||||
}
|
||||
else
|
||||
s_pSrchItem->SetSelection( true );
|
||||
|
||||
Reference in New Issue
Block a user