[Libreoffice-commits] core.git: svl/source svtools/source

2021-11-07 Thread Eike Rathke (via logerrit)
 svl/source/config/languageoptions.cxx |2 +-
 svtools/source/misc/langtab.cxx   |   13 +++--
 2 files changed, 8 insertions(+), 7 deletions(-)

New commits:
commit 0f3c19ee61ec371aa32d9f51c3555d3ea8ae9eeb
Author: Eike Rathke 
AuthorDate: Sun Nov 7 19:00:41 2021 +0100
Commit: Eike Rathke 
CommitDate: Sun Nov 7 20:11:57 2021 +0100

Resolves: tdf#145386 Use "Default" for LANGUAGE_PROCESS_OR_USER_DEFAULT

There's no, specifically not in Writer, handling of the LCID
0x0400 LANGUAGE_PROCESS_OR_USER_DEFAULT language/locale concept
other than the number formatter mapping it to LANGUAGE_SYSTEM.

Use the LANGUAGE_SYSTEM "Default" string in UI (status bar, status
menu, language list) but keep the LCID, and don't append the
resolved locale string as it is also displayed both in the Font
Western and CJK listboxes.

This ends up as two list entries, like
* Default - English (UK)first entry
* Default   last entry
of which the second would be selected.

Change-Id: I8d9e4171bee6bbe9d1c9dcfb7a5fa8fc92ea1a2c
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/124449
Reviewed-by: Eike Rathke 
Tested-by: Jenkins

