xref: /trunk/main/sc/source/ui/view/tabvwshe.cxx (revision cf6516809c57e1bb0a940545cca99cdad54d4ce2)
1b3f79822SAndrew Rist /**************************************************************
2cdf0e10cSrcweir  *
3b3f79822SAndrew Rist  * Licensed to the Apache Software Foundation (ASF) under one
4b3f79822SAndrew Rist  * or more contributor license agreements.  See the NOTICE file
5b3f79822SAndrew Rist  * distributed with this work for additional information
6b3f79822SAndrew Rist  * regarding copyright ownership.  The ASF licenses this file
7b3f79822SAndrew Rist  * to you under the Apache License, Version 2.0 (the
8b3f79822SAndrew Rist  * "License"); you may not use this file except in compliance
9b3f79822SAndrew Rist  * with the License.  You may obtain a copy of the License at
10cdf0e10cSrcweir  *
11b3f79822SAndrew Rist  *   http://www.apache.org/licenses/LICENSE-2.0
12cdf0e10cSrcweir  *
13b3f79822SAndrew Rist  * Unless required by applicable law or agreed to in writing,
14b3f79822SAndrew Rist  * software distributed under the License is distributed on an
15b3f79822SAndrew Rist  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16b3f79822SAndrew Rist  * KIND, either express or implied.  See the License for the
17b3f79822SAndrew Rist  * specific language governing permissions and limitations
18b3f79822SAndrew Rist  * under the License.
19cdf0e10cSrcweir  *
20b3f79822SAndrew Rist  *************************************************************/
21b3f79822SAndrew Rist 
22b3f79822SAndrew Rist 
23cdf0e10cSrcweir 
24cdf0e10cSrcweir // MARKER(update_precomp.py): autogen include statement, do not remove
25cdf0e10cSrcweir #include "precompiled_sc.hxx"
26cdf0e10cSrcweir 
27cdf0e10cSrcweir 
28cdf0e10cSrcweir 
29cdf0e10cSrcweir // INCLUDE ---------------------------------------------------------------
30cdf0e10cSrcweir #include <editeng/eeitem.hxx>
31cdf0e10cSrcweir 
32cdf0e10cSrcweir #include "scitems.hxx"
33cdf0e10cSrcweir #include <editeng/editview.hxx>
34cdf0e10cSrcweir #include <editeng/flditem.hxx>
35cdf0e10cSrcweir #include <svx/hlnkitem.hxx>
36cdf0e10cSrcweir #include <svl/srchitem.hxx>
37cdf0e10cSrcweir #include <sfx2/dispatch.hxx>
38cdf0e10cSrcweir #include <sfx2/viewfrm.hxx>
39cdf0e10cSrcweir #include <sfx2/request.hxx>
40cdf0e10cSrcweir #include <sfx2/objface.hxx>
41cdf0e10cSrcweir #include <svl/stritem.hxx>
42cdf0e10cSrcweir #include <vcl/sound.hxx>
43cdf0e10cSrcweir 
44cdf0e10cSrcweir #include "tabvwsh.hxx"
45cdf0e10cSrcweir #include "sc.hrc"
46cdf0e10cSrcweir #include "scmod.hxx"
47cdf0e10cSrcweir #include "impex.hxx"
48cdf0e10cSrcweir #include "editsh.hxx"
49cdf0e10cSrcweir #include "dociter.hxx"
50cdf0e10cSrcweir #include "inputhdl.hxx"
510deba7fbSSteve Yin #include <svx/srchdlg.hxx>
52cdf0e10cSrcweir #include "document.hxx"
53cdf0e10cSrcweir 
54cdf0e10cSrcweir //==================================================================
55cdf0e10cSrcweir 
GetSelectionText(sal_Bool bWholeWord)56cdf0e10cSrcweir String __EXPORT ScTabViewShell::GetSelectionText( sal_Bool bWholeWord )
57cdf0e10cSrcweir {
58cdf0e10cSrcweir     String aStrSelection;
59cdf0e10cSrcweir 
60cdf0e10cSrcweir     if ( pEditShell && pEditShell == GetMySubShell() )
61cdf0e10cSrcweir     {
62cdf0e10cSrcweir         aStrSelection = pEditShell->GetSelectionText( bWholeWord );
63cdf0e10cSrcweir     }
64cdf0e10cSrcweir     else
65cdf0e10cSrcweir     {
66cdf0e10cSrcweir         ScRange aRange;
67cdf0e10cSrcweir 
68cdf0e10cSrcweir         if ( GetViewData()->GetSimpleArea( aRange ) == SC_MARK_SIMPLE )
69cdf0e10cSrcweir         {
70cdf0e10cSrcweir             ScDocument* pDoc = GetViewData()->GetDocument();
71cdf0e10cSrcweir             if ( bInFormatDialog && aRange.aStart.Row() != aRange.aEnd.Row() )
72cdf0e10cSrcweir             {
73cdf0e10cSrcweir                 // Range auf eine Datenzeile begrenzen
74cdf0e10cSrcweir                 // (#48613# nur wenn der Aufruf aus einem Format-Dialog kommt)
75cdf0e10cSrcweir                 ScHorizontalCellIterator aIter( pDoc, aRange.aStart.Tab(),
76cdf0e10cSrcweir                     aRange.aStart.Col(), aRange.aStart.Row(),
77cdf0e10cSrcweir                     aRange.aEnd.Col(), aRange.aEnd.Row() );
78cdf0e10cSrcweir                 SCCOL nCol;
79cdf0e10cSrcweir                 SCROW nRow;
80cdf0e10cSrcweir                 if ( aIter.GetNext( nCol, nRow ) )
81cdf0e10cSrcweir                 {
82cdf0e10cSrcweir                     aRange.aStart.SetCol( nCol );
83cdf0e10cSrcweir                     aRange.aStart.SetRow( nRow );
84cdf0e10cSrcweir                     aRange.aEnd.SetRow( nRow );
85cdf0e10cSrcweir                 }
86cdf0e10cSrcweir                 else
87cdf0e10cSrcweir                     aRange.aEnd = aRange.aStart;
88cdf0e10cSrcweir             }
89cdf0e10cSrcweir             else
90cdf0e10cSrcweir             {
91cdf0e10cSrcweir                 // #i111531# with 1M rows it was necessary to limit the range
92cdf0e10cSrcweir                 // to the actually used data area.
93cdf0e10cSrcweir                 SCCOL nCol1, nCol2;
94cdf0e10cSrcweir                 SCROW nRow1, nRow2;
95cdf0e10cSrcweir                 SCTAB nTab1, nTab2;
96cdf0e10cSrcweir                 aRange.GetVars( nCol1, nRow1, nTab1, nCol2, nRow2, nTab2);
97cdf0e10cSrcweir                 bool bShrunk;
98cdf0e10cSrcweir                 pDoc->ShrinkToUsedDataArea( bShrunk, nTab1, nCol1, nRow1, nCol2, nRow2, false);
99cdf0e10cSrcweir                 if (bShrunk)
100cdf0e10cSrcweir                 {
101cdf0e10cSrcweir                     aRange.aStart.SetCol( nCol1 );
102cdf0e10cSrcweir                     aRange.aStart.SetRow( nRow1 );
103cdf0e10cSrcweir                     aRange.aEnd.SetCol( nCol2 );
104cdf0e10cSrcweir                     aRange.aEnd.SetRow( nRow2 );
105cdf0e10cSrcweir                 }
106cdf0e10cSrcweir             }
107cdf0e10cSrcweir 
108cdf0e10cSrcweir             ScImportExport aObj( pDoc, aRange );
109cdf0e10cSrcweir             aObj.SetFormulas( GetViewData()->GetOptions().GetOption( VOPT_FORMULAS ) );
110cdf0e10cSrcweir             rtl::OUString aExportOUString;
111cdf0e10cSrcweir             aObj.ExportString( aExportOUString );
112cdf0e10cSrcweir             aStrSelection = aExportOUString;
113cdf0e10cSrcweir 
114cdf0e10cSrcweir             aStrSelection.ConvertLineEnd( LINEEND_CR );
115cdf0e10cSrcweir 
116cdf0e10cSrcweir             //  Tab/CR durch Space ersetzen, wenn fuer Dialog oder per Basic/SelectionTextExt,
117cdf0e10cSrcweir             //  oder wenn es eine einzelne Zeile ist.
118cdf0e10cSrcweir             //  Sonst mehrzeilig mit Tabs beibehalten (z.B. Mail oder Basic/SelectionText).
119cdf0e10cSrcweir             //  Fuer Mail werden die Tabs dann spaeter in (mehrere) Spaces gewandelt.
120cdf0e10cSrcweir 
121cdf0e10cSrcweir             if ( bInFormatDialog || bWholeWord || aRange.aEnd.Row() == aRange.aStart.Row() )
122cdf0e10cSrcweir             {
123cdf0e10cSrcweir                 xub_StrLen nAt;
124cdf0e10cSrcweir                 while (  (nAt = aStrSelection.Search( CHAR_CR )) != STRING_NOTFOUND )
125cdf0e10cSrcweir                     aStrSelection.SetChar( nAt, ' ' );
126cdf0e10cSrcweir                 while (  (nAt = aStrSelection.Search( '\t' )) != STRING_NOTFOUND )
127cdf0e10cSrcweir                     aStrSelection.SetChar( nAt, ' ' );
128cdf0e10cSrcweir 
129cdf0e10cSrcweir                 aStrSelection.EraseTrailingChars( ' ' );
130cdf0e10cSrcweir             }
131cdf0e10cSrcweir         }
132cdf0e10cSrcweir     }
133cdf0e10cSrcweir 
134cdf0e10cSrcweir     return aStrSelection;
135cdf0e10cSrcweir }
136cdf0e10cSrcweir 
137cdf0e10cSrcweir //------------------------------------------------------------------------
138cdf0e10cSrcweir 
InsertURL(const String & rName,const String & rURL,const String & rTarget,sal_uInt16 nMode)139cdf0e10cSrcweir void ScTabViewShell::InsertURL( const String& rName, const String& rURL, const String& rTarget,
140cdf0e10cSrcweir                                 sal_uInt16 nMode )
141cdf0e10cSrcweir {
142cdf0e10cSrcweir     SvxLinkInsertMode eMode = (SvxLinkInsertMode) nMode;
143cdf0e10cSrcweir     sal_Bool bAsText = ( eMode != HLINK_BUTTON );       // Default ist jetzt Text
144cdf0e10cSrcweir 
145cdf0e10cSrcweir     if ( bAsText )
146cdf0e10cSrcweir     {
147cdf0e10cSrcweir         if ( GetViewData()->IsActive() )
148cdf0e10cSrcweir         {
149cdf0e10cSrcweir             //  if the view is active, always use InsertURLField, which starts EditMode
150cdf0e10cSrcweir             //  and selects the URL, so it can be changed from the URL bar / dialog
151cdf0e10cSrcweir 
152cdf0e10cSrcweir             InsertURLField( rName, rURL, rTarget );
153cdf0e10cSrcweir         }
154cdf0e10cSrcweir         else
155cdf0e10cSrcweir         {
156cdf0e10cSrcweir             //  #91216# if the view is not active, InsertURLField doesn't work
157cdf0e10cSrcweir             //  -> use InsertBookmark to directly manipulate cell content
158cdf0e10cSrcweir             //  bTryReplace=sal_True -> if cell contains only one URL, replace it
159cdf0e10cSrcweir 
160cdf0e10cSrcweir             SCCOL nPosX = GetViewData()->GetCurX();
161cdf0e10cSrcweir             SCROW nPosY = GetViewData()->GetCurY();
162cdf0e10cSrcweir             InsertBookmark( rName, rURL, nPosX, nPosY, &rTarget, sal_True );
163cdf0e10cSrcweir         }
164cdf0e10cSrcweir     }
165cdf0e10cSrcweir     else
166cdf0e10cSrcweir     {
167cdf0e10cSrcweir         SC_MOD()->InputEnterHandler();
168cdf0e10cSrcweir         InsertURLButton( rName, rURL, rTarget );
169cdf0e10cSrcweir     }
170cdf0e10cSrcweir }
171cdf0e10cSrcweir 
172cdf0e10cSrcweir //------------------------------------------------------------------------
173cdf0e10cSrcweir 
174cdf0e10cSrcweir // wenn CLOOKs: -> mit <editview.hxx> <flditem.hxx>in neue tabvwsh
175cdf0e10cSrcweir 
lcl_SelectFieldAfterInsert(EditView & rView)176cdf0e10cSrcweir void lcl_SelectFieldAfterInsert( EditView& rView )
177cdf0e10cSrcweir {
178cdf0e10cSrcweir     ESelection aSel = rView.GetSelection();
179cdf0e10cSrcweir     if ( aSel.nStartPos == aSel.nEndPos && aSel.nStartPos > 0 )
180cdf0e10cSrcweir     {
181cdf0e10cSrcweir         //  Cursor is behind the inserted field -> extend selection to the left
182cdf0e10cSrcweir 
183cdf0e10cSrcweir         --aSel.nStartPos;
184cdf0e10cSrcweir         rView.SetSelection( aSel );
185cdf0e10cSrcweir     }
186cdf0e10cSrcweir }
187cdf0e10cSrcweir 
InsertURLField(const String & rName,const String & rURL,const String & rTarget)188cdf0e10cSrcweir void ScTabViewShell::InsertURLField( const String& rName, const String& rURL, const String& rTarget )
189cdf0e10cSrcweir {
190cdf0e10cSrcweir     SvxURLField aURLField( rURL, rName, SVXURLFORMAT_REPR );
191cdf0e10cSrcweir     aURLField.SetTargetFrame( rTarget );
192cdf0e10cSrcweir     SvxFieldItem aURLItem( aURLField, EE_FEATURE_FIELD );
193cdf0e10cSrcweir 
194cdf0e10cSrcweir     ScViewData*     pViewData   = GetViewData();
195cdf0e10cSrcweir     ScModule*       pScMod      = SC_MOD();
196cdf0e10cSrcweir     ScInputHandler* pHdl        = pScMod->GetInputHdl( pViewData->GetViewShell() );
197cdf0e10cSrcweir 
198cdf0e10cSrcweir     sal_Bool bSelectFirst = sal_False;
199cdf0e10cSrcweir     if ( !pScMod->IsEditMode() )
200cdf0e10cSrcweir     {
201cdf0e10cSrcweir         if ( !SelectionEditable() )
202cdf0e10cSrcweir         {
203cdf0e10cSrcweir             // no error message (may be called from drag&drop)
204cdf0e10cSrcweir             Sound::Beep();
205cdf0e10cSrcweir             return;
206cdf0e10cSrcweir         }
207cdf0e10cSrcweir 
208cdf0e10cSrcweir         // single url in cell is shown in the dialog and replaced
209cdf0e10cSrcweir         bSelectFirst = HasBookmarkAtCursor( NULL );
210cdf0e10cSrcweir         pScMod->SetInputMode( SC_INPUT_TABLE );
211cdf0e10cSrcweir     }
212cdf0e10cSrcweir 
213cdf0e10cSrcweir     EditView*       pTopView    = pHdl->GetTopView();
214cdf0e10cSrcweir     EditView*       pTableView  = pHdl->GetTableView();
215cdf0e10cSrcweir     DBG_ASSERT( pTopView || pTableView, "No EditView" );
216cdf0e10cSrcweir 
217cdf0e10cSrcweir     if ( bSelectFirst )
218cdf0e10cSrcweir     {
219cdf0e10cSrcweir         if ( pTopView )
220cdf0e10cSrcweir             pTopView->SetSelection( ESelection(0,0,0,1) );
221cdf0e10cSrcweir         if ( pTableView )
222cdf0e10cSrcweir             pTableView->SetSelection( ESelection(0,0,0,1) );
223cdf0e10cSrcweir     }
224cdf0e10cSrcweir 
225cdf0e10cSrcweir     pHdl->DataChanging();
226cdf0e10cSrcweir 
227cdf0e10cSrcweir     if ( pTopView )
228cdf0e10cSrcweir     {
229cdf0e10cSrcweir         pTopView->InsertField( aURLItem );
230cdf0e10cSrcweir         lcl_SelectFieldAfterInsert( *pTopView );
231cdf0e10cSrcweir     }
232cdf0e10cSrcweir     if ( pTableView )
233cdf0e10cSrcweir     {
234cdf0e10cSrcweir         pTableView->InsertField( aURLItem );
235cdf0e10cSrcweir         lcl_SelectFieldAfterInsert( *pTableView );
236cdf0e10cSrcweir     }
237cdf0e10cSrcweir 
238cdf0e10cSrcweir     pHdl->DataChanged();
239cdf0e10cSrcweir }
240cdf0e10cSrcweir 
ExecSearch(SfxRequest & rReq)241cdf0e10cSrcweir void ScTabViewShell::ExecSearch( SfxRequest& rReq )
242cdf0e10cSrcweir {
243cdf0e10cSrcweir     const SfxItemSet*   pReqArgs    = rReq.GetArgs();
244cdf0e10cSrcweir     sal_uInt16              nSlot       = rReq.GetSlot();
245cdf0e10cSrcweir     const SfxPoolItem*  pItem;
246cdf0e10cSrcweir 
247cdf0e10cSrcweir     switch ( nSlot )
248cdf0e10cSrcweir     {
249*c5c7750dSDamjan Jovanovic         case FID_SEARCH_ON:
250*c5c7750dSDamjan Jovanovic             bSearchJustOpened = sal_True;
251*c5c7750dSDamjan Jovanovic             break;
252*c5c7750dSDamjan Jovanovic 
253cdf0e10cSrcweir         case FID_SEARCH_NOW:
254cdf0e10cSrcweir             {
255cdf0e10cSrcweir                 if ( pReqArgs &&
256cdf0e10cSrcweir                      SFX_ITEM_SET == pReqArgs->GetItemState(SID_SEARCH_ITEM, sal_False, &pItem) )
257cdf0e10cSrcweir                 {
258cdf0e10cSrcweir                     DBG_ASSERT( pItem->ISA(SvxSearchItem), "falsches Item" );
259cdf0e10cSrcweir                     const SvxSearchItem* pSearchItem = (const SvxSearchItem*) pItem;
260cdf0e10cSrcweir 
261cdf0e10cSrcweir                     ScGlobal::SetSearchItem( *pSearchItem );
2620deba7fbSSteve Yin                     //SearchAndReplace( pSearchItem, sal_True, rReq.IsAPI() );
2630deba7fbSSteve Yin                     sal_Bool bSuccess = SearchAndReplace( pSearchItem, sal_True, rReq.IsAPI() );
2640deba7fbSSteve Yin                     if ( Application::IsAccessibilityEnabled() )
2650deba7fbSSteve Yin                     {
2660deba7fbSSteve Yin                         SvxSearchDialog* pSearchDlg =
2670deba7fbSSteve Yin                             ((SvxSearchDialog*)(SfxViewFrame::Current()->GetChildWindow(
2680deba7fbSSteve Yin                             SvxSearchDialogWrapper::GetChildWindowId())->GetWindow()));
2690deba7fbSSteve Yin                         if( pSearchDlg )
2700deba7fbSSteve Yin                         {
2710deba7fbSSteve Yin                             ScTabView* pTabView = GetViewData()->GetView();
2720deba7fbSSteve Yin                             if( pTabView )
2730deba7fbSSteve Yin                             {
2740deba7fbSSteve Yin                                 Window* pWin = pTabView->GetActiveWin();
2750deba7fbSSteve Yin                                 if( pWin )
2760deba7fbSSteve Yin                                 {
2770deba7fbSSteve Yin                                     pSearchDlg->SetDocWin( pWin );
2780deba7fbSSteve Yin                                     pSearchDlg->SetSrchFlag( bSuccess );
2790deba7fbSSteve Yin                                 }
2800deba7fbSSteve Yin                             }
2810deba7fbSSteve Yin                         }
2820deba7fbSSteve Yin                     }
283cdf0e10cSrcweir                     rReq.Done();
284cdf0e10cSrcweir                 }
285cdf0e10cSrcweir             }
286cdf0e10cSrcweir             break;
287cdf0e10cSrcweir 
288cdf0e10cSrcweir         case SID_SEARCH_ITEM:
289cdf0e10cSrcweir             if (pReqArgs && SFX_ITEM_SET ==
290cdf0e10cSrcweir                             pReqArgs->GetItemState(SID_SEARCH_ITEM, sal_False, &pItem))
291cdf0e10cSrcweir             {
292cdf0e10cSrcweir                 //  Search-Item merken
293cdf0e10cSrcweir                 DBG_ASSERT( pItem->ISA(SvxSearchItem), "falsches Item" );
294cdf0e10cSrcweir                 ScGlobal::SetSearchItem( *(const SvxSearchItem*) pItem );
295cdf0e10cSrcweir             }
296cdf0e10cSrcweir             else
297cdf0e10cSrcweir             {
298cdf0e10cSrcweir                 DBG_ERROR("SID_SEARCH_ITEM ohne Parameter");
299cdf0e10cSrcweir             }
300cdf0e10cSrcweir             break;
301cdf0e10cSrcweir         case FID_SEARCH:
302cdf0e10cSrcweir         case FID_REPLACE:
303cdf0e10cSrcweir         case FID_REPLACE_ALL:
304cdf0e10cSrcweir         case FID_SEARCH_ALL:
305cdf0e10cSrcweir             {
306cdf0e10cSrcweir                 if (pReqArgs && SFX_ITEM_SET == pReqArgs->GetItemState(nSlot, sal_False, &pItem))
307cdf0e10cSrcweir                 {
308cdf0e10cSrcweir                     //  SearchItem holen
309cdf0e10cSrcweir 
310cdf0e10cSrcweir                     SvxSearchItem aSearchItem = ScGlobal::GetSearchItem();
311cdf0e10cSrcweir 
312cdf0e10cSrcweir                     //  SearchItem fuellen
313cdf0e10cSrcweir 
314cdf0e10cSrcweir                     aSearchItem.SetSearchString(((SfxStringItem*)pItem)->GetValue());
315cdf0e10cSrcweir                     if(SFX_ITEM_SET == pReqArgs->GetItemState(FN_PARAM_1, sal_False, &pItem))
316cdf0e10cSrcweir                         aSearchItem.SetReplaceString(((SfxStringItem*)pItem)->GetValue());
317cdf0e10cSrcweir 
318cdf0e10cSrcweir                     if (nSlot == FID_SEARCH)
319cdf0e10cSrcweir                         aSearchItem.SetCommand(SVX_SEARCHCMD_FIND);
320cdf0e10cSrcweir                     else if(nSlot == FID_REPLACE)
321cdf0e10cSrcweir                         aSearchItem.SetCommand(SVX_SEARCHCMD_REPLACE);
322cdf0e10cSrcweir                     else if(nSlot == FID_REPLACE_ALL)
323cdf0e10cSrcweir                         aSearchItem.SetCommand(SVX_SEARCHCMD_REPLACE_ALL);
324cdf0e10cSrcweir                     else
325cdf0e10cSrcweir                         aSearchItem.SetCommand(SVX_SEARCHCMD_FIND_ALL);
326cdf0e10cSrcweir 
327cdf0e10cSrcweir                     //  Request ausfuehren (dabei wird das SearchItem gespeichert)
328cdf0e10cSrcweir 
329cdf0e10cSrcweir                     aSearchItem.SetWhich(SID_SEARCH_ITEM);
330cdf0e10cSrcweir                     GetViewData()->GetDispatcher().Execute( FID_SEARCH_NOW,
331cdf0e10cSrcweir                             rReq.IsAPI() ? SFX_CALLMODE_API|SFX_CALLMODE_SYNCHRON :
332cdf0e10cSrcweir                                             SFX_CALLMODE_STANDARD,
333cdf0e10cSrcweir                             &aSearchItem, 0L );
3340deba7fbSSteve Yin                     if ( Application::IsAccessibilityEnabled() )
3350deba7fbSSteve Yin                     {
3360deba7fbSSteve Yin                         SvxSearchDialog* pSearchDlg =
3370deba7fbSSteve Yin                             ((SvxSearchDialog*)(SfxViewFrame::Current()->GetChildWindow(
3380deba7fbSSteve Yin                             SvxSearchDialogWrapper::GetChildWindowId())->GetWindow()));
3390deba7fbSSteve Yin                         if( pSearchDlg )
3400deba7fbSSteve Yin                         {
3410deba7fbSSteve Yin                             ScTabView* pTabView = GetViewData()->GetView();
3420deba7fbSSteve Yin                             if( pTabView )
3430deba7fbSSteve Yin                             {
3440deba7fbSSteve Yin                                 Window* pWin = pTabView->GetActiveWin();
3450deba7fbSSteve Yin                                 if( pWin )
3460deba7fbSSteve Yin                                 {
3470deba7fbSSteve Yin                                     pSearchDlg->SetDocWin( pWin );
3480deba7fbSSteve Yin                                     pSearchDlg->SetSrchFlag();
3490deba7fbSSteve Yin                                 }
3500deba7fbSSteve Yin                             }
3510deba7fbSSteve Yin                         }
3520deba7fbSSteve Yin                     }
353cdf0e10cSrcweir                 }
354cdf0e10cSrcweir                 else
355cdf0e10cSrcweir                 {
356cdf0e10cSrcweir                     GetViewData()->GetDispatcher().Execute(
357cdf0e10cSrcweir                             SID_SEARCH_DLG, SFX_CALLMODE_ASYNCHRON|SFX_CALLMODE_RECORD );
358cdf0e10cSrcweir                 }
359cdf0e10cSrcweir             }
360cdf0e10cSrcweir             break;
361cdf0e10cSrcweir         case FID_REPEAT_SEARCH:
362cdf0e10cSrcweir             {
363cdf0e10cSrcweir                 //  nochmal mit ScGlobal::GetSearchItem()
364cdf0e10cSrcweir 
365cdf0e10cSrcweir                 SvxSearchItem aSearchItem = ScGlobal::GetSearchItem();
366cdf0e10cSrcweir                 aSearchItem.SetWhich(SID_SEARCH_ITEM);
367cdf0e10cSrcweir                 GetViewData()->GetDispatcher().Execute( FID_SEARCH_NOW,
368cdf0e10cSrcweir                         rReq.IsAPI() ? SFX_CALLMODE_API|SFX_CALLMODE_SYNCHRON :
369cdf0e10cSrcweir                                         SFX_CALLMODE_STANDARD,
370cdf0e10cSrcweir                         &aSearchItem, 0L );
371cdf0e10cSrcweir             }
372cdf0e10cSrcweir             break;
373cdf0e10cSrcweir //      case FID_SEARCH_COUNT:
374cdf0e10cSrcweir     }
375cdf0e10cSrcweir }
376cdf0e10cSrcweir 
377cdf0e10cSrcweir //--------------------------------------------------------------------
378