[Libreoffice-commits] core.git: cui/source i18npool/inc i18npool/Library_i18npool.mk i18npool/source i18npool/util include/svx include/unotools offapi/com officecfg/registry svl/source svx/source svx/uiconfig unotools/source

abdulmajeed ahmed aalabdulrazzaq at kacst.edu.sa
Fri Jun 21 02:17:19 PDT 2013


 cui/source/options/optgdlg.cxx                                 |    3 
 i18npool/Library_i18npool.mk                                   |    1 
 i18npool/inc/transliteration_Ignore.hxx                        |    5 +
 i18npool/source/localedata/data/ar_DZ.xml                      |    2 
 i18npool/source/localedata/data/ar_EG.xml                      |   10 ++
 i18npool/source/localedata/data/ar_LB.xml                      |    2 
 i18npool/source/localedata/data/ar_OM.xml                      |    6 -
 i18npool/source/localedata/data/ar_SA.xml                      |    2 
 i18npool/source/localedata/data/ar_TN.xml                      |    2 
 i18npool/source/registerservices/registerservices.cxx          |    2 
 i18npool/source/transliteration/ignoreDiacritics_CTL.cxx       |   45 ++++++++++
 i18npool/source/transliteration/transliterationImpl.cxx        |    7 +
 i18npool/util/i18npool.component                               |    3 
 include/svx/srchdlg.hxx                                        |    2 
 include/unotools/searchopt.hxx                                 |    2 
 offapi/com/sun/star/i18n/TransliterationModulesExtra.idl       |    3 
 officecfg/registry/schema/org/openoffice/Office/Common.xcs     |    9 ++
 officecfg/registry/schema/org/openoffice/Office/DataAccess.xcs |    6 +
 svl/source/items/srchitem.cxx                                  |    6 +
 svx/source/dialog/srchdlg.cxx                                  |   30 +++++-
 svx/uiconfig/ui/findreplacedialog.ui                           |   17 +++
 unotools/source/config/searchopt.cxx                           |   19 +++-
 22 files changed, 162 insertions(+), 22 deletions(-)

New commits:
commit 448fa131b2dafac305d88480e469cc4bc0515d68
Author: abdulmajeed ahmed <aalabdulrazzaq at kacst.edu.sa>
Date:   Fri Jun 21 11:07:34 2013 +0200

    Fix fdo#52204 add new feature ignore diacritics in search for CTL
    
    Change-Id: Ie9044a35003217545bacea214ef59047bff3b8b1

diff --git a/cui/source/options/optgdlg.cxx b/cui/source/options/optgdlg.cxx
index 12a46f0..729ed7c 100644
--- a/cui/source/options/optgdlg.cxx
+++ b/cui/source/options/optgdlg.cxx
@@ -65,6 +65,7 @@
 #include <dialmgr.hxx>
 #include <svtools/helpopt.hxx>
 #include <unotools/saveopt.hxx>
+#include <unotools/searchopt.hxx>
 #include <sal/macros.h>
 
 #include <com/sun/star/configuration/theDefaultProvider.hpp>
