[Libreoffice-commits] core.git: forms/source helpcompiler/source oox/source opencl/source reportdesign/source
Libreoffice Gerrit user
logerrit at kemper.freedesktop.org
Wed Nov 21 12:00:29 UTC 2018
forms/source/component/Columns.cxx | 9 -
forms/source/component/Edit.cxx | 6
forms/source/component/File.cxx | 14 -
forms/source/component/ImageButton.cxx | 5
forms/source/component/clickableimage.cxx | 5
forms/source/runtime/formoperations.cxx | 18 --
forms/source/xforms/convert.cxx | 8 -
helpcompiler/source/HelpCompiler.cxx | 8 -
oox/source/drawingml/texteffectscontext.cxx | 130 ++++++++----------
oox/source/export/shapes.cxx | 68 ++++-----
opencl/source/openclwrapper.cxx | 8 -
reportdesign/source/core/sdr/RptObject.cxx | 78 +++++-----
reportdesign/source/filter/xml/xmlControlProperty.cxx | 23 +--
13 files changed, 171 insertions(+), 209 deletions(-)
New commits:
commit 55e42805ea796cc92d2e93dfce9200b9c13eaeb4
Author: Noel Grandin <noel.grandin at collabora.co.uk>
AuthorDate: Wed Nov 21 11:48:58 2018 +0200
Commit: Noel Grandin <noel.grandin at collabora.co.uk>
CommitDate: Wed Nov 21 13:00:02 2018 +0100
improve function-local statics in forms..reportdesign
Change-Id: I285e2e75c8d9cad35445c89f00ef68b155806ea2
Reviewed-on: https://gerrit.libreoffice.org/63703
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin at collabora.co.uk>
diff --git a/forms/source/component/Columns.cxx b/forms/source/component/Columns.cxx
index 24a431aca5d5..42de375a20b9 100644
--- a/forms/source/component/Columns.cxx
+++ b/forms/source/component/Columns.cxx
@@ -63,10 +63,10 @@ const sal_uInt16 COMPATIBLE_HIDDEN = 0x0008;
const css::uno::Sequence<OUString>& getColumnTypes()
{
- static css::uno::Sequence<OUString> aColumnTypes(10);
- if (aColumnTypes.getConstArray()[0].isEmpty())
+ static css::uno::Sequence<OUString> aColumnTypes = [&]()
{
- OUString* pNames = aColumnTypes.getArray();
+ css::uno::Sequence<OUString> tmp(10);
+ OUString* pNames = tmp.getArray();
pNames[TYPE_CHECKBOX] = "CheckBox";
pNames[TYPE_COMBOBOX] = "ComboBox";
pNames[TYPE_CURRENCYFIELD] = "CurrencyField";
@@ -77,7 +77,8 @@ const css::uno::Sequence<OUString>& getColumnTypes()
pNames[TYPE_PATTERNFIELD] = "PatternField";
pNames[TYPE_TEXTFIELD] = "TextField";
pNames[TYPE_TIMEFIELD] = "TimeField";
- }
+ return tmp;
+ }();
return aColumnTypes;
}
diff --git a/forms/source/component/Edit.cxx b/forms/source/component/Edit.cxx
index 589b0e7ffd3b..5eacc041a2ba 100644
--- a/forms/source/component/Edit.cxx
+++ b/forms/source/component/Edit.cxx
@@ -61,12 +61,8 @@ using namespace ::com::sun::star::form::binding;
Sequence<Type> OEditControl::_getTypes()
{
- static Sequence<Type> aTypes;
- if (!aTypes.getLength())
- {
// my two base classes
- aTypes = concatSequences(OBoundControl::_getTypes(), OEditControl_BASE::getTypes());
- }
+ static Sequence<Type> const aTypes = concatSequences(OBoundControl::_getTypes(), OEditControl_BASE::getTypes());
return aTypes;
}
diff --git a/forms/source/component/File.cxx b/forms/source/component/File.cxx
index 281f18e9a476..b2fc1da00430 100644
--- a/forms/source/component/File.cxx
+++ b/forms/source/component/File.cxx
@@ -46,18 +46,8 @@ using namespace ::com::sun::star::util;
Sequence<Type> OFileControlModel::_getTypes()
{
- static Sequence<Type> aTypes;
- if (!aTypes.getLength())
- {
- // my base class
- Sequence<Type> aBaseClassTypes = OControlModel::_getTypes();
-
- Sequence<Type> aOwnTypes(1);
- Type* pOwnTypes = aOwnTypes.getArray();
- pOwnTypes[0] = cppu::UnoType<XReset>::get();
-
- aTypes = concatSequences(aBaseClassTypes, aOwnTypes);
- }
+ static Sequence<Type> const aTypes =
+ concatSequences(OControlModel::_getTypes(), Sequence<Type>{ cppu::UnoType<XReset>::get() });
return aTypes;
}
diff --git a/forms/source/component/ImageButton.cxx b/forms/source/component/ImageButton.cxx
index 51b21175dc4d..74092fba5e1c 100644
--- a/forms/source/component/ImageButton.cxx
+++ b/forms/source/component/ImageButton.cxx
@@ -143,9 +143,8 @@ void OImageButtonModel::read(const Reference<XObjectInputStream>& _rxInStream)
// OImageButtonControl
Sequence<Type> OImageButtonControl::_getTypes()
{
- static Sequence<Type> aTypes;
- if (!aTypes.getLength())
- aTypes = concatSequences(OClickableImageBaseControl::_getTypes(), OImageButtonControl_BASE::getTypes());
+ static Sequence<Type> const aTypes =
+ concatSequences(OClickableImageBaseControl::_getTypes(), OImageButtonControl_BASE::getTypes());
return aTypes;
}
diff --git a/forms/source/component/clickableimage.cxx b/forms/source/component/clickableimage.cxx
index bae745377e41..36637975e9ba 100644
--- a/forms/source/component/clickableimage.cxx
+++ b/forms/source/component/clickableimage.cxx
@@ -77,9 +77,8 @@ namespace frm
Sequence<Type> OClickableImageBaseControl::_getTypes()
{
- static Sequence<Type> aTypes;
- if (!aTypes.getLength())
- aTypes = concatSequences(OControl::_getTypes(), OClickableImageBaseControl_BASE::getTypes());
+ static Sequence<Type> const aTypes =
+ concatSequences(OControl::_getTypes(), OClickableImageBaseControl_BASE::getTypes());
return aTypes;
}
diff --git a/forms/source/runtime/formoperations.cxx b/forms/source/runtime/formoperations.cxx
index 76e3ec2a9647..8eaca59166d8 100644
--- a/forms/source/runtime/formoperations.cxx
+++ b/forms/source/runtime/formoperations.cxx
@@ -1188,19 +1188,13 @@ namespace frm
// nobody's interested in ...
return;
- static Sequence< sal_Int16 > s_aModifyDependentFeatures;
- if ( s_aModifyDependentFeatures.getLength() == 0 )
+ static Sequence< sal_Int16 > const s_aModifyDependentFeatures
{
- sal_Int16 pModifyDependentFeatures[] =
- {
- FormFeature::MoveToNext,
- FormFeature::MoveToInsertRow,
- FormFeature::SaveRecordChanges,
- FormFeature::UndoRecordChanges
- };
- size_t const nFeatureCount = SAL_N_ELEMENTS( pModifyDependentFeatures );
- s_aModifyDependentFeatures = Sequence< sal_Int16 >( pModifyDependentFeatures, nFeatureCount );
- }
+ FormFeature::MoveToNext,
+ FormFeature::MoveToInsertRow,
+ FormFeature::SaveRecordChanges,
+ FormFeature::UndoRecordChanges
+ };
Reference< XFeatureInvalidation > xInvalidation = m_xFeatureInvalidation;
_rClearForCallback.clear();
diff --git a/forms/source/xforms/convert.cxx b/forms/source/xforms/convert.cxx
index f82dfd9e0a7d..f00dd5e166db 100644
--- a/forms/source/xforms/convert.cxx
+++ b/forms/source/xforms/convert.cxx
@@ -288,12 +288,8 @@ void Convert::init()
Convert& Convert::get()
{
// create our Singleton instance on demand
- static Convert* pConvert = nullptr;
- if( pConvert == nullptr )
- pConvert = new Convert();
-
- OSL_ENSURE( pConvert != nullptr, "no converter?" );
- return *pConvert;
+ static Convert aConvert;
+ return aConvert;
}
bool Convert::hasType( const css::uno::Type& rType )
diff --git a/helpcompiler/source/HelpCompiler.cxx b/helpcompiler/source/HelpCompiler.cxx
index 9050c5f983a1..08c2149d8516 100644
--- a/helpcompiler/source/HelpCompiler.cxx
+++ b/helpcompiler/source/HelpCompiler.cxx
@@ -509,13 +509,7 @@ namespace fs
{
rtl_TextEncoding getThreadTextEncoding()
{
- static bool bNeedsInit = true;
- static rtl_TextEncoding nThreadTextEncoding;
- if( bNeedsInit )
- {
- bNeedsInit = false;
- nThreadTextEncoding = osl_getThreadTextEncoding();
- }
+ static rtl_TextEncoding nThreadTextEncoding = osl_getThreadTextEncoding();
return nThreadTextEncoding;
}
diff --git a/oox/source/drawingml/texteffectscontext.cxx b/oox/source/drawingml/texteffectscontext.cxx
index 7359da879e85..79d69408996d 100644
--- a/oox/source/drawingml/texteffectscontext.cxx
+++ b/oox/source/drawingml/texteffectscontext.cxx
@@ -20,82 +20,80 @@ namespace oox { namespace drawingml {
namespace
{
-OUString lclGetNameForElementId(sal_uInt32 aId)
+OUString const & lclGetNameForElementId(sal_uInt32 aId)
{
- static std::map<sal_uInt32, OUString> aIdMap;
- if(aIdMap.empty())
+ static std::map<sal_uInt32, OUString> const aIdMap
{
- aIdMap[OOX_TOKEN(w14, srgbClr)] = "srgbClr";
- aIdMap[OOX_TOKEN(w14, schemeClr)] = "schemeClr";
- aIdMap[OOX_TOKEN(w14, tint)] = "tint";
- aIdMap[OOX_TOKEN(w14, shade)] = "shade";
- aIdMap[OOX_TOKEN(w14, alpha)] = "alpha";
- aIdMap[OOX_TOKEN(w14, hueMod)] = "hueMod";
- aIdMap[OOX_TOKEN(w14, sat)] = "sat";
- aIdMap[OOX_TOKEN(w14, satOff)] = "satOff";
- aIdMap[OOX_TOKEN(w14, satMod)] = "satMod";
- aIdMap[OOX_TOKEN(w14, lum)] = "lum";
- aIdMap[OOX_TOKEN(w14, lumOff)] = "lumOff";
- aIdMap[OOX_TOKEN(w14, lumMod)] = "lumMod";
- aIdMap[OOX_TOKEN(w14, noFill)] = "noFill";
- aIdMap[OOX_TOKEN(w14, solidFill)] = "solidFill";
- aIdMap[OOX_TOKEN(w14, gradFill)] = "gradFill";
- aIdMap[OOX_TOKEN(w14, gsLst)] = "gsLst";
- aIdMap[OOX_TOKEN(w14, gs)] = "gs";
- aIdMap[OOX_TOKEN(w14, pos)] = "pos";
- aIdMap[OOX_TOKEN(w14, lin)] = "lin";
- aIdMap[OOX_TOKEN(w14, path)] = "path";
- aIdMap[OOX_TOKEN(w14, fillToRect)] = "fillToRect";
- aIdMap[OOX_TOKEN(w14, prstDash)] = "prstDash";
- aIdMap[OOX_TOKEN(w14, round)] = "round";
- aIdMap[OOX_TOKEN(w14, bevel)] = "bevel";
- aIdMap[OOX_TOKEN(w14, miter)] = "miter";
- aIdMap[OOX_TOKEN(w14, camera)] = "camera";
- aIdMap[OOX_TOKEN(w14, lightRig)] = "lightRig";
- aIdMap[OOX_TOKEN(w14, rot)] = "rot";
- aIdMap[OOX_TOKEN(w14, bevelT)] = "bevelT";
- aIdMap[OOX_TOKEN(w14, bevelB)] = "bevelB";
- aIdMap[OOX_TOKEN(w14, extrusionClr)] = "extrusionClr";
- aIdMap[OOX_TOKEN(w14, contourClr)] = "contourClr";
- aIdMap[OOX_TOKEN(w14, styleSet)] = "styleSet";
+ { OOX_TOKEN(w14, srgbClr) , "srgbClr" },
+ { OOX_TOKEN(w14, schemeClr) , "schemeClr" },
+ { OOX_TOKEN(w14, tint) , "tint" },
+ { OOX_TOKEN(w14, shade) , "shade" },
+ { OOX_TOKEN(w14, alpha) , "alpha" },
+ { OOX_TOKEN(w14, hueMod) , "hueMod" },
+ { OOX_TOKEN(w14, sat) , "sat" },
+ { OOX_TOKEN(w14, satOff) , "satOff" },
+ { OOX_TOKEN(w14, satMod) , "satMod" },
+ { OOX_TOKEN(w14, lum) , "lum" },
+ { OOX_TOKEN(w14, lumOff) , "lumOff" },
+ { OOX_TOKEN(w14, lumMod) , "lumMod" },
+ { OOX_TOKEN(w14, noFill) , "noFill" },
+ { OOX_TOKEN(w14, solidFill) , "solidFill" },
+ { OOX_TOKEN(w14, gradFill) , "gradFill" },
+ { OOX_TOKEN(w14, gsLst) , "gsLst" },
+ { OOX_TOKEN(w14, gs) , "gs" },
+ { OOX_TOKEN(w14, pos) , "pos" },
+ { OOX_TOKEN(w14, lin) , "lin" },
+ { OOX_TOKEN(w14, path) , "path" },
+ { OOX_TOKEN(w14, fillToRect) , "fillToRect" },
+ { OOX_TOKEN(w14, prstDash) , "prstDash" },
+ { OOX_TOKEN(w14, round) , "round" },
+ { OOX_TOKEN(w14, bevel) , "bevel" },
+ { OOX_TOKEN(w14, miter) , "miter" },
+ { OOX_TOKEN(w14, camera) , "camera" },
+ { OOX_TOKEN(w14, lightRig) , "lightRig" },
+ { OOX_TOKEN(w14, rot) , "rot" },
+ { OOX_TOKEN(w14, bevelT) , "bevelT" },
+ { OOX_TOKEN(w14, bevelB) , "bevelB" },
+ { OOX_TOKEN(w14, extrusionClr) , "extrusionClr" },
+ { OOX_TOKEN(w14, contourClr) , "contourClr"} ,
+ { OOX_TOKEN(w14, styleSet) , "styleSet" },
- aIdMap[OOX_TOKEN(w14, glow)] = "glow";
- aIdMap[OOX_TOKEN(w14, shadow)] = "shadow";
- aIdMap[OOX_TOKEN(w14, reflection)] = "reflection";
- aIdMap[OOX_TOKEN(w14, textOutline)] = "textOutline";
- aIdMap[OOX_TOKEN(w14, textFill)] = "textFill";
- aIdMap[OOX_TOKEN(w14, scene3d)] = "scene3d";
- aIdMap[OOX_TOKEN(w14, props3d)] = "props3d";
- aIdMap[OOX_TOKEN(w14, ligatures)] = "ligatures";
- aIdMap[OOX_TOKEN(w14, numForm)] = "numForm";
- aIdMap[OOX_TOKEN(w14, numSpacing)] = "numSpacing";
- aIdMap[OOX_TOKEN(w14, stylisticSets)]= "stylisticSets";
- aIdMap[OOX_TOKEN(w14, cntxtAlts)] = "cntxtAlts";
- }
+ { OOX_TOKEN(w14, glow) , "glow" },
+ { OOX_TOKEN(w14, shadow) , "shadow" },
+ { OOX_TOKEN(w14, reflection) , "reflection" },
+ { OOX_TOKEN(w14, textOutline) , "textOutline" },
+ { OOX_TOKEN(w14, textFill) , "textFill" },
+ { OOX_TOKEN(w14, scene3d) , "scene3d" },
+ { OOX_TOKEN(w14, props3d) , "props3d" },
+ { OOX_TOKEN(w14, ligatures) , "ligatures" },
+ { OOX_TOKEN(w14, numForm) , "numForm" },
+ { OOX_TOKEN(w14, numSpacing) , "numSpacing" },
+ { OOX_TOKEN(w14, stylisticSets), "stylisticSets" },
+ { OOX_TOKEN(w14, cntxtAlts) , "cntxtAlts" },
+ };
- return aIdMap[aId];
+ return aIdMap.find(aId)->second;
}
OUString lclGetGrabBagName(sal_uInt32 aId)
{
- static std::map<sal_uInt32, OUString> aGrabBagNameMap;
- if(aGrabBagNameMap.empty())
+ static std::map<sal_uInt32, OUString> const aGrabBagNameMap
{
- aGrabBagNameMap[OOX_TOKEN(w14, glow)] = "CharGlowTextEffect";
- aGrabBagNameMap[OOX_TOKEN(w14, shadow)] = "CharShadowTextEffect";
- aGrabBagNameMap[OOX_TOKEN(w14, reflection)] = "CharReflectionTextEffect";
- aGrabBagNameMap[OOX_TOKEN(w14, textOutline)] = "CharTextOutlineTextEffect";
- aGrabBagNameMap[OOX_TOKEN(w14, textFill)] = "CharTextFillTextEffect";
- aGrabBagNameMap[OOX_TOKEN(w14, scene3d)] = "CharScene3DTextEffect";
- aGrabBagNameMap[OOX_TOKEN(w14, props3d)] = "CharProps3DTextEffect";
- aGrabBagNameMap[OOX_TOKEN(w14, ligatures)] = "CharLigaturesTextEffect";
- aGrabBagNameMap[OOX_TOKEN(w14, numForm)] = "CharNumFormTextEffect";
- aGrabBagNameMap[OOX_TOKEN(w14, numSpacing)] = "CharNumSpacingTextEffect";
- aGrabBagNameMap[OOX_TOKEN(w14, stylisticSets)]= "CharStylisticSetsTextEffect";
- aGrabBagNameMap[OOX_TOKEN(w14, cntxtAlts)] = "CharCntxtAltsTextEffect";
- }
+ { OOX_TOKEN(w14, glow) , "CharGlowTextEffect" },
+ { OOX_TOKEN(w14, shadow) , "CharShadowTextEffect" },
+ { OOX_TOKEN(w14, reflection) , "CharReflectionTextEffect" },
+ { OOX_TOKEN(w14, textOutline) , "CharTextOutlineTextEffect" },
+ { OOX_TOKEN(w14, textFill) , "CharTextFillTextEffect" },
+ { OOX_TOKEN(w14, scene3d) , "CharScene3DTextEffect" },
+ { OOX_TOKEN(w14, props3d) , "CharProps3DTextEffect" },
+ { OOX_TOKEN(w14, ligatures) , "CharLigaturesTextEffect" },
+ { OOX_TOKEN(w14, numForm) , "CharNumFormTextEffect" },
+ { OOX_TOKEN(w14, numSpacing) , "CharNumSpacingTextEffect" },
+ { OOX_TOKEN(w14, stylisticSets), "CharStylisticSetsTextEffect" },
+ { OOX_TOKEN(w14, cntxtAlts) , "CharCntxtAltsTextEffect" },
+ };
- return aGrabBagNameMap[aId];
+ return aGrabBagNameMap.find(aId)->second;
}
}
diff --git a/oox/source/export/shapes.cxx b/oox/source/export/shapes.cxx
index fabaa43a3f54..7544db053339 100644
--- a/oox/source/export/shapes.cxx
+++ b/oox/source/export/shapes.cxx
@@ -1449,43 +1449,37 @@ typedef std::unordered_map< const char*, ShapeConverter, rtl::CStringHash, rtl::
static const NameToConvertMapType& lcl_GetConverters()
{
- static bool shape_map_inited = false;
- static NameToConvertMapType shape_converters;
- if( shape_map_inited )
- {
- return shape_converters;
- }
-
- shape_converters[ "com.sun.star.drawing.ClosedBezierShape" ] = &ShapeExport::WriteClosedPolyPolygonShape;
- shape_converters[ "com.sun.star.drawing.ConnectorShape" ] = &ShapeExport::WriteConnectorShape;
- shape_converters[ "com.sun.star.drawing.CustomShape" ] = &ShapeExport::WriteCustomShape;
- shape_converters[ "com.sun.star.drawing.EllipseShape" ] = &ShapeExport::WriteEllipseShape;
- shape_converters[ "com.sun.star.drawing.GraphicObjectShape" ] = &ShapeExport::WriteGraphicObjectShape;
- shape_converters[ "com.sun.star.drawing.LineShape" ] = &ShapeExport::WriteLineShape;
- shape_converters[ "com.sun.star.drawing.OpenBezierShape" ] = &ShapeExport::WriteOpenPolyPolygonShape;
- shape_converters[ "com.sun.star.drawing.PolyPolygonShape" ] = &ShapeExport::WriteClosedPolyPolygonShape;
- shape_converters[ "com.sun.star.drawing.PolyLineShape" ] = &ShapeExport::WriteClosedPolyPolygonShape;
- shape_converters[ "com.sun.star.drawing.RectangleShape" ] = &ShapeExport::WriteRectangleShape;
- shape_converters[ "com.sun.star.drawing.OLE2Shape" ] = &ShapeExport::WriteOLE2Shape;
- shape_converters[ "com.sun.star.drawing.TableShape" ] = &ShapeExport::WriteTableShape;
- shape_converters[ "com.sun.star.drawing.TextShape" ] = &ShapeExport::WriteTextShape;
- shape_converters[ "com.sun.star.drawing.GroupShape" ] = &ShapeExport::WriteGroupShape;
-
- shape_converters[ "com.sun.star.presentation.GraphicObjectShape" ] = &ShapeExport::WriteGraphicObjectShape;
- shape_converters[ "com.sun.star.presentation.MediaShape" ] = &ShapeExport::WriteGraphicObjectShape;
- shape_converters[ "com.sun.star.presentation.OLE2Shape" ] = &ShapeExport::WriteOLE2Shape;
- shape_converters[ "com.sun.star.presentation.TableShape" ] = &ShapeExport::WriteTableShape;
- shape_converters[ "com.sun.star.presentation.TextShape" ] = &ShapeExport::WriteTextShape;
-
- shape_converters[ "com.sun.star.presentation.DateTimeShape" ] = &ShapeExport::WriteTextShape;
- shape_converters[ "com.sun.star.presentation.FooterShape" ] = &ShapeExport::WriteTextShape;
- shape_converters[ "com.sun.star.presentation.HeaderShape" ] = &ShapeExport::WriteTextShape;
- shape_converters[ "com.sun.star.presentation.NotesShape" ] = &ShapeExport::WriteTextShape;
- shape_converters[ "com.sun.star.presentation.OutlinerShape" ] = &ShapeExport::WriteTextShape;
- shape_converters[ "com.sun.star.presentation.SlideNumberShape" ] = &ShapeExport::WriteTextShape;
- shape_converters[ "com.sun.star.presentation.TitleTextShape" ] = &ShapeExport::WriteTextShape;
- shape_map_inited = true;
-
+ static NameToConvertMapType const shape_converters
+ {
+ { "com.sun.star.drawing.ClosedBezierShape" , &ShapeExport::WriteClosedPolyPolygonShape },
+ { "com.sun.star.drawing.ConnectorShape" , &ShapeExport::WriteConnectorShape },
+ { "com.sun.star.drawing.CustomShape" , &ShapeExport::WriteCustomShape },
+ { "com.sun.star.drawing.EllipseShape" , &ShapeExport::WriteEllipseShape },
+ { "com.sun.star.drawing.GraphicObjectShape" , &ShapeExport::WriteGraphicObjectShape },
+ { "com.sun.star.drawing.LineShape" , &ShapeExport::WriteLineShape },
+ { "com.sun.star.drawing.OpenBezierShape" , &ShapeExport::WriteOpenPolyPolygonShape },
+ { "com.sun.star.drawing.PolyPolygonShape" , &ShapeExport::WriteClosedPolyPolygonShape },
+ { "com.sun.star.drawing.PolyLineShape" , &ShapeExport::WriteClosedPolyPolygonShape },
+ { "com.sun.star.drawing.RectangleShape" , &ShapeExport::WriteRectangleShape },
+ { "com.sun.star.drawing.OLE2Shape" , &ShapeExport::WriteOLE2Shape },
+ { "com.sun.star.drawing.TableShape" , &ShapeExport::WriteTableShape },
+ { "com.sun.star.drawing.TextShape" , &ShapeExport::WriteTextShape },
+ { "com.sun.star.drawing.GroupShape" , &ShapeExport::WriteGroupShape },
+
+ { "com.sun.star.presentation.GraphicObjectShape" , &ShapeExport::WriteGraphicObjectShape },
+ { "com.sun.star.presentation.MediaShape" , &ShapeExport::WriteGraphicObjectShape },
+ { "com.sun.star.presentation.OLE2Shape" , &ShapeExport::WriteOLE2Shape },
+ { "com.sun.star.presentation.TableShape" , &ShapeExport::WriteTableShape },
+ { "com.sun.star.presentation.TextShape" , &ShapeExport::WriteTextShape },
+
+ { "com.sun.star.presentation.DateTimeShape" , &ShapeExport::WriteTextShape },
+ { "com.sun.star.presentation.FooterShape" , &ShapeExport::WriteTextShape },
+ { "com.sun.star.presentation.HeaderShape" , &ShapeExport::WriteTextShape },
+ { "com.sun.star.presentation.NotesShape" , &ShapeExport::WriteTextShape },
+ { "com.sun.star.presentation.OutlinerShape" , &ShapeExport::WriteTextShape },
+ { "com.sun.star.presentation.SlideNumberShape" , &ShapeExport::WriteTextShape },
+ { "com.sun.star.presentation.TitleTextShape" , &ShapeExport::WriteTextShape },
+ };
return shape_converters;
}
diff --git a/opencl/source/openclwrapper.cxx b/opencl/source/openclwrapper.cxx
index 436906340c53..1194758f4f4d 100644
--- a/opencl/source/openclwrapper.cxx
+++ b/opencl/source/openclwrapper.cxx
@@ -94,17 +94,15 @@ OString generateMD5(const void* pData, size_t length)
OString const & getCacheFolder()
{
- static OString aCacheFolder;
-
- if (aCacheFolder.isEmpty())
+ static OString const aCacheFolder = [&]()
{
OUString url("${$BRAND_BASE_DIR/" LIBO_ETC_FOLDER "/" SAL_CONFIGFILE("bootstrap") ":UserInstallation}/cache/");
rtl::Bootstrap::expandMacros(url);
osl::Directory::create(url);
- aCacheFolder = OUStringToOString(url, RTL_TEXTENCODING_UTF8);
- }
+ return OUStringToOString(url, RTL_TEXTENCODING_UTF8);
+ }();
return aCacheFolder;
}
diff --git a/reportdesign/source/core/sdr/RptObject.cxx b/reportdesign/source/core/sdr/RptObject.cxx
index eb0f45742e77..0fe29d2d0252 100644
--- a/reportdesign/source/core/sdr/RptObject.cxx
+++ b/reportdesign/source/core/sdr/RptObject.cxx
@@ -249,68 +249,72 @@ const TPropertyNamePair& getPropertyNameMap(sal_uInt16 _nObjectId)
{
case OBJ_DLG_IMAGECONTROL:
{
- static TPropertyNamePair s_aNameMap;
- if ( s_aNameMap.empty() )
+ static TPropertyNamePair s_aNameMap = [&]()
{
std::shared_ptr<AnyConverter> aNoConverter(new AnyConverter);
- s_aNameMap.emplace(PROPERTY_CONTROLBACKGROUND,TPropertyConverter(PROPERTY_BACKGROUNDCOLOR,aNoConverter));
- s_aNameMap.emplace(PROPERTY_CONTROLBORDER,TPropertyConverter(PROPERTY_BORDER,aNoConverter));
- s_aNameMap.emplace(PROPERTY_CONTROLBORDERCOLOR,TPropertyConverter(PROPERTY_BORDERCOLOR,aNoConverter));
- }
+ TPropertyNamePair tmp;
+ tmp.emplace(PROPERTY_CONTROLBACKGROUND,TPropertyConverter(PROPERTY_BACKGROUNDCOLOR,aNoConverter));
+ tmp.emplace(PROPERTY_CONTROLBORDER,TPropertyConverter(PROPERTY_BORDER,aNoConverter));
+ tmp.emplace(PROPERTY_CONTROLBORDERCOLOR,TPropertyConverter(PROPERTY_BORDERCOLOR,aNoConverter));
+ return tmp;
+ }();
return s_aNameMap;
}
case OBJ_DLG_FIXEDTEXT:
{
- static TPropertyNamePair s_aNameMap;
- if ( s_aNameMap.empty() )
+ static TPropertyNamePair s_aNameMap = [&]()
{
std::shared_ptr<AnyConverter> aNoConverter(new AnyConverter);
- s_aNameMap.emplace(PROPERTY_CHARCOLOR,TPropertyConverter(PROPERTY_TEXTCOLOR,aNoConverter));
- s_aNameMap.emplace(PROPERTY_CONTROLBACKGROUND,TPropertyConverter(PROPERTY_BACKGROUNDCOLOR,aNoConverter));
- s_aNameMap.emplace(PROPERTY_CHARUNDERLINECOLOR,TPropertyConverter(PROPERTY_TEXTLINECOLOR,aNoConverter));
- s_aNameMap.emplace(PROPERTY_CHARRELIEF,TPropertyConverter(PROPERTY_FONTRELIEF,aNoConverter));
- s_aNameMap.emplace(PROPERTY_CHARFONTHEIGHT,TPropertyConverter(PROPERTY_FONTHEIGHT,aNoConverter));
- s_aNameMap.emplace(PROPERTY_CHARSTRIKEOUT,TPropertyConverter(PROPERTY_FONTSTRIKEOUT,aNoConverter));
- s_aNameMap.emplace(PROPERTY_CONTROLTEXTEMPHASISMARK,TPropertyConverter(PROPERTY_FONTEMPHASISMARK,aNoConverter));
- s_aNameMap.emplace(PROPERTY_CONTROLBORDER,TPropertyConverter(PROPERTY_BORDER,aNoConverter));
- s_aNameMap.emplace(PROPERTY_CONTROLBORDERCOLOR,TPropertyConverter(PROPERTY_BORDERCOLOR,aNoConverter));
+ TPropertyNamePair tmp;
+ tmp.emplace(PROPERTY_CHARCOLOR,TPropertyConverter(PROPERTY_TEXTCOLOR,aNoConverter));
+ tmp.emplace(PROPERTY_CONTROLBACKGROUND,TPropertyConverter(PROPERTY_BACKGROUNDCOLOR,aNoConverter));
+ tmp.emplace(PROPERTY_CHARUNDERLINECOLOR,TPropertyConverter(PROPERTY_TEXTLINECOLOR,aNoConverter));
+ tmp.emplace(PROPERTY_CHARRELIEF,TPropertyConverter(PROPERTY_FONTRELIEF,aNoConverter));
+ tmp.emplace(PROPERTY_CHARFONTHEIGHT,TPropertyConverter(PROPERTY_FONTHEIGHT,aNoConverter));
+ tmp.emplace(PROPERTY_CHARSTRIKEOUT,TPropertyConverter(PROPERTY_FONTSTRIKEOUT,aNoConverter));
+ tmp.emplace(PROPERTY_CONTROLTEXTEMPHASISMARK,TPropertyConverter(PROPERTY_FONTEMPHASISMARK,aNoConverter));
+ tmp.emplace(PROPERTY_CONTROLBORDER,TPropertyConverter(PROPERTY_BORDER,aNoConverter));
+ tmp.emplace(PROPERTY_CONTROLBORDERCOLOR,TPropertyConverter(PROPERTY_BORDERCOLOR,aNoConverter));
std::shared_ptr<AnyConverter> aParaAdjust(new ParaAdjust);
- s_aNameMap.emplace(PROPERTY_PARAADJUST,TPropertyConverter(PROPERTY_ALIGN,aParaAdjust));
- }
+ tmp.emplace(PROPERTY_PARAADJUST,TPropertyConverter(PROPERTY_ALIGN,aParaAdjust));
+ return tmp;
+ }();
return s_aNameMap;
}
case OBJ_DLG_FORMATTEDFIELD:
{
- static TPropertyNamePair s_aNameMap;
- if ( s_aNameMap.empty() )
+ static TPropertyNamePair s_aNameMap = [&]()
{
std::shared_ptr<AnyConverter> aNoConverter(new AnyConverter);
- s_aNameMap.emplace(PROPERTY_CHARCOLOR,TPropertyConverter(PROPERTY_TEXTCOLOR,aNoConverter));
- s_aNameMap.emplace(PROPERTY_CONTROLBACKGROUND,TPropertyConverter(PROPERTY_BACKGROUNDCOLOR,aNoConverter));
- s_aNameMap.emplace(PROPERTY_CHARUNDERLINECOLOR,TPropertyConverter(PROPERTY_TEXTLINECOLOR,aNoConverter));
- s_aNameMap.emplace(PROPERTY_CHARRELIEF,TPropertyConverter(PROPERTY_FONTRELIEF,aNoConverter));
- s_aNameMap.emplace(PROPERTY_CHARFONTHEIGHT,TPropertyConverter(PROPERTY_FONTHEIGHT,aNoConverter));
- s_aNameMap.emplace(PROPERTY_CHARSTRIKEOUT,TPropertyConverter(PROPERTY_FONTSTRIKEOUT,aNoConverter));
- s_aNameMap.emplace(PROPERTY_CONTROLTEXTEMPHASISMARK,TPropertyConverter(PROPERTY_FONTEMPHASISMARK,aNoConverter));
- s_aNameMap.emplace(PROPERTY_CONTROLBORDER,TPropertyConverter(PROPERTY_BORDER,aNoConverter));
- s_aNameMap.emplace(PROPERTY_CONTROLBORDERCOLOR,TPropertyConverter(PROPERTY_BORDERCOLOR,aNoConverter));
+ TPropertyNamePair tmp;
+ tmp.emplace(PROPERTY_CHARCOLOR,TPropertyConverter(PROPERTY_TEXTCOLOR,aNoConverter));
+ tmp.emplace(PROPERTY_CONTROLBACKGROUND,TPropertyConverter(PROPERTY_BACKGROUNDCOLOR,aNoConverter));
+ tmp.emplace(PROPERTY_CHARUNDERLINECOLOR,TPropertyConverter(PROPERTY_TEXTLINECOLOR,aNoConverter));
+ tmp.emplace(PROPERTY_CHARRELIEF,TPropertyConverter(PROPERTY_FONTRELIEF,aNoConverter));
+ tmp.emplace(PROPERTY_CHARFONTHEIGHT,TPropertyConverter(PROPERTY_FONTHEIGHT,aNoConverter));
+ tmp.emplace(PROPERTY_CHARSTRIKEOUT,TPropertyConverter(PROPERTY_FONTSTRIKEOUT,aNoConverter));
+ tmp.emplace(PROPERTY_CONTROLTEXTEMPHASISMARK,TPropertyConverter(PROPERTY_FONTEMPHASISMARK,aNoConverter));
+ tmp.emplace(PROPERTY_CONTROLBORDER,TPropertyConverter(PROPERTY_BORDER,aNoConverter));
+ tmp.emplace(PROPERTY_CONTROLBORDERCOLOR,TPropertyConverter(PROPERTY_BORDERCOLOR,aNoConverter));
std::shared_ptr<AnyConverter> aParaAdjust(new ParaAdjust);
- s_aNameMap.emplace(PROPERTY_PARAADJUST,TPropertyConverter(PROPERTY_ALIGN,aParaAdjust));
- }
+ tmp.emplace(PROPERTY_PARAADJUST,TPropertyConverter(PROPERTY_ALIGN,aParaAdjust));
+ return tmp;
+ }();
return s_aNameMap;
}
case OBJ_CUSTOMSHAPE:
{
- static TPropertyNamePair s_aNameMap;
- if ( s_aNameMap.empty() )
+ static TPropertyNamePair s_aNameMap = [&]()
{
std::shared_ptr<AnyConverter> aNoConverter(new AnyConverter);
- s_aNameMap.emplace(OUString("FillColor"),TPropertyConverter(PROPERTY_CONTROLBACKGROUND,aNoConverter));
- s_aNameMap.emplace(PROPERTY_PARAADJUST,TPropertyConverter(PROPERTY_ALIGN,aNoConverter));
- }
+ TPropertyNamePair tmp;
+ tmp.emplace(OUString("FillColor"),TPropertyConverter(PROPERTY_CONTROLBACKGROUND,aNoConverter));
+ tmp.emplace(PROPERTY_PARAADJUST,TPropertyConverter(PROPERTY_ALIGN,aNoConverter));
+ return tmp;
+ }();
return s_aNameMap;
}
diff --git a/reportdesign/source/filter/xml/xmlControlProperty.cxx b/reportdesign/source/filter/xml/xmlControlProperty.cxx
index e7009a0eca24..82cb361d58c7 100644
--- a/reportdesign/source/filter/xml/xmlControlProperty.cxx
+++ b/reportdesign/source/filter/xml/xmlControlProperty.cxx
@@ -82,20 +82,19 @@ OXMLControlProperty::OXMLControlProperty( ORptFilter& rImport
case XML_TOK_VALUE_TYPE:
{
// needs to be translated into a css::uno::Type
- static std::map< OUString, css::uno::Type > s_aTypeNameMap;
- if (s_aTypeNameMap.empty())
+ static std::map< OUString, css::uno::Type > const s_aTypeNameMap
{
- s_aTypeNameMap[GetXMLToken( XML_BOOLEAN)] = cppu::UnoType<bool>::get();
+ { GetXMLToken( XML_BOOLEAN) , cppu::UnoType<bool>::get() },
// Not a copy paste error, see comment xmloff/source/forms/propertyimport.cxx lines 244-248
- s_aTypeNameMap[GetXMLToken( XML_FLOAT)] = cppu::UnoType<double>::get();
- s_aTypeNameMap[GetXMLToken( XML_DOUBLE)] = cppu::UnoType<double>::get();
- s_aTypeNameMap[GetXMLToken( XML_STRING)] = cppu::UnoType<OUString>::get();
- s_aTypeNameMap[GetXMLToken( XML_INT)] = cppu::UnoType<sal_Int32>::get();
- s_aTypeNameMap[GetXMLToken( XML_SHORT)] = cppu::UnoType<sal_Int16>::get();
- s_aTypeNameMap[GetXMLToken( XML_DATE)] = cppu::UnoType<css::util::Date>::get();
- s_aTypeNameMap[GetXMLToken( XML_TIME)] = cppu::UnoType<css::util::Time>::get();
- s_aTypeNameMap[GetXMLToken( XML_VOID)] = cppu::UnoType<void>::get();
- }
+ { GetXMLToken( XML_FLOAT) , cppu::UnoType<double>::get() },
+ { GetXMLToken( XML_DOUBLE) , cppu::UnoType<double>::get() },
+ { GetXMLToken( XML_STRING) , cppu::UnoType<OUString>::get() },
+ { GetXMLToken( XML_INT) , cppu::UnoType<sal_Int32>::get() },
+ { GetXMLToken( XML_SHORT) , cppu::UnoType<sal_Int16>::get() },
+ { GetXMLToken( XML_DATE) , cppu::UnoType<css::util::Date>::get() },
+ { GetXMLToken( XML_TIME) , cppu::UnoType<css::util::Time>::get() },
+ { GetXMLToken( XML_VOID) , cppu::UnoType<void>::get() },
+ };
const std::map< OUString, css::uno::Type >::const_iterator aTypePos = s_aTypeNameMap.find(sValue);
OSL_ENSURE(s_aTypeNameMap.end() != aTypePos, "OXMLControlProperty::OXMLControlProperty: invalid type!");
More information about the Libreoffice-commits
mailing list