summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJulien Nabet <serval2412@yahoo.fr>2013-07-24 19:47:37 +0200
committerFridrich Strba <fridrich@documentfoundation.org>2013-07-24 20:17:47 +0000
commitb525ef35b14ffd2f162c539cc8c62cb0934ab214 (patch)
tree64d1d6e9195f0e5773b57d80d3cd871e58ac4700
parentbd242a8768b8e2f457af581c782ef8a9f2ba0be7 (diff)
fdo#46037: no more comphelper/configurationhelper.hxx in vcl
Change-Id: I809915fae3ffc117c854ec90632f70c76031aa60 Reviewed-on: https://gerrit.libreoffice.org/5079 Reviewed-by: Fridrich Strba <fridrich@documentfoundation.org> Tested-by: Fridrich Strba <fridrich@documentfoundation.org>
-rw-r--r--vcl/Library_vcl.mk2
-rw-r--r--vcl/inc/pch/precompiled_vcl.hxx1
-rw-r--r--vcl/source/control/edit.cxx53
3 files changed, 8 insertions, 48 deletions
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 <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 a27fe60045c0..260cdaa65d9f 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 );