summaryrefslogtreecommitdiff
path: root/svtools
diff options
context:
space:
mode:
authorStephan Bergmann <sbergman@redhat.com>2013-12-11 15:16:51 +0100
committerStephan Bergmann <sbergman@redhat.com>2013-12-11 15:16:51 +0100
commit90f91088d238469b4a2262c91de3117ba40f5bde (patch)
treebad912690be028b4242744eed6755b36bb1bcefa /svtools
parent2fa2d39bf3eb2f216e13f6dd2c6c5c35fd19627c (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')
-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..76428658dd5e 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 }
+ { "GraphicType", UNOGRAPHIC_GRAPHICTYPE, ::getCppuType( (const sal_Int8*)(0)), beans::PropertyAttribute::READONLY, 0 },
+ { "MimeType", UNOGRAPHIC_MIMETYPE, ::getCppuType( (const OUString*)(0)), beans::PropertyAttribute::READONLY, 0 },
+ { "SizePixel", UNOGRAPHIC_SIZEPIXEL, ::getCppuType( (const awt::Size*)(0)), beans::PropertyAttribute::READONLY, 0 },
+ { "Size100thMM", UNOGRAPHIC_SIZE100THMM, ::getCppuType( (const awt::Size*)(0)), beans::PropertyAttribute::READONLY, 0 },
+ { "BitsPerPixel", UNOGRAPHIC_BITSPERPIXEL, ::getCppuType( (const sal_uInt8*)(0)), beans::PropertyAttribute::READONLY, 0 },
+ { "Transparent", UNOGRAPHIC_TRANSPARENT, ::getCppuType( (const sal_Bool*)(0)), beans::PropertyAttribute::READONLY, 0 },
+ { "Alpha", UNOGRAPHIC_ALPHA, ::getCppuType( (const sal_Bool*)(0)), beans::PropertyAttribute::READONLY, 0 },
+ { "Animated", UNOGRAPHIC_ANIMATED, ::getCppuType( (const sal_Bool*)(0)), beans::PropertyAttribute::READONLY, 0 },
+ {}
};
pRet->acquire();
diff --git a/svtools/source/graphic/renderer.cxx b/svtools/source/graphic/renderer.cxx
index ef397f413053..38b1849cf398 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 }
+ { "Device", UNOGRAPHIC_DEVICE, ::getCppuType( (const uno::Any*)(0)), 0, 0 },
+ { "DestinationRect", UNOGRAPHIC_DESTINATIONRECT, ::getCppuType( (const awt::Rectangle*)(0)), 0, 0 },
+ { "RenderData", UNOGRAPHIC_RENDERDATA, ::getCppuType( (const uno::Any*)(0)), 0, 0 },
+ {}
};
pRet->acquire();
diff --git a/svtools/source/uno/unoimap.cxx b/svtools/source/uno/unoimap.cxx
index ad57fccc693c..c6f4194672c6 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}
+ { "URL", HANDLE_URL, ::getCppuType((const OUString*)0), 0, 0 },
+ { "Title", HANDLE_TITLE, ::getCppuType((const OUString*)0), 0, 0 },
+ { "Description", HANDLE_DESCRIPTION, ::getCppuType((const OUString*)0), 0, 0 },
+ { "Target", HANDLE_TARGET, ::getCppuType((const OUString*)0), 0, 0 },
+ { "Name", HANDLE_NAME, ::getCppuType((const OUString*)0), 0, 0 },
+ { "IsActive", HANDLE_ISACTIVE, ::getBooleanCppuType(), 0, 0 },
+ { "Polygon", HANDLE_POLYGON, ::getCppuType((const PointSequence*)0), 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}
+ { "URL", HANDLE_URL, ::getCppuType((const OUString*)0), 0, 0 },
+ { "Title", HANDLE_TITLE, ::getCppuType((const OUString*)0), 0, 0 },
+ { "Description", HANDLE_DESCRIPTION, ::getCppuType((const OUString*)0), 0, 0 },
+ { "Target", HANDLE_TARGET, ::getCppuType((const OUString*)0), 0, 0 },
+ { "Name", HANDLE_NAME, ::getCppuType((const OUString*)0), 0, 0 },
+ { "IsActive", HANDLE_ISACTIVE, ::getBooleanCppuType(), 0, 0 },
+ { "Center", HANDLE_CENTER, ::getCppuType((const awt::Point*)0), 0, 0 },
+ { "Radius", HANDLE_RADIUS, ::getCppuType((const sal_Int32*)0), 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}
+ { "URL", HANDLE_URL, ::getCppuType((const OUString*)0), 0, 0 },
+ { "Title", HANDLE_TITLE, ::getCppuType((const OUString*)0), 0, 0 },
+ { "Description", HANDLE_DESCRIPTION, ::getCppuType((const OUString*)0), 0, 0 },
+ { "Target", HANDLE_TARGET, ::getCppuType((const OUString*)0), 0, 0 },
+ { "Name", HANDLE_NAME, ::getCppuType((const OUString*)0), 0, 0 },
+ { "IsActive", HANDLE_ISACTIVE, ::getBooleanCppuType(), 0, 0 },
+ { "Boundary", HANDLE_BOUNDARY, ::getCppuType((const awt::Rectangle*)0), 0, 0 },
+ {}
};
return new PropertySetInfo( aRectangleObj_Impl );