class SvxJSearchOptionsDialog added
This commit is contained in:
parent
180450ba6b
commit
f50b87327a
2 changed files with 106 additions and 11 deletions
|
@ -2,9 +2,9 @@
|
|||
*
|
||||
* $RCSfile: srchdlg.hxx,v $
|
||||
*
|
||||
* $Revision: 1.3 $
|
||||
* $Revision: 1.4 $
|
||||
*
|
||||
* last change: $Author: tl $ $Date: 2001-02-21 13:23:36 $
|
||||
* last change: $Author: tl $ $Date: 2001-02-23 13:08:58 $
|
||||
*
|
||||
* The Contents of this file are made available subject to the terms of
|
||||
* either of the following licenses
|
||||
|
@ -91,6 +91,9 @@
|
|||
#ifndef _SFX_CHILDWIN_HXX //autogen
|
||||
#include <sfx2/childwin.hxx>
|
||||
#endif
|
||||
#ifndef _BASEDLGS_HXX
|
||||
#include <sfx2/basedlgs.hxx>
|
||||
#endif
|
||||
#ifndef _SVARRAY_HXX //autogen
|
||||
#include <svtools/svarray.hxx>
|
||||
#endif
|
||||
|
@ -111,6 +114,8 @@
|
|||
class SvxSearchItem;
|
||||
class MoreButton;
|
||||
class SfxStyleSheetBasePool;
|
||||
class SvxJSearchOptionsPage;
|
||||
|
||||
struct SearchDlg_Impl;
|
||||
|
||||
#ifndef NO_SVX_SEARCH
|
||||
|
@ -181,6 +186,7 @@ class SvxSearchDialog : public ModelessDialog
|
|||
{
|
||||
friend class SvxSearchController;
|
||||
friend class SvxSearchDialogWrapper;
|
||||
friend class SvxJSearchOptionsDialog;
|
||||
|
||||
public:
|
||||
SvxSearchDialog( Window* pParent, SfxBindings& rBind );
|
||||
|
@ -188,6 +194,9 @@ public:
|
|||
|
||||
virtual BOOL Close();
|
||||
|
||||
// Window
|
||||
virtual void Activate();
|
||||
|
||||
void GetSearchItems( SfxItemSet& rSet );
|
||||
void GetReplaceItems( SfxItemSet& rSet );
|
||||
|
||||
|
@ -329,6 +338,35 @@ inline BOOL SvxSearchDialog::HasReplaceAttributes() const
|
|||
return ( aReplaceAttrText.IsEnabled() && bLen );
|
||||
}
|
||||
|
||||
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
|
||||
|
||||
class SvxJSearchOptionsDialog : public SfxSingleTabDialog
|
||||
{
|
||||
SvxSearchDialog &rDialog;
|
||||
SvxJSearchOptionsPage *pPage;
|
||||
|
||||
// disallow copy-constructor and assignment-operator for now
|
||||
SvxJSearchOptionsDialog( const SvxJSearchOptionsDialog & );
|
||||
SvxJSearchOptionsDialog & operator == ( const SvxJSearchOptionsDialog & );
|
||||
|
||||
public:
|
||||
SvxJSearchOptionsDialog( SvxSearchDialog &rParent,
|
||||
const SfxItemSet& rOptionsSet, USHORT nUniqueId );
|
||||
virtual ~SvxJSearchOptionsDialog();
|
||||
|
||||
// Window
|
||||
virtual void Activate();
|
||||
|
||||
INT32 GetTransliterationFlags() const;
|
||||
void SetTransliterationFlags( INT32 nSettings );
|
||||
};
|
||||
|
||||
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
|
||||
|
||||
#endif // SV_NODIALOG
|
||||
#endif // NO_SVX_SEARCH
|
||||
|
||||
|
|
|
@ -2,9 +2,9 @@
|
|||
*
|
||||
* $RCSfile: srchdlg.cxx,v $
|
||||
*
|
||||
* $Revision: 1.6 $
|
||||
* $Revision: 1.7 $
|
||||
*
|
||||
* last change: $Author: tl $ $Date: 2001-02-21 13:27:46 $
|
||||
* last change: $Author: tl $ $Date: 2001-02-23 13:12:55 $
|
||||
*
|
||||
* The Contents of this file are made available subject to the terms of
|
||||
* either of the following licenses
|
||||
|
@ -310,6 +310,52 @@ void SearchAttrItemList::Remove( USHORT nPos, USHORT nLen )
|
|||
SrchAttrItemList::Remove( nPos, nLen );
|
||||
}
|
||||
|
||||
|
||||
// class SvxJSearchOptionsDialog -----------------------------------------
|
||||
|
||||
|
||||
SvxJSearchOptionsDialog::SvxJSearchOptionsDialog(
|
||||
SvxSearchDialog &rParent,
|
||||
const SfxItemSet& rOptionsSet, USHORT nUniqueId ) :
|
||||
SfxSingleTabDialog ( &rParent, rOptionsSet, RID_SVXPAGE_JSEARCH_OPTIONS ),
|
||||
rDialog ( rParent )
|
||||
{
|
||||
pPage = (SvxJSearchOptionsPage *)
|
||||
SvxJSearchOptionsPage::Create( this, rOptionsSet );
|
||||
SetTabPage( pPage ); //! implicitly calls pPage->Reset(...)!
|
||||
pPage->EnableSaveOptions( FALSE );
|
||||
}
|
||||
|
||||
|
||||
SvxJSearchOptionsDialog::~SvxJSearchOptionsDialog()
|
||||
{
|
||||
// pPage will be implicitly destroyed by the
|
||||
// SfxSingleTabDialog destructor
|
||||
}
|
||||
|
||||
|
||||
void SvxJSearchOptionsDialog::Activate()
|
||||
{
|
||||
// apply changes of transliteration in configuration
|
||||
SvxSearchItem *pItem = rDialog.pSearchItem;
|
||||
DBG_ASSERT( pItem, "SearchItem missing" );
|
||||
if (pItem)
|
||||
pPage->SetTransliterationFlags( pItem->GetTransliterationFlags() );
|
||||
}
|
||||
|
||||
|
||||
INT32 SvxJSearchOptionsDialog::GetTransliterationFlags() const
|
||||
{
|
||||
return pPage->GetTransliterationFlags();
|
||||
}
|
||||
|
||||
|
||||
void SvxJSearchOptionsDialog::SetTransliterationFlags( INT32 nSettings )
|
||||
{
|
||||
pPage->SetTransliterationFlags( nSettings );
|
||||
}
|
||||
|
||||
|
||||
// class SvxSearchDialog -------------------------------------------------
|
||||
|
||||
SvxSearchDialog::SvxSearchDialog( Window* pParent, SfxBindings& rBind ) :
|
||||
|
@ -537,6 +583,19 @@ void SvxSearchDialog::ApplyTransliterationFlags_Impl( INT32 nSettings )
|
|||
|
||||
// -----------------------------------------------------------------------
|
||||
|
||||
void SvxSearchDialog::Activate()
|
||||
{
|
||||
// apply possible transliteration changes of the SvxSearchItem member
|
||||
DBG_ASSERT( pSearchItem, "SearchItem missing" );
|
||||
if (pSearchItem)
|
||||
{
|
||||
aMatchCaseCB .Check( pSearchItem->GetExact() );
|
||||
aJapMatchFullHalfWidthCB.Check( pSearchItem->IsMatchFullHalfWidthForms() );
|
||||
}
|
||||
}
|
||||
|
||||
// -----------------------------------------------------------------------
|
||||
|
||||
void SvxSearchDialog::InitControls_Impl()
|
||||
{
|
||||
// CaseSensitives AutoComplete
|
||||
|
@ -1195,14 +1254,12 @@ IMPL_LINK( SvxSearchDialog, CommandHdl_Impl, Button *, pBtn )
|
|||
else if ( pBtn == &aJapOptionsBtn )
|
||||
{
|
||||
SfxItemSet aSet( SFX_APP()->GetPool() );
|
||||
SfxSingleTabDialog aDlg( SfxSingleTabDialog( this, aSet, RID_SVXPAGE_JSEARCH_OPTIONS ) );
|
||||
SvxJSearchOptionsPage *pPage = (SvxJSearchOptionsPage *)
|
||||
SvxJSearchOptionsPage::Create( &aDlg, aSet );
|
||||
aDlg.SetTabPage( pPage ); //! implicitly calls pPage->Reset(...)!
|
||||
pPage->EnableSaveOptions( FALSE );
|
||||
pPage->SetTransliterationFlags( GetTransliterationFlags() );
|
||||
SvxJSearchOptionsDialog aDlg( *this, aSet, RID_SVXPAGE_JSEARCH_OPTIONS );
|
||||
pSearchItem->SetTransliterationFlags( GetTransliterationFlags() );
|
||||
aDlg.Execute();
|
||||
ApplyTransliterationFlags_Impl( pPage->GetTransliterationFlags() );
|
||||
INT32 nFlags = aDlg.GetTransliterationFlags();
|
||||
pSearchItem->SetTransliterationFlags( nFlags );
|
||||
ApplyTransliterationFlags_Impl( nFlags );
|
||||
}
|
||||
|
||||
return 0;
|
||||
|
|
Loading…
Reference in a new issue