vcl/Library_vcl.mk              |    2 -
 vcl/inc/pch/precompiled_vcl.hxx |    1 
 vcl/source/control/edit.cxx     |   53 +++++-----------------------------------
 3 files changed, 8 insertions(+), 48 deletions(-)

New commits:
commit b525ef35b14ffd2f162c539cc8c62cb0934ab214
Author: Julien Nabet <serval2...@yahoo.fr>
Date:   Wed Jul 24 19:47:37 2013 +0200

    fdo#46037: no more comphelper/configurationhelper.hxx in vcl
    
    Change-Id: I809915fae3ffc117c854ec90632f70c76031aa60
    Reviewed-on: https://gerrit.libreoffice.org/5079
    Reviewed-by: Fridrich Strba <fridr...@documentfoundation.org>
    Tested-by: Fridrich Strba <fridr...@documentfoundation.org>

diff --git a/vcl/Library_vcl.mk b/vcl/Library_vcl.mk
index dd0f0e0..f5bc19f 100644
--- a/vcl/Library_vcl.mk
+++ b/vcl/Library_vcl.mk
@@ -35,7 +35,7 @@ endif
 
 $(eval $(call 
gb_Library_set_precompiled_header,vcl,$(SRCDIR)/vcl/inc/pch/precompiled_vcl))
 
