bump product version to 4.1.6.2
[LibreOffice.git] / svx / source / svdraw / svdattr.cxx
blob25e0710595ad435bc262c7e7cd81440b505c2aa3
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*
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 <com/sun/star/drawing/TextFitToSizeType.hpp>
21 #include <com/sun/star/drawing/TextHorizontalAdjust.hpp>
22 #include <com/sun/star/drawing/TextVerticalAdjust.hpp>
23 #include <com/sun/star/drawing/TextAnimationKind.hpp>
24 #include <com/sun/star/uno/Any.hxx>
25 #include <com/sun/star/drawing/TextAnimationDirection.hpp>
26 #include <com/sun/star/drawing/ConnectorType.hpp>
27 #include <com/sun/star/drawing/MeasureKind.hpp>
28 #include <com/sun/star/drawing/MeasureTextHorzPos.hpp>
29 #include <com/sun/star/drawing/MeasureTextVertPos.hpp>
30 #include <com/sun/star/drawing/CircleKind.hpp>
31 #include <com/sun/star/uno/Sequence.hxx>
33 #include <unotools/intlwrapper.hxx>
34 #include <comphelper/processfactory.hxx>
35 #include <vcl/svapp.hxx>
36 #include <svx/svdattr.hxx>
37 #include <svx/svdattrx.hxx>
38 #include <svx/svdpool.hxx>
40 #include <svl/solar.hrc>
41 #include "editeng/xmlcnitm.hxx"
42 #include <editeng/editdata.hxx>
44 #include <svx/svxids.hrc>
45 #include <svx/xtable.hxx> // for RGB_Color()
46 #include <svx/svdmodel.hxx> // for DEGREE_CHAR
47 #include <svx/svdtrans.hxx>
48 #include "svx/svdglob.hxx" // string cache
49 #include "svx/svdstr.hrc"
50 #include <svx/sdgcpitm.hxx>
51 #include <editeng/adjustitem.hxx>
52 #include <svx/sdtfchim.hxx>
53 #include <editeng/writingmodeitem.hxx>
54 #include <tools/bigint.hxx>
55 #include <tools/stream.hxx>
57 #include <svx/xfillit0.hxx>
58 #include <svx/xflclit.hxx>
59 #include <svx/xlineit0.hxx>
60 #include <svx/svx3ditems.hxx>
62 #include "editeng/boxitem.hxx"
63 #include "editeng/shaditem.hxx"
64 #include "editeng/lineitem.hxx"
66 using namespace ::rtl;
67 using namespace ::com::sun::star;
69 /*************************************************************************
71 |* Constructor
73 \************************************************************************/
75 SdrItemPool::SdrItemPool(
76 SfxItemPool* _pMaster,
77 sal_Bool bLoadRefCounts)
78 : XOutdevItemPool(_pMaster, SDRATTR_START, SDRATTR_END, bLoadRefCounts)
80 // prepare some constants
81 const Color aNullCol(RGB_Color(COL_BLACK));
82 const sal_Int32 nDefEdgeDist(500L); // Defaulting hard for Draw (100TH_MM) currently. MapMode will have to be taken into account in the future.
84 // init the non-persistent items
85 for(sal_uInt16 i(SDRATTR_NOTPERSIST_FIRST); i <= SDRATTR_NOTPERSIST_LAST; i++)
87 mpLocalItemInfos[i - SDRATTR_START]._nFlags=0;
90 // init own PoolDefaults
91 mppLocalPoolDefaults[SDRATTR_SHADOW -SDRATTR_START]=new SdrShadowItem;
92 mppLocalPoolDefaults[SDRATTR_SHADOWCOLOR -SDRATTR_START]=new SdrShadowColorItem(aNullCol);
93 mppLocalPoolDefaults[SDRATTR_SHADOWXDIST -SDRATTR_START]=new SdrShadowXDistItem;
94 mppLocalPoolDefaults[SDRATTR_SHADOWYDIST -SDRATTR_START]=new SdrShadowYDistItem;
95 mppLocalPoolDefaults[SDRATTR_SHADOWTRANSPARENCE-SDRATTR_START]=new SdrShadowTransparenceItem;
96 mppLocalPoolDefaults[SDRATTR_SHADOW3D -SDRATTR_START]=new SfxVoidItem(SDRATTR_SHADOW3D );
97 mppLocalPoolDefaults[SDRATTR_SHADOWPERSP -SDRATTR_START]=new SfxVoidItem(SDRATTR_SHADOWPERSP );
98 mppLocalPoolDefaults[SDRATTR_CAPTIONTYPE -SDRATTR_START]=new SdrCaptionTypeItem ;
99 mppLocalPoolDefaults[SDRATTR_CAPTIONFIXEDANGLE-SDRATTR_START]=new SdrCaptionFixedAngleItem;
100 mppLocalPoolDefaults[SDRATTR_CAPTIONANGLE -SDRATTR_START]=new SdrCaptionAngleItem ;
101 mppLocalPoolDefaults[SDRATTR_CAPTIONGAP -SDRATTR_START]=new SdrCaptionGapItem ;
102 mppLocalPoolDefaults[SDRATTR_CAPTIONESCDIR -SDRATTR_START]=new SdrCaptionEscDirItem ;
103 mppLocalPoolDefaults[SDRATTR_CAPTIONESCISREL -SDRATTR_START]=new SdrCaptionEscIsRelItem ;
104 mppLocalPoolDefaults[SDRATTR_CAPTIONESCREL -SDRATTR_START]=new SdrCaptionEscRelItem ;
105 mppLocalPoolDefaults[SDRATTR_CAPTIONESCABS -SDRATTR_START]=new SdrCaptionEscAbsItem ;
106 mppLocalPoolDefaults[SDRATTR_CAPTIONLINELEN -SDRATTR_START]=new SdrCaptionLineLenItem ;
107 mppLocalPoolDefaults[SDRATTR_CAPTIONFITLINELEN-SDRATTR_START]=new SdrCaptionFitLineLenItem;
108 mppLocalPoolDefaults[SDRATTR_ECKENRADIUS -SDRATTR_START]=new SdrEckenradiusItem;
109 mppLocalPoolDefaults[SDRATTR_TEXT_MINFRAMEHEIGHT -SDRATTR_START]=new SdrTextMinFrameHeightItem;
110 mppLocalPoolDefaults[SDRATTR_TEXT_AUTOGROWHEIGHT -SDRATTR_START]=new SdrTextAutoGrowHeightItem;
111 mppLocalPoolDefaults[SDRATTR_TEXT_FITTOSIZE -SDRATTR_START]=new SdrTextFitToSizeTypeItem;
112 mppLocalPoolDefaults[SDRATTR_TEXT_LEFTDIST -SDRATTR_START]=new SdrTextLeftDistItem;
113 mppLocalPoolDefaults[SDRATTR_TEXT_RIGHTDIST -SDRATTR_START]=new SdrTextRightDistItem;
114 mppLocalPoolDefaults[SDRATTR_TEXT_UPPERDIST -SDRATTR_START]=new SdrTextUpperDistItem;
115 mppLocalPoolDefaults[SDRATTR_TEXT_LOWERDIST -SDRATTR_START]=new SdrTextLowerDistItem;
116 mppLocalPoolDefaults[SDRATTR_TEXT_VERTADJUST -SDRATTR_START]=new SdrTextVertAdjustItem;
117 mppLocalPoolDefaults[SDRATTR_TEXT_MAXFRAMEHEIGHT -SDRATTR_START]=new SdrTextMaxFrameHeightItem;
118 mppLocalPoolDefaults[SDRATTR_TEXT_MINFRAMEWIDTH -SDRATTR_START]=new SdrTextMinFrameWidthItem;
119 mppLocalPoolDefaults[SDRATTR_TEXT_MAXFRAMEWIDTH -SDRATTR_START]=new SdrTextMaxFrameWidthItem;
120 mppLocalPoolDefaults[SDRATTR_TEXT_AUTOGROWWIDTH -SDRATTR_START]=new SdrTextAutoGrowWidthItem;
121 mppLocalPoolDefaults[SDRATTR_TEXT_HORZADJUST -SDRATTR_START]=new SdrTextHorzAdjustItem;
122 mppLocalPoolDefaults[SDRATTR_TEXT_ANIKIND -SDRATTR_START]=new SdrTextAniKindItem;
123 mppLocalPoolDefaults[SDRATTR_TEXT_ANIDIRECTION -SDRATTR_START]=new SdrTextAniDirectionItem;
124 mppLocalPoolDefaults[SDRATTR_TEXT_ANISTARTINSIDE -SDRATTR_START]=new SdrTextAniStartInsideItem;
125 mppLocalPoolDefaults[SDRATTR_TEXT_ANISTOPINSIDE -SDRATTR_START]=new SdrTextAniStopInsideItem;
126 mppLocalPoolDefaults[SDRATTR_TEXT_ANICOUNT -SDRATTR_START]=new SdrTextAniCountItem;
127 mppLocalPoolDefaults[SDRATTR_TEXT_ANIDELAY -SDRATTR_START]=new SdrTextAniDelayItem;
128 mppLocalPoolDefaults[SDRATTR_TEXT_ANIAMOUNT -SDRATTR_START]=new SdrTextAniAmountItem;
129 mppLocalPoolDefaults[SDRATTR_TEXT_CONTOURFRAME -SDRATTR_START]=new SdrTextContourFrameItem;
130 mppLocalPoolDefaults[SDRATTR_CUSTOMSHAPE_ADJUSTMENT -SDRATTR_START]=new SdrCustomShapeAdjustmentItem;
131 mppLocalPoolDefaults[SDRATTR_XMLATTRIBUTES -SDRATTR_START]=new SvXMLAttrContainerItem( SDRATTR_XMLATTRIBUTES );
132 mppLocalPoolDefaults[SDRATTR_TEXT_USEFIXEDCELLHEIGHT -SDRATTR_START]=new SdrTextFixedCellHeightItem;
133 mppLocalPoolDefaults[SDRATTR_TEXT_WORDWRAP -SDRATTR_START]=new SdrTextWordWrapItem( sal_True );
134 mppLocalPoolDefaults[SDRATTR_TEXT_AUTOGROWSIZE -SDRATTR_START]=new SdrTextAutoGrowSizeItem;
135 mppLocalPoolDefaults[SDRATTR_EDGEKIND -SDRATTR_START]=new SdrEdgeKindItem;
136 mppLocalPoolDefaults[SDRATTR_EDGENODE1HORZDIST-SDRATTR_START]=new SdrEdgeNode1HorzDistItem(nDefEdgeDist);
137 mppLocalPoolDefaults[SDRATTR_EDGENODE1VERTDIST-SDRATTR_START]=new SdrEdgeNode1VertDistItem(nDefEdgeDist);
138 mppLocalPoolDefaults[SDRATTR_EDGENODE2HORZDIST-SDRATTR_START]=new SdrEdgeNode2HorzDistItem(nDefEdgeDist);
139 mppLocalPoolDefaults[SDRATTR_EDGENODE2VERTDIST-SDRATTR_START]=new SdrEdgeNode2VertDistItem(nDefEdgeDist);
140 mppLocalPoolDefaults[SDRATTR_EDGENODE1GLUEDIST-SDRATTR_START]=new SdrEdgeNode1GlueDistItem;
141 mppLocalPoolDefaults[SDRATTR_EDGENODE2GLUEDIST-SDRATTR_START]=new SdrEdgeNode2GlueDistItem;
142 mppLocalPoolDefaults[SDRATTR_EDGELINEDELTAANZ -SDRATTR_START]=new SdrEdgeLineDeltaAnzItem;
143 mppLocalPoolDefaults[SDRATTR_EDGELINE1DELTA -SDRATTR_START]=new SdrEdgeLine1DeltaItem;
144 mppLocalPoolDefaults[SDRATTR_EDGELINE2DELTA -SDRATTR_START]=new SdrEdgeLine2DeltaItem;
145 mppLocalPoolDefaults[SDRATTR_EDGELINE3DELTA -SDRATTR_START]=new SdrEdgeLine3DeltaItem;
146 mppLocalPoolDefaults[SDRATTR_MEASUREKIND -SDRATTR_START]=new SdrMeasureKindItem;
147 mppLocalPoolDefaults[SDRATTR_MEASURETEXTHPOS -SDRATTR_START]=new SdrMeasureTextHPosItem;
148 mppLocalPoolDefaults[SDRATTR_MEASURETEXTVPOS -SDRATTR_START]=new SdrMeasureTextVPosItem;
149 mppLocalPoolDefaults[SDRATTR_MEASURELINEDIST -SDRATTR_START]=new SdrMeasureLineDistItem(800);
150 mppLocalPoolDefaults[SDRATTR_MEASUREHELPLINEOVERHANG -SDRATTR_START]=new SdrMeasureHelplineOverhangItem(200);
151 mppLocalPoolDefaults[SDRATTR_MEASUREHELPLINEDIST -SDRATTR_START]=new SdrMeasureHelplineDistItem(100);
152 mppLocalPoolDefaults[SDRATTR_MEASUREHELPLINE1LEN -SDRATTR_START]=new SdrMeasureHelpline1LenItem;
153 mppLocalPoolDefaults[SDRATTR_MEASUREHELPLINE2LEN -SDRATTR_START]=new SdrMeasureHelpline2LenItem;
154 mppLocalPoolDefaults[SDRATTR_MEASUREBELOWREFEDGE -SDRATTR_START]=new SdrMeasureBelowRefEdgeItem;
155 mppLocalPoolDefaults[SDRATTR_MEASURETEXTROTA90 -SDRATTR_START]=new SdrMeasureTextRota90Item;
156 mppLocalPoolDefaults[SDRATTR_MEASURETEXTUPSIDEDOWN -SDRATTR_START]=new SdrMeasureTextUpsideDownItem;
157 mppLocalPoolDefaults[SDRATTR_MEASUREOVERHANG -SDRATTR_START]=new SdrMeasureOverhangItem(600);
158 mppLocalPoolDefaults[SDRATTR_MEASUREUNIT -SDRATTR_START]=new SdrMeasureUnitItem;
159 mppLocalPoolDefaults[SDRATTR_MEASURESCALE -SDRATTR_START]=new SdrMeasureScaleItem;
160 mppLocalPoolDefaults[SDRATTR_MEASURESHOWUNIT -SDRATTR_START]=new SdrMeasureShowUnitItem;
161 mppLocalPoolDefaults[SDRATTR_MEASUREFORMATSTRING -SDRATTR_START]=new SdrMeasureFormatStringItem();
162 mppLocalPoolDefaults[SDRATTR_MEASURETEXTAUTOANGLE -SDRATTR_START]=new SdrMeasureTextAutoAngleItem();
163 mppLocalPoolDefaults[SDRATTR_MEASURETEXTAUTOANGLEVIEW-SDRATTR_START]=new SdrMeasureTextAutoAngleViewItem();
164 mppLocalPoolDefaults[SDRATTR_MEASURETEXTISFIXEDANGLE -SDRATTR_START]=new SdrMeasureTextIsFixedAngleItem();
165 mppLocalPoolDefaults[SDRATTR_MEASURETEXTFIXEDANGLE -SDRATTR_START]=new SdrMeasureTextFixedAngleItem();
166 mppLocalPoolDefaults[SDRATTR_MEASUREDECIMALPLACES -SDRATTR_START]=new SdrMeasureDecimalPlacesItem();
167 mppLocalPoolDefaults[SDRATTR_CIRCKIND -SDRATTR_START]=new SdrCircKindItem;
168 mppLocalPoolDefaults[SDRATTR_CIRCSTARTANGLE-SDRATTR_START]=new SdrCircStartAngleItem;
169 mppLocalPoolDefaults[SDRATTR_CIRCENDANGLE -SDRATTR_START]=new SdrCircEndAngleItem;
170 mppLocalPoolDefaults[SDRATTR_OBJMOVEPROTECT -SDRATTR_START]=new SdrObjMoveProtectItem;
171 mppLocalPoolDefaults[SDRATTR_OBJSIZEPROTECT -SDRATTR_START]=new SdrObjSizeProtectItem;
172 mppLocalPoolDefaults[SDRATTR_OBJPRINTABLE -SDRATTR_START]=new SdrObjPrintableItem;
173 mppLocalPoolDefaults[SDRATTR_OBJVISIBLE -SDRATTR_START]=new SdrObjVisibleItem;
174 mppLocalPoolDefaults[SDRATTR_LAYERID -SDRATTR_START]=new SdrLayerIdItem;
175 mppLocalPoolDefaults[SDRATTR_LAYERNAME -SDRATTR_START]=new SdrLayerNameItem;
176 mppLocalPoolDefaults[SDRATTR_OBJECTNAME -SDRATTR_START]=new SdrObjectNameItem;
177 mppLocalPoolDefaults[SDRATTR_ALLPOSITIONX -SDRATTR_START]=new SdrAllPositionXItem;
178 mppLocalPoolDefaults[SDRATTR_ALLPOSITIONY -SDRATTR_START]=new SdrAllPositionYItem;
179 mppLocalPoolDefaults[SDRATTR_ALLSIZEWIDTH -SDRATTR_START]=new SdrAllSizeWidthItem;
180 mppLocalPoolDefaults[SDRATTR_ALLSIZEHEIGHT -SDRATTR_START]=new SdrAllSizeHeightItem;
181 mppLocalPoolDefaults[SDRATTR_ONEPOSITIONX -SDRATTR_START]=new SdrOnePositionXItem;
182 mppLocalPoolDefaults[SDRATTR_ONEPOSITIONY -SDRATTR_START]=new SdrOnePositionYItem;
183 mppLocalPoolDefaults[SDRATTR_ONESIZEWIDTH -SDRATTR_START]=new SdrOneSizeWidthItem;
184 mppLocalPoolDefaults[SDRATTR_ONESIZEHEIGHT -SDRATTR_START]=new SdrOneSizeHeightItem;
185 mppLocalPoolDefaults[SDRATTR_LOGICSIZEWIDTH -SDRATTR_START]=new SdrLogicSizeWidthItem;
186 mppLocalPoolDefaults[SDRATTR_LOGICSIZEHEIGHT-SDRATTR_START]=new SdrLogicSizeHeightItem;
187 mppLocalPoolDefaults[SDRATTR_ROTATEANGLE -SDRATTR_START]=new SdrRotateAngleItem;
188 mppLocalPoolDefaults[SDRATTR_SHEARANGLE -SDRATTR_START]=new SdrShearAngleItem;
189 mppLocalPoolDefaults[SDRATTR_MOVEX -SDRATTR_START]=new SdrMoveXItem;
190 mppLocalPoolDefaults[SDRATTR_MOVEY -SDRATTR_START]=new SdrMoveYItem;
191 mppLocalPoolDefaults[SDRATTR_RESIZEXONE -SDRATTR_START]=new SdrResizeXOneItem;
192 mppLocalPoolDefaults[SDRATTR_RESIZEYONE -SDRATTR_START]=new SdrResizeYOneItem;
193 mppLocalPoolDefaults[SDRATTR_ROTATEONE -SDRATTR_START]=new SdrRotateOneItem;
194 mppLocalPoolDefaults[SDRATTR_HORZSHEARONE -SDRATTR_START]=new SdrHorzShearOneItem;
195 mppLocalPoolDefaults[SDRATTR_VERTSHEARONE -SDRATTR_START]=new SdrVertShearOneItem;
196 mppLocalPoolDefaults[SDRATTR_RESIZEXALL -SDRATTR_START]=new SdrResizeXAllItem;
197 mppLocalPoolDefaults[SDRATTR_RESIZEYALL -SDRATTR_START]=new SdrResizeYAllItem;
198 mppLocalPoolDefaults[SDRATTR_ROTATEALL -SDRATTR_START]=new SdrRotateAllItem;
199 mppLocalPoolDefaults[SDRATTR_HORZSHEARALL -SDRATTR_START]=new SdrHorzShearAllItem;
200 mppLocalPoolDefaults[SDRATTR_VERTSHEARALL -SDRATTR_START]=new SdrVertShearAllItem;
201 mppLocalPoolDefaults[SDRATTR_TRANSFORMREF1X -SDRATTR_START]=new SdrTransformRef1XItem;
202 mppLocalPoolDefaults[SDRATTR_TRANSFORMREF1Y -SDRATTR_START]=new SdrTransformRef1YItem;
203 mppLocalPoolDefaults[SDRATTR_TRANSFORMREF2X -SDRATTR_START]=new SdrTransformRef2XItem;
204 mppLocalPoolDefaults[SDRATTR_TRANSFORMREF2Y -SDRATTR_START]=new SdrTransformRef2YItem;
205 mppLocalPoolDefaults[SDRATTR_TEXTDIRECTION -SDRATTR_START]=new SvxWritingModeItem(com::sun::star::text::WritingMode_LR_TB, SDRATTR_TEXTDIRECTION);
206 mppLocalPoolDefaults[ SDRATTR_GRAFRED - SDRATTR_START] = new SdrGrafRedItem;
207 mppLocalPoolDefaults[ SDRATTR_GRAFGREEN - SDRATTR_START] = new SdrGrafGreenItem;
208 mppLocalPoolDefaults[ SDRATTR_GRAFBLUE - SDRATTR_START] = new SdrGrafBlueItem;
209 mppLocalPoolDefaults[ SDRATTR_GRAFLUMINANCE - SDRATTR_START] = new SdrGrafLuminanceItem;
210 mppLocalPoolDefaults[ SDRATTR_GRAFCONTRAST - SDRATTR_START] = new SdrGrafContrastItem;
211 mppLocalPoolDefaults[ SDRATTR_GRAFGAMMA - SDRATTR_START] = new SdrGrafGamma100Item;
212 mppLocalPoolDefaults[ SDRATTR_GRAFTRANSPARENCE - SDRATTR_START] = new SdrGrafTransparenceItem;
213 mppLocalPoolDefaults[ SDRATTR_GRAFINVERT - SDRATTR_START] = new SdrGrafInvertItem;
214 mppLocalPoolDefaults[ SDRATTR_GRAFMODE - SDRATTR_START] = new SdrGrafModeItem;
215 mppLocalPoolDefaults[ SDRATTR_GRAFCROP - SDRATTR_START] = new SdrGrafCropItem;
216 mppLocalPoolDefaults[ SDRATTR_3DOBJ_PERCENT_DIAGONAL - SDRATTR_START ] = new Svx3DPercentDiagonalItem;
217 mppLocalPoolDefaults[ SDRATTR_3DOBJ_BACKSCALE - SDRATTR_START ] = new Svx3DBackscaleItem;
218 mppLocalPoolDefaults[ SDRATTR_3DOBJ_DEPTH - SDRATTR_START ] = new Svx3DDepthItem;
219 mppLocalPoolDefaults[ SDRATTR_3DOBJ_HORZ_SEGS - SDRATTR_START ] = new Svx3DHorizontalSegmentsItem;
220 mppLocalPoolDefaults[ SDRATTR_3DOBJ_VERT_SEGS - SDRATTR_START ] = new Svx3DVerticalSegmentsItem;
221 mppLocalPoolDefaults[ SDRATTR_3DOBJ_END_ANGLE - SDRATTR_START ] = new Svx3DEndAngleItem;
222 mppLocalPoolDefaults[ SDRATTR_3DOBJ_DOUBLE_SIDED - SDRATTR_START ] = new Svx3DDoubleSidedItem;
223 mppLocalPoolDefaults[ SDRATTR_3DOBJ_NORMALS_KIND - SDRATTR_START ] = new Svx3DNormalsKindItem;
224 mppLocalPoolDefaults[ SDRATTR_3DOBJ_NORMALS_INVERT - SDRATTR_START ] = new Svx3DNormalsInvertItem;
225 mppLocalPoolDefaults[ SDRATTR_3DOBJ_TEXTURE_PROJ_X - SDRATTR_START ] = new Svx3DTextureProjectionXItem;
226 mppLocalPoolDefaults[ SDRATTR_3DOBJ_TEXTURE_PROJ_Y - SDRATTR_START ] = new Svx3DTextureProjectionYItem;
227 mppLocalPoolDefaults[ SDRATTR_3DOBJ_SHADOW_3D - SDRATTR_START ] = new Svx3DShadow3DItem;
228 mppLocalPoolDefaults[ SDRATTR_3DOBJ_MAT_COLOR - SDRATTR_START ] = new Svx3DMaterialColorItem;
229 mppLocalPoolDefaults[ SDRATTR_3DOBJ_MAT_EMISSION - SDRATTR_START ] = new Svx3DMaterialEmissionItem;
230 mppLocalPoolDefaults[ SDRATTR_3DOBJ_MAT_SPECULAR - SDRATTR_START ] = new Svx3DMaterialSpecularItem;
231 mppLocalPoolDefaults[ SDRATTR_3DOBJ_MAT_SPECULAR_INTENSITY - SDRATTR_START ] = new Svx3DMaterialSpecularIntensityItem;
232 mppLocalPoolDefaults[ SDRATTR_3DOBJ_TEXTURE_KIND - SDRATTR_START ] = new Svx3DTextureKindItem;
233 mppLocalPoolDefaults[ SDRATTR_3DOBJ_TEXTURE_MODE - SDRATTR_START ] = new Svx3DTextureModeItem;
234 mppLocalPoolDefaults[ SDRATTR_3DOBJ_TEXTURE_FILTER - SDRATTR_START ] = new Svx3DTextureFilterItem;
235 mppLocalPoolDefaults[ SDRATTR_3DOBJ_SMOOTH_NORMALS - SDRATTR_START ] = new Svx3DSmoothNormalsItem;
236 mppLocalPoolDefaults[ SDRATTR_3DOBJ_SMOOTH_LIDS - SDRATTR_START ] = new Svx3DSmoothLidsItem;
237 mppLocalPoolDefaults[ SDRATTR_3DOBJ_CHARACTER_MODE - SDRATTR_START ] = new Svx3DCharacterModeItem;
238 mppLocalPoolDefaults[ SDRATTR_3DOBJ_CLOSE_FRONT - SDRATTR_START ] = new Svx3DCloseFrontItem;
239 mppLocalPoolDefaults[ SDRATTR_3DOBJ_CLOSE_BACK - SDRATTR_START ] = new Svx3DCloseBackItem;
240 mppLocalPoolDefaults[ SDRATTR_3DOBJ_REDUCED_LINE_GEOMETRY - SDRATTR_START ] = new Svx3DReducedLineGeometryItem;
241 mppLocalPoolDefaults[ SDRATTR_3DSCENE_PERSPECTIVE - SDRATTR_START ] = new Svx3DPerspectiveItem;
242 mppLocalPoolDefaults[ SDRATTR_3DSCENE_DISTANCE - SDRATTR_START ] = new Svx3DDistanceItem;
243 mppLocalPoolDefaults[ SDRATTR_3DSCENE_FOCAL_LENGTH - SDRATTR_START ] = new Svx3DFocalLengthItem;
244 mppLocalPoolDefaults[ SDRATTR_3DSCENE_TWO_SIDED_LIGHTING - SDRATTR_START ] = new Svx3DTwoSidedLightingItem;
245 mppLocalPoolDefaults[ SDRATTR_3DSCENE_LIGHTCOLOR_1 - SDRATTR_START ] = new Svx3DLightcolor1Item;
246 mppLocalPoolDefaults[ SDRATTR_3DSCENE_LIGHTCOLOR_2 - SDRATTR_START ] = new Svx3DLightcolor2Item;
247 mppLocalPoolDefaults[ SDRATTR_3DSCENE_LIGHTCOLOR_3 - SDRATTR_START ] = new Svx3DLightcolor3Item;
248 mppLocalPoolDefaults[ SDRATTR_3DSCENE_LIGHTCOLOR_4 - SDRATTR_START ] = new Svx3DLightcolor4Item;
249 mppLocalPoolDefaults[ SDRATTR_3DSCENE_LIGHTCOLOR_5 - SDRATTR_START ] = new Svx3DLightcolor5Item;
250 mppLocalPoolDefaults[ SDRATTR_3DSCENE_LIGHTCOLOR_6 - SDRATTR_START ] = new Svx3DLightcolor6Item;
251 mppLocalPoolDefaults[ SDRATTR_3DSCENE_LIGHTCOLOR_7 - SDRATTR_START ] = new Svx3DLightcolor7Item;
252 mppLocalPoolDefaults[ SDRATTR_3DSCENE_LIGHTCOLOR_8 - SDRATTR_START ] = new Svx3DLightcolor8Item;
253 mppLocalPoolDefaults[ SDRATTR_3DSCENE_AMBIENTCOLOR - SDRATTR_START ] = new Svx3DAmbientcolorItem;
254 mppLocalPoolDefaults[ SDRATTR_3DSCENE_LIGHTON_1 - SDRATTR_START ] = new Svx3DLightOnOff1Item;
255 mppLocalPoolDefaults[ SDRATTR_3DSCENE_LIGHTON_2 - SDRATTR_START ] = new Svx3DLightOnOff2Item;
256 mppLocalPoolDefaults[ SDRATTR_3DSCENE_LIGHTON_3 - SDRATTR_START ] = new Svx3DLightOnOff3Item;
257 mppLocalPoolDefaults[ SDRATTR_3DSCENE_LIGHTON_4 - SDRATTR_START ] = new Svx3DLightOnOff4Item;
258 mppLocalPoolDefaults[ SDRATTR_3DSCENE_LIGHTON_5 - SDRATTR_START ] = new Svx3DLightOnOff5Item;
259 mppLocalPoolDefaults[ SDRATTR_3DSCENE_LIGHTON_6 - SDRATTR_START ] = new Svx3DLightOnOff6Item;
260 mppLocalPoolDefaults[ SDRATTR_3DSCENE_LIGHTON_7 - SDRATTR_START ] = new Svx3DLightOnOff7Item;
261 mppLocalPoolDefaults[ SDRATTR_3DSCENE_LIGHTON_8 - SDRATTR_START ] = new Svx3DLightOnOff8Item;
262 mppLocalPoolDefaults[ SDRATTR_3DSCENE_LIGHTDIRECTION_1 - SDRATTR_START ] = new Svx3DLightDirection1Item;
263 mppLocalPoolDefaults[ SDRATTR_3DSCENE_LIGHTDIRECTION_2 - SDRATTR_START ] = new Svx3DLightDirection2Item;
264 mppLocalPoolDefaults[ SDRATTR_3DSCENE_LIGHTDIRECTION_3 - SDRATTR_START ] = new Svx3DLightDirection3Item;
265 mppLocalPoolDefaults[ SDRATTR_3DSCENE_LIGHTDIRECTION_4 - SDRATTR_START ] = new Svx3DLightDirection4Item;
266 mppLocalPoolDefaults[ SDRATTR_3DSCENE_LIGHTDIRECTION_5 - SDRATTR_START ] = new Svx3DLightDirection5Item;
267 mppLocalPoolDefaults[ SDRATTR_3DSCENE_LIGHTDIRECTION_6 - SDRATTR_START ] = new Svx3DLightDirection6Item;
268 mppLocalPoolDefaults[ SDRATTR_3DSCENE_LIGHTDIRECTION_7 - SDRATTR_START ] = new Svx3DLightDirection7Item;
269 mppLocalPoolDefaults[ SDRATTR_3DSCENE_LIGHTDIRECTION_8 - SDRATTR_START ] = new Svx3DLightDirection8Item;
270 mppLocalPoolDefaults[ SDRATTR_3DSCENE_SHADOW_SLANT - SDRATTR_START ] = new Svx3DShadowSlantItem;
271 mppLocalPoolDefaults[ SDRATTR_3DSCENE_SHADE_MODE - SDRATTR_START ] = new Svx3DShadeModeItem;
272 mppLocalPoolDefaults[ SDRATTR_CUSTOMSHAPE_ENGINE - SDRATTR_START ] = new SdrCustomShapeEngineItem;
273 mppLocalPoolDefaults[ SDRATTR_CUSTOMSHAPE_DATA - SDRATTR_START ] = new SdrCustomShapeDataItem;
274 mppLocalPoolDefaults[ SDRATTR_CUSTOMSHAPE_GEOMETRY - SDRATTR_START ] = new SdrCustomShapeGeometryItem;
275 mppLocalPoolDefaults[ SDRATTR_CUSTOMSHAPE_REPLACEMENT_URL - SDRATTR_START ] = new SdrCustomShapeReplacementURLItem;
277 SvxBoxItem* pboxItem = new SvxBoxItem( SDRATTR_TABLE_BORDER );
278 pboxItem->SetDistance( 100 );
279 mppLocalPoolDefaults[ SDRATTR_TABLE_BORDER - SDRATTR_START ] = pboxItem;
281 SvxBoxInfoItem* pBoxInfoItem = new SvxBoxInfoItem( SDRATTR_TABLE_BORDER_INNER );
283 pBoxInfoItem->SetTable( sal_True );
284 pBoxInfoItem->SetDist( sal_True); // always show margin field
285 pBoxInfoItem->SetValid( VALID_DISABLE, sal_True ); // some lines may have DontCare state only in tables
287 mppLocalPoolDefaults[ SDRATTR_TABLE_BORDER_INNER - SDRATTR_START ] = pBoxInfoItem;
288 mppLocalPoolDefaults[ SDRATTR_TABLE_BORDER_TLBR - SDRATTR_START ] = new SvxLineItem( SDRATTR_TABLE_BORDER_TLBR );
289 mppLocalPoolDefaults[ SDRATTR_TABLE_BORDER_BLTR - SDRATTR_START ] = new SvxLineItem( SDRATTR_TABLE_BORDER_BLTR );
291 // set own ItemInfos
292 mpLocalItemInfos[SDRATTR_SHADOW-SDRATTR_START]._nSID=SID_ATTR_FILL_SHADOW;
293 mpLocalItemInfos[SDRATTR_TEXT_FITTOSIZE-SDRATTR_START]._nSID=SID_ATTR_TEXT_FITTOSIZE;
294 mpLocalItemInfos[SDRATTR_GRAFCROP-SDRATTR_START]._nSID=SID_ATTR_GRAF_CROP;
296 mpLocalItemInfos[SDRATTR_TABLE_BORDER - SDRATTR_START ]._nSID = SID_ATTR_BORDER_OUTER;
297 mpLocalItemInfos[SDRATTR_TABLE_BORDER_INNER - SDRATTR_START ]._nSID = SID_ATTR_BORDER_INNER;
298 mpLocalItemInfos[SDRATTR_TABLE_BORDER_TLBR - SDRATTR_START ]._nSID = SID_ATTR_BORDER_DIAG_TLBR;
299 mpLocalItemInfos[SDRATTR_TABLE_BORDER_BLTR - SDRATTR_START ]._nSID = SID_ATTR_BORDER_DIAG_BLTR;
301 // it's my own creation level, set Defaults and ItemInfos
302 SetDefaults(mppLocalPoolDefaults);
303 SetItemInfos(mpLocalItemInfos);
306 /*************************************************************************
308 |* copy ctor, so that static defaults are cloned
309 |* (Parameter 2 = sal_True)
311 \************************************************************************/
313 SdrItemPool::SdrItemPool(const SdrItemPool& rPool)
314 : XOutdevItemPool(rPool)
318 /*************************************************************************
320 |* Clone()
322 \************************************************************************/
324 SfxItemPool* SdrItemPool::Clone() const
326 return new SdrItemPool(*this);
329 /*************************************************************************
331 |* Destructor
333 \************************************************************************/
335 SdrItemPool::~SdrItemPool()
337 // dtor of SfxItemPool
338 Delete();
340 // clear own static Defaults
341 if(mppLocalPoolDefaults)
343 const sal_uInt16 nBeg(SDRATTR_SHADOW_FIRST - SDRATTR_START);
344 const sal_uInt16 nEnd2(SDRATTR_END - SDRATTR_START);
346 for(sal_uInt16 i(nBeg); i <= nEnd2; i++)
348 SetRefCount(*mppLocalPoolDefaults[i],0);
349 delete mppLocalPoolDefaults[i];
350 mppLocalPoolDefaults[i] = 0L;
354 // split pools before destroying
355 SetSecondaryPool(NULL);
358 SfxItemPresentation SdrItemPool::GetPresentation(
359 const SfxPoolItem& rItem, SfxItemPresentation ePresentation,
360 SfxMapUnit ePresentationMetric, OUString& rText,
361 const IntlWrapper * pIntlWrapper) const
363 if (!IsInvalidItem(&rItem)) {
364 sal_uInt16 nWhich=rItem.Which();
365 if (nWhich>=SDRATTR_SHADOW_FIRST && nWhich<=SDRATTR_END) {
366 rItem.GetPresentation(SFX_ITEM_PRESENTATION_NAMELESS,
367 GetMetric(nWhich),ePresentationMetric,rText,
368 pIntlWrapper);
369 OUString aStr;
371 TakeItemName(nWhich, aStr);
372 rText = aStr + " " + rText;
374 return ePresentation;
377 return XOutdevItemPool::GetPresentation(rItem,ePresentation,ePresentationMetric,rText,pIntlWrapper);
380 void SdrItemPool::TakeItemName(sal_uInt16 nWhich, OUString& rItemName)
382 ResMgr* pResMgr = ImpGetResMgr();
383 sal_uInt16 nResId = SIP_UNKNOWN_ATTR;
385 switch (nWhich)
387 case XATTR_LINESTYLE : nResId = SIP_XA_LINESTYLE;break;
388 case XATTR_LINEDASH : nResId = SIP_XA_LINEDASH;break;
389 case XATTR_LINEWIDTH : nResId = SIP_XA_LINEWIDTH;break;
390 case XATTR_LINECOLOR : nResId = SIP_XA_LINECOLOR;break;
391 case XATTR_LINESTART : nResId = SIP_XA_LINESTART;break;
392 case XATTR_LINEEND : nResId = SIP_XA_LINEEND;break;
393 case XATTR_LINESTARTWIDTH : nResId = SIP_XA_LINESTARTWIDTH;break;
394 case XATTR_LINEENDWIDTH : nResId = SIP_XA_LINEENDWIDTH;break;
395 case XATTR_LINESTARTCENTER : nResId = SIP_XA_LINESTARTCENTER;break;
396 case XATTR_LINEENDCENTER : nResId = SIP_XA_LINEENDCENTER;break;
397 case XATTR_LINETRANSPARENCE : nResId = SIP_XA_LINETRANSPARENCE;break;
398 case XATTR_LINEJOINT : nResId = SIP_XA_LINEJOINT;break;
399 case XATTRSET_LINE : nResId = SIP_XATTRSET_LINE;break;
401 case XATTR_FILLSTYLE : nResId = SIP_XA_FILLSTYLE;break;
402 case XATTR_FILLCOLOR : nResId = SIP_XA_FILLCOLOR;break;
403 case XATTR_FILLGRADIENT : nResId = SIP_XA_FILLGRADIENT;break;
404 case XATTR_FILLHATCH : nResId = SIP_XA_FILLHATCH;break;
405 case XATTR_FILLBITMAP : nResId = SIP_XA_FILLBITMAP;break;
406 case XATTR_FILLTRANSPARENCE : nResId = SIP_XA_FILLTRANSPARENCE;break;
407 case XATTR_GRADIENTSTEPCOUNT : nResId = SIP_XA_GRADIENTSTEPCOUNT;break;
408 case XATTR_FILLBMP_TILE : nResId = SIP_XA_FILLBMP_TILE;break;
409 case XATTR_FILLBMP_POS : nResId = SIP_XA_FILLBMP_POS;break;
410 case XATTR_FILLBMP_SIZEX : nResId = SIP_XA_FILLBMP_SIZEX;break;
411 case XATTR_FILLBMP_SIZEY : nResId = SIP_XA_FILLBMP_SIZEY;break;
412 case XATTR_FILLFLOATTRANSPARENCE: nResId = SIP_XA_FILLFLOATTRANSPARENCE;break;
413 case XATTR_SECONDARYFILLCOLOR : nResId = SIP_XA_SECONDARYFILLCOLOR;break;
414 case XATTR_FILLBMP_SIZELOG : nResId = SIP_XA_FILLBMP_SIZELOG;break;
415 case XATTR_FILLBMP_TILEOFFSETX : nResId = SIP_XA_FILLBMP_TILEOFFSETX;break;
416 case XATTR_FILLBMP_TILEOFFSETY : nResId = SIP_XA_FILLBMP_TILEOFFSETY;break;
417 case XATTR_FILLBMP_STRETCH : nResId = SIP_XA_FILLBMP_STRETCH;break;
418 case XATTR_FILLBMP_POSOFFSETX : nResId = SIP_XA_FILLBMP_POSOFFSETX;break;
419 case XATTR_FILLBMP_POSOFFSETY : nResId = SIP_XA_FILLBMP_POSOFFSETY;break;
420 case XATTR_FILLBACKGROUND : nResId = SIP_XA_FILLBACKGROUND;break;
422 case XATTRSET_FILL : nResId = SIP_XATTRSET_FILL;break;
424 case XATTR_FORMTXTSTYLE : nResId = SIP_XA_FORMTXTSTYLE;break;
425 case XATTR_FORMTXTADJUST : nResId = SIP_XA_FORMTXTADJUST;break;
426 case XATTR_FORMTXTDISTANCE : nResId = SIP_XA_FORMTXTDISTANCE;break;
427 case XATTR_FORMTXTSTART : nResId = SIP_XA_FORMTXTSTART;break;
428 case XATTR_FORMTXTMIRROR : nResId = SIP_XA_FORMTXTMIRROR;break;
429 case XATTR_FORMTXTOUTLINE : nResId = SIP_XA_FORMTXTOUTLINE;break;
430 case XATTR_FORMTXTSHADOW : nResId = SIP_XA_FORMTXTSHADOW;break;
431 case XATTR_FORMTXTSHDWCOLOR : nResId = SIP_XA_FORMTXTSHDWCOLOR;break;
432 case XATTR_FORMTXTSHDWXVAL : nResId = SIP_XA_FORMTXTSHDWXVAL;break;
433 case XATTR_FORMTXTSHDWYVAL : nResId = SIP_XA_FORMTXTSHDWYVAL;break;
434 case XATTR_FORMTXTSTDFORM : nResId = SIP_XA_FORMTXTSTDFORM;break;
435 case XATTR_FORMTXTHIDEFORM : nResId = SIP_XA_FORMTXTHIDEFORM;break;
436 case XATTR_FORMTXTSHDWTRANSP: nResId = SIP_XA_FORMTXTSHDWTRANSP;break;
438 case SDRATTR_SHADOW : nResId = SIP_SA_SHADOW;break;
439 case SDRATTR_SHADOWCOLOR : nResId = SIP_SA_SHADOWCOLOR;break;
440 case SDRATTR_SHADOWXDIST : nResId = SIP_SA_SHADOWXDIST;break;
441 case SDRATTR_SHADOWYDIST : nResId = SIP_SA_SHADOWYDIST;break;
442 case SDRATTR_SHADOWTRANSPARENCE: nResId = SIP_SA_SHADOWTRANSPARENCE;break;
443 case SDRATTR_SHADOW3D : nResId = SIP_SA_SHADOW3D;break;
444 case SDRATTR_SHADOWPERSP : nResId = SIP_SA_SHADOWPERSP;break;
446 case SDRATTR_CAPTIONTYPE : nResId = SIP_SA_CAPTIONTYPE;break;
447 case SDRATTR_CAPTIONFIXEDANGLE: nResId = SIP_SA_CAPTIONFIXEDANGLE;break;
448 case SDRATTR_CAPTIONANGLE : nResId = SIP_SA_CAPTIONANGLE;break;
449 case SDRATTR_CAPTIONGAP : nResId = SIP_SA_CAPTIONGAP;break;
450 case SDRATTR_CAPTIONESCDIR : nResId = SIP_SA_CAPTIONESCDIR;break;
451 case SDRATTR_CAPTIONESCISREL : nResId = SIP_SA_CAPTIONESCISREL;break;
452 case SDRATTR_CAPTIONESCREL : nResId = SIP_SA_CAPTIONESCREL;break;
453 case SDRATTR_CAPTIONESCABS : nResId = SIP_SA_CAPTIONESCABS;break;
454 case SDRATTR_CAPTIONLINELEN : nResId = SIP_SA_CAPTIONLINELEN;break;
455 case SDRATTR_CAPTIONFITLINELEN: nResId = SIP_SA_CAPTIONFITLINELEN;break;
457 case SDRATTR_ECKENRADIUS : nResId = SIP_SA_ECKENRADIUS;break;
458 case SDRATTR_TEXT_MINFRAMEHEIGHT : nResId = SIP_SA_TEXT_MINFRAMEHEIGHT;break;
459 case SDRATTR_TEXT_AUTOGROWHEIGHT : nResId = SIP_SA_TEXT_AUTOGROWHEIGHT;break;
460 case SDRATTR_TEXT_FITTOSIZE : nResId = SIP_SA_TEXT_FITTOSIZE;break;
461 case SDRATTR_TEXT_LEFTDIST : nResId = SIP_SA_TEXT_LEFTDIST;break;
462 case SDRATTR_TEXT_RIGHTDIST : nResId = SIP_SA_TEXT_RIGHTDIST;break;
463 case SDRATTR_TEXT_UPPERDIST : nResId = SIP_SA_TEXT_UPPERDIST;break;
464 case SDRATTR_TEXT_LOWERDIST : nResId = SIP_SA_TEXT_LOWERDIST;break;
465 case SDRATTR_TEXT_VERTADJUST : nResId = SIP_SA_TEXT_VERTADJUST;break;
466 case SDRATTR_TEXT_MAXFRAMEHEIGHT : nResId = SIP_SA_TEXT_MAXFRAMEHEIGHT;break;
467 case SDRATTR_TEXT_MINFRAMEWIDTH : nResId = SIP_SA_TEXT_MINFRAMEWIDTH;break;
468 case SDRATTR_TEXT_MAXFRAMEWIDTH : nResId = SIP_SA_TEXT_MAXFRAMEWIDTH;break;
469 case SDRATTR_TEXT_AUTOGROWWIDTH : nResId = SIP_SA_TEXT_AUTOGROWWIDTH;break;
470 case SDRATTR_TEXT_HORZADJUST : nResId = SIP_SA_TEXT_HORZADJUST;break;
471 case SDRATTR_TEXT_ANIKIND : nResId = SIP_SA_TEXT_ANIKIND;break;
472 case SDRATTR_TEXT_ANIDIRECTION : nResId = SIP_SA_TEXT_ANIDIRECTION;break;
473 case SDRATTR_TEXT_ANISTARTINSIDE : nResId = SIP_SA_TEXT_ANISTARTINSIDE;break;
474 case SDRATTR_TEXT_ANISTOPINSIDE : nResId = SIP_SA_TEXT_ANISTOPINSIDE;break;
475 case SDRATTR_TEXT_ANICOUNT : nResId = SIP_SA_TEXT_ANICOUNT;break;
476 case SDRATTR_TEXT_ANIDELAY : nResId = SIP_SA_TEXT_ANIDELAY;break;
477 case SDRATTR_TEXT_ANIAMOUNT : nResId = SIP_SA_TEXT_ANIAMOUNT;break;
478 case SDRATTR_TEXT_CONTOURFRAME : nResId = SIP_SA_TEXT_CONTOURFRAME;break;
479 case SDRATTR_CUSTOMSHAPE_ADJUSTMENT : nResId = SIP_SA_CUSTOMSHAPE_ADJUSTMENT;break;
480 case SDRATTR_XMLATTRIBUTES : nResId = SIP_SA_XMLATTRIBUTES;break;
481 case SDRATTR_TEXT_USEFIXEDCELLHEIGHT: nResId = SIP_SA_TEXT_USEFIXEDCELLHEIGHT;break;
482 case SDRATTR_TEXT_WORDWRAP : nResId = SIP_SA_WORDWRAP;break;
483 case SDRATTR_TEXT_AUTOGROWSIZE : nResId = SIP_SA_AUTOGROWSIZE;break;
485 case SDRATTR_EDGEKIND : nResId = SIP_SA_EDGEKIND;break;
486 case SDRATTR_EDGENODE1HORZDIST : nResId = SIP_SA_EDGENODE1HORZDIST;break;
487 case SDRATTR_EDGENODE1VERTDIST : nResId = SIP_SA_EDGENODE1VERTDIST;break;
488 case SDRATTR_EDGENODE2HORZDIST : nResId = SIP_SA_EDGENODE2HORZDIST;break;
489 case SDRATTR_EDGENODE2VERTDIST : nResId = SIP_SA_EDGENODE2VERTDIST;break;
490 case SDRATTR_EDGENODE1GLUEDIST : nResId = SIP_SA_EDGENODE1GLUEDIST;break;
491 case SDRATTR_EDGENODE2GLUEDIST : nResId = SIP_SA_EDGENODE2GLUEDIST;break;
492 case SDRATTR_EDGELINEDELTAANZ : nResId = SIP_SA_EDGELINEDELTAANZ;break;
493 case SDRATTR_EDGELINE1DELTA : nResId = SIP_SA_EDGELINE1DELTA;break;
494 case SDRATTR_EDGELINE2DELTA : nResId = SIP_SA_EDGELINE2DELTA;break;
495 case SDRATTR_EDGELINE3DELTA : nResId = SIP_SA_EDGELINE3DELTA;break;
497 case SDRATTR_MEASUREKIND : nResId = SIP_SA_MEASUREKIND;break;
498 case SDRATTR_MEASURETEXTHPOS : nResId = SIP_SA_MEASURETEXTHPOS;break;
499 case SDRATTR_MEASURETEXTVPOS : nResId = SIP_SA_MEASURETEXTVPOS;break;
500 case SDRATTR_MEASURELINEDIST : nResId = SIP_SA_MEASURELINEDIST;break;
501 case SDRATTR_MEASUREHELPLINEOVERHANG : nResId = SIP_SA_MEASUREHELPLINEOVERHANG;break;
502 case SDRATTR_MEASUREHELPLINEDIST : nResId = SIP_SA_MEASUREHELPLINEDIST;break;
503 case SDRATTR_MEASUREHELPLINE1LEN : nResId = SIP_SA_MEASUREHELPLINE1LEN;break;
504 case SDRATTR_MEASUREHELPLINE2LEN : nResId = SIP_SA_MEASUREHELPLINE2LEN;break;
505 case SDRATTR_MEASUREBELOWREFEDGE : nResId = SIP_SA_MEASUREBELOWREFEDGE;break;
506 case SDRATTR_MEASURETEXTROTA90 : nResId = SIP_SA_MEASURETEXTROTA90;break;
507 case SDRATTR_MEASURETEXTUPSIDEDOWN : nResId = SIP_SA_MEASURETEXTUPSIDEDOWN;break;
508 case SDRATTR_MEASUREOVERHANG : nResId = SIP_SA_MEASUREOVERHANG;break;
509 case SDRATTR_MEASUREUNIT : nResId = SIP_SA_MEASUREUNIT;break;
510 case SDRATTR_MEASURESCALE : nResId = SIP_SA_MEASURESCALE;break;
511 case SDRATTR_MEASURESHOWUNIT : nResId = SIP_SA_MEASURESHOWUNIT;break;
512 case SDRATTR_MEASUREFORMATSTRING : nResId = SIP_SA_MEASUREFORMATSTRING;break;
513 case SDRATTR_MEASURETEXTAUTOANGLE : nResId = SIP_SA_MEASURETEXTAUTOANGLE;break;
514 case SDRATTR_MEASURETEXTAUTOANGLEVIEW: nResId = SIP_SA_MEASURETEXTAUTOANGLEVIEW;break;
515 case SDRATTR_MEASURETEXTISFIXEDANGLE : nResId = SIP_SA_MEASURETEXTISFIXEDANGLE;break;
516 case SDRATTR_MEASURETEXTFIXEDANGLE : nResId = SIP_SA_MEASURETEXTFIXEDANGLE;break;
517 case SDRATTR_MEASUREDECIMALPLACES : nResId = SIP_SA_MEASUREDECIMALPLACES;break;
519 case SDRATTR_CIRCKIND : nResId = SIP_SA_CIRCKIND;break;
520 case SDRATTR_CIRCSTARTANGLE: nResId = SIP_SA_CIRCSTARTANGLE;break;
521 case SDRATTR_CIRCENDANGLE : nResId = SIP_SA_CIRCENDANGLE;break;
523 case SDRATTR_OBJMOVEPROTECT : nResId = SIP_SA_OBJMOVEPROTECT;break;
524 case SDRATTR_OBJSIZEPROTECT : nResId = SIP_SA_OBJSIZEPROTECT;break;
525 case SDRATTR_OBJPRINTABLE : nResId = SIP_SA_OBJPRINTABLE;break;
526 case SDRATTR_OBJVISIBLE : nResId = SIP_SA_OBJVISIBLE;break;
527 case SDRATTR_LAYERID : nResId = SIP_SA_LAYERID;break;
528 case SDRATTR_LAYERNAME : nResId = SIP_SA_LAYERNAME;break;
529 case SDRATTR_OBJECTNAME : nResId = SIP_SA_OBJECTNAME;break;
530 case SDRATTR_ALLPOSITIONX : nResId = SIP_SA_ALLPOSITIONX;break;
531 case SDRATTR_ALLPOSITIONY : nResId = SIP_SA_ALLPOSITIONY;break;
532 case SDRATTR_ALLSIZEWIDTH : nResId = SIP_SA_ALLSIZEWIDTH;break;
533 case SDRATTR_ALLSIZEHEIGHT : nResId = SIP_SA_ALLSIZEHEIGHT;break;
534 case SDRATTR_ONEPOSITIONX : nResId = SIP_SA_ONEPOSITIONX;break;
535 case SDRATTR_ONEPOSITIONY : nResId = SIP_SA_ONEPOSITIONY;break;
536 case SDRATTR_ONESIZEWIDTH : nResId = SIP_SA_ONESIZEWIDTH;break;
537 case SDRATTR_ONESIZEHEIGHT : nResId = SIP_SA_ONESIZEHEIGHT;break;
538 case SDRATTR_LOGICSIZEWIDTH : nResId = SIP_SA_LOGICSIZEWIDTH;break;
539 case SDRATTR_LOGICSIZEHEIGHT: nResId = SIP_SA_LOGICSIZEHEIGHT;break;
540 case SDRATTR_ROTATEANGLE : nResId = SIP_SA_ROTATEANGLE;break;
541 case SDRATTR_SHEARANGLE : nResId = SIP_SA_SHEARANGLE;break;
542 case SDRATTR_MOVEX : nResId = SIP_SA_MOVEX;break;
543 case SDRATTR_MOVEY : nResId = SIP_SA_MOVEY;break;
544 case SDRATTR_RESIZEXONE : nResId = SIP_SA_RESIZEXONE;break;
545 case SDRATTR_RESIZEYONE : nResId = SIP_SA_RESIZEYONE;break;
546 case SDRATTR_ROTATEONE : nResId = SIP_SA_ROTATEONE;break;
547 case SDRATTR_HORZSHEARONE : nResId = SIP_SA_HORZSHEARONE;break;
548 case SDRATTR_VERTSHEARONE : nResId = SIP_SA_VERTSHEARONE;break;
549 case SDRATTR_RESIZEXALL : nResId = SIP_SA_RESIZEXALL;break;
550 case SDRATTR_RESIZEYALL : nResId = SIP_SA_RESIZEYALL;break;
551 case SDRATTR_ROTATEALL : nResId = SIP_SA_ROTATEALL;break;
552 case SDRATTR_HORZSHEARALL : nResId = SIP_SA_HORZSHEARALL;break;
553 case SDRATTR_VERTSHEARALL : nResId = SIP_SA_VERTSHEARALL;break;
554 case SDRATTR_TRANSFORMREF1X : nResId = SIP_SA_TRANSFORMREF1X;break;
555 case SDRATTR_TRANSFORMREF1Y : nResId = SIP_SA_TRANSFORMREF1Y;break;
556 case SDRATTR_TRANSFORMREF2X : nResId = SIP_SA_TRANSFORMREF2X;break;
557 case SDRATTR_TRANSFORMREF2Y : nResId = SIP_SA_TRANSFORMREF2Y;break;
559 case SDRATTR_GRAFRED : nResId = SIP_SA_GRAFRED;break;
560 case SDRATTR_GRAFGREEN : nResId = SIP_SA_GRAFGREEN;break;
561 case SDRATTR_GRAFBLUE : nResId = SIP_SA_GRAFBLUE;break;
562 case SDRATTR_GRAFLUMINANCE : nResId = SIP_SA_GRAFLUMINANCE;break;
563 case SDRATTR_GRAFCONTRAST : nResId = SIP_SA_GRAFCONTRAST;break;
564 case SDRATTR_GRAFGAMMA : nResId = SIP_SA_GRAFGAMMA;break;
565 case SDRATTR_GRAFTRANSPARENCE : nResId = SIP_SA_GRAFTRANSPARENCE;break;
566 case SDRATTR_GRAFINVERT : nResId = SIP_SA_GRAFINVERT;break;
567 case SDRATTR_GRAFMODE : nResId = SIP_SA_GRAFMODE;break;
568 case SDRATTR_GRAFCROP : nResId = SIP_SA_GRAFCROP;break;
570 case EE_PARA_HYPHENATE : nResId = SIP_EE_PARA_HYPHENATE;break;
571 case EE_PARA_BULLETSTATE: nResId = SIP_EE_PARA_BULLETSTATE;break;
572 case EE_PARA_OUTLLRSPACE: nResId = SIP_EE_PARA_OUTLLRSPACE;break;
573 case EE_PARA_OUTLLEVEL : nResId = SIP_EE_PARA_OUTLLEVEL;break;
574 case EE_PARA_BULLET : nResId = SIP_EE_PARA_BULLET;break;
575 case EE_PARA_LRSPACE : nResId = SIP_EE_PARA_LRSPACE;break;
576 case EE_PARA_ULSPACE : nResId = SIP_EE_PARA_ULSPACE;break;
577 case EE_PARA_SBL : nResId = SIP_EE_PARA_SBL;break;
578 case EE_PARA_JUST : nResId = SIP_EE_PARA_JUST;break;
579 case EE_PARA_TABS : nResId = SIP_EE_PARA_TABS;break;
581 case EE_CHAR_COLOR : nResId = SIP_EE_CHAR_COLOR;break;
582 case EE_CHAR_FONTINFO : nResId = SIP_EE_CHAR_FONTINFO;break;
583 case EE_CHAR_FONTHEIGHT : nResId = SIP_EE_CHAR_FONTHEIGHT;break;
584 case EE_CHAR_FONTWIDTH : nResId = SIP_EE_CHAR_FONTWIDTH;break;
585 case EE_CHAR_WEIGHT : nResId = SIP_EE_CHAR_WEIGHT;break;
586 case EE_CHAR_UNDERLINE : nResId = SIP_EE_CHAR_UNDERLINE;break;
587 case EE_CHAR_OVERLINE : nResId = SIP_EE_CHAR_OVERLINE;break;
588 case EE_CHAR_STRIKEOUT : nResId = SIP_EE_CHAR_STRIKEOUT;break;
589 case EE_CHAR_ITALIC : nResId = SIP_EE_CHAR_ITALIC;break;
590 case EE_CHAR_OUTLINE : nResId = SIP_EE_CHAR_OUTLINE;break;
591 case EE_CHAR_SHADOW : nResId = SIP_EE_CHAR_SHADOW;break;
592 case EE_CHAR_ESCAPEMENT : nResId = SIP_EE_CHAR_ESCAPEMENT;break;
593 case EE_CHAR_PAIRKERNING: nResId = SIP_EE_CHAR_PAIRKERNING;break;
594 case EE_CHAR_KERNING : nResId = SIP_EE_CHAR_KERNING;break;
595 case EE_CHAR_WLM : nResId = SIP_EE_CHAR_WLM;break;
596 case EE_FEATURE_TAB : nResId = SIP_EE_FEATURE_TAB;break;
597 case EE_FEATURE_LINEBR : nResId = SIP_EE_FEATURE_LINEBR;break;
598 case EE_FEATURE_NOTCONV : nResId = SIP_EE_FEATURE_NOTCONV;break;
599 case EE_FEATURE_FIELD : nResId = SIP_EE_FEATURE_FIELD;break;
600 } // switch
602 rItemName = ResId( nResId, *pResMgr );
605 ////////////////////////////////////////////////////////////////////////////////
606 // FractionItem
607 ////////////////////////////////////////////////////////////////////////////////
609 TYPEINIT1_AUTOFACTORY(SdrFractionItem,SfxPoolItem);
611 SdrFractionItem::SdrFractionItem(sal_uInt16 nId, SvStream& rIn):
612 SfxPoolItem(nId)
614 sal_Int32 nMul,nDiv;
615 rIn>>nMul;
616 rIn>>nDiv;
617 nValue=Fraction(nMul,nDiv);
620 int SdrFractionItem::operator==(const SfxPoolItem& rCmp) const
622 return SfxPoolItem::operator==(rCmp) &&
623 ((SdrFractionItem&)rCmp).GetValue()==nValue;
626 SfxItemPresentation SdrFractionItem::GetPresentation(
627 SfxItemPresentation ePresentation, SfxMapUnit /*eCoreMetric*/,
628 SfxMapUnit /*ePresentationMetric*/, OUString &rText, const IntlWrapper *) const
630 if(nValue.IsValid())
632 sal_Int32 nDiv = nValue.GetDenominator();
633 rText = OUString::valueOf(nValue.GetNumerator());
635 if(nDiv != 1)
637 rText = rText + "/" + OUString::valueOf(nDiv);
640 else
642 rText = "?";
645 if(ePresentation == SFX_ITEM_PRESENTATION_COMPLETE)
647 OUString aStr;
649 SdrItemPool::TakeItemName(Which(), aStr);
650 rText = aStr + " " + rText;
653 return ePresentation;
656 SfxPoolItem* SdrFractionItem::Create(SvStream& rIn, sal_uInt16 /*nVer*/) const
658 return new SdrFractionItem(Which(),rIn);
661 SvStream& SdrFractionItem::Store(SvStream& rOut, sal_uInt16 /*nItemVers*/) const
663 rOut<<sal_Int32(nValue.GetNumerator());
664 rOut<<sal_Int32(nValue.GetDenominator());
665 return rOut;
668 SfxPoolItem* SdrFractionItem::Clone(SfxItemPool * /*pPool*/) const
670 return new SdrFractionItem(Which(),GetValue());
673 ////////////////////////////////////////////////////////////////////////////////
674 // ScaleItem
675 ////////////////////////////////////////////////////////////////////////////////
677 TYPEINIT1_AUTOFACTORY(SdrScaleItem,SdrFractionItem);
679 SfxItemPresentation SdrScaleItem::GetPresentation(
680 SfxItemPresentation ePresentation, SfxMapUnit /*eCoreMetric*/,
681 SfxMapUnit /*ePresentationMetric*/, OUString &rText, const IntlWrapper *) const
683 if(GetValue().IsValid())
685 sal_Int32 nDiv = GetValue().GetDenominator();
687 rText = OUString::valueOf(GetValue().GetNumerator()) + ":" + OUString::valueOf(nDiv);
689 else
691 rText = "?";
694 if(ePresentation == SFX_ITEM_PRESENTATION_COMPLETE)
696 OUString aStr;
698 SdrItemPool::TakeItemName(Which(), aStr);
699 rText = aStr + " " + rText;
702 return ePresentation;
705 SfxPoolItem* SdrScaleItem::Create(SvStream& rIn, sal_uInt16 /*nVer*/) const
707 return new SdrScaleItem(Which(),rIn);
710 SfxPoolItem* SdrScaleItem::Clone(SfxItemPool * /*pPool*/) const
712 return new SdrScaleItem(Which(),GetValue());
715 ////////////////////////////////////////////////////////////////////////////////
716 // OnOffItem
717 ////////////////////////////////////////////////////////////////////////////////
719 TYPEINIT1_AUTOFACTORY(SdrOnOffItem,SfxBoolItem);
721 SfxPoolItem* SdrOnOffItem::Clone(SfxItemPool* /*pPool*/) const
723 return new SdrOnOffItem(Which(),GetValue());
726 SfxPoolItem* SdrOnOffItem::Create(SvStream& rIn, sal_uInt16 /*nVer*/) const
728 return new SdrOnOffItem(Which(),rIn);
731 OUString SdrOnOffItem::GetValueTextByVal(sal_Bool bVal) const
733 if (bVal)
734 return ImpGetResStr(STR_ItemValON);
735 return ImpGetResStr(STR_ItemValOFF);
738 SfxItemPresentation SdrOnOffItem::GetPresentation(SfxItemPresentation ePres,
739 SfxMapUnit /*eCoreMetric*/, SfxMapUnit /*ePresMetric*/, OUString& rText, const IntlWrapper *) const
741 rText=GetValueTextByVal(GetValue());
742 if (ePres==SFX_ITEM_PRESENTATION_COMPLETE) {
743 OUString aStr;
745 SdrItemPool::TakeItemName(Which(), aStr);
746 rText = aStr + " " + rText;
748 return ePres;
751 TYPEINIT1_AUTOFACTORY(SdrYesNoItem,SfxBoolItem);
753 SfxPoolItem* SdrYesNoItem::Clone(SfxItemPool* /*pPool*/) const
755 return new SdrYesNoItem(Which(),GetValue());
758 SfxPoolItem* SdrYesNoItem::Create(SvStream& rIn, sal_uInt16 /*nVer*/) const
760 return new SdrYesNoItem(Which(),rIn);
763 OUString SdrYesNoItem::GetValueTextByVal(sal_Bool bVal) const
765 if (bVal)
766 return ImpGetResStr(STR_ItemValYES);
767 return ImpGetResStr(STR_ItemValNO);
770 SfxItemPresentation SdrYesNoItem::GetPresentation(SfxItemPresentation ePres,
771 SfxMapUnit /*eCoreMetric*/, SfxMapUnit /*ePresMetric*/, OUString& rText, const IntlWrapper *) const
773 rText=GetValueTextByVal(GetValue());
774 if (ePres==SFX_ITEM_PRESENTATION_COMPLETE) {
775 OUString aStr;
777 SdrItemPool::TakeItemName(Which(), aStr);
778 rText = aStr + " " + rText;
780 return ePres;
783 //------------------------------------------------------------
784 // class SdrPercentItem
785 //------------------------------------------------------------
787 TYPEINIT1_AUTOFACTORY(SdrPercentItem,SfxUInt16Item);
789 SfxPoolItem* SdrPercentItem::Clone(SfxItemPool* /*pPool*/) const
791 return new SdrPercentItem(Which(),GetValue());
794 SfxPoolItem* SdrPercentItem::Create(SvStream& rIn, sal_uInt16 /*nVer*/) const
796 return new SdrPercentItem(Which(),rIn);
799 SfxItemPresentation SdrPercentItem::GetPresentation(
800 SfxItemPresentation ePres, SfxMapUnit /*eCoreMetric*/,
801 SfxMapUnit /*ePresMetric*/, OUString& rText, const IntlWrapper *) const
803 rText = OUString::number(GetValue()) + "%";
805 if(ePres == SFX_ITEM_PRESENTATION_COMPLETE)
807 OUString aStr;
809 SdrItemPool::TakeItemName(Which(), aStr);
810 rText = aStr + " " + rText;
813 return ePres;
816 //------------------------------------------------------------
817 // class SdrAngleItem
818 //------------------------------------------------------------
820 TYPEINIT1_AUTOFACTORY(SdrAngleItem,SfxInt32Item);
822 SfxPoolItem* SdrAngleItem::Clone(SfxItemPool* /*pPool*/) const
824 return new SdrAngleItem(Which(),GetValue());
827 SfxPoolItem* SdrAngleItem::Create(SvStream& rIn, sal_uInt16 /*nVer*/) const
829 return new SdrAngleItem(Which(),rIn);
832 SfxItemPresentation SdrAngleItem::GetPresentation(
833 SfxItemPresentation ePres, SfxMapUnit /*eCoreMetric*/, SfxMapUnit /*ePresMetric*/,
834 OUString& rText, const IntlWrapper * pIntlWrapper) const
836 sal_Int32 nValue(GetValue());
837 bool bNeg(nValue < 0);
839 if(bNeg)
840 nValue = -nValue;
842 OUStringBuffer aText = OUString::valueOf(nValue);
844 if(nValue)
846 sal_Unicode aUnicodeNull('0');
847 sal_Int32 nAnz(2);
849 const IntlWrapper* pMyIntlWrapper = NULL;
850 if(!pIntlWrapper)
851 pIntlWrapper = pMyIntlWrapper = new IntlWrapper(
852 Application::GetSettings().GetLanguageTag() );
854 if(pIntlWrapper->getLocaleData()->isNumLeadingZero())
855 nAnz++;
857 while(aText.getLength() < nAnz)
858 aText.insert(0, aUnicodeNull);
860 sal_Int32 nLen = aText.getLength();
861 bool bNull1(aText[nLen-1] == aUnicodeNull);
862 bool bNull2(bNull1 && aText[nLen-2] == aUnicodeNull);
864 if(bNull2)
866 // no decimal place(s)
867 sal_Int32 idx = nLen-2;
868 aText.remove(idx, aText.getLength()-idx);
870 else
872 sal_Unicode cDec =
873 pIntlWrapper->getLocaleData()->getNumDecimalSep()[0];
874 aText.insert(nLen-2, cDec);
876 if(bNull1)
877 aText.remove(nLen, aText.getLength()-nLen);
880 if(bNeg)
881 aText.insert(0, sal_Unicode('-'));
883 if ( pMyIntlWrapper )
885 delete pMyIntlWrapper;
886 pIntlWrapper = NULL;
890 aText.insert(aText.getLength(), sal_Unicode(DEGREE_CHAR));
892 if(ePres == SFX_ITEM_PRESENTATION_COMPLETE)
894 OUString aStr;
896 SdrItemPool::TakeItemName(Which(), aStr);
897 aText.insert(0, ' ');
898 aText.insert(0, aStr);
901 rText = aText.makeStringAndClear();
902 return ePres;
905 //------------------------------------------------------------
906 // class SdrMetricItem
907 //------------------------------------------------------------
909 TYPEINIT1_AUTOFACTORY(SdrMetricItem,SfxInt32Item);
911 SfxPoolItem* SdrMetricItem::Clone(SfxItemPool* /*pPool*/) const
913 return new SdrMetricItem(Which(),GetValue());
916 SfxPoolItem* SdrMetricItem::Create(SvStream& rIn, sal_uInt16 /*nVer*/) const
918 return new SdrMetricItem(Which(),rIn);
921 bool SdrMetricItem::HasMetrics() const
923 return sal_True;
926 bool SdrMetricItem::ScaleMetrics(long nMul, long nDiv)
928 if (GetValue()!=0) {
929 BigInt aVal(GetValue());
930 aVal*=nMul;
931 aVal+=nDiv/2; // to round accurately
932 aVal/=nDiv;
933 SetValue(long(aVal));
935 return sal_True;
938 SfxItemPresentation SdrMetricItem::GetPresentation(SfxItemPresentation ePres,
939 SfxMapUnit eCoreMetric, SfxMapUnit ePresMetric, OUString& rText, const IntlWrapper *) const
941 long nValue=GetValue();
942 SdrFormatter aFmt((MapUnit)eCoreMetric,(MapUnit)ePresMetric);
943 aFmt.TakeStr(nValue,rText);
944 OUString aStr;
945 aFmt.TakeUnitStr((MapUnit)ePresMetric,aStr);
946 rText+=aStr;
947 if (ePres==SFX_ITEM_PRESENTATION_COMPLETE) {
948 OUString aStr2;
950 SdrItemPool::TakeItemName(Which(), aStr2);
951 rText = aStr2 + " " + rText;
953 return ePres;
956 ////////////////////////////////////////////////////////////////////////////////
957 // items of the legend object
958 ////////////////////////////////////////////////////////////////////////////////
960 TYPEINIT1_AUTOFACTORY(SdrCaptionTypeItem,SfxEnumItem);
962 SfxPoolItem* SdrCaptionTypeItem::Clone(SfxItemPool* /*pPool*/) const { return new SdrCaptionTypeItem(*this); }
964 SfxPoolItem* SdrCaptionTypeItem::Create(SvStream& rIn, sal_uInt16 /*nVer*/) const { return new SdrCaptionTypeItem(rIn); }
966 sal_uInt16 SdrCaptionTypeItem::GetValueCount() const { return 4; }
968 OUString SdrCaptionTypeItem::GetValueTextByPos(sal_uInt16 nPos) const
970 return ImpGetResStr(STR_ItemValCAPTIONTYPE1+nPos);
973 SfxItemPresentation SdrCaptionTypeItem::GetPresentation(SfxItemPresentation ePres,
974 SfxMapUnit /*eCoreMetric*/, SfxMapUnit /*ePresMetric*/, OUString& rText, const IntlWrapper *) const
976 rText=GetValueTextByPos(sal::static_int_cast< sal_uInt16 >(GetValue()));
977 if (ePres==SFX_ITEM_PRESENTATION_COMPLETE) {
978 OUString aStr;
980 SdrItemPool::TakeItemName(Which(), aStr);
981 rText = aStr + " " + rText;
983 return ePres;
986 TYPEINIT1_AUTOFACTORY(SdrCaptionEscDirItem,SfxEnumItem);
988 SfxPoolItem* SdrCaptionEscDirItem::Clone(SfxItemPool* /*pPool*/) const { return new SdrCaptionEscDirItem(*this); }
990 SfxPoolItem* SdrCaptionEscDirItem::Create(SvStream& rIn, sal_uInt16 /*nVer*/) const { return new SdrCaptionEscDirItem(rIn); }
992 sal_uInt16 SdrCaptionEscDirItem::GetValueCount() const { return 3; }
994 OUString SdrCaptionEscDirItem::GetValueTextByPos(sal_uInt16 nPos) const
996 return ImpGetResStr(STR_ItemValCAPTIONESCHORI+nPos);
999 SfxItemPresentation SdrCaptionEscDirItem::GetPresentation(SfxItemPresentation ePres,
1000 SfxMapUnit /*eCoreMetric*/, SfxMapUnit /*ePresMetric*/, OUString& rText, const IntlWrapper *) const
1002 rText=GetValueTextByPos(sal::static_int_cast< sal_uInt16 >(GetValue()));
1003 if (ePres==SFX_ITEM_PRESENTATION_COMPLETE) {
1004 OUString aStr;
1006 SdrItemPool::TakeItemName(Which(), aStr);
1007 rText = aStr + " " + rText;
1009 return ePres;
1012 ////////////////////////////////////////////////////////////////////////////////
1013 // MiscItems
1014 ////////////////////////////////////////////////////////////////////////////////
1016 // FitToSize
1017 TYPEINIT1_AUTOFACTORY(SdrTextFitToSizeTypeItem,SfxEnumItem);
1019 SfxPoolItem* SdrTextFitToSizeTypeItem::Clone(SfxItemPool* /*pPool*/) const { return new SdrTextFitToSizeTypeItem(*this); }
1021 SfxPoolItem* SdrTextFitToSizeTypeItem::Create(SvStream& rIn, sal_uInt16 /*nVer*/) const { return new SdrTextFitToSizeTypeItem(rIn); }
1023 sal_uInt16 SdrTextFitToSizeTypeItem::GetValueCount() const { return 4; }
1025 OUString SdrTextFitToSizeTypeItem::GetValueTextByPos(sal_uInt16 nPos) const
1027 return ImpGetResStr(STR_ItemValFITTOSIZENONE+nPos);
1030 SfxItemPresentation SdrTextFitToSizeTypeItem::GetPresentation(SfxItemPresentation ePres,
1031 SfxMapUnit /*eCoreMetric*/, SfxMapUnit /*ePresMetric*/, OUString& rText, const IntlWrapper *) const
1033 rText=GetValueTextByPos(sal::static_int_cast< sal_uInt16 >(GetValue()));
1034 if (ePres==SFX_ITEM_PRESENTATION_COMPLETE) {
1035 OUString aStr;
1037 SdrItemPool::TakeItemName(Which(), aStr);
1038 rText = aStr + " " + rText;
1040 return ePres;
1043 int SdrTextFitToSizeTypeItem::HasBoolValue() const { return sal_True; }
1045 sal_Bool SdrTextFitToSizeTypeItem::GetBoolValue() const { return GetValue()!=SDRTEXTFIT_NONE; }
1047 void SdrTextFitToSizeTypeItem::SetBoolValue(sal_Bool bVal) { SetValue(sal::static_int_cast< sal_uInt16 >(bVal ? SDRTEXTFIT_PROPORTIONAL : SDRTEXTFIT_NONE)); }
1049 bool SdrTextFitToSizeTypeItem::QueryValue( uno::Any& rVal, sal_uInt8 /*nMemberId*/) const
1051 drawing::TextFitToSizeType eFS = (drawing::TextFitToSizeType)GetValue();
1052 rVal <<= eFS;
1054 return true;
1057 bool SdrTextFitToSizeTypeItem::PutValue( const uno::Any& rVal, sal_uInt8 /*nMemberId*/)
1059 drawing::TextFitToSizeType eFS;
1060 if(!(rVal >>= eFS))
1062 sal_Int32 nEnum = 0;
1063 if(!(rVal >>= nEnum))
1064 return false;
1066 eFS = (drawing::TextFitToSizeType) nEnum;
1069 SetValue( sal::static_int_cast< sal_uInt16 >( (SdrFitToSizeType)eFS ) );
1071 return true;
1074 TYPEINIT1_AUTOFACTORY(SdrTextVertAdjustItem,SfxEnumItem);
1076 SfxPoolItem* SdrTextVertAdjustItem::Clone(SfxItemPool* /*pPool*/) const { return new SdrTextVertAdjustItem(*this); }
1078 SfxPoolItem* SdrTextVertAdjustItem::Create(SvStream& rIn, sal_uInt16 /*nVer*/) const { return new SdrTextVertAdjustItem(rIn); }
1080 sal_uInt16 SdrTextVertAdjustItem::GetValueCount() const { return 5; }
1082 OUString SdrTextVertAdjustItem::GetValueTextByPos(sal_uInt16 nPos) const
1084 return ImpGetResStr(STR_ItemValTEXTVADJTOP+nPos);
1087 SfxItemPresentation SdrTextVertAdjustItem::GetPresentation(SfxItemPresentation ePres,
1088 SfxMapUnit /*eCoreMetric*/, SfxMapUnit /*ePresMetric*/, OUString& rText, const IntlWrapper *) const
1090 rText=GetValueTextByPos(sal::static_int_cast< sal_uInt16 >(GetValue()));
1091 if (ePres==SFX_ITEM_PRESENTATION_COMPLETE) {
1092 OUString aStr;
1094 SdrItemPool::TakeItemName(Which(), aStr);
1095 rText = aStr + " " + rText;
1097 return ePres;
1100 bool SdrTextVertAdjustItem::QueryValue( uno::Any& rVal, sal_uInt8 /*nMemberId*/) const
1102 rVal <<= (drawing::TextVerticalAdjust)GetValue();
1103 return true;
1106 bool SdrTextVertAdjustItem::PutValue( const uno::Any& rVal, sal_uInt8 /*nMemberId*/)
1108 drawing::TextVerticalAdjust eAdj;
1109 if(!(rVal >>= eAdj))
1111 sal_Int32 nEnum = 0;
1112 if(!(rVal >>= nEnum))
1113 return false;
1115 eAdj = (drawing::TextVerticalAdjust)nEnum;
1118 SetValue( sal::static_int_cast< sal_uInt16 >( (SdrTextVertAdjust)eAdj ) );
1120 return true;
1123 TYPEINIT1_AUTOFACTORY(SdrTextHorzAdjustItem,SfxEnumItem);
1125 SfxPoolItem* SdrTextHorzAdjustItem::Clone(SfxItemPool* /*pPool*/) const { return new SdrTextHorzAdjustItem(*this); }
1127 SfxPoolItem* SdrTextHorzAdjustItem::Create(SvStream& rIn, sal_uInt16 /*nVer*/) const { return new SdrTextHorzAdjustItem(rIn); }
1129 sal_uInt16 SdrTextHorzAdjustItem::GetValueCount() const { return 5; }
1131 OUString SdrTextHorzAdjustItem::GetValueTextByPos(sal_uInt16 nPos) const
1133 return ImpGetResStr(STR_ItemValTEXTHADJLEFT+nPos);
1136 SfxItemPresentation SdrTextHorzAdjustItem::GetPresentation(SfxItemPresentation ePres,
1137 SfxMapUnit /*eCoreMetric*/, SfxMapUnit /*ePresMetric*/, OUString& rText, const IntlWrapper *) const
1139 rText=GetValueTextByPos(sal::static_int_cast< sal_uInt16 >(GetValue()));
1140 if (ePres==SFX_ITEM_PRESENTATION_COMPLETE) {
1141 OUString aStr;
1143 SdrItemPool::TakeItemName(Which(), aStr);
1144 rText = aStr + " " + rText;
1146 return ePres;
1149 bool SdrTextHorzAdjustItem::QueryValue( uno::Any& rVal, sal_uInt8 /*nMemberId*/) const
1151 rVal <<= (drawing::TextHorizontalAdjust)GetValue();
1152 return true;
1155 bool SdrTextHorzAdjustItem::PutValue( const uno::Any& rVal, sal_uInt8 /*nMemberId*/)
1157 drawing::TextHorizontalAdjust eAdj;
1158 if(!(rVal >>= eAdj))
1160 sal_Int32 nEnum = 0;
1161 if(!(rVal >>= nEnum))
1162 return false;
1164 eAdj = (drawing::TextHorizontalAdjust)nEnum;
1167 SetValue( sal::static_int_cast< sal_uInt16 >( (SdrTextHorzAdjust)eAdj ) );
1169 return true;
1172 TYPEINIT1_AUTOFACTORY(SdrTextAniKindItem,SfxEnumItem);
1174 SfxPoolItem* SdrTextAniKindItem::Clone(SfxItemPool* /*pPool*/) const { return new SdrTextAniKindItem(*this); }
1176 SfxPoolItem* SdrTextAniKindItem::Create(SvStream& rIn, sal_uInt16 /*nVer*/) const { return new SdrTextAniKindItem(rIn); }
1178 sal_uInt16 SdrTextAniKindItem::GetValueCount() const { return 5; }
1180 OUString SdrTextAniKindItem::GetValueTextByPos(sal_uInt16 nPos) const
1182 return ImpGetResStr(STR_ItemValTEXTANI_NONE+nPos);
1185 SfxItemPresentation SdrTextAniKindItem::GetPresentation(SfxItemPresentation ePres,
1186 SfxMapUnit /*eCoreMetric*/, SfxMapUnit /*ePresMetric*/, OUString& rText, const IntlWrapper *) const
1188 rText=GetValueTextByPos(sal::static_int_cast< sal_uInt16 >(GetValue()));
1189 if (ePres==SFX_ITEM_PRESENTATION_COMPLETE) {
1190 OUString aStr;
1192 SdrItemPool::TakeItemName(Which(), aStr);
1193 rText = aStr + " " + rText;
1195 return ePres;
1198 bool SdrTextAniKindItem::QueryValue( uno::Any& rVal, sal_uInt8 /*nMemberId*/) const
1200 rVal <<= (drawing::TextAnimationKind)GetValue();
1201 return true;
1204 bool SdrTextAniKindItem::PutValue( const uno::Any& rVal, sal_uInt8 /*nMemberId*/)
1206 drawing::TextAnimationKind eKind;
1207 if(!(rVal >>= eKind))
1209 sal_Int32 nEnum = 0;
1210 if(!(rVal >>= nEnum))
1211 return false;
1212 eKind = (drawing::TextAnimationKind)nEnum;
1215 SetValue( sal::static_int_cast< sal_uInt16 >( (SdrTextAniKind)eKind ) );
1217 return true;
1220 TYPEINIT1_AUTOFACTORY(SdrTextAniDirectionItem,SfxEnumItem);
1222 SfxPoolItem* SdrTextAniDirectionItem::Clone(SfxItemPool* /*pPool*/) const { return new SdrTextAniDirectionItem(*this); }
1224 SfxPoolItem* SdrTextAniDirectionItem::Create(SvStream& rIn, sal_uInt16 /*nVer*/) const { return new SdrTextAniDirectionItem(rIn); }
1226 sal_uInt16 SdrTextAniDirectionItem::GetValueCount() const { return 4; }
1228 OUString SdrTextAniDirectionItem::GetValueTextByPos(sal_uInt16 nPos) const
1230 return ImpGetResStr(STR_ItemValTEXTANI_LEFT+nPos);
1233 SfxItemPresentation SdrTextAniDirectionItem::GetPresentation(SfxItemPresentation ePres,
1234 SfxMapUnit /*eCoreMetric*/, SfxMapUnit /*ePresMetric*/, OUString& rText, const IntlWrapper *) const
1236 rText=GetValueTextByPos(sal::static_int_cast< sal_uInt16 >(GetValue()));
1237 if (ePres==SFX_ITEM_PRESENTATION_COMPLETE) {
1238 OUString aStr;
1240 SdrItemPool::TakeItemName(Which(), aStr);
1241 rText = aStr + " " + rText;
1243 return ePres;
1246 bool SdrTextAniDirectionItem::QueryValue( uno::Any& rVal, sal_uInt8 /*nMemberId*/) const
1248 rVal <<= (drawing::TextAnimationDirection)GetValue();
1249 return true;
1252 bool SdrTextAniDirectionItem::PutValue( const uno::Any& rVal, sal_uInt8 /*nMemberId*/)
1254 drawing::TextAnimationDirection eDir;
1255 if(!(rVal >>= eDir))
1257 sal_Int32 nEnum = 0;
1258 if(!(rVal >>= nEnum))
1259 return false;
1261 eDir = (drawing::TextAnimationDirection)nEnum;
1264 SetValue( sal::static_int_cast< sal_uInt16 >( (SdrTextAniDirection)eDir ) );
1266 return true;
1269 TYPEINIT1_AUTOFACTORY(SdrTextAniDelayItem,SfxUInt16Item);
1271 SfxPoolItem* SdrTextAniDelayItem::Clone(SfxItemPool* /*pPool*/) const { return new SdrTextAniDelayItem(*this); }
1273 SfxPoolItem* SdrTextAniDelayItem::Create(SvStream& rIn, sal_uInt16 /*nVer*/) const { return new SdrTextAniDelayItem(rIn); }
1275 SfxItemPresentation SdrTextAniDelayItem::GetPresentation(
1276 SfxItemPresentation ePres, SfxMapUnit /*eCoreMetric*/, SfxMapUnit /*ePresMetric*/,
1277 OUString& rText, const IntlWrapper *) const
1279 rText = OUString::number(GetValue()) + "ms";
1281 if(ePres == SFX_ITEM_PRESENTATION_COMPLETE)
1283 OUString aStr;
1285 SdrItemPool::TakeItemName(Which(), aStr);
1286 rText = aStr + " " + rText;
1289 return ePres;
1292 TYPEINIT1_AUTOFACTORY(SdrTextAniAmountItem,SfxInt16Item);
1294 SfxPoolItem* SdrTextAniAmountItem::Clone(SfxItemPool* /*pPool*/) const { return new SdrTextAniAmountItem(*this); }
1296 SfxPoolItem* SdrTextAniAmountItem::Create(SvStream& rIn, sal_uInt16 /*nVer*/) const { return new SdrTextAniAmountItem(rIn); }
1298 bool SdrTextAniAmountItem::HasMetrics() const
1300 return GetValue()>0;
1303 bool SdrTextAniAmountItem::ScaleMetrics(long nMul, long nDiv)
1305 if (GetValue()>0) {
1306 BigInt aVal(GetValue());
1307 aVal*=nMul;
1308 aVal+=nDiv/2; // to round accurately
1309 aVal/=nDiv;
1310 SetValue(short(aVal));
1311 return sal_True;
1312 } else return sal_False;
1315 SfxItemPresentation SdrTextAniAmountItem::GetPresentation(
1316 SfxItemPresentation ePres, SfxMapUnit eCoreMetric, SfxMapUnit ePresMetric,
1317 OUString& rText, const IntlWrapper *) const
1319 sal_Int32 nValue(GetValue());
1321 if(!nValue)
1322 nValue = -1L;
1324 if(nValue < 0)
1326 rText = OUString::valueOf(-nValue) + "pixel";
1328 else
1330 SdrFormatter aFmt((MapUnit)eCoreMetric, (MapUnit)ePresMetric);
1331 OUString aStr;
1333 aFmt.TakeStr(nValue, rText);
1334 aFmt.TakeUnitStr((MapUnit)ePresMetric, aStr);
1335 rText += aStr;
1338 if(ePres == SFX_ITEM_PRESENTATION_COMPLETE)
1340 OUString aStr;
1342 SdrItemPool::TakeItemName(Which(), aStr);
1343 rText = aStr + " " + rText;
1346 return ePres;
1349 TYPEINIT1_AUTOFACTORY( SdrTextFixedCellHeightItem, SfxBoolItem );
1350 SdrTextFixedCellHeightItem::SdrTextFixedCellHeightItem( sal_Bool bUseFixedCellHeight )
1351 : SfxBoolItem( SDRATTR_TEXT_USEFIXEDCELLHEIGHT, bUseFixedCellHeight )
1354 SdrTextFixedCellHeightItem::SdrTextFixedCellHeightItem( SvStream & rStream, sal_uInt16 nVersion )
1355 : SfxBoolItem( SDRATTR_TEXT_USEFIXEDCELLHEIGHT, sal_False )
1357 if ( nVersion )
1359 sal_Bool bValue;
1360 rStream >> bValue;
1361 SetValue( bValue );
1364 SfxItemPresentation SdrTextFixedCellHeightItem::GetPresentation( SfxItemPresentation ePres,
1365 SfxMapUnit /*eCoreMetric*/, SfxMapUnit /*ePresentationMetric*/,
1366 OUString &rText, const IntlWrapper * ) const
1368 rText = GetValueTextByVal( GetValue() );
1369 if (ePres==SFX_ITEM_PRESENTATION_COMPLETE)
1371 OUString aStr;
1372 SdrItemPool::TakeItemName(Which(), aStr);
1373 rText = aStr + " " + rText;
1375 return ePres;
1377 SfxPoolItem* SdrTextFixedCellHeightItem::Create( SvStream& rIn, sal_uInt16 nItemVersion ) const
1379 return new SdrTextFixedCellHeightItem( rIn, nItemVersion );
1381 SvStream& SdrTextFixedCellHeightItem::Store( SvStream& rOut, sal_uInt16 nItemVersion ) const
1383 if ( nItemVersion )
1385 sal_Bool bValue = (sal_Bool)GetValue();
1386 rOut << bValue;
1388 return rOut;
1390 SfxPoolItem* SdrTextFixedCellHeightItem::Clone( SfxItemPool * /*pPool*/) const
1392 return new SdrTextFixedCellHeightItem( GetValue() );
1394 sal_uInt16 SdrTextFixedCellHeightItem::GetVersion( sal_uInt16 /*nFileFormatVersion*/) const
1396 return 1;
1398 bool SdrTextFixedCellHeightItem::QueryValue( uno::Any& rVal, sal_uInt8 /*nMemberId*/) const
1400 sal_Bool bValue = (sal_Bool)GetValue();
1401 rVal <<= bValue;
1402 return true;
1404 bool SdrTextFixedCellHeightItem::PutValue( const uno::Any& rVal, sal_uInt8 /*nMemberId*/)
1406 sal_Bool bValue = sal_Bool();
1407 if( !( rVal >>= bValue ) )
1408 return false;
1409 SetValue( bValue );
1410 return true;
1413 TYPEINIT1_AUTOFACTORY( SdrCustomShapeAdjustmentItem, SfxPoolItem );
1415 SdrCustomShapeAdjustmentItem::SdrCustomShapeAdjustmentItem() : SfxPoolItem( SDRATTR_CUSTOMSHAPE_ADJUSTMENT )
1419 SdrCustomShapeAdjustmentItem::SdrCustomShapeAdjustmentItem( SvStream& rIn, sal_uInt16 nVersion ):
1420 SfxPoolItem( SDRATTR_CUSTOMSHAPE_ADJUSTMENT )
1422 if ( nVersion )
1424 SdrCustomShapeAdjustmentValue aVal;
1425 sal_uInt32 i, nCount;
1426 rIn >> nCount;
1427 for ( i = 0; i < nCount; i++ )
1429 rIn >> aVal.nValue;
1430 SetValue( i, aVal );
1435 SdrCustomShapeAdjustmentItem::~SdrCustomShapeAdjustmentItem()
1439 int SdrCustomShapeAdjustmentItem::operator==( const SfxPoolItem& rCmp ) const
1441 int bRet = SfxPoolItem::operator==( rCmp );
1442 if ( bRet )
1444 bRet = GetCount() == ((SdrCustomShapeAdjustmentItem&)rCmp).GetCount();
1446 if (bRet)
1448 for (sal_uInt32 i = 0; i < GetCount(); ++i)
1449 if (aAdjustmentValueList[i].nValue != ((SdrCustomShapeAdjustmentItem&)rCmp).aAdjustmentValueList[i].nValue)
1450 return false;
1453 return bRet;
1456 SfxItemPresentation SdrCustomShapeAdjustmentItem::GetPresentation(
1457 SfxItemPresentation ePresentation, SfxMapUnit /*eCoreMetric*/,
1458 SfxMapUnit /*ePresentationMetric*/, OUString &rText, const IntlWrapper *) const
1460 sal_uInt32 i, nCount = GetCount();
1461 rText += OUString::number( nCount );
1462 for ( i = 0; i < nCount; i++ )
1464 rText = rText + " " + OUString::number( GetValue( i ).nValue );
1466 if ( ePresentation == SFX_ITEM_PRESENTATION_COMPLETE )
1468 OUString aStr;
1470 SdrItemPool::TakeItemName( Which(), aStr );
1471 rText = aStr + " " + rText;
1473 return ePresentation;
1476 SfxPoolItem* SdrCustomShapeAdjustmentItem::Create( SvStream& rIn, sal_uInt16 nItemVersion ) const
1478 return new SdrCustomShapeAdjustmentItem( rIn, nItemVersion );
1481 SvStream& SdrCustomShapeAdjustmentItem::Store( SvStream& rOut, sal_uInt16 nItemVersion ) const
1483 if ( nItemVersion )
1485 sal_uInt32 i, nCount = GetCount();
1486 rOut << nCount;
1487 for ( i = 0; i < nCount; i++ )
1488 rOut << GetValue( i ).nValue;
1490 return rOut;
1493 SfxPoolItem* SdrCustomShapeAdjustmentItem::Clone( SfxItemPool * /*pPool*/) const
1495 SdrCustomShapeAdjustmentItem* pItem = new SdrCustomShapeAdjustmentItem;
1497 if (pItem)
1498 pItem->aAdjustmentValueList = aAdjustmentValueList;
1500 return pItem;
1503 const SdrCustomShapeAdjustmentValue& SdrCustomShapeAdjustmentItem::GetValue( sal_uInt32 nIndex ) const
1505 #ifdef DBG_UTIL
1506 if ( aAdjustmentValueList.size() <= nIndex )
1507 OSL_FAIL( "SdrCustomShapeAdjustemntItem::GetValue - nIndex out of range (SJ)" );
1508 #endif
1509 return aAdjustmentValueList[nIndex];
1512 void SdrCustomShapeAdjustmentItem::SetValue( sal_uInt32 nIndex, const SdrCustomShapeAdjustmentValue& rVal )
1514 for (sal_uInt32 i = aAdjustmentValueList.size(); i <= nIndex; i++ )
1515 aAdjustmentValueList.push_back(SdrCustomShapeAdjustmentValue());
1517 aAdjustmentValueList[nIndex] = rVal;
1520 sal_uInt16 SdrCustomShapeAdjustmentItem::GetVersion( sal_uInt16 /*nFileFormatVersion*/) const
1522 return 1;
1525 bool SdrCustomShapeAdjustmentItem::QueryValue( uno::Any& rVal, sal_uInt8 /*nMemberId*/) const
1527 sal_uInt32 i, nCount = GetCount();
1528 uno::Sequence< sal_Int32 > aSequence( nCount );
1529 if ( nCount )
1531 sal_Int32* pPtr = aSequence.getArray();
1532 for ( i = 0; i < nCount; i++ )
1533 *pPtr++ = GetValue( i ).nValue;
1535 rVal <<= aSequence;
1536 return true;
1539 bool SdrCustomShapeAdjustmentItem::PutValue( const uno::Any& rVal, sal_uInt8 /*nMemberId*/)
1541 uno::Sequence< sal_Int32 > aSequence;
1542 if( !( rVal >>= aSequence ) )
1543 return false;
1545 aAdjustmentValueList.clear();
1547 sal_uInt32 i, nCount = aSequence.getLength();
1548 if ( nCount )
1550 SdrCustomShapeAdjustmentValue val;
1551 const sal_Int32* pPtr2 = aSequence.getConstArray();
1552 for ( i = 0; i < nCount; i++ )
1554 val.nValue = *pPtr2++;
1555 aAdjustmentValueList.push_back(val);
1558 return true;
1562 //++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
1563 // Edge
1564 //++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
1566 // EdgeKind
1567 TYPEINIT1_AUTOFACTORY(SdrEdgeKindItem,SfxEnumItem);
1569 SfxPoolItem* SdrEdgeKindItem::Clone(SfxItemPool* /*pPool*/) const { return new SdrEdgeKindItem(*this); }
1571 SfxPoolItem* SdrEdgeKindItem::Create(SvStream& rIn, sal_uInt16 /*nVer*/) const { return new SdrEdgeKindItem(rIn); }
1573 sal_uInt16 SdrEdgeKindItem::GetValueCount() const { return 4; }
1575 OUString SdrEdgeKindItem::GetValueTextByPos(sal_uInt16 nPos) const
1577 return ImpGetResStr(STR_ItemValEDGE_ORTHOLINES+nPos);
1580 SfxItemPresentation SdrEdgeKindItem::GetPresentation(SfxItemPresentation ePres,
1581 SfxMapUnit /*eCoreMetric*/, SfxMapUnit /*ePresMetric*/, OUString& rText, const IntlWrapper *) const
1583 rText=GetValueTextByPos(sal::static_int_cast< sal_uInt16 >(GetValue()));
1584 if (ePres==SFX_ITEM_PRESENTATION_COMPLETE) {
1585 OUString aStr;
1587 SdrItemPool::TakeItemName(Which(), aStr);
1588 rText = aStr + " " + rText;
1590 return ePres;
1593 bool SdrEdgeKindItem::QueryValue( uno::Any& rVal, sal_uInt8 /*nMemberId*/) const
1595 drawing::ConnectorType eCT = drawing::ConnectorType_STANDARD;
1597 switch( GetValue() )
1599 case SDREDGE_ORTHOLINES : eCT = drawing::ConnectorType_STANDARD; break;
1600 case SDREDGE_THREELINES : eCT = drawing::ConnectorType_LINES; break;
1601 case SDREDGE_ONELINE : eCT = drawing::ConnectorType_LINE; break;
1602 case SDREDGE_BEZIER : eCT = drawing::ConnectorType_CURVE; break;
1603 case SDREDGE_ARC : eCT = drawing::ConnectorType_CURVE; break;
1604 default:
1605 OSL_FAIL( "SdrEdgeKindItem::QueryValue : unknown enum" );
1608 rVal <<= eCT;
1610 return true;
1613 bool SdrEdgeKindItem::PutValue( const uno::Any& rVal, sal_uInt8 /*nMemberId*/)
1615 drawing::ConnectorType eCT;
1616 if(!(rVal >>= eCT))
1618 sal_Int32 nEnum = 0;
1619 if(!(rVal >>= nEnum))
1620 return false;
1622 eCT = (drawing::ConnectorType)nEnum;
1625 SdrEdgeKind eEK = SDREDGE_ORTHOLINES;
1626 switch( eCT )
1628 case drawing::ConnectorType_STANDARD : eEK = SDREDGE_ORTHOLINES; break;
1629 case drawing::ConnectorType_CURVE : eEK = SDREDGE_BEZIER; break;
1630 case drawing::ConnectorType_LINE : eEK = SDREDGE_ONELINE; break;
1631 case drawing::ConnectorType_LINES : eEK = SDREDGE_THREELINES; break;
1632 default:
1633 OSL_FAIL( "SdrEdgeKindItem::PuValue : unknown enum" );
1635 SetValue( sal::static_int_cast< sal_uInt16 >( eEK ) );
1637 return true;
1640 bool SdrEdgeNode1HorzDistItem::QueryValue( uno::Any& rVal, sal_uInt8 /*nMemberId*/) const
1642 rVal <<= (sal_Int32)GetValue();
1643 return true;
1646 bool SdrEdgeNode1HorzDistItem::PutValue( const uno::Any& rVal, sal_uInt8 /*nMemberId*/)
1648 sal_Int32 nValue = 0;
1649 if(!(rVal >>= nValue))
1650 return false;
1652 SetValue( nValue );
1653 return true;
1656 bool SdrEdgeNode1VertDistItem::QueryValue( uno::Any& rVal, sal_uInt8 /*nMemberId*/) const
1658 rVal <<= (sal_Int32)GetValue();
1659 return true;
1662 bool SdrEdgeNode1VertDistItem::PutValue( const uno::Any& rVal, sal_uInt8 /*nMemberId*/)
1664 sal_Int32 nValue = 0;
1665 if(!(rVal >>= nValue))
1666 return false;
1668 SetValue( nValue );
1669 return true;
1672 bool SdrEdgeNode2HorzDistItem::QueryValue( uno::Any& rVal, sal_uInt8 /*nMemberId*/) const
1674 rVal <<= (sal_Int32)GetValue();
1675 return true;
1678 bool SdrEdgeNode2HorzDistItem::PutValue( const uno::Any& rVal, sal_uInt8 /*nMemberId*/)
1680 sal_Int32 nValue = 0;
1681 if(!(rVal >>= nValue))
1682 return false;
1684 SetValue( nValue );
1685 return true;
1688 bool SdrEdgeNode2VertDistItem::QueryValue( uno::Any& rVal, sal_uInt8 /*nMemberId*/) const
1690 rVal <<= (sal_Int32)GetValue();
1691 return true;
1694 bool SdrEdgeNode2VertDistItem::PutValue( const uno::Any& rVal, sal_uInt8 /*nMemberId*/)
1696 sal_Int32 nValue = 0;
1697 if(!(rVal >>= nValue))
1698 return false;
1700 SetValue( nValue );
1701 return true;
1704 bool SdrEdgeLine1DeltaItem::QueryValue( uno::Any& rVal, sal_uInt8 /*nMemberId*/) const
1706 rVal <<= (sal_Int32)GetValue();
1707 return true;
1710 bool SdrEdgeLine1DeltaItem::PutValue( const uno::Any& rVal, sal_uInt8 /*nMemberId*/)
1712 sal_Int32 nValue = 0;
1713 if(!(rVal >>= nValue))
1714 return false;
1716 SetValue( nValue );
1717 return true;
1720 bool SdrEdgeLine2DeltaItem::QueryValue( uno::Any& rVal, sal_uInt8 /*nMemberId*/) const
1722 rVal <<= (sal_Int32)GetValue();
1723 return true;
1726 bool SdrEdgeLine2DeltaItem::PutValue( const uno::Any& rVal, sal_uInt8 /*nMemberId*/)
1728 sal_Int32 nValue = 0;
1729 if(!(rVal >>= nValue))
1730 return false;
1732 SetValue( nValue );
1733 return true;
1736 bool SdrEdgeLine3DeltaItem::QueryValue( uno::Any& rVal, sal_uInt8 /*nMemberId*/) const
1738 rVal <<= (sal_Int32)GetValue();
1739 return true;
1742 bool SdrEdgeLine3DeltaItem::PutValue( const uno::Any& rVal, sal_uInt8 /*nMemberId*/)
1744 sal_Int32 nValue = 0;
1745 if(!(rVal >>= nValue))
1746 return false;
1748 SetValue( nValue );
1749 return true;
1752 //++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
1753 // Measure
1754 //++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
1756 TYPEINIT1_AUTOFACTORY(SdrMeasureKindItem,SfxEnumItem);
1758 SfxPoolItem* SdrMeasureKindItem::Clone(SfxItemPool* /*pPool*/) const { return new SdrMeasureKindItem(*this); }
1760 SfxPoolItem* SdrMeasureKindItem::Create(SvStream& rIn, sal_uInt16 /*nVer*/) const { return new SdrMeasureKindItem(rIn); }
1762 sal_uInt16 SdrMeasureKindItem::GetValueCount() const { return 2; }
1764 OUString SdrMeasureKindItem::GetValueTextByPos(sal_uInt16 nPos) const
1766 return ImpGetResStr(STR_ItemValMEASURE_STD+nPos);
1769 SfxItemPresentation SdrMeasureKindItem::GetPresentation(SfxItemPresentation ePres,
1770 SfxMapUnit /*eCoreMetric*/, SfxMapUnit /*ePresMetric*/, OUString& rText, const IntlWrapper *) const
1772 rText=GetValueTextByPos(sal::static_int_cast< sal_uInt16 >(GetValue()));
1773 if (ePres==SFX_ITEM_PRESENTATION_COMPLETE) {
1774 OUString aStr;
1776 SdrItemPool::TakeItemName(Which(), aStr);
1777 rText = aStr + " " + rText;
1779 return ePres;
1782 bool SdrMeasureKindItem::QueryValue( uno::Any& rVal, sal_uInt8 /*nMemberId*/) const
1784 rVal <<= (drawing::MeasureKind)GetValue();
1785 return true;
1788 bool SdrMeasureKindItem::PutValue( const uno::Any& rVal, sal_uInt8 /*nMemberId*/)
1790 drawing::MeasureKind eKind;
1791 if(!(rVal >>= eKind))
1793 sal_Int32 nEnum = 0;
1794 if(!(rVal >>= nEnum))
1795 return false;
1797 eKind = (drawing::MeasureKind)nEnum;
1800 SetValue( sal::static_int_cast< sal_uInt16 >( (SdrMeasureKind)eKind ) );
1801 return true;
1804 TYPEINIT1_AUTOFACTORY(SdrMeasureTextHPosItem,SfxEnumItem);
1806 SfxPoolItem* SdrMeasureTextHPosItem::Clone(SfxItemPool* /*pPool*/) const { return new SdrMeasureTextHPosItem(*this); }
1808 SfxPoolItem* SdrMeasureTextHPosItem::Create(SvStream& rIn, sal_uInt16 /*nVer*/) const { return new SdrMeasureTextHPosItem(rIn); }
1810 sal_uInt16 SdrMeasureTextHPosItem::GetValueCount() const { return 4; }
1812 OUString SdrMeasureTextHPosItem::GetValueTextByPos(sal_uInt16 nPos) const
1814 return ImpGetResStr(STR_ItemValMEASURE_TEXTHAUTO+nPos);
1817 SfxItemPresentation SdrMeasureTextHPosItem::GetPresentation(SfxItemPresentation ePres,
1818 SfxMapUnit /*eCoreMetric*/, SfxMapUnit /*ePresMetric*/, OUString& rText, const IntlWrapper *) const
1820 rText=GetValueTextByPos(sal::static_int_cast< sal_uInt16 >(GetValue()));
1821 if (ePres==SFX_ITEM_PRESENTATION_COMPLETE) {
1822 OUString aStr;
1824 SdrItemPool::TakeItemName(Which(), aStr);
1825 rText = aStr + " " + rText;
1827 return ePres;
1830 bool SdrMeasureTextHPosItem::QueryValue( uno::Any& rVal, sal_uInt8 /*nMemberId*/) const
1832 rVal <<= (drawing::MeasureTextHorzPos)GetValue();
1833 return true;
1836 bool SdrMeasureTextHPosItem::PutValue( const uno::Any& rVal, sal_uInt8 /*nMemberId*/)
1838 drawing::MeasureTextHorzPos ePos;
1839 if(!(rVal >>= ePos))
1841 sal_Int32 nEnum = 0;
1842 if(!(rVal >>= nEnum))
1843 return false;
1845 ePos = (drawing::MeasureTextHorzPos)nEnum;
1848 SetValue( sal::static_int_cast< sal_uInt16 >( (SdrMeasureTextHPos)ePos ) );
1849 return true;
1852 TYPEINIT1_AUTOFACTORY(SdrMeasureTextVPosItem,SfxEnumItem);
1854 SfxPoolItem* SdrMeasureTextVPosItem::Clone(SfxItemPool* /*pPool*/) const { return new SdrMeasureTextVPosItem(*this); }
1856 SfxPoolItem* SdrMeasureTextVPosItem::Create(SvStream& rIn, sal_uInt16 /*nVer*/) const { return new SdrMeasureTextVPosItem(rIn); }
1858 sal_uInt16 SdrMeasureTextVPosItem::GetValueCount() const { return 5; }
1860 OUString SdrMeasureTextVPosItem::GetValueTextByPos(sal_uInt16 nPos) const
1862 return ImpGetResStr(STR_ItemValMEASURE_TEXTVAUTO+nPos);
1865 SfxItemPresentation SdrMeasureTextVPosItem::GetPresentation(SfxItemPresentation ePres,
1866 SfxMapUnit /*eCoreMetric*/, SfxMapUnit /*ePresMetric*/, OUString& rText, const IntlWrapper *) const
1868 rText=GetValueTextByPos(sal::static_int_cast< sal_uInt16 >(GetValue()));
1869 if (ePres==SFX_ITEM_PRESENTATION_COMPLETE) {
1870 OUString aStr;
1872 SdrItemPool::TakeItemName(Which(), aStr);
1873 rText = aStr + " " + rText;
1875 return ePres;
1878 bool SdrMeasureTextVPosItem::QueryValue( uno::Any& rVal, sal_uInt8 /*nMemberId*/) const
1880 rVal <<= (drawing::MeasureTextVertPos)GetValue();
1881 return true;
1884 bool SdrMeasureTextVPosItem::PutValue( const uno::Any& rVal, sal_uInt8 /*nMemberId*/)
1886 drawing::MeasureTextVertPos ePos;
1887 if(!(rVal >>= ePos))
1889 sal_Int32 nEnum = 0;
1890 if(!(rVal >>= nEnum))
1891 return false;
1893 ePos = (drawing::MeasureTextVertPos)nEnum;
1896 SetValue( sal::static_int_cast< sal_uInt16 >( (SdrMeasureTextHPos)ePos ) );
1897 return true;
1900 TYPEINIT1_AUTOFACTORY(SdrMeasureUnitItem,SfxEnumItem);
1902 SfxPoolItem* SdrMeasureUnitItem::Clone(SfxItemPool* /*pPool*/) const { return new SdrMeasureUnitItem(*this); }
1904 SfxPoolItem* SdrMeasureUnitItem::Create(SvStream& rIn, sal_uInt16 /*nVer*/) const { return new SdrMeasureUnitItem(rIn); }
1906 sal_uInt16 SdrMeasureUnitItem::GetValueCount() const { return 14; }
1908 OUString SdrMeasureUnitItem::GetValueTextByPos(sal_uInt16 nPos) const
1910 OUString aRetval;
1912 if((FieldUnit)nPos == FUNIT_NONE)
1913 aRetval = "default";
1914 else
1915 SdrFormatter::TakeUnitStr((FieldUnit)nPos, aRetval);
1917 return aRetval;
1920 SfxItemPresentation SdrMeasureUnitItem::GetPresentation(SfxItemPresentation ePres,
1921 SfxMapUnit /*eCoreMetric*/, SfxMapUnit /*ePresMetric*/, OUString& rText, const IntlWrapper *) const
1923 rText=GetValueTextByPos(sal::static_int_cast< sal_uInt16 >(GetValue()));
1924 if (ePres==SFX_ITEM_PRESENTATION_COMPLETE) {
1925 OUString aStr;
1927 SdrItemPool::TakeItemName(Which(), aStr);
1928 rText = aStr + " " + rText;
1930 return ePres;
1933 bool SdrMeasureUnitItem::QueryValue( uno::Any& rVal, sal_uInt8 /*nMemberId*/) const
1935 rVal <<= (sal_Int32)GetValue();
1936 return true;
1939 bool SdrMeasureUnitItem::PutValue( const uno::Any& rVal, sal_uInt8 /*nMemberId*/)
1941 sal_Int32 nMeasure = 0;
1942 if(!(rVal >>= nMeasure))
1943 return false;
1945 SetValue( sal::static_int_cast< sal_uInt16 >( (FieldUnit)nMeasure ) );
1946 return true;
1949 //++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
1950 // Circ
1951 //++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
1953 TYPEINIT1_AUTOFACTORY(SdrCircKindItem,SfxEnumItem);
1955 SfxPoolItem* SdrCircKindItem::Clone(SfxItemPool* /*pPool*/) const { return new SdrCircKindItem(*this); }
1957 SfxPoolItem* SdrCircKindItem::Create(SvStream& rIn, sal_uInt16 /*nVer*/) const { return new SdrCircKindItem(rIn); }
1959 sal_uInt16 SdrCircKindItem::GetValueCount() const { return 4; }
1961 OUString SdrCircKindItem::GetValueTextByPos(sal_uInt16 nPos) const
1963 return ImpGetResStr(STR_ItemValCIRC_FULL+nPos);
1966 SfxItemPresentation SdrCircKindItem::GetPresentation(SfxItemPresentation ePres,
1967 SfxMapUnit /*eCoreMetric*/, SfxMapUnit /*ePresMetric*/, OUString& rText, const IntlWrapper *) const
1969 rText=GetValueTextByPos(sal::static_int_cast< sal_uInt16 >(GetValue()));
1970 if (ePres==SFX_ITEM_PRESENTATION_COMPLETE) {
1971 OUString aStr;
1973 SdrItemPool::TakeItemName(Which(), aStr);
1974 rText = aStr + " " + rText;
1976 return ePres;
1979 bool SdrCircKindItem::QueryValue( uno::Any& rVal, sal_uInt8 /*nMemberId*/) const
1981 rVal <<= (drawing::CircleKind)GetValue();
1982 return true;
1985 bool SdrCircKindItem::PutValue( const uno::Any& rVal, sal_uInt8 /*nMemberId*/)
1987 drawing::CircleKind eKind;
1988 if(!(rVal >>= eKind))
1990 sal_Int32 nEnum = 0;
1991 if(!(rVal >>= nEnum))
1992 return false;
1994 eKind = (drawing::CircleKind)nEnum;
1997 SetValue( sal::static_int_cast< sal_uInt16 >( (SdrCircKind)eKind ) );
1998 return true;
2001 //------------------------------------------------------------
2002 // class SdrSignedPercentItem
2003 //------------------------------------------------------------
2005 TYPEINIT1_AUTOFACTORY( SdrSignedPercentItem, SfxInt16Item );
2008 SfxPoolItem* SdrSignedPercentItem::Clone(SfxItemPool* /*pPool*/) const
2010 return new SdrSignedPercentItem( Which(), GetValue() );
2013 SfxPoolItem* SdrSignedPercentItem::Create( SvStream& rIn, sal_uInt16 /*nVer*/) const
2015 return new SdrSignedPercentItem( Which(), rIn );
2018 SfxItemPresentation SdrSignedPercentItem::GetPresentation(
2019 SfxItemPresentation ePres, SfxMapUnit /*eCoreMetric*/, SfxMapUnit /*ePresMetric*/,
2020 OUString& rText, const IntlWrapper *) const
2022 rText = OUString::number(GetValue()) + "%";
2024 if(ePres == SFX_ITEM_PRESENTATION_COMPLETE)
2026 OUString aStr;
2028 SdrItemPool::TakeItemName(Which(), aStr);
2029 rText = aStr + " " + rText;
2032 return ePres;
2035 //++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
2036 // SdrGrafRedItem
2037 //++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
2039 TYPEINIT1( SdrGrafRedItem, SdrSignedPercentItem );
2041 SfxPoolItem* SdrGrafRedItem::Clone( SfxItemPool* /*pPool*/) const
2043 return new SdrGrafRedItem( *this );
2046 SfxPoolItem* SdrGrafRedItem::Create( SvStream& rIn, sal_uInt16 /*nVer*/) const
2048 return new SdrGrafRedItem( rIn );
2051 //++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
2052 // SdrGrafGreenItem
2053 //++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
2055 TYPEINIT1( SdrGrafGreenItem, SdrSignedPercentItem );
2057 SfxPoolItem* SdrGrafGreenItem::Clone( SfxItemPool* /*pPool*/) const
2059 return new SdrGrafGreenItem( *this );
2062 SfxPoolItem* SdrGrafGreenItem::Create( SvStream& rIn, sal_uInt16 /*nVer*/) const
2064 return new SdrGrafGreenItem( rIn );
2067 //++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
2068 // SdrGrafBlueItem
2069 //++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
2071 TYPEINIT1( SdrGrafBlueItem, SdrSignedPercentItem );
2073 SfxPoolItem* SdrGrafBlueItem::Clone( SfxItemPool* /*pPool*/) const
2075 return new SdrGrafBlueItem( *this );
2078 SfxPoolItem* SdrGrafBlueItem::Create( SvStream& rIn, sal_uInt16 /*nVer*/) const
2080 return new SdrGrafBlueItem( rIn );
2083 //++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
2084 // SdrGrafLuminanceItem
2085 //++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
2087 TYPEINIT1( SdrGrafLuminanceItem, SdrSignedPercentItem );
2089 SfxPoolItem* SdrGrafLuminanceItem::Clone( SfxItemPool* /*pPool*/) const
2091 return new SdrGrafLuminanceItem( *this );
2094 SfxPoolItem* SdrGrafLuminanceItem::Create( SvStream& rIn, sal_uInt16 /*nVer*/) const
2096 return new SdrGrafLuminanceItem( rIn );
2099 //++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
2100 // SdrGrafContrastItem
2101 //++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
2103 TYPEINIT1( SdrGrafContrastItem, SdrSignedPercentItem );
2105 SfxPoolItem* SdrGrafContrastItem::Clone( SfxItemPool* /*pPool*/) const
2107 return new SdrGrafContrastItem( *this );
2110 SfxPoolItem* SdrGrafContrastItem::Create( SvStream& rIn, sal_uInt16 /*nVer*/) const
2112 return new SdrGrafContrastItem( rIn );
2115 //++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
2116 // SdrGrafGamma100Item
2117 //++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
2119 TYPEINIT1( SdrGrafGamma100Item, SfxUInt32Item );
2121 SfxPoolItem* SdrGrafGamma100Item::Clone( SfxItemPool* /*pPool */) const
2123 return new SdrGrafGamma100Item( *this );
2126 SfxPoolItem* SdrGrafGamma100Item::Create( SvStream& rIn, sal_uInt16 /*nVer*/) const
2128 return new SdrGrafGamma100Item( rIn );
2131 bool SdrGrafGamma100Item::QueryValue( uno::Any& rVal, sal_uInt8 /*nMemberId*/) const
2133 rVal <<= ((double)GetValue()) / 100.0;
2134 return true;
2137 bool SdrGrafGamma100Item::PutValue( const uno::Any& rVal, sal_uInt8 /*nMemberId*/)
2139 double nGamma = 0;
2140 if(!(rVal >>= nGamma))
2141 return false;
2143 SetValue( (sal_uInt32)(nGamma * 100.0 ) );
2144 return true;
2147 //++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
2148 // SdrGrafInvertItem
2149 //++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
2151 TYPEINIT1( SdrGrafInvertItem, SdrOnOffItem );
2153 SfxPoolItem* SdrGrafInvertItem::Clone( SfxItemPool* /*pPool*/) const
2155 return new SdrGrafInvertItem( *this );
2158 SfxPoolItem* SdrGrafInvertItem::Create( SvStream& rIn, sal_uInt16 /*nVer*/) const
2160 return new SdrGrafInvertItem( rIn );
2163 //++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
2164 // SdrGrafTransparenceItem
2165 //++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
2167 TYPEINIT1( SdrGrafTransparenceItem, SdrPercentItem );
2169 SfxPoolItem* SdrGrafTransparenceItem::Clone( SfxItemPool* /*pPool*/) const
2171 return new SdrGrafTransparenceItem( *this );
2174 SfxPoolItem* SdrGrafTransparenceItem::Create( SvStream& rIn, sal_uInt16 /*nVer*/) const
2176 return new SdrGrafTransparenceItem( rIn );
2179 //++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
2180 // SdrGrafModeItem
2181 //++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
2183 TYPEINIT1( SdrGrafModeItem, SfxEnumItem );
2185 SfxPoolItem* SdrGrafModeItem::Clone(SfxItemPool* /*pPool*/) const
2187 return new SdrGrafModeItem( *this );
2190 SfxPoolItem* SdrGrafModeItem::Create( SvStream& rIn, sal_uInt16 /*nVer*/) const
2192 return new SdrGrafModeItem( rIn );
2195 sal_uInt16 SdrGrafModeItem::GetValueCount() const
2197 return 4;
2200 OUString SdrGrafModeItem::GetValueTextByPos(sal_uInt16 nPos) const
2202 OUString aStr;
2204 switch(nPos)
2206 case 1:
2208 aStr = "Greys";
2209 break;
2211 case 2:
2213 aStr = "Black/White";
2214 break;
2216 case 3:
2218 aStr = "Watermark";
2219 break;
2221 default:
2223 aStr = "Standard";
2224 break;
2228 return aStr;
2231 SfxItemPresentation SdrGrafModeItem::GetPresentation( SfxItemPresentation ePres,
2232 SfxMapUnit /*eCoreMetric*/, SfxMapUnit /*ePresMetric*/,
2233 OUString& rText, const IntlWrapper *) const
2235 rText = GetValueTextByPos( sal::static_int_cast< sal_uInt16 >( GetValue() ) );
2237 if( ePres == SFX_ITEM_PRESENTATION_COMPLETE )
2239 OUString aStr;
2241 SdrItemPool::TakeItemName( Which(), aStr );
2242 rText = aStr + " " + rText;
2245 return ePres;
2248 //++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
2249 // SdrGrafCropItem
2250 //++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
2252 TYPEINIT1( SdrGrafCropItem, SvxGrfCrop );
2254 SfxPoolItem* SdrGrafCropItem::Clone( SfxItemPool* /*pPool*/) const
2256 return new SdrGrafCropItem( *this );
2259 SfxPoolItem* SdrGrafCropItem::Create( SvStream& rIn, sal_uInt16 nVer ) const
2261 return( ( 0 == nVer ) ? Clone( NULL ) : SvxGrfCrop::Create( rIn, nVer ) );
2264 sal_uInt16 SdrGrafCropItem::GetVersion( sal_uInt16 /*nFileVersion*/) const
2266 // GRFCROP_VERSION_MOVETOSVX is 1
2267 return GRFCROP_VERSION_MOVETOSVX;
2270 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */