summaryrefslogtreecommitdiff
path: root/sc
diff options
context:
space:
mode:
authorMatúš Kukan <matus.kukan@collabora.com>2014-02-05 13:47:45 +0100
committerMatúš Kukan <matus.kukan@collabora.com>2014-02-05 19:10:04 +0100
commitd50e08b4e18ad6fa8b4078df6e23ffbaf47e708c (patch)
treec21e3aa93ad22354bd3b8234f5e4ffd59010560e /sc
parent4784e94cec2e8f96a08add2f19f482057058b2eb (diff)
fdo#74132: Do not interrupt search in Calc.
Extending f25cdaa78d5e7d200fbaf31cce9895bab7c5ee63 "fdo#74132: Do not interrupt search in Writer." for Calc. Change-Id: I3a7e5070300993d2811a79f17cb1b2edb0355c44
Diffstat (limited to 'sc')
-rw-r--r--sc/inc/globstr.hrc7
-rw-r--r--sc/source/ui/src/globstr.src24
-rw-r--r--sc/source/ui/view/viewfun2.cxx41
-rw-r--r--sc/uiconfig/scalc/toolbar/findbar.xml2
4 files changed, 9 insertions, 65 deletions
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>