Kaydet (Commit) d50e08b4 authored tarafından Matúš Kukan's avatar Matúš Kukan

fdo#74132: Do not interrupt search in Calc.

Extending f25cdaa7
"fdo#74132: Do not interrupt search in Writer." for Calc.

Change-Id: I3a7e5070300993d2811a79f17cb1b2edb0355c44
üst 4784e94c
......@@ -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)
......
......@@ -82,8 +82,9 @@ public:
enum SearchLabel
{
SL_Empty,
SL_NotFound,
SL_End
SL_End,
SL_EndSheet,
SL_NotFound
};
class SvxSearchDialog;
......
......@@ -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
......
......@@ -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 #?" ;
......
......@@ -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)'
}
......
......@@ -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>
......@@ -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);
......
......@@ -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" ;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment