From beeef93480fae65840646e4e36aa888efe92579a Mon Sep 17 00:00:00 2001 From: Akshay Deep Date: Tue, 8 Mar 2016 19:54:57 +0530 Subject: tdf#98417, tdf#98539: DIALOG: Improvements to the Find & Replace dialog. Added Find Previous Button. Replaced backward checkbox with 'Replace Backward' from other options. Modified Dialog Layout as per the attachment in bug report. Removed vertical spacing in parent_container_box to reduce height of the dialog. Removed InfoBox from ReplaceAll functionality in writer, shifted it to SearchLabel. Attribute labels only show up when attribues are used in search, else they remain hidden. Change-Id: I0e9ded854fc2601524d6fc2a0ba5e9cb602e11a4 Reviewed-on: https://gerrit.libreoffice.org/23057 Tested-by: Jenkins Reviewed-by: Samuel Mehrbrodt --- sw/source/uibase/uiview/viewsrch.cxx | 17 +++++------------ 1 file changed, 5 insertions(+), 12 deletions(-) (limited to 'sw/source') diff --git a/sw/source/uibase/uiview/viewsrch.cxx b/sw/source/uibase/uiview/viewsrch.cxx index 23283de9d6b0..58012322104b 100644 --- a/sw/source/uibase/uiview/viewsrch.cxx +++ b/sw/source/uibase/uiview/viewsrch.cxx @@ -85,11 +85,6 @@ struct SwSearchOptions SwSearchOptions( SwWrtShell* pSh, bool bBackward ); }; -static vcl::Window* GetParentWindow( SvxSearchDialog* pSrchDlg ) -{ - return pSrchDlg && pSrchDlg->IsVisible() ? pSrchDlg : nullptr; -} - /// Adds rMatches using rKey as a key to the rTree tree. static void lcl_addContainerToJson(boost::property_tree::ptree& rTree, const OString& rKey, const std::vector& rMatches) { @@ -193,7 +188,7 @@ void SwView::ExecSearch(SfxRequest& rReq) { // We will remember the search-/replace items. const SearchAttrItemList* pList = pSrchDlg->GetSearchItemList(); - if( pList && pList->Count() ) + if( nullptr != pList && pList->Count() ) m_pSrchList = new SearchAttrItemList( *pList ); pList = pSrchDlg->GetReplaceItemList(); @@ -218,7 +213,7 @@ void SwView::ExecSearch(SfxRequest& rReq) DELETEZ( m_pReplList ); const SearchAttrItemList* pList = pSrchDlg->GetSearchItemList(); - if( pList && pList->Count() ) + if( nullptr != pList && pList->Count() ) m_pSrchList = new SearchAttrItemList( *pList ); pList = pSrchDlg->GetReplaceItemList(); @@ -414,11 +409,9 @@ void SwView::ExecSearch(SfxRequest& rReq) if( !bQuiet && ULONG_MAX != nFound) { - OUString aText( SW_RES( STR_NB_REPLACED ) ); - aText = aText.replaceFirst("XX", OUString::number( nFound )); - pSrchDlg = GetSearchDialog(); - vcl::Window* pParentWindow = GetParentWindow(pSrchDlg); - ScopedVclPtr::Create( pParentWindow, aText )->Execute(); + OUString sText( SW_RES( STR_NB_REPLACED ) ); + sText = sText.replaceFirst("XX", OUString::number( nFound )); + SvxSearchDialogWrapper::SetSearchLabel(sText); } } #if HAVE_FEATURE_DESKTOP -- cgit