summaryrefslogtreecommitdiff
path: root/svtools/source
diff options
context:
space:
mode:
authorStephan Bergmann <sbergman@redhat.com>2013-12-11 15:16:51 +0100
committerStephan Bergmann <sbergman@redhat.com>2013-12-12 08:26:40 +0100
commita62c2a5fa5d5be465b0edab6adeb1fd16ace462f (patch)
tree47cf29b4b7a0ba3ce321ce628a6b0a6175d978d7 /svtools/source
parentcff72ec4bf87c6484be97d954966309ba7a5eb8a (diff)
Don't hold css::uno::Type instances by pointer
...in comphelper::PropertyMapEntry and SfxItemPropertyMapEntry. And as the arrays of such need to be initialized dynamically anyway, also change their name members to proper OUStrings while at it. Plus some const clean-up. Change-Id: I67d4d7b5773fb020605f369daf39528bec930606
Diffstat (limited to 'svtools/source')
-rw-r--r--svtools/source/graphic/descriptor.cxx21
-rw-r--r--svtools/source/graphic/renderer.cxx11
-rw-r--r--svtools/source/uno/unoimap.cxx61
3 files changed, 44 insertions, 49 deletions
diff --git a/svtools/source/graphic/descriptor.cxx b/svtools/source/graphic/descriptor.cxx
index 47588d84b36e..3642591fc154 100644
--- a/svtools/source/graphic/descriptor.cxx
+++ b/svtools/source/graphic/descriptor.cxx
@@ -296,18 +296,17 @@ uno::Sequence< sal_Int8 > SAL_CALL GraphicDescriptor::getImplementationId()
SolarMutexGuard aGuard;
::comphelper::PropertySetInfo* pRet = new ::comphelper::PropertySetInfo();
- static ::comphelper::PropertyMapEntry aEntries[] =
+ static ::comphelper::PropertyMapEntry const aEntries[] =
{
- { MAP_CHAR_LEN( "GraphicType" ), UNOGRAPHIC_GRAPHICTYPE, &::getCppuType( (const sal_Int8*)(0)), beans::PropertyAttribute::READONLY, 0 },
- { MAP_CHAR_LEN( "MimeType" ), UNOGRAPHIC_MIMETYPE, &::getCppuType( (const OUString*)(0)), beans::PropertyAttribute::READONLY, 0 },
- { MAP_CHAR_LEN( "SizePixel" ), UNOGRAPHIC_SIZEPIXEL, &::getCppuType( (const awt::Size*)(0)), beans::PropertyAttribute::READONLY, 0 },
- { MAP_CHAR_LEN( "Size100thMM" ), UNOGRAPHIC_SIZE100THMM, &::getCppuType( (const awt::Size*)(0)), beans::PropertyAttribute::READONLY, 0 },
- { MAP_CHAR_LEN( "BitsPerPixel" ), UNOGRAPHIC_BITSPERPIXEL, &::getCppuType( (const sal_uInt8*)(0)), beans::PropertyAttribute::READONLY, 0 },
- { MAP_CHAR_LEN( "Transparent" ), UNOGRAPHIC_TRANSPARENT, &::getCppuType( (const sal_Bool*)(0)), beans::PropertyAttribute::READONLY, 0 },
- { MAP_CHAR_LEN( "Alpha" ), UNOGRAPHIC_ALPHA, &::getCppuType( (const sal_Bool*)(0)), beans::PropertyAttribute::READONLY, 0 },
- { MAP_CHAR_LEN( "Animated" ), UNOGRAPHIC_ANIMATED, &::getCppuType( (const sal_Bool*)(0)), beans::PropertyAttribute::READONLY, 0 },
-
- { 0,0,0,0,0,0 }
+ { OUString("GraphicType"), UNOGRAPHIC_GRAPHICTYPE, ::getCppuType( (const sal_Int8*)(0)), beans::PropertyAttribute::READONLY, 0 },
+ { OUString("MimeType"), UNOGRAPHIC_MIMETYPE, ::getCppuType( (const OUString*)(0)), beans::PropertyAttribute::READONLY, 0 },
+ { OUString("SizePixel"), UNOGRAPHIC_SIZEPIXEL, ::getCppuType( (const awt::Size*)(0)), beans::PropertyAttribute::READONLY, 0 },
+ { OUString("Size100thMM"), UNOGRAPHIC_SIZE100THMM, ::getCppuType( (const awt::Size*)(0)), beans::PropertyAttribute::READONLY, 0 },
+ { OUString("BitsPerPixel"), UNOGRAPHIC_BITSPERPIXEL, ::getCppuType( (const sal_uInt8*)(0)), beans::PropertyAttribute::READONLY, 0 },
+ { OUString("Transparent"), UNOGRAPHIC_TRANSPARENT, ::getCppuType( (const sal_Bool*)(0)), beans::PropertyAttribute::READONLY, 0 },
+ { OUString("Alpha"), UNOGRAPHIC_ALPHA, ::getCppuType( (const sal_Bool*)(0)), beans::PropertyAttribute::READONLY, 0 },
+ { OUString("Animated"), UNOGRAPHIC_ANIMATED, ::getCppuType( (const sal_Bool*)(0)), beans::PropertyAttribute::READONLY, 0 },
+ { OUString(), 0, css::uno::Type(), 0, 0 }
};
pRet->acquire();
diff --git a/svtools/source/graphic/renderer.cxx b/svtools/source/graphic/renderer.cxx
index ef397f413053..412bb573ae5a 100644
--- a/svtools/source/graphic/renderer.cxx
+++ b/svtools/source/graphic/renderer.cxx
@@ -191,13 +191,12 @@ uno::Sequence< sal_Int8 > SAL_CALL GraphicRendererVCL::getImplementationId()
SolarMutexGuard aGuard;
::comphelper::PropertySetInfo* pRet = new ::comphelper::PropertySetInfo();
- static ::comphelper::PropertyMapEntry aEntries[] =
+ static ::comphelper::PropertyMapEntry const aEntries[] =
{
- { MAP_CHAR_LEN( "Device" ), UNOGRAPHIC_DEVICE, &::getCppuType( (const uno::Any*)(0)), 0, 0 },
- { MAP_CHAR_LEN( "DestinationRect" ), UNOGRAPHIC_DESTINATIONRECT, &::getCppuType( (const awt::Rectangle*)(0)), 0, 0 },
- { MAP_CHAR_LEN( "RenderData" ), UNOGRAPHIC_RENDERDATA, &::getCppuType( (const uno::Any*)(0)), 0, 0 },
-
- { 0,0,0,0,0,0 }
+ { OUString("Device"), UNOGRAPHIC_DEVICE, ::getCppuType( (const uno::Any*)(0)), 0, 0 },
+ { OUString("DestinationRect"), UNOGRAPHIC_DESTINATIONRECT, ::getCppuType( (const awt::Rectangle*)(0)), 0, 0 },
+ { OUString("RenderData"), UNOGRAPHIC_RENDERDATA, ::getCppuType( (const uno::Any*)(0)), 0, 0 },
+ { OUString(), 0, css::uno::Type(), 0, 0 }
};
pRet->acquire();
diff --git a/svtools/source/uno/unoimap.cxx b/svtools/source/uno/unoimap.cxx
index ad57fccc693c..dec735e64fef 100644
--- a/svtools/source/uno/unoimap.cxx
+++ b/svtools/source/uno/unoimap.cxx
@@ -42,9 +42,6 @@
#include <svtools/imaprect.hxx>
#include <svtools/imappoly.hxx>
-#define MAP_LEN(x) x, sizeof(x)-1
-
-
using namespace comphelper;
using namespace cppu;
using namespace com::sun::star;
@@ -126,39 +123,39 @@ private:
UNO3_GETIMPLEMENTATION_IMPL( SvUnoImageMapObject );
-PropertySetInfo* SvUnoImageMapObject::createPropertySetInfo( sal_uInt16 nType )
+PropertySetInfo * SvUnoImageMapObject::createPropertySetInfo( sal_uInt16 nType )
{
switch( nType )
{
case IMAP_OBJ_POLYGON:
{
- static PropertyMapEntry aPolygonObj_Impl[] =
+ static PropertyMapEntry const aPolygonObj_Impl[] =
{
- { MAP_LEN( "URL" ), HANDLE_URL, &::getCppuType((const OUString*)0), 0, 0 },
- { MAP_LEN( "Title" ), HANDLE_TITLE, &::getCppuType((const OUString*)0), 0, 0 },
- { MAP_LEN( "Description" ), HANDLE_DESCRIPTION, &::getCppuType((const OUString*)0), 0, 0 },
- { MAP_LEN( "Target" ), HANDLE_TARGET, &::getCppuType((const OUString*)0), 0, 0 },
- { MAP_LEN( "Name" ), HANDLE_NAME, &::getCppuType((const OUString*)0), 0, 0 },
- { MAP_LEN( "IsActive" ), HANDLE_ISACTIVE, &::getBooleanCppuType(), 0, 0 },
- { MAP_LEN( "Polygon" ), HANDLE_POLYGON, &::getCppuType((const PointSequence*)0), 0, 0 },
- {0,0,0,0,0,0}
+ { OUString("URL"), HANDLE_URL, ::getCppuType((const OUString*)0), 0, 0 },
+ { OUString("Title"), HANDLE_TITLE, ::getCppuType((const OUString*)0), 0, 0 },
+ { OUString("Description"), HANDLE_DESCRIPTION, ::getCppuType((const OUString*)0), 0, 0 },
+ { OUString("Target"), HANDLE_TARGET, ::getCppuType((const OUString*)0), 0, 0 },
+ { OUString("Name"), HANDLE_NAME, ::getCppuType((const OUString*)0), 0, 0 },
+ { OUString("IsActive"), HANDLE_ISACTIVE, ::getBooleanCppuType(), 0, 0 },
+ { OUString("Polygon"), HANDLE_POLYGON, ::getCppuType((const PointSequence*)0), 0, 0 },
+ { OUString(), 0, css::uno::Type(), 0, 0 }
};
return new PropertySetInfo( aPolygonObj_Impl );
}
case IMAP_OBJ_CIRCLE:
{
- static PropertyMapEntry aCircleObj_Impl[] =
+ static PropertyMapEntry const aCircleObj_Impl[] =
{
- { MAP_LEN( "URL" ), HANDLE_URL, &::getCppuType((const OUString*)0), 0, 0 },
- { MAP_LEN( "Title" ), HANDLE_TITLE, &::getCppuType((const OUString*)0), 0, 0 },
- { MAP_LEN( "Description" ), HANDLE_DESCRIPTION, &::getCppuType((const OUString*)0), 0, 0 },
- { MAP_LEN( "Target" ), HANDLE_TARGET, &::getCppuType((const OUString*)0), 0, 0 },
- { MAP_LEN( "Name" ), HANDLE_NAME, &::getCppuType((const OUString*)0), 0, 0 },
- { MAP_LEN( "IsActive" ), HANDLE_ISACTIVE, &::getBooleanCppuType(), 0, 0 },
- { MAP_LEN( "Center" ), HANDLE_CENTER, &::getCppuType((const awt::Point*)0), 0, 0 },
- { MAP_LEN( "Radius" ), HANDLE_RADIUS, &::getCppuType((const sal_Int32*)0), 0, 0 },
- {0,0,0,0,0,0}
+ { OUString("URL"), HANDLE_URL, ::getCppuType((const OUString*)0), 0, 0 },
+ { OUString("Title"), HANDLE_TITLE, ::getCppuType((const OUString*)0), 0, 0 },
+ { OUString("Description"), HANDLE_DESCRIPTION, ::getCppuType((const OUString*)0), 0, 0 },
+ { OUString("Target"), HANDLE_TARGET, ::getCppuType((const OUString*)0), 0, 0 },
+ { OUString("Name"), HANDLE_NAME, ::getCppuType((const OUString*)0), 0, 0 },
+ { OUString("IsActive"), HANDLE_ISACTIVE, ::getBooleanCppuType(), 0, 0 },
+ { OUString("Center"), HANDLE_CENTER, ::getCppuType((const awt::Point*)0), 0, 0 },
+ { OUString("Radius"), HANDLE_RADIUS, ::getCppuType((const sal_Int32*)0), 0, 0 },
+ { OUString(), 0, css::uno::Type(), 0, 0 }
};
return new PropertySetInfo( aCircleObj_Impl );
@@ -166,16 +163,16 @@ PropertySetInfo* SvUnoImageMapObject::createPropertySetInfo( sal_uInt16 nType )
case IMAP_OBJ_RECTANGLE:
default:
{
- static PropertyMapEntry aRectangleObj_Impl[] =
+ static PropertyMapEntry const aRectangleObj_Impl[] =
{
- { MAP_LEN( "URL" ), HANDLE_URL, &::getCppuType((const OUString*)0), 0, 0 },
- { MAP_LEN( "Title" ), HANDLE_TITLE, &::getCppuType((const OUString*)0), 0, 0 },
- { MAP_LEN( "Description" ), HANDLE_DESCRIPTION, &::getCppuType((const OUString*)0), 0, 0 },
- { MAP_LEN( "Target" ), HANDLE_TARGET, &::getCppuType((const OUString*)0), 0, 0 },
- { MAP_LEN( "Name" ), HANDLE_NAME, &::getCppuType((const OUString*)0), 0, 0 },
- { MAP_LEN( "IsActive" ), HANDLE_ISACTIVE, &::getBooleanCppuType(), 0, 0 },
- { MAP_LEN( "Boundary" ), HANDLE_BOUNDARY, &::getCppuType((const awt::Rectangle*)0), 0, 0 },
- {0,0,0,0,0,0}
+ { OUString("URL"), HANDLE_URL, ::getCppuType((const OUString*)0), 0, 0 },
+ { OUString("Title"), HANDLE_TITLE, ::getCppuType((const OUString*)0), 0, 0 },
+ { OUString("Description"), HANDLE_DESCRIPTION, ::getCppuType((const OUString*)0), 0, 0 },
+ { OUString("Target"), HANDLE_TARGET, ::getCppuType((const OUString*)0), 0, 0 },
+ { OUString("Name"), HANDLE_NAME, ::getCppuType((const OUString*)0), 0, 0 },
+ { OUString("IsActive"), HANDLE_ISACTIVE, ::getBooleanCppuType(), 0, 0 },
+ { OUString("Boundary"), HANDLE_BOUNDARY, ::getCppuType((const awt::Rectangle*)0), 0, 0 },
+ { OUString(), 0, css::uno::Type(), 0, 0 }
};
return new PropertySetInfo( aRectangleObj_Impl );