diff options
author | Matúš Kukan <matus.kukan@collabora.com> | 2014-02-05 13:47:45 +0100 |
---|---|---|
committer | Matúš Kukan <matus.kukan@collabora.com> | 2014-02-05 19:10:04 +0100 |
commit | d50e08b4e18ad6fa8b4078df6e23ffbaf47e708c (patch) | |
tree | c21e3aa93ad22354bd3b8234f5e4ffd59010560e | |
parent | 4784e94cec2e8f96a08add2f19f482057058b2eb (diff) |
fdo#74132: Do not interrupt search in Calc.
Extending f25cdaa78d5e7d200fbaf31cce9895bab7c5ee63
"fdo#74132: Do not interrupt search in Writer." for Calc.
Change-Id: I3a7e5070300993d2811a79f17cb1b2edb0355c44
-rw-r--r-- | include/svx/dialogs.hrc | 1 | ||||
-rw-r--r-- | include/svx/srchdlg.hxx | 5 | ||||
-rw-r--r-- | sc/inc/globstr.hrc | 7 | ||||
-rw-r--r-- | sc/source/ui/src/globstr.src | 24 | ||||
-rw-r--r-- | sc/source/ui/view/viewfun2.cxx | 41 | ||||
-rw-r--r-- | sc/uiconfig/scalc/toolbar/findbar.xml | 2 | ||||
-rw-r--r-- | svx/source/dialog/srchdlg.cxx | 2 | ||||
-rw-r--r-- | svx/source/dialog/srchdlg.src | 4 |
8 files changed, 19 insertions, 67 deletions
diff --git a/include/svx/dialogs.hrc b/include/svx/dialogs.hrc index e0d70950f37b..cc31b77e504b 100644 --- a/include/svx/dialogs.hrc +++ b/include/svx/dialogs.hrc @@ -242,6 +242,7 @@ #define RID_SVXSTR_LANGUAGE_ALL (RID_SVX_START + 15) // Strings from the search dialog +#define RID_SVXSTR_SEARCH_END_SHEET (RID_SVX_START + 71) #define RID_SVXSTR_SEARCH_END (RID_SVX_START + 79) #define RID_SVXSTR_SEARCH_STYLES (RID_SVX_START + 80) #define RID_SVXSTR_SEARCH (RID_SVX_START + 81) diff --git a/include/svx/srchdlg.hxx b/include/svx/srchdlg.hxx index 50f7d6366254..07cf33028b6c 100644 --- a/include/svx/srchdlg.hxx +++ b/include/svx/srchdlg.hxx @@ -82,8 +82,9 @@ public: enum SearchLabel { SL_Empty, - SL_NotFound, - SL_End + SL_End, + SL_EndSheet, + SL_NotFound }; class SvxSearchDialog; diff --git a/sc/inc/globstr.hrc b/sc/inc/globstr.hrc index f02ef5122b00..c402de22d80a 100644 --- a/sc/inc/globstr.hrc +++ b/sc/inc/globstr.hrc @@ -89,7 +89,6 @@ #define STR_MSSG_INSERTCELLS_0 50 #define STR_MSSG_DELETECELLS_0 51 #define STR_MSSG_MERGECELLS_0 52 -#define STR_MSSG_SEARCHANDREPLACE_0 53 #define STR_MSSG_SOLVE_0 54 #define STR_MSSG_SOLVE_1 55 #define STR_MSSG_SOLVE_2 56 @@ -301,9 +300,6 @@ #define STR_NAMECONFLICT 223 #define STR_ERR_AUTOFILTER 224 -#define STR_MSSG_SEARCHANDREPLACE_1 225 -#define STR_MSSG_SEARCHANDREPLACE_2 226 -#define STR_MSSG_SEARCHANDREPLACE_3 227 #define STR_CREATENAME_REPLACE 228 #define STR_CREATENAME_MARKERR 229 @@ -476,9 +472,6 @@ #define STR_CLOSE_ERROR_LINK 351 #define STR_UNDO_RANGENAMES 352 -#define STR_MSSG_SEARCHANDREPLACE_4 353 -#define STR_MSSG_SEARCHANDREPLACE_5 354 - #define STR_UNDO_RESIZEMATRIX 355 #define STR_TIP_RESIZEMATRIX 356 diff --git a/sc/source/ui/src/globstr.src b/sc/source/ui/src/globstr.src index 19444701d6dc..47c5d94f5d72 100644 --- a/sc/source/ui/src/globstr.src +++ b/sc/source/ui/src/globstr.src @@ -437,10 +437,6 @@ Resource RID_GLOBSTR { Text [ en-US ] = "Ranges containing merged cells can only be sorted without formats." ; }; - String STR_MSSG_SEARCHANDREPLACE_0 - { - Text [ en-US ] = "Search key not found." ; - }; String STR_MSSG_SOLVE_0 { Text [ en-US ] = "Goal Seek succeeded. Result: " ; @@ -1189,26 +1185,6 @@ Resource RID_GLOBSTR { Text [ en-US ] = "AutoFilter not possible" ; }; - String STR_MSSG_SEARCHANDREPLACE_1 - { - Text [ en-US ] = "%PRODUCTNAME Calc has searched to the beginning of the sheet. Do you want to continue at the end?" ; - }; - String STR_MSSG_SEARCHANDREPLACE_2 - { - Text [ en-US ] = "%PRODUCTNAME Calc has searched to the end of the sheet. Do you want to continue at the beginning?" ; - }; - String STR_MSSG_SEARCHANDREPLACE_3 - { - Text [ en-US ] = "Find & Replace" ; - }; - String STR_MSSG_SEARCHANDREPLACE_4 - { - Text [ en-US ] = "%PRODUCTNAME Calc has searched to the beginning of the document. Do you want to continue at the end?" ; - }; - String STR_MSSG_SEARCHANDREPLACE_5 - { - Text [ en-US ] = "%PRODUCTNAME Calc has searched to the end of the document. Do you want to continue at the beginning?" ; - }; String STR_CREATENAME_REPLACE { Text [ en-US ] = "Replace existing definition of #?" ; diff --git a/sc/source/ui/view/viewfun2.cxx b/sc/source/ui/view/viewfun2.cxx index 76afd3242fda..8d320611e5d3 100644 --- a/sc/source/ui/view/viewfun2.cxx +++ b/sc/source/ui/view/viewfun2.cxx @@ -34,6 +34,7 @@ #include <sfx2/viewfrm.hxx> #include <svl/stritem.hxx> #include <svl/zforlist.hxx> +#include <svx/srchdlg.hxx> #include <svx/svdview.hxx> #include <vcl/msgbox.hxx> #include <vcl/waitobj.hxx> @@ -1552,6 +1553,7 @@ void ScViewFunc::AutoFormat( sal_uInt16 nFormatNo, sal_Bool bRecord ) sal_Bool ScViewFunc::SearchAndReplace( const SvxSearchItem* pSearchItem, sal_Bool bAddUndo, sal_Bool bIsApi ) { + SvxSearchDialogWrapper::SetSearchLabel(SL_Empty); ScDocShell* pDocSh = GetViewData()->GetDocShell(); ScDocument* pDoc = pDocSh->GetDocument(); ScMarkData& rMark = GetViewData()->GetMarkData(); @@ -1657,37 +1659,14 @@ sal_Bool ScViewFunc::SearchAndReplace( const SvxSearchItem* pSearchItem, nCommand == SVX_SEARCHCMD_REPLACE) ) { bFirst = false; - sal_uInt16 nRetVal; GetFrameWin()->LeaveWait(); - if ( bIsApi ) - nRetVal = RET_NO; - else + if (!bIsApi) { - // search dialog as parent (if available) - Window* pParent = GetParentOrChild(SID_SEARCH_DLG); - sal_uInt16 nStrId; - if ( pSearchItem->GetBackward() ) - { - if ( nStartTab == nEndTab ) - nStrId = STR_MSSG_SEARCHANDREPLACE_1; - else - nStrId = STR_MSSG_SEARCHANDREPLACE_4; - } + if ( nStartTab == nEndTab ) + SvxSearchDialogWrapper::SetSearchLabel(SL_EndSheet); else - { - if ( nStartTab == nEndTab ) - nStrId = STR_MSSG_SEARCHANDREPLACE_2; - else - nStrId = STR_MSSG_SEARCHANDREPLACE_5; - } - MessBox aBox( pParent, WinBits(WB_YES_NO | WB_DEF_YES), - ScGlobal::GetRscString( STR_MSSG_SEARCHANDREPLACE_3 ), - ScGlobal::GetRscString( nStrId ) ); - nRetVal = aBox.Execute(); - } + SvxSearchDialogWrapper::SetSearchLabel(SL_End); - if ( nRetVal == RET_YES ) - { ScDocument::GetSearchAndReplaceStart( *pSearchItem, nCol, nRow ); if (pSearchItem->GetBackward()) nTab = nEndTab; @@ -1708,13 +1687,7 @@ sal_Bool ScViewFunc::SearchAndReplace( const SvxSearchItem* pSearchItem, GetFrameWin()->LeaveWait(); if (!bIsApi) - { - // search dialog as parent if available - Window* pParent = GetParentOrChild(SID_SEARCH_DLG); - // "nothing found" - InfoBox aBox( pParent, ScGlobal::GetRscString( STR_MSSG_SEARCHANDREPLACE_0 ) ); - aBox.Execute(); - } + SvxSearchDialogWrapper::SetSearchLabel(SL_NotFound); break; // break 'while (TRUE)' } diff --git a/sc/uiconfig/scalc/toolbar/findbar.xml b/sc/uiconfig/scalc/toolbar/findbar.xml index 4e8ec6ba0743..807ffbfa2dcd 100644 --- a/sc/uiconfig/scalc/toolbar/findbar.xml +++ b/sc/uiconfig/scalc/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/svx/source/dialog/srchdlg.cxx b/svx/source/dialog/srchdlg.cxx index 4e6b23ea2a94..cd793240e921 100644 --- a/svx/source/dialog/srchdlg.cxx +++ b/svx/source/dialog/srchdlg.cxx @@ -2270,6 +2270,8 @@ void SvxSearchDialogWrapper::SetSearchLabel(const SearchLabel& rSL) OUString sStr; if (rSL == SL_End) sStr = SVX_RESSTR(RID_SVXSTR_SEARCH_END); + else if (rSL == SL_EndSheet) + sStr = SVX_RESSTR(RID_SVXSTR_SEARCH_END_SHEET); else if (rSL == SL_NotFound) sStr = SVX_RESSTR(RID_SVXSTR_SEARCH_NOT_FOUND); diff --git a/svx/source/dialog/srchdlg.src b/svx/source/dialog/srchdlg.src index 18b5e1117c54..c0fd4e5b6933 100644 --- a/svx/source/dialog/srchdlg.src +++ b/svx/source/dialog/srchdlg.src @@ -46,6 +46,10 @@ String RID_SVXSTR_SEARCH_END { Text [ en-US ] = "Reached the end of the document" ; }; +String RID_SVXSTR_SEARCH_END_SHEET +{ + Text [ en-US ] = "Reached the end of the sheet" ; +}; String RID_SVXSTR_SEARCH_NOT_FOUND { Text [ en-US ] = "Search key not found" ; |