xref: /aoo41x/main/svx/source/svdraw/svdattr.cxx (revision 26734c99)
1 /**************************************************************
2  *
3  * Licensed to the Apache Software Foundation (ASF) under one
4  * or more contributor license agreements.  See the NOTICE file
5  * distributed with this work for additional information
6  * regarding copyright ownership.  The ASF licenses this file
7  * to you under the Apache License, Version 2.0 (the
8  * "License"); you may not use this file except in compliance
9  * with the License.  You may obtain a copy of the License at
10  *
11  *   http://www.apache.org/licenses/LICENSE-2.0
12  *
13  * Unless required by applicable law or agreed to in writing,
14  * software distributed under the License is distributed on an
15  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16  * KIND, either express or implied.  See the License for the
17  * specific language governing permissions and limitations
18  * under the License.
19  *
20  *************************************************************/
21 
22 
23 
24 // MARKER(update_precomp.py): autogen include statement, do not remove
25 #include "precompiled_svx.hxx"
26 
27 
28 #include <com/sun/star/drawing/TextFitToSizeType.hpp>
29 #include <com/sun/star/drawing/TextHorizontalAdjust.hpp>
30 #include <com/sun/star/drawing/TextVerticalAdjust.hpp>
31 #include <com/sun/star/drawing/TextAnimationKind.hpp>
32 #include <com/sun/star/uno/Any.hxx>
33 #include <com/sun/star/drawing/TextAnimationDirection.hpp>
34 #include <com/sun/star/drawing/ConnectorType.hpp>
35 #include <com/sun/star/drawing/MeasureKind.hpp>
36 #include <com/sun/star/drawing/MeasureTextHorzPos.hpp>
37 #include <com/sun/star/drawing/MeasureTextVertPos.hpp>
38 #include <com/sun/star/drawing/CircleKind.hpp>
39 #include <com/sun/star/uno/Sequence.hxx>
40 
41 #include <unotools/intlwrapper.hxx>
42 #include <comphelper/processfactory.hxx>
43 #include <vcl/svapp.hxx>
44 #include <svx/svdattr.hxx>
45 #include <svx/svdattrx.hxx>
46 #include <svx/svdpool.hxx>
47 
48 #include <svl/solar.hrc>
49 #include "editeng/xmlcnitm.hxx"
50 
51 #include <svx/svxids.hrc>
52 #include <svx/xtable.hxx>    // fuer RGB_Color()
53 #include "svx/svditext.hxx"
54 #include <svx/svdmodel.hxx>  // fuer DEGREE_CHAR
55 #include <svx/svdtrans.hxx>
56 #include "svx/svdglob.hxx"  // Stringcache
57 #include "svx/svdstr.hrc"
58 #include <svx/sdgcpitm.hxx>
59 #include <editeng/adjitem.hxx>
60 #include <svx/sdtfchim.hxx>
61 #include <editeng/writingmodeitem.hxx>
62 #include <tools/bigint.hxx>
63 #include <tools/stream.hxx>
64 
65 #include <svx/xfillit0.hxx>
66 #include <svx/xflclit.hxx>
67 #include <svx/xlineit0.hxx>
68 #include <svx/svx3ditems.hxx>
69 
70 #define ITEMID_BOX SDRATTR_TABLE_BORDER
71 #define ITEMID_BOXINFO SDRATTR_TABLE_BORDER_INNER
72 #include "editeng/boxitem.hxx"
73 
74 #define ITEMID_SHADOW SDRATTR_TABLE_BORDER_SHADOW
75 #include "editeng/shaditem.hxx"
76 
77 #define ITEMID_LINE 0
78 #include "editeng/bolnitem.hxx"
79 
80 using namespace ::rtl;
81 using namespace ::com::sun::star;
82 
83 /*************************************************************************
84 |*
85 |* Konstruktor
86 |*
87 \************************************************************************/
88 
89 SdrItemPool::SdrItemPool(
90 	SfxItemPool* _pMaster,
91 	sal_Bool bLoadRefCounts)
92 :	XOutdevItemPool(_pMaster, SDRATTR_START, SDRATTR_END, bLoadRefCounts)
93 {
94 	// preapare some constants
95 	const Color aNullCol(RGB_Color(COL_BLACK));
96 	const XubString aEmptyStr;
97 	const sal_Int32 nDefEdgeDist(500L); // Erstmal hart defaulted fuer Draw (100TH_MM). hier muss noch der MapMode beruecksichtigt werden.
98 
99 	// init the non-persistent items
100 	for(sal_uInt16 i(SDRATTR_NOTPERSIST_FIRST); i <= SDRATTR_NOTPERSIST_LAST; i++)
101 	{
102 		mpLocalItemInfos[i - SDRATTR_START]._nFlags=0;
103 	}
104 
105 	// init own PoolDefaults
106 	mppLocalPoolDefaults[SDRATTR_SHADOW            -SDRATTR_START]=new SdrShadowItem;
107 	mppLocalPoolDefaults[SDRATTR_SHADOWCOLOR       -SDRATTR_START]=new SdrShadowColorItem(aEmptyStr,aNullCol);
108 	mppLocalPoolDefaults[SDRATTR_SHADOWXDIST       -SDRATTR_START]=new SdrShadowXDistItem;
109 	mppLocalPoolDefaults[SDRATTR_SHADOWYDIST       -SDRATTR_START]=new SdrShadowYDistItem;
110 	mppLocalPoolDefaults[SDRATTR_SHADOWTRANSPARENCE-SDRATTR_START]=new SdrShadowTransparenceItem;
111 	mppLocalPoolDefaults[SDRATTR_SHADOW3D          -SDRATTR_START]=new SfxVoidItem(SDRATTR_SHADOW3D    );
112 	mppLocalPoolDefaults[SDRATTR_SHADOWPERSP       -SDRATTR_START]=new SfxVoidItem(SDRATTR_SHADOWPERSP );
113 	mppLocalPoolDefaults[SDRATTR_CAPTIONTYPE      -SDRATTR_START]=new SdrCaptionTypeItem      ;
114 	mppLocalPoolDefaults[SDRATTR_CAPTIONFIXEDANGLE-SDRATTR_START]=new SdrCaptionFixedAngleItem;
115 	mppLocalPoolDefaults[SDRATTR_CAPTIONANGLE     -SDRATTR_START]=new SdrCaptionAngleItem     ;
116 	mppLocalPoolDefaults[SDRATTR_CAPTIONGAP       -SDRATTR_START]=new SdrCaptionGapItem       ;
117 	mppLocalPoolDefaults[SDRATTR_CAPTIONESCDIR    -SDRATTR_START]=new SdrCaptionEscDirItem    ;
118 	mppLocalPoolDefaults[SDRATTR_CAPTIONESCISREL  -SDRATTR_START]=new SdrCaptionEscIsRelItem  ;
119 	mppLocalPoolDefaults[SDRATTR_CAPTIONESCREL    -SDRATTR_START]=new SdrCaptionEscRelItem    ;
120 	mppLocalPoolDefaults[SDRATTR_CAPTIONESCABS    -SDRATTR_START]=new SdrCaptionEscAbsItem    ;
121 	mppLocalPoolDefaults[SDRATTR_CAPTIONLINELEN   -SDRATTR_START]=new SdrCaptionLineLenItem   ;
122 	mppLocalPoolDefaults[SDRATTR_CAPTIONFITLINELEN-SDRATTR_START]=new SdrCaptionFitLineLenItem;
123 	mppLocalPoolDefaults[SDRATTR_ECKENRADIUS			-SDRATTR_START]=new SdrEckenradiusItem;
124 	mppLocalPoolDefaults[SDRATTR_TEXT_MINFRAMEHEIGHT	-SDRATTR_START]=new SdrTextMinFrameHeightItem;
125 	mppLocalPoolDefaults[SDRATTR_TEXT_AUTOGROWHEIGHT	-SDRATTR_START]=new SdrTextAutoGrowHeightItem;
126 	mppLocalPoolDefaults[SDRATTR_TEXT_FITTOSIZE		-SDRATTR_START]=new SdrTextFitToSizeTypeItem;
127 	mppLocalPoolDefaults[SDRATTR_TEXT_LEFTDIST		-SDRATTR_START]=new SdrTextLeftDistItem;
128 	mppLocalPoolDefaults[SDRATTR_TEXT_RIGHTDIST		-SDRATTR_START]=new SdrTextRightDistItem;
129 	mppLocalPoolDefaults[SDRATTR_TEXT_UPPERDIST		-SDRATTR_START]=new SdrTextUpperDistItem;
130 	mppLocalPoolDefaults[SDRATTR_TEXT_LOWERDIST		-SDRATTR_START]=new SdrTextLowerDistItem;
131 	mppLocalPoolDefaults[SDRATTR_TEXT_VERTADJUST		-SDRATTR_START]=new SdrTextVertAdjustItem;
132 	mppLocalPoolDefaults[SDRATTR_TEXT_MAXFRAMEHEIGHT	-SDRATTR_START]=new SdrTextMaxFrameHeightItem;
133 	mppLocalPoolDefaults[SDRATTR_TEXT_MINFRAMEWIDTH	-SDRATTR_START]=new SdrTextMinFrameWidthItem;
134 	mppLocalPoolDefaults[SDRATTR_TEXT_MAXFRAMEWIDTH	-SDRATTR_START]=new SdrTextMaxFrameWidthItem;
135 	mppLocalPoolDefaults[SDRATTR_TEXT_AUTOGROWWIDTH	-SDRATTR_START]=new SdrTextAutoGrowWidthItem;
136 	mppLocalPoolDefaults[SDRATTR_TEXT_HORZADJUST		-SDRATTR_START]=new SdrTextHorzAdjustItem;
137 	mppLocalPoolDefaults[SDRATTR_TEXT_ANIKIND			-SDRATTR_START]=new SdrTextAniKindItem;
138 	mppLocalPoolDefaults[SDRATTR_TEXT_ANIDIRECTION	-SDRATTR_START]=new SdrTextAniDirectionItem;
139 	mppLocalPoolDefaults[SDRATTR_TEXT_ANISTARTINSIDE	-SDRATTR_START]=new SdrTextAniStartInsideItem;
140 	mppLocalPoolDefaults[SDRATTR_TEXT_ANISTOPINSIDE	-SDRATTR_START]=new SdrTextAniStopInsideItem;
141 	mppLocalPoolDefaults[SDRATTR_TEXT_ANICOUNT		-SDRATTR_START]=new SdrTextAniCountItem;
142 	mppLocalPoolDefaults[SDRATTR_TEXT_ANIDELAY		-SDRATTR_START]=new SdrTextAniDelayItem;
143 	mppLocalPoolDefaults[SDRATTR_TEXT_ANIAMOUNT		-SDRATTR_START]=new SdrTextAniAmountItem;
144 	mppLocalPoolDefaults[SDRATTR_TEXT_CONTOURFRAME	-SDRATTR_START]=new SdrTextContourFrameItem;
145 	mppLocalPoolDefaults[SDRATTR_CUSTOMSHAPE_ADJUSTMENT -SDRATTR_START]=new SdrCustomShapeAdjustmentItem;
146 	mppLocalPoolDefaults[SDRATTR_XMLATTRIBUTES -SDRATTR_START]=new SvXMLAttrContainerItem( SDRATTR_XMLATTRIBUTES );
147 	mppLocalPoolDefaults[SDRATTR_TEXT_USEFIXEDCELLHEIGHT -SDRATTR_START]=new SdrTextFixedCellHeightItem;
148 	mppLocalPoolDefaults[SDRATTR_TEXT_WORDWRAP		   -SDRATTR_START]=new SdrTextWordWrapItem;
149 	mppLocalPoolDefaults[SDRATTR_TEXT_AUTOGROWSIZE	   -SDRATTR_START]=new SdrTextAutoGrowSizeItem;
150 	mppLocalPoolDefaults[SDRATTR_EDGEKIND         -SDRATTR_START]=new SdrEdgeKindItem;
151 	mppLocalPoolDefaults[SDRATTR_EDGENODE1HORZDIST-SDRATTR_START]=new SdrEdgeNode1HorzDistItem(nDefEdgeDist);
152 	mppLocalPoolDefaults[SDRATTR_EDGENODE1VERTDIST-SDRATTR_START]=new SdrEdgeNode1VertDistItem(nDefEdgeDist);
153 	mppLocalPoolDefaults[SDRATTR_EDGENODE2HORZDIST-SDRATTR_START]=new SdrEdgeNode2HorzDistItem(nDefEdgeDist);
154 	mppLocalPoolDefaults[SDRATTR_EDGENODE2VERTDIST-SDRATTR_START]=new SdrEdgeNode2VertDistItem(nDefEdgeDist);
155 	mppLocalPoolDefaults[SDRATTR_EDGENODE1GLUEDIST-SDRATTR_START]=new SdrEdgeNode1GlueDistItem;
156 	mppLocalPoolDefaults[SDRATTR_EDGENODE2GLUEDIST-SDRATTR_START]=new SdrEdgeNode2GlueDistItem;
157 	mppLocalPoolDefaults[SDRATTR_EDGELINEDELTAANZ -SDRATTR_START]=new SdrEdgeLineDeltaAnzItem;
158 	mppLocalPoolDefaults[SDRATTR_EDGELINE1DELTA   -SDRATTR_START]=new SdrEdgeLine1DeltaItem;
159 	mppLocalPoolDefaults[SDRATTR_EDGELINE2DELTA   -SDRATTR_START]=new SdrEdgeLine2DeltaItem;
160 	mppLocalPoolDefaults[SDRATTR_EDGELINE3DELTA   -SDRATTR_START]=new SdrEdgeLine3DeltaItem;
161 	mppLocalPoolDefaults[SDRATTR_MEASUREKIND             -SDRATTR_START]=new SdrMeasureKindItem;
162 	mppLocalPoolDefaults[SDRATTR_MEASURETEXTHPOS         -SDRATTR_START]=new SdrMeasureTextHPosItem;
163 	mppLocalPoolDefaults[SDRATTR_MEASURETEXTVPOS         -SDRATTR_START]=new SdrMeasureTextVPosItem;
164 	mppLocalPoolDefaults[SDRATTR_MEASURELINEDIST         -SDRATTR_START]=new SdrMeasureLineDistItem(800);
165 	mppLocalPoolDefaults[SDRATTR_MEASUREHELPLINEOVERHANG -SDRATTR_START]=new SdrMeasureHelplineOverhangItem(200);
166 	mppLocalPoolDefaults[SDRATTR_MEASUREHELPLINEDIST     -SDRATTR_START]=new SdrMeasureHelplineDistItem(100);
167 	mppLocalPoolDefaults[SDRATTR_MEASUREHELPLINE1LEN     -SDRATTR_START]=new SdrMeasureHelpline1LenItem;
168 	mppLocalPoolDefaults[SDRATTR_MEASUREHELPLINE2LEN     -SDRATTR_START]=new SdrMeasureHelpline2LenItem;
169 	mppLocalPoolDefaults[SDRATTR_MEASUREBELOWREFEDGE     -SDRATTR_START]=new SdrMeasureBelowRefEdgeItem;
170 	mppLocalPoolDefaults[SDRATTR_MEASURETEXTROTA90       -SDRATTR_START]=new SdrMeasureTextRota90Item;
171 	mppLocalPoolDefaults[SDRATTR_MEASURETEXTUPSIDEDOWN   -SDRATTR_START]=new SdrMeasureTextUpsideDownItem;
172 	mppLocalPoolDefaults[SDRATTR_MEASUREOVERHANG         -SDRATTR_START]=new SdrMeasureOverhangItem(600);
173 	mppLocalPoolDefaults[SDRATTR_MEASUREUNIT             -SDRATTR_START]=new SdrMeasureUnitItem;
174 	mppLocalPoolDefaults[SDRATTR_MEASURESCALE            -SDRATTR_START]=new SdrMeasureScaleItem;
175 	mppLocalPoolDefaults[SDRATTR_MEASURESHOWUNIT         -SDRATTR_START]=new SdrMeasureShowUnitItem;
176 	mppLocalPoolDefaults[SDRATTR_MEASUREFORMATSTRING     -SDRATTR_START]=new SdrMeasureFormatStringItem();
177 	mppLocalPoolDefaults[SDRATTR_MEASURETEXTAUTOANGLE    -SDRATTR_START]=new SdrMeasureTextAutoAngleItem();
178 	mppLocalPoolDefaults[SDRATTR_MEASURETEXTAUTOANGLEVIEW-SDRATTR_START]=new SdrMeasureTextAutoAngleViewItem();
179 	mppLocalPoolDefaults[SDRATTR_MEASURETEXTISFIXEDANGLE -SDRATTR_START]=new SdrMeasureTextIsFixedAngleItem();
180 	mppLocalPoolDefaults[SDRATTR_MEASURETEXTFIXEDANGLE   -SDRATTR_START]=new SdrMeasureTextFixedAngleItem();
181 	mppLocalPoolDefaults[SDRATTR_MEASUREDECIMALPLACES    -SDRATTR_START]=new SdrMeasureDecimalPlacesItem();
182 	mppLocalPoolDefaults[SDRATTR_CIRCKIND      -SDRATTR_START]=new SdrCircKindItem;
183 	mppLocalPoolDefaults[SDRATTR_CIRCSTARTANGLE-SDRATTR_START]=new SdrCircStartAngleItem;
184 	mppLocalPoolDefaults[SDRATTR_CIRCENDANGLE  -SDRATTR_START]=new SdrCircEndAngleItem;
185 	mppLocalPoolDefaults[SDRATTR_OBJMOVEPROTECT -SDRATTR_START]=new SdrObjMoveProtectItem;
186 	mppLocalPoolDefaults[SDRATTR_OBJSIZEPROTECT -SDRATTR_START]=new SdrObjSizeProtectItem;
187 	mppLocalPoolDefaults[SDRATTR_OBJPRINTABLE   -SDRATTR_START]=new SdrObjPrintableItem;
188 	mppLocalPoolDefaults[SDRATTR_OBJVISIBLE		-SDRATTR_START]=new SdrObjVisibleItem;
189 	mppLocalPoolDefaults[SDRATTR_LAYERID        -SDRATTR_START]=new SdrLayerIdItem;
190 	mppLocalPoolDefaults[SDRATTR_LAYERNAME      -SDRATTR_START]=new SdrLayerNameItem;
191 	mppLocalPoolDefaults[SDRATTR_OBJECTNAME     -SDRATTR_START]=new SdrObjectNameItem;
192 	mppLocalPoolDefaults[SDRATTR_ALLPOSITIONX   -SDRATTR_START]=new SdrAllPositionXItem;
193 	mppLocalPoolDefaults[SDRATTR_ALLPOSITIONY   -SDRATTR_START]=new SdrAllPositionYItem;
194 	mppLocalPoolDefaults[SDRATTR_ALLSIZEWIDTH   -SDRATTR_START]=new SdrAllSizeWidthItem;
195 	mppLocalPoolDefaults[SDRATTR_ALLSIZEHEIGHT  -SDRATTR_START]=new SdrAllSizeHeightItem;
196 	mppLocalPoolDefaults[SDRATTR_ONEPOSITIONX   -SDRATTR_START]=new SdrOnePositionXItem;
197 	mppLocalPoolDefaults[SDRATTR_ONEPOSITIONY   -SDRATTR_START]=new SdrOnePositionYItem;
198 	mppLocalPoolDefaults[SDRATTR_ONESIZEWIDTH   -SDRATTR_START]=new SdrOneSizeWidthItem;
199 	mppLocalPoolDefaults[SDRATTR_ONESIZEHEIGHT  -SDRATTR_START]=new SdrOneSizeHeightItem;
200 	mppLocalPoolDefaults[SDRATTR_LOGICSIZEWIDTH -SDRATTR_START]=new SdrLogicSizeWidthItem;
201 	mppLocalPoolDefaults[SDRATTR_LOGICSIZEHEIGHT-SDRATTR_START]=new SdrLogicSizeHeightItem;
202 	mppLocalPoolDefaults[SDRATTR_ROTATEANGLE    -SDRATTR_START]=new SdrRotateAngleItem;
203 	mppLocalPoolDefaults[SDRATTR_SHEARANGLE     -SDRATTR_START]=new SdrShearAngleItem;
204 	mppLocalPoolDefaults[SDRATTR_MOVEX          -SDRATTR_START]=new SdrMoveXItem;
205 	mppLocalPoolDefaults[SDRATTR_MOVEY          -SDRATTR_START]=new SdrMoveYItem;
206 	mppLocalPoolDefaults[SDRATTR_RESIZEXONE     -SDRATTR_START]=new SdrResizeXOneItem;
207 	mppLocalPoolDefaults[SDRATTR_RESIZEYONE     -SDRATTR_START]=new SdrResizeYOneItem;
208 	mppLocalPoolDefaults[SDRATTR_ROTATEONE      -SDRATTR_START]=new SdrRotateOneItem;
209 	mppLocalPoolDefaults[SDRATTR_HORZSHEARONE   -SDRATTR_START]=new SdrHorzShearOneItem;
210 	mppLocalPoolDefaults[SDRATTR_VERTSHEARONE   -SDRATTR_START]=new SdrVertShearOneItem;
211 	mppLocalPoolDefaults[SDRATTR_RESIZEXALL     -SDRATTR_START]=new SdrResizeXAllItem;
212 	mppLocalPoolDefaults[SDRATTR_RESIZEYALL     -SDRATTR_START]=new SdrResizeYAllItem;
213 	mppLocalPoolDefaults[SDRATTR_ROTATEALL      -SDRATTR_START]=new SdrRotateAllItem;
214 	mppLocalPoolDefaults[SDRATTR_HORZSHEARALL   -SDRATTR_START]=new SdrHorzShearAllItem;
215 	mppLocalPoolDefaults[SDRATTR_VERTSHEARALL   -SDRATTR_START]=new SdrVertShearAllItem;
216 	mppLocalPoolDefaults[SDRATTR_TRANSFORMREF1X -SDRATTR_START]=new SdrTransformRef1XItem;
217 	mppLocalPoolDefaults[SDRATTR_TRANSFORMREF1Y -SDRATTR_START]=new SdrTransformRef1YItem;
218 	mppLocalPoolDefaults[SDRATTR_TRANSFORMREF2X -SDRATTR_START]=new SdrTransformRef2XItem;
219 	mppLocalPoolDefaults[SDRATTR_TRANSFORMREF2Y -SDRATTR_START]=new SdrTransformRef2YItem;
220     mppLocalPoolDefaults[SDRATTR_TEXTDIRECTION  -SDRATTR_START]=new SvxWritingModeItem(com::sun::star::text::WritingMode_LR_TB, SDRATTR_TEXTDIRECTION);
221 	mppLocalPoolDefaults[ SDRATTR_GRAFRED				- SDRATTR_START] = new SdrGrafRedItem;
222 	mppLocalPoolDefaults[ SDRATTR_GRAFGREEN			- SDRATTR_START] = new SdrGrafGreenItem;
223 	mppLocalPoolDefaults[ SDRATTR_GRAFBLUE			- SDRATTR_START] = new SdrGrafBlueItem;
224 	mppLocalPoolDefaults[ SDRATTR_GRAFLUMINANCE		- SDRATTR_START] = new SdrGrafLuminanceItem;
225 	mppLocalPoolDefaults[ SDRATTR_GRAFCONTRAST		- SDRATTR_START] = new SdrGrafContrastItem;
226 	mppLocalPoolDefaults[ SDRATTR_GRAFGAMMA			- SDRATTR_START] = new SdrGrafGamma100Item;
227 	mppLocalPoolDefaults[ SDRATTR_GRAFTRANSPARENCE	- SDRATTR_START] = new SdrGrafTransparenceItem;
228 	mppLocalPoolDefaults[ SDRATTR_GRAFINVERT			- SDRATTR_START] = new SdrGrafInvertItem;
229 	mppLocalPoolDefaults[ SDRATTR_GRAFMODE			- SDRATTR_START] = new SdrGrafModeItem;
230 	mppLocalPoolDefaults[ SDRATTR_GRAFCROP			- SDRATTR_START] = new SdrGrafCropItem;
231 	mppLocalPoolDefaults[ SDRATTR_3DOBJ_PERCENT_DIAGONAL - SDRATTR_START ] = new Svx3DPercentDiagonalItem;
232 	mppLocalPoolDefaults[ SDRATTR_3DOBJ_BACKSCALE - SDRATTR_START ] = new Svx3DBackscaleItem;
233 	mppLocalPoolDefaults[ SDRATTR_3DOBJ_DEPTH - SDRATTR_START ] = new Svx3DDepthItem;
234 	mppLocalPoolDefaults[ SDRATTR_3DOBJ_HORZ_SEGS - SDRATTR_START ] = new Svx3DHorizontalSegmentsItem;
235 	mppLocalPoolDefaults[ SDRATTR_3DOBJ_VERT_SEGS - SDRATTR_START ] = new Svx3DVerticalSegmentsItem;
236 	mppLocalPoolDefaults[ SDRATTR_3DOBJ_END_ANGLE - SDRATTR_START ] = new Svx3DEndAngleItem;
237 	mppLocalPoolDefaults[ SDRATTR_3DOBJ_DOUBLE_SIDED - SDRATTR_START ] = new Svx3DDoubleSidedItem;
238 	mppLocalPoolDefaults[ SDRATTR_3DOBJ_NORMALS_KIND - SDRATTR_START ] = new Svx3DNormalsKindItem;
239 	mppLocalPoolDefaults[ SDRATTR_3DOBJ_NORMALS_INVERT - SDRATTR_START ] = new Svx3DNormalsInvertItem;
240 	mppLocalPoolDefaults[ SDRATTR_3DOBJ_TEXTURE_PROJ_X - SDRATTR_START ] = new Svx3DTextureProjectionXItem;
241 	mppLocalPoolDefaults[ SDRATTR_3DOBJ_TEXTURE_PROJ_Y - SDRATTR_START ] = new Svx3DTextureProjectionYItem;
242 	mppLocalPoolDefaults[ SDRATTR_3DOBJ_SHADOW_3D - SDRATTR_START ] = new Svx3DShadow3DItem;
243 	mppLocalPoolDefaults[ SDRATTR_3DOBJ_MAT_COLOR - SDRATTR_START ] = new Svx3DMaterialColorItem;
244 	mppLocalPoolDefaults[ SDRATTR_3DOBJ_MAT_EMISSION - SDRATTR_START ] = new Svx3DMaterialEmissionItem;
245 	mppLocalPoolDefaults[ SDRATTR_3DOBJ_MAT_SPECULAR - SDRATTR_START ] = new Svx3DMaterialSpecularItem;
246 	mppLocalPoolDefaults[ SDRATTR_3DOBJ_MAT_SPECULAR_INTENSITY - SDRATTR_START ] = new Svx3DMaterialSpecularIntensityItem;
247 	mppLocalPoolDefaults[ SDRATTR_3DOBJ_TEXTURE_KIND - SDRATTR_START ] = new Svx3DTextureKindItem;
248 	mppLocalPoolDefaults[ SDRATTR_3DOBJ_TEXTURE_MODE - SDRATTR_START ] = new Svx3DTextureModeItem;
249 	mppLocalPoolDefaults[ SDRATTR_3DOBJ_TEXTURE_FILTER - SDRATTR_START ] = new Svx3DTextureFilterItem;
250 	mppLocalPoolDefaults[ SDRATTR_3DOBJ_SMOOTH_NORMALS - SDRATTR_START ] = new Svx3DSmoothNormalsItem;
251 	mppLocalPoolDefaults[ SDRATTR_3DOBJ_SMOOTH_LIDS - SDRATTR_START ] = new Svx3DSmoothLidsItem;
252 	mppLocalPoolDefaults[ SDRATTR_3DOBJ_CHARACTER_MODE - SDRATTR_START ] = new Svx3DCharacterModeItem;
253 	mppLocalPoolDefaults[ SDRATTR_3DOBJ_CLOSE_FRONT - SDRATTR_START ] = new Svx3DCloseFrontItem;
254 	mppLocalPoolDefaults[ SDRATTR_3DOBJ_CLOSE_BACK - SDRATTR_START ] = new Svx3DCloseBackItem;
255 	mppLocalPoolDefaults[ SDRATTR_3DOBJ_REDUCED_LINE_GEOMETRY - SDRATTR_START ] = new Svx3DReducedLineGeometryItem;
256 	mppLocalPoolDefaults[ SDRATTR_3DSCENE_PERSPECTIVE - SDRATTR_START ] = new Svx3DPerspectiveItem;
257 	mppLocalPoolDefaults[ SDRATTR_3DSCENE_DISTANCE - SDRATTR_START ] = new Svx3DDistanceItem;
258 	mppLocalPoolDefaults[ SDRATTR_3DSCENE_FOCAL_LENGTH - SDRATTR_START ] = new Svx3DFocalLengthItem;
259 	mppLocalPoolDefaults[ SDRATTR_3DSCENE_TWO_SIDED_LIGHTING - SDRATTR_START ] = new Svx3DTwoSidedLightingItem;
260 	mppLocalPoolDefaults[ SDRATTR_3DSCENE_LIGHTCOLOR_1 - SDRATTR_START ] = new Svx3DLightcolor1Item;
261 	mppLocalPoolDefaults[ SDRATTR_3DSCENE_LIGHTCOLOR_2 - SDRATTR_START ] = new Svx3DLightcolor2Item;
262 	mppLocalPoolDefaults[ SDRATTR_3DSCENE_LIGHTCOLOR_3 - SDRATTR_START ] = new Svx3DLightcolor3Item;
263 	mppLocalPoolDefaults[ SDRATTR_3DSCENE_LIGHTCOLOR_4 - SDRATTR_START ] = new Svx3DLightcolor4Item;
264 	mppLocalPoolDefaults[ SDRATTR_3DSCENE_LIGHTCOLOR_5 - SDRATTR_START ] = new Svx3DLightcolor5Item;
265 	mppLocalPoolDefaults[ SDRATTR_3DSCENE_LIGHTCOLOR_6 - SDRATTR_START ] = new Svx3DLightcolor6Item;
266 	mppLocalPoolDefaults[ SDRATTR_3DSCENE_LIGHTCOLOR_7 - SDRATTR_START ] = new Svx3DLightcolor7Item;
267 	mppLocalPoolDefaults[ SDRATTR_3DSCENE_LIGHTCOLOR_8 - SDRATTR_START ] = new Svx3DLightcolor8Item;
268 	mppLocalPoolDefaults[ SDRATTR_3DSCENE_AMBIENTCOLOR - SDRATTR_START ] = new Svx3DAmbientcolorItem;
269 	mppLocalPoolDefaults[ SDRATTR_3DSCENE_LIGHTON_1 - SDRATTR_START ] = new Svx3DLightOnOff1Item;
270 	mppLocalPoolDefaults[ SDRATTR_3DSCENE_LIGHTON_2 - SDRATTR_START ] = new Svx3DLightOnOff2Item;
271 	mppLocalPoolDefaults[ SDRATTR_3DSCENE_LIGHTON_3 - SDRATTR_START ] = new Svx3DLightOnOff3Item;
272 	mppLocalPoolDefaults[ SDRATTR_3DSCENE_LIGHTON_4 - SDRATTR_START ] = new Svx3DLightOnOff4Item;
273 	mppLocalPoolDefaults[ SDRATTR_3DSCENE_LIGHTON_5 - SDRATTR_START ] = new Svx3DLightOnOff5Item;
274 	mppLocalPoolDefaults[ SDRATTR_3DSCENE_LIGHTON_6 - SDRATTR_START ] = new Svx3DLightOnOff6Item;
275 	mppLocalPoolDefaults[ SDRATTR_3DSCENE_LIGHTON_7 - SDRATTR_START ] = new Svx3DLightOnOff7Item;
276 	mppLocalPoolDefaults[ SDRATTR_3DSCENE_LIGHTON_8 - SDRATTR_START ] = new Svx3DLightOnOff8Item;
277 	mppLocalPoolDefaults[ SDRATTR_3DSCENE_LIGHTDIRECTION_1 - SDRATTR_START ] = new Svx3DLightDirection1Item;
278 	mppLocalPoolDefaults[ SDRATTR_3DSCENE_LIGHTDIRECTION_2 - SDRATTR_START ] = new Svx3DLightDirection2Item;
279 	mppLocalPoolDefaults[ SDRATTR_3DSCENE_LIGHTDIRECTION_3 - SDRATTR_START ] = new Svx3DLightDirection3Item;
280 	mppLocalPoolDefaults[ SDRATTR_3DSCENE_LIGHTDIRECTION_4 - SDRATTR_START ] = new Svx3DLightDirection4Item;
281 	mppLocalPoolDefaults[ SDRATTR_3DSCENE_LIGHTDIRECTION_5 - SDRATTR_START ] = new Svx3DLightDirection5Item;
282 	mppLocalPoolDefaults[ SDRATTR_3DSCENE_LIGHTDIRECTION_6 - SDRATTR_START ] = new Svx3DLightDirection6Item;
283 	mppLocalPoolDefaults[ SDRATTR_3DSCENE_LIGHTDIRECTION_7 - SDRATTR_START ] = new Svx3DLightDirection7Item;
284 	mppLocalPoolDefaults[ SDRATTR_3DSCENE_LIGHTDIRECTION_8 - SDRATTR_START ] = new Svx3DLightDirection8Item;
285 	mppLocalPoolDefaults[ SDRATTR_3DSCENE_SHADOW_SLANT - SDRATTR_START ] = new Svx3DShadowSlantItem;
286 	mppLocalPoolDefaults[ SDRATTR_3DSCENE_SHADE_MODE - SDRATTR_START ] = new Svx3DShadeModeItem;
287 	mppLocalPoolDefaults[ SDRATTR_CUSTOMSHAPE_ENGINE - SDRATTR_START ] = new SdrCustomShapeEngineItem;
288 	mppLocalPoolDefaults[ SDRATTR_CUSTOMSHAPE_DATA - SDRATTR_START ] = new SdrCustomShapeDataItem;
289 	mppLocalPoolDefaults[ SDRATTR_CUSTOMSHAPE_GEOMETRY - SDRATTR_START ] = new SdrCustomShapeGeometryItem;
290 	mppLocalPoolDefaults[ SDRATTR_CUSTOMSHAPE_REPLACEMENT_URL - SDRATTR_START ] = new SdrCustomShapeReplacementURLItem;
291 
292 	SvxBoxItem* pboxItem = new SvxBoxItem( SDRATTR_TABLE_BORDER );
293 	pboxItem->SetDistance( 100 );
294 	mppLocalPoolDefaults[ SDRATTR_TABLE_BORDER - SDRATTR_START ] = pboxItem;
295 
296 	SvxBoxInfoItem* pBoxInfoItem = new SvxBoxInfoItem( SDRATTR_TABLE_BORDER_INNER );
297 
298 	pBoxInfoItem->SetTable( sal_True );
299 	pBoxInfoItem->SetDist( sal_True);        // Abstandsfeld immer anzeigen
300 //	pBoxInfoItem->SetMinDist( sal_True );// Minimalgroesse in Tabellen und Absaetzen setzen
301 //	pBoxInfoItem->SetDefDist( MIN_BORDER_DIST );// Default-Abstand immer setzen
302 	pBoxInfoItem->SetValid( VALID_DISABLE, sal_True ); // Einzelne Linien koennen nur in Tabellen DontCare-Status haben
303 
304 	mppLocalPoolDefaults[ SDRATTR_TABLE_BORDER_INNER - SDRATTR_START ] =  pBoxInfoItem;
305 //	mppLocalPoolDefaults[ SDRATTR_TABLE_BORDER_SHADOW - SDRATTR_START ] = new SvxShadowItem( SDRATTR_TABLE_BORDER_SHADOW );
306     mppLocalPoolDefaults[ SDRATTR_TABLE_BORDER_TLBR - SDRATTR_START ] = new SvxLineItem( SDRATTR_TABLE_BORDER_TLBR );
307     mppLocalPoolDefaults[ SDRATTR_TABLE_BORDER_BLTR - SDRATTR_START ] = new SvxLineItem( SDRATTR_TABLE_BORDER_BLTR );
308 
309 	// set own ItemInfos
310 	mpLocalItemInfos[SDRATTR_SHADOW-SDRATTR_START]._nSID=SID_ATTR_FILL_SHADOW;
311 	mpLocalItemInfos[SDRATTR_TEXT_FITTOSIZE-SDRATTR_START]._nSID=SID_ATTR_TEXT_FITTOSIZE;
312 	mpLocalItemInfos[SDRATTR_GRAFCROP-SDRATTR_START]._nSID=SID_ATTR_GRAF_CROP;
313 
314 	mpLocalItemInfos[SDRATTR_TABLE_BORDER - SDRATTR_START ]._nSID = SID_ATTR_BORDER_OUTER;
315 	mpLocalItemInfos[SDRATTR_TABLE_BORDER_INNER - SDRATTR_START ]._nSID = SID_ATTR_BORDER_INNER;
316 //	mpLocalItemInfos[SDRATTR_TABLE_BORDER_SHADOW - SDRATTR_START ]._nSID = SID_ATTR_BORDER_SHADOW;
317 	mpLocalItemInfos[SDRATTR_TABLE_BORDER_TLBR - SDRATTR_START ]._nSID = SID_ATTR_BORDER_DIAG_TLBR;
318 	mpLocalItemInfos[SDRATTR_TABLE_BORDER_BLTR - SDRATTR_START ]._nSID = SID_ATTR_BORDER_DIAG_BLTR;
319 
320 	// it's my own creation level, set Defaults and ItemInfos
321 	SetDefaults(mppLocalPoolDefaults);
322 	SetItemInfos(mpLocalItemInfos);
323 }
324 
325 /*************************************************************************
326 |*
327 |* copy ctor, sorgt dafuer, dass die static defaults gecloned werden
328 |*            (Parameter 2 = sal_True)
329 |*
330 \************************************************************************/
331 
332 SdrItemPool::SdrItemPool(const SdrItemPool& rPool)
333 :	XOutdevItemPool(rPool)
334 {
335 }
336 
337 /*************************************************************************
338 |*
339 |* Clone()
340 |*
341 \************************************************************************/
342 
343 SfxItemPool* __EXPORT SdrItemPool::Clone() const
344 {
345 	return new SdrItemPool(*this);
346 }
347 
348 /*************************************************************************
349 |*
350 |* Destruktor
351 |*
352 \************************************************************************/
353 
354 SdrItemPool::~SdrItemPool()
355 {
356 	// dtor of SfxItemPool
357 	Delete();
358 
359 	// clear own static Defaults
360 	if(mppLocalPoolDefaults)
361 	{
362 		const sal_uInt16 nBeg(SDRATTR_SHADOW_FIRST - SDRATTR_START);
363 		const sal_uInt16 nEnd2(SDRATTR_END - SDRATTR_START);
364 
365 		for(sal_uInt16 i(nBeg); i <= nEnd2; i++)
366 		{
367 			SetRefCount(*mppLocalPoolDefaults[i],0);
368 			delete mppLocalPoolDefaults[i];
369 			mppLocalPoolDefaults[i] = 0L;
370 		}
371 	}
372 
373 	// split pools before detroying
374 	SetSecondaryPool(NULL);
375 }
376 
377 SfxItemPresentation __EXPORT SdrItemPool::GetPresentation(
378 			  const SfxPoolItem& rItem, SfxItemPresentation ePresentation,
379 			  SfxMapUnit ePresentationMetric, XubString& rText,
380               const IntlWrapper * pIntlWrapper) const
381 {
382 	if (!IsInvalidItem(&rItem)) {
383 		sal_uInt16 nWhich=rItem.Which();
384 		if (nWhich>=SDRATTR_SHADOW_FIRST && nWhich<=SDRATTR_END) {
385 			rItem.GetPresentation(SFX_ITEM_PRESENTATION_NAMELESS,
386 						GetMetric(nWhich),ePresentationMetric,rText,
387                         pIntlWrapper);
388 			String aStr;
389 
390 			TakeItemName(nWhich, aStr);
391 			aStr += sal_Unicode(' ');
392 			rText.Insert(aStr, 0);
393 
394 			return ePresentation;
395 		}
396 	}
397     return XOutdevItemPool::GetPresentation(rItem,ePresentation,ePresentationMetric,rText,pIntlWrapper);
398 }
399 
400 void SdrItemPool::TakeItemName(sal_uInt16 nWhich, String& rItemName)
401 {
402 	ResMgr* pResMgr = ImpGetResMgr();
403 	sal_uInt16	nResId = SIP_UNKNOWN_ATTR;
404 
405 	switch (nWhich)
406 	{
407 		case XATTR_LINESTYLE        : nResId = SIP_XA_LINESTYLE;break;
408 		case XATTR_LINEDASH         : nResId = SIP_XA_LINEDASH;break;
409 		case XATTR_LINEWIDTH        : nResId = SIP_XA_LINEWIDTH;break;
410 		case XATTR_LINECOLOR        : nResId = SIP_XA_LINECOLOR;break;
411 		case XATTR_LINESTART        : nResId = SIP_XA_LINESTART;break;
412 		case XATTR_LINEEND          : nResId = SIP_XA_LINEEND;break;
413 		case XATTR_LINESTARTWIDTH   : nResId = SIP_XA_LINESTARTWIDTH;break;
414 		case XATTR_LINEENDWIDTH     : nResId = SIP_XA_LINEENDWIDTH;break;
415 		case XATTR_LINESTARTCENTER  : nResId = SIP_XA_LINESTARTCENTER;break;
416 		case XATTR_LINEENDCENTER    : nResId = SIP_XA_LINEENDCENTER;break;
417 		case XATTR_LINETRANSPARENCE : nResId = SIP_XA_LINETRANSPARENCE;break;
418 		case XATTR_LINEJOINT		: nResId = SIP_XA_LINEJOINT;break;
419 		case XATTRSET_LINE          : nResId = SIP_XATTRSET_LINE;break;
420 
421 		case XATTR_FILLSTYLE			: nResId = SIP_XA_FILLSTYLE;break;
422 		case XATTR_FILLCOLOR			: nResId = SIP_XA_FILLCOLOR;break;
423 		case XATTR_FILLGRADIENT			: nResId = SIP_XA_FILLGRADIENT;break;
424 		case XATTR_FILLHATCH			: nResId = SIP_XA_FILLHATCH;break;
425 		case XATTR_FILLBITMAP			: nResId = SIP_XA_FILLBITMAP;break;
426 		case XATTR_FILLTRANSPARENCE		: nResId = SIP_XA_FILLTRANSPARENCE;break;
427 		case XATTR_GRADIENTSTEPCOUNT	: nResId = SIP_XA_GRADIENTSTEPCOUNT;break;
428 		case XATTR_FILLBMP_TILE			: nResId = SIP_XA_FILLBMP_TILE;break;
429 		case XATTR_FILLBMP_POS			: nResId = SIP_XA_FILLBMP_POS;break;
430 		case XATTR_FILLBMP_SIZEX		: nResId = SIP_XA_FILLBMP_SIZEX;break;
431 		case XATTR_FILLBMP_SIZEY		: nResId = SIP_XA_FILLBMP_SIZEY;break;
432 		case XATTR_FILLFLOATTRANSPARENCE: nResId = SIP_XA_FILLFLOATTRANSPARENCE;break;
433 		case XATTR_SECONDARYFILLCOLOR	: nResId = SIP_XA_SECONDARYFILLCOLOR;break;
434 		case XATTR_FILLBMP_SIZELOG		: nResId = SIP_XA_FILLBMP_SIZELOG;break;
435 		case XATTR_FILLBMP_TILEOFFSETX	: nResId = SIP_XA_FILLBMP_TILEOFFSETX;break;
436 		case XATTR_FILLBMP_TILEOFFSETY	: nResId = SIP_XA_FILLBMP_TILEOFFSETY;break;
437 		case XATTR_FILLBMP_STRETCH		: nResId = SIP_XA_FILLBMP_STRETCH;break;
438 		case XATTR_FILLBMP_POSOFFSETX	: nResId = SIP_XA_FILLBMP_POSOFFSETX;break;
439 		case XATTR_FILLBMP_POSOFFSETY	: nResId = SIP_XA_FILLBMP_POSOFFSETY;break;
440 		case XATTR_FILLBACKGROUND		: nResId = SIP_XA_FILLBACKGROUND;break;
441 
442 		case XATTRSET_FILL             : nResId = SIP_XATTRSET_FILL;break;
443 
444 		case XATTR_FORMTXTSTYLE     : nResId = SIP_XA_FORMTXTSTYLE;break;
445 		case XATTR_FORMTXTADJUST    : nResId = SIP_XA_FORMTXTADJUST;break;
446 		case XATTR_FORMTXTDISTANCE  : nResId = SIP_XA_FORMTXTDISTANCE;break;
447 		case XATTR_FORMTXTSTART     : nResId = SIP_XA_FORMTXTSTART;break;
448 		case XATTR_FORMTXTMIRROR    : nResId = SIP_XA_FORMTXTMIRROR;break;
449 		case XATTR_FORMTXTOUTLINE   : nResId = SIP_XA_FORMTXTOUTLINE;break;
450 		case XATTR_FORMTXTSHADOW    : nResId = SIP_XA_FORMTXTSHADOW;break;
451 		case XATTR_FORMTXTSHDWCOLOR : nResId = SIP_XA_FORMTXTSHDWCOLOR;break;
452 		case XATTR_FORMTXTSHDWXVAL  : nResId = SIP_XA_FORMTXTSHDWXVAL;break;
453 		case XATTR_FORMTXTSHDWYVAL  : nResId = SIP_XA_FORMTXTSHDWYVAL;break;
454 		case XATTR_FORMTXTSTDFORM   : nResId = SIP_XA_FORMTXTSTDFORM;break;
455 		case XATTR_FORMTXTHIDEFORM  : nResId = SIP_XA_FORMTXTHIDEFORM;break;
456 		case XATTR_FORMTXTSHDWTRANSP: nResId = SIP_XA_FORMTXTSHDWTRANSP;break;
457 
458 		case SDRATTR_SHADOW            : nResId = SIP_SA_SHADOW;break;
459 		case SDRATTR_SHADOWCOLOR       : nResId = SIP_SA_SHADOWCOLOR;break;
460 		case SDRATTR_SHADOWXDIST       : nResId = SIP_SA_SHADOWXDIST;break;
461 		case SDRATTR_SHADOWYDIST       : nResId = SIP_SA_SHADOWYDIST;break;
462 		case SDRATTR_SHADOWTRANSPARENCE: nResId = SIP_SA_SHADOWTRANSPARENCE;break;
463 		case SDRATTR_SHADOW3D          : nResId = SIP_SA_SHADOW3D;break;
464 		case SDRATTR_SHADOWPERSP       : nResId = SIP_SA_SHADOWPERSP;break;
465 
466 		case SDRATTR_CAPTIONTYPE      : nResId = SIP_SA_CAPTIONTYPE;break;
467 		case SDRATTR_CAPTIONFIXEDANGLE: nResId = SIP_SA_CAPTIONFIXEDANGLE;break;
468 		case SDRATTR_CAPTIONANGLE     : nResId = SIP_SA_CAPTIONANGLE;break;
469 		case SDRATTR_CAPTIONGAP       : nResId = SIP_SA_CAPTIONGAP;break;
470 		case SDRATTR_CAPTIONESCDIR    : nResId = SIP_SA_CAPTIONESCDIR;break;
471 		case SDRATTR_CAPTIONESCISREL  : nResId = SIP_SA_CAPTIONESCISREL;break;
472 		case SDRATTR_CAPTIONESCREL    : nResId = SIP_SA_CAPTIONESCREL;break;
473 		case SDRATTR_CAPTIONESCABS    : nResId = SIP_SA_CAPTIONESCABS;break;
474 		case SDRATTR_CAPTIONLINELEN   : nResId = SIP_SA_CAPTIONLINELEN;break;
475 		case SDRATTR_CAPTIONFITLINELEN: nResId = SIP_SA_CAPTIONFITLINELEN;break;
476 
477 		case SDRATTR_ECKENRADIUS			: nResId = SIP_SA_ECKENRADIUS;break;
478 		case SDRATTR_TEXT_MINFRAMEHEIGHT	: nResId = SIP_SA_TEXT_MINFRAMEHEIGHT;break;
479 		case SDRATTR_TEXT_AUTOGROWHEIGHT	: nResId = SIP_SA_TEXT_AUTOGROWHEIGHT;break;
480 		case SDRATTR_TEXT_FITTOSIZE			: nResId = SIP_SA_TEXT_FITTOSIZE;break;
481 		case SDRATTR_TEXT_LEFTDIST			: nResId = SIP_SA_TEXT_LEFTDIST;break;
482 		case SDRATTR_TEXT_RIGHTDIST			: nResId = SIP_SA_TEXT_RIGHTDIST;break;
483 		case SDRATTR_TEXT_UPPERDIST			: nResId = SIP_SA_TEXT_UPPERDIST;break;
484 		case SDRATTR_TEXT_LOWERDIST			: nResId = SIP_SA_TEXT_LOWERDIST;break;
485 		case SDRATTR_TEXT_VERTADJUST		: nResId = SIP_SA_TEXT_VERTADJUST;break;
486 		case SDRATTR_TEXT_MAXFRAMEHEIGHT	: nResId = SIP_SA_TEXT_MAXFRAMEHEIGHT;break;
487 		case SDRATTR_TEXT_MINFRAMEWIDTH		: nResId = SIP_SA_TEXT_MINFRAMEWIDTH;break;
488 		case SDRATTR_TEXT_MAXFRAMEWIDTH		: nResId = SIP_SA_TEXT_MAXFRAMEWIDTH;break;
489 		case SDRATTR_TEXT_AUTOGROWWIDTH		: nResId = SIP_SA_TEXT_AUTOGROWWIDTH;break;
490 		case SDRATTR_TEXT_HORZADJUST		: nResId = SIP_SA_TEXT_HORZADJUST;break;
491 		case SDRATTR_TEXT_ANIKIND			: nResId = SIP_SA_TEXT_ANIKIND;break;
492 		case SDRATTR_TEXT_ANIDIRECTION		: nResId = SIP_SA_TEXT_ANIDIRECTION;break;
493 		case SDRATTR_TEXT_ANISTARTINSIDE	: nResId = SIP_SA_TEXT_ANISTARTINSIDE;break;
494 		case SDRATTR_TEXT_ANISTOPINSIDE		: nResId = SIP_SA_TEXT_ANISTOPINSIDE;break;
495 		case SDRATTR_TEXT_ANICOUNT			: nResId = SIP_SA_TEXT_ANICOUNT;break;
496 		case SDRATTR_TEXT_ANIDELAY			: nResId = SIP_SA_TEXT_ANIDELAY;break;
497 		case SDRATTR_TEXT_ANIAMOUNT			: nResId = SIP_SA_TEXT_ANIAMOUNT;break;
498 		case SDRATTR_TEXT_CONTOURFRAME		: nResId = SIP_SA_TEXT_CONTOURFRAME;break;
499 		case SDRATTR_CUSTOMSHAPE_ADJUSTMENT	: nResId = SIP_SA_CUSTOMSHAPE_ADJUSTMENT;break;
500 		case SDRATTR_XMLATTRIBUTES			: nResId = SIP_SA_XMLATTRIBUTES;break;
501 		case SDRATTR_TEXT_USEFIXEDCELLHEIGHT: nResId = SIP_SA_TEXT_USEFIXEDCELLHEIGHT;break;
502 		case SDRATTR_TEXT_WORDWRAP			: nResId = SIP_SA_WORDWRAP;break;
503 		case SDRATTR_TEXT_AUTOGROWSIZE		: nResId = SIP_SA_AUTOGROWSIZE;break;
504 
505 		case SDRATTR_EDGEKIND           : nResId = SIP_SA_EDGEKIND;break;
506 		case SDRATTR_EDGENODE1HORZDIST  : nResId = SIP_SA_EDGENODE1HORZDIST;break;
507 		case SDRATTR_EDGENODE1VERTDIST  : nResId = SIP_SA_EDGENODE1VERTDIST;break;
508 		case SDRATTR_EDGENODE2HORZDIST  : nResId = SIP_SA_EDGENODE2HORZDIST;break;
509 		case SDRATTR_EDGENODE2VERTDIST  : nResId = SIP_SA_EDGENODE2VERTDIST;break;
510 		case SDRATTR_EDGENODE1GLUEDIST  : nResId = SIP_SA_EDGENODE1GLUEDIST;break;
511 		case SDRATTR_EDGENODE2GLUEDIST  : nResId = SIP_SA_EDGENODE2GLUEDIST;break;
512 		case SDRATTR_EDGELINEDELTAANZ   : nResId = SIP_SA_EDGELINEDELTAANZ;break;
513 		case SDRATTR_EDGELINE1DELTA     : nResId = SIP_SA_EDGELINE1DELTA;break;
514 		case SDRATTR_EDGELINE2DELTA     : nResId = SIP_SA_EDGELINE2DELTA;break;
515 		case SDRATTR_EDGELINE3DELTA     : nResId = SIP_SA_EDGELINE3DELTA;break;
516 
517 		case SDRATTR_MEASUREKIND             : nResId = SIP_SA_MEASUREKIND;break;
518 		case SDRATTR_MEASURETEXTHPOS         : nResId = SIP_SA_MEASURETEXTHPOS;break;
519 		case SDRATTR_MEASURETEXTVPOS         : nResId = SIP_SA_MEASURETEXTVPOS;break;
520 		case SDRATTR_MEASURELINEDIST         : nResId = SIP_SA_MEASURELINEDIST;break;
521 		case SDRATTR_MEASUREHELPLINEOVERHANG : nResId = SIP_SA_MEASUREHELPLINEOVERHANG;break;
522 		case SDRATTR_MEASUREHELPLINEDIST     : nResId = SIP_SA_MEASUREHELPLINEDIST;break;
523 		case SDRATTR_MEASUREHELPLINE1LEN     : nResId = SIP_SA_MEASUREHELPLINE1LEN;break;
524 		case SDRATTR_MEASUREHELPLINE2LEN     : nResId = SIP_SA_MEASUREHELPLINE2LEN;break;
525 		case SDRATTR_MEASUREBELOWREFEDGE     : nResId = SIP_SA_MEASUREBELOWREFEDGE;break;
526 		case SDRATTR_MEASURETEXTROTA90       : nResId = SIP_SA_MEASURETEXTROTA90;break;
527 		case SDRATTR_MEASURETEXTUPSIDEDOWN   : nResId = SIP_SA_MEASURETEXTUPSIDEDOWN;break;
528 		case SDRATTR_MEASUREOVERHANG         : nResId = SIP_SA_MEASUREOVERHANG;break;
529 		case SDRATTR_MEASUREUNIT             : nResId = SIP_SA_MEASUREUNIT;break;
530 		case SDRATTR_MEASURESCALE            : nResId = SIP_SA_MEASURESCALE;break;
531 		case SDRATTR_MEASURESHOWUNIT         : nResId = SIP_SA_MEASURESHOWUNIT;break;
532 		case SDRATTR_MEASUREFORMATSTRING     : nResId = SIP_SA_MEASUREFORMATSTRING;break;
533 		case SDRATTR_MEASURETEXTAUTOANGLE    : nResId = SIP_SA_MEASURETEXTAUTOANGLE;break;
534 		case SDRATTR_MEASURETEXTAUTOANGLEVIEW: nResId = SIP_SA_MEASURETEXTAUTOANGLEVIEW;break;
535 		case SDRATTR_MEASURETEXTISFIXEDANGLE : nResId = SIP_SA_MEASURETEXTISFIXEDANGLE;break;
536 		case SDRATTR_MEASURETEXTFIXEDANGLE   : nResId = SIP_SA_MEASURETEXTFIXEDANGLE;break;
537 		case SDRATTR_MEASUREDECIMALPLACES    : nResId = SIP_SA_MEASUREDECIMALPLACES;break;
538 
539 		case SDRATTR_CIRCKIND      : nResId = SIP_SA_CIRCKIND;break;
540 		case SDRATTR_CIRCSTARTANGLE: nResId = SIP_SA_CIRCSTARTANGLE;break;
541 		case SDRATTR_CIRCENDANGLE  : nResId = SIP_SA_CIRCENDANGLE;break;
542 
543 		case SDRATTR_OBJMOVEPROTECT : nResId = SIP_SA_OBJMOVEPROTECT;break;
544 		case SDRATTR_OBJSIZEPROTECT : nResId = SIP_SA_OBJSIZEPROTECT;break;
545 		case SDRATTR_OBJPRINTABLE   : nResId = SIP_SA_OBJPRINTABLE;break;
546 		case SDRATTR_OBJVISIBLE		: nResId = SIP_SA_OBJVISIBLE;break;
547 		case SDRATTR_LAYERID        : nResId = SIP_SA_LAYERID;break;
548 		case SDRATTR_LAYERNAME      : nResId = SIP_SA_LAYERNAME;break;
549 		case SDRATTR_OBJECTNAME     : nResId = SIP_SA_OBJECTNAME;break;
550 		case SDRATTR_ALLPOSITIONX   : nResId = SIP_SA_ALLPOSITIONX;break;
551 		case SDRATTR_ALLPOSITIONY   : nResId = SIP_SA_ALLPOSITIONY;break;
552 		case SDRATTR_ALLSIZEWIDTH   : nResId = SIP_SA_ALLSIZEWIDTH;break;
553 		case SDRATTR_ALLSIZEHEIGHT  : nResId = SIP_SA_ALLSIZEHEIGHT;break;
554 		case SDRATTR_ONEPOSITIONX   : nResId = SIP_SA_ONEPOSITIONX;break;
555 		case SDRATTR_ONEPOSITIONY   : nResId = SIP_SA_ONEPOSITIONY;break;
556 		case SDRATTR_ONESIZEWIDTH   : nResId = SIP_SA_ONESIZEWIDTH;break;
557 		case SDRATTR_ONESIZEHEIGHT  : nResId = SIP_SA_ONESIZEHEIGHT;break;
558 		case SDRATTR_LOGICSIZEWIDTH : nResId = SIP_SA_LOGICSIZEWIDTH;break;
559 		case SDRATTR_LOGICSIZEHEIGHT: nResId = SIP_SA_LOGICSIZEHEIGHT;break;
560 		case SDRATTR_ROTATEANGLE    : nResId = SIP_SA_ROTATEANGLE;break;
561 		case SDRATTR_SHEARANGLE     : nResId = SIP_SA_SHEARANGLE;break;
562 		case SDRATTR_MOVEX          : nResId = SIP_SA_MOVEX;break;
563 		case SDRATTR_MOVEY          : nResId = SIP_SA_MOVEY;break;
564 		case SDRATTR_RESIZEXONE     : nResId = SIP_SA_RESIZEXONE;break;
565 		case SDRATTR_RESIZEYONE     : nResId = SIP_SA_RESIZEYONE;break;
566 		case SDRATTR_ROTATEONE      : nResId = SIP_SA_ROTATEONE;break;
567 		case SDRATTR_HORZSHEARONE   : nResId = SIP_SA_HORZSHEARONE;break;
568 		case SDRATTR_VERTSHEARONE   : nResId = SIP_SA_VERTSHEARONE;break;
569 		case SDRATTR_RESIZEXALL     : nResId = SIP_SA_RESIZEXALL;break;
570 		case SDRATTR_RESIZEYALL     : nResId = SIP_SA_RESIZEYALL;break;
571 		case SDRATTR_ROTATEALL      : nResId = SIP_SA_ROTATEALL;break;
572 		case SDRATTR_HORZSHEARALL   : nResId = SIP_SA_HORZSHEARALL;break;
573 		case SDRATTR_VERTSHEARALL   : nResId = SIP_SA_VERTSHEARALL;break;
574 		case SDRATTR_TRANSFORMREF1X : nResId = SIP_SA_TRANSFORMREF1X;break;
575 		case SDRATTR_TRANSFORMREF1Y : nResId = SIP_SA_TRANSFORMREF1Y;break;
576 		case SDRATTR_TRANSFORMREF2X : nResId = SIP_SA_TRANSFORMREF2X;break;
577 		case SDRATTR_TRANSFORMREF2Y : nResId = SIP_SA_TRANSFORMREF2Y;break;
578 
579 		case SDRATTR_GRAFRED			: nResId = SIP_SA_GRAFRED;break;
580 		case SDRATTR_GRAFGREEN			: nResId = SIP_SA_GRAFGREEN;break;
581 		case SDRATTR_GRAFBLUE			: nResId = SIP_SA_GRAFBLUE;break;
582 		case SDRATTR_GRAFLUMINANCE		: nResId = SIP_SA_GRAFLUMINANCE;break;
583 		case SDRATTR_GRAFCONTRAST		: nResId = SIP_SA_GRAFCONTRAST;break;
584 		case SDRATTR_GRAFGAMMA			: nResId = SIP_SA_GRAFGAMMA;break;
585 		case SDRATTR_GRAFTRANSPARENCE	: nResId = SIP_SA_GRAFTRANSPARENCE;break;
586 		case SDRATTR_GRAFINVERT 		: nResId = SIP_SA_GRAFINVERT;break;
587 		case SDRATTR_GRAFMODE			: nResId = SIP_SA_GRAFMODE;break;
588 		case SDRATTR_GRAFCROP			: nResId = SIP_SA_GRAFCROP;break;
589 
590 		case EE_PARA_HYPHENATE  : nResId = SIP_EE_PARA_HYPHENATE;break;
591 		case EE_PARA_BULLETSTATE: nResId = SIP_EE_PARA_BULLETSTATE;break;
592 		case EE_PARA_OUTLLRSPACE: nResId = SIP_EE_PARA_OUTLLRSPACE;break;
593 		case EE_PARA_OUTLLEVEL  : nResId = SIP_EE_PARA_OUTLLEVEL;break;
594 		case EE_PARA_BULLET     : nResId = SIP_EE_PARA_BULLET;break;
595 		case EE_PARA_LRSPACE    : nResId = SIP_EE_PARA_LRSPACE;break;
596 		case EE_PARA_ULSPACE    : nResId = SIP_EE_PARA_ULSPACE;break;
597 		case EE_PARA_SBL        : nResId = SIP_EE_PARA_SBL;break;
598 		case EE_PARA_JUST       : nResId = SIP_EE_PARA_JUST;break;
599 		case EE_PARA_TABS       : nResId = SIP_EE_PARA_TABS;break;
600 
601 		case EE_CHAR_COLOR      : nResId = SIP_EE_CHAR_COLOR;break;
602 		case EE_CHAR_FONTINFO   : nResId = SIP_EE_CHAR_FONTINFO;break;
603 		case EE_CHAR_FONTHEIGHT : nResId = SIP_EE_CHAR_FONTHEIGHT;break;
604 		case EE_CHAR_FONTWIDTH  : nResId = SIP_EE_CHAR_FONTWIDTH;break;
605 		case EE_CHAR_WEIGHT     : nResId = SIP_EE_CHAR_WEIGHT;break;
606 		case EE_CHAR_UNDERLINE  : nResId = SIP_EE_CHAR_UNDERLINE;break;
607 		case EE_CHAR_OVERLINE   : nResId = SIP_EE_CHAR_OVERLINE;break;
608 		case EE_CHAR_STRIKEOUT  : nResId = SIP_EE_CHAR_STRIKEOUT;break;
609 		case EE_CHAR_ITALIC     : nResId = SIP_EE_CHAR_ITALIC;break;
610 		case EE_CHAR_OUTLINE    : nResId = SIP_EE_CHAR_OUTLINE;break;
611 		case EE_CHAR_SHADOW     : nResId = SIP_EE_CHAR_SHADOW;break;
612 		case EE_CHAR_ESCAPEMENT : nResId = SIP_EE_CHAR_ESCAPEMENT;break;
613 		case EE_CHAR_PAIRKERNING: nResId = SIP_EE_CHAR_PAIRKERNING;break;
614 		case EE_CHAR_KERNING    : nResId = SIP_EE_CHAR_KERNING;break;
615 		case EE_CHAR_WLM        : nResId = SIP_EE_CHAR_WLM;break;
616 		case EE_FEATURE_TAB     : nResId = SIP_EE_FEATURE_TAB;break;
617 		case EE_FEATURE_LINEBR  : nResId = SIP_EE_FEATURE_LINEBR;break;
618 		case EE_FEATURE_NOTCONV : nResId = SIP_EE_FEATURE_NOTCONV;break;
619 		case EE_FEATURE_FIELD   : nResId = SIP_EE_FEATURE_FIELD;break;
620 	} // switch
621 
622 	rItemName = String( ResId( nResId, *pResMgr ) );
623 }
624 
625 ////////////////////////////////////////////////////////////////////////////////
626 // FractionItem
627 ////////////////////////////////////////////////////////////////////////////////
628 
629 TYPEINIT1_AUTOFACTORY(SdrFractionItem,SfxPoolItem);
630 
631 SdrFractionItem::SdrFractionItem(sal_uInt16 nId, SvStream& rIn):
632 	SfxPoolItem(nId)
633 {
634 	sal_Int32 nMul,nDiv;
635 	rIn>>nMul;
636 	rIn>>nDiv;
637 	nValue=Fraction(nMul,nDiv);
638 }
639 
640 int __EXPORT SdrFractionItem::operator==(const SfxPoolItem& rCmp) const
641 {
642 	return SfxPoolItem::operator==(rCmp) &&
643 		   ((SdrFractionItem&)rCmp).GetValue()==nValue;
644 }
645 
646 SfxItemPresentation __EXPORT SdrFractionItem::GetPresentation(
647 	SfxItemPresentation ePresentation, SfxMapUnit /*eCoreMetric*/,
648     SfxMapUnit /*ePresentationMetric*/, XubString &rText, const IntlWrapper *) const
649 {
650 	if(nValue.IsValid())
651 	{
652 		sal_Int32 nDiv = nValue.GetDenominator();
653 		rText = UniString::CreateFromInt32(nValue.GetNumerator());
654 
655 		if(nDiv != 1)
656 		{
657 			rText += sal_Unicode('/');
658 			rText += UniString::CreateFromInt32(nDiv);
659 		}
660 	}
661 	else
662 	{
663 		rText = UniString();
664 		rText += sal_Unicode('?');
665 	}
666 
667 	if(ePresentation == SFX_ITEM_PRESENTATION_COMPLETE)
668 	{
669 		XubString aStr;
670 
671 		SdrItemPool::TakeItemName(Which(), aStr);
672 		aStr += sal_Unicode(' ');
673 		rText.Insert(aStr, 0);
674 	}
675 
676 	return ePresentation;
677 }
678 
679 SfxPoolItem* __EXPORT SdrFractionItem::Create(SvStream& rIn, sal_uInt16 /*nVer*/) const
680 {
681 	return new SdrFractionItem(Which(),rIn);
682 }
683 
684 SvStream& __EXPORT SdrFractionItem::Store(SvStream& rOut, sal_uInt16 /*nItemVers*/) const
685 {
686 	rOut<<sal_Int32(nValue.GetNumerator());
687 	rOut<<sal_Int32(nValue.GetDenominator());
688 	return rOut;
689 }
690 
691 SfxPoolItem* __EXPORT SdrFractionItem::Clone(SfxItemPool * /*pPool*/) const
692 {
693 	return new SdrFractionItem(Which(),GetValue());
694 }
695 
696 #ifdef SDR_ISPOOLABLE
697 int __EXPORT SdrFractionItem::IsPoolable() const
698 {
699 	sal_uInt16 nId=Which();
700 	return nId<SDRATTR_NOTPERSIST_FIRST || nId>SDRATTR_NOTPERSIST_LAST;
701 }
702 #endif
703 
704 ////////////////////////////////////////////////////////////////////////////////
705 // ScaleItem
706 ////////////////////////////////////////////////////////////////////////////////
707 
708 TYPEINIT1_AUTOFACTORY(SdrScaleItem,SdrFractionItem);
709 
710 SfxItemPresentation __EXPORT SdrScaleItem::GetPresentation(
711 	SfxItemPresentation ePresentation, SfxMapUnit /*eCoreMetric*/,
712     SfxMapUnit /*ePresentationMetric*/, XubString &rText, const IntlWrapper *) const
713 {
714 	if(GetValue().IsValid())
715 	{
716 		sal_Int32 nDiv = GetValue().GetDenominator();
717 
718 		rText = UniString::CreateFromInt32(GetValue().GetNumerator());
719 		rText += sal_Unicode(':');
720 		rText += UniString::CreateFromInt32(nDiv);
721 	}
722 	else
723 	{
724 		rText = UniString();
725 		rText += sal_Unicode('?');
726 	}
727 
728 	if(ePresentation == SFX_ITEM_PRESENTATION_COMPLETE)
729 	{
730 		XubString aStr;
731 
732 		SdrItemPool::TakeItemName(Which(), aStr);
733 		aStr += sal_Unicode(' ');
734 		rText.Insert(aStr, 0);
735 	}
736 
737 	return ePresentation;
738 }
739 
740 SfxPoolItem* __EXPORT SdrScaleItem::Create(SvStream& rIn, sal_uInt16 /*nVer*/) const
741 {
742 	return new SdrScaleItem(Which(),rIn);
743 }
744 
745 SfxPoolItem* __EXPORT SdrScaleItem::Clone(SfxItemPool * /*pPool*/) const
746 {
747 	return new SdrScaleItem(Which(),GetValue());
748 }
749 
750 ////////////////////////////////////////////////////////////////////////////////
751 // OnOffItem
752 ////////////////////////////////////////////////////////////////////////////////
753 
754 TYPEINIT1_AUTOFACTORY(SdrOnOffItem,SfxBoolItem);
755 
756 SfxPoolItem* __EXPORT SdrOnOffItem::Clone(SfxItemPool* /*pPool*/) const
757 {
758 	return new SdrOnOffItem(Which(),GetValue());
759 }
760 
761 SfxPoolItem* __EXPORT SdrOnOffItem::Create(SvStream& rIn, sal_uInt16 /*nVer*/) const
762 {
763 	return new SdrOnOffItem(Which(),rIn);
764 }
765 
766 XubString __EXPORT SdrOnOffItem::GetValueTextByVal(sal_Bool bVal) const
767 {
768 	if (bVal) return ImpGetResStr(STR_ItemValON);
769 	else return ImpGetResStr(STR_ItemValOFF);
770 }
771 
772 SfxItemPresentation __EXPORT SdrOnOffItem::GetPresentation(SfxItemPresentation ePres,
773                       SfxMapUnit /*eCoreMetric*/, SfxMapUnit /*ePresMetric*/, XubString& rText, const IntlWrapper *) const
774 {
775 	rText=GetValueTextByVal(GetValue());
776 	if (ePres==SFX_ITEM_PRESENTATION_COMPLETE) {
777 		String aStr;
778 
779 		SdrItemPool::TakeItemName(Which(), aStr);
780 		aStr += sal_Unicode(' ');
781 		rText.Insert(aStr, 0);
782 	}
783 	return ePres;
784 }
785 
786 #ifdef SDR_ISPOOLABLE
787 int __EXPORT SdrOnOffItem::IsPoolable() const
788 {
789 	sal_uInt16 nId=Which();
790 	return nId<SDRATTR_NOTPERSIST_FIRST || nId>SDRATTR_NOTPERSIST_LAST;
791 }
792 #endif
793 
794 TYPEINIT1_AUTOFACTORY(SdrYesNoItem,SfxBoolItem);
795 
796 SfxPoolItem* __EXPORT SdrYesNoItem::Clone(SfxItemPool* /*pPool*/) const
797 {
798 	return new SdrYesNoItem(Which(),GetValue());
799 }
800 
801 SfxPoolItem* __EXPORT SdrYesNoItem::Create(SvStream& rIn, sal_uInt16 /*nVer*/) const
802 {
803 	return new SdrYesNoItem(Which(),rIn);
804 }
805 
806 XubString __EXPORT SdrYesNoItem::GetValueTextByVal(sal_Bool bVal) const
807 {
808 	if (bVal) return ImpGetResStr(STR_ItemValYES);
809 	else return ImpGetResStr(STR_ItemValNO);
810 }
811 
812 SfxItemPresentation __EXPORT SdrYesNoItem::GetPresentation(SfxItemPresentation ePres,
813                       SfxMapUnit /*eCoreMetric*/, SfxMapUnit /*ePresMetric*/, XubString& rText, const IntlWrapper *) const
814 {
815 	rText=GetValueTextByVal(GetValue());
816 	if (ePres==SFX_ITEM_PRESENTATION_COMPLETE) {
817 		String aStr;
818 
819 		SdrItemPool::TakeItemName(Which(), aStr);
820 		aStr += sal_Unicode(' ');
821 		rText.Insert(aStr, 0);
822 	}
823 	return ePres;
824 }
825 
826 #ifdef SDR_ISPOOLABLE
827 int __EXPORT SdrYesNoItem::IsPoolable() const
828 {
829 	sal_uInt16 nId=Which();
830 	return nId<SDRATTR_NOTPERSIST_FIRST || nId>SDRATTR_NOTPERSIST_LAST;
831 }
832 #endif
833 
834 //------------------------------------------------------------
835 // class SdrPercentItem
836 //------------------------------------------------------------
837 
838 TYPEINIT1_AUTOFACTORY(SdrPercentItem,SfxUInt16Item);
839 
840 SfxPoolItem* __EXPORT SdrPercentItem::Clone(SfxItemPool* /*pPool*/) const
841 {
842 	return new SdrPercentItem(Which(),GetValue());
843 }
844 
845 SfxPoolItem* __EXPORT SdrPercentItem::Create(SvStream& rIn, sal_uInt16 /*nVer*/) const
846 {
847 	return new SdrPercentItem(Which(),rIn);
848 }
849 
850 SfxItemPresentation __EXPORT SdrPercentItem::GetPresentation(
851 	SfxItemPresentation ePres, SfxMapUnit /*eCoreMetric*/,
852     SfxMapUnit /*ePresMetric*/, XubString& rText, const IntlWrapper *) const
853 {
854 	rText = UniString::CreateFromInt32(GetValue());
855 	rText += sal_Unicode('%');
856 
857 	if(ePres == SFX_ITEM_PRESENTATION_COMPLETE)
858 	{
859 		XubString aStr;
860 
861 		SdrItemPool::TakeItemName(Which(), aStr);
862 		aStr += sal_Unicode(' ');
863 		rText.Insert(aStr, 0);
864 	}
865 
866 	return ePres;
867 }
868 
869 #ifdef SDR_ISPOOLABLE
870 int __EXPORT SdrPercentItem::IsPoolable() const
871 {
872 	sal_uInt16 nId=Which();
873 	return nId<SDRATTR_NOTPERSIST_FIRST || nId>SDRATTR_NOTPERSIST_LAST;
874 }
875 #endif
876 
877 //------------------------------------------------------------
878 // class SdrAngleItem
879 //------------------------------------------------------------
880 
881 TYPEINIT1_AUTOFACTORY(SdrAngleItem,SfxInt32Item);
882 
883 SfxPoolItem* __EXPORT SdrAngleItem::Clone(SfxItemPool* /*pPool*/) const
884 {
885 	return new SdrAngleItem(Which(),GetValue());
886 }
887 
888 SfxPoolItem* __EXPORT SdrAngleItem::Create(SvStream& rIn, sal_uInt16 /*nVer*/) const
889 {
890 	return new SdrAngleItem(Which(),rIn);
891 }
892 
893 SfxItemPresentation __EXPORT SdrAngleItem::GetPresentation(
894 	SfxItemPresentation ePres, SfxMapUnit /*eCoreMetric*/, SfxMapUnit /*ePresMetric*/,
895     XubString& rText, const IntlWrapper * pIntlWrapper) const
896 {
897 	sal_Int32 nValue(GetValue());
898 	sal_Bool bNeg(nValue < 0);
899 
900 	if(bNeg)
901 		nValue = -nValue;
902 
903 	rText = UniString::CreateFromInt32(nValue);
904 
905 	if(nValue)
906 	{
907 		sal_Unicode aUnicodeNull('0');
908 		xub_StrLen nAnz(2);
909 
910         const IntlWrapper* pMyIntlWrapper = NULL;
911 //        DBG_ASSERT( pIntlWrapper, "SdrAngleItem::GetPresentation: using default App-IntlWrapper" );
912         if(!pIntlWrapper)
913             pIntlWrapper = pMyIntlWrapper = new IntlWrapper(
914                 ::comphelper::getProcessServiceFactory(),
915                 Application::GetSettings().GetLanguage() );
916 
917         if(pIntlWrapper->getLocaleData()->isNumLeadingZero())
918 			nAnz++;
919 
920 		while(rText.Len() < nAnz)
921 			rText.Insert(aUnicodeNull, 0);
922 
923 		xub_StrLen nLen = rText.Len();
924 		sal_Bool bNull1(rText.GetChar(nLen-1) == aUnicodeNull);
925 		sal_Bool bNull2(bNull1 && rText.GetChar(nLen-2) == aUnicodeNull);
926 
927 		if(bNull2)
928 		{
929 			// keine Nachkommastellen
930 			rText.Erase(nLen-2);
931 		}
932 		else
933 		{
934             sal_Unicode cDec =
935                 pIntlWrapper->getLocaleData()->getNumDecimalSep().GetChar(0);
936 			rText.Insert(cDec, nLen-2);
937 
938 			if(bNull1)
939 				rText.Erase(nLen);
940 		}
941 
942 		if(bNeg)
943 			rText.Insert(sal_Unicode('-'), 0);
944 
945         if ( pMyIntlWrapper )
946         {
947             delete pMyIntlWrapper;
948             pIntlWrapper = NULL;
949         }
950 	}
951 
952 	rText += sal_Unicode(DEGREE_CHAR);
953 
954 	if(ePres == SFX_ITEM_PRESENTATION_COMPLETE)
955 	{
956 		XubString aStr;
957 
958 		SdrItemPool::TakeItemName(Which(), aStr);
959 		aStr += sal_Unicode(' ');
960 		rText.Insert(aStr, 0);
961 	}
962 
963 	return ePres;
964 }
965 
966 #ifdef SDR_ISPOOLABLE
967 int __EXPORT SdrAngleItem::IsPoolable() const
968 {
969 	sal_uInt16 nId=Which();
970 	return nId<SDRATTR_NOTPERSIST_FIRST || nId>SDRATTR_NOTPERSIST_LAST;
971 }
972 #endif
973 
974 //------------------------------------------------------------
975 // class SdrMetricItem
976 //------------------------------------------------------------
977 
978 TYPEINIT1_AUTOFACTORY(SdrMetricItem,SfxInt32Item);
979 
980 SfxPoolItem* __EXPORT SdrMetricItem::Clone(SfxItemPool* /*pPool*/) const
981 {
982 	return new SdrMetricItem(Which(),GetValue());
983 }
984 
985 SfxPoolItem* __EXPORT SdrMetricItem::Create(SvStream& rIn, sal_uInt16 /*nVer*/) const
986 {
987 	return new SdrMetricItem(Which(),rIn);
988 }
989 
990 FASTBOOL __EXPORT SdrMetricItem::HasMetrics() const
991 {
992 	return sal_True;
993 }
994 
995 FASTBOOL __EXPORT SdrMetricItem::ScaleMetrics(long nMul, long nDiv)
996 {
997 	if (GetValue()!=0) {
998 		BigInt aVal(GetValue());
999 		aVal*=nMul;
1000 		aVal+=nDiv/2; // fuer korrektes Runden
1001 		aVal/=nDiv;
1002 		SetValue(long(aVal));
1003 	}
1004 	return sal_True;
1005 }
1006 
1007 SfxItemPresentation __EXPORT SdrMetricItem::GetPresentation(SfxItemPresentation ePres,
1008                       SfxMapUnit eCoreMetric, SfxMapUnit ePresMetric, XubString& rText, const IntlWrapper *) const
1009 {
1010 	long nValue=GetValue();
1011 	SdrFormatter aFmt((MapUnit)eCoreMetric,(MapUnit)ePresMetric);
1012 	aFmt.TakeStr(nValue,rText);
1013 	String aStr;
1014 	aFmt.TakeUnitStr((MapUnit)ePresMetric,aStr);
1015 	rText+=aStr;
1016 	if (ePres==SFX_ITEM_PRESENTATION_COMPLETE) {
1017 		String aStr2;
1018 
1019 		SdrItemPool::TakeItemName(Which(), aStr2);
1020 		aStr2 += sal_Unicode(' ');
1021 		rText.Insert(aStr2, 0);
1022 	}
1023 	return ePres;
1024 }
1025 
1026 #ifdef SDR_ISPOOLABLE
1027 int __EXPORT SdrMetricItem::IsPoolable() const
1028 {
1029 	sal_uInt16 nId=Which();
1030 	return nId<SDRATTR_NOTPERSIST_FIRST || nId>SDRATTR_NOTPERSIST_LAST;
1031 }
1032 #endif
1033 
1034 ////////////////////////////////////////////////////////////////////////////////
1035 // Items des Legendenobjekts
1036 ////////////////////////////////////////////////////////////////////////////////
1037 
1038 TYPEINIT1_AUTOFACTORY(SdrCaptionTypeItem,SfxEnumItem);
1039 
1040 SfxPoolItem* __EXPORT SdrCaptionTypeItem::Clone(SfxItemPool* /*pPool*/) const                { return new SdrCaptionTypeItem(*this); }
1041 
1042 SfxPoolItem* __EXPORT SdrCaptionTypeItem::Create(SvStream& rIn, sal_uInt16 /*nVer*/) const       { return new SdrCaptionTypeItem(rIn); }
1043 
1044 sal_uInt16 __EXPORT SdrCaptionTypeItem::GetValueCount() const { return 4; }
1045 
1046 XubString __EXPORT SdrCaptionTypeItem::GetValueTextByPos(sal_uInt16 nPos) const
1047 {
1048 	return ImpGetResStr(STR_ItemValCAPTIONTYPE1+nPos);
1049 }
1050 
1051 SfxItemPresentation __EXPORT SdrCaptionTypeItem::GetPresentation(SfxItemPresentation ePres,
1052                       SfxMapUnit /*eCoreMetric*/, SfxMapUnit /*ePresMetric*/, XubString& rText, const IntlWrapper *) const
1053 {
1054 	rText=GetValueTextByPos(sal::static_int_cast< sal_uInt16 >(GetValue()));
1055 	if (ePres==SFX_ITEM_PRESENTATION_COMPLETE) {
1056 		String aStr;
1057 
1058 		SdrItemPool::TakeItemName(Which(), aStr);
1059 		aStr += sal_Unicode(' ');
1060 		rText.Insert(aStr, 0);
1061 	}
1062 	return ePres;
1063 }
1064 
1065 TYPEINIT1_AUTOFACTORY(SdrCaptionEscDirItem,SfxEnumItem);
1066 
1067 SfxPoolItem* __EXPORT SdrCaptionEscDirItem::Clone(SfxItemPool* /*pPool*/) const              { return new SdrCaptionEscDirItem(*this); }
1068 
1069 SfxPoolItem* __EXPORT SdrCaptionEscDirItem::Create(SvStream& rIn, sal_uInt16 /*nVer*/) const     { return new SdrCaptionEscDirItem(rIn); }
1070 
1071 sal_uInt16 __EXPORT SdrCaptionEscDirItem::GetValueCount() const { return 3; }
1072 
1073 XubString __EXPORT SdrCaptionEscDirItem::GetValueTextByPos(sal_uInt16 nPos) const
1074 {
1075 	return ImpGetResStr(STR_ItemValCAPTIONESCHORI+nPos);
1076 }
1077 
1078 SfxItemPresentation __EXPORT SdrCaptionEscDirItem::GetPresentation(SfxItemPresentation ePres,
1079                       SfxMapUnit /*eCoreMetric*/, SfxMapUnit /*ePresMetric*/, XubString& rText, const IntlWrapper *) const
1080 {
1081 	rText=GetValueTextByPos(sal::static_int_cast< sal_uInt16 >(GetValue()));
1082 	if (ePres==SFX_ITEM_PRESENTATION_COMPLETE) {
1083 		String aStr;
1084 
1085 		SdrItemPool::TakeItemName(Which(), aStr);
1086 		aStr += sal_Unicode(' ');
1087 		rText.Insert(aStr, 0);
1088 	}
1089 	return ePres;
1090 }
1091 
1092 ////////////////////////////////////////////////////////////////////////////////
1093 // MiscItems
1094 ////////////////////////////////////////////////////////////////////////////////
1095 
1096 // FitToSize
1097 TYPEINIT1_AUTOFACTORY(SdrTextFitToSizeTypeItem,SfxEnumItem);
1098 
1099 SfxPoolItem* __EXPORT SdrTextFitToSizeTypeItem::Clone(SfxItemPool* /*pPool*/) const         { return new SdrTextFitToSizeTypeItem(*this); }
1100 
1101 SfxPoolItem* __EXPORT SdrTextFitToSizeTypeItem::Create(SvStream& rIn, sal_uInt16 /*nVer*/) const { return new SdrTextFitToSizeTypeItem(rIn); }
1102 
1103 sal_uInt16 __EXPORT SdrTextFitToSizeTypeItem::GetValueCount() const { return 4; }
1104 
1105 XubString __EXPORT SdrTextFitToSizeTypeItem::GetValueTextByPos(sal_uInt16 nPos) const
1106 {
1107 	return ImpGetResStr(STR_ItemValFITTOSIZENONE+nPos);
1108 }
1109 
1110 SfxItemPresentation __EXPORT SdrTextFitToSizeTypeItem::GetPresentation(SfxItemPresentation ePres,
1111                       SfxMapUnit /*eCoreMetric*/, SfxMapUnit /*ePresMetric*/, XubString& rText, const IntlWrapper *) const
1112 {
1113 	rText=GetValueTextByPos(sal::static_int_cast< sal_uInt16 >(GetValue()));
1114 	if (ePres==SFX_ITEM_PRESENTATION_COMPLETE) {
1115 		String aStr;
1116 
1117 		SdrItemPool::TakeItemName(Which(), aStr);
1118 		aStr += sal_Unicode(' ');
1119 		rText.Insert(aStr, 0);
1120 	}
1121 	return ePres;
1122 }
1123 
1124 int  __EXPORT SdrTextFitToSizeTypeItem::HasBoolValue() const { return sal_True; }
1125 
1126 sal_Bool __EXPORT SdrTextFitToSizeTypeItem::GetBoolValue() const { return GetValue()!=SDRTEXTFIT_NONE; }
1127 
1128 void __EXPORT SdrTextFitToSizeTypeItem::SetBoolValue(sal_Bool bVal) { SetValue(sal::static_int_cast< sal_uInt16 >(bVal ? SDRTEXTFIT_PROPORTIONAL : SDRTEXTFIT_NONE)); }
1129 
1130 sal_Bool SdrTextFitToSizeTypeItem::QueryValue( uno::Any& rVal, sal_uInt8 /*nMemberId*/) const
1131 {
1132 	drawing::TextFitToSizeType eFS = (drawing::TextFitToSizeType)GetValue();
1133 	rVal <<= eFS;
1134 
1135 	return sal_True;
1136 }
1137 
1138 sal_Bool SdrTextFitToSizeTypeItem::PutValue( const uno::Any& rVal, sal_uInt8 /*nMemberId*/)
1139 {
1140 	drawing::TextFitToSizeType eFS;
1141 	if(!(rVal >>= eFS))
1142 	{
1143 		sal_Int32 nEnum = 0;
1144 		if(!(rVal >>= nEnum))
1145 			return sal_False;
1146 
1147 		eFS = (drawing::TextFitToSizeType) nEnum;
1148 	}
1149 
1150 	SetValue( sal::static_int_cast< sal_uInt16 >( (SdrFitToSizeType)eFS ) );
1151 
1152 	return sal_True;
1153 }
1154 
1155 TYPEINIT1_AUTOFACTORY(SdrTextVertAdjustItem,SfxEnumItem);
1156 
1157 SfxPoolItem* __EXPORT SdrTextVertAdjustItem::Clone(SfxItemPool* /*pPool*/) const            { return new SdrTextVertAdjustItem(*this); }
1158 
1159 SfxPoolItem* __EXPORT SdrTextVertAdjustItem::Create(SvStream& rIn, sal_uInt16 /*nVer*/) const   { return new SdrTextVertAdjustItem(rIn); }
1160 
1161 sal_uInt16 __EXPORT SdrTextVertAdjustItem::GetValueCount() const { return 5; }
1162 
1163 XubString __EXPORT SdrTextVertAdjustItem::GetValueTextByPos(sal_uInt16 nPos) const
1164 {
1165 	return ImpGetResStr(STR_ItemValTEXTVADJTOP+nPos);
1166 }
1167 
1168 SfxItemPresentation __EXPORT SdrTextVertAdjustItem::GetPresentation(SfxItemPresentation ePres,
1169                       SfxMapUnit /*eCoreMetric*/, SfxMapUnit /*ePresMetric*/, XubString& rText, const IntlWrapper *) const
1170 {
1171 	rText=GetValueTextByPos(sal::static_int_cast< sal_uInt16 >(GetValue()));
1172 	if (ePres==SFX_ITEM_PRESENTATION_COMPLETE) {
1173 		String aStr;
1174 
1175 		SdrItemPool::TakeItemName(Which(), aStr);
1176 		aStr += sal_Unicode(' ');
1177 		rText.Insert(aStr, 0);
1178 	}
1179 	return ePres;
1180 }
1181 
1182 sal_Bool SdrTextVertAdjustItem::QueryValue( uno::Any& rVal, sal_uInt8 /*nMemberId*/) const
1183 {
1184 	rVal <<= (drawing::TextVerticalAdjust)GetValue();
1185 	return sal_True;
1186 }
1187 
1188 sal_Bool SdrTextVertAdjustItem::PutValue( const uno::Any& rVal, sal_uInt8 /*nMemberId*/)
1189 {
1190 	drawing::TextVerticalAdjust eAdj;
1191 	if(!(rVal >>= eAdj))
1192 	{
1193 		sal_Int32 nEnum = 0;
1194 		if(!(rVal >>= nEnum))
1195 			return sal_False;
1196 
1197 		eAdj = (drawing::TextVerticalAdjust)nEnum;
1198 	}
1199 
1200 	SetValue( sal::static_int_cast< sal_uInt16 >( (SdrTextVertAdjust)eAdj ) );
1201 
1202 	return sal_True;
1203 }
1204 
1205 TYPEINIT1_AUTOFACTORY(SdrTextHorzAdjustItem,SfxEnumItem);
1206 
1207 SfxPoolItem* __EXPORT SdrTextHorzAdjustItem::Clone(SfxItemPool* /*pPool*/) const            { return new SdrTextHorzAdjustItem(*this); }
1208 
1209 SfxPoolItem* __EXPORT SdrTextHorzAdjustItem::Create(SvStream& rIn, sal_uInt16 /*nVer*/) const   { return new SdrTextHorzAdjustItem(rIn); }
1210 
1211 sal_uInt16 __EXPORT SdrTextHorzAdjustItem::GetValueCount() const { return 5; }
1212 
1213 XubString __EXPORT SdrTextHorzAdjustItem::GetValueTextByPos(sal_uInt16 nPos) const
1214 {
1215 	return ImpGetResStr(STR_ItemValTEXTHADJLEFT+nPos);
1216 }
1217 
1218 SfxItemPresentation __EXPORT SdrTextHorzAdjustItem::GetPresentation(SfxItemPresentation ePres,
1219                       SfxMapUnit /*eCoreMetric*/, SfxMapUnit /*ePresMetric*/, XubString& rText, const IntlWrapper *) const
1220 {
1221 	rText=GetValueTextByPos(sal::static_int_cast< sal_uInt16 >(GetValue()));
1222 	if (ePres==SFX_ITEM_PRESENTATION_COMPLETE) {
1223 		String aStr;
1224 
1225 		SdrItemPool::TakeItemName(Which(), aStr);
1226 		aStr += sal_Unicode(' ');
1227 		rText.Insert(aStr, 0);
1228 	}
1229 	return ePres;
1230 }
1231 
1232 sal_Bool SdrTextHorzAdjustItem::QueryValue( uno::Any& rVal, sal_uInt8 /*nMemberId*/) const
1233 {
1234 	rVal <<= (drawing::TextHorizontalAdjust)GetValue();
1235 	return sal_True;
1236 }
1237 
1238 sal_Bool SdrTextHorzAdjustItem::PutValue( const uno::Any& rVal, sal_uInt8 /*nMemberId*/)
1239 {
1240 	drawing::TextHorizontalAdjust eAdj;
1241 	if(!(rVal >>= eAdj))
1242 	{
1243 		sal_Int32 nEnum = 0;
1244 		if(!(rVal >>= nEnum))
1245 			return sal_False;
1246 
1247 		eAdj = (drawing::TextHorizontalAdjust)nEnum;
1248 	}
1249 
1250 	SetValue( sal::static_int_cast< sal_uInt16 >( (SdrTextHorzAdjust)eAdj ) );
1251 
1252 	return sal_True;
1253 }
1254 
1255 TYPEINIT1_AUTOFACTORY(SdrTextAniKindItem,SfxEnumItem);
1256 
1257 SfxPoolItem* __EXPORT SdrTextAniKindItem::Clone(SfxItemPool* /*pPool*/) const            { return new SdrTextAniKindItem(*this); }
1258 
1259 SfxPoolItem* __EXPORT SdrTextAniKindItem::Create(SvStream& rIn, sal_uInt16 /*nVer*/) const   { return new SdrTextAniKindItem(rIn); }
1260 
1261 sal_uInt16 __EXPORT SdrTextAniKindItem::GetValueCount() const { return 5; }
1262 
1263 XubString __EXPORT SdrTextAniKindItem::GetValueTextByPos(sal_uInt16 nPos) const
1264 {
1265 	return ImpGetResStr(STR_ItemValTEXTANI_NONE+nPos);
1266 }
1267 
1268 SfxItemPresentation __EXPORT SdrTextAniKindItem::GetPresentation(SfxItemPresentation ePres,
1269                       SfxMapUnit /*eCoreMetric*/, SfxMapUnit /*ePresMetric*/, XubString& rText, const IntlWrapper *) const
1270 {
1271 	rText=GetValueTextByPos(sal::static_int_cast< sal_uInt16 >(GetValue()));
1272 	if (ePres==SFX_ITEM_PRESENTATION_COMPLETE) {
1273 		String aStr;
1274 
1275 		SdrItemPool::TakeItemName(Which(), aStr);
1276 		aStr += sal_Unicode(' ');
1277 		rText.Insert(aStr, 0);
1278 	}
1279 	return ePres;
1280 }
1281 
1282 sal_Bool SdrTextAniKindItem::QueryValue( uno::Any& rVal, sal_uInt8 /*nMemberId*/) const
1283 {
1284 	rVal <<= (drawing::TextAnimationKind)GetValue();
1285 	return sal_True;
1286 }
1287 
1288 sal_Bool SdrTextAniKindItem::PutValue( const uno::Any& rVal, sal_uInt8 /*nMemberId*/)
1289 {
1290 	drawing::TextAnimationKind eKind;
1291 	if(!(rVal >>= eKind))
1292 	{
1293 		sal_Int32 nEnum = 0;
1294 		if(!(rVal >>= nEnum))
1295 			return sal_False;
1296 		eKind = (drawing::TextAnimationKind)nEnum;
1297 	}
1298 
1299 	SetValue( sal::static_int_cast< sal_uInt16 >( (SdrTextAniKind)eKind ) );
1300 
1301 	return sal_True;
1302 }
1303 
1304 TYPEINIT1_AUTOFACTORY(SdrTextAniDirectionItem,SfxEnumItem);
1305 
1306 SfxPoolItem* __EXPORT SdrTextAniDirectionItem::Clone(SfxItemPool* /*pPool*/) const            { return new SdrTextAniDirectionItem(*this); }
1307 
1308 SfxPoolItem* __EXPORT SdrTextAniDirectionItem::Create(SvStream& rIn, sal_uInt16 /*nVer*/) const   { return new SdrTextAniDirectionItem(rIn); }
1309 
1310 sal_uInt16 __EXPORT SdrTextAniDirectionItem::GetValueCount() const { return 4; }
1311 
1312 XubString __EXPORT SdrTextAniDirectionItem::GetValueTextByPos(sal_uInt16 nPos) const
1313 {
1314 	return ImpGetResStr(STR_ItemValTEXTANI_LEFT+nPos);
1315 }
1316 
1317 SfxItemPresentation __EXPORT SdrTextAniDirectionItem::GetPresentation(SfxItemPresentation ePres,
1318                       SfxMapUnit /*eCoreMetric*/, SfxMapUnit /*ePresMetric*/, XubString& rText, const IntlWrapper *) const
1319 {
1320 	rText=GetValueTextByPos(sal::static_int_cast< sal_uInt16 >(GetValue()));
1321 	if (ePres==SFX_ITEM_PRESENTATION_COMPLETE) {
1322 		String aStr;
1323 
1324 		SdrItemPool::TakeItemName(Which(), aStr);
1325 		aStr += sal_Unicode(' ');
1326 		rText.Insert(aStr, 0);
1327 	}
1328 	return ePres;
1329 }
1330 
1331 sal_Bool SdrTextAniDirectionItem::QueryValue( uno::Any& rVal, sal_uInt8 /*nMemberId*/) const
1332 {
1333 	rVal <<= (drawing::TextAnimationDirection)GetValue();
1334 	return sal_True;
1335 }
1336 
1337 sal_Bool SdrTextAniDirectionItem::PutValue( const uno::Any& rVal, sal_uInt8 /*nMemberId*/)
1338 {
1339 	drawing::TextAnimationDirection eDir;
1340 	if(!(rVal >>= eDir))
1341 	{
1342 		sal_Int32 nEnum = 0;
1343 		if(!(rVal >>= nEnum))
1344 			return sal_False;
1345 
1346 		eDir = (drawing::TextAnimationDirection)nEnum;
1347 	}
1348 
1349 	SetValue( sal::static_int_cast< sal_uInt16 >( (SdrTextAniDirection)eDir ) );
1350 
1351 	return sal_True;
1352 }
1353 
1354 TYPEINIT1_AUTOFACTORY(SdrTextAniDelayItem,SfxUInt16Item);
1355 
1356 SfxPoolItem* __EXPORT SdrTextAniDelayItem::Clone(SfxItemPool* /*pPool*/) const            { return new SdrTextAniDelayItem(*this); }
1357 
1358 SfxPoolItem* __EXPORT SdrTextAniDelayItem::Create(SvStream& rIn, sal_uInt16 /*nVer*/) const   { return new SdrTextAniDelayItem(rIn); }
1359 
1360 SfxItemPresentation __EXPORT SdrTextAniDelayItem::GetPresentation(
1361 	SfxItemPresentation ePres, SfxMapUnit /*eCoreMetric*/, SfxMapUnit /*ePresMetric*/,
1362     XubString& rText, const IntlWrapper *) const
1363 {
1364 	rText = UniString::CreateFromInt32(GetValue());
1365 	rText += sal_Unicode('m');
1366 	rText += sal_Unicode('s');
1367 
1368 	if(ePres == SFX_ITEM_PRESENTATION_COMPLETE)
1369 	{
1370 		XubString aStr;
1371 
1372 		SdrItemPool::TakeItemName(Which(), aStr);
1373 		aStr += sal_Unicode(' ');
1374 		rText.Insert(aStr, 0);
1375 	}
1376 
1377 	return ePres;
1378 }
1379 
1380 TYPEINIT1_AUTOFACTORY(SdrTextAniAmountItem,SfxInt16Item);
1381 
1382 SfxPoolItem* __EXPORT SdrTextAniAmountItem::Clone(SfxItemPool* /*pPool*/) const            { return new SdrTextAniAmountItem(*this); }
1383 
1384 SfxPoolItem* __EXPORT SdrTextAniAmountItem::Create(SvStream& rIn, sal_uInt16 /*nVer*/) const   { return new SdrTextAniAmountItem(rIn); }
1385 
1386 FASTBOOL __EXPORT SdrTextAniAmountItem::HasMetrics() const
1387 {
1388 	return GetValue()>0;
1389 }
1390 
1391 FASTBOOL __EXPORT SdrTextAniAmountItem::ScaleMetrics(long nMul, long nDiv)
1392 {
1393 	if (GetValue()>0) {
1394 		BigInt aVal(GetValue());
1395 		aVal*=nMul;
1396 		aVal+=nDiv/2; // fuer korrektes Runden
1397 		aVal/=nDiv;
1398 		SetValue(short(aVal));
1399 		return sal_True;
1400 	} else return sal_False;
1401 }
1402 
1403 SfxItemPresentation __EXPORT SdrTextAniAmountItem::GetPresentation(
1404 	SfxItemPresentation ePres, SfxMapUnit eCoreMetric, SfxMapUnit ePresMetric,
1405     XubString& rText, const IntlWrapper *) const
1406 {
1407 	sal_Int32 nValue(GetValue());
1408 
1409 	if(!nValue)
1410 		nValue = -1L;
1411 
1412 	if(nValue < 0)
1413 	{
1414 		sal_Char aText[] = "pixel";
1415 
1416 		rText = UniString::CreateFromInt32(-nValue);
1417 		rText += UniString(aText, sizeof(aText-1));
1418 	}
1419 	else
1420 	{
1421 		SdrFormatter aFmt((MapUnit)eCoreMetric, (MapUnit)ePresMetric);
1422 		XubString aStr;
1423 
1424 		aFmt.TakeStr(nValue, rText);
1425 		aFmt.TakeUnitStr((MapUnit)ePresMetric, aStr);
1426 		rText += aStr;
1427 	}
1428 
1429 	if(ePres == SFX_ITEM_PRESENTATION_COMPLETE)
1430 	{
1431 		XubString aStr;
1432 
1433 		SdrItemPool::TakeItemName(Which(), aStr);
1434 		aStr += sal_Unicode(' ');
1435 		rText.Insert(aStr, 0);
1436 	}
1437 
1438 	return ePres;
1439 }
1440 
1441 TYPEINIT1_AUTOFACTORY( SdrTextFixedCellHeightItem, SfxBoolItem );
1442 SdrTextFixedCellHeightItem::SdrTextFixedCellHeightItem( sal_Bool bUseFixedCellHeight )
1443 	: SfxBoolItem( SDRATTR_TEXT_USEFIXEDCELLHEIGHT, bUseFixedCellHeight )
1444 {
1445 }
1446 SdrTextFixedCellHeightItem::SdrTextFixedCellHeightItem( SvStream & rStream, sal_uInt16 nVersion )
1447 	: SfxBoolItem( SDRATTR_TEXT_USEFIXEDCELLHEIGHT, sal_False )
1448 {
1449 	if ( nVersion )
1450 	{
1451 		sal_Bool bValue;
1452 		rStream >> bValue;
1453 		SetValue( bValue );
1454 	}
1455 }
1456 SfxItemPresentation __EXPORT SdrTextFixedCellHeightItem::GetPresentation( SfxItemPresentation ePres,
1457 									SfxMapUnit /*eCoreMetric*/, SfxMapUnit /*ePresentationMetric*/,
1458                                         String &rText, const IntlWrapper * ) const
1459 {
1460 	rText = GetValueTextByVal( GetValue() );
1461 	if (ePres==SFX_ITEM_PRESENTATION_COMPLETE)
1462 	{
1463 		String aStr;
1464 		SdrItemPool::TakeItemName(Which(), aStr);
1465 		aStr += sal_Unicode(' ');
1466 		rText.Insert(aStr, 0);
1467 	}
1468 	return ePres;
1469 }
1470 SfxPoolItem* __EXPORT SdrTextFixedCellHeightItem::Create( SvStream& rIn, sal_uInt16 nItemVersion ) const
1471 {
1472 	return new SdrTextFixedCellHeightItem( rIn, nItemVersion );
1473 }
1474 SvStream& __EXPORT SdrTextFixedCellHeightItem::Store( SvStream& rOut, sal_uInt16 nItemVersion ) const
1475 {
1476 	if ( nItemVersion )
1477 	{
1478 		sal_Bool bValue = (sal_Bool)GetValue();
1479 		rOut << bValue;
1480 	}
1481 	return rOut;
1482 }
1483 SfxPoolItem* __EXPORT SdrTextFixedCellHeightItem::Clone( SfxItemPool * /*pPool*/) const
1484 {
1485 	return new SdrTextFixedCellHeightItem( GetValue() );
1486 }
1487 sal_uInt16 SdrTextFixedCellHeightItem::GetVersion( sal_uInt16 /*nFileFormatVersion*/) const
1488 {
1489 	return 1;
1490 }
1491 sal_Bool SdrTextFixedCellHeightItem::QueryValue( uno::Any& rVal, sal_uInt8 /*nMemberId*/) const
1492 {
1493 	sal_Bool bValue = (sal_Bool)GetValue();
1494 	rVal <<= bValue;
1495 	return sal_True;
1496 }
1497 sal_Bool SdrTextFixedCellHeightItem::PutValue( const uno::Any& rVal, sal_uInt8 /*nMemberId*/)
1498 {
1499 	sal_Bool bValue = sal_Bool();
1500 	if( !( rVal >>= bValue ) )
1501 		return sal_False;
1502 	SetValue( bValue );
1503 	return sal_True;
1504 }
1505 #ifdef SDR_ISPOOLABLE
1506 int __EXPORT SdrTextFixedCellHeightItem::IsPoolable() const
1507 {
1508 	sal_uInt16 nId=Which();
1509 	return nId < SDRATTR_NOTPERSIST_FIRST || nId > SDRATTR_NOTPERSIST_LAST;
1510 }
1511 #endif
1512 
1513 TYPEINIT1_AUTOFACTORY( SdrCustomShapeAdjustmentItem, SfxPoolItem );
1514 
1515 SdrCustomShapeAdjustmentItem::SdrCustomShapeAdjustmentItem() : SfxPoolItem( SDRATTR_CUSTOMSHAPE_ADJUSTMENT )
1516 {
1517 }
1518 
1519 SdrCustomShapeAdjustmentItem::SdrCustomShapeAdjustmentItem( SvStream& rIn, sal_uInt16 nVersion ):
1520 	SfxPoolItem( SDRATTR_CUSTOMSHAPE_ADJUSTMENT )
1521 {
1522 	if ( nVersion )
1523 	{
1524 		SdrCustomShapeAdjustmentValue aVal;
1525 		sal_uInt32 i, nCount;
1526 		rIn >> nCount;
1527 		for ( i = 0; i < nCount; i++ )
1528 		{
1529 			rIn >> aVal.nValue;
1530 			SetValue( i, aVal );
1531 		}
1532 	}
1533 }
1534 
1535 SdrCustomShapeAdjustmentItem::~SdrCustomShapeAdjustmentItem()
1536 {
1537 	void* pPtr;
1538 	for ( pPtr = aAdjustmentValueList.First(); pPtr; pPtr = aAdjustmentValueList.Next() )
1539 		delete (SdrCustomShapeAdjustmentValue*)pPtr;
1540 }
1541 
1542 int __EXPORT SdrCustomShapeAdjustmentItem::operator==( const SfxPoolItem& rCmp ) const
1543 {
1544 	int bRet = SfxPoolItem::operator==( rCmp );
1545 	if ( bRet )
1546 	{
1547 		bRet = ((SdrCustomShapeAdjustmentItem&)rCmp).GetCount() == GetCount();
1548 		if ( bRet )
1549 		{
1550 			sal_uInt32 i;
1551 			for ( i = 0; i < GetCount(); i++ )
1552 			{
1553 				if ( ((SdrCustomShapeAdjustmentItem&)rCmp).GetValue( i ).nValue != GetValue( i ).nValue )
1554 				{
1555 					bRet = 0;
1556 					break;
1557 				}
1558 			}
1559 		}
1560 	}
1561 	return bRet;
1562 }
1563 
1564 SfxItemPresentation __EXPORT SdrCustomShapeAdjustmentItem::GetPresentation(
1565 	SfxItemPresentation ePresentation, SfxMapUnit /*eCoreMetric*/,
1566     SfxMapUnit /*ePresentationMetric*/, XubString &rText, const IntlWrapper *) const
1567 {
1568 	sal_uInt32 i, nCount = GetCount();
1569 	rText.Append( UniString::CreateFromInt32( nCount ) );
1570 	for ( i = 0; i < nCount; i++ )
1571 	{
1572 		rText += sal_Unicode( ' ' );
1573 		rText.Append( UniString::CreateFromInt32( GetValue( i ).nValue ) );
1574 	}
1575 	if ( ePresentation == SFX_ITEM_PRESENTATION_COMPLETE )
1576 	{
1577 		XubString aStr;
1578 
1579 		SdrItemPool::TakeItemName( Which(), aStr );
1580 		aStr += sal_Unicode( ' ' );
1581 		rText.Insert( aStr, 0 );
1582 	}
1583 	return ePresentation;
1584 }
1585 
1586 SfxPoolItem* __EXPORT SdrCustomShapeAdjustmentItem::Create( SvStream& rIn, sal_uInt16 nItemVersion ) const
1587 {
1588 	return new SdrCustomShapeAdjustmentItem( rIn, nItemVersion );
1589 }
1590 
1591 SvStream& __EXPORT SdrCustomShapeAdjustmentItem::Store( SvStream& rOut, sal_uInt16 nItemVersion ) const
1592 {
1593 	if ( nItemVersion )
1594 	{
1595 		sal_uInt32 i, nCount = GetCount();
1596 		rOut << nCount;
1597 		for ( i = 0; i < nCount; i++ )
1598 			rOut << GetValue( i ).nValue;
1599 	}
1600 	return rOut;
1601 }
1602 
1603 SfxPoolItem* __EXPORT SdrCustomShapeAdjustmentItem::Clone( SfxItemPool * /*pPool*/) const
1604 {
1605 	sal_uInt32 i;
1606 	SdrCustomShapeAdjustmentItem* pItem = new SdrCustomShapeAdjustmentItem;
1607 	for ( i = 0; i < GetCount(); i++ )
1608 	{
1609 		const SdrCustomShapeAdjustmentValue& rVal = GetValue( i );
1610 		pItem->SetValue( i, rVal );
1611 	}
1612 	return pItem;
1613 }
1614 
1615 #ifdef SDR_ISPOOLABLE
1616 int __EXPORT SdrCustomShapeAdjustmentItem::IsPoolable() const
1617 {
1618 	sal_uInt16 nId=Which();
1619 	return nId < SDRATTR_NOTPERSIST_FIRST || nId > SDRATTR_NOTPERSIST_LAST;
1620 }
1621 #endif
1622 
1623 const SdrCustomShapeAdjustmentValue& SdrCustomShapeAdjustmentItem::GetValue( sal_uInt32 nIndex ) const
1624 {
1625 #ifdef DBG_UTIL
1626 	if ( aAdjustmentValueList.Count() <= nIndex )
1627 		DBG_ERROR( "SdrCustomShapeAdjustemntItem::GetValue - nIndex out of range (SJ)" );
1628 #endif
1629 	return *(SdrCustomShapeAdjustmentValue*)aAdjustmentValueList.GetObject( nIndex );
1630 }
1631 
1632 void SdrCustomShapeAdjustmentItem::SetValue( sal_uInt32 nIndex, const SdrCustomShapeAdjustmentValue& rVal )
1633 {
1634 	sal_uInt32 i;
1635 	for ( i = GetCount(); i <= nIndex; i++ )
1636 	{
1637 		SdrCustomShapeAdjustmentValue* pItem = new SdrCustomShapeAdjustmentValue;
1638 		aAdjustmentValueList.Insert( pItem, LIST_APPEND );
1639 	}
1640 	SdrCustomShapeAdjustmentValue& rValue = *(SdrCustomShapeAdjustmentValue*)aAdjustmentValueList.GetObject( nIndex );
1641 	rValue.nValue = rVal.nValue;
1642 }
1643 
1644 sal_uInt16 SdrCustomShapeAdjustmentItem::GetVersion( sal_uInt16 /*nFileFormatVersion*/) const
1645 {
1646 	return 1;
1647 }
1648 
1649 sal_Bool SdrCustomShapeAdjustmentItem::QueryValue( uno::Any& rVal, sal_uInt8 /*nMemberId*/) const
1650 {
1651 	sal_uInt32 i, nCount = GetCount();
1652 	uno::Sequence< sal_Int32 > aSequence( nCount );
1653 	if ( nCount )
1654 	{
1655 		sal_Int32* pPtr = aSequence.getArray();
1656 		for ( i = 0; i < nCount; i++ )
1657 			*pPtr++ = GetValue( i ).nValue;
1658 	}
1659 	rVal <<= aSequence;
1660 	return sal_True;
1661 }
1662 
1663 sal_Bool SdrCustomShapeAdjustmentItem::PutValue( const uno::Any& rVal, sal_uInt8 /*nMemberId*/)
1664 {
1665 	uno::Sequence< sal_Int32 > aSequence;
1666 	if( !( rVal >>= aSequence ) )
1667 		return sal_False;
1668 
1669 	void* pPtr;
1670 	for ( pPtr = aAdjustmentValueList.First(); pPtr; pPtr = aAdjustmentValueList.Next() )
1671 		delete (SdrCustomShapeAdjustmentValue*)pPtr;
1672 
1673 	sal_uInt32 i, nCount = aSequence.getLength();
1674 	if ( nCount )
1675 	{
1676 		const sal_Int32* pPtr2 = aSequence.getConstArray();
1677 		for ( i = 0; i < nCount; i++ )
1678 		{
1679 			SdrCustomShapeAdjustmentValue* pItem = new SdrCustomShapeAdjustmentValue;
1680 			pItem->nValue = *pPtr2++;
1681 			aAdjustmentValueList.Insert( pItem, LIST_APPEND );
1682 		}
1683 	}
1684 	return sal_True;
1685 }
1686 
1687 
1688 //++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
1689 // Edge
1690 //++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
1691 
1692 // EdgeKind
1693 TYPEINIT1_AUTOFACTORY(SdrEdgeKindItem,SfxEnumItem);
1694 
1695 SfxPoolItem* __EXPORT SdrEdgeKindItem::Clone(SfxItemPool* /*pPool*/) const            { return new SdrEdgeKindItem(*this); }
1696 
1697 SfxPoolItem* __EXPORT SdrEdgeKindItem::Create(SvStream& rIn, sal_uInt16 /*nVer*/) const   { return new SdrEdgeKindItem(rIn); }
1698 
1699 sal_uInt16 __EXPORT SdrEdgeKindItem::GetValueCount() const { return 4; }
1700 
1701 XubString __EXPORT SdrEdgeKindItem::GetValueTextByPos(sal_uInt16 nPos) const
1702 {
1703 	return ImpGetResStr(STR_ItemValEDGE_ORTHOLINES+nPos);
1704 }
1705 
1706 SfxItemPresentation __EXPORT SdrEdgeKindItem::GetPresentation(SfxItemPresentation ePres,
1707                       SfxMapUnit /*eCoreMetric*/, SfxMapUnit /*ePresMetric*/, XubString& rText, const IntlWrapper *) const
1708 {
1709 	rText=GetValueTextByPos(sal::static_int_cast< sal_uInt16 >(GetValue()));
1710 	if (ePres==SFX_ITEM_PRESENTATION_COMPLETE) {
1711 		String aStr;
1712 
1713 		SdrItemPool::TakeItemName(Which(), aStr);
1714 		aStr += sal_Unicode(' ');
1715 		rText.Insert(aStr, 0);
1716 	}
1717 	return ePres;
1718 }
1719 
1720 sal_Bool SdrEdgeKindItem::QueryValue( uno::Any& rVal, sal_uInt8 /*nMemberId*/) const
1721 {
1722 	drawing::ConnectorType eCT = drawing::ConnectorType_STANDARD;
1723 
1724 	switch( GetValue() )
1725 	{
1726 		case SDREDGE_ORTHOLINES :   eCT = drawing::ConnectorType_STANDARD; break;
1727 		case SDREDGE_THREELINES :   eCT = drawing::ConnectorType_LINES;	break;
1728 		case SDREDGE_ONELINE :		eCT = drawing::ConnectorType_LINE;	break;
1729 		case SDREDGE_BEZIER :		eCT = drawing::ConnectorType_CURVE;	break;
1730 		case SDREDGE_ARC :          eCT = drawing::ConnectorType_CURVE;	break;
1731 		default:
1732 			DBG_ERROR( "SdrEdgeKindItem::QueryValue : unknown enum" );
1733 	}
1734 
1735 	rVal <<= eCT;
1736 
1737 	return sal_True;
1738 }
1739 
1740 sal_Bool SdrEdgeKindItem::PutValue( const uno::Any& rVal, sal_uInt8 /*nMemberId*/)
1741 {
1742 	drawing::ConnectorType eCT;
1743 	if(!(rVal >>= eCT))
1744 	{
1745 		sal_Int32 nEnum = 0;
1746 		if(!(rVal >>= nEnum))
1747 			return sal_False;
1748 
1749 		eCT = (drawing::ConnectorType)nEnum;
1750 	}
1751 
1752 	SdrEdgeKind eEK = SDREDGE_ORTHOLINES;
1753 	switch( eCT )
1754 	{
1755 		case drawing::ConnectorType_STANDARD :	eEK = SDREDGE_ORTHOLINES;	break;
1756 		case drawing::ConnectorType_CURVE :		eEK = SDREDGE_BEZIER;		break;
1757 		case drawing::ConnectorType_LINE :       eEK = SDREDGE_ONELINE;		break;
1758 		case drawing::ConnectorType_LINES :      eEK = SDREDGE_THREELINES;   break;
1759 		default:
1760 			DBG_ERROR( "SdrEdgeKindItem::PuValue : unknown enum" );
1761 	}
1762 	SetValue( sal::static_int_cast< sal_uInt16 >( eEK ) );
1763 
1764 	return sal_True;
1765 }
1766 
1767 sal_Bool SdrEdgeNode1HorzDistItem::QueryValue( uno::Any& rVal, sal_uInt8 /*nMemberId*/) const
1768 {
1769 	rVal <<= (sal_Int32)GetValue();
1770 	return sal_True;
1771 }
1772 
1773 sal_Bool SdrEdgeNode1HorzDistItem::PutValue( const uno::Any& rVal, sal_uInt8 /*nMemberId*/)
1774 {
1775 	sal_Int32 nValue = 0;
1776 	if(!(rVal >>= nValue))
1777 		return sal_False;
1778 
1779 	SetValue( nValue );
1780 	return sal_True;
1781 }
1782 
1783 sal_Bool SdrEdgeNode1VertDistItem::QueryValue( uno::Any& rVal, sal_uInt8 /*nMemberId*/) const
1784 {
1785 	rVal <<= (sal_Int32)GetValue();
1786 	return sal_True;
1787 }
1788 
1789 sal_Bool SdrEdgeNode1VertDistItem::PutValue( const uno::Any& rVal, sal_uInt8 /*nMemberId*/)
1790 {
1791 	sal_Int32 nValue = 0;
1792 	if(!(rVal >>= nValue))
1793 		return sal_False;
1794 
1795 	SetValue( nValue );
1796 	return sal_True;
1797 }
1798 
1799 sal_Bool SdrEdgeNode2HorzDistItem::QueryValue( uno::Any& rVal, sal_uInt8 /*nMemberId*/) const
1800 {
1801 	rVal <<= (sal_Int32)GetValue();
1802 	return sal_True;
1803 }
1804 
1805 sal_Bool SdrEdgeNode2HorzDistItem::PutValue( const uno::Any& rVal, sal_uInt8 /*nMemberId*/)
1806 {
1807 	sal_Int32 nValue = 0;
1808 	if(!(rVal >>= nValue))
1809 		return sal_False;
1810 
1811 	SetValue( nValue );
1812 	return sal_True;
1813 }
1814 
1815 sal_Bool SdrEdgeNode2VertDistItem::QueryValue( uno::Any& rVal, sal_uInt8 /*nMemberId*/) const
1816 {
1817 	rVal <<= (sal_Int32)GetValue();
1818 	return sal_True;
1819 }
1820 
1821 sal_Bool SdrEdgeNode2VertDistItem::PutValue( const uno::Any& rVal, sal_uInt8 /*nMemberId*/)
1822 {
1823 	sal_Int32 nValue = 0;
1824 	if(!(rVal >>= nValue))
1825 		return sal_False;
1826 
1827 	SetValue( nValue );
1828 	return sal_True;
1829 }
1830 
1831 sal_Bool SdrEdgeLine1DeltaItem::QueryValue( uno::Any& rVal, sal_uInt8 /*nMemberId*/) const
1832 {
1833 	rVal <<= (sal_Int32)GetValue();
1834 	return sal_True;
1835 }
1836 
1837 sal_Bool SdrEdgeLine1DeltaItem::PutValue( const uno::Any& rVal, sal_uInt8 /*nMemberId*/)
1838 {
1839 	sal_Int32 nValue = 0;
1840 	if(!(rVal >>= nValue))
1841 		return sal_False;
1842 
1843 	SetValue( nValue );
1844 	return sal_True;
1845 }
1846 
1847 sal_Bool SdrEdgeLine2DeltaItem::QueryValue( uno::Any& rVal, sal_uInt8 /*nMemberId*/) const
1848 {
1849 	rVal <<= (sal_Int32)GetValue();
1850 	return sal_True;
1851 }
1852 
1853 sal_Bool SdrEdgeLine2DeltaItem::PutValue( const uno::Any& rVal, sal_uInt8 /*nMemberId*/)
1854 {
1855 	sal_Int32 nValue = 0;
1856 	if(!(rVal >>= nValue))
1857 		return sal_False;
1858 
1859 	SetValue( nValue );
1860 	return sal_True;
1861 }
1862 
1863 sal_Bool SdrEdgeLine3DeltaItem::QueryValue( uno::Any& rVal, sal_uInt8 /*nMemberId*/) const
1864 {
1865 	rVal <<= (sal_Int32)GetValue();
1866 	return sal_True;
1867 }
1868 
1869 sal_Bool SdrEdgeLine3DeltaItem::PutValue( const uno::Any& rVal, sal_uInt8 /*nMemberId*/)
1870 {
1871 	sal_Int32 nValue = 0;
1872 	if(!(rVal >>= nValue))
1873 		return sal_False;
1874 
1875 	SetValue( nValue );
1876 	return sal_True;
1877 }
1878 
1879 //++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
1880 // Measure
1881 //++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
1882 
1883 // MeasureKind
1884 TYPEINIT1_AUTOFACTORY(SdrMeasureKindItem,SfxEnumItem);
1885 
1886 SfxPoolItem* __EXPORT SdrMeasureKindItem::Clone(SfxItemPool* /*pPool*/) const            { return new SdrMeasureKindItem(*this); }
1887 
1888 SfxPoolItem* __EXPORT SdrMeasureKindItem::Create(SvStream& rIn, sal_uInt16 /*nVer*/) const   { return new SdrMeasureKindItem(rIn); }
1889 
1890 sal_uInt16 __EXPORT SdrMeasureKindItem::GetValueCount() const { return 2; }
1891 
1892 XubString __EXPORT SdrMeasureKindItem::GetValueTextByPos(sal_uInt16 nPos) const
1893 {
1894 	return ImpGetResStr(STR_ItemValMEASURE_STD+nPos);
1895 }
1896 
1897 SfxItemPresentation __EXPORT SdrMeasureKindItem::GetPresentation(SfxItemPresentation ePres,
1898                       SfxMapUnit /*eCoreMetric*/, SfxMapUnit /*ePresMetric*/, XubString& rText, const IntlWrapper *) const
1899 {
1900 	rText=GetValueTextByPos(sal::static_int_cast< sal_uInt16 >(GetValue()));
1901 	if (ePres==SFX_ITEM_PRESENTATION_COMPLETE) {
1902 		String aStr;
1903 
1904 		SdrItemPool::TakeItemName(Which(), aStr);
1905 		aStr += sal_Unicode(' ');
1906 		rText.Insert(aStr, 0);
1907 	}
1908 	return ePres;
1909 }
1910 
1911 sal_Bool SdrMeasureKindItem::QueryValue( uno::Any& rVal, sal_uInt8 /*nMemberId*/) const
1912 {
1913 	rVal <<= (drawing::MeasureKind)GetValue();
1914 	return sal_True;
1915 }
1916 
1917 sal_Bool SdrMeasureKindItem::PutValue( const uno::Any& rVal, sal_uInt8 /*nMemberId*/)
1918 {
1919 	drawing::MeasureKind eKind;
1920 	if(!(rVal >>= eKind))
1921 	{
1922 		sal_Int32 nEnum = 0;
1923 		if(!(rVal >>= nEnum))
1924 			return sal_False;
1925 
1926 		eKind = (drawing::MeasureKind)nEnum;
1927 	}
1928 
1929 	SetValue( sal::static_int_cast< sal_uInt16 >( (SdrMeasureKind)eKind ) );
1930 	return sal_True;
1931 }
1932 
1933 TYPEINIT1_AUTOFACTORY(SdrMeasureTextHPosItem,SfxEnumItem);
1934 
1935 SfxPoolItem* __EXPORT SdrMeasureTextHPosItem::Clone(SfxItemPool* /*pPool*/) const            { return new SdrMeasureTextHPosItem(*this); }
1936 
1937 SfxPoolItem* __EXPORT SdrMeasureTextHPosItem::Create(SvStream& rIn, sal_uInt16 /*nVer*/) const   { return new SdrMeasureTextHPosItem(rIn); }
1938 
1939 sal_uInt16 __EXPORT SdrMeasureTextHPosItem::GetValueCount() const { return 4; }
1940 
1941 XubString __EXPORT SdrMeasureTextHPosItem::GetValueTextByPos(sal_uInt16 nPos) const
1942 {
1943 	return ImpGetResStr(STR_ItemValMEASURE_TEXTHAUTO+nPos);
1944 }
1945 
1946 SfxItemPresentation __EXPORT SdrMeasureTextHPosItem::GetPresentation(SfxItemPresentation ePres,
1947                       SfxMapUnit /*eCoreMetric*/, SfxMapUnit /*ePresMetric*/, XubString& rText, const IntlWrapper *) const
1948 {
1949 	rText=GetValueTextByPos(sal::static_int_cast< sal_uInt16 >(GetValue()));
1950 	if (ePres==SFX_ITEM_PRESENTATION_COMPLETE) {
1951 		String aStr;
1952 
1953 		SdrItemPool::TakeItemName(Which(), aStr);
1954 		aStr += sal_Unicode(' ');
1955 		rText.Insert(aStr, 0);
1956 	}
1957 	return ePres;
1958 }
1959 
1960 sal_Bool SdrMeasureTextHPosItem::QueryValue( uno::Any& rVal, sal_uInt8 /*nMemberId*/) const
1961 {
1962 	rVal <<= (drawing::MeasureTextHorzPos)GetValue();
1963 	return sal_True;
1964 }
1965 
1966 sal_Bool SdrMeasureTextHPosItem::PutValue( const uno::Any& rVal, sal_uInt8 /*nMemberId*/)
1967 {
1968 	drawing::MeasureTextHorzPos ePos;
1969 	if(!(rVal >>= ePos))
1970 	{
1971 		sal_Int32 nEnum = 0;
1972 		if(!(rVal >>= nEnum))
1973 			return sal_False;
1974 
1975 		ePos = (drawing::MeasureTextHorzPos)nEnum;
1976 	}
1977 
1978 	SetValue( sal::static_int_cast< sal_uInt16 >( (SdrMeasureTextHPos)ePos ) );
1979 	return sal_True;
1980 }
1981 
1982 TYPEINIT1_AUTOFACTORY(SdrMeasureTextVPosItem,SfxEnumItem);
1983 
1984 SfxPoolItem* __EXPORT SdrMeasureTextVPosItem::Clone(SfxItemPool* /*pPool*/) const            { return new SdrMeasureTextVPosItem(*this); }
1985 
1986 SfxPoolItem* __EXPORT SdrMeasureTextVPosItem::Create(SvStream& rIn, sal_uInt16 /*nVer*/) const   { return new SdrMeasureTextVPosItem(rIn); }
1987 
1988 sal_uInt16 __EXPORT SdrMeasureTextVPosItem::GetValueCount() const { return 5; }
1989 
1990 XubString __EXPORT SdrMeasureTextVPosItem::GetValueTextByPos(sal_uInt16 nPos) const
1991 {
1992 	return ImpGetResStr(STR_ItemValMEASURE_TEXTVAUTO+nPos);
1993 }
1994 
1995 SfxItemPresentation __EXPORT SdrMeasureTextVPosItem::GetPresentation(SfxItemPresentation ePres,
1996                       SfxMapUnit /*eCoreMetric*/, SfxMapUnit /*ePresMetric*/, XubString& rText, const IntlWrapper *) const
1997 {
1998 	rText=GetValueTextByPos(sal::static_int_cast< sal_uInt16 >(GetValue()));
1999 	if (ePres==SFX_ITEM_PRESENTATION_COMPLETE) {
2000 		String aStr;
2001 
2002 		SdrItemPool::TakeItemName(Which(), aStr);
2003 		aStr += sal_Unicode(' ');
2004 		rText.Insert(aStr, 0);
2005 	}
2006 	return ePres;
2007 }
2008 
2009 sal_Bool SdrMeasureTextVPosItem::QueryValue( uno::Any& rVal, sal_uInt8 /*nMemberId*/) const
2010 {
2011 	rVal <<= (drawing::MeasureTextVertPos)GetValue();
2012 	return sal_True;
2013 }
2014 
2015 sal_Bool SdrMeasureTextVPosItem::PutValue( const uno::Any& rVal, sal_uInt8 /*nMemberId*/)
2016 {
2017 	drawing::MeasureTextVertPos ePos;
2018 	if(!(rVal >>= ePos))
2019 	{
2020 		sal_Int32 nEnum = 0;
2021 		if(!(rVal >>= nEnum))
2022 			return sal_False;
2023 
2024 		ePos = (drawing::MeasureTextVertPos)nEnum;
2025 	}
2026 
2027 	SetValue( sal::static_int_cast< sal_uInt16 >( (SdrMeasureTextHPos)ePos ) );
2028 	return sal_True;
2029 }
2030 
2031 TYPEINIT1_AUTOFACTORY(SdrMeasureUnitItem,SfxEnumItem);
2032 
2033 SfxPoolItem* __EXPORT SdrMeasureUnitItem::Clone(SfxItemPool* /*pPool*/) const            { return new SdrMeasureUnitItem(*this); }
2034 
2035 SfxPoolItem* __EXPORT SdrMeasureUnitItem::Create(SvStream& rIn, sal_uInt16 /*nVer*/) const   { return new SdrMeasureUnitItem(rIn); }
2036 
2037 sal_uInt16 __EXPORT SdrMeasureUnitItem::GetValueCount() const { return 14; }
2038 
2039 XubString __EXPORT SdrMeasureUnitItem::GetValueTextByPos(sal_uInt16 nPos) const
2040 {
2041 	XubString aRetval;
2042 
2043 	if((FieldUnit)nPos == FUNIT_NONE)
2044 	{
2045 		sal_Char aText[] = "default";
2046 		aRetval += UniString(aText, sizeof(aText-1));
2047 	}
2048 	else
2049 	{
2050 		SdrFormatter::TakeUnitStr((FieldUnit)nPos, aRetval);
2051 	}
2052 
2053 	return aRetval;
2054 }
2055 
2056 SfxItemPresentation __EXPORT SdrMeasureUnitItem::GetPresentation(SfxItemPresentation ePres,
2057                       SfxMapUnit /*eCoreMetric*/, SfxMapUnit /*ePresMetric*/, XubString& rText, const IntlWrapper *) const
2058 {
2059 	rText=GetValueTextByPos(sal::static_int_cast< sal_uInt16 >(GetValue()));
2060 	if (ePres==SFX_ITEM_PRESENTATION_COMPLETE) {
2061 		String aStr;
2062 
2063 		SdrItemPool::TakeItemName(Which(), aStr);
2064 		aStr += sal_Unicode(' ');
2065 		rText.Insert(aStr, 0);
2066 	}
2067 	return ePres;
2068 }
2069 
2070 sal_Bool SdrMeasureUnitItem::QueryValue( uno::Any& rVal, sal_uInt8 /*nMemberId*/) const
2071 {
2072 	rVal <<= (sal_Int32)GetValue();
2073 	return sal_True;
2074 }
2075 
2076 sal_Bool SdrMeasureUnitItem::PutValue( const uno::Any& rVal, sal_uInt8 /*nMemberId*/)
2077 {
2078 	sal_Int32 nMeasure = 0;
2079 	if(!(rVal >>= nMeasure))
2080 		return sal_False;
2081 
2082 	SetValue( sal::static_int_cast< sal_uInt16 >( (FieldUnit)nMeasure ) );
2083 	return sal_True;
2084 }
2085 
2086 //++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
2087 // Circ
2088 //++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
2089 
2090 // CircKind
2091 TYPEINIT1_AUTOFACTORY(SdrCircKindItem,SfxEnumItem);
2092 
2093 SfxPoolItem* __EXPORT SdrCircKindItem::Clone(SfxItemPool* /*pPool*/) const          { return new SdrCircKindItem(*this); }
2094 
2095 SfxPoolItem* __EXPORT SdrCircKindItem::Create(SvStream& rIn, sal_uInt16 /*nVer*/) const { return new SdrCircKindItem(rIn); }
2096 
2097 sal_uInt16 __EXPORT SdrCircKindItem::GetValueCount() const { return 4; }
2098 
2099 XubString __EXPORT SdrCircKindItem::GetValueTextByPos(sal_uInt16 nPos) const
2100 {
2101 	return ImpGetResStr(STR_ItemValCIRC_FULL+nPos);
2102 }
2103 
2104 SfxItemPresentation __EXPORT SdrCircKindItem::GetPresentation(SfxItemPresentation ePres,
2105                       SfxMapUnit /*eCoreMetric*/, SfxMapUnit /*ePresMetric*/, XubString& rText, const IntlWrapper *) const
2106 {
2107 	rText=GetValueTextByPos(sal::static_int_cast< sal_uInt16 >(GetValue()));
2108 	if (ePres==SFX_ITEM_PRESENTATION_COMPLETE) {
2109 		String aStr;
2110 
2111 		SdrItemPool::TakeItemName(Which(), aStr);
2112 		aStr += sal_Unicode(' ');
2113 		rText.Insert(aStr, 0);
2114 	}
2115 	return ePres;
2116 }
2117 
2118 sal_Bool SdrCircKindItem::QueryValue( uno::Any& rVal, sal_uInt8 /*nMemberId*/) const
2119 {
2120 	rVal <<= (drawing::CircleKind)GetValue();
2121 	return sal_True;
2122 }
2123 
2124 sal_Bool SdrCircKindItem::PutValue( const uno::Any& rVal, sal_uInt8 /*nMemberId*/)
2125 {
2126 	drawing::CircleKind eKind;
2127 	if(!(rVal >>= eKind))
2128 	{
2129 		sal_Int32 nEnum = 0;
2130 		if(!(rVal >>= nEnum))
2131 			return sal_False;
2132 
2133 		eKind = (drawing::CircleKind)nEnum;
2134 	}
2135 
2136 	SetValue( sal::static_int_cast< sal_uInt16 >( (SdrCircKind)eKind ) );
2137 	return sal_True;
2138 }
2139 
2140 //------------------------------------------------------------
2141 // class SdrSignedPercentItem
2142 //------------------------------------------------------------
2143 
2144 TYPEINIT1_AUTOFACTORY( SdrSignedPercentItem, SfxInt16Item );
2145 
2146 
2147 SfxPoolItem* __EXPORT SdrSignedPercentItem::Clone(SfxItemPool* /*pPool*/) const
2148 {
2149 	return new SdrSignedPercentItem( Which(), GetValue() );
2150 }
2151 
2152 SfxPoolItem* __EXPORT SdrSignedPercentItem::Create( SvStream& rIn, sal_uInt16 /*nVer*/) const
2153 {
2154 	return new SdrSignedPercentItem( Which(), rIn );
2155 }
2156 
2157 SfxItemPresentation __EXPORT SdrSignedPercentItem::GetPresentation(
2158 	SfxItemPresentation ePres, SfxMapUnit /*eCoreMetric*/, SfxMapUnit /*ePresMetric*/,
2159     XubString& rText, const IntlWrapper *) const
2160 {
2161 	rText = UniString::CreateFromInt32(GetValue());
2162 	rText += sal_Unicode('%');
2163 
2164 	if(ePres == SFX_ITEM_PRESENTATION_COMPLETE)
2165 	{
2166 		XubString aStr;
2167 
2168 		SdrItemPool::TakeItemName(Which(), aStr);
2169 		aStr += sal_Unicode(' ');
2170 		rText.Insert(aStr, 0);
2171 	}
2172 
2173 	return ePres;
2174 }
2175 
2176 #ifdef SDR_ISPOOLABLE
2177 
2178 int __EXPORT SdrSignedPercentItem::IsPoolable() const
2179 {
2180 	sal_uInt16 nId=Which();
2181 	return nId < SDRATTR_NOTPERSIST_FIRST || nId > SDRATTR_NOTPERSIST_LAST;
2182 }
2183 #endif
2184 
2185 //++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
2186 // SdrGrafRedItem
2187 //++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
2188 
2189 TYPEINIT1( SdrGrafRedItem, SdrSignedPercentItem );
2190 
2191 SfxPoolItem* __EXPORT SdrGrafRedItem::Clone( SfxItemPool* /*pPool*/) const
2192 {
2193 	return new SdrGrafRedItem( *this );
2194 }
2195 
2196 SfxPoolItem* __EXPORT SdrGrafRedItem::Create( SvStream& rIn, sal_uInt16 /*nVer*/) const
2197 {
2198 	return new SdrGrafRedItem( rIn );
2199 }
2200 
2201 //++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
2202 // SdrGrafGreenItem
2203 //++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
2204 
2205 TYPEINIT1( SdrGrafGreenItem, SdrSignedPercentItem );
2206 
2207 SfxPoolItem* __EXPORT SdrGrafGreenItem::Clone( SfxItemPool* /*pPool*/) const
2208 {
2209 	return new SdrGrafGreenItem( *this );
2210 }
2211 
2212 SfxPoolItem* __EXPORT SdrGrafGreenItem::Create( SvStream& rIn, sal_uInt16 /*nVer*/) const
2213 {
2214 	return new SdrGrafGreenItem( rIn );
2215 }
2216 
2217 //++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
2218 // SdrGrafBlueItem
2219 //++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
2220 
2221 TYPEINIT1( SdrGrafBlueItem, SdrSignedPercentItem );
2222 
2223 SfxPoolItem* __EXPORT SdrGrafBlueItem::Clone( SfxItemPool* /*pPool*/) const
2224 {
2225 	return new SdrGrafBlueItem( *this );
2226 }
2227 
2228 SfxPoolItem* __EXPORT SdrGrafBlueItem::Create( SvStream& rIn, sal_uInt16 /*nVer*/) const
2229 {
2230 	return new SdrGrafBlueItem( rIn );
2231 }
2232 
2233 //++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
2234 // SdrGrafLuminanceItem
2235 //++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
2236 
2237 TYPEINIT1( SdrGrafLuminanceItem, SdrSignedPercentItem );
2238 
2239 SfxPoolItem* __EXPORT SdrGrafLuminanceItem::Clone( SfxItemPool* /*pPool*/) const
2240 {
2241 	return new SdrGrafLuminanceItem( *this );
2242 }
2243 
2244 SfxPoolItem* __EXPORT SdrGrafLuminanceItem::Create( SvStream& rIn, sal_uInt16 /*nVer*/) const
2245 {
2246 	return new SdrGrafLuminanceItem( rIn );
2247 }
2248 
2249 //++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
2250 // SdrGrafContrastItem
2251 //++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
2252 
2253 TYPEINIT1( SdrGrafContrastItem, SdrSignedPercentItem );
2254 
2255 SfxPoolItem* __EXPORT SdrGrafContrastItem::Clone( SfxItemPool* /*pPool*/) const
2256 {
2257 	return new SdrGrafContrastItem( *this );
2258 }
2259 
2260 SfxPoolItem* __EXPORT SdrGrafContrastItem::Create( SvStream& rIn, sal_uInt16 /*nVer*/) const
2261 {
2262 	return new SdrGrafContrastItem( rIn );
2263 }
2264 
2265 //++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
2266 // SdrGrafGamma100Item
2267 //++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
2268 
2269 TYPEINIT1( SdrGrafGamma100Item, SfxUInt32Item );
2270 
2271 SfxPoolItem* __EXPORT SdrGrafGamma100Item::Clone( SfxItemPool* /*pPool */) const
2272 {
2273 	return new SdrGrafGamma100Item( *this );
2274 }
2275 
2276 SfxPoolItem* __EXPORT SdrGrafGamma100Item::Create( SvStream& rIn, sal_uInt16 /*nVer*/) const
2277 {
2278 	return new SdrGrafGamma100Item( rIn );
2279 }
2280 
2281 sal_Bool SdrGrafGamma100Item::QueryValue( uno::Any& rVal, sal_uInt8 /*nMemberId*/) const
2282 {
2283 	rVal <<= ((double)GetValue()) / 100.0;
2284 	return sal_True;
2285 }
2286 
2287 sal_Bool SdrGrafGamma100Item::PutValue( const uno::Any& rVal, sal_uInt8 /*nMemberId*/)
2288 {
2289 	double nGamma = 0;
2290 	if(!(rVal >>= nGamma))
2291 		return sal_False;
2292 
2293 	SetValue( (sal_uInt32)(nGamma * 100.0  ) );
2294 	return sal_True;
2295 }
2296 
2297 //++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
2298 // SdrGrafInvertItem
2299 //++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
2300 
2301 TYPEINIT1( SdrGrafInvertItem, SdrOnOffItem );
2302 
2303 SfxPoolItem* __EXPORT SdrGrafInvertItem::Clone( SfxItemPool* /*pPool*/) const
2304 {
2305 	return new SdrGrafInvertItem( *this );
2306 }
2307 
2308 SfxPoolItem* __EXPORT SdrGrafInvertItem::Create( SvStream& rIn, sal_uInt16 /*nVer*/) const
2309 {
2310 	return new SdrGrafInvertItem( rIn );
2311 }
2312 
2313 //++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
2314 // SdrGrafTransparenceItem
2315 //++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
2316 
2317 TYPEINIT1( SdrGrafTransparenceItem, SdrPercentItem );
2318 
2319 SfxPoolItem* __EXPORT SdrGrafTransparenceItem::Clone( SfxItemPool* /*pPool*/) const
2320 {
2321 	return new SdrGrafTransparenceItem( *this );
2322 }
2323 
2324 SfxPoolItem* __EXPORT SdrGrafTransparenceItem::Create( SvStream& rIn, sal_uInt16 /*nVer*/) const
2325 {
2326 	return new SdrGrafTransparenceItem( rIn );
2327 }
2328 
2329 //++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
2330 // SdrGrafModeItem
2331 //++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
2332 
2333 TYPEINIT1( SdrGrafModeItem, SfxEnumItem );
2334 
2335 SfxPoolItem* __EXPORT SdrGrafModeItem::Clone(SfxItemPool* /*pPool*/) const
2336 {
2337 	return new SdrGrafModeItem( *this );
2338 }
2339 
2340 SfxPoolItem* __EXPORT SdrGrafModeItem::Create( SvStream& rIn, sal_uInt16 /*nVer*/) const
2341 {
2342 	return new SdrGrafModeItem( rIn );
2343 }
2344 
2345 sal_uInt16 __EXPORT SdrGrafModeItem::GetValueCount() const
2346 {
2347 	return 4;
2348 }
2349 
2350 XubString __EXPORT SdrGrafModeItem::GetValueTextByPos(sal_uInt16 nPos) const
2351 {
2352 	XubString aStr;
2353 
2354 	switch(nPos)
2355 	{
2356 		case 1:
2357 		{
2358 			sal_Char aTextGreys[] = "Greys";
2359 			aStr += UniString(aTextGreys, sizeof(aTextGreys-1));
2360 			break;
2361 		}
2362 		case 2:
2363 		{
2364 			sal_Char aTextBlackWhite[] = "Black/White";
2365 			aStr += UniString(aTextBlackWhite, sizeof(aTextBlackWhite-1));
2366 			break;
2367 		}
2368 		case 3:
2369 		{
2370 			sal_Char aTextWatermark[] = "Watermark";
2371 			aStr += UniString(aTextWatermark, sizeof(aTextWatermark-1));
2372 			break;
2373 		}
2374 		default:
2375 		{
2376 			sal_Char aTextStandard[] = "Standard";
2377 			aStr += UniString(aTextStandard, sizeof(aTextStandard-1));
2378 			break;
2379 		}
2380 	}
2381 
2382 	return aStr;
2383 }
2384 
2385 SfxItemPresentation __EXPORT SdrGrafModeItem::GetPresentation( SfxItemPresentation ePres,
2386 															   SfxMapUnit /*eCoreMetric*/, SfxMapUnit /*ePresMetric*/,
2387                                                                XubString& rText, const IntlWrapper *) const
2388 {
2389 	rText = GetValueTextByPos( sal::static_int_cast< sal_uInt16 >( GetValue() ) );
2390 
2391 	if( ePres == SFX_ITEM_PRESENTATION_COMPLETE )
2392 	{
2393 		String aStr;
2394 
2395 		SdrItemPool::TakeItemName( Which(), aStr );
2396 		aStr += sal_Unicode(' ');
2397 		rText.Insert( aStr, 0 );
2398 	}
2399 
2400 	return ePres;
2401 }
2402 
2403 //++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
2404 // SdrGrafCropItem
2405 //++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
2406 
2407 TYPEINIT1( SdrGrafCropItem, SvxGrfCrop );
2408 
2409 SfxPoolItem* SdrGrafCropItem::Clone( SfxItemPool* /*pPool*/) const
2410 {
2411 	return new SdrGrafCropItem( *this );
2412 }
2413 
2414 SfxPoolItem* SdrGrafCropItem::Create( SvStream& rIn, sal_uInt16 nVer ) const
2415 {
2416 	return( ( 0 == nVer ) ? Clone( NULL ) : SvxGrfCrop::Create( rIn, nVer ) );
2417 }
2418 
2419 sal_uInt16 SdrGrafCropItem::GetVersion( sal_uInt16 /*nFileVersion*/) const
2420 {
2421 	// GRFCROP_VERSION_MOVETOSVX is 1
2422 	return GRFCROP_VERSION_MOVETOSVX;
2423 }
2424 
2425 // eof
2426