[Libreoffice-commits] core.git: editeng/source svl/source sw/source unotools/source

Caolán McNamara caolanm at redhat.com
Thu Aug 20 08:30:42 PDT 2015


 editeng/source/editeng/editeng.cxx          |   24 +++++++++---------------
 editeng/source/editeng/impedit.hxx          |    4 ++--
 editeng/source/editeng/impedit2.cxx         |    4 ----
 svl/source/numbers/zforlist.cxx             |    5 ++++-
 sw/source/core/doc/docfmt.cxx               |    4 +++-
 unotools/source/config/syslocaleoptions.cxx |    4 ++--
 unotools/source/misc/syslocale.cxx          |   11 +----------
 7 files changed, 21 insertions(+), 35 deletions(-)

New commits:
commit 77dc6b346ad56b38ec41dc39887388d86548b712
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Thu Aug 20 14:14:11 2015 +0100

    tweak config-less sysconfig path
    
    Change-Id: I9b93b740aab2e6e2a19612d8ec41e699c1032e9e

diff --git a/editeng/source/editeng/editeng.cxx b/editeng/source/editeng/editeng.cxx
index ea3a5f9..910b487 100644
--- a/editeng/source/editeng/editeng.cxx
+++ b/editeng/source/editeng/editeng.cxx
@@ -1294,24 +1294,18 @@ bool EditEngine::PostKeyEvent( const KeyEvent& rKeyEvent, EditView* pEditView, v
                                 LanguageType eLang = pImpEditEngine->GetLanguage( EditPaM( aStart.GetNode(), aStart.GetIndex()+1));
                                 LanguageTag aLanguageTag( eLang);
 
-                                if (!pImpEditEngine->pLocaleDataWrapper)
-                                    pImpEditEngine->pLocaleDataWrapper = new OnDemandLocaleDataWrapper;
-
-                                if (!pImpEditEngine->pLocaleDataWrapper->isInitialized())
-                                    pImpEditEngine->pLocaleDataWrapper->init( SvtSysLocale().GetLocaleData().getComponentContext(), aLanguageTag);
+                                if (!pImpEditEngine->xLocaleDataWrapper.isInitialized())
+                                    pImpEditEngine->xLocaleDataWrapper.init( SvtSysLocale().GetLocaleData().getComponentContext(), aLanguageTag);
                                 else
-                                    pImpEditEngine->pLocaleDataWrapper->changeLocale( aLanguageTag);
-
-                                if (!pImpEditEngine->pTransliterationWrapper)
-                                    pImpEditEngine->pTransliterationWrapper = new OnDemandTransliterationWrapper;
+                                    pImpEditEngine->xLocaleDataWrapper.changeLocale( aLanguageTag);
 
-                                if (!pImpEditEngine->pTransliterationWrapper->isInitialized())
-                                    pImpEditEngine->pTransliterationWrapper->init( SvtSysLocale().GetLocaleData().getComponentContext(), eLang, i18n::TransliterationModules_IGNORE_CASE);
+                                if (!pImpEditEngine->xTransliterationWrapper.isInitialized())
+                                    pImpEditEngine->xTransliterationWrapper.init( SvtSysLocale().GetLocaleData().getComponentContext(), eLang, i18n::TransliterationModules_IGNORE_CASE);
                                 else
-                                    pImpEditEngine->pTransliterationWrapper->changeLocale( eLang);
+                                    pImpEditEngine->xTransliterationWrapper.changeLocale( eLang);
 
-                                const ::utl::TransliterationWrapper* pTransliteration = pImpEditEngine->pTransliterationWrapper->get();
-                                Sequence< i18n::CalendarItem2 > xItem = pImpEditEngine->pLocaleDataWrapper->get()->getDefaultCalendarDays();
+                                const ::utl::TransliterationWrapper* pTransliteration = pImpEditEngine->xTransliterationWrapper.get();
+                                Sequence< i18n::CalendarItem2 > xItem = pImpEditEngine->xLocaleDataWrapper->getDefaultCalendarDays();
                                 sal_Int32 nCount = xItem.getLength();
                                 const i18n::CalendarItem2* pArr = xItem.getArray();
                                 for( sal_Int32 n = 0; n <= nCount; ++n )
@@ -1326,7 +1320,7 @@ bool EditEngine::PostKeyEvent( const KeyEvent& rKeyEvent, EditView* pEditView, v
 
                                 if ( aComplete.isEmpty() )
                                 {
-                                    xItem = pImpEditEngine->pLocaleDataWrapper->get()->getDefaultCalendarMonths();
+                                    xItem = pImpEditEngine->xLocaleDataWrapper->getDefaultCalendarMonths();
                                     sal_Int32 nMonthCount = xItem.getLength();
                                     const i18n::CalendarItem2* pMonthArr = xItem.getArray();
                                     for( sal_Int32 n = 0; n <= nMonthCount; ++n )
diff --git a/editeng/source/editeng/impedit.hxx b/editeng/source/editeng/impedit.hxx
index 5ce5524..793a85e 100644
--- a/editeng/source/editeng/impedit.hxx
+++ b/editeng/source/editeng/impedit.hxx
@@ -464,8 +464,8 @@ private:
 
     LanguageType        eDefLanguage;
 
-    OnDemandLocaleDataWrapper*       pLocaleDataWrapper;
-    OnDemandTransliterationWrapper*  pTransliterationWrapper;
+    OnDemandLocaleDataWrapper       xLocaleDataWrapper;
+    OnDemandTransliterationWrapper  xTransliterationWrapper;
 
     // For Formatting / Update ....
     boost::ptr_vector<DeletedNodeInfo> aDeletedNodes;
diff --git a/editeng/source/editeng/impedit2.cxx b/editeng/source/editeng/impedit2.cxx
index 9dec70e..8269dae 100644
--- a/editeng/source/editeng/impedit2.cxx
+++ b/editeng/source/editeng/impedit2.cxx
@@ -129,8 +129,6 @@ ImpEditEngine::ImpEditEngine( EditEngine* pEE, SfxItemPool* pItemPool ) :
     nStretchY           = 100;
 
     eDefLanguage        = LANGUAGE_DONTKNOW;
-    pLocaleDataWrapper  = 0;
-    pTransliterationWrapper = 0;
     maBackgroundColor   = COL_AUTO;
 
     nAsianCompressionMode = text::CharacterCompressionType::NONE;
@@ -184,8 +182,6 @@ ImpEditEngine::~ImpEditEngine()
     delete pCTLOptions;
     if ( bOwnerOfRefDev )
         pRefDev.disposeAndClear();
-    delete pLocaleDataWrapper;
-    delete pTransliterationWrapper;
     delete pSpellInfo;
 }
 
diff --git a/svl/source/numbers/zforlist.cxx b/svl/source/numbers/zforlist.cxx
index 8b00985..db8e67d 100644
--- a/svl/source/numbers/zforlist.cxx
+++ b/svl/source/numbers/zforlist.cxx
@@ -26,6 +26,7 @@
 #include <comphelper/string.hxx>
 #include <tools/debug.hxx>
 #include <unotools/charclass.hxx>
+#include <unotools/configmgr.hxx>
 #include <i18nlangtag/mslangid.hxx>
 #include <unotools/localedatawrapper.hxx>
 #include <unotools/numberformatcodewrapper.hxx>
@@ -3125,7 +3126,9 @@ sal_uInt16 SvNumberFormatter::ExpandTwoDigitYear( sal_uInt16 nYear ) const
 // static
 sal_uInt16 SvNumberFormatter::GetYear2000Default()
 {
-    return (sal_uInt16) ::utl::MiscCfg().GetYear2000();
+    if (!utl::ConfigManager::IsAvoidConfig())
+        return (sal_uInt16) ::utl::MiscCfg().GetYear2000();
+    return 1930;
 }
 
 
diff --git a/sw/source/core/doc/docfmt.cxx b/sw/source/core/doc/docfmt.cxx
index 1ee3069..832cad2 100644
--- a/sw/source/core/doc/docfmt.cxx
+++ b/sw/source/core/doc/docfmt.cxx
@@ -31,6 +31,7 @@
 #include <svl/whiter.hxx>
 #include <svl/zforlist.hxx>
 #include <comphelper/processfactory.hxx>
+#include <unotools/configmgr.hxx>
 #include <unotools/misccfg.hxx>
 #include <com/sun/star/i18n/WordType.hpp>
 #include <fmtpdsc.hxx>
@@ -1714,7 +1715,8 @@ void SwDoc::_CreateNumberFormatter()
 
     mpNumberFormatter = new SvNumberFormatter( comphelper::getProcessComponentContext(), eLang );
     mpNumberFormatter->SetEvalDateFormat( NF_EVALDATEFORMAT_FORMAT_INTL );
-    mpNumberFormatter->SetYear2000(static_cast<sal_uInt16>(::utl::MiscCfg().GetYear2000()));
+    if (!utl::ConfigManager::IsAvoidConfig())
+        mpNumberFormatter->SetYear2000(static_cast<sal_uInt16>(::utl::MiscCfg().GetYear2000()));
 }
 
 SwTableNumFormatMerge::SwTableNumFormatMerge( const SwDoc& rSrc, SwDoc& rDest )
diff --git a/unotools/source/config/syslocaleoptions.cxx b/unotools/source/config/syslocaleoptions.cxx
index f72c1c0..c349f2e 100644
--- a/unotools/source/config/syslocaleoptions.cxx
+++ b/unotools/source/config/syslocaleoptions.cxx
@@ -516,8 +516,8 @@ SvtSysLocaleOptions::SvtSysLocaleOptions()
     if ( !pOptions )
     {
         pOptions = new SvtSysLocaleOptions_Impl;
-
-        ItemHolder1::holdConfigItem(E_SYSLOCALEOPTIONS);
+        if (!utl::ConfigManager::IsAvoidConfig())
+            ItemHolder1::holdConfigItem(E_SYSLOCALEOPTIONS);
     }
     ++nRefCount;
     pOptions->AddListener(this);
diff --git a/unotools/source/misc/syslocale.cxx b/unotools/source/misc/syslocale.cxx
index 117d5d8..b8e6d56 100644
--- a/unotools/source/misc/syslocale.cxx
+++ b/unotools/source/misc/syslocale.cxx
@@ -55,13 +55,7 @@ private:
 
 SvtSysLocale_Impl::SvtSysLocale_Impl() : pCharClass(NULL)
 {
-    if (utl::ConfigManager::IsAvoidConfig())
-    {
-        pLocaleData = NULL;
-        return;
-    }
-
-    pLocaleData = new LocaleDataWrapper(aSysLocaleOptions.GetRealLanguageTag());
+    pLocaleData = new LocaleDataWrapper( aSysLocaleOptions.GetRealLanguageTag() );
     setDateAcceptancePatternsConfig();
 
     // listen for further changes
@@ -121,9 +115,6 @@ void SvtSysLocale_Impl::setDateAcceptancePatternsConfig()
 
 SvtSysLocale::SvtSysLocale()
 {
-    if (utl::ConfigManager::IsAvoidConfig())
-        return;
-
     MutexGuard aGuard( GetMutex() );
     if ( !pImpl )
         pImpl = new SvtSysLocale_Impl;


More information about the Libreoffice-commits mailing list