[Libreoffice-commits] core.git: scripting/source sd/source sfx2/source stoc/source svl/source svtools/source

2018-11-22 Thread Libreoffice Gerrit user
 scripting/source/vbaevents/eventhelper.cxx|   11 +-
 sd/source/core/stlsheet.cxx   |4 
 sd/source/ui/framework/factories/BasicViewFactory.cxx |   11 +-
 sd/source/ui/unoidl/facreg.cxx|   20 ++--
 sfx2/source/appl/sfxhelp.cxx  |   48 ---
 sfx2/source/view/classificationhelper.cxx |   11 +-
 sfx2/source/view/sfxbasecontroller.cxx|   74 +++---
 stoc/source/javaloader/javaloader.cxx |   12 --
 svl/source/misc/inettype.cxx  |   18 ++--
 svtools/source/config/apearcfg.cxx|   15 ---
 svtools/source/config/htmlcfg.cxx |   13 ---
 11 files changed, 88 insertions(+), 149 deletions(-)

New commits:
commit 06ad764cfb36ece7f054ecb786cc0395346a6a68
Author: Noel Grandin 
AuthorDate: Thu Nov 22 08:56:15 2018 +0200
Commit: Noel Grandin 
CommitDate: Thu Nov 22 12:46:56 2018 +0100

improve function-local statics in scripting..svtools

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

diff --git a/scripting/source/vbaevents/eventhelper.cxx 
b/scripting/source/vbaevents/eventhelper.cxx
index 86d941df9e74..408539cb7038 100644
--- a/scripting/source/vbaevents/eventhelper.cxx
+++ b/scripting/source/vbaevents/eventhelper.cxx
@@ -256,10 +256,9 @@ static TranslatePropMap aTranslatePropMap_Impl[] =
 
 static EventInfoHash& getEventTransInfo()
 {
-static bool initialised = false;
-static EventInfoHash eventTransInfo;
-if ( !initialised )
+static EventInfoHash eventTransInfo = [&]()
 {
+EventInfoHash tmp;
 OUString sEventInfo;
 TranslatePropMap* pTransProp = aTranslatePropMap_Impl;
 int nCount = SAL_N_ELEMENTS(aTranslatePropMap_Impl);
@@ -275,10 +274,10 @@ static EventInfoHash& getEventTransInfo()
 pTransProp++;
 i++;
 }while(i < nCount && sEventInfo == pTransProp->sEventInfo);
-eventTransInfo[sEventInfo] = infoList;
+tmp[sEventInfo] = infoList;
 }
-initialised = true;
-}
+return tmp;
+}();
 return eventTransInfo;
 }
 
diff --git a/sd/source/core/stlsheet.cxx b/sd/source/core/stlsheet.cxx
index 24f365b30936..3df37e99da6e 100644
--- a/sd/source/core/stlsheet.cxx
+++ b/sd/source/core/stlsheet.cxx
@@ -958,9 +958,7 @@ void SAL_CALL SdStyleSheet::setParentStyle( const OUString& 
rParentName  )
 Reference< XPropertySetInfo > SdStyleSheet::getPropertySetInfo()
 {
 throwIfDisposed();
-static Reference< XPropertySetInfo > xInfo;
-if( !xInfo.is() )
-xInfo = GetStylePropertySet().getPropertySetInfo();
+static Reference< XPropertySetInfo > xInfo = 
GetStylePropertySet().getPropertySetInfo();
 return xInfo;
 }
 