diff --git a/svl/source/config/languageoptions.cxx 
b/svl/source/config/languageoptions.cxx
index e04abe80f4da..2e7550b98758 100644
--- a/svl/source/config/languageoptions.cxx
+++ b/svl/source/config/languageoptions.cxx
@@ -48,7 +48,7 @@ SvtScriptType GetScriptTypeOfLanguage( LanguageType nLang )
 {
 if( LANGUAGE_DONTKNOW == nLang )
 nLang = LANGUAGE_ENGLISH_US;
-else if( LANGUAGE_SYSTEM == nLang  )
+else if (LANGUAGE_SYSTEM == nLang || LANGUAGE_PROCESS_OR_USER_DEFAULT == 
nLang)
 nLang = SvtSysLocale().GetLanguageTag().getLanguageType();
 
 sal_Int16 nScriptType = MsLangId::getScriptType( nLang );
diff --git a/svtools/source/misc/langtab.cxx b/svtools/source/misc/langtab.cxx
index 9981cf6862b3..00e676d149ef 100644
--- a/svtools/source/misc/langtab.cxx
+++ b/svtools/source/misc/langtab.cxx
@@ -225,23 +225,24 @@ bool SvtLanguageTable::HasLanguageType( const 
LanguageType eType )
 
 OUString SvtLanguageTableImpl::GetString( const LanguageType eType ) const
 {
-LanguageType eLang = MsLangId::getReplacementForObsoleteLanguage( eType );
-sal_uInt32 nPos = FindIndex(eLang);
+const LanguageType nLang = MsLangId::getReplacementForObsoleteLanguage( 
eType);
+const sal_uInt32 nPos = (eType == LANGUAGE_PROCESS_OR_USER_DEFAULT ?
+FindIndex(LANGUAGE_SYSTEM) : FindIndex( nLang));
 
 if ( RESARRAY_INDEX_NOTFOUND != nPos && nPos < GetEntryCount() )
 return m_aStrings[nPos].first;
 
 // Obtain from ICU, or a geeky but usable-in-a-pinch lang-tag.
-OUString sLangTag( lcl_getDescription( LanguageTag(eType)));
+OUString sLangTag( lcl_getDescription( LanguageTag(nLang)));
 SAL_WARN("svtools.misc", "Language: 0x"
-<< std::hex << eType
+<< std::hex << nLang
 << " with unknown name, so returning lang-tag of: "
 << sLangTag);
 
 // And add it to the table if it is an on-the-fly-id, which it usually is,
 // so it is available in all subsequent language boxes.
-if (LanguageTag::isOnTheFlyID( eType))
-const_cast(this)->AddItem( sLangTag, eType);
+if (LanguageTag::isOnTheFlyID( nLang))
+const_cast(this)->AddItem( sLangTag, nLang);
 
 return sLangTag;
 }


[Libreoffice-commits] core.git: svl/source svtools/source

2021-05-29 Thread Noel Grandin (via logerrit)
 svl/source/numbers/zforlist.cxx  |   84 +++
 svtools/source/control/ruler.cxx |   20 -
 2 files changed, 52 insertions(+), 52 deletions(-)

New commits:
commit ee50d4152cc4a06367d66808ceba1e74e62f3ed8
Author: Noel Grandin 
AuthorDate: Fri May 28 14:42:34 2021 +0200
Commit: Noel Grandin 
CommitDate: Sat May 29 17:50:52 2021 +0200

no need to allocate these on the heap

Change-Id: I58847f8eb2c8dc17ca393a758d122cd3929deeb0
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/116375
Tested-by: Jenkins
Reviewed-by: Noel Grandin 

diff --git a/svl/source/numbers/zforlist.cxx b/svl/source/numbers/zforlist.cxx
index 42fa5660ab18..b1885ad4a94a 100644
--- a/svl/source/numbers/zforlist.cxx
+++ b/svl/source/numbers/zforlist.cxx
@@ -1728,15 +1728,15 @@ bool SvNumberFormatter::GetPreviewString(const 
OUString& sFormatString,
 eLnge = ActLnge;
 sal_Int32 nCheckPos = -1;
 OUString sTmpString = sFormatString;
-std::unique_ptr p_Entry(new SvNumberformat(sTmpString,
- pFormatScanner.get(),
- pStringScanner.get(),
- nCheckPos,
- eLnge));
+SvNumberformat aEntry(sTmpString,
+  pFormatScanner.get(),
+  pStringScanner.get(),
+  nCheckPos,
+  eLnge);
 if (nCheckPos == 0) // String ok
 {
 sal_uInt32 CLOffset = ImpGenerateCL(eLnge); // create new standard 
formats if necessary
-sal_uInt32 nKey = ImpIsEntry(p_Entry->GetFormatstring(),CLOffset, 
eLnge);
+sal_uInt32 nKey = ImpIsEntry(aEntry.GetFormatstring(),CLOffset, eLnge);
 if (nKey != NUMBERFORMAT_ENTRY_NOT_FOUND)   // already present
 {
 GetOutputString(fPreviewNumber, nKey, sOutString, ppColor, 
bUseStarFormat);
@@ -1745,12 +1745,12 @@ bool SvNumberFormatter::GetPreviewString(const 
OUString& sFormatString,
 {
 if ( bUseStarFormat )
 {
-p_Entry->SetStarFormatSupport( true );
+aEntry.SetStarFormatSupport( true );
 }
-p_Entry->GetOutputString(fPreviewNumber, sOutString, ppColor);
+aEntry.GetOutputString(fPreviewNumber, sOutString, ppColor);
 if ( bUseStarFormat )
 {
-p_Entry->SetStarFormatSupport( false );
+aEntry.SetStarFormatSupport( false );
 }
 }
 return true;
@@ -1790,15 +1790,15 @@ bool SvNumberFormatter::GetPreviewStringGuess( const 
OUString& sFormatString,
 return true;
 }
 
-std::unique_ptr pEntry;
+std::optional pEntry;
 sal_Int32 nCheckPos = -1;
 OUString sTmpString;
 
 if ( bEnglish )
 {
 sTmpString = sFormatString;
-pEntry.reset(new SvNumberformat( sTmpString, pFormatScanner.get(),
- pStringScanner.get(), nCheckPos, eLnge ));
+pEntry.emplace( sTmpString, pFormatScanner.get(),
+pStringScanner.get(), nCheckPos, eLnge );
 }
 else
 {
@@ -1810,8 +1810,8 @@ bool SvNumberFormatter::GetPreviewStringGuess( const 
OUString& sFormatString,
 LanguageType eFormatLang = LANGUAGE_ENGLISH_US;
 pFormatScanner->SetConvertMode( LANGUAGE_ENGLISH_US, eLnge, false, 
false);
 sTmpString = sFormatString;
-pEntry.reset(new SvNumberformat( sTmpString, pFormatScanner.get(),
- pStringScanner.get(), nCheckPos, 
eFormatLang ));
+pEntry.emplace( sTmpString, pFormatScanner.get(),
+pStringScanner.get(), nCheckPos, eFormatLang );
 pFormatScanner->SetConvertMode( false );
 ChangeIntl( eLnge );
 
@@ -1824,8 +1824,8 @@ bool SvNumberFormatter::GetPreviewStringGuess( const 
OUString& sFormatString,
 // Force locale's keywords.
 pFormatScanner->ChangeIntl( 
ImpSvNumberformatScan::KeywordLocalization::LocaleLegacy );
 sTmpString = sFormatString;
-pEntry.reset(new SvNumberformat( sTmpString, 
pFormatScanner.get(),
- pStringScanner.get(), nCheckPos, 
eLnge ));
+pEntry.emplace( sTmpString, pFormatScanner.get(),
+pStringScanner.get(), nCheckPos, eLnge );
 }
 else
 {
@@ -1835,19 +1835,19 @@ bool SvNumberFormatter::GetPreviewStringGuess( const 
OUString& sFormatString,
 eFormatLang = eLnge;
 pFormatScanner->SetConvertMode( eLnge, LANGUAGE_ENGLISH_US, 
false, false);
 sTmpString = sFormatString;
-std::unique_ptr pEntry2(new SvNumberformat( 
sTmpString, 

[Libreoffice-commits] core.git: svl/source svtools/source svx/source

2016-10-31 Thread Noel Grandin
 svl/source/numbers/zforfind.cxx |   14 +--
 svtools/source/config/accessibilityoptions.cxx  |   40 ++--
 svtools/source/config/colorcfg.cxx  |6 -
 svtools/source/misc/openfiledroptargetlistener.cxx  |6 -
 svtools/source/uno/unoevent.cxx |6 -
 svx/source/accessibility/ChildrenManagerImpl.cxx|8 -
 svx/source/dialog/rubydialog.cxx|9 --
 svx/source/dialog/svxbmpnumvalueset.cxx |   21 +---
 svx/source/form/fmscriptingenv.cxx  |6 -
 svx/source/gallery2/gallery1.cxx|6 -
 svx/source/sidebar/possize/PosSizePropertyPanel.cxx |7 -
 svx/source/svdraw/svdoashp.cxx  |   15 +--
 svx/source/tbxctrls/tbunosearchcontrollers.cxx  |   31 ++
 svx/source/toolbars/extrusionbar.cxx|   90 ++--
 svx/source/toolbars/fontworkbar.cxx |5 -
 svx/source/unodraw/unomod.cxx   |3 
 16 files changed, 88 insertions(+), 185 deletions(-)

New commits:
commit 06babf60ce9edd17e02930e60b9afdc12b40b553
Author: Noel Grandin 
Date:   Mon Oct 31 12:40:01 2016 +0200

loplugin:oncevar in svl..svx

Change-Id: I80b11a7b698de4b84d7a2f4c7dc62b2e4fd8bb01
Reviewed-on: https://gerrit.libreoffice.org/30438
Reviewed-by: Noel Grandin 
Tested-by: Noel Grandin 

diff --git a/svl/source/numbers/zforfind.cxx b/svl/source/numbers/zforfind.cxx
index 7fc7f8c..e04272a 100644
--- a/svl/source/numbers/zforfind.cxx
+++ b/svl/source/numbers/zforfind.cxx
@@ -616,11 +616,6 @@ short ImpSvNumberInputScan::GetLogical( const OUString& 
rString )
  */
 short ImpSvNumberInputScan::GetMonth( const OUString& rString, sal_Int32& nPos 
)
 {
-// #102136# The correct English form of month September abbreviated is
-// SEPT, but almost every data contains SEP instead.
-static const char aSeptCorrect[] = "SEPT";
-static const char aSepShortened[] = "SEP";
-
 short res = 0; // no month found
 
 if (rString.getLength() > nPos) // only if needed
@@ -668,10 +663,11 @@ short ImpSvNumberInputScan::GetMonth( const OUString& 
rString, sal_Int32& nPos )
 res = sal::static_int_cast< short >(-(i+1)); // negative
 break;  // for
 }
-else if ( i == 8 && pUpperAbbrevMonthText[i] == aSeptCorrect &&
-StringContainsWord( aSepShortened, rString, nPos ) )
-{   // #102136# SEPT/SEP
-nPos = nPos + strlen(aSepShortened);
+else if ( i == 8 && pUpperAbbrevMonthText[i] == "SEPT" &&
+StringContainsWord( "SEP", rString, nPos ) )
+{   // #102136# The correct English form of month September 
abbreviated is
+// SEPT, but almost every data contains SEP instead.
+nPos = nPos + 3;
 res = sal::static_int_cast< short >(-(i+1)); // negative
 break;  // for
 }
diff --git a/svtools/source/config/accessibilityoptions.cxx 
b/svtools/source/config/accessibilityoptions.cxx
index 0e874b0..3078b11 100644
--- a/svtools/source/config/accessibilityoptions.cxx
+++ b/svtools/source/config/accessibilityoptions.cxx
@@ -43,22 +43,6 @@ using namespace com::sun::star::uno;
 
 #define HELP_TIP_TIMEOUT 0x // max. timeout setting to pretend a 
non-timeout
 
-namespace
-{
-const char s_sAccessibility[] = 
"org.openoffice.Office.Common/Accessibility";
-const char s_sIsForPagePreviews[] = "IsForPagePreviews";
-const char s_sIsHelpTipsDisappear[] = "IsHelpTipsDisappear";
-const char s_sHelpTipSeconds[] = "HelpTipSeconds";
-const char s_sIsAllowAnimatedGraphics[] = "IsAllowAnimatedGraphics";
-const char s_sIsAllowAnimatedText[] = "IsAllowAnimatedText";
-const char s_sIsAutomaticFontColor[] = "IsAutomaticFontColor";
-const char s_sIsSelectionInReadonly[] = "IsSelectionInReadonly";
-const char s_sColorValueSetColumnCount[] = "ColorValueSetColumnCount";
-const char s_sEdgeBlending[] = "EdgeBlending";
-const char s_sListBoxMaximumLineCount[] = "ListBoxMaximumLineCount";
-const char s_sPreviewUsesCheckeredBackground[]  = 
"PreviewUsesCheckeredBackground";
-}
-
 // class SvtAccessibilityOptions_Impl 
-
 
 class SvtAccessibilityOptions_Impl
@@ -105,7 +89,7 @@ SvtAccessibilityOptions_Impl::SvtAccessibilityOptions_Impl()
 m_xCfg.set(
 ::comphelper::ConfigurationHelper::openConfig(
 comphelper::getProcessComponentContext(),
-s_sAccessibility,
+"org.openoffice.Office.Common/Accessibility",
 ::comphelper::EConfigurationModes::Standard ),
 css::uno::UNO_QUERY);
 }
@@ -129,7 +113,7 @@ bool SvtAccessibilityOptions_Impl::GetIsForPagePreviews() 

[Libreoffice-commits] core.git: svl/source svtools/source svx/inc svx/source ucb/source unodevtools/source

2016-08-11 Thread Noel Grandin
 svl/source/items/stylepool.cxx|4 ++--
 svl/source/numbers/zforfind.hxx   |   12 ++--
 svtools/source/contnr/contentenumeration.hxx  |2 +-
 svtools/source/contnr/fileview.cxx|2 +-
 svtools/source/contnr/imivctl.hxx |   16 
 svtools/source/control/roadmap.cxx|2 +-
 svtools/source/uno/treecontrolpeer.cxx|2 +-
 svx/inc/galbrws2.hxx  |2 +-
 svx/inc/sdr/overlay/overlaymanagerbuffered.hxx|4 ++--
 svx/inc/svdibrow.hxx  |2 +-
 svx/source/accessibility/ChildrenManagerImpl.hxx  |2 +-
 svx/source/dialog/contimp.hxx |4 ++--
 svx/source/dialog/framelink.cxx   |2 +-
 svx/source/fmcomp/fmgridcl.cxx|2 +-
 svx/source/form/fmvwimp.cxx   |2 +-
 svx/source/inc/filtnav.hxx|4 ++--
 svx/source/inc/fmshimp.hxx|2 +-
 svx/source/inc/gridcell.hxx   |2 +-
 svx/source/svdraw/svdfmtf.hxx |2 +-
 svx/source/svdraw/svdhdl.cxx  |2 +-
 svx/source/tbxctrls/tbunosearchcontrollers.cxx|2 +-
 ucb/source/ucp/file/shell.hxx |2 +-
 unodevtools/source/skeletonmaker/skeletoncpp.hxx  |4 ++--
 unodevtools/source/skeletonmaker/skeletonjava.hxx |2 +-
 24 files changed, 41 insertions(+), 41 deletions(-)

New commits:
commit b796b24793827583550279d40bfe565c66ad284d
Author: Noel Grandin 
Date:   Wed Aug 10 13:44:57 2016 +0200

loplugin:countusersofdefaultparams in svl..unodevtools

Change-Id: Ie3d2cf29e99b8a51b80246aafa23a92e6c3404b2
Reviewed-on: https://gerrit.libreoffice.org/28017
Tested-by: Jenkins 
Reviewed-by: Noel Grandin 

diff --git a/svl/source/items/stylepool.cxx b/svl/source/items/stylepool.cxx
index 8ac1e4f..347334a 100644
--- a/svl/source/items/stylepool.cxx
+++ b/svl/source/items/stylepool.cxx
@@ -371,8 +371,8 @@ public:
 std::shared_ptr insertItemSet( const SfxItemSet& rSet );
 
 // #i86923#
-IStylePoolIteratorAccess* createIterator( bool bSkipUnusedItemSets = false,
-  bool bSkipIgnorableItems = false 
);
+IStylePoolIteratorAccess* createIterator( bool bSkipUnusedItemSets,
+  bool bSkipIgnorableItems );
 };
 
 std::shared_ptr StylePoolImpl::insertItemSet( const SfxItemSet& 
rSet )
diff --git a/svl/source/numbers/zforfind.hxx b/svl/source/numbers/zforfind.hxx
index ba24b87..e7b7a60 100644
--- a/svl/source/numbers/zforfind.hxx
+++ b/svl/source/numbers/zforfind.hxx
@@ -294,7 +294,7 @@ private:
 // Get currency symbol and advance string position
 bool GetCurrency( const OUString& rString,
   sal_Int32& nPos,
-  const SvNumberformat* pFormat = nullptr ); // optional 
number format to match against
+  const SvNumberformat* pFormat ); // optional number 
format to match against
 
 // Get symbol AM or PM and advance string position
 bool GetTimeAmPm( const OUString& rString,
@@ -335,21 +335,21 @@ private:
 // Conversion of date to number
 bool GetDateRef( double& fDays,  // OUT: days diff 
to null date
  sal_uInt16& nCounter,   // Count of date 
substrings
- const SvNumberformat* pFormat = nullptr ); // optional 
number format to match against
+ const SvNumberformat* pFormat ); // optional number 
format to match against
 
 // Analyze start of string
 bool ScanStartString( const OUString& rString,
-  const SvNumberformat* pFormat = nullptr );
+  const SvNumberformat* pFormat );
 
 // Analyze middle substring
 bool ScanMidString( const OUString& rString,
 sal_uInt16 nStringPos,
-const SvNumberformat* pFormat = nullptr );
+const SvNumberformat* pFormat );
 
 
 // Analyze end of string
 bool ScanEndString( const OUString& rString,
-const SvNumberformat* pFormat = nullptr );
+const SvNumberformat* pFormat );
 
 // Compare rString to substring of array indexed by nString
 // nString == 0x => last substring
@@ -369,7 +369,7 @@ private:
 
 // Main analyzing function
 bool IsNumberFormatMain( const OUString& rString,
- const SvNumberformat* pFormat = nullptr);// 
optional number format to match against
+ const SvNumberformat* pFormat);// optional 
number format to match against
 
 static inline bool MyIsdigit( sal_Unicode c );
 
diff --git 

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

2016-06-16 Thread Michael Stahl
 svl/source/config/cjkoptions.cxx   |   13 -
 svl/source/config/ctloptions.cxx   |   14 +-
 svtools/source/config/menuoptions.cxx  |   10 +++---
 svtools/source/config/miscopt.cxx  |   10 +++---
 unotools/source/config/cmdoptions.cxx  |   10 +++---
 unotools/source/config/defaultoptions.cxx  |   10 +++---
 unotools/source/config/extendedsecurityoptions.cxx |   10 +++---
 unotools/source/config/fontoptions.cxx |   10 +++---
 unotools/source/config/historyoptions.cxx  |   10 +++---
 unotools/source/config/localisationoptions.cxx |   10 +++---
 unotools/source/config/misccfg.cxx |6 +++---
 unotools/source/config/pathoptions.cxx |6 +++---
 unotools/source/config/printwarningoptions.cxx |6 +++---
 unotools/source/config/securityoptions.cxx |   10 +++---
 unotools/source/misc/syslocale.cxx |   10 +++---
 15 files changed, 96 insertions(+), 49 deletions(-)

New commits:
commit ed8a2341b9631ad312ff40d23331c66d537aad20
Author: Michael Stahl 
Date:   Thu Jun 16 15:24:29 2016 +0200

properly prefix various global variables and hide them

Change-Id: I6b97e6a4c6ac4c0e26bcbb2b132b333920c16f19

diff --git a/svl/source/config/cjkoptions.cxx b/svl/source/config/cjkoptions.cxx
index 3eba25b..e0b1b9e 100644
--- a/svl/source/config/cjkoptions.cxx
+++ b/svl/source/config/cjkoptions.cxx
@@ -376,20 +376,23 @@ bool 
SvtCJKOptions_Impl::IsReadOnly(SvtCJKOptions::EOption eOption) const
 return bReadOnly;
 }
 
-// global
-std::weak_ptr  pCJKOptions;
+namespace {
 
-namespace { struct theCJKOptionsMutex : public rtl::Static< ::osl::Mutex , 
theCJKOptionsMutex >{}; }
+// global
+std::weak_ptr g_pCJKOptions;
+
+struct theCJKOptionsMutex : public rtl::Static< ::osl::Mutex , 
theCJKOptionsMutex >{};
+}
 
 SvtCJKOptions::SvtCJKOptions(bool bDontLoad)
 {
 // Global access, must be guarded (multithreading)
 ::osl::MutexGuard aGuard( theCJKOptionsMutex::get() );
-pImpl = pCJKOptions.lock();
+pImpl = g_pCJKOptions.lock();
 if ( !pImpl )
 {
 pImpl = std::make_shared();
-pCJKOptions = pImpl;
+g_pCJKOptions = pImpl;
 ItemHolder2::holdConfigItem(E_CJKOPTIONS);
 }
 
diff --git a/svl/source/config/ctloptions.cxx b/svl/source/config/ctloptions.cxx
index ef2a610..245c385 100644
--- a/svl/source/config/ctloptions.cxx
+++ b/svl/source/config/ctloptions.cxx
@@ -372,21 +372,25 @@ void SvtCTLOptions_Impl::SetCTLTextNumerals( 
SvtCTLOptions::TextNumerals _eNumer
 NotifyListeners(0);
 }
 }
-// global
-std::weak_ptr  pCTLOptions;
 
-namespace { struct CTLMutex : public rtl::Static< osl::Mutex, CTLMutex > {}; }
+namespace {
+
+// global
+std::weak_ptr g_pCTLOptions;
+
+struct CTLMutex : public rtl::Static< osl::Mutex, CTLMutex > {};
+}
 
 SvtCTLOptions::SvtCTLOptions( bool bDontLoad )
 {
 // Global access, must be guarded (multithreading)
 ::osl::MutexGuard aGuard( CTLMutex::get() );
 
-m_pImpl = pCTLOptions.lock();
+m_pImpl = g_pCTLOptions.lock();
 if ( !m_pImpl )
 {
 m_pImpl = std::make_shared();
-pCTLOptions = m_pImpl;
+g_pCTLOptions = m_pImpl;
 ItemHolder2::holdConfigItem(E_CTLOPTIONS);
 }
 
diff --git a/svtools/source/config/menuoptions.cxx 
b/svtools/source/config/menuoptions.cxx
index be735a6..c0fcaef 100644
--- a/svtools/source/config/menuoptions.cxx
+++ b/svtools/source/config/menuoptions.cxx
@@ -315,18 +315,22 @@ Sequence< OUString > 
SvtMenuOptions_Impl::impl_GetPropertyNames()
 return seqPropertyNames;
 }
 
-std::weak_ptr m_pMenuOptions;
+namespace {
+
+std::weak_ptr g_pMenuOptions;
+
+}
 
 SvtMenuOptions::SvtMenuOptions()
 {
 // Global access, must be guarded (multithreading!).
 MutexGuard aGuard( GetOwnStaticMutex() );
 
-m_pImpl = m_pMenuOptions.lock();
+m_pImpl = g_pMenuOptions.lock();
 if( !m_pImpl )
 {
 m_pImpl = std::make_shared();
-m_pMenuOptions = m_pImpl;
+g_pMenuOptions = m_pImpl;
 svtools::ItemHolder2::holdConfigItem(E_MENUOPTIONS);
 }
 }
diff --git a/svtools/source/config/miscopt.cxx 
b/svtools/source/config/miscopt.cxx
index e0ecfd8..2d30403 100644
--- a/svtools/source/config/miscopt.cxx
+++ b/svtools/source/config/miscopt.cxx
@@ -643,18 +643,22 @@ Sequence< OUString > 
SvtMiscOptions_Impl::GetPropertyNames()
 return seqPropertyNames;
 }
 
-std::weak_ptr m_pMiscOptions;
+namespace {
+
+std::weak_ptr g_pMiscOptions;
+
+}
 
 SvtMiscOptions::SvtMiscOptions()
 {
 // Global access, must be guarded (multithreading!).
 MutexGuard aGuard( GetInitMutex() );
 
-m_pImpl = m_pMiscOptions.lock();
+m_pImpl = g_pMiscOptions.lock();
 if( !m_pImpl )
 {
 m_pImpl = std::make_shared();
-m_pMiscOptions = m_pImpl;
+

[Libreoffice-commits] core.git: svl/source svtools/source

2016-04-05 Thread Rohan Kumar
 svl/source/items/poolitem.cxx |8 
 svtools/source/brwbox/brwbox3.cxx |6 +++---
 svtools/source/config/helpopt.cxx |4 +---
 svtools/source/config/menuoptions.cxx |5 +
 svtools/source/misc/sampletext.cxx|   10 +-
 5 files changed, 14 insertions(+), 19 deletions(-)

New commits:
commit 0452db13db40e81522fb6bc49136d25b6ffcff41
Author: Rohan Kumar 
Date:   Wed Mar 9 19:08:34 2016 +0530

tdf#91794 remove OSL_DEBUG_LEVEL > 1 conditionals

I removed OSL_DEBUG_LEVEL > 1 conditionals, replaced DBG_ASSERT to
standard assert(..) and used SAL_INFO() in some places

Change-Id: Ib6d6065e3f141e60f865fef1faacdb5598e12431
Reviewed-on: https://gerrit.libreoffice.org/23073
Tested-by: Jenkins 
Reviewed-by: Björn Michaelsen 

diff --git a/svl/source/items/poolitem.cxx b/svl/source/items/poolitem.cxx
index 50a91fe..90f5b73 100644
--- a/svl/source/items/poolitem.cxx
+++ b/svl/source/items/poolitem.cxx
@@ -25,7 +25,7 @@
 #include 
 
 
-#if OSL_DEBUG_LEVEL > 1
+#if OSL_DEBUG_LEVEL > 0
 static sal_uLong nItemCount = 0;
 
 const char* pw1 = "Wow! 10.000 items!";
@@ -41,7 +41,7 @@ SfxPoolItem::SfxPoolItem(sal_uInt16 const nWhich)
 , m_nKind(SFX_ITEMS_NONE)
 {
 DBG_ASSERT(nWhich <= SHRT_MAX, "invalid WhichId");
-#if OSL_DEBUG_LEVEL > 1
+#if OSL_DEBUG_LEVEL > 0
 ++nItemCount;
 if ( pw1 && nItemCount>=1 )
 {
@@ -77,7 +77,7 @@ SfxPoolItem::SfxPoolItem( const SfxPoolItem& rCpy )
 , m_nWhich(rCpy.Which()) // call function because of ChkThis() (WTF does 
that mean?)
 , m_nKind( SFX_ITEMS_NONE )
 {
-#if OSL_DEBUG_LEVEL > 1
+#if OSL_DEBUG_LEVEL > 0
 ++nItemCount;
 if ( pw1 && nItemCount>=1 )
 {
@@ -112,7 +112,7 @@ SfxPoolItem::~SfxPoolItem()
 {
 DBG_ASSERT(m_nRefCount == 0 || m_nRefCount > SFX_ITEMS_MAXREF,
 "destroying item in use");
-#if OSL_DEBUG_LEVEL > 1
+#if OSL_DEBUG_LEVEL > 0
 --nItemCount;
 #endif
 }
diff --git a/svtools/source/brwbox/brwbox3.cxx 
b/svtools/source/brwbox/brwbox3.cxx
index c98cc99..4562ddd 100644
--- a/svtools/source/brwbox/brwbox3.cxx
+++ b/svtools/source/brwbox/brwbox3.cxx
@@ -234,7 +234,7 @@ OUString BrowseBox::GetAccessibleObjectName( 
::svt::AccessibleBrowseBoxObjType e
 }
 else
 aRetText = "TableCell";
-#if OSL_DEBUG_LEVEL > 1
+#if OSL_DEBUG_LEVEL > 0
 aRetText += " [";
 aRetText += OUString::number(sal_Int32(GetCurRow()));
 aRetText += ",";
@@ -247,7 +247,7 @@ OUString BrowseBox::GetAccessibleObjectName( 
::svt::AccessibleBrowseBoxObjType e
 sal_Int32 rowId = _nPosition + 1;
 aRetText = OUString::number( rowId );
 }
-#if OSL_DEBUG_LEVEL > 1
+#if OSL_DEBUG_LEVEL > 0
 aRetText += " [";
 aRetText += OUString::number(sal_Int32(GetCurRow()));
 aRetText += ",";
@@ -257,7 +257,7 @@ OUString BrowseBox::GetAccessibleObjectName( 
::svt::AccessibleBrowseBoxObjType e
 break;
 case ::svt::BBTYPE_COLUMNHEADERCELL:
 aRetText = GetColumnDescription( sal_Int16( _nPosition ) );
-#if OSL_DEBUG_LEVEL > 1
+#if OSL_DEBUG_LEVEL > 0
 aRetText += " [";
 aRetText += OUString::number(sal_Int32(GetCurRow()));
 aRetText += ",";
diff --git a/svtools/source/config/helpopt.cxx 
b/svtools/source/config/helpopt.cxx
index 01bf065..f03ebcf 100644
--- a/svtools/source/config/helpopt.cxx
+++ b/svtools/source/config/helpopt.cxx
@@ -150,9 +150,7 @@ void  SvtHelpOptions_Impl::Load(const uno::Sequence< 
OUString>& rPropertyNames)
 {
 for ( int nProp = 0; nProp < rPropertyNames.getLength(); nProp++ )
 {
-#if OSL_DEBUG_LEVEL > 1
-DBG_ASSERT( pValues[nProp].hasValue(), "property value missing" );
-#endif
+assert(pValues[nProp].hasValue() && "property value missing");
 if ( pValues[nProp].hasValue() )
 {
 bool bTmp;
diff --git a/svtools/source/config/menuoptions.cxx 
b/svtools/source/config/menuoptions.cxx
index 1f27fc7..7146b23 100644
--- a/svtools/source/config/menuoptions.cxx
+++ b/svtools/source/config/menuoptions.cxx
@@ -276,10 +276,7 @@ void SvtMenuOptions_Impl::Notify( const Sequence< OUString 
>& seqPropertyNames )
 
DBG_ASSERT(!(seqValues[nProperty].getValueTypeClass()!=TypeClass_BOOLEAN), 
"SvtMenuOptions_Impl::SvtMenuOptions_Impl()\nWho has changed the value type of 
\"Office.Common\\View\\Menu\\IsSystemIconsInMenus\"?" );
 bMenuSettingsChanged |= seqValues[nProperty] >>= bSystemMenuIcons;
 }
-
-#if OSL_DEBUG_LEVEL > 1
-else DBG_ASSERT( sal_False, "SvtMenuOptions_Impl::Notify()\nUnknown 
property detected ... I can't handle these!\n" );
-#endif
+else assert( false && "SvtMenuOptions_Impl::Notify()\nUnknown property 
detected ... I can't