-$(eval $(call gb_Library_use_custom_headers,vcl,vcl/generic/fontmanager))
+$(eval $(call gb_Library_use_custom_headers,vcl,officecfg/registry 
vcl/generic/fontmanager))
 
 $(eval $(call gb_Library_set_include,vcl,\
     $$(INCLUDE) \
diff --git a/vcl/inc/pch/precompiled_vcl.hxx b/vcl/inc/pch/precompiled_vcl.hxx
index 76d533e..921e3dc 100644
--- a/vcl/inc/pch/precompiled_vcl.hxx
+++ b/vcl/inc/pch/precompiled_vcl.hxx
@@ -270,7 +270,6 @@
 #include <com/sun/star/xml/sax/Writer.hpp>
 #include <com/sun/star/xml/sax/XDocumentHandler.hpp>
 #include <comphelper/componentcontext.hxx>
-#include <comphelper/configurationhelper.hxx>
 #include <comphelper/namedvaluecollection.hxx>
 #include <comphelper/processfactory.hxx>
 #include <comphelper/scopeguard.hxx>
diff --git a/vcl/source/control/edit.cxx b/vcl/source/control/edit.cxx
index a27fe60..260cdaa 100644
--- a/vcl/source/control/edit.cxx
+++ b/vcl/source/control/edit.cxx
@@ -55,7 +55,6 @@
 
 #include <com/sun/star/uno/Any.hxx>
 
-#include <comphelper/configurationhelper.hxx>
 #include <comphelper/processfactory.hxx>
 #include <comphelper/string.hxx>
 
@@ -66,6 +65,8 @@
 #include <vcl/unohelp.hxx>
 #include <vcl/unohelp2.hxx>
 
+#include <officecfg/Office/Common.hxx>
+
 
 
 
@@ -904,50 +905,10 @@ void Edit::ImplInsertText( const OUString& rStr, const 
Selection* pNewSel, sal_B
 
         // determine if input-sequence-checking should be applied or not
         //
-        static OUString sModule( "/org.openoffice.Office.Common/I18N" );
-        static OUString sRelNode( "CTL" );
-        static OUString sCTLSequenceChecking( "CTLSequenceChecking" );
-        static OUString sCTLSequenceCheckingRestricted( 
"CTLSequenceCheckingRestricted" );
-        static OUString sCTLSequenceCheckingTypeAndReplace( 
"CTLSequenceCheckingTypeAndReplace" );
-        static OUString sCTLFont( "CTLFont" );
-        //
-        sal_Bool bCTLSequenceChecking               = sal_False;
-        sal_Bool bCTLSequenceCheckingRestricted     = sal_False;
-        sal_Bool bCTLSequenceCheckingTypeAndReplace = sal_False;
-        sal_Bool bCTLFontEnabled                    = sal_False;
-        bool bIsInputSequenceChecking               = false;
-        //
-        // get access to the configuration of this office module
-        try
-        {
-            uno::Reference< uno::XComponentContext > xContext = 
::comphelper::getProcessComponentContext();
-            uno::Reference< container::XNameAccess > xModuleCfg( 
::comphelper::ConfigurationHelper::openConfig(
-                                    xContext,
-                                    sModule,
-                                    
::comphelper::ConfigurationHelper::E_READONLY ),
-                                uno::UNO_QUERY );
-
-            //!! get values from configuration.
-            //!! we can't use SvtCTLOptions here since vcl must not be linked
-            //!! against svtools. (It is already the other way around.)
-            Any aCTLSequenceChecking                = 
::comphelper::ConfigurationHelper::readRelativeKey( xModuleCfg, sRelNode, 
sCTLSequenceChecking );
-            Any aCTLSequenceCheckingRestricted      = 
::comphelper::ConfigurationHelper::readRelativeKey( xModuleCfg, sRelNode, 
sCTLSequenceCheckingRestricted );
-            Any aCTLSequenceCheckingTypeAndReplace  = 
::comphelper::ConfigurationHelper::readRelativeKey( xModuleCfg, sRelNode, 
sCTLSequenceCheckingTypeAndReplace );
-            Any aCTLFontEnabled                     = 
::comphelper::ConfigurationHelper::readRelativeKey( xModuleCfg, sRelNode, 
sCTLFont );
-            aCTLSequenceChecking                >>= bCTLSequenceChecking;
-            aCTLSequenceCheckingRestricted      >>= 
bCTLSequenceCheckingRestricted;
-            aCTLSequenceCheckingTypeAndReplace  >>= 
bCTLSequenceCheckingTypeAndReplace;
-            aCTLFontEnabled                     >>= bCTLFontEnabled;
-        }
-        catch(...)
-        {
-            bIsInputSequenceChecking = false;   // continue with inserting the 
new text
-        }
-        //
         uno::Reference < i18n::XBreakIterator > xBI( ImplGetBreakIterator(), 
UNO_QUERY );
-        bIsInputSequenceChecking = rStr.getLength() == 1 &&
-                bCTLFontEnabled &&
-                bCTLSequenceChecking &&
+        bool bIsInputSequenceChecking = rStr.getLength() == 1 &&
+                officecfg::Office::Common::I18N::CTL::CTLFont::get() &&
+                
officecfg::Office::Common::I18N::CTL::CTLSequenceChecking::get() &&
                 aSelection.Min() > 0 && /* first char needs not to be checked 
*/
                 xBI.is() && i18n::ScriptType::COMPLEX == xBI->getScriptType( 
rStr, 0 );
 
@@ -957,14 +918,14 @@ void Edit::ImplInsertText( const OUString& rStr, const 
Selection* pNewSel, sal_B
         {
             sal_Unicode cChar = rStr[0];
             sal_Int32 nTmpPos = static_cast< sal_Int32 >( aSelection.Min() );
-            sal_Int16 nCheckMode = bCTLSequenceCheckingRestricted ?
+            sal_Int16 nCheckMode = 
officecfg::Office::Common::I18N::CTL::CTLSequenceCheckingRestricted::get()?
                     i18n::InputSequenceCheckMode::STRICT : 
i18n::InputSequenceCheckMode::BASIC;
 
             // the text that needs to be checked is only the one
             // before the current cursor position
             OUString aOldText( maText.getStr(), nTmpPos);
             OUString aTmpText( aOldText );
-            if (bCTLSequenceCheckingTypeAndReplace)
+            if 
(officecfg::Office::Common::I18N::CTL::CTLSequenceCheckingTypeAndReplace::get())
             {
                 xISC->correctInputSequence( aTmpText, nTmpPos - 1, cChar, 
nCheckMode );
 
_______________________________________________
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

Reply via email to