From b525ef35b14ffd2f162c539cc8c62cb0934ab214 Mon Sep 17 00:00:00 2001 From: Julien Nabet Date: Wed, 24 Jul 2013 19:47:37 +0200 Subject: fdo#46037: no more comphelper/configurationhelper.hxx in vcl Change-Id: I809915fae3ffc117c854ec90632f70c76031aa60 Reviewed-on: https://gerrit.libreoffice.org/5079 Reviewed-by: Fridrich Strba Tested-by: Fridrich Strba --- 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(-) (limited to 'vcl') diff --git a/vcl/Library_vcl.mk b/vcl/Library_vcl.mk index dd0f0e0a05d0..f5bc19f95852 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 76d533e9f6be..921e3dc4a531 100644 --- a/vcl/inc/pch/precompiled_vcl.hxx +++ b/vcl/inc/pch/precompiled_vcl.hxx @@ -270,7 +270,6 @@ #include #include #include -#include #include #include #include diff --git a/vcl/source/control/edit.cxx b/vcl/source/control/edit.cxx index a27fe60045c0..260cdaa65d9f 100644 --- a/vcl/source/control/edit.cxx +++ b/vcl/source/control/edit.cxx @@ -55,7 +55,6 @@ #include -#include #include #include @@ -66,6 +65,8 @@ #include #include +#include + @@ -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 ); -- cgit v1.2.3