Author: damjan Date: Thu Nov 12 17:04:30 2015 New Revision: 1714091 URL: http://svn.apache.org/viewvc?rev=1714091&view=rev Log: #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 Modified: openoffice/trunk/main/sc/sdi/tabvwsh.sdi openoffice/trunk/main/sc/source/ui/inc/tabvwsh.hxx openoffice/trunk/main/sc/source/ui/view/tabvwsha.cxx openoffice/trunk/main/sc/source/ui/view/tabvwshe.cxx Modified: openoffice/trunk/main/sc/sdi/tabvwsh.sdi URL: http://svn.apache.org/viewvc/openoffice/trunk/main/sc/sdi/tabvwsh.sdi?rev=1714091&r1=1714090&r2=1714091&view=diff ============================================================================== --- openoffice/trunk/main/sc/sdi/tabvwsh.sdi (original) +++ openoffice/trunk/main/sc/sdi/tabvwsh.sdi Thu Nov 12 17:04:30 2015 @@ -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; ] Modified: openoffice/trunk/main/sc/source/ui/inc/tabvwsh.hxx URL: http://svn.apache.org/viewvc/openoffice/trunk/main/sc/source/ui/inc/tabvwsh.hxx?rev=1714091&r1=1714090&r2=1714091&view=diff ============================================================================== --- openoffice/trunk/main/sc/source/ui/inc/tabvwsh.hxx (original) +++ openoffice/trunk/main/sc/source/ui/inc/tabvwsh.hxx Thu Nov 12 17:04:30 2015 @@ -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 ); Modified: openoffice/trunk/main/sc/source/ui/view/tabvwsha.cxx URL: http://svn.apache.org/viewvc/openoffice/trunk/main/sc/source/ui/view/tabvwsha.cxx?rev=1714091&r1=1714090&r2=1714091&view=diff ============================================================================== --- openoffice/trunk/main/sc/source/ui/view/tabvwsha.cxx (original) +++ openoffice/trunk/main/sc/source/ui/view/tabvwsha.cxx Thu Nov 12 17:04:30 2015 @@ -225,7 +225,18 @@ void __EXPORT ScTabViewShell::GetState( 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: Modified: openoffice/trunk/main/sc/source/ui/view/tabvwshe.cxx URL: http://svn.apache.org/viewvc/openoffice/trunk/main/sc/source/ui/view/tabvwshe.cxx?rev=1714091&r1=1714090&r2=1714091&view=diff ============================================================================== --- openoffice/trunk/main/sc/source/ui/view/tabvwshe.cxx (original) +++ openoffice/trunk/main/sc/source/ui/view/tabvwshe.cxx Thu Nov 12 17:04:30 2015 @@ -246,6 +246,10 @@ void ScTabViewShell::ExecSearch( SfxRequ switch ( nSlot ) { + case FID_SEARCH_ON: + bSearchJustOpened = sal_True; + break; + case FID_SEARCH_NOW: { if ( pReqArgs &&