1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
3 * This file is part of the LibreOffice project.
5 * This Source Code Form is subject to the terms of the Mozilla Public
6 * License, v. 2.0. If a copy of the MPL was not distributed with this
7 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
9 * This file incorporates work covered by the following license notice:
11 * Licensed to the Apache Software Foundation (ASF) under one or more
12 * contributor license agreements. See the NOTICE file distributed
13 * with this work for additional information regarding copyright
14 * ownership. The ASF licenses this file to you under the Apache
15 * License, Version 2.0 (the "License"); you may not use this file
16 * except in compliance with the License. You may obtain a copy of
17 * the License at http://www.apache.org/licenses/LICENSE-2.0 .
20 #include <sal/macros.h>
21 #include <com/sun/star/table/XTable.hpp>
22 #include <com/sun/star/container/XIndexAccess.hpp>
23 #include <com/sun/star/frame/XModel.hpp>
24 #include <com/sun/star/embed/XEmbeddedObject.hpp>
25 #include <com/sun/star/util/MeasureUnit.hpp>
26 #include <com/sun/star/drawing/TextVerticalAdjust.hpp>
27 #include <com/sun/star/media/ZoomLevel.hpp>
28 #include <com/sun/star/io/XInputStream.hpp>
29 #include <com/sun/star/beans/PropertyAttribute.hpp>
30 #include <tools/fldunit.hxx>
31 #include <osl/mutex.hxx>
32 #include <vcl/svapp.hxx>
33 #include <comphelper/propertysetinfo.hxx>
34 #include <svx/dialmgr.hxx>
35 #include "svx/unoapi.hxx"
36 #include <editeng/unotext.hxx>
37 #include <svx/unoshprp.hxx>
38 #include <editeng/editeng.hxx>
39 #include "svx/globl3d.hxx"
40 #include <svx/dialogs.hrc>
41 #include <svx/svdpool.hxx>
42 #include <svx/svdobj.hxx>
44 #include <shapeimpl.hxx>
45 #include <unordered_map>
47 using namespace ::com::sun::star
;
48 using namespace ::com::sun::star::beans::PropertyAttribute
;
49 using ::com::sun::star::drawing::TextVerticalAdjust
;
51 SfxItemPropertyMapEntry
const * ImplGetSvxShapePropertyMap()
53 static SfxItemPropertyMapEntry
const aShapePropertyMap_Impl
[] =
58 LINE_PROPERTIES_START_END
59 SHAPE_DESCRIPTOR_PROPERTIES
66 CUSTOMSHAPE_PROPERTIES
67 { OUString("UserDefinedAttributes"), SDRATTR_XMLATTRIBUTES
, cppu::UnoType
<com::sun::star::container::XNameContainer
>::get(), 0, 0},
68 { OUString("ParaUserDefinedAttributes"), EE_PARA_XMLATTRIBS
, cppu::UnoType
<com::sun::star::container::XNameContainer
>::get(), 0, 0},
69 { OUString(), 0, css::uno::Type(), 0, 0 }
72 return aShapePropertyMap_Impl
;
75 SfxItemPropertyMapEntry
const * ImplGetSvxTextShapePropertyMap()
77 static SfxItemPropertyMapEntry
const aTextShapePropertyMap_Impl
[] =
82 LINE_PROPERTIES_START_END
83 SHAPE_DESCRIPTOR_PROPERTIES
84 MISC_OBJ_PROPERTIES_NO_SHEAR
90 CUSTOMSHAPE_PROPERTIES
91 { OUString("UserDefinedAttributes"), SDRATTR_XMLATTRIBUTES
, cppu::UnoType
<com::sun::star::container::XNameContainer
>::get(), 0, 0},
92 { OUString("ParaUserDefinedAttributes"), EE_PARA_XMLATTRIBS
, cppu::UnoType
<com::sun::star::container::XNameContainer
>::get(), 0, 0},
93 { OUString(), 0, css::uno::Type(), 0, 0 }
96 return aTextShapePropertyMap_Impl
;
99 SfxItemPropertyMapEntry
const * ImplGetSvxConnectorPropertyMap()
101 static SfxItemPropertyMapEntry
const aConnectorPropertyMap_Impl
[] =
103 SPECIAL_CONNECTOR_PROPERTIES
104 EDGERADIUS_PROPERTIES
107 LINE_PROPERTIES_START_END
108 SHAPE_DESCRIPTOR_PROPERTIES
110 LINKTARGET_PROPERTIES
115 { OUString("UserDefinedAttributes"), SDRATTR_XMLATTRIBUTES
, cppu::UnoType
<com::sun::star::container::XNameContainer
>::get(), 0, 0},
116 { OUString("ParaUserDefinedAttributes"), EE_PARA_XMLATTRIBS
, cppu::UnoType
<com::sun::star::container::XNameContainer
>::get(), 0, 0},
117 { OUString(), 0, css::uno::Type(), 0, 0 }
120 return aConnectorPropertyMap_Impl
;
123 SfxItemPropertyMapEntry
const * ImplGetSvxDimensioningPropertyMap()
125 static SfxItemPropertyMapEntry
const aDimensioningPropertyMap_Impl
[] =
127 SPECIAL_DIMENSIONING_PROPERTIES
128 EDGERADIUS_PROPERTIES
131 LINE_PROPERTIES_START_END
132 SHAPE_DESCRIPTOR_PROPERTIES
134 LINKTARGET_PROPERTIES
139 { OUString("UserDefinedAttributes"), SDRATTR_XMLATTRIBUTES
, cppu::UnoType
<com::sun::star::container::XNameContainer
>::get(), 0, 0},
140 { OUString("ParaUserDefinedAttributes"), EE_PARA_XMLATTRIBS
, cppu::UnoType
<com::sun::star::container::XNameContainer
>::get(), 0, 0},
141 { OUString(), 0, css::uno::Type(), 0, 0 }
144 return aDimensioningPropertyMap_Impl
;
147 SfxItemPropertyMapEntry
const * ImplGetSvxCirclePropertyMap()
149 static SfxItemPropertyMapEntry
const aCirclePropertyMap_Impl
[] =
151 SPECIAL_CIRCLE_PROPERTIES
152 EDGERADIUS_PROPERTIES
155 LINE_PROPERTIES_START_END
156 SHAPE_DESCRIPTOR_PROPERTIES
158 LINKTARGET_PROPERTIES
163 CUSTOMSHAPE_PROPERTIES
164 { OUString("UserDefinedAttributes"), SDRATTR_XMLATTRIBUTES
, cppu::UnoType
<com::sun::star::container::XNameContainer
>::get(), 0, 0},
165 { OUString("ParaUserDefinedAttributes"), EE_PARA_XMLATTRIBS
, cppu::UnoType
<com::sun::star::container::XNameContainer
>::get(), 0, 0},
166 { OUString(), 0, css::uno::Type(), 0, 0 }
169 return aCirclePropertyMap_Impl
;
172 SfxItemPropertyMapEntry
const * ImplGetSvxPolyPolygonPropertyMap()
174 static SfxItemPropertyMapEntry
const aPolyPolygonPropertyMap_Impl
[] =
176 { OUString("Geometry"), OWN_ATTR_BASE_GEOMETRY
, cppu::UnoType
<css::drawing::PointSequenceSequence
>::get(), 0, 0 },
177 SPECIAL_POLYGON_PROPERTIES
178 SPECIAL_POLYPOLYGON_PROPERTIES
181 LINE_PROPERTIES_START_END
182 SHAPE_DESCRIPTOR_PROPERTIES
184 LINKTARGET_PROPERTIES
189 CUSTOMSHAPE_PROPERTIES
190 { OUString("UserDefinedAttributes"), SDRATTR_XMLATTRIBUTES
, cppu::UnoType
<com::sun::star::container::XNameContainer
>::get(), 0, 0},
191 { OUString("ParaUserDefinedAttributes"), EE_PARA_XMLATTRIBS
, cppu::UnoType
<com::sun::star::container::XNameContainer
>::get(), 0, 0},
192 { OUString(), 0, css::uno::Type(), 0, 0 }
195 return aPolyPolygonPropertyMap_Impl
;
198 SfxItemPropertyMapEntry
const * ImplGetSvxPolyPolygonBezierPropertyMap()
200 static SfxItemPropertyMapEntry
const aPolyPolygonBezierPropertyMap_Impl
[] =
202 { OUString("Geometry"), OWN_ATTR_BASE_GEOMETRY
, cppu::UnoType
<com::sun::star::drawing::PolyPolygonBezierCoords
>::get(), 0, 0 },
203 SPECIAL_POLYGON_PROPERTIES
204 SPECIAL_POLYPOLYGONBEZIER_PROPERTIES
207 LINE_PROPERTIES_START_END
208 SHAPE_DESCRIPTOR_PROPERTIES
210 LINKTARGET_PROPERTIES
215 CUSTOMSHAPE_PROPERTIES
216 { OUString("UserDefinedAttributes"), SDRATTR_XMLATTRIBUTES
, cppu::UnoType
<com::sun::star::container::XNameContainer
>::get(), 0, 0},
217 { OUString("ParaUserDefinedAttributes"), EE_PARA_XMLATTRIBS
, cppu::UnoType
<com::sun::star::container::XNameContainer
>::get(), 0, 0},
218 { OUString(), 0, css::uno::Type(), 0, 0 }
221 return aPolyPolygonBezierPropertyMap_Impl
;
224 SfxItemPropertyMapEntry
const * ImplGetSvxGraphicObjectPropertyMap()
226 static SfxItemPropertyMapEntry
const aGraphicObjectPropertyMap_Impl
[] =
228 SPECIAL_GRAPHOBJ_PROPERTIES
234 LINE_PROPERTIES_START_END
235 SHAPE_DESCRIPTOR_PROPERTIES
237 // #i118485# Full properties now, shear included
240 LINKTARGET_PROPERTIES
245 { OUString("IsMirrored"), OWN_ATTR_MIRRORED
, cppu::UnoType
<bool>::get(), 0, 0},
246 { OUString("UserDefinedAttributes"), SDRATTR_XMLATTRIBUTES
, cppu::UnoType
<com::sun::star::container::XNameContainer
>::get(), 0, 0},
247 { OUString("ParaUserDefinedAttributes"), EE_PARA_XMLATTRIBS
, cppu::UnoType
<com::sun::star::container::XNameContainer
>::get(), 0, 0},
248 { OUString("GraphicStream"), OWN_ATTR_GRAPHIC_STREAM
, cppu::UnoType
<css::io::XInputStream
>::get(), ::com::sun::star::beans::PropertyAttribute::READONLY
, 0},
249 { OUString(), 0, css::uno::Type(), 0, 0 }
252 return aGraphicObjectPropertyMap_Impl
;
255 SfxItemPropertyMapEntry
const * ImplGetSvx3DSceneObjectPropertyMap()
257 static SfxItemPropertyMapEntry
const a3DSceneObjectPropertyMap_Impl
[] =
259 SPECIAL_3DSCENEOBJECT_PROPERTIES
262 LINE_PROPERTIES_START_END
263 SHAPE_DESCRIPTOR_PROPERTIES
265 LINKTARGET_PROPERTIES
267 { OUString(), 0, css::uno::Type(), 0, 0 }
270 return a3DSceneObjectPropertyMap_Impl
;
273 SfxItemPropertyMapEntry
const * ImplGetSvx3DCubeObjectPropertyMap()
275 static SfxItemPropertyMapEntry
const a3DCubeObjectPropertyMap_Impl
[] =
277 SPECIAL_3DCUBEOBJECT_PROPERTIES
278 MISC_3D_OBJ_PROPERTIES
281 LINE_PROPERTIES_START_END
282 SHAPE_DESCRIPTOR_PROPERTIES
284 LINKTARGET_PROPERTIES
286 { OUString("UserDefinedAttributes"), SDRATTR_XMLATTRIBUTES
, cppu::UnoType
<com::sun::star::container::XNameContainer
>::get(), 0, 0},
287 { OUString("ParaUserDefinedAttributes"), EE_PARA_XMLATTRIBS
, cppu::UnoType
<com::sun::star::container::XNameContainer
>::get(), 0, 0},
288 { OUString(), 0, css::uno::Type(), 0, 0 }
291 return a3DCubeObjectPropertyMap_Impl
;
294 SfxItemPropertyMapEntry
const * ImplGetSvx3DSphereObjectPropertyMap()
296 static SfxItemPropertyMapEntry
const a3DSphereObjectPropertyMap_Impl
[] =
298 SPECIAL_3DSPHEREOBJECT_PROPERTIES
299 MISC_3D_OBJ_PROPERTIES
302 LINE_PROPERTIES_START_END
303 SHAPE_DESCRIPTOR_PROPERTIES
305 LINKTARGET_PROPERTIES
307 { OUString("UserDefinedAttributes"), SDRATTR_XMLATTRIBUTES
, cppu::UnoType
<com::sun::star::container::XNameContainer
>::get(), 0, 0},
308 { OUString("ParaUserDefinedAttributes"), EE_PARA_XMLATTRIBS
, cppu::UnoType
<com::sun::star::container::XNameContainer
>::get(), 0, 0},
309 { OUString(), 0, css::uno::Type(), 0, 0 }
311 return a3DSphereObjectPropertyMap_Impl
;
314 SfxItemPropertyMapEntry
const * ImplGetSvx3DLatheObjectPropertyMap()
316 static SfxItemPropertyMapEntry
const a3DLatheObjectPropertyMap_Impl
[] =
318 SPECIAL_3DLATHEOBJECT_PROPERTIES
320 // #107245# New 3D properties which are possible for lathe and extrude 3d objects
321 SPECIAL_3DLATHEANDEXTRUDEOBJ_PROPERTIES
323 SPECIAL_3DBACKSCALE_PROPERTIES
324 MISC_3D_OBJ_PROPERTIES
327 LINE_PROPERTIES_START_END
328 SHAPE_DESCRIPTOR_PROPERTIES
330 LINKTARGET_PROPERTIES
332 { OUString("UserDefinedAttributes"), SDRATTR_XMLATTRIBUTES
, cppu::UnoType
<com::sun::star::container::XNameContainer
>::get(), 0, 0},
333 { OUString("ParaUserDefinedAttributes"), EE_PARA_XMLATTRIBS
, cppu::UnoType
<com::sun::star::container::XNameContainer
>::get(), 0, 0},
334 { OUString(), 0, css::uno::Type(), 0, 0 }
337 return a3DLatheObjectPropertyMap_Impl
;
340 SfxItemPropertyMapEntry
const * ImplGetSvx3DExtrudeObjectPropertyMap()
342 static SfxItemPropertyMapEntry
const a3DExtrudeObjectPropertyMap_Impl
[] =
344 SPECIAL_3DEXTRUDEOBJECT_PROPERTIES
346 // #107245# New 3D properties which are possible for lathe and extrude 3d objects
347 SPECIAL_3DLATHEANDEXTRUDEOBJ_PROPERTIES
349 SPECIAL_3DBACKSCALE_PROPERTIES
350 MISC_3D_OBJ_PROPERTIES
353 LINE_PROPERTIES_START_END
354 SHAPE_DESCRIPTOR_PROPERTIES
356 LINKTARGET_PROPERTIES
358 { OUString("UserDefinedAttributes"), SDRATTR_XMLATTRIBUTES
, cppu::UnoType
<com::sun::star::container::XNameContainer
>::get(), 0, 0},
359 { OUString("ParaUserDefinedAttributes"), EE_PARA_XMLATTRIBS
, cppu::UnoType
<com::sun::star::container::XNameContainer
>::get(), 0, 0},
360 { OUString(), 0, css::uno::Type(), 0, 0 }
363 return a3DExtrudeObjectPropertyMap_Impl
;
366 SfxItemPropertyMapEntry
const * ImplGetSvx3DPolygonObjectPropertyMap()
368 static SfxItemPropertyMapEntry
const a3DPolygonObjectPropertyMap_Impl
[] =
370 SPECIAL_3DPOLYGONOBJECT_PROPERTIES
371 MISC_3D_OBJ_PROPERTIES
374 LINE_PROPERTIES_START_END
375 SHAPE_DESCRIPTOR_PROPERTIES
377 LINKTARGET_PROPERTIES
379 { OUString("UserDefinedAttributes"), SDRATTR_XMLATTRIBUTES
, cppu::UnoType
<com::sun::star::container::XNameContainer
>::get(), 0, 0},
380 { OUString("ParaUserDefinedAttributes"), EE_PARA_XMLATTRIBS
, cppu::UnoType
<com::sun::star::container::XNameContainer
>::get(), 0, 0},
381 { OUString(), 0, css::uno::Type(), 0, 0 }
384 return a3DPolygonObjectPropertyMap_Impl
;
387 SfxItemPropertyMapEntry
const * ImplGetSvxAllPropertyMap()
389 static SfxItemPropertyMapEntry
const aAllPropertyMap_Impl
[] =
393 LINE_PROPERTIES_START_END
395 EDGERADIUS_PROPERTIES
399 SHAPE_DESCRIPTOR_PROPERTIES
401 LINKTARGET_PROPERTIES
402 SPECIAL_CONNECTOR_PROPERTIES
403 SPECIAL_DIMENSIONING_PROPERTIES
404 SPECIAL_CIRCLE_PROPERTIES
405 SPECIAL_POLYGON_PROPERTIES
406 SPECIAL_POLYPOLYGON_PROPERTIES
407 SPECIAL_POLYPOLYGONBEZIER_PROPERTIES
408 SPECIAL_GRAPHOBJ_PROPERTIES
409 SPECIAL_3DSCENEOBJECT_PROPERTIES
410 MISC_3D_OBJ_PROPERTIES
411 SPECIAL_3DCUBEOBJECT_PROPERTIES
412 SPECIAL_3DSPHEREOBJECT_PROPERTIES
413 SPECIAL_3DLATHEOBJECT_PROPERTIES
414 SPECIAL_3DEXTRUDEOBJECT_PROPERTIES
416 // #107245# New 3D properties which are possible for lathe and extrude 3d objects
417 SPECIAL_3DLATHEANDEXTRUDEOBJ_PROPERTIES
419 SPECIAL_3DBACKSCALE_PROPERTIES
420 SPECIAL_3DPOLYGONOBJECT_PROPERTIES
421 CUSTOMSHAPE_PROPERTIES
422 { OUString("UserDefinedAttributes"), SDRATTR_XMLATTRIBUTES
, cppu::UnoType
<com::sun::star::container::XNameContainer
>::get(), 0, 0},
423 { OUString("ParaUserDefinedAttributes"), EE_PARA_XMLATTRIBS
, cppu::UnoType
<com::sun::star::container::XNameContainer
>::get(), 0, 0},
424 { OUString(), 0, css::uno::Type(), 0, 0 }
427 return aAllPropertyMap_Impl
;
430 SfxItemPropertyMapEntry
const * ImplGetSvxGroupPropertyMap()
432 static SfxItemPropertyMapEntry
const aGroupPropertyMap_Impl
[] =
434 SHAPE_DESCRIPTOR_PROPERTIES
436 LINKTARGET_PROPERTIES
437 { OUString(), 0, css::uno::Type(), 0, 0 }
440 return aGroupPropertyMap_Impl
;
443 SfxItemPropertyMapEntry
const * ImplGetSvxOle2PropertyMap()
445 static SfxItemPropertyMapEntry
const aOle2PropertyMap_Impl
[] =
447 // #i118485# Adding properties for line, fill, text, shadow, fontwork, rotate, shear
450 LINE_PROPERTIES_START_END
451 SHAPE_DESCRIPTOR_PROPERTIES
453 LINKTARGET_PROPERTIES
458 { OUString("ThumbnailGraphicURL"), OWN_ATTR_THUMBNAIL
, cppu::UnoType
<OUString
>::get(), 0, 0 },
459 { OUString("Model"), OWN_ATTR_OLEMODEL
, cppu::UnoType
<com::sun::star::frame::XModel
>::get(), ::com::sun::star::beans::PropertyAttribute::READONLY
, 0},
460 { OUString("EmbeddedObject"), OWN_ATTR_OLE_EMBEDDED_OBJECT
, cppu::UnoType
<com::sun::star::embed::XEmbeddedObject
>::get(), ::com::sun::star::beans::PropertyAttribute::READONLY
, 0},
461 { OUString("EmbeddedObjectNoNewClient"),OWN_ATTR_OLE_EMBEDDED_OBJECT_NONEWCLIENT
, cppu::UnoType
<com::sun::star::embed::XEmbeddedObject
>::get(), ::com::sun::star::beans::PropertyAttribute::READONLY
, 0},
462 { OUString("OriginalSize"), OWN_ATTR_OLESIZE
, cppu::UnoType
<com::sun::star::awt::Size
>::get(), ::com::sun::star::beans::PropertyAttribute::READONLY
, 0},
463 { OUString("CLSID"), OWN_ATTR_CLSID
, cppu::UnoType
<OUString
>::get(), 0, 0 },
464 { OUString("IsInternal"), OWN_ATTR_INTERNAL_OLE
, cppu::UnoType
<bool>::get() , ::com::sun::star::beans::PropertyAttribute::READONLY
, 0},
465 { OUString("VisibleArea"), OWN_ATTR_OLE_VISAREA
, cppu::UnoType
<com::sun::star::awt::Rectangle
>::get(), 0, 0},
466 { OUString("Aspect"), OWN_ATTR_OLE_ASPECT
, cppu::UnoType
<sal_Int64
>::get(), 0, 0},
467 { OUString(UNO_NAME_OLE2_PERSISTNAME
), OWN_ATTR_PERSISTNAME
, cppu::UnoType
<OUString
>::get(), 0, 0 },
468 { OUString("LinkURL"), OWN_ATTR_OLE_LINKURL
, cppu::UnoType
<OUString
>::get(), 0, 0 },
469 { OUString(UNO_NAME_GRAPHOBJ_GRAPHIC
), OWN_ATTR_VALUE_GRAPHIC
, cppu::UnoType
<com::sun::star::graphic::XGraphic
>::get(), 0, 0},
470 { OUString(), 0, css::uno::Type(), 0, 0 }
473 return aOle2PropertyMap_Impl
;
476 SfxItemPropertyMapEntry
const * ImplGetSvxPluginPropertyMap()
478 static SfxItemPropertyMapEntry
const aPluginPropertyMap_Impl
[] =
480 { OUString("PluginMimeType"), OWN_ATTR_PLUGIN_MIMETYPE
, cppu::UnoType
<OUString
>::get(), 0, 0},
481 { OUString("PluginURL"), OWN_ATTR_PLUGIN_URL
, cppu::UnoType
<OUString
>::get(), 0, 0},
482 { OUString("PluginCommands"), OWN_ATTR_PLUGIN_COMMANDS
, cppu::UnoType
<css::uno::Sequence
< ::com::sun::star::beans::PropertyValue
>>::get(), 0, 0},
483 { OUString("Transformation"), OWN_ATTR_TRANSFORMATION
, cppu::UnoType
<com::sun::star::drawing::HomogenMatrix3
>::get(), 0, 0 },
484 { OUString(UNO_NAME_MISC_OBJ_ZORDER
), OWN_ATTR_ZORDER
, cppu::UnoType
<sal_Int32
>::get(), 0, 0},
485 { OUString(UNO_NAME_MISC_OBJ_LAYERID
), SDRATTR_LAYERID
, cppu::UnoType
<sal_Int16
>::get(), 0, 0},
486 { OUString(UNO_NAME_MISC_OBJ_LAYERNAME
),SDRATTR_LAYERNAME
, cppu::UnoType
<OUString
>::get(), 0, 0},
487 { OUString(UNO_NAME_LINKDISPLAYBITMAP
), OWN_ATTR_LDBITMAP
, cppu::UnoType
<com::sun::star::awt::XBitmap
>::get(), ::com::sun::star::beans::PropertyAttribute::READONLY
, 0},
488 { OUString(UNO_NAME_LINKDISPLAYNAME
), OWN_ATTR_LDNAME
, cppu::UnoType
<OUString
>::get(), ::com::sun::star::beans::PropertyAttribute::READONLY
, 0},
489 { OUString(UNO_NAME_OLE2_METAFILE
), OWN_ATTR_METAFILE
, cppu::UnoType
<css::uno::Sequence
<sal_Int8
>>::get(), ::com::sun::star::beans::PropertyAttribute::READONLY
, 0},
490 { OUString("ThumbnailGraphicURL"), OWN_ATTR_THUMBNAIL
, cppu::UnoType
<OUString
>::get(), 0, 0 },
491 { OUString(UNO_NAME_MISC_OBJ_MOVEPROTECT
), SDRATTR_OBJMOVEPROTECT
, cppu::UnoType
<bool>::get(),0, 0},
492 { OUString(UNO_NAME_MISC_OBJ_SIZEPROTECT
), SDRATTR_OBJSIZEPROTECT
, cppu::UnoType
<bool>::get(),0, 0},
493 { OUString(UNO_NAME_OLE2_PERSISTNAME
), OWN_ATTR_PERSISTNAME
, cppu::UnoType
<OUString
>::get(), 0, 0 },
494 { OUString("LinkURL"), OWN_ATTR_OLE_LINKURL
, cppu::UnoType
<OUString
>::get(), 0, 0 },
495 { OUString(UNO_NAME_MISC_OBJ_BOUNDRECT
), OWN_ATTR_BOUNDRECT
, cppu::UnoType
<com::sun::star::awt::Rectangle
>::get(), ::com::sun::star::beans::PropertyAttribute::READONLY
, 0},
496 { OUString("VisibleArea"), OWN_ATTR_OLE_VISAREA
, cppu::UnoType
<com::sun::star::awt::Rectangle
>::get(), 0, 0},
498 { OUString(UNO_NAME_MISC_OBJ_TITLE
), OWN_ATTR_MISC_OBJ_TITLE
, cppu::UnoType
<OUString
>::get(), 0, 0},
499 { OUString(UNO_NAME_MISC_OBJ_DESCRIPTION
), OWN_ATTR_MISC_OBJ_DESCRIPTION
, cppu::UnoType
<OUString
>::get(), 0, 0},
500 { OUString(), 0, css::uno::Type(), 0, 0 }
503 return aPluginPropertyMap_Impl
;
506 SfxItemPropertyMapEntry
const * ImplGetSvxFramePropertyMap()
508 //TODO/LATER: new properties for ScrollingMode and DefaultBorder
509 static SfxItemPropertyMapEntry
const aFramePropertyMap_Impl
[] =
511 { OUString("FrameURL"), OWN_ATTR_FRAME_URL
, cppu::UnoType
<OUString
>::get(), 0, 0},
512 { OUString("FrameName"), OWN_ATTR_FRAME_NAME
, cppu::UnoType
<OUString
>::get(), 0, 0},
513 { OUString("FrameIsAutoScroll"), OWN_ATTR_FRAME_ISAUTOSCROLL
, cppu::UnoType
<bool>::get() , ::com::sun::star::beans::PropertyAttribute::MAYBEVOID
, 0},
514 { OUString("FrameIsBorder"), OWN_ATTR_FRAME_ISBORDER
, cppu::UnoType
<bool>::get() , 0, 0},
515 { OUString("FrameMarginWidth"), OWN_ATTR_FRAME_MARGIN_WIDTH
, cppu::UnoType
<sal_Int32
>::get(), 0, 0},
516 { OUString("FrameMarginHeight"), OWN_ATTR_FRAME_MARGIN_HEIGHT
, cppu::UnoType
<sal_Int32
>::get(), 0, 0},
517 { OUString("Transformation"), OWN_ATTR_TRANSFORMATION
, cppu::UnoType
<com::sun::star::drawing::HomogenMatrix3
>::get(), 0, 0 },
518 { OUString(UNO_NAME_MISC_OBJ_ZORDER
), OWN_ATTR_ZORDER
, cppu::UnoType
<sal_Int32
>::get(), 0, 0},
519 { OUString(UNO_NAME_MISC_OBJ_LAYERID
), SDRATTR_LAYERID
, cppu::UnoType
<sal_Int16
>::get(), 0, 0},
520 { OUString(UNO_NAME_MISC_OBJ_LAYERNAME
),SDRATTR_LAYERNAME
, cppu::UnoType
<OUString
>::get(), 0, 0},
521 { OUString(UNO_NAME_LINKDISPLAYBITMAP
), OWN_ATTR_LDBITMAP
, cppu::UnoType
<com::sun::star::awt::XBitmap
>::get(), ::com::sun::star::beans::PropertyAttribute::READONLY
, 0},
522 { OUString(UNO_NAME_LINKDISPLAYNAME
), OWN_ATTR_LDNAME
, cppu::UnoType
<OUString
>::get(), ::com::sun::star::beans::PropertyAttribute::READONLY
, 0},
523 { OUString(UNO_NAME_OLE2_METAFILE
), OWN_ATTR_METAFILE
, cppu::UnoType
<css::uno::Sequence
<sal_Int8
>>::get(), ::com::sun::star::beans::PropertyAttribute::READONLY
, 0},
524 { OUString("ThumbnailGraphicURL"), OWN_ATTR_THUMBNAIL
, cppu::UnoType
<OUString
>::get(), 0, 0 },
525 { OUString(UNO_NAME_MISC_OBJ_MOVEPROTECT
), SDRATTR_OBJMOVEPROTECT
, cppu::UnoType
<bool>::get(),0, 0},
526 { OUString(UNO_NAME_MISC_OBJ_SIZEPROTECT
), SDRATTR_OBJSIZEPROTECT
, cppu::UnoType
<bool>::get(),0, 0},
527 { OUString(UNO_NAME_OLE2_PERSISTNAME
), OWN_ATTR_PERSISTNAME
, cppu::UnoType
<OUString
>::get(), 0, 0 },
528 { OUString("LinkURL"), OWN_ATTR_OLE_LINKURL
, cppu::UnoType
<OUString
>::get(), 0, 0 },
529 { OUString(UNO_NAME_MISC_OBJ_BOUNDRECT
), OWN_ATTR_BOUNDRECT
, cppu::UnoType
<com::sun::star::awt::Rectangle
>::get(), ::com::sun::star::beans::PropertyAttribute::READONLY
, 0},
530 { OUString("VisibleArea"), OWN_ATTR_OLE_VISAREA
, cppu::UnoType
<com::sun::star::awt::Rectangle
>::get(), 0, 0},
532 { OUString(UNO_NAME_MISC_OBJ_TITLE
), OWN_ATTR_MISC_OBJ_TITLE
, cppu::UnoType
<OUString
>::get(), 0, 0},
533 { OUString(UNO_NAME_MISC_OBJ_DESCRIPTION
), OWN_ATTR_MISC_OBJ_DESCRIPTION
, cppu::UnoType
<OUString
>::get(), 0, 0},
534 { OUString(), 0, css::uno::Type(), 0, 0 }
537 return aFramePropertyMap_Impl
;
540 SfxItemPropertyMapEntry
const * ImplGetSvxAppletPropertyMap()
542 static SfxItemPropertyMapEntry
const aAppletPropertyMap_Impl
[] =
544 { OUString("AppletCodeBase"), OWN_ATTR_APPLET_CODEBASE
, cppu::UnoType
<OUString
>::get(), 0, 0},
545 { OUString("AppletName"), OWN_ATTR_APPLET_NAME
, cppu::UnoType
<OUString
>::get(), 0, 0},
546 { OUString("AppletCode"), OWN_ATTR_APPLET_CODE
, cppu::UnoType
<OUString
>::get(), 0, 0},
547 { OUString("AppletCommands"), OWN_ATTR_APPLET_COMMANDS
, cppu::UnoType
<css::uno::Sequence
< ::com::sun::star::beans::PropertyValue
>>::get(), 0, 0},
548 { OUString("AppletDocBase"), OWN_ATTR_APPLET_DOCBASE
, cppu::UnoType
<OUString
>::get(), 0, 0},
549 { OUString("AppletIsScript"), OWN_ATTR_APPLET_ISSCRIPT
, cppu::UnoType
<bool>::get(), 0, 0 },
550 { OUString("Transformation"), OWN_ATTR_TRANSFORMATION
, cppu::UnoType
<com::sun::star::drawing::HomogenMatrix3
>::get(), 0, 0 },
551 { OUString(UNO_NAME_MISC_OBJ_ZORDER
), OWN_ATTR_ZORDER
, cppu::UnoType
<sal_Int32
>::get(), 0, 0},
552 { OUString(UNO_NAME_MISC_OBJ_LAYERID
), SDRATTR_LAYERID
, cppu::UnoType
<sal_Int16
>::get(), 0, 0},
553 { OUString(UNO_NAME_MISC_OBJ_LAYERNAME
),SDRATTR_LAYERNAME
, cppu::UnoType
<OUString
>::get(), 0, 0},
554 { OUString(UNO_NAME_LINKDISPLAYBITMAP
), OWN_ATTR_LDBITMAP
, cppu::UnoType
<com::sun::star::awt::XBitmap
>::get(), ::com::sun::star::beans::PropertyAttribute::READONLY
, 0},
555 { OUString(UNO_NAME_LINKDISPLAYNAME
), OWN_ATTR_LDNAME
, cppu::UnoType
<OUString
>::get(), ::com::sun::star::beans::PropertyAttribute::READONLY
, 0},
556 { OUString(UNO_NAME_OLE2_METAFILE
), OWN_ATTR_METAFILE
, cppu::UnoType
<css::uno::Sequence
<sal_Int8
>>::get(), ::com::sun::star::beans::PropertyAttribute::READONLY
, 0},
557 { OUString("ThumbnailGraphicURL"), OWN_ATTR_THUMBNAIL
, cppu::UnoType
<OUString
>::get(), 0, 0 },
558 { OUString(UNO_NAME_MISC_OBJ_MOVEPROTECT
), SDRATTR_OBJMOVEPROTECT
, cppu::UnoType
<bool>::get(),0, 0},
559 { OUString(UNO_NAME_MISC_OBJ_SIZEPROTECT
), SDRATTR_OBJSIZEPROTECT
, cppu::UnoType
<bool>::get(),0, 0},
560 { OUString(UNO_NAME_OLE2_PERSISTNAME
), OWN_ATTR_PERSISTNAME
, cppu::UnoType
<OUString
>::get(), 0, 0 },
561 { OUString("LinkURL"), OWN_ATTR_OLE_LINKURL
, cppu::UnoType
<OUString
>::get(), 0, 0 },
562 { OUString(UNO_NAME_MISC_OBJ_BOUNDRECT
), OWN_ATTR_BOUNDRECT
, cppu::UnoType
<com::sun::star::awt::Rectangle
>::get(), ::com::sun::star::beans::PropertyAttribute::READONLY
, 0},
563 { OUString("VisibleArea"), OWN_ATTR_OLE_VISAREA
, cppu::UnoType
<com::sun::star::awt::Rectangle
>::get(), 0, 0},
565 { OUString(UNO_NAME_MISC_OBJ_TITLE
), OWN_ATTR_MISC_OBJ_TITLE
, cppu::UnoType
<OUString
>::get(), 0, 0},
566 { OUString(UNO_NAME_MISC_OBJ_DESCRIPTION
), OWN_ATTR_MISC_OBJ_DESCRIPTION
, cppu::UnoType
<OUString
>::get(), 0, 0},
567 { OUString(), 0, css::uno::Type(), 0, 0 }
570 return aAppletPropertyMap_Impl
;
573 SfxItemPropertyMapEntry
const * ImplGetSvxControlShapePropertyMap()
575 static SfxItemPropertyMapEntry
const aControlPropertyMap_Impl
[] =
577 // the following properties are mapped to the XControl Model of this shape
578 { OUString(UNO_NAME_EDIT_CHAR_FONTNAME
), 0, cppu::UnoType
<OUString
>::get(), 0, 0 },
579 { OUString(UNO_NAME_EDIT_CHAR_FONTSTYLENAME
), 0, cppu::UnoType
<OUString
>::get(), 0, 0 },
580 { OUString(UNO_NAME_EDIT_CHAR_FONTFAMILY
), 0, cppu::UnoType
<sal_Int16
>::get(), 0, 0 },
581 { OUString(UNO_NAME_EDIT_CHAR_FONTCHARSET
), 0, cppu::UnoType
<sal_Int16
>::get(), 0, 0 },
582 { OUString(UNO_NAME_EDIT_CHAR_HEIGHT
), 0, cppu::UnoType
<float>::get(), 0, 0 },
583 { OUString(UNO_NAME_EDIT_CHAR_FONTPITCH
), 0, cppu::UnoType
<sal_Int16
>::get(), 0, 0 },
584 { OUString(UNO_NAME_EDIT_CHAR_POSTURE
), 0, cppu::UnoType
<com::sun::star::awt::FontSlant
>::get(),0, 0 },
585 { OUString(UNO_NAME_EDIT_CHAR_WEIGHT
), 0, cppu::UnoType
<float>::get(), 0, 0 },
586 { OUString(UNO_NAME_EDIT_CHAR_UNDERLINE
), 0, cppu::UnoType
<sal_Int16
>::get(), 0, 0 },
587 { OUString(UNO_NAME_EDIT_CHAR_STRIKEOUT
), 0, cppu::UnoType
<sal_Int16
>::get(), 0, 0},
588 { OUString(UNO_NAME_EDIT_CHAR_CASEMAP
), 0, cppu::UnoType
<sal_Int16
>::get(), 0, 0 },
589 { OUString(UNO_NAME_EDIT_CHAR_COLOR
), 0, cppu::UnoType
<sal_Int32
>::get(), 0, 0 },
590 { OUString("CharBackColor"), 0, cppu::UnoType
<sal_Int32
>::get(), 0, 0 },
591 { OUString("CharBackTransparent"), 0, cppu::UnoType
<bool>::get(), 0, 0 },
592 { OUString("CharRelief"), 0, cppu::UnoType
<sal_Int16
>::get(), 0, 0 },
593 { OUString("CharUnderlineColor"), 0, cppu::UnoType
<sal_Int32
>::get(), 0, 0 },
594 { OUString("CharKerning"), 0, cppu::UnoType
<sal_Int16
>::get(), 0, 0 },
595 { OUString("CharWordMode"), 0, cppu::UnoType
<bool>::get(), 0, 0 },
596 { OUString(UNO_NAME_EDIT_PARA_ADJUST
), 0, cppu::UnoType
<sal_Int16
>::get(), 0, 0 },
597 { OUString("TextVerticalAdjust"), 0, cppu::UnoType
<TextVerticalAdjust
>::get(), MAYBEVOID
, 0 },
598 { OUString("ControlBackground"), 0, cppu::UnoType
<sal_Int32
>::get(), 0, 0 },
599 { OUString("ControlBorder"), 0, cppu::UnoType
<sal_Int16
>::get(), 0, 0 },
600 { OUString("ControlBorderColor"), 0, cppu::UnoType
<sal_Int32
>::get(), 0, 0 },
601 { OUString("ControlSymbolColor"), 0, cppu::UnoType
<sal_Int16
>::get(), 0, 0 },
602 { OUString("ImageScaleMode"), 0, cppu::UnoType
<sal_Int16
>::get(), 0, 0 },
603 { OUString(UNO_NAME_MISC_OBJ_MOVEPROTECT
), SDRATTR_OBJMOVEPROTECT
, cppu::UnoType
<bool>::get(),0, 0},
604 { OUString(UNO_NAME_MISC_OBJ_SIZEPROTECT
), SDRATTR_OBJSIZEPROTECT
, cppu::UnoType
<bool>::get(),0, 0},
605 { OUString("ControlTextEmphasis"), 0, cppu::UnoType
<sal_Int16
>::get(), 0, 0 },
606 { OUString("ControlWritingMode"), 0, cppu::UnoType
< sal_Int16
>::get(), 0, 0},
607 // the following properties are handled by SvxShape
608 { OUString("Transformation"), OWN_ATTR_TRANSFORMATION
, cppu::UnoType
<com::sun::star::drawing::HomogenMatrix3
>::get(), 0, 0 },
609 { OUString(UNO_NAME_MISC_OBJ_ZORDER
), OWN_ATTR_ZORDER
, cppu::UnoType
<sal_Int32
>::get(), 0, 0},
610 { OUString(UNO_NAME_MISC_OBJ_LAYERID
), SDRATTR_LAYERID
, cppu::UnoType
<sal_Int16
>::get(), 0, 0},
611 { OUString(UNO_NAME_MISC_OBJ_LAYERNAME
),SDRATTR_LAYERNAME
, cppu::UnoType
<OUString
>::get(), 0, 0},
612 { OUString(UNO_NAME_LINKDISPLAYBITMAP
), OWN_ATTR_LDBITMAP
, cppu::UnoType
<com::sun::star::awt::XBitmap
>::get(), ::com::sun::star::beans::PropertyAttribute::READONLY
, 0},
613 { OUString(UNO_NAME_LINKDISPLAYNAME
), OWN_ATTR_LDNAME
, cppu::UnoType
<OUString
>::get(), ::com::sun::star::beans::PropertyAttribute::READONLY
, 0},
614 { OUString("UserDefinedAttributes"), SDRATTR_XMLATTRIBUTES
, cppu::UnoType
<com::sun::star::container::XNameContainer
>::get(), 0, 0},
615 {OUString("ParaUserDefinedAttributes"), EE_PARA_XMLATTRIBS
, cppu::UnoType
<com::sun::star::container::XNameContainer
>::get(), 0, 0},
616 { OUString(UNO_NAME_MISC_OBJ_BOUNDRECT
), OWN_ATTR_BOUNDRECT
, cppu::UnoType
<com::sun::star::awt::Rectangle
>::get(), ::com::sun::star::beans::PropertyAttribute::READONLY
, 0},
618 { OUString(UNO_NAME_MISC_OBJ_TITLE
), OWN_ATTR_MISC_OBJ_TITLE
, cppu::UnoType
<OUString
>::get(), 0, 0},
619 { OUString(UNO_NAME_MISC_OBJ_DESCRIPTION
), OWN_ATTR_MISC_OBJ_DESCRIPTION
, cppu::UnoType
<OUString
>::get(), 0, 0},
621 { OUString(UNO_NAME_MISC_OBJ_PRINTABLE
), SDRATTR_OBJPRINTABLE
, cppu::UnoType
<bool>::get(), 0, 0},
622 { OUString("Visible"), SDRATTR_OBJVISIBLE
, cppu::UnoType
<bool>::get(), 0, 0},
623 { OUString(UNO_NAME_MISC_OBJ_INTEROPGRABBAG
), OWN_ATTR_INTEROPGRABBAG
, cppu::UnoType
<css::uno::Sequence
< ::com::sun::star::beans::PropertyValue
>>::get(), 0, 0},
624 { OUString(), 0, css::uno::Type(), 0, 0 }
627 return aControlPropertyMap_Impl
;
630 SfxItemPropertyMapEntry
const * ImplGetSvxPageShapePropertyMap()
632 static SfxItemPropertyMapEntry
const aPageShapePropertyMap_Impl
[] =
634 { OUString("PageNumber"), OWN_ATTR_PAGE_NUMBER
, cppu::UnoType
<sal_Int32
>::get(), 0, 0},
635 { OUString("Transformation"), OWN_ATTR_TRANSFORMATION
, cppu::UnoType
<com::sun::star::drawing::HomogenMatrix3
>::get(), 0, 0 },
636 { OUString(UNO_NAME_MISC_OBJ_ZORDER
), OWN_ATTR_ZORDER
, cppu::UnoType
<sal_Int32
>::get(), 0, 0},
637 { OUString(UNO_NAME_MISC_OBJ_LAYERID
), SDRATTR_LAYERID
, cppu::UnoType
<sal_Int16
>::get(), 0, 0},
638 { OUString(UNO_NAME_MISC_OBJ_LAYERNAME
),SDRATTR_LAYERNAME
, cppu::UnoType
<OUString
>::get(), 0, 0},
639 { OUString(UNO_NAME_LINKDISPLAYBITMAP
), OWN_ATTR_LDBITMAP
, cppu::UnoType
<com::sun::star::awt::XBitmap
>::get(), ::com::sun::star::beans::PropertyAttribute::READONLY
, 0},
640 { OUString(UNO_NAME_LINKDISPLAYNAME
), OWN_ATTR_LDNAME
, cppu::UnoType
<OUString
>::get(), ::com::sun::star::beans::PropertyAttribute::READONLY
, 0},
641 { OUString(UNO_NAME_MISC_OBJ_MOVEPROTECT
), SDRATTR_OBJMOVEPROTECT
, cppu::UnoType
<bool>::get(),0, 0},
642 { OUString(UNO_NAME_MISC_OBJ_SIZEPROTECT
), SDRATTR_OBJSIZEPROTECT
, cppu::UnoType
<bool>::get(),0, 0},
643 { OUString(UNO_NAME_MISC_OBJ_BOUNDRECT
), OWN_ATTR_BOUNDRECT
, cppu::UnoType
<com::sun::star::awt::Rectangle
>::get(), ::com::sun::star::beans::PropertyAttribute::READONLY
, 0},
645 { OUString(UNO_NAME_MISC_OBJ_TITLE
), OWN_ATTR_MISC_OBJ_TITLE
, cppu::UnoType
<OUString
>::get(), 0, 0},
646 { OUString(UNO_NAME_MISC_OBJ_DESCRIPTION
), OWN_ATTR_MISC_OBJ_DESCRIPTION
, cppu::UnoType
<OUString
>::get(), 0, 0},
647 { OUString(), 0, css::uno::Type(), 0, 0 }
650 return aPageShapePropertyMap_Impl
;
653 SfxItemPropertyMapEntry
const * ImplGetSvxCaptionPropertyMap()
655 static SfxItemPropertyMapEntry
const aCaptionPropertyMap_Impl
[] =
657 { OUString("CaptionPoint"), OWN_ATTR_CAPTION_POINT
, cppu::UnoType
<com::sun::star::awt::Point
>::get(), 0, 0 },
658 { OUString("CaptionType"), SDRATTR_CAPTIONTYPE
, cppu::UnoType
<sal_Int16
>::get(), 0, 0},
659 { OUString("CaptionIsFixedAngle"), SDRATTR_CAPTIONFIXEDANGLE
, cppu::UnoType
<bool>::get(), 0, 0},
660 { OUString("CaptionAngle"), SDRATTR_CAPTIONANGLE
, cppu::UnoType
<sal_Int32
>::get(), 0, 0},
661 { OUString("CaptionGap"), SDRATTR_CAPTIONGAP
, cppu::UnoType
<sal_Int32
>::get(), 0, SFX_METRIC_ITEM
},
662 { OUString("CaptionEscapeDirection"), SDRATTR_CAPTIONESCDIR
, cppu::UnoType
<sal_Int32
>::get(), 0, 0},
663 { OUString("CaptionIsEscapeRelative"), SDRATTR_CAPTIONESCISREL
, cppu::UnoType
<bool>::get(), 0, 0},
664 { OUString("CaptionEscapeRelative"), SDRATTR_CAPTIONESCREL
, cppu::UnoType
<sal_Int32
>::get(), 0, 0},
665 { OUString("CaptionEscapeAbsolute"), SDRATTR_CAPTIONESCABS
, cppu::UnoType
<sal_Int32
>::get(), 0, SFX_METRIC_ITEM
},
666 { OUString("CaptionLineLength"), SDRATTR_CAPTIONLINELEN
, cppu::UnoType
<sal_Int32
>::get(), 0, SFX_METRIC_ITEM
},
667 { OUString("CaptionIsFitLineLength"), SDRATTR_CAPTIONFITLINELEN
, cppu::UnoType
<bool>::get(), 0, 0},
668 EDGERADIUS_PROPERTIES
671 LINE_PROPERTIES_START_END
672 SHAPE_DESCRIPTOR_PROPERTIES
674 LINKTARGET_PROPERTIES
679 { OUString("UserDefinedAttributes"), SDRATTR_XMLATTRIBUTES
, cppu::UnoType
<com::sun::star::container::XNameContainer
>::get(), 0, 0},
680 {OUString("ParaUserDefinedAttributes"), EE_PARA_XMLATTRIBS
, cppu::UnoType
<com::sun::star::container::XNameContainer
>::get(), 0, 0},
681 { OUString(), 0, css::uno::Type(), 0, 0 }
684 return aCaptionPropertyMap_Impl
;
687 SfxItemPropertyMapEntry
const * ImplGetSvxCustomShapePropertyMap()
689 static SfxItemPropertyMapEntry
const aCustomShapePropertyMap_Impl
[] =
691 { OUString("CustomShapeEngine"), SDRATTR_CUSTOMSHAPE_ENGINE
, cppu::UnoType
<OUString
>::get(), 0, 0 },
692 { OUString("CustomShapeData"), SDRATTR_CUSTOMSHAPE_DATA
, cppu::UnoType
<OUString
>::get(), 0, 0 },
693 { OUString("CustomShapeGeometry"), SDRATTR_CUSTOMSHAPE_GEOMETRY
,
694 cppu::UnoType
<css::uno::Sequence
< ::com::sun::star::beans::PropertyValue
>>::get(), 0, 0 },
695 { OUString("CustomShapeGraphicURL"), SDRATTR_CUSTOMSHAPE_REPLACEMENT_URL
, cppu::UnoType
<OUString
>::get(), 0, 0},
696 CUSTOMSHAPE_PROPERTIES
699 LINE_PROPERTIES_START_END
700 SHAPE_DESCRIPTOR_PROPERTIES
702 LINKTARGET_PROPERTIES
705 {OUString("UserDefinedAttributes"), SDRATTR_XMLATTRIBUTES
, cppu::UnoType
<com::sun::star::container::XNameContainer
>::get(), 0, 0},
706 {OUString("ParaUserDefinedAttributes"), EE_PARA_XMLATTRIBS
, cppu::UnoType
<com::sun::star::container::XNameContainer
>::get(), 0, 0},
707 { OUString(), 0, css::uno::Type(), 0, 0 }
709 return aCustomShapePropertyMap_Impl
;
712 SfxItemPropertyMapEntry
const * ImplGetSvxMediaShapePropertyMap()
714 static SfxItemPropertyMapEntry
const aMediaShapePropertyMap_Impl
[] =
716 { OUString(UNO_NAME_MISC_OBJ_ZORDER
), OWN_ATTR_ZORDER
, cppu::UnoType
<sal_Int32
>::get(), 0, 0},
717 { OUString(UNO_NAME_MISC_OBJ_LAYERID
), SDRATTR_LAYERID
, cppu::UnoType
<sal_Int16
>::get(), 0, 0},
718 { OUString(UNO_NAME_MISC_OBJ_LAYERNAME
), SDRATTR_LAYERNAME
, cppu::UnoType
<OUString
>::get(), 0, 0},
719 { OUString(UNO_NAME_LINKDISPLAYBITMAP
), OWN_ATTR_LDBITMAP
, cppu::UnoType
<com::sun::star::awt::XBitmap
>::get(), ::com::sun::star::beans::PropertyAttribute::READONLY
, 0},
720 { OUString(UNO_NAME_LINKDISPLAYNAME
), OWN_ATTR_LDNAME
, cppu::UnoType
<OUString
>::get(), ::com::sun::star::beans::PropertyAttribute::READONLY
, 0},
721 { OUString("Transformation"), OWN_ATTR_TRANSFORMATION
, cppu::UnoType
<com::sun::star::drawing::HomogenMatrix3
>::get(), 0, 0 },
722 { OUString("MediaURL"), OWN_ATTR_MEDIA_URL
, cppu::UnoType
<OUString
>::get(), 0, 0},
723 { OUString("PreferredSize"), OWN_ATTR_MEDIA_PREFERREDSIZE
, cppu::UnoType
<com::sun::star::awt::Size
>::get(), ::com::sun::star::beans::PropertyAttribute::READONLY
, 0},
724 { OUString("Loop"), OWN_ATTR_MEDIA_LOOP
, cppu::UnoType
<sal_Bool
>::get(), 0, 0},
725 { OUString("Mute"), OWN_ATTR_MEDIA_MUTE
, cppu::UnoType
<sal_Bool
>::get(), 0, 0},
726 { OUString("VolumeDB"), OWN_ATTR_MEDIA_VOLUMEDB
, cppu::UnoType
<sal_Int16
>::get(), 0, 0},
727 { OUString("Zoom"), OWN_ATTR_MEDIA_ZOOM
, cppu::UnoType
<com::sun::star::media::ZoomLevel
>::get(), 0, 0},
728 { OUString(UNO_NAME_MISC_OBJ_MOVEPROTECT
), SDRATTR_OBJMOVEPROTECT
, cppu::UnoType
<bool>::get(),0, 0},
729 { OUString(UNO_NAME_MISC_OBJ_SIZEPROTECT
), SDRATTR_OBJSIZEPROTECT
, cppu::UnoType
<bool>::get(),0, 0},
730 { OUString(UNO_NAME_MISC_OBJ_BOUNDRECT
), OWN_ATTR_BOUNDRECT
, cppu::UnoType
<com::sun::star::awt::Rectangle
>::get(), ::com::sun::star::beans::PropertyAttribute::READONLY
, 0},
732 { OUString(UNO_NAME_MISC_OBJ_TITLE
), OWN_ATTR_MISC_OBJ_TITLE
, cppu::UnoType
<OUString
>::get(), 0, 0},
733 { OUString(UNO_NAME_MISC_OBJ_DESCRIPTION
), OWN_ATTR_MISC_OBJ_DESCRIPTION
, cppu::UnoType
<OUString
>::get(), 0, 0},
734 {OUString("PrivateStream"), OWN_ATTR_MEDIA_STREAM
, cppu::UnoType
<css::io::XInputStream
>::get(), 0, 0},
735 {OUString("PrivateTempFileURL"), OWN_ATTR_MEDIA_TEMPFILEURL
, cppu::UnoType
<OUString
>::get(), ::com::sun::star::beans::PropertyAttribute::READONLY
, 0},
736 { OUString("MediaMimeType"), OWN_ATTR_MEDIA_MIMETYPE
, cppu::UnoType
<OUString
>::get(), 0, 0},
737 { OUString("FallbackGraphic"), OWN_ATTR_FALLBACK_GRAPHIC
, cppu::UnoType
<css::graphic::XGraphic
>::get(), ::com::sun::star::beans::PropertyAttribute::READONLY
, 0},
738 { OUString(), 0, css::uno::Type(), 0, 0 }
741 return aMediaShapePropertyMap_Impl
;
744 SfxItemPropertyMapEntry
const * ImplGetSvxTableShapePropertyMap()
746 static SfxItemPropertyMapEntry
const aTableShapePropertyMap_Impl
[] =
748 { OUString(UNO_NAME_MISC_OBJ_ZORDER
), OWN_ATTR_ZORDER
, cppu::UnoType
<sal_Int32
>::get(), 0, 0},
749 { OUString(UNO_NAME_MISC_OBJ_LAYERID
), SDRATTR_LAYERID
, cppu::UnoType
<sal_Int16
>::get(), 0, 0},
750 { OUString(UNO_NAME_MISC_OBJ_LAYERNAME
), SDRATTR_LAYERNAME
, cppu::UnoType
<OUString
>::get(), 0, 0},
751 { OUString(UNO_NAME_LINKDISPLAYBITMAP
), OWN_ATTR_LDBITMAP
, cppu::UnoType
<css::awt::XBitmap
>::get(), ::com::sun::star::beans::PropertyAttribute::READONLY
, 0},
752 { OUString(UNO_NAME_LINKDISPLAYNAME
), OWN_ATTR_LDNAME
, cppu::UnoType
<OUString
>::get(), ::com::sun::star::beans::PropertyAttribute::READONLY
, 0},
753 { OUString("Transformation"), OWN_ATTR_TRANSFORMATION
, cppu::UnoType
<com::sun::star::drawing::HomogenMatrix3
>::get(), 0, 0 },
754 { OUString(UNO_NAME_MISC_OBJ_MOVEPROTECT
), SDRATTR_OBJMOVEPROTECT
, cppu::UnoType
<bool>::get(),0, 0},
755 { OUString(UNO_NAME_MISC_OBJ_SIZEPROTECT
), SDRATTR_OBJSIZEPROTECT
, cppu::UnoType
<bool>::get(),0, 0},
756 { OUString(UNO_NAME_MISC_OBJ_BOUNDRECT
), OWN_ATTR_BOUNDRECT
, cppu::UnoType
<com::sun::star::awt::Rectangle
>::get(), ::com::sun::star::beans::PropertyAttribute::READONLY
, 0},
757 { OUString(UNO_NAME_MISC_OBJ_NAME
), SDRATTR_OBJECTNAME
, cppu::UnoType
<rtl::OUString
>::get(), 0, 0},
758 { OUString(UNO_NAME_MISC_OBJ_TITLE
), OWN_ATTR_MISC_OBJ_TITLE
, cppu::UnoType
<OUString
>::get(), 0, 0},
759 { OUString(UNO_NAME_MISC_OBJ_DESCRIPTION
), OWN_ATTR_MISC_OBJ_DESCRIPTION
, cppu::UnoType
<OUString
>::get(), 0, 0},
760 { OUString("Model"), OWN_ATTR_OLEMODEL
, cppu::UnoType
<css::table::XTable
>::get(), ::com::sun::star::beans::PropertyAttribute::READONLY
, 0},
761 { OUString("TableTemplate"), OWN_ATTR_TABLETEMPLATE
, cppu::UnoType
<css::container::XIndexAccess
>::get(), 0, 0},
762 { OUString("UseFirstRowStyle"), OWN_ATTR_TABLETEMPLATE_FIRSTROW
, cppu::UnoType
<bool>::get(),0, 0},
763 { OUString("UseLastRowStyle"), OWN_ATTR_TABLETEMPLATE_LASTROW
, cppu::UnoType
<bool>::get(),0, 0},
764 { OUString("UseFirstColumnStyle"), OWN_ATTR_TABLETEMPLATE_FIRSTCOLUMN
, cppu::UnoType
<bool>::get(),0, 0},
765 { OUString("UseLastColumnStyle"), OWN_ATTR_TABLETEMPLATE_LASTCOLUMN
, cppu::UnoType
<bool>::get(),0, 0},
766 { OUString("UseBandingRowStyle"), OWN_ATTR_TABLETEMPLATE_BANDINGROWS
, cppu::UnoType
<bool>::get(),0, 0},
767 { OUString("UseBandingColumnStyle"), OWN_ATTR_TABLETEMPLATE_BANDINGCOULUMNS
, cppu::UnoType
<bool>::get(),0, 0},
768 { OUString("ReplacementGraphic"), OWN_ATTR_BITMAP
, cppu::UnoType
<css::graphic::XGraphic
>::get(), ::com::sun::star::beans::PropertyAttribute::READONLY
, 0},
769 { OUString(), 0, css::uno::Type(), 0, 0 }
772 return aTableShapePropertyMap_Impl
;
775 comphelper::PropertyMapEntry
const * ImplGetSvxDrawingDefaultsPropertyMap()
777 static comphelper::PropertyMapEntry
const aSvxDrawingDefaultsPropertyMap_Impl
[] =
780 LINE_PROPERTIES_DEFAULTS
782 FILL_PROPERTIES_DEFAULTS
783 EDGERADIUS_PROPERTIES
784 TEXT_PROPERTIES_DEFAULTS
786 SPECIAL_DIMENSIONING_PROPERTIES_DEFAULTS
787 MISC_3D_OBJ_PROPERTIES
788 SPECIAL_3DBACKSCALE_PROPERTIES
789 { OUString(), 0, css::uno::Type(), 0, 0 }
792 return aSvxDrawingDefaultsPropertyMap_Impl
;
795 comphelper::PropertyMapEntry
const * ImplGetAdditionalWriterDrawingDefaultsPropertyMap()
797 static comphelper::PropertyMapEntry
const aSvxAdditionalDefaultsPropertyMap_Impl
[] =
799 { OUString("IsFollowingTextFlow"), SID_SW_FOLLOW_TEXT_FLOW
, cppu::UnoType
<bool>::get(), 0, 0},
800 { OUString(), 0, css::uno::Type(), 0, 0 }
803 return aSvxAdditionalDefaultsPropertyMap_Impl
;
806 typedef std::unordered_map
< OUString
, sal_uInt32
, OUStringHash
> UHashMapImpl
;
810 const UHashMapImpl
& GetUHashImpl()
812 static UHashMapImpl
aImpl(63);
813 static bool bInited
= false;
816 const struct { const char *name
; sal_Int32 length
; sal_uInt32 id
; } aInit
[] = {
817 { RTL_CONSTASCII_STRINGPARAM("com.sun.star.drawing.RectangleShape"), OBJ_RECT
},
818 { RTL_CONSTASCII_STRINGPARAM("com.sun.star.drawing.EllipseShape"), OBJ_CIRC
},
819 { RTL_CONSTASCII_STRINGPARAM("com.sun.star.drawing.ControlShape"), OBJ_UNO
},
820 { RTL_CONSTASCII_STRINGPARAM("com.sun.star.drawing.ConnectorShape"), OBJ_EDGE
},
821 { RTL_CONSTASCII_STRINGPARAM("com.sun.star.drawing.MeasureShape"), OBJ_MEASURE
},
822 { RTL_CONSTASCII_STRINGPARAM("com.sun.star.drawing.LineShape"), OBJ_LINE
},
823 { RTL_CONSTASCII_STRINGPARAM("com.sun.star.drawing.PolyPolygonShape"), OBJ_POLY
},
824 { RTL_CONSTASCII_STRINGPARAM("com.sun.star.drawing.PolyLineShape"), OBJ_PLIN
},
825 { RTL_CONSTASCII_STRINGPARAM("com.sun.star.drawing.OpenBezierShape"), OBJ_PATHLINE
},
826 { RTL_CONSTASCII_STRINGPARAM("com.sun.star.drawing.ClosedBezierShape"), OBJ_PATHFILL
},
827 { RTL_CONSTASCII_STRINGPARAM("com.sun.star.drawing.OpenFreeHandShape"), OBJ_FREELINE
},
828 { RTL_CONSTASCII_STRINGPARAM("com.sun.star.drawing.ClosedFreeHandShape"), OBJ_FREEFILL
},
829 { RTL_CONSTASCII_STRINGPARAM("com.sun.star.drawing.PolyPolygonPathShape"), OBJ_PATHPOLY
},
830 { RTL_CONSTASCII_STRINGPARAM("com.sun.star.drawing.PolyLinePathShape"), OBJ_PATHPLIN
},
831 { RTL_CONSTASCII_STRINGPARAM("com.sun.star.drawing.GraphicObjectShape"), OBJ_GRAF
},
832 { RTL_CONSTASCII_STRINGPARAM("com.sun.star.drawing.GroupShape"), OBJ_GRUP
},
833 { RTL_CONSTASCII_STRINGPARAM("com.sun.star.drawing.TextShape"), OBJ_TEXT
},
834 { RTL_CONSTASCII_STRINGPARAM("com.sun.star.drawing.OLE2Shape"), OBJ_OLE2
},
835 { RTL_CONSTASCII_STRINGPARAM("com.sun.star.drawing.PageShape"), OBJ_PAGE
},
836 { RTL_CONSTASCII_STRINGPARAM("com.sun.star.drawing.CaptionShape"), OBJ_CAPTION
},
837 { RTL_CONSTASCII_STRINGPARAM("com.sun.star.drawing.FrameShape"), OBJ_FRAME
},
838 { RTL_CONSTASCII_STRINGPARAM("com.sun.star.drawing.PluginShape"), OBJ_OLE2_PLUGIN
},
839 { RTL_CONSTASCII_STRINGPARAM("com.sun.star.drawing.AppletShape"), OBJ_OLE2_APPLET
},
840 { RTL_CONSTASCII_STRINGPARAM("com.sun.star.drawing.CustomShape"), OBJ_CUSTOMSHAPE
},
841 { RTL_CONSTASCII_STRINGPARAM("com.sun.star.drawing.MediaShape"), OBJ_MEDIA
},
843 { RTL_CONSTASCII_STRINGPARAM("com.sun.star.drawing.Shape3DSceneObject"), E3D_POLYSCENE_ID
| E3D_INVENTOR_FLAG
},
844 { RTL_CONSTASCII_STRINGPARAM("com.sun.star.drawing.Shape3DCubeObject"), E3D_CUBEOBJ_ID
| E3D_INVENTOR_FLAG
},
845 { RTL_CONSTASCII_STRINGPARAM("com.sun.star.drawing.Shape3DSphereObject"), E3D_SPHEREOBJ_ID
| E3D_INVENTOR_FLAG
},
846 { RTL_CONSTASCII_STRINGPARAM("com.sun.star.drawing.Shape3DLatheObject"), E3D_LATHEOBJ_ID
| E3D_INVENTOR_FLAG
},
847 { RTL_CONSTASCII_STRINGPARAM("com.sun.star.drawing.Shape3DExtrudeObject"), E3D_EXTRUDEOBJ_ID
| E3D_INVENTOR_FLAG
},
848 { RTL_CONSTASCII_STRINGPARAM("com.sun.star.drawing.Shape3DPolygonObject"), E3D_POLYGONOBJ_ID
| E3D_INVENTOR_FLAG
},
849 { RTL_CONSTASCII_STRINGPARAM("com.sun.star.drawing.OpenGLObject"), OBJ_OPENGL
},
852 for (sal_uInt32 i
= 0; i
< sizeof(aInit
)/sizeof(aInit
[0]); i
++)
853 aImpl
[OUString( aInit
[i
].name
, aInit
[i
].length
, RTL_TEXTENCODING_ASCII_US
) ] = aInit
[i
].id
;
863 OUString
UHashMap::getNameFromId(sal_uInt32 nId
)
865 const UHashMapImpl
&rMap
= GetUHashImpl();
867 for (UHashMapImpl::const_iterator it
= rMap
.begin(); it
!= rMap
.end(); ++it
)
869 if (it
->second
== nId
)
872 OSL_FAIL("[CL] unknown SdrObject identifier");
876 uno::Sequence
< OUString
> UHashMap::getServiceNames()
878 const UHashMapImpl
&rMap
= GetUHashImpl();
880 uno::Sequence
< OUString
> aSeq( rMap
.size() );
881 OUString
* pStrings
= aSeq
.getArray();
884 for (UHashMapImpl::const_iterator it
= rMap
.begin(); it
!= rMap
.end(); ++it
)
885 pStrings
[i
++] = it
->first
;
890 sal_uInt32
UHashMap::getId( const OUString
& rCompareString
)
892 const UHashMapImpl
&rMap
= GetUHashImpl();
893 UHashMapImpl::const_iterator it
= rMap
.find( rCompareString
);
894 if( it
== rMap
.end() )
895 return UHASHMAP_NOTFOUND
;
900 struct theSvxMapProvider
:
901 public rtl::Static
<SvxUnoPropertyMapProvider
, theSvxMapProvider
>
905 SvxUnoPropertyMapProvider
& getSvxMapProvider()
907 return theSvxMapProvider::get();
912 SvxUnoPropertyMapProvider::SvxUnoPropertyMapProvider()
914 for(sal_uInt16 i
=0;i
<SVXMAP_END
; i
++)
921 SvxUnoPropertyMapProvider::~SvxUnoPropertyMapProvider()
923 for(sal_uInt16 i
=0;i
<SVXMAP_END
; i
++)
929 const SfxItemPropertyMapEntry
* SvxUnoPropertyMapProvider::GetMap(sal_uInt16 nPropertyId
)
931 DBG_ASSERT(nPropertyId
< SVXMAP_END
, "Id ?" );
932 if(!aMapArr
[nPropertyId
]) {
933 switch(nPropertyId
) {
934 case SVXMAP_SHAPE
: aMapArr
[SVXMAP_SHAPE
]=ImplGetSvxShapePropertyMap(); break;
935 case SVXMAP_CONNECTOR
: aMapArr
[SVXMAP_CONNECTOR
]=ImplGetSvxConnectorPropertyMap(); break;
936 case SVXMAP_DIMENSIONING
: aMapArr
[SVXMAP_DIMENSIONING
]=ImplGetSvxDimensioningPropertyMap(); break;
937 case SVXMAP_CIRCLE
: aMapArr
[SVXMAP_CIRCLE
]=ImplGetSvxCirclePropertyMap(); break;
938 case SVXMAP_POLYPOLYGON
: aMapArr
[SVXMAP_POLYPOLYGON
]=ImplGetSvxPolyPolygonPropertyMap(); break;
939 case SVXMAP_POLYPOLYGONBEZIER
: aMapArr
[SVXMAP_POLYPOLYGONBEZIER
]=ImplGetSvxPolyPolygonBezierPropertyMap(); break;
940 case SVXMAP_GRAPHICOBJECT
: aMapArr
[SVXMAP_GRAPHICOBJECT
]=ImplGetSvxGraphicObjectPropertyMap(); break;
941 case SVXMAP_3DSCENEOBJECT
: aMapArr
[SVXMAP_3DSCENEOBJECT
]=ImplGetSvx3DSceneObjectPropertyMap(); break;
942 case SVXMAP_3DCUBEOBJEKT
: aMapArr
[SVXMAP_3DCUBEOBJEKT
]=ImplGetSvx3DCubeObjectPropertyMap(); break;
943 case SVXMAP_3DSPHEREOBJECT
: aMapArr
[SVXMAP_3DSPHEREOBJECT
]=ImplGetSvx3DSphereObjectPropertyMap(); break;
944 case SVXMAP_3DLATHEOBJECT
: aMapArr
[SVXMAP_3DLATHEOBJECT
]=ImplGetSvx3DLatheObjectPropertyMap(); break;
945 case SVXMAP_3DEXTRUDEOBJECT
: aMapArr
[SVXMAP_3DEXTRUDEOBJECT
]=ImplGetSvx3DExtrudeObjectPropertyMap(); break;
946 case SVXMAP_3DPOLYGONOBJECT
: aMapArr
[SVXMAP_3DPOLYGONOBJECT
]=ImplGetSvx3DPolygonObjectPropertyMap(); break;
947 case SVXMAP_ALL
: aMapArr
[SVXMAP_ALL
]=ImplGetSvxAllPropertyMap(); break;
948 case SVXMAP_GROUP
: aMapArr
[SVXMAP_GROUP
]=ImplGetSvxGroupPropertyMap(); break;
949 case SVXMAP_CAPTION
: aMapArr
[SVXMAP_CAPTION
]=ImplGetSvxCaptionPropertyMap(); break;
950 case SVXMAP_OLE2
: aMapArr
[SVXMAP_OLE2
]=ImplGetSvxOle2PropertyMap(); break;
951 case SVXMAP_PLUGIN
: aMapArr
[SVXMAP_PLUGIN
]=ImplGetSvxPluginPropertyMap(); break;
952 case SVXMAP_FRAME
: aMapArr
[SVXMAP_FRAME
]=ImplGetSvxFramePropertyMap(); break;
953 case SVXMAP_APPLET
: aMapArr
[SVXMAP_APPLET
]=ImplGetSvxAppletPropertyMap(); break;
954 case SVXMAP_CONTROL
: aMapArr
[SVXMAP_CONTROL
]=ImplGetSvxControlShapePropertyMap(); break;
955 case SVXMAP_TEXT
: aMapArr
[SVXMAP_TEXT
]=ImplGetSvxTextShapePropertyMap(); break;
956 case SVXMAP_CUSTOMSHAPE
: aMapArr
[SVXMAP_CUSTOMSHAPE
]=ImplGetSvxCustomShapePropertyMap(); break;
957 case SVXMAP_MEDIA
: aMapArr
[SVXMAP_MEDIA
]=ImplGetSvxMediaShapePropertyMap(); break;
958 case SVXMAP_TABLE
: aMapArr
[SVXMAP_TABLE
]=ImplGetSvxTableShapePropertyMap(); break;
959 case SVXMAP_PAGE
: aMapArr
[SVXMAP_PAGE
] = ImplGetSvxPageShapePropertyMap(); break;
962 OSL_FAIL( "Unknown property map for SvxUnoPropertyMapProvider!" );
964 // Sort(nPropertyId);
966 return aMapArr
[nPropertyId
];
968 const SvxItemPropertySet
* SvxUnoPropertyMapProvider::GetPropertySet(sal_uInt16 nPropertyId
, SfxItemPool
& rPool
)
970 if( !aSetArr
[nPropertyId
] )
971 aSetArr
[nPropertyId
] = new SvxItemPropertySet( GetMap( nPropertyId
), rPool
);
972 return aSetArr
[nPropertyId
];
976 /** maps the API constant MeasureUnit to a vcl MapUnit enum.
977 Returns false if conversion is not supported.
979 @cl: for warnings01 I found out that this method never worked so I thin
980 it is not used at all
981 sal_Bool SvxMeasureUnitToMapUnit( const short eApi, int& eVcl ) throw()
985 case util::MeasureUnit::MM_100TH: eVcl = MAP_100TH_MM; break;
986 case util::MeasureUnit::MM_10TH: eVcl = MAP_10TH_MM; break;
987 case util::MeasureUnit::MM: eVcl = MAP_MM; break;
988 case util::MeasureUnit::CM: eVcl = MAP_CM; break;
989 case util::MeasureUnit::INCH_1000TH: eVcl = MAP_1000TH_INCH; break;
990 case util::MeasureUnit::INCH_100TH: eVcl = MAP_100TH_INCH; break;
991 case util::MeasureUnit::INCH_10TH: eVcl = MAP_10TH_INCH; break;
992 case util::MeasureUnit::INCH: eVcl = MAP_INCH; break;
993 case util::MeasureUnit::POINT: eVcl = MAP_POINT; break;
994 case util::MeasureUnit::TWIP: eVcl = MAP_TWIP; break;
995 case util::MeasureUnit::PERCENT: eVcl = MAP_RELATIVE; break;
1004 /** maps the vcl MapUnit enum to a API constant MeasureUnit.
1005 Returns false if conversion is not supported.
1007 bool SvxMapUnitToMeasureUnit( const MapUnit eVcl
, short& eApi
) throw()
1011 case MAP_100TH_MM
: eApi
= util::MeasureUnit::MM_100TH
; break;
1012 case MAP_10TH_MM
: eApi
= util::MeasureUnit::MM_10TH
; break;
1013 case MAP_MM
: eApi
= util::MeasureUnit::MM
; break;
1014 case MAP_CM
: eApi
= util::MeasureUnit::CM
; break;
1015 case MAP_1000TH_INCH
: eApi
= util::MeasureUnit::INCH_1000TH
; break;
1016 case MAP_100TH_INCH
: eApi
= util::MeasureUnit::INCH_100TH
; break;
1017 case MAP_10TH_INCH
: eApi
= util::MeasureUnit::INCH_10TH
; break;
1018 case MAP_INCH
: eApi
= util::MeasureUnit::INCH
; break;
1019 case MAP_POINT
: eApi
= util::MeasureUnit::POINT
; break;
1020 case MAP_TWIP
: eApi
= util::MeasureUnit::TWIP
; break;
1021 case MAP_RELATIVE
: eApi
= util::MeasureUnit::PERCENT
; break;
1029 /** maps the API constant MeasureUnit to a vcl MapUnit enum.
1030 Returns false if conversion is not supported.
1033 bool SvxMeasureUnitToFieldUnit( const short eApi
, FieldUnit
& eVcl
) throw()
1037 case util::MeasureUnit::MM
: eVcl
= FUNIT_MM
; break;
1038 case util::MeasureUnit::CM
: eVcl
= FUNIT_CM
; break;
1039 case util::MeasureUnit::M
: eVcl
= FUNIT_M
; break;
1040 case util::MeasureUnit::KM
: eVcl
= FUNIT_KM
; break;
1041 case util::MeasureUnit::TWIP
: eVcl
= FUNIT_TWIP
; break;
1042 case util::MeasureUnit::POINT
: eVcl
= FUNIT_POINT
; break;
1043 case util::MeasureUnit::PICA
: eVcl
= FUNIT_PICA
; break;
1044 case util::MeasureUnit::INCH
: eVcl
= FUNIT_INCH
; break;
1045 case util::MeasureUnit::FOOT
: eVcl
= FUNIT_FOOT
; break;
1046 case util::MeasureUnit::MILE
: eVcl
= FUNIT_MILE
; break;
1047 case util::MeasureUnit::PERCENT
: eVcl
= FUNIT_PERCENT
; break;
1048 case util::MeasureUnit::MM_100TH
: eVcl
= FUNIT_100TH_MM
; break;
1056 /** maps the vcl MapUnit enum to a API constant MeasureUnit.
1057 Returns false if conversion is not supported.
1059 bool SvxFieldUnitToMeasureUnit( const FieldUnit eVcl
, short& eApi
) throw()
1063 case FUNIT_MM
: eApi
= util::MeasureUnit::MM
; break;
1064 case FUNIT_CM
: eApi
= util::MeasureUnit::CM
; break;
1065 case FUNIT_M
: eApi
= util::MeasureUnit::M
; break;
1066 case FUNIT_KM
: eApi
= util::MeasureUnit::KM
; break;
1067 case FUNIT_TWIP
: eApi
= util::MeasureUnit::TWIP
; break;
1068 case FUNIT_POINT
: eApi
= util::MeasureUnit::POINT
; break;
1069 case FUNIT_PICA
: eApi
= util::MeasureUnit::PICA
; break;
1070 case FUNIT_INCH
: eApi
= util::MeasureUnit::INCH
; break;
1071 case FUNIT_FOOT
: eApi
= util::MeasureUnit::FOOT
; break;
1072 case FUNIT_MILE
: eApi
= util::MeasureUnit::MILE
; break;
1073 case FUNIT_PERCENT
: eApi
= util::MeasureUnit::PERCENT
; break;
1074 case FUNIT_100TH_MM
: eApi
= util::MeasureUnit::MM_100TH
; break;
1082 bool SvxUnoGetResourceRanges( const short nWhich
, int& nApiResIds
, int& nIntResIds
, int& nCount
) throw()
1086 case XATTR_FILLBITMAP
:
1087 nApiResIds
= RID_SVXSTR_BMP_DEF_START
;
1088 nIntResIds
= RID_SVXSTR_BMP_START
;
1089 nCount
= RID_SVXSTR_BMP_DEF_END
- RID_SVXSTR_BMP_DEF_START
+ 1;
1092 case XATTR_LINEDASH
:
1093 nApiResIds
= RID_SVXSTR_DASH_DEF_START
;
1094 nIntResIds
= RID_SVXSTR_DASH_START
;
1095 nCount
= RID_SVXSTR_DASH_DEF_END
- RID_SVXSTR_DASH_DEF_START
+ 1;
1098 case XATTR_LINESTART
:
1100 nApiResIds
= RID_SVXSTR_LEND_DEF_START
;
1101 nIntResIds
= RID_SVXSTR_LEND_START
;
1102 nCount
= RID_SVXSTR_LEND_DEF_END
- RID_SVXSTR_LEND_DEF_START
+ 1;
1105 case XATTR_FILLGRADIENT
:
1106 nApiResIds
= RID_SVXSTR_GRDT_DEF_START
;
1107 nIntResIds
= RID_SVXSTR_GRDT_START
;
1108 nCount
= RID_SVXSTR_GRDT_DEF_END
- RID_SVXSTR_GRDT_DEF_START
+ 1;
1111 case XATTR_FILLHATCH
:
1112 nApiResIds
= RID_SVXSTR_HATCH_DEF_START
;
1113 nIntResIds
= RID_SVXSTR_HATCH_START
;
1114 nCount
= RID_SVXSTR_HATCH_DEF_END
- RID_SVXSTR_HATCH_DEF_START
+ 1;
1117 case XATTR_FILLFLOATTRANSPARENCE
:
1118 nApiResIds
= RID_SVXSTR_TRASNGR_DEF_START
;
1119 nIntResIds
= RID_SVXSTR_TRASNGR_START
;
1120 nCount
= RID_SVXSTR_TRASNGR_DEF_END
- RID_SVXSTR_TRASNGR_DEF_START
+ 1;
1130 bool SvxUnoConvertResourceString( int nSourceResIds
, int nDestResIds
, int nCount
, OUString
& rString
) throw()
1132 // first, calculate the search string length without an optional number behind the name
1133 sal_Int32 nLength
= rString
.getLength();
1134 while( nLength
> 0 )
1136 const sal_Unicode nChar
= rString
[ nLength
- 1 ];
1137 if( (nChar
< '0') || (nChar
> '9') )
1143 // if we cut off a number, also cut of some spaces
1144 if( nLength
!= rString
.getLength() )
1146 while( nLength
> 0 )
1148 const sal_Unicode nChar
= rString
[ nLength
- 1 ];
1156 const OUString
aShortString( rString
.copy( 0, nLength
) );
1159 for( i
= 0; i
< nCount
; i
++ )
1161 sal_uInt16 nResId
= (sal_uInt16
)(nSourceResIds
+ i
);
1162 const ResId
aRes( SVX_RES(nResId
));
1163 const OUString
aCompare( aRes
.toString() );
1164 if( aShortString
== aCompare
)
1166 sal_uInt16 nNewResId
= (sal_uInt16
)(nDestResIds
+ i
);
1167 ResId
aNewRes( SVX_RES( nNewResId
));
1168 rString
= rString
.replaceAt( 0, aShortString
.getLength(), aNewRes
.toString() );
1171 else if( rString
== aCompare
)
1173 sal_uInt16 nNewResId
= (sal_uInt16
)(nDestResIds
+ i
);
1174 ResId
aNewRes( SVX_RES( nNewResId
));
1175 rString
= aNewRes
.toString();
1184 // #i122649# Some comments on the below arrays:
1185 // - They need to have the same order and count of items
1186 // - They are used to translate between translated and non-translated color names
1187 // - To make longer names be found which start with the same basic string,
1188 // these have to be in front of others
1190 // It would be nice to:
1191 // - evtl. organize these in a single array with 2-dimensional inner to elliminate
1192 // the possibility to define it wrong
1193 // - change the compare to also work when a shorter name is in front of a longer one
1195 static const sal_uInt16 SvxUnoColorNameDefResId
[] =
1197 RID_SVXSTR_COLOR_BLUEGREY_DEF
,
1198 RID_SVXSTR_COLOR_BLACK_DEF
,
1199 RID_SVXSTR_COLOR_BLUE_CLASSIC_DEF
,
1200 RID_SVXSTR_COLOR_BLUE_DEF
,
1201 RID_SVXSTR_COLOR_GREEN_DEF
,
1202 RID_SVXSTR_COLOR_CYAN_DEF
,
1203 RID_SVXSTR_COLOR_RED_DEF
,
1204 RID_SVXSTR_COLOR_MAGENTA_DEF
,
1205 RID_SVXSTR_COLOR_GREY_DEF
,
1206 RID_SVXSTR_COLOR_YELLOWGREEN_DEF
,
1207 RID_SVXSTR_COLOR_YELLOW_DEF
,
1208 RID_SVXSTR_COLOR_WHITE_DEF
,
1209 RID_SVXSTR_COLOR_ORANGE_DEF
,
1210 RID_SVXSTR_COLOR_VIOLET_DEF
,
1211 RID_SVXSTR_COLOR_BORDEAUX_DEF
,
1212 RID_SVXSTR_COLOR_PALE_YELLOW_DEF
,
1213 RID_SVXSTR_COLOR_PALE_GREEN_DEF
,
1214 RID_SVXSTR_COLOR_DARKVIOLET_DEF
,
1215 RID_SVXSTR_COLOR_SALMON_DEF
,
1216 RID_SVXSTR_COLOR_SEABLUE_DEF
,
1217 RID_SVXSTR_COLOR_CHART_DEF
,
1218 RID_SVXSTR_COLOR_PURPLE_DEF
,
1219 RID_SVXSTR_COLOR_SKYBLUE_DEF
,
1220 RID_SVXSTR_COLOR_PINK_DEF
,
1221 RID_SVXSTR_COLOR_TURQUOISE_DEF
,
1222 RID_SVXSTR_COLOR_LIBRE_GREEN_1_DEF
,
1223 RID_SVXSTR_COLOR_LIBRE_GREEN_ACCENT_DEF
,
1224 RID_SVXSTR_COLOR_LIBRE_BLUE_ACCENT_DEF
,
1225 RID_SVXSTR_COLOR_LIBRE_ORANGE_ACCENT_DEF
,
1226 RID_SVXSTR_COLOR_LIBRE_PURPLE_DEF
,
1227 RID_SVXSTR_COLOR_LIBRE_PURPLE_ACCENT_DEF
,
1228 RID_SVXSTR_COLOR_LIBRE_YELLOW_ACCENT_DEF
,
1229 RID_SVXSTR_COLOR_TANGO_BUTTER_DEF
,
1230 RID_SVXSTR_COLOR_TANGO_ORANGE_DEF
,
1231 RID_SVXSTR_COLOR_TANGO_CHOCOLATE_DEF
,
1232 RID_SVXSTR_COLOR_TANGO_CHAMELEON_DEF
,
1233 RID_SVXSTR_COLOR_TANGO_SKY_BLUE_DEF
,
1234 RID_SVXSTR_COLOR_TANGO_PLUM_DEF
,
1235 RID_SVXSTR_COLOR_TANGO_SCARLET_RED_DEF
,
1236 RID_SVXSTR_COLOR_TANGO_ALUMINIUM_DEF
1239 static const sal_uInt16 SvxUnoColorNameResId
[] =
1241 RID_SVXSTR_COLOR_BLUEGREY
,
1242 RID_SVXSTR_COLOR_BLACK
,
1243 RID_SVXSTR_COLOR_BLUE_CLASSIC
,
1244 RID_SVXSTR_COLOR_BLUE
,
1245 RID_SVXSTR_COLOR_GREEN
,
1246 RID_SVXSTR_COLOR_CYAN
,
1247 RID_SVXSTR_COLOR_RED
,
1248 RID_SVXSTR_COLOR_MAGENTA
,
1249 RID_SVXSTR_COLOR_GREY
,
1250 RID_SVXSTR_COLOR_YELLOWGREEN
,
1251 RID_SVXSTR_COLOR_YELLOW
,
1252 RID_SVXSTR_COLOR_WHITE
,
1253 RID_SVXSTR_COLOR_ORANGE
,
1254 RID_SVXSTR_COLOR_VIOLET
,
1255 RID_SVXSTR_COLOR_BORDEAUX
,
1256 RID_SVXSTR_COLOR_PALE_YELLOW
,
1257 RID_SVXSTR_COLOR_PALE_GREEN
,
1258 RID_SVXSTR_COLOR_DARKVIOLET
,
1259 RID_SVXSTR_COLOR_SALMON
,
1260 RID_SVXSTR_COLOR_SEABLUE
,
1261 RID_SVXSTR_COLOR_CHART
,
1262 RID_SVXSTR_COLOR_PURPLE
,
1263 RID_SVXSTR_COLOR_SKYBLUE
,
1264 RID_SVXSTR_COLOR_PINK
,
1265 RID_SVXSTR_COLOR_TURQUOISE
,
1266 RID_SVXSTR_COLOR_LIBRE_GREEN_1
,
1267 RID_SVXSTR_COLOR_LIBRE_GREEN_ACCENT
,
1268 RID_SVXSTR_COLOR_LIBRE_BLUE_ACCENT
,
1269 RID_SVXSTR_COLOR_LIBRE_ORANGE_ACCENT
,
1270 RID_SVXSTR_COLOR_LIBRE_PURPLE
,
1271 RID_SVXSTR_COLOR_LIBRE_PURPLE_ACCENT
,
1272 RID_SVXSTR_COLOR_LIBRE_YELLOW_ACCENT
,
1273 RID_SVXSTR_COLOR_TANGO_BUTTER
,
1274 RID_SVXSTR_COLOR_TANGO_ORANGE
,
1275 RID_SVXSTR_COLOR_TANGO_CHOCOLATE
,
1276 RID_SVXSTR_COLOR_TANGO_CHAMELEON
,
1277 RID_SVXSTR_COLOR_TANGO_SKY_BLUE
,
1278 RID_SVXSTR_COLOR_TANGO_PLUM
,
1279 RID_SVXSTR_COLOR_TANGO_SCARLET_RED
,
1280 RID_SVXSTR_COLOR_TANGO_ALUMINIUM
1285 bool SvxUnoConvertResourceString( const sal_uInt16
* pSourceResIds
, const sal_uInt16
* pDestResIds
, int nCount
, OUString
& rString
) throw()
1287 //We replace e.g. "Gray 10%" with the translation of Gray, but we shouldn't
1288 //replace "Red Hat 1" with the translation of Red :-)
1289 sal_Int32 nLength
= rString
.getLength();
1290 while( nLength
> 0 )
1292 const sal_Unicode nChar
= rString
[nLength
-1];
1293 if (nChar
!= '%' && (nChar
< '0' || nChar
> '9'))
1297 OUString sStr
= rString
.copy(0, nLength
).trim();
1299 for(int i
= 0; i
< nCount
; ++i
)
1301 OUString aStrDefName
= SVX_RESSTR( pSourceResIds
[i
] );
1302 if( sStr
== aStrDefName
)
1304 OUString aReplace
= SVX_RESSTR( pDestResIds
[i
] );
1305 rString
= rString
.replaceAt( 0, aStrDefName
.getLength(), aReplace
);
1313 /** if the given name is a predefined name for the current language it is replaced by
1314 the corresponding api name.
1316 OUString
SvxUnogetApiNameForItem(const sal_Int16 nWhich
, const OUString
& rInternalName
) throw()
1318 OUString aNew
= rInternalName
;
1320 if( nWhich
== XATTR_LINECOLOR
)
1322 if( SvxUnoConvertResourceString( SvxUnoColorNameResId
, SvxUnoColorNameDefResId
, sizeof( SvxUnoColorNameResId
) / sizeof( sal_uInt16
), aNew
) )
1333 if( SvxUnoGetResourceRanges( nWhich
, nApiResIds
, nIntResIds
, nCount
) )
1335 if(SvxUnoConvertResourceString( nIntResIds
, nApiResIds
, nCount
, aNew
) )
1342 // just use previous name, if nothing else was found.
1343 return rInternalName
;
1346 /** if the given name is a predefined api name it is replaced by the predefined name
1347 for the current language.
1349 OUString
SvxUnogetInternalNameForItem(const sal_Int16 nWhich
, const OUString
& rApiName
) throw()
1351 OUString aNew
= rApiName
;
1353 if( nWhich
== XATTR_LINECOLOR
)
1355 if( SvxUnoConvertResourceString( SvxUnoColorNameDefResId
, SvxUnoColorNameResId
, sizeof( SvxUnoColorNameResId
) / sizeof( sal_uInt16
), aNew
) )
1366 if( SvxUnoGetResourceRanges( nWhich
, nApiResIds
, nIntResIds
, nCount
) )
1368 if(SvxUnoConvertResourceString( nApiResIds
, nIntResIds
, nCount
, aNew
) )
1375 // just use previous name, if nothing else was found.
1381 comphelper::PropertySetInfo
* SvxPropertySetInfoPool::getOrCreate( sal_Int32 nServiceId
) throw()
1383 SolarMutexGuard aGuard
;
1385 if( nServiceId
> SVXUNO_SERVICEID_LASTID
)
1387 OSL_FAIL( "unknown service id!" );
1391 if( mpInfos
[ nServiceId
] == NULL
)
1393 mpInfos
[nServiceId
] = new comphelper::PropertySetInfo();
1394 mpInfos
[nServiceId
]->acquire();
1396 switch( nServiceId
)
1398 case SVXUNO_SERVICEID_COM_SUN_STAR_DRAWING_DEFAULTS
:
1399 mpInfos
[SVXUNO_SERVICEID_COM_SUN_STAR_DRAWING_DEFAULTS
]->add( ImplGetSvxDrawingDefaultsPropertyMap() );
1401 case SVXUNO_SERVICEID_COM_SUN_STAR_DRAWING_DEFAULTS_WRITER
:
1402 mpInfos
[SVXUNO_SERVICEID_COM_SUN_STAR_DRAWING_DEFAULTS_WRITER
]->add( ImplGetSvxDrawingDefaultsPropertyMap() );
1403 mpInfos
[SVXUNO_SERVICEID_COM_SUN_STAR_DRAWING_DEFAULTS_WRITER
]->remove( OUString( UNO_NAME_EDIT_PARA_IS_HANGING_PUNCTUATION
) );
1404 // OD 13.10.2003 #i18732# - add property map for writer item 'IsFollowingTextFlow'
1405 mpInfos
[SVXUNO_SERVICEID_COM_SUN_STAR_DRAWING_DEFAULTS_WRITER
]->add( ImplGetAdditionalWriterDrawingDefaultsPropertyMap() );
1409 OSL_FAIL( "unknown service id!" );
1413 return mpInfos
[ nServiceId
];
1416 comphelper::PropertySetInfo
* SvxPropertySetInfoPool::mpInfos
[SVXUNO_SERVICEID_LASTID
+1] = { NULL
};
1418 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */