diff options
Diffstat (limited to 'svx/source/dialog/srchdlg.cxx')
-rw-r--r-- | svx/source/dialog/srchdlg.cxx | 30 |
1 files changed, 24 insertions, 6 deletions
diff --git a/svx/source/dialog/srchdlg.cxx b/svx/source/dialog/srchdlg.cxx index 7b371363fc25..5cfb9928b514 100644 --- a/svx/source/dialog/srchdlg.cxx +++ b/svx/source/dialog/srchdlg.cxx @@ -33,8 +33,10 @@ #include <sfx2/viewsh.hxx> #include <sfx2/basedlgs.hxx> #include <svl/cjkoptions.hxx> +#include <svl/ctloptions.hxx> #include <com/sun/star/container/XNameAccess.hpp> #include <com/sun/star/i18n/TransliterationModules.hpp> +#include <com/sun/star/i18n/TransliterationModulesExtra.hpp> #include <com/sun/star/frame/XDispatch.hpp> #include <com/sun/star/frame/XDispatchProvider.hpp> #include <com/sun/star/beans/PropertyValue.hpp> @@ -298,6 +300,7 @@ SvxSearchDialog::SvxSearchDialog( Window* pParent, SfxChildWindow* pChildWin, Sf get(m_pCloseBtn, "close"); + get(m_pIgnoreDiacritics, "ignorediacritics"); get(m_pSelectionBtn, "selection"); get(m_pBackwardsBtn, "backwards"); get(m_pRegExpBtn, "regexp"); @@ -415,7 +418,12 @@ void SvxSearchDialog::Construct_Impl() { m_pJapMatchFullHalfWidthCB->Hide(); } - + SvtCTLOptions aCTLOptions; + if(!aCTLOptions.IsCTLFontEnabled()) + { + m_pIgnoreDiacritics->Check( sal_False ); + m_pIgnoreDiacritics->Hide(); + } //component extension - show component search buttons if the commands // vnd.sun.star::SearchViaComponent1 and 2 are supported const uno::Reference< frame::XFrame >xFrame = rBindings.GetActiveFrame(); @@ -499,6 +507,7 @@ sal_Bool SvxSearchDialog::Close() aOpt.SetSimilaritySearch ( m_pSimilarityBox->IsChecked() ); aOpt.SetUseAsianOptions ( m_pJapOptionsCB->IsChecked() ); aOpt.SetNotes ( m_pNotesBtn->IsChecked() ); + aOpt.SetIgnoreDiacritics_CTL ( m_pIgnoreDiacritics->IsChecked() ); const SfxPoolItem* ppArgs[] = { pSearchItem, 0 }; rBindings.GetDispatcher()->Execute( FID_SEARCH_OFF, SFX_CALLMODE_SLOT, ppArgs ); @@ -602,7 +611,7 @@ void SvxSearchDialog::InitControls_Impl() m_pSimilarityBox->SetClickHdl( aLink ); m_pJapOptionsCB->SetClickHdl( aLink ); m_pJapMatchFullHalfWidthCB->SetClickHdl( aLink ); - + m_pIgnoreDiacritics->SetClickHdl( aLink ); m_pLayoutBtn->SetClickHdl( LINK( this, SvxSearchDialog, TemplateHdl_Impl ) ); m_pFormatBtn->SetClickHdl( LINK( this, SvxSearchDialog, FormatHdl_Impl ) ); m_pNoFormatBtn->SetClickHdl( @@ -638,7 +647,7 @@ void SvxSearchDialog::ShowOptionalControls_Impl() DBG_ASSERT( pSearchItem, "no search item" ); SvtCJKOptions aCJKOptions; - + SvtCTLOptions aCTLOptions; SvtModuleOptions::EFactory eFactory = getModule(rBindings); bool bDrawApp = eFactory == SvtModuleOptions::E_DRAW; bool bWriterApp = @@ -654,7 +663,7 @@ void SvxSearchDialog::ShowOptionalControls_Impl() m_pSimilarityBox->Show(); m_pSimilarityBtn->Show(); m_pSelectionBtn->Show(); - + m_pIgnoreDiacritics->Show(aCTLOptions.IsCTLFontEnabled()); m_pJapMatchFullHalfWidthCB->Show(aCJKOptions.IsCJKFontEnabled()); m_pJapOptionsCB->Show(aCJKOptions.IsJapaneseFindEnabled()); m_pJapOptionsBtn->Show(aCJKOptions.IsJapaneseFindEnabled()); @@ -708,6 +717,7 @@ void SvxSearchDialog::Init_Impl( int bSearchPattern ) // We don't want to save any intermediate state to the module while the // dialog is being initialized. ToggleSaveToModule aNoModuleSave(*this, false); + SvtSearchOptions aOpt; bWriter = ( pSearchItem->GetAppFlag() == SVX_SEARCHAPP_WRITER ); @@ -755,6 +765,8 @@ void SvxSearchDialog::Init_Impl( int bSearchPattern ) m_pSimilarityBox->Check( pSearchItem->IsLevenshtein() ); if( m_pJapOptionsCB->IsVisible() ) m_pJapOptionsCB->Check( pSearchItem->IsUseAsianOptions() ); + if (m_pIgnoreDiacritics->IsVisible()) + m_pIgnoreDiacritics->Check( aOpt.IsIgnoreDiacritics_CTL() ); ApplyTransliterationFlags_Impl( pSearchItem->GetTransliterationFlags() ); ShowOptionalControls_Impl(); @@ -1243,12 +1255,13 @@ IMPL_LINK( SvxSearchDialog, CommandHdl_Impl, Button *, pBtn ) pSearchItem->SetNotes(GetCheckBoxValue(m_pNotesBtn)); pSearchItem->SetPattern(GetCheckBoxValue(m_pLayoutBtn)); pSearchItem->SetSelection(GetCheckBoxValue(m_pSelectionBtn)); - pSearchItem->SetUseAsianOptions(GetCheckBoxValue(m_pJapOptionsCB)); sal_Int32 nFlags = GetTransliterationFlags(); if( !pSearchItem->IsUseAsianOptions()) nFlags &= (TransliterationModules_IGNORE_CASE | TransliterationModules_IGNORE_WIDTH ); + if (GetCheckBoxValue(m_pIgnoreDiacritics)) + nFlags |= TransliterationModulesExtra::ignoreDiacritics_CTL; pSearchItem->SetTransliterationFlags( nFlags ); if ( !bWriter ) @@ -2227,12 +2240,17 @@ void SvxSearchDialog::SaveToModule_Impl() pSearchItem->SetNotes(GetCheckBoxValue(m_pNotesBtn)); pSearchItem->SetPattern(GetCheckBoxValue(m_pLayoutBtn)); pSearchItem->SetSelection(GetCheckBoxValue(m_pSelectionBtn)); - pSearchItem->SetUseAsianOptions(GetCheckBoxValue(m_pJapOptionsCB)); + + SvtSearchOptions aOpt; + aOpt.SetIgnoreDiacritics_CTL(GetCheckBoxValue(m_pIgnoreDiacritics)); + sal_Int32 nFlags = GetTransliterationFlags(); if( !pSearchItem->IsUseAsianOptions()) nFlags &= (TransliterationModules_IGNORE_CASE | TransliterationModules_IGNORE_WIDTH ); + if (GetCheckBoxValue(m_pIgnoreDiacritics)) + nFlags |= TransliterationModulesExtra::ignoreDiacritics_CTL; pSearchItem->SetTransliterationFlags( nFlags ); if ( !bWriter ) |