summaryrefslogtreecommitdiff
path: root/sc
diff options
context:
space:
mode:
authorDamjan Jovanovic <damjan@apache.org>2015-11-12 17:04:30 +0000
committerDamjan Jovanovic <damjan@apache.org>2015-11-12 17:04:30 +0000
commit769cffa5fe2ff66d05f5ff55df6382f35ea853a6 (patch)
tree1431c7f09ef96f811076d86a23369ad78b79c4c9 /sc
parent81f02514035de84eb4851917db7aa9455672efb8 (diff)
#i35093# Find (and replace) on selected cells is misleading
When any cellc in Calc are selected at the time the "Find & Replace" dialog is opened, automatically check the "Current selection only" checkbox, just like Writer does when multiple lines of text are selected when this dialog opens. Users expect this from Writer and other spreadsheets, and not doing it can even lead to wrong cells being changed when "Replace" is used! Patch by: me
Notes
Notes: prefer: b592eb99d1eaa241fe34d4c9e8f3903ef7b775d1
Diffstat (limited to 'sc')
-rw-r--r--sc/sdi/tabvwsh.sdi1
-rw-r--r--sc/source/ui/inc/tabvwsh.hxx1
-rw-r--r--sc/source/ui/view/tabvwsha.cxx13
-rw-r--r--sc/source/ui/view/tabvwshe.cxx4
4 files changed, 18 insertions, 1 deletions
diff --git a/sc/sdi/tabvwsh.sdi b/sc/sdi/tabvwsh.sdi
index f93b1e6542af..a266a6dc963d 100644
--- a/sc/sdi/tabvwsh.sdi
+++ b/sc/sdi/tabvwsh.sdi
@@ -198,6 +198,7 @@ interface TableEditView
FID_SEARCH [ ExecMethod = ExecSearch; ]
FID_REPLACE [ ExecMethod = ExecSearch; ]
FID_SEARCH_ALL [ ExecMethod = ExecSearch; ]
+ FID_SEARCH_ON [ ExecMethod = ExecSearch; Export = FALSE; ]
FID_REPLACE_ALL [ ExecMethod = ExecSearch; ]
FID_REPEAT_SEARCH [ ExecMethod = ExecSearch; ]
diff --git a/sc/source/ui/inc/tabvwsh.hxx b/sc/source/ui/inc/tabvwsh.hxx
index f593985ed2fb..abc7b82f8053 100644
--- a/sc/source/ui/inc/tabvwsh.hxx
+++ b/sc/source/ui/inc/tabvwsh.hxx
@@ -178,6 +178,7 @@ private:
String aCurrShapeEnumCommand[ MASTERENUMCOMMANDS ];
sal_Bool bForceFocusOnCurCell; // i123629
+ sal_Bool bSearchJustOpened; // i35093
private:
void Construct( sal_uInt8 nForceDesignMode = SC_FORCEMODE_NONE );
diff --git a/sc/source/ui/view/tabvwsha.cxx b/sc/source/ui/view/tabvwsha.cxx
index e34f697cb053..33a37b3ed93d 100644
--- a/sc/source/ui/view/tabvwsha.cxx
+++ b/sc/source/ui/view/tabvwsha.cxx
@@ -225,7 +225,18 @@ void __EXPORT ScTabViewShell::GetState( SfxItemSet& rSet )
break;
case SID_SEARCH_ITEM:
- rSet.Put( ScGlobal::GetSearchItem() );
+ {
+ SvxSearchItem searchItem = ScGlobal::GetSearchItem();
+ // i35093:
+ if (bSearchJustOpened)
+ {
+ ScMarkData& rMarkData = pViewData->GetMarkData();
+ if (rMarkData.IsMarked())
+ searchItem.SetSelection( sal_True );
+ }
+ bSearchJustOpened = sal_False;
+ rSet.Put(searchItem);
+ }
break;
case SID_SEARCH_OPTIONS:
diff --git a/sc/source/ui/view/tabvwshe.cxx b/sc/source/ui/view/tabvwshe.cxx
index e04a48151f10..b4b0f2ff974c 100644
--- a/sc/source/ui/view/tabvwshe.cxx
+++ b/sc/source/ui/view/tabvwshe.cxx
@@ -246,6 +246,10 @@ void ScTabViewShell::ExecSearch( SfxRequest& rReq )
switch ( nSlot )
{
+ case FID_SEARCH_ON:
+ bSearchJustOpened = sal_True;
+ break;
+
case FID_SEARCH_NOW:
{
if ( pReqArgs &&