1 /*************************************************************************
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
5 * Copyright 2008 by Sun Microsystems, Inc.
7 * OpenOffice.org - a multi-platform office productivity suite
9 * $RCSfile: viewsrch.cxx,v $
12 * This file is part of OpenOffice.org.
14 * OpenOffice.org is free software: you can redistribute it and/or modify
15 * it under the terms of the GNU Lesser General Public License version 3
16 * only, as published by the Free Software Foundation.
18 * OpenOffice.org is distributed in the hope that it will be useful,
19 * but WITHOUT ANY WARRANTY; without even the implied warranty of
20 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21 * GNU Lesser General Public License version 3 for more details
22 * (a copy is included in the LICENSE file that accompanied this code).
24 * You should have received a copy of the GNU Lesser General Public License
25 * version 3 along with OpenOffice.org. If not, see
26 * <http://www.openoffice.org/license.html>
27 * for a copy of the LGPLv3 License.
29 ************************************************************************/
31 // MARKER(update_precomp.py): autogen include statement, do not remove
32 #include "precompiled_sw.hxx"
35 #include <string> // HACK: prevent conflict between STLPORT and Workshop headers
36 #include <hintids.hxx>
37 #include <com/sun/star/util/SearchOptions.hpp>
38 #include <svtools/cjkoptions.hxx>
39 #include <svtools/ctloptions.hxx>
40 #include <svx/pageitem.hxx>
41 #include <svtools/whiter.hxx>
42 #include <sfx2/dispatch.hxx>
43 #include <svtools/stritem.hxx>
44 #ifndef _T2XTCMP_HXX //autogen
45 #include <svtools/txtcmp.hxx>
47 #include <svtools/itempool.hxx>
48 #include <svtools/eitem.hxx>
49 #include <svx/srchitem.hxx>
50 #include <sfx2/request.hxx>
51 #include <svx/srchdlg.hxx>
52 #include <vcl/msgbox.hxx>
53 #include <vcl/wrkwin.hxx>
54 #include "svx/unolingu.hxx"
55 #include <swmodule.hxx>
57 #include <workctrl.hxx>
62 #include <swundo.hxx> // fuer Undo-Ids
74 #include <SwRewriter.hxx>
77 #include <comcore.hrc>
80 #include "PostItMgr.hxx"
82 using namespace com::sun::star
;
83 using namespace ::com::sun::star::i18n
;
84 using namespace ::com::sun::star::lang
;
85 using namespace ::com::sun::star::util
;
86 using namespace ::com::sun::star::i18n
;
88 #define SRCH_ATTR_OFF 0
89 #define SRCH_ATTR_ON 1
90 #define SRCH_ATTR_SET 2
92 /*--------------------------------------------------------------------
93 Beschreibung: Search Parameter
94 --------------------------------------------------------------------*/
96 struct SwSearchOptions
98 SwDocPositions eStart
, eEnd
;
101 SwSearchOptions( SwWrtShell
* pSh
, BOOL bBackward
);
105 inline Window
* GetParentWindow( SvxSearchDialog
* pSrchDlg
)
108 if( pSrchDlg
&& pSrchDlg
->IsVisible() )
109 pWin
= LAYOUT_THIS_WINDOW (pSrchDlg
);
116 /*-----------------12.04.97 13:04-------------------
118 --------------------------------------------------*/
121 void SwView::ExecSearch(SfxRequest
& rReq
, BOOL bNoMessage
)
123 const SfxItemSet
* pArgs
= rReq
.GetArgs();
124 const SfxPoolItem
* pItem
= 0;
125 const USHORT nId
= SvxSearchDialogWrapper::GetChildWindowId();
126 SvxSearchDialogWrapper
*pWrp
= (SvxSearchDialogWrapper
*)GetViewFrame()->GetChildWindow(nId
);
128 if(pArgs
&& SFX_ITEM_SET
== pArgs
->GetItemState(SID_SEARCH_QUIET
, FALSE
, &pItem
))
129 bQuiet
= ((const SfxBoolItem
*) pItem
)->GetValue();
131 BOOL bApi
= bQuiet
| bNoMessage
;
133 USHORT nSlot
= rReq
.GetSlot();
134 if (nSlot
== FN_REPEAT_SEARCH
&& !pSrchItem
)
138 rReq
.SetReturnValue(SfxBoolItem(nSlot
, FALSE
));
142 if( pWrtShell
->IsBlockMode() )
143 pWrtShell
->LeaveBlockMode();
146 // erstmal Nichts tun
147 case SID_SEARCH_ITEM
:
150 pSrchItem
= (SvxSearchItem
*) pArgs
->Get(SID_SEARCH_ITEM
).Clone();
156 GetViewFrame()->GetBindings().Invalidate(SID_SEARCH_ITEM
);
164 pSrchItem
= (SvxSearchItem
*) pArgs
->Get(SID_SEARCH_ITEM
).Clone();
166 DELETEZ( pSrchList
);
167 DELETEZ( pReplList
);
171 pSrchDlg
= static_cast <SvxSearchDialog
*> (pWrp
->getDialog ());
172 // die Search / Replace -Items merken wir uns
173 const SearchAttrItemList
* pList
= pSrchDlg
->GetSearchItemList();
174 if( pList
&& pList
->Count() )
175 pSrchList
= new SearchAttrItemList( *pList
);
177 if( 0 != (pList
= pSrchDlg
->GetReplaceItemList() ) &&
179 pReplList
= new SearchAttrItemList( *pList
);
184 case FN_REPEAT_SEARCH
:
188 if(FID_SEARCH_NOW
== nSlot
&& !rReq
.IsAPI())
189 SwView::SetMoveType(NID_SRCH_REP
);
192 pSrchDlg
= static_cast <SvxSearchDialog
*> (pWrp
->getDialog ());
200 DELETEZ( pSrchList
);
201 DELETEZ( pReplList
);
203 const SearchAttrItemList
* pList
= pSrchDlg
->GetSearchItemList();
204 if( pList
&& pList
->Count() )
205 pSrchList
= new SearchAttrItemList( *pList
);
207 if( 0 != (pList
= pSrchDlg
->GetReplaceItemList() ) &&
209 pReplList
= new SearchAttrItemList( *pList
);
212 if (nSlot
== FN_REPEAT_SEARCH
)
214 ASSERT(pSrchItem
, "Search-Item fehlt");
216 pSrchItem
= new SvxSearchItem(SID_SEARCH_ITEM
);
220 // SearchItem aus Request besorgen
221 ASSERT(pArgs
, "Args fehlen");
225 pSrchItem
= (SvxSearchItem
*) pArgs
->Get(SID_SEARCH_ITEM
).Clone();
228 switch (pSrchItem
->GetCommand())
230 case SVX_SEARCHCMD_FIND
:
232 BOOL bRet
= SearchAndWrap(bApi
);
234 Scroll(pWrtShell
->GetCharRect().SVRect());
235 rReq
.SetReturnValue(SfxBoolItem(nSlot
, bRet
));
238 case SVX_SEARCHCMD_FIND_ALL
:
240 BOOL bRet
= SearchAll();
245 Window
* pParentWindow
= GetParentWindow( pSrchDlg
);
246 InfoBox( pParentWindow
, SW_RES(MSG_NOT_FOUND
)).Execute();
250 rReq
.SetReturnValue(SfxBoolItem(nSlot
, bRet
));
253 case SVX_SEARCHCMD_REPLACE
:
256 // 1) Selektion ersetzen (nicht. wenn nur Attribute ersetzt
258 //JP 27.04.95: warum ?
259 // was ist, wenn man das gefundene nur attributieren will??
261 USHORT nCmd
= SVX_SEARCHCMD_FIND
;
262 if( pSrchItem
->GetReplaceString().Len() ||
265 // Verhindern, dass - falls der Suchstring im
266 // Ersetzungsstring enthalten ist - der ersetzte String
267 // noch einmal gefunden wird.
269 BOOL bBack
= pSrchItem
->GetBackward();
272 String
aReplace( pSrchItem
->GetReplaceString() );
273 SearchOptions
aTmp( pSrchItem
->GetSearchOptions() );
274 String
*pBackRef
= ReplaceBackReferences( aTmp
, pWrtShell
->GetCrsr() );
276 pSrchItem
->SetReplaceString( *pBackRef
);
280 pSrchItem
->SetReplaceString( aReplace
);
286 pWrtShell
->SwapPam();
290 nCmd
= SVX_SEARCHCMD_REPLACE
;
292 // 2) Weiter suchen (ohne zu ersetzen!)
294 USHORT nOldCmd
= pSrchItem
->GetCommand();
295 pSrchItem
->SetCommand( nCmd
);
296 BOOL bRet
= SearchAndWrap(bApi
);
298 Scroll( pWrtShell
->GetCharRect().SVRect());
299 pSrchItem
->SetCommand( nOldCmd
);
300 rReq
.SetReturnValue(SfxBoolItem(nSlot
, bRet
));
304 case SVX_SEARCHCMD_REPLACE_ALL
:
306 SwSearchOptions
aOpts( pWrtShell
, pSrchItem
->GetBackward() );
309 if( !pSrchItem
->GetSelection() )
311 // bestehende Selektionen aufheben,
312 // wenn nicht in selektierten Bereichen gesucht werden soll
313 (pWrtShell
->*pWrtShell
->fnKillSel
)(0, FALSE
);
314 if( DOCPOS_START
== aOpts
.eEnd
)
323 { //Scope for SwWait-Object
324 SwWait
aWait( *GetDocShell(), TRUE
);
325 pWrtShell
->StartAllAction();
326 nFound
= FUNC_Search( aOpts
);
327 pWrtShell
->EndAllAction();
329 rReq
.SetReturnValue(SfxBoolItem(nSlot
, nFound
!= 0 && ULONG_MAX
!= nFound
));
334 Window
* pParentWindow
= GetParentWindow( pSrchDlg
);
335 InfoBox( pParentWindow
, SW_RES(MSG_NOT_FOUND
)).Execute();
341 if( !bApi
&& ULONG_MAX
!= nFound
)
343 String
aText( SW_RES( STR_NB_REPLACED
) );
344 const xub_StrLen nPos
= aText
.Search( String::CreateFromAscii("XX") );
345 aText
.Erase( nPos
, 2 );
346 aText
.Insert( String::CreateFromInt32( nFound
), nPos
);
347 Window
* pParentWindow
= GetParentWindow( pSrchDlg
);
348 InfoBox( pParentWindow
, aText
).Execute();
354 uno::Reference
< frame::XDispatchRecorder
> xRecorder
=
355 GetViewFrame()->GetBindings().GetRecorder();
356 //prevent additional dialogs in recorded macros
357 if ( xRecorder
.is() )
358 rReq
.AppendItem(SfxBoolItem(SID_SEARCH_QUIET
, sal_True
));
363 case FID_SEARCH_SEARCHSET
:
364 case FID_SEARCH_REPLACESET
:
366 static const USHORT aNormalAttr
[] =
368 /* 0 */ RES_CHRATR_CASEMAP
, RES_CHRATR_CASEMAP
,
369 /* 2 */ RES_CHRATR_COLOR
, RES_CHRATR_POSTURE
,
370 /* 4 */ RES_CHRATR_SHADOWED
, RES_CHRATR_WORDLINEMODE
,
371 /* 6 */ RES_CHRATR_BLINK
, RES_CHRATR_BLINK
,
372 /* 8 */ RES_CHRATR_BACKGROUND
, RES_CHRATR_BACKGROUND
,
373 /*10 */ RES_CHRATR_ROTATE
, RES_CHRATR_ROTATE
,
374 /*12 */ RES_CHRATR_SCALEW
, RES_CHRATR_RELIEF
,
375 // insert position for CJK/CTL attributes!
376 /*14 */ RES_PARATR_LINESPACING
, RES_PARATR_HYPHENZONE
,
377 /*16 */ RES_PARATR_REGISTER
, RES_PARATR_REGISTER
,
378 /*18 */ RES_PARATR_VERTALIGN
, RES_PARATR_VERTALIGN
,
379 /*20 */ RES_LR_SPACE
, RES_UL_SPACE
,
380 /*22 */ SID_ATTR_PARA_MODEL
, SID_ATTR_PARA_KEEP
,
384 static const USHORT aCJKAttr
[] =
386 RES_CHRATR_CJK_FONT
, RES_CHRATR_CJK_WEIGHT
,
387 RES_CHRATR_EMPHASIS_MARK
, RES_CHRATR_TWO_LINES
,
388 RES_PARATR_SCRIPTSPACE
, RES_PARATR_FORBIDDEN_RULES
390 static const USHORT aCTLAttr
[] =
392 RES_CHRATR_CTL_FONT
, RES_CHRATR_CTL_WEIGHT
395 SvUShorts
aArr( 0, 16 );
396 aArr
.Insert( aNormalAttr
,
397 sizeof( aNormalAttr
) / sizeof( aNormalAttr
[0] ),
399 if( SW_MOD()->GetCTLOptions().IsCTLFontEnabled() )
400 aArr
.Insert( aCTLAttr
,
401 sizeof( aCTLAttr
) / sizeof( aCTLAttr
[0] ),
403 SvtCJKOptions aCJKOpt
;
404 if( aCJKOpt
.IsAnyEnabled() )
405 aArr
.Insert( aCJKAttr
,
406 sizeof( aCJKAttr
) / sizeof( aCJKAttr
[0] ),
409 SfxItemSet
aSet( pWrtShell
->GetAttrPool(), aArr
.GetData() );
410 USHORT nWhich
= SID_SEARCH_SEARCHSET
;
412 if ( FID_SEARCH_REPLACESET
== nSlot
)
414 nWhich
= SID_SEARCH_REPLACESET
;
418 pReplList
->Get( aSet
);
419 DELETEZ( pReplList
);
422 else if ( pSrchList
)
424 pSrchList
->Get( aSet
);
425 DELETEZ( pSrchList
);
427 rReq
.SetReturnValue( SvxSetItem( nWhich
, aSet
) );
434 ByteString
sStr( "nSlot: " );
435 sStr
+= ByteString::CreateFromInt32( nSlot
);
436 sStr
+= " falscher Dispatcher (viewsrch.cxx)";
437 DBG_ERROR( sStr
.GetBuffer() );
445 BOOL
SwView::SearchAndWrap(BOOL bApi
)
447 SwSearchOptions
aOpts( pWrtShell
, pSrchItem
->GetBackward() );
449 // Startposition der Suche fuer WrapAround merken
450 // Start- / EndAction wegen vielleicht bestehender Selektionen
452 pWrtShell
->StartAllAction();
454 // falls in selektierten Bereichen gesucht werden soll, duerfen sie
455 // nicht aufgehoben werden
456 if (!pSrchItem
->GetSelection())
457 (pWrtShell
->*pWrtShell
->fnKillSel
)(0, FALSE
);
459 SwWait
*pWait
= new SwWait( *GetDocShell(), TRUE
);
460 if( FUNC_Search( aOpts
) )
463 if(pWrtShell
->IsSelFrmMode())
465 pWrtShell
->UnSelectFrm();
466 pWrtShell
->LeaveSelFrmMode();
469 pWrtShell
->EndAllAction();
473 delete pWait
, pWait
= 0;
475 // Suchen in den Sonderbereichen, wenn keine
476 // Suche in Selektionen vorliegt. Bei Suche in Selektionen
477 // wird ohnehin in diesen Sonderbereichen gesucht
478 BOOL bHasSrchInOther
= bExtra
;
479 if (!pSrchItem
->GetSelection() && !bExtra
)
482 if( FUNC_Search( aOpts
) )
486 pWrtShell
->EndAllAction();
494 const USHORT nId
= SvxSearchDialogWrapper::GetChildWindowId();
495 SvxSearchDialogWrapper
*pWrp
= (SvxSearchDialogWrapper
*)GetViewFrame()->GetChildWindow(nId
);
496 pSrchDlg
= pWrp
? static_cast <SvxSearchDialog
*> (pWrp
->getDialog ()) : 0;
498 // falls Startposition am Dokumentende / -anfang
501 pWrtShell
->EndAllAction();
504 Window
* pParentWindow
= GetParentWindow( pSrchDlg
);
505 InfoBox( pParentWindow
, SW_RES(MSG_NOT_FOUND
)).Execute();
511 pWrtShell
->EndAllAction();
512 // noch mal mit WrapAround versuchen?
514 if( bApi
|| RET_NO
== QueryBox( GetParentWindow( pSrchDlg
),
515 SW_RES( DOCPOS_START
== aOpts
.eEnd
524 pWrtShell
->StartAllAction();
525 pWrtShell
->Pop(FALSE
);
526 pWait
= new SwWait( *GetDocShell(), TRUE
);
528 BOOL bSrchBkwrd
= DOCPOS_START
== aOpts
.eEnd
;
530 aOpts
.eEnd
= bSrchBkwrd
? DOCPOS_START
: DOCPOS_END
;
531 aOpts
.eStart
= bSrchBkwrd
? DOCPOS_END
: DOCPOS_START
;
535 pWrtShell
->ClearMark();
542 bFound
= 0 != FUNC_Search( aOpts
);
543 pWrtShell
->EndAllAction();
549 Window
* pParentWindow
= GetParentWindow( pSrchDlg
);
550 InfoBox( pParentWindow
, SW_RES(MSG_NOT_FOUND
)).Execute();
552 return bFound
= FALSE
;
556 BOOL
SwView::SearchAll(USHORT
* pFound
)
558 SwWait
aWait( *GetDocShell(), TRUE
);
559 pWrtShell
->StartAllAction();
561 SwSearchOptions
aOpts( pWrtShell
, pSrchItem
->GetBackward() );
563 if (!pSrchItem
->GetSelection())
565 // bestehende Selektionen aufheben,
566 // wenn nicht in selektierten Bereichen gesucht werden soll
567 (pWrtShell
->*pWrtShell
->fnKillSel
)(0, FALSE
);
569 if( DOCPOS_START
== aOpts
.eEnd
)
575 USHORT nFound
= (USHORT
)FUNC_Search( aOpts
);
578 bFound
= 0 != nFound
;
580 pWrtShell
->EndAllAction();
585 void SwView::Replace()
587 SwWait
aWait( *GetDocShell(), TRUE
);
589 pWrtShell
->StartAllAction();
591 if( pSrchItem
->GetPattern() ) // Vorlagen?
593 SwRewriter aRewriter
;
594 aRewriter
.AddRule(UNDO_ARG1
, pSrchItem
->GetSearchString());
595 aRewriter
.AddRule(UNDO_ARG2
, SW_RES(STR_YIELDS
));
596 aRewriter
.AddRule(UNDO_ARG3
, pSrchItem
->GetReplaceString());
598 pWrtShell
->StartUndo(UNDO_UI_REPLACE_STYLE
, &aRewriter
); // #111827#
600 pWrtShell
->SetTxtFmtColl( pWrtShell
->GetParaStyle(
601 pSrchItem
->GetReplaceString(),
602 SwWrtShell::GETSTYLE_CREATESOME
));
604 pWrtShell
->EndUndo(UNDO_UI_REPLACE_STYLE
); // #111827#
608 if (GetPostItMgr()->GetActivePostIt())
609 GetPostItMgr()->Replace(pSrchItem
);
610 sal_Bool bReplaced
= pWrtShell
->SwEditShell::Replace( pSrchItem
->GetReplaceString(),
611 pSrchItem
->GetRegExp());
613 if( bReplaced
&& pReplList
&& pReplList
->Count() && pWrtShell
->HasSelection() )
615 SfxItemSet
aReplSet( pWrtShell
->GetAttrPool(),
616 aTxtFmtCollSetRange
);
617 if( pReplList
->Get( aReplSet
).Count() )
619 ::SfxToSwPageDescAttr( *pWrtShell
, aReplSet
);
620 pWrtShell
->SwEditShell::SetAttr( aReplSet
);
625 pWrtShell
->EndAllAction();
630 SwSearchOptions::SwSearchOptions( SwWrtShell
* pSh
, BOOL bBackward
)
632 eStart
= DOCPOS_CURR
;
636 bDontWrap
= pSh
->IsEndOfDoc();
641 bDontWrap
= pSh
->IsStartOfDoc();
645 ULONG
SwView::FUNC_Search( const SwSearchOptions
& rOptions
)
647 BOOL bDoReplace
= pSrchItem
->GetCommand() == SVX_SEARCHCMD_REPLACE
||
648 pSrchItem
->GetCommand() == SVX_SEARCHCMD_REPLACE_ALL
;
650 int eRanges
= pSrchItem
->GetSelection() ?
651 FND_IN_SEL
: bExtra
? FND_IN_OTHER
: FND_IN_BODY
;
652 if (pSrchItem
->GetCommand() == SVX_SEARCHCMD_FIND_ALL
||
653 pSrchItem
->GetCommand() == SVX_SEARCHCMD_REPLACE_ALL
)
654 eRanges
|= FND_IN_SELALL
;
656 pWrtShell
->SttSelect();
658 static USHORT __READONLY_DATA aSearchAttrRange
[] = {
659 RES_FRMATR_BEGIN
, RES_FRMATR_END
-1,
660 RES_CHRATR_BEGIN
, RES_CHRATR_END
-1,
661 RES_PARATR_BEGIN
, RES_PARATR_END
-1,
662 SID_ATTR_PARA_MODEL
, SID_ATTR_PARA_KEEP
,
665 SfxItemSet
aSrchSet( pWrtShell
->GetAttrPool(), aSearchAttrRange
);
666 if( pSrchList
&& pSrchList
->Count() )
668 pSrchList
->Get( aSrchSet
);
670 /* -- Seitenumbruch mit Seitenvorlage */
671 ::SfxToSwPageDescAttr( *pWrtShell
, aSrchSet
);
674 SfxItemSet
* pReplSet
= 0;
675 if( bDoReplace
&& pReplList
&& pReplList
->Count() )
677 pReplSet
= new SfxItemSet( pWrtShell
->GetAttrPool(),
679 pReplList
->Get( *pReplSet
);
681 /* -- Seitenumbruch mit Seitenvorlage */
682 ::SfxToSwPageDescAttr( *pWrtShell
, *pReplSet
);
684 if( !pReplSet
->Count() ) // schade, die Attribute
685 DELETEZ( pReplSet
); // kennen wir nicht
689 // build SearchOptions to be used
691 SearchOptions
aSearchOpt( pSrchItem
->GetSearchOptions() );
692 aSearchOpt
.Locale
= SvxCreateLocale( (USHORT
)GetAppLanguage() );
694 aSearchOpt
.replaceString
= aEmptyStr
;
697 if( aSrchSet
.Count() || ( pReplSet
&& pReplSet
->Count() ))
699 nFound
= pWrtShell
->SearchAttr(
701 !pSrchItem
->GetPattern(),
705 pSrchItem
->GetSearchString().Len() ? &aSearchOpt
: 0,
708 else if( pSrchItem
->GetPattern() )
710 // Suchen (und ersetzen) von Vorlagen
711 const String
sRplStr( pSrchItem
->GetReplaceString() );
712 nFound
= pWrtShell
->SearchTempl( pSrchItem
->GetSearchString(),
716 bDoReplace
? &sRplStr
: 0 );
721 nFound
= pWrtShell
->SearchPattern(aSearchOpt
, pSrchItem
->GetNotes(),
727 pWrtShell
->EndSelect();
731 LAYOUT_NS Dialog
* SwView::GetSearchDialog()
733 const USHORT nId
= SvxSearchDialogWrapper::GetChildWindowId();
734 SvxSearchDialogWrapper
*pWrp
= (SvxSearchDialogWrapper
*)SfxViewFrame::Current()->GetChildWindow(nId
);
736 pSrchDlg
= pWrp
->getDialog ();
742 void SwView::StateSearch(SfxItemSet
&rSet
)
744 SfxWhichIter
aIter(rSet
);
745 USHORT nWhich
= aIter
.FirstWhich();
751 case SID_SEARCH_OPTIONS
:
753 UINT16 nOpt
= 0xFFFF;
754 if( GetDocShell()->IsReadOnly() )
755 nOpt
&= ~( SEARCH_OPTIONS_REPLACE
|
756 SEARCH_OPTIONS_REPLACE_ALL
);
757 rSet
.Put( SfxUInt16Item( SID_SEARCH_OPTIONS
, nOpt
));
760 case SID_SEARCH_ITEM
:
764 pSrchItem
= new SvxSearchItem( SID_SEARCH_ITEM
);
765 pSrchItem
->SetFamily(SFX_STYLE_FAMILY_PARA
);
766 pSrchItem
->SetSearchString( pWrtShell
->GetSelTxt() );
769 if( bJustOpened
&& pWrtShell
->IsSelection() )
772 if( 1 == pWrtShell
->GetCrsrCnt() &&
773 ( aTxt
= pWrtShell
->SwCrsrShell::GetSelTxt() ).Len() )
775 pSrchItem
->SetSearchString( aTxt
);
776 pSrchItem
->SetSelection( FALSE
);
779 pSrchItem
->SetSelection( TRUE
);
783 rSet
.Put( *pSrchItem
);
787 /* case SID_SEARCH_REPLACESET:
788 case SID_SEARCH_SEARCHSET:
790 static USHORT __READONLY_DATA aSearchAttrRange[] =
792 RES_CHRATR_CASEMAP, RES_CHRATR_POSTURE,
793 RES_CHRATR_SHADOWED, RES_CHRATR_WORDLINEMODE,
794 RES_PARATR_LINESPACING, RES_PARATR_HYPHENZONE,
795 RES_LR_SPACE, RES_UL_SPACE,
796 SID_ATTR_PARA_MODEL, SID_ATTR_PARA_KEEP,
800 SfxItemSet aSet(pWrtShell->GetAttrPool(), aSearchAttrRange );
801 if( SID_SEARCH_REPLACESET==nWhich )
805 pReplList->Get( aSet );
806 DELETEZ( pReplList );
811 pSrchList->Get( aSet );
812 DELETEZ( pSrchList );
814 rSet.Put( SvxSetItem( nWhich, aSet ));
819 nWhich
= aIter
.NextWhich();