diff --git a/sd/source/ui/framework/factories/BasicViewFactory.cxx 
b/sd/source/ui/framework/factories/BasicViewFactory.cxx
index 864f305e6009..d76eccbde220 100644
--- a/sd/source/ui/framework/factories/BasicViewFactory.cxx
+++ b/sd/source/ui/framework/factories/BasicViewFactory.cxx
@@ -439,17 +439,18 @@ bool BasicViewFactory::IsCacheable (const 
std::shared_ptr& rpDes
 Reference xResource (rpDescriptor->mxView, 
UNO_QUERY);
 if (xResource.is())
 {
-static ::std::vector > s_aCacheableResources;
-if (s_aCacheableResources.empty() )
+static ::std::vector > s_aCacheableResources = 
[&]()
 {
+::std::vector > tmp;
 std::shared_ptr pHelper 
(FrameworkHelper::Instance(*mpBase));
 
 // The slide sorter and the task panel are cacheable and 
relocatable.
-s_aCacheableResources.push_back(FrameworkHelper::CreateResourceId(
+tmp.push_back(FrameworkHelper::CreateResourceId(
 FrameworkHelper::msSlideSorterURL, 
FrameworkHelper::msLeftDrawPaneURL));
-s_aCacheableResources.push_back(FrameworkHelper::CreateResourceId(
+tmp.push_back(FrameworkHelper::CreateResourceId(
 FrameworkHelper::msSlideSorterURL, 
FrameworkHelper::msLeftImpressPaneURL));
-}
+return tmp;
+}();
 
 ::std::vector >::const_iterator iId;
 for (iId=s_aCacheableResources.begin(); 
iId!=s_aCacheableResources.end(); ++iId)
diff --git a/sd/source/ui/unoidl/facreg.cxx b/sd/source/ui/unoidl/facreg.cxx
index 7b69d936ea9e..d4dc0533bfcf 100644
--- a/sd/source/ui/unoidl/facreg.cxx
+++ b/sd/source/ui/unoidl/facreg.cxx
@@ -44,16 +44,14 @@ enum FactoryId
 typedef std::unordered_map FactoryMap;
 
 namespace {
-static std::shared_ptr spFactoryMap;
-std::shared_ptr const & GetFactoryMap()
+FactoryMap const & GetFactoryMap()
 {
-if (spFactoryMap == nullptr)
+static FactoryMap aFactoryMap
 {
-spFactoryMap.reset(new FactoryMap);
-(*spFactoryMap)[SdDrawingDocume

[Libreoffice-commits] core.git: scripting/source sd/source sfx2/source stoc/source svl/source svtools/source

2016-08-25 Thread Gökhan Gurbetoğlu
 scripting/source/dlgprov/dlgprov.cxx  |6 +
 sd/source/filter/eppt/pptexanimations.cxx |   28 +++
 sfx2/source/dialog/templdlg.cxx   |4 +--
 stoc/source/javavm/javavm.cxx |   36 +++---
 svl/source/config/itemholder2.cxx |8 +++---
 svtools/source/config/colorcfg.cxx|   11 -
 svtools/source/config/extcolorcfg.cxx |   29 ++--
 svtools/source/config/itemholder2.cxx |8 +++---
 8 files changed, 58 insertions(+), 72 deletions(-)

New commits:
commit b7bf1ba2136b3d1e031673e7b541c6181e95ff61
Author: Gökhan Gurbetoğlu 
Date:   Wed Aug 24 17:41:12 2016 +0300

tdf#100726 - Improve readability of OUString concatanations

Improved readability of OUString concatanations. Also removed unused
OUStrings "sColor" and "sEntry" from the code.

Change-Id: Ie9792f499cd880be72229f8a8c71f05ff8e258b6
Reviewed-on: https://gerrit.libreoffice.org/28375
Tested-by: Jenkins 
Reviewed-by: Michael Stahl 

diff --git a/scripting/source/dlgprov/dlgprov.cxx 
b/scripting/source/dlgprov/dlgprov.cxx
index 30d8b23..4adfd13 100644
--- a/scripting/source/dlgprov/dlgprov.cxx
+++ b/scripting/source/dlgprov/dlgprov.cxx
@@ -280,10 +280,8 @@ static const char aResourceResolverPropName[] = 
"ResourceResolver";
 uriRef.set( xFac->parse( aURL ), UNO_QUERY );
 if ( !uriRef.is() )
 {
-OUString errorMsg("DialogProviderImpl::getDialogModel: failed 
to parse URI: ");
-errorMsg += aURL;
-throw IllegalArgumentException( errorMsg,
-Reference< XInterface >(), 1 );
+OUString errorMsg = "DialogProviderImpl::getDialogModel: 
failed to parse URI: " + aURL;
+throw IllegalArgumentException( errorMsg, Reference< 
XInterface >(), 1 );
 }
 Reference < uri::XVndSunStarExpandUrl > sxUri( uriRef, UNO_QUERY );
 if( !sxUri.is() )
diff --git a/sd/source/filter/eppt/pptexanimations.cxx 
b/sd/source/filter/eppt/pptexanimations.cxx
index 4a839c2..adf8661 100644
--- a/sd/source/filter/eppt/pptexanimations.cxx
+++ b/sd/source/filter/eppt/pptexanimations.cxx
@@ -1429,23 +1429,23 @@ Any AnimationExporter::convertAnimateValue( const Any& 
rSourceValue, const OUStr
 OUString aP( "," );
 if ( rSourceValue >>= aHSL )
 {
-aDest += "hsl(";
-aDest += OUString::number( (sal_Int32)( aHSL[ 0 ] / ( 360.0 / 255 
) ) );
-aDest += aP;
-aDest += OUString::number( (sal_Int32)( aHSL[ 1 ] * 255.0 ) );
-aDest += aP;
-aDest += OUString::number( (sal_Int32)( aHSL[ 2 ] * 255.0 ) );
-aDest += ")";
+aDest += "hsl("
+  +  OUString::number( (sal_Int32)( aHSL[ 0 ] / ( 360.0 / 255 
) ) )
+  +  aP
+  +  OUString::number( (sal_Int32)( aHSL[ 1 ] * 255.0 ) )
+  +  aP
+  +  OUString::number( (sal_Int32)( aHSL[ 2 ] * 255.0 ) )
+  +  ")";
 }
 else if ( rSourceValue >>= nColor )
 {
-aDest += "rgb(";
-aDest += OUString::number( ( (sal_Int8)nColor ) );
-aDest += aP;
-aDest += OUString::number( ( (sal_Int8)( nColor >> 8 ) ) );
-aDest += aP;
-aDest += OUString::number( ( (sal_Int8)( nColor >> 16 ) ) );
-aDest += ")";
+aDest += "rgb("
+  +  OUString::number( ( (sal_Int8)nColor ) )
+  +  aP
+  +  OUString::number( ( (sal_Int8)( nColor >> 8 ) ) )
+  +  aP
+  +  OUString::number( ( (sal_Int8)( nColor >> 16 ) ) )
+  +  ")";
 }
 }
 else if ( rAttributeName == "FillStyle" )
diff --git a/sfx2/source/dialog/templdlg.cxx b/sfx2/source/dialog/templdlg.cxx
index 4096986..8e0d421 100644
--- a/sfx2/source/dialog/templdlg.cxx
+++ b/sfx2/source/dialog/templdlg.cxx
@@ -1912,8 +1912,8 @@ void SfxCommonTemplateDialog_Impl::DeleteHdl()
 SvTreeListEntry* pEntry = pTreeBox ? pTreeBox->FirstSelected() : 
aFmtLb->FirstSelected();
 const SfxStyleFamilyItem* pItem = GetFamilyItem_Impl();
 
-OUString aMsg = SfxResId(STR_DELETE_STYLE_USED).toString();
-aMsg += SfxResId(STR_DELETE_STYLE).toString();
+OUString aMsg = SfxResId(STR_DELETE_STYLE_USED).toString()
+  + SfxResId(STR_DELETE_STYLE).toString();
 
 while (pEntry)
 {
diff --git a/stoc/source/javavm/javavm.cxx b/stoc/source/javavm/javavm.cxx
index e37023b..dcba929 100644
--- a/stoc/source/javavm/javavm.cxx
+++ b/stoc/source/javavm/javavm.cxx
@@ -286,14 +286,12 @@ void getINetPropsFromConfig(stoc_javavm::JVM * pjvm,
 // read ftp proxy name
 css::uno::Reference ftpProxy_name = 
xRegistryRootKey->openKe