summaryrefslogtreecommitdiff
path: root/sc/source/ui/view
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/source/ui/view
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/source/ui/view')
-rw-r--r--sc/source/ui/view/tabvwsha.cxx13
-rw-r--r--sc/source/ui/view/tabvwshe.cxx4
2 files changed, 16 insertions, 1 deletions
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 &&