@@ -1396,6 +1397,8 @@ sal_Bool OfaLanguagesTabPage::FillItemSet( SfxItemSet& rSet )
 
     if ( m_pCTLSupportCB->GetSavedValue() != m_pCTLSupportCB->IsChecked() )
     {
+        SvtSearchOptions aOpt;
+        aOpt.SetIgnoreDiacritics_CTL (true);
         pLangConfig->aLanguageOptions.SetCTLFontEnabled( m_pCTLSupportCB->IsChecked() );
 
         const sal_uInt16 STATE_COUNT = 1;
diff --git a/i18npool/Library_i18npool.mk b/i18npool/Library_i18npool.mk
index b578664..158f93f 100644
--- a/i18npool/Library_i18npool.mk
+++ b/i18npool/Library_i18npool.mk
@@ -93,6 +93,7 @@ $(eval $(call gb_Library_add_exception_objects,i18npool,\
 	i18npool/source/transliteration/ignoreTraditionalKanji_ja_JP \
 	i18npool/source/transliteration/ignoreWidth \
 	i18npool/source/transliteration/ignoreZiZu_ja_JP \
+	i18npool/source/transliteration/ignoreDiacritics_CTL \
 	i18npool/source/transliteration/katakanaToHiragana \
 	i18npool/source/transliteration/largeToSmall_ja_JP \
 	i18npool/source/transliteration/numtochar \
diff --git a/i18npool/inc/transliteration_Ignore.hxx b/i18npool/inc/transliteration_Ignore.hxx
index 26f9252..e66e16a 100644
--- a/i18npool/inc/transliteration_Ignore.hxx
+++ b/i18npool/inc/transliteration_Ignore.hxx
@@ -113,6 +113,11 @@ TRANSLITERATION_IGNORE(TraditionalKanji_ja_JP)
 #if defined( TRANSLITERATION_ZiZu_ja_JP ) || defined( TRANSLITERATION_ALL )
 TRANSLITERATION_IGNORE(ZiZu_ja_JP)
 #endif
+
+#if defined( TRANSLITERATION_Diacritics_CTL ) || defined( TRANSLITERATION_ALL )
+TRANSLITERATION_IGNORE(Diacritics_CTL)
+#endif
+
 #undef TRANSLITERATION_IGNORE
 
 #define TRANSLITERATION_IGNORE( name ) \
diff --git a/i18npool/source/localedata/data/ar_DZ.xml b/i18npool/source/localedata/data/ar_DZ.xml
index c3c3be7..bb63392 100644
--- a/i18npool/source/localedata/data/ar_DZ.xml
+++ b/i18npool/source/localedata/data/ar_DZ.xml
@@ -453,7 +453,7 @@
       <DecimalPlaces>2</DecimalPlaces>
     </Currency>
   </LC_CURRENCY>
-  <LC_TRANSLITERATION ref="en_US"/>
+  <LC_TRANSLITERATION ref="ar_EG"/>
   <LC_MISC ref="ar_EG"/>
   <LC_NumberingLevel ref="ar_EG"/>
   <LC_OutLineNumberingLevel ref="ar_EG"/>
diff --git a/i18npool/source/localedata/data/ar_EG.xml b/i18npool/source/localedata/data/ar_EG.xml
index defa49e..662a913 100644
--- a/i18npool/source/localedata/data/ar_EG.xml
+++ b/i18npool/source/localedata/data/ar_EG.xml
@@ -458,7 +458,15 @@
       <DecimalPlaces>2</DecimalPlaces>
     </Currency>
   </LC_CURRENCY>
-  <LC_TRANSLITERATION ref="en_US"/>
+  <LC_TRANSLITERATION>
+    <Transliteration unoid="SENTENCE_CASE"/>
+    <Transliteration unoid="LOWERCASE_UPPERCASE"/>
+    <Transliteration unoid="UPPERCASE_LOWERCASE"/>
+    <Transliteration unoid="TITLE_CASE"/>
+    <Transliteration unoid="TOGGLE_CASE"/>
+    <Transliteration unoid="IGNORE_CASE"/>
+    <Transliteration unoid="ignoreDiacritics_CTL"/>
+  </LC_TRANSLITERATION>
   <LC_MISC>
     <ReservedWords>
       <trueWord>صح</trueWord>
diff --git a/i18npool/source/localedata/data/ar_LB.xml b/i18npool/source/localedata/data/ar_LB.xml
index 86aba61..9499dfb 100644
--- a/i18npool/source/localedata/data/ar_LB.xml
+++ b/i18npool/source/localedata/data/ar_LB.xml
@@ -300,7 +300,7 @@
       <DecimalPlaces>2</DecimalPlaces>
     </Currency>
   </LC_CURRENCY>
-  <LC_TRANSLITERATION ref="en_US"/>
+  <LC_TRANSLITERATION ref="ar_EG"/>
   <LC_MISC ref="ar_EG"/>
   <LC_NumberingLevel ref="ar_EG"/>
   <LC_OutLineNumberingLevel ref="ar_EG"/>
diff --git a/i18npool/source/localedata/data/ar_OM.xml b/i18npool/source/localedata/data/ar_OM.xml
index d293046..5c4bfd7 100644
--- a/i18npool/source/localedata/data/ar_OM.xml
+++ b/i18npool/source/localedata/data/ar_OM.xml
@@ -341,11 +341,7 @@
       <DecimalPlaces>2</DecimalPlaces>
     </Currency>
   </LC_CURRENCY>
-  <LC_TRANSLITERATION>
-    <Transliteration unoid="LOWERCASE_UPPERCASE"/>
-    <Transliteration unoid="UPPERCASE_LOWERCASE"/>
-    <Transliteration unoid="IGNORE_CASE"/>
-  </LC_TRANSLITERATION>
+  <LC_TRANSLITERATION ref="ar_EG"/>
   <LC_MISC>
     <ReservedWords>
       <trueWord>صحيح</trueWord>
diff --git a/i18npool/source/localedata/data/ar_SA.xml b/i18npool/source/localedata/data/ar_SA.xml
index 01b596c..05f0fb8 100644
--- a/i18npool/source/localedata/data/ar_SA.xml
+++ b/i18npool/source/localedata/data/ar_SA.xml
@@ -300,7 +300,7 @@
       <DecimalPlaces>2</DecimalPlaces>
     </Currency>
   </LC_CURRENCY>
-  <LC_TRANSLITERATION ref="en_US"/>
+  <LC_TRANSLITERATION ref="ar_EG"/>
   <LC_MISC ref="ar_EG"/>
   <LC_NumberingLevel ref="ar_EG"/>
   <LC_OutLineNumberingLevel ref="ar_EG"/>
diff --git a/i18npool/source/localedata/data/ar_TN.xml b/i18npool/source/localedata/data/ar_TN.xml
index b69ad31..014f775 100644
--- a/i18npool/source/localedata/data/ar_TN.xml
+++ b/i18npool/source/localedata/data/ar_TN.xml
@@ -300,7 +300,7 @@
       <DecimalPlaces>3</DecimalPlaces>
     </Currency>
   </LC_CURRENCY>
-  <LC_TRANSLITERATION ref="en_US"/>
+  <LC_TRANSLITERATION ref="ar_EG"/>
   <LC_MISC ref="ar_EG"/>
   <LC_NumberingLevel ref="ar_EG"/>
   <LC_OutLineNumberingLevel ref="ar_EG"/>
diff --git a/i18npool/source/registerservices/registerservices.cxx b/i18npool/source/registerservices/registerservices.cxx
index b9c19b0..ca87c02 100644
--- a/i18npool/source/registerservices/registerservices.cxx
+++ b/i18npool/source/registerservices/registerservices.cxx
@@ -190,6 +190,7 @@ IMPL_CREATEINSTANCE( ignoreSize_ja_JP)
 IMPL_CREATEINSTANCE( ignoreProlongedSoundMark_ja_JP)
 IMPL_CREATEINSTANCE( ignoreMiddleDot_ja_JP)
 IMPL_CREATEINSTANCE( ignoreSpace_ja_JP)
+IMPL_CREATEINSTANCE( ignoreDiacritics_CTL)
 
 IMPL_CREATEINSTANCE( TextToChuyin_zh_TW )
 IMPL_CREATEINSTANCE( TextToPinyin_zh_CN )
@@ -465,6 +466,7 @@ static const struct InstancesArray {
     IMPL_TRANSLITERATION_ITEM (ignoreSpace_ja_JP),
     IMPL_TRANSLITERATION_ITEM (TextToPinyin_zh_CN),
     IMPL_TRANSLITERATION_ITEM (TextToChuyin_zh_TW),
+    IMPL_TRANSLITERATION_ITEM( ignoreDiacritics_CTL),
 
     IMPL_TRANSLITERATION_ITEM (NumToCharUpper_zh_CN),
     IMPL_TRANSLITERATION_ITEM (NumToCharLower_zh_CN),
diff --git a/i18npool/source/transliteration/ignoreDiacritics_CTL.cxx b/i18npool/source/transliteration/ignoreDiacritics_CTL.cxx
new file mode 100644
index 0000000..f4de2c5
--- /dev/null
+++ b/i18npool/source/transliteration/ignoreDiacritics_CTL.cxx
@@ -0,0 +1,45 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ */
+
+#define TRANSLITERATION_Diacritics_CTL
+#include <transliteration_Ignore.hxx>
+
+namespace com { namespace sun { namespace star { namespace i18n {
+
+sal_Unicode
+ignoreDiacritics_CTL_translator (const sal_Unicode c)
+{
+    switch (c) {
+        //Arabic Diacritics
+        case 0x064B:
+        case 0x064C:
+        case 0x064D:
+        case 0x064E:
+        case 0x064F:
+        case 0x0650:
+        case 0x0651:
+        case 0x0652:
+        // no break;
+        return 0xffff; // Skip this character
+    }
+    return c;
+}
+
+ignoreDiacritics_CTL::ignoreDiacritics_CTL()
+{
+    func = ignoreDiacritics_CTL_translator;
+    table = 0;
+    map = 0;
+    transliterationName = "ignoreDiacritics_CTL";
+    implementationName = "com.sun.star.i18n.Transliteration.ignoreDiacritics_CTL";
+}
+
+} } } }
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/i18npool/source/transliteration/transliterationImpl.cxx b/i18npool/source/transliteration/transliterationImpl.cxx
index e8f3f2c..fddb41c 100644
--- a/i18npool/source/transliteration/transliterationImpl.cxx
+++ b/i18npool/source/transliteration/transliterationImpl.cxx
@@ -23,6 +23,7 @@
 
 #include <com/sun/star/i18n/LocaleData.hpp>
 #include <com/sun/star/i18n/TransliterationType.hpp>
+#include <com/sun/star/i18n/TransliterationModulesExtra.hpp>
 #include <com/sun/star/lang/XComponent.hpp>
 
 #include <comphelper/processfactory.hxx>
@@ -191,6 +192,12 @@ TransliterationImpl::loadModule( TransliterationModules modType, const Locale& r
                                                 bodyCascade[numCascade], rLocale))
                     numCascade++;
         }
+        // additional transliterations from TranslationModuleExtra (we cannot extend TransliterationModule)
+        if (modType & TransliterationModulesExtra::ignoreDiacritics_CTL)
+        {
+            if (loadModuleByName(OUString("ignoreDiacritics_CTL"), bodyCascade[numCascade], rLocale))
+                numCascade++;
+        }
     } else if (modType&TransliterationModules_NON_IGNORE_MASK) {
         for (sal_Int16 i = 0; TMlist[i].tm; i++) {
             if (TMlist[i].tm == modType) {
diff --git a/i18npool/util/i18npool.component b/i18npool/util/i18npool.component
index 7f96470..559d0bf 100644
--- a/i18npool/util/i18npool.component
+++ b/i18npool/util/i18npool.component
@@ -472,4 +472,7 @@
   <implementation name="com.sun.star.text.DefaultNumberingProvider">
     <service name="com.sun.star.text.DefaultNumberingProvider"/>
   </implementation>
+  <implementation name="com.sun.star.i18n.Transliteration.ignoreDiacritics_CTL">
+    <service name="com.sun.star.i18n.Transliteration.l10n"/>
+  </implementation>
 </component>
diff --git a/include/svx/srchdlg.hxx b/include/svx/srchdlg.hxx
index 60cf509..a06d209 100644
--- a/include/svx/srchdlg.hxx
+++ b/include/svx/srchdlg.hxx
@@ -164,7 +164,7 @@ private:
     CheckBox*       m_pWordBtn;
 
     PushButton*     m_pCloseBtn;
-
+    CheckBox*       m_pIgnoreDiacritics;
     CheckBox*       m_pSelectionBtn;
     CheckBox*       m_pBackwardsBtn;
     CheckBox*       m_pRegExpBtn;
diff --git a/include/unotools/searchopt.hxx b/include/unotools/searchopt.hxx
index 0ce76a8..a808c88 100644
--- a/include/unotools/searchopt.hxx
+++ b/include/unotools/searchopt.hxx
@@ -84,6 +84,7 @@ public:
     sal_Bool    IsIgnoreWhitespace() const;
     sal_Bool    IsIgnoreProlongedSoundMark() const;
     sal_Bool    IsIgnoreMiddleDot() const;
+    sal_Bool    IsIgnoreDiacritics_CTL() const;
 
     void    SetMatchFullHalfWidthForms( sal_Bool bVal );
     void    SetMatchHiraganaKatakana( sal_Bool bVal );
@@ -103,6 +104,7 @@ public:
     void    SetIgnoreWhitespace( sal_Bool bVal );
     void    SetIgnoreProlongedSoundMark( sal_Bool bVal );
     void    SetIgnoreMiddleDot( sal_Bool bVal );
+    void    SetIgnoreDiacritics_CTL( sal_Bool bVal );
 };
 
 
diff --git a/offapi/com/sun/star/i18n/TransliterationModulesExtra.idl b/offapi/com/sun/star/i18n/TransliterationModulesExtra.idl
index f1e3363..45f7ccb 100644
--- a/offapi/com/sun/star/i18n/TransliterationModulesExtra.idl
+++ b/offapi/com/sun/star/i18n/TransliterationModulesExtra.idl
@@ -50,7 +50,8 @@ constants TransliterationModulesExtra
      */
     const short TOGGLE_CASE = 202;
 
-
+    /// because we cannot extend TransliterationModule we used TranslationModuleExtra and it will act the same way
+    const long ignoreDiacritics_CTL   = 0x40000000;
     const long END_OF_MODULE    = 0;
 };
 
diff --git a/officecfg/registry/schema/org/openoffice/Office/Common.xcs b/officecfg/registry/schema/org/openoffice/Office/Common.xcs
index 1d64c93..30f305c 100644
--- a/officecfg/registry/schema/org/openoffice/Office/Common.xcs
+++ b/officecfg/registry/schema/org/openoffice/Office/Common.xcs
@@ -5900,6 +5900,15 @@
         </info>
         <value>false</value>
       </prop>
+      <prop oor:name="IsIgnoreDiacritics_CTL" oor:type="xs:boolean" oor:nillable="false">
+        <!-- OldPath: -->
+        <!-- OldLocation: -->
+        <!-- UIHints: Edit/Find & Replace -->
+        <info>
+          <desc>Specifies search with the use of CTL option.</desc>
+        </info>
+        <value>true</value>
+      </prop>
       <prop oor:name="IsUseAsianOptions" oor:type="xs:boolean" oor:nillable="false">
         <!-- OldPath: -->
         <!-- OldLocation: -->
diff --git a/officecfg/registry/schema/org/openoffice/Office/DataAccess.xcs b/officecfg/registry/schema/org/openoffice/Office/DataAccess.xcs
index a2217b6..7009d32 100644
--- a/officecfg/registry/schema/org/openoffice/Office/DataAccess.xcs
+++ b/officecfg/registry/schema/org/openoffice/Office/DataAccess.xcs
@@ -952,6 +952,12 @@
         </info>
         <value>false</value>
       </prop>
+      <prop oor:name="IsIgnoreDiacritics_CTL" oor:type="xs:boolean" oor:nillable="false">
+        <info>
+          <desc>Specifies search with the use of CTL option.</desc>
+        </info>
+        <value>true</value>
+      </prop>
       <prop oor:name="IsUseAsianOptions" oor:type="xs:boolean" oor:nillable="false">
         <info>
           <desc>Specifies that the Asian options for search should be used.</desc>
diff --git a/svl/source/items/srchitem.cxx b/svl/source/items/srchitem.cxx
index f094b53..c3ad82c 100644
--- a/svl/source/items/srchitem.cxx
+++ b/svl/source/items/srchitem.cxx
@@ -29,6 +29,7 @@
 #include <com/sun/star/lang/Locale.hpp>
 #include <svl/memberid.hrc>
 #include <i18nlangtag/languagetag.hxx>
+#include <com/sun/star/i18n/TransliterationModulesExtra.hpp>
 
 using namespace utl;
 using namespace com::sun::star::beans;
@@ -82,7 +83,8 @@ static Sequence< OUString > lcl_GetNotifyNames()
         "Japanese/IsIgnorePunctuation",         // 15
         "Japanese/IsIgnoreWhitespace",          // 16
         "Japanese/IsIgnoreProlongedSoundMark",  // 17
-        "Japanese/IsIgnoreMiddleDot"            // 18
+        "Japanese/IsIgnoreMiddleDot",           // 18
+        "IsIgnoreDiacritics_CTL"                // 19
     };
 
     const int nCount = SAL_N_ELEMENTS( aTranslitNames );
@@ -141,6 +143,8 @@ SvxSearchItem::SvxSearchItem( const sal_uInt16 nId ) :
         rFlags |= TransliterationModules_IGNORE_CASE;
     if ( aOpt.IsMatchFullHalfWidthForms())
         rFlags |= TransliterationModules_IGNORE_WIDTH;
+    if ( aOpt.IsIgnoreDiacritics_CTL())
+        rFlags |= TransliterationModulesExtra::ignoreDiacritics_CTL ;
     if ( bAsianOptions )
     {
         if ( aOpt.IsMatchHiraganaKatakana())
diff --git a/svx/source/dialog/srchdlg.cxx b/svx/source/dialog/srchdlg.cxx
index 7b37136..5cfb992 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 1fef7c6..f654796 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>
diff --git a/unotools/source/config/searchopt.cxx b/unotools/source/config/searchopt.cxx
index fa44fbf..228a7b9 100644
--- a/unotools/source/config/searchopt.cxx
+++ b/unotools/source/config/searchopt.cxx
@@ -23,6 +23,7 @@
 #include <tools/debug.hxx>
 #include <unotools/configitem.hxx>
 #include <com/sun/star/i18n/TransliterationModules.hpp>
+#include <com/sun/star/i18n/TransliterationModulesExtra.hpp>
 #include <com/sun/star/uno/Sequence.hxx>
 #include <com/sun/star/uno/Any.h>
 #include <rtl/logfile.hxx>
@@ -34,7 +35,7 @@ using namespace com::sun::star::uno;
 using namespace com::sun::star::i18n;
 
 
-#define MAX_FLAGS_OFFSET    25
+#define MAX_FLAGS_OFFSET    26
 
 //////////////////////////////////////////////////////////////////////
 
@@ -159,7 +160,8 @@ Sequence< OUString > SvtSearchOptions_Impl::GetPropertyNames() const
         "Japanese/IsIgnoreWhitespace",          // 22
         "Japanese/IsIgnoreProlongedSoundMark",      // 23
         "Japanese/IsIgnoreMiddleDot",           // 24
-        "IsNotes"                   // 25
+        "IsNotes",                              // 25
+        "IsIgnoreDiacritics_CTL"                // 26
     };
 
     const int nCount = SAL_N_ELEMENTS( aPropNames );
@@ -308,7 +310,8 @@ sal_Int32 SvtSearchOptions::GetTransliterationFlags() const
         nRes |= TransliterationModules_ignoreProlongedSoundMark_ja_JP;
     if ( IsIgnoreMiddleDot())
         nRes |= TransliterationModules_ignoreMiddleDot_ja_JP;
-
+    if ( IsIgnoreDiacritics_CTL())
+        nRes |= TransliterationModulesExtra::ignoreDiacritics_CTL;
     return nRes;
 }
 
@@ -616,6 +619,16 @@ void SvtSearchOptions::SetNotes( sal_Bool bVal )
         pImpl->SetFlag( 25, bVal );
 }
 
+sal_Bool SvtSearchOptions::IsIgnoreDiacritics_CTL() const
+{
+    return pImpl->GetFlag( 26 );
+}
+
+void SvtSearchOptions::SetIgnoreDiacritics_CTL( sal_Bool bVal )
+{
+    pImpl->SetFlag( 26, bVal );
+}
+
 //////////////////////////////////////////////////////////////////////
 
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */


More information about the Libreoffice-commits mailing list