diff options
author | Matúš Kukan <matus.kukan@collabora.com> | 2014-02-04 15:46:41 +0100 |
---|---|---|
committer | Matúš Kukan <matus.kukan@collabora.com> | 2014-02-05 19:09:15 +0100 |
commit | f25cdaa78d5e7d200fbaf31cce9895bab7c5ee63 (patch) | |
tree | 4a05313e773c0182b68e00508287aaeb583668e7 /sw | |
parent | d6f13b6a84e4b12320111c2e92cd8af20ed44d4c (diff) |
fdo#74132: Do not interrupt search in Writer.
Instead of "Do you want to continue at the beginning?" dialog,
just inform that we were at the end of the document in new label.
Also replace 'Search key not found' dialog with label.
Change-Id: I6a140cbad93406b73996f87a6d05fcc5d245fdbf
Diffstat (limited to 'sw')
-rw-r--r-- | sw/source/ui/uiview/viewsrch.cxx | 63 | ||||
-rw-r--r-- | sw/uiconfig/sglobal/toolbar/findbar.xml | 2 | ||||
-rw-r--r-- | sw/uiconfig/sweb/toolbar/findbar.xml | 2 | ||||
-rw-r--r-- | sw/uiconfig/swriter/toolbar/findbar.xml | 1 | ||||
-rw-r--r-- | sw/uiconfig/swxform/toolbar/findbar.xml | 2 |
5 files changed, 20 insertions, 50 deletions
diff --git a/sw/source/ui/uiview/viewsrch.cxx b/sw/source/ui/uiview/viewsrch.cxx index 7bf41a51d482..f9ca08122714 100644 --- a/sw/source/ui/uiview/viewsrch.cxx +++ b/sw/source/ui/uiview/viewsrch.cxx @@ -23,6 +23,7 @@ #include <boost/scoped_ptr.hpp> #include <hintids.hxx> + #include <com/sun/star/util/SearchOptions.hpp> #include <svl/cjkoptions.hxx> #include <svl/ctloptions.hxx> @@ -86,18 +87,6 @@ static Window* GetParentWindow( SvxSearchDialog* m_pSrchDlg ) return pWin; } -static void ShowNotFoundInfoBox( SvxSearchDialog* m_pSrchDlg ) -{ - Window* pParentWindow = GetParentWindow( m_pSrchDlg ); - MessageDialog aBox(pParentWindow, "InfoNotFoundDialog", - "modules/swriter/ui/infonotfounddialog.ui"); - if (pParentWindow) - { - aBox.SetText(pParentWindow->GetText()); - } - aBox.Execute(); -} - void SwView::ExecSearch(SfxRequest& rReq, sal_Bool bNoMessage) { const SfxItemSet* pArgs = rReq.GetArgs(); @@ -231,9 +220,7 @@ void SwView::ExecSearch(SfxRequest& rReq, sal_Bool bNoMessage) if( !bRet ) { if( !bApi ) - { - ShowNotFoundInfoBox( m_pSrchDlg ); - } + SvxSearchDialogWrapper::SetSearchLabel(SL_NotFound); m_bFound = sal_False; } rReq.SetReturnValue(SfxBoolItem(nSlot, bRet)); @@ -349,9 +336,7 @@ void SwView::ExecSearch(SfxRequest& rReq, sal_Bool bNoMessage) if( !nFound ) { if( !bApi ) - { - ShowNotFoundInfoBox( m_pSrchDlg ); - } + SvxSearchDialogWrapper::SetSearchLabel(SL_NotFound); m_bFound = sal_False; return; } @@ -527,9 +512,7 @@ sal_Bool SwView::SearchAndWrap(sal_Bool bApi) { m_pWrtShell->EndAllAction(); if( !bApi ) - { - ShowNotFoundInfoBox( m_pSrchDlg ); - } + SvxSearchDialogWrapper::SetSearchLabel(SL_NotFound); m_bFound = sal_False; m_pWrtShell->Pop(); return sal_False; @@ -537,27 +520,6 @@ sal_Bool SwView::SearchAndWrap(sal_Bool bApi) m_pWrtShell->EndAllAction(); // Try again with WrapAround? - int nRet = RET_NO; - if( !bApi ) - { - if (DOCPOS_START == aOpts.eEnd) - { - nRet = MessageDialog(GetParentWindow(m_pSrchDlg), "QueryContinueEndDialog", - "modules/swriter/ui/querycontinueenddialog.ui").Execute(); - } - else - { - nRet = MessageDialog(GetParentWindow(m_pSrchDlg), "QueryContinueBeginDialog", - "modules/swriter/ui/querycontinuebegindialog.ui").Execute(); - } - } - - if (nRet == RET_NO) - { - m_bFound = sal_False; - m_pWrtShell->Pop(); - return sal_False; - } m_pWrtShell->StartAllAction(); m_pWrtShell->Pop(sal_False); pWait.reset(new SwWait( *GetDocShell(), true )); @@ -576,16 +538,15 @@ sal_Bool SwView::SearchAndWrap(sal_Bool bApi) m_pWrtShell->SttDoc(); } - m_bFound = 0 != FUNC_Search( aOpts ); + m_bFound = bool(FUNC_Search( aOpts )); m_pWrtShell->EndAllAction(); pWait.reset(); - if ( m_bFound ) - return m_bFound; - if(!bApi) - { - ShowNotFoundInfoBox( m_pSrchDlg ); - } - return m_bFound = sal_False; + + if (m_bFound) + SvxSearchDialogWrapper::SetSearchLabel(SL_End); + else if(!bApi) + SvxSearchDialogWrapper::SetSearchLabel(SL_NotFound); + return m_bFound; } @@ -728,6 +689,8 @@ SwSearchOptions::SwSearchOptions( SwWrtShell* pSh, sal_Bool bBackward ) sal_uLong SwView::FUNC_Search( const SwSearchOptions& rOptions ) { + SvxSearchDialogWrapper::SetSearchLabel(SL_Empty); + sal_Bool bDoReplace = m_pSrchItem->GetCommand() == SVX_SEARCHCMD_REPLACE || m_pSrchItem->GetCommand() == SVX_SEARCHCMD_REPLACE_ALL; diff --git a/sw/uiconfig/sglobal/toolbar/findbar.xml b/sw/uiconfig/sglobal/toolbar/findbar.xml index 4e8ec6ba0743..807ffbfa2dcd 100644 --- a/sw/uiconfig/sglobal/toolbar/findbar.xml +++ b/sw/uiconfig/sglobal/toolbar/findbar.xml @@ -26,4 +26,6 @@ <toolbar:toolbaritem xlink:href=".uno:MatchCase"/> <toolbar:toolbarseparator/> <toolbar:toolbaritem xlink:href=".uno:SearchDialog"/> + <toolbar:toolbarseparator/> + <toolbar:toolbaritem xlink:href=".uno:SearchLabel"/> </toolbar:toolbar> diff --git a/sw/uiconfig/sweb/toolbar/findbar.xml b/sw/uiconfig/sweb/toolbar/findbar.xml index 4e8ec6ba0743..807ffbfa2dcd 100644 --- a/sw/uiconfig/sweb/toolbar/findbar.xml +++ b/sw/uiconfig/sweb/toolbar/findbar.xml @@ -26,4 +26,6 @@ <toolbar:toolbaritem xlink:href=".uno:MatchCase"/> <toolbar:toolbarseparator/> <toolbar:toolbaritem xlink:href=".uno:SearchDialog"/> + <toolbar:toolbarseparator/> + <toolbar:toolbaritem xlink:href=".uno:SearchLabel"/> </toolbar:toolbar> diff --git a/sw/uiconfig/swriter/toolbar/findbar.xml b/sw/uiconfig/swriter/toolbar/findbar.xml index 13e84ad6b8e9..f0c18542ace6 100644 --- a/sw/uiconfig/swriter/toolbar/findbar.xml +++ b/sw/uiconfig/swriter/toolbar/findbar.xml @@ -30,4 +30,5 @@ <toolbar:toolbaritem xlink:href=".uno:ScrollToPrevious"/> <toolbar:toolbaritem xlink:href=".uno:NavigationPopup"/> <toolbar:toolbaritem xlink:href=".uno:ScrollToNext"/> + <toolbar:toolbaritem xlink:href=".uno:SearchLabel"/> </toolbar:toolbar> diff --git a/sw/uiconfig/swxform/toolbar/findbar.xml b/sw/uiconfig/swxform/toolbar/findbar.xml index 4e8ec6ba0743..807ffbfa2dcd 100644 --- a/sw/uiconfig/swxform/toolbar/findbar.xml +++ b/sw/uiconfig/swxform/toolbar/findbar.xml @@ -26,4 +26,6 @@ <toolbar:toolbaritem xlink:href=".uno:MatchCase"/> <toolbar:toolbarseparator/> <toolbar:toolbaritem xlink:href=".uno:SearchDialog"/> + <toolbar:toolbarseparator/> + <toolbar:toolbaritem xlink:href=".uno:SearchLabel"/> </toolbar:toolbar> |