diff options
author | abdulmajeed ahmed <aalabdulrazzaq@kacst.edu.sa> | 2013-06-21 11:07:34 +0200 |
---|---|---|
committer | abdulmajeed ahmed <aalabdulrazzaq@kacst.edu.sa> | 2013-06-21 11:14:17 +0200 |
commit | 448fa131b2dafac305d88480e469cc4bc0515d68 (patch) | |
tree | 4f8f94215ce38a9c7ccb0d3edb4af3bb62aa5b38 /svx | |
parent | 832612bb6bd013cf68a64e33827158f96e6d03d3 (diff) |
Fix fdo#52204 add new feature ignore diacritics in search for CTL
Change-Id: Ie9044a35003217545bacea214ef59047bff3b8b1
Diffstat (limited to 'svx')
-rw-r--r-- | svx/source/dialog/srchdlg.cxx | 30 | ||||
-rw-r--r-- | svx/uiconfig/ui/findreplacedialog.ui | 17 |
2 files changed, 41 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 ) diff --git a/svx/uiconfig/ui/findreplacedialog.ui b/svx/uiconfig/ui/findreplacedialog.ui index 1fef7c62fcc6..f65479626be5 100644 --- a/svx/uiconfig/ui/findreplacedialog.ui +++ b/svx/uiconfig/ui/findreplacedialog.ui @@ -746,6 +746,23 @@ <property name="height">1</property> </packing> </child> + <child> + <object class="GtkCheckButton" id="ignorediacritics"> + <property name="label" translatable="yes">Ignore diacritics CTL</property> + <property name="visible">True</property> + <property name="can_focus">True</property> + <property name="receives_default">False</property> + <property name="use_underline">True</property> + <property name="xalign">0</property> + <property name="draw_indicator">True</property> + </object> + <packing> + <property name="left_attach">0</property> + <property name="top_attach">8</property> + <property name="width">1</property> + <property name="height">1</property> + </packing> + </child> </object> <packing> <property name="expand">False</property> |