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