xref: /aoo41x/main/svx/source/svdraw/svdattr.cxx (revision ae2dc0fa)
1 /**************************************************************
2  *
3  * Licensed to the Apache Software Foundation (ASF) under one
4  * or more contributor license agreements.  See the NOTICE file
5  * distributed with this work for additional information
6  * regarding copyright ownership.  The ASF licenses this file
7  * to you under the Apache License, Version 2.0 (the
8  * "License"); you may not use this file except in compliance
9  * with the License.  You may obtain a copy of the License at
10  *
11  *   http://www.apache.org/licenses/LICENSE-2.0
12  *
13  * Unless required by applicable law or agreed to in writing,
14  * software distributed under the License is distributed on an
15  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16  * KIND, either express or implied.  See the License for the
17  * specific language governing permissions and limitations
18  * under the License.
19  *
20  *************************************************************/
21 
22 
23 
24 // MARKER(update_precomp.py): autogen include statement, do not remove
25 #include "precompiled_svx.hxx"
26 
27 
28 #include <com/sun/star/drawing/TextFitToSizeType.hpp>
29 #include <com/sun/star/drawing/TextHorizontalAdjust.hpp>
30 #include <com/sun/star/drawing/TextVerticalAdjust.hpp>
31 #include <com/sun/star/drawing/TextAnimationKind.hpp>
32 #include <com/sun/star/uno/Any.hxx>
33 #include <com/sun/star/drawing/TextAnimationDirection.hpp>
34 #include <com/sun/star/drawing/ConnectorType.hpp>
35 #include <com/sun/star/drawing/MeasureKind.hpp>
36 #include <com/sun/star/drawing/MeasureTextHorzPos.hpp>
37 #include <com/sun/star/drawing/MeasureTextVertPos.hpp>
38 #include <com/sun/star/drawing/CircleKind.hpp>
39 #include <com/sun/star/uno/Sequence.hxx>
40 
41 #include <unotools/intlwrapper.hxx>
42 #include <comphelper/processfactory.hxx>
43 #include <vcl/svapp.hxx>
44 #include <svx/svdattr.hxx>
45 #include <svx/svdattrx.hxx>
46 #include <svx/svdpool.hxx>
47 
48 #include <svl/solar.hrc>
49 #include "editeng/xmlcnitm.hxx"
50 
51 #include <svx/svxids.hrc>
52 #include <svx/xtable.hxx>    // fuer RGB_Color()
53 #include "svx/svditext.hxx"
54 #include <svx/svdmodel.hxx>  // fuer DEGREE_CHAR
55 #include <svx/svdtrans.hxx>
56 #include "svx/svdglob.hxx"  // Stringcache
57 #include "svx/svdstr.hrc"
58 #include <svx/sdgcpitm.hxx>
59 #include <editeng/adjitem.hxx>
60 #include <svx/sdtfchim.hxx>
61 #include <editeng/writingmodeitem.hxx>
62 #include <tools/bigint.hxx>
63 #include <tools/stream.hxx>
64 
65 #include <svx/xfillit0.hxx>
66 #include <svx/xflclit.hxx>
67 #include <svx/xlineit0.hxx>
68 #include <svx/svx3ditems.hxx>
69 
70 #define ITEMID_BOX SDRATTR_TABLE_BORDER
71 #define ITEMID_BOXINFO SDRATTR_TABLE_BORDER_INNER
72 #include "editeng/boxitem.hxx"
73 
74 #define ITEMID_SHADOW SDRATTR_TABLE_BORDER_SHADOW
75 #include "editeng/shaditem.hxx"
76 
77 #define ITEMID_LINE 0
78 #include "editeng/bolnitem.hxx"
79 
80 using namespace ::rtl;
81 using namespace ::com::sun::star;
82 
83 /*************************************************************************
84 |*
85 |* Konstruktor
86 |*
87 \************************************************************************/
88 
SdrItemPool(SfxItemPool * _pMaster,sal_Bool bLoadRefCounts)89 SdrItemPool::SdrItemPool(
90 	SfxItemPool* _pMaster,
91 	sal_Bool bLoadRefCounts)
92 :	XOutdevItemPool(_pMaster, SDRATTR_START, SDRATTR_END, bLoadRefCounts)
93 {
94 	// preapare some constants
95 	const Color aNullCol(RGB_Color(COL_BLACK));
96 	const XubString aEmptyStr;
97 	const sal_Int32 nDefEdgeDist(500L); // Erstmal hart defaulted fuer Draw (100TH_MM). hier muss noch der MapMode beruecksichtigt werden.
98 
99 	// init the non-persistent items
100 	for(sal_uInt16 i(SDRATTR_NOTPERSIST_FIRST); i <= SDRATTR_NOTPERSIST_LAST; i++)
101 	{
102 		mpLocalItemInfos[i - SDRATTR_START]._nFlags=0;
103 	}
104 
105 	// init own PoolDefaults
106 	mppLocalPoolDefaults[SDRATTR_SHADOW            -SDRATTR_START]=new SdrShadowItem;
107 	mppLocalPoolDefaults[SDRATTR_SHADOWCOLOR       -SDRATTR_START]=new SdrShadowColorItem(aEmptyStr,aNullCol);
108 	mppLocalPoolDefaults[SDRATTR_SHADOWXDIST       -SDRATTR_START]=new SdrShadowXDistItem;
109 	mppLocalPoolDefaults[SDRATTR_SHADOWYDIST       -SDRATTR_START]=new SdrShadowYDistItem;
110 	mppLocalPoolDefaults[SDRATTR_SHADOWTRANSPARENCE-SDRATTR_START]=new SdrShadowTransparenceItem;
111 	mppLocalPoolDefaults[SDRATTR_SHADOW3D          -SDRATTR_START]=new SfxVoidItem(SDRATTR_SHADOW3D    );
112 	mppLocalPoolDefaults[SDRATTR_SHADOWPERSP       -SDRATTR_START]=new SfxVoidItem(SDRATTR_SHADOWPERSP );
113 	mppLocalPoolDefaults[SDRATTR_CAPTIONTYPE      -SDRATTR_START]=new SdrCaptionTypeItem      ;
114 	mppLocalPoolDefaults[SDRATTR_CAPTIONFIXEDANGLE-SDRATTR_START]=new SdrCaptionFixedAngleItem;
115 	mppLocalPoolDefaults[SDRATTR_CAPTIONANGLE     -SDRATTR_START]=new SdrCaptionAngleItem     ;
116 	mppLocalPoolDefaults[SDRATTR_CAPTIONGAP       -SDRATTR_START]=new SdrCaptionGapItem       ;
117 	mppLocalPoolDefaults[SDRATTR_CAPTIONESCDIR    -SDRATTR_START]=new SdrCaptionEscDirItem    ;
118 	mppLocalPoolDefaults[SDRATTR_CAPTIONESCISREL  -SDRATTR_START]=new SdrCaptionEscIsRelItem  ;
119 	mppLocalPoolDefaults[SDRATTR_CAPTIONESCREL    -SDRATTR_START]=new SdrCaptionEscRelItem    ;
120 	mppLocalPoolDefaults[SDRATTR_CAPTIONESCABS    -SDRATTR_START]=new SdrCaptionEscAbsItem    ;
121 	mppLocalPoolDefaults[SDRATTR_CAPTIONLINELEN   -SDRATTR_START]=new SdrCaptionLineLenItem   ;
122 	mppLocalPoolDefaults[SDRATTR_CAPTIONFITLINELEN-SDRATTR_START]=new SdrCaptionFitLineLenItem;
123 	mppLocalPoolDefaults[SDRATTR_ECKENRADIUS			-SDRATTR_START]=new SdrEckenradiusItem;
124 	mppLocalPoolDefaults[SDRATTR_TEXT_MINFRAMEHEIGHT	-SDRATTR_START]=new SdrTextMinFrameHeightItem;
125 	mppLocalPoolDefaults[SDRATTR_TEXT_AUTOGROWHEIGHT	-SDRATTR_START]=new SdrTextAutoGrowHeightItem;
126 	mppLocalPoolDefaults[SDRATTR_TEXT_FITTOSIZE		-SDRATTR_START]=new SdrTextFitToSizeTypeItem;
127 	mppLocalPoolDefaults[SDRATTR_TEXT_LEFTDIST		-SDRATTR_START]=new SdrTextLeftDistItem;
128 	mppLocalPoolDefaults[SDRATTR_TEXT_RIGHTDIST		-SDRATTR_START]=new SdrTextRightDistItem;
129 	mppLocalPoolDefaults[SDRATTR_TEXT_UPPERDIST		-SDRATTR_START]=new SdrTextUpperDistItem;
130 	mppLocalPoolDefaults[SDRATTR_TEXT_LOWERDIST		-SDRATTR_START]=new SdrTextLowerDistItem;
131 	mppLocalPoolDefaults[SDRATTR_TEXT_VERTADJUST		-SDRATTR_START]=new SdrTextVertAdjustItem;
132 	mppLocalPoolDefaults[SDRATTR_TEXT_MAXFRAMEHEIGHT	-SDRATTR_START]=new SdrTextMaxFrameHeightItem;
133 	mppLocalPoolDefaults[SDRATTR_TEXT_MINFRAMEWIDTH	-SDRATTR_START]=new SdrTextMinFrameWidthItem;
134 	mppLocalPoolDefaults[SDRATTR_TEXT_MAXFRAMEWIDTH	-SDRATTR_START]=new SdrTextMaxFrameWidthItem;
135 	mppLocalPoolDefaults[SDRATTR_TEXT_AUTOGROWWIDTH	-SDRATTR_START]=new SdrTextAutoGrowWidthItem;
136 	mppLocalPoolDefaults[SDRATTR_TEXT_HORZADJUST		-SDRATTR_START]=new SdrTextHorzAdjustItem;
137 	mppLocalPoolDefaults[SDRATTR_TEXT_ANIKIND			-SDRATTR_START]=new SdrTextAniKindItem;
138 	mppLocalPoolDefaults[SDRATTR_TEXT_ANIDIRECTION	-SDRATTR_START]=new SdrTextAniDirectionItem;
139 	mppLocalPoolDefaults[SDRATTR_TEXT_ANISTARTINSIDE	-SDRATTR_START]=new SdrTextAniStartInsideItem;
140 	mppLocalPoolDefaults[SDRATTR_TEXT_ANISTOPINSIDE	-SDRATTR_START]=new SdrTextAniStopInsideItem;
141 	mppLocalPoolDefaults[SDRATTR_TEXT_ANICOUNT		-SDRATTR_START]=new SdrTextAniCountItem;
142 	mppLocalPoolDefaults[SDRATTR_TEXT_ANIDELAY		-SDRATTR_START]=new SdrTextAniDelayItem;
143 	mppLocalPoolDefaults[SDRATTR_TEXT_ANIAMOUNT		-SDRATTR_START]=new SdrTextAniAmountItem;
144 	mppLocalPoolDefaults[SDRATTR_TEXT_CONTOURFRAME	-SDRATTR_START]=new SdrTextContourFrameItem;
145 	mppLocalPoolDefaults[SDRATTR_CUSTOMSHAPE_ADJUSTMENT -SDRATTR_START]=new SdrCustomShapeAdjustmentItem;
146 	mppLocalPoolDefaults[SDRATTR_XMLATTRIBUTES -SDRATTR_START]=new SvXMLAttrContainerItem( SDRATTR_XMLATTRIBUTES );
147 	mppLocalPoolDefaults[SDRATTR_TEXT_USEFIXEDCELLHEIGHT -SDRATTR_START]=new SdrTextFixedCellHeightItem;
148 	mppLocalPoolDefaults[SDRATTR_TEXT_WORDWRAP		   -SDRATTR_START]=new SdrTextWordWrapItem;
149 	mppLocalPoolDefaults[SDRATTR_TEXT_AUTOGROWSIZE	   -SDRATTR_START]=new SdrTextAutoGrowSizeItem;
150 	mppLocalPoolDefaults[SDRATTR_EDGEKIND         -SDRATTR_START]=new SdrEdgeKindItem;
151 	mppLocalPoolDefaults[SDRATTR_EDGENODE1HORZDIST-SDRATTR_START]=new SdrEdgeNode1HorzDistItem(nDefEdgeDist);
152 	mppLocalPoolDefaults[SDRATTR_EDGENODE1VERTDIST-SDRATTR_START]=new SdrEdgeNode1VertDistItem(nDefEdgeDist);
153 	mppLocalPoolDefaults[SDRATTR_EDGENODE2HORZDIST-SDRATTR_START]=new SdrEdgeNode2HorzDistItem(nDefEdgeDist);
154 	mppLocalPoolDefaults[SDRATTR_EDGENODE2VERTDIST-SDRATTR_START]=new SdrEdgeNode2VertDistItem(nDefEdgeDist);
155 	mppLocalPoolDefaults[SDRATTR_EDGENODE1GLUEDIST-SDRATTR_START]=new SdrEdgeNode1GlueDistItem;
156 	mppLocalPoolDefaults[SDRATTR_EDGENODE2GLUEDIST-SDRATTR_START]=new SdrEdgeNode2GlueDistItem;
157 	mppLocalPoolDefaults[SDRATTR_EDGELINEDELTAANZ -SDRATTR_START]=new SdrEdgeLineDeltaAnzItem;
158 	mppLocalPoolDefaults[SDRATTR_EDGELINE1DELTA   -SDRATTR_START]=new SdrEdgeLine1DeltaItem;
159 	mppLocalPoolDefaults[SDRATTR_EDGELINE2DELTA   -SDRATTR_START]=new SdrEdgeLine2DeltaItem;
160 	mppLocalPoolDefaults[SDRATTR_EDGELINE3DELTA   -SDRATTR_START]=new SdrEdgeLine3DeltaItem;
161 	mppLocalPoolDefaults[SDRATTR_MEASUREKIND             -SDRATTR_START]=new SdrMeasureKindItem;
162 	mppLocalPoolDefaults[SDRATTR_MEASURETEXTHPOS         -SDRATTR_START]=new SdrMeasureTextHPosItem;
163 	mppLocalPoolDefaults[SDRATTR_MEASURETEXTVPOS         -SDRATTR_START]=new SdrMeasureTextVPosItem;
164 	mppLocalPoolDefaults[SDRATTR_MEASURELINEDIST         -SDRATTR_START]=new SdrMeasureLineDistItem(800);
165 	mppLocalPoolDefaults[SDRATTR_MEASUREHELPLINEOVERHANG -SDRATTR_START]=new SdrMeasureHelplineOverhangItem(200);
166 	mppLocalPoolDefaults[SDRATTR_MEASUREHELPLINEDIST     -SDRATTR_START]=new SdrMeasureHelplineDistItem(100);
167 	mppLocalPoolDefaults[SDRATTR_MEASUREHELPLINE1LEN     -SDRATTR_START]=new SdrMeasureHelpline1LenItem;
168 	mppLocalPoolDefaults[SDRATTR_MEASUREHELPLINE2LEN     -SDRATTR_START]=new SdrMeasureHelpline2LenItem;
169 	mppLocalPoolDefaults[SDRATTR_MEASUREBELOWREFEDGE     -SDRATTR_START]=new SdrMeasureBelowRefEdgeItem;
170 	mppLocalPoolDefaults[SDRATTR_MEASURETEXTROTA90       -SDRATTR_START]=new SdrMeasureTextRota90Item;
171 	mppLocalPoolDefaults[SDRATTR_MEASURETEXTUPSIDEDOWN   -SDRATTR_START]=new SdrMeasureTextUpsideDownItem;
172 	mppLocalPoolDefaults[SDRATTR_MEASUREOVERHANG         -SDRATTR_START]=new SdrMeasureOverhangItem(600);
173 	mppLocalPoolDefaults[SDRATTR_MEASUREUNIT             -SDRATTR_START]=new SdrMeasureUnitItem;
174 	mppLocalPoolDefaults[SDRATTR_MEASURESCALE            -SDRATTR_START]=new SdrMeasureScaleItem;
175 	mppLocalPoolDefaults[SDRATTR_MEASURESHOWUNIT         -SDRATTR_START]=new SdrMeasureShowUnitItem;
176 	mppLocalPoolDefaults[SDRATTR_MEASUREFORMATSTRING     -SDRATTR_START]=new SdrMeasureFormatStringItem();
177 	mppLocalPoolDefaults[SDRATTR_MEASURETEXTAUTOANGLE    -SDRATTR_START]=new SdrMeasureTextAutoAngleItem();
178 	mppLocalPoolDefaults[SDRATTR_MEASURETEXTAUTOANGLEVIEW-SDRATTR_START]=new SdrMeasureTextAutoAngleViewItem();
179 	mppLocalPoolDefaults[SDRATTR_MEASURETEXTISFIXEDANGLE -SDRATTR_START]=new SdrMeasureTextIsFixedAngleItem();
180 	mppLocalPoolDefaults[SDRATTR_MEASURETEXTFIXEDANGLE   -SDRATTR_START]=new SdrMeasureTextFixedAngleItem();
181 	mppLocalPoolDefaults[SDRATTR_MEASUREDECIMALPLACES    -SDRATTR_START]=new SdrMeasureDecimalPlacesItem();
182 	mppLocalPoolDefaults[SDRATTR_CIRCKIND      -SDRATTR_START]=new SdrCircKindItem;
183 	mppLocalPoolDefaults[SDRATTR_CIRCSTARTANGLE-SDRATTR_START]=new SdrCircStartAngleItem;
184 	mppLocalPoolDefaults[SDRATTR_CIRCENDANGLE  -SDRATTR_START]=new SdrCircEndAngleItem;
185 	mppLocalPoolDefaults[SDRATTR_OBJMOVEPROTECT -SDRATTR_START]=new SdrObjMoveProtectItem;
186 	mppLocalPoolDefaults[SDRATTR_OBJSIZEPROTECT -SDRATTR_START]=new SdrObjSizeProtectItem;
187 	mppLocalPoolDefaults[SDRATTR_OBJPRINTABLE   -SDRATTR_START]=new SdrObjPrintableItem;
188 	mppLocalPoolDefaults[SDRATTR_OBJVISIBLE		-SDRATTR_START]=new SdrObjVisibleItem;
189 	mppLocalPoolDefaults[SDRATTR_LAYERID        -SDRATTR_START]=new SdrLayerIdItem;
190 	mppLocalPoolDefaults[SDRATTR_LAYERNAME      -SDRATTR_START]=new SdrLayerNameItem;
191 	mppLocalPoolDefaults[SDRATTR_OBJECTNAME     -SDRATTR_START]=new SdrObjectNameItem;
192 	mppLocalPoolDefaults[SDRATTR_ALLPOSITIONX   -SDRATTR_START]=new SdrAllPositionXItem;
193 	mppLocalPoolDefaults[SDRATTR_ALLPOSITIONY   -SDRATTR_START]=new SdrAllPositionYItem;
194 	mppLocalPoolDefaults[SDRATTR_ALLSIZEWIDTH   -SDRATTR_START]=new SdrAllSizeWidthItem;
195 	mppLocalPoolDefaults[SDRATTR_ALLSIZEHEIGHT  -SDRATTR_START]=new SdrAllSizeHeightItem;
196 	mppLocalPoolDefaults[SDRATTR_ONEPOSITIONX   -SDRATTR_START]=new SdrOnePositionXItem;
197 	mppLocalPoolDefaults[SDRATTR_ONEPOSITIONY   -SDRATTR_START]=new SdrOnePositionYItem;
198 	mppLocalPoolDefaults[SDRATTR_ONESIZEWIDTH   -SDRATTR_START]=new SdrOneSizeWidthItem;
199 	mppLocalPoolDefaults[SDRATTR_ONESIZEHEIGHT  -SDRATTR_START]=new SdrOneSizeHeightItem;
200 	mppLocalPoolDefaults[SDRATTR_LOGICSIZEWIDTH -SDRATTR_START]=new SdrLogicSizeWidthItem;
201 	mppLocalPoolDefaults[SDRATTR_LOGICSIZEHEIGHT-SDRATTR_START]=new SdrLogicSizeHeightItem;
202 	mppLocalPoolDefaults[SDRATTR_ROTATEANGLE    -SDRATTR_START]=new SdrRotateAngleItem;
203 	mppLocalPoolDefaults[SDRATTR_SHEARANGLE     -SDRATTR_START]=new SdrShearAngleItem;
204 	mppLocalPoolDefaults[SDRATTR_MOVEX          -SDRATTR_START]=new SdrMoveXItem;
205 	mppLocalPoolDefaults[SDRATTR_MOVEY          -SDRATTR_START]=new SdrMoveYItem;
206 	mppLocalPoolDefaults[SDRATTR_RESIZEXONE     -SDRATTR_START]=new SdrResizeXOneItem;
207 	mppLocalPoolDefaults[SDRATTR_RESIZEYONE     -SDRATTR_START]=new SdrResizeYOneItem;
208 	mppLocalPoolDefaults[SDRATTR_ROTATEONE      -SDRATTR_START]=new SdrRotateOneItem;
209 	mppLocalPoolDefaults[SDRATTR_HORZSHEARONE   -SDRATTR_START]=new SdrHorzShearOneItem;
210 	mppLocalPoolDefaults[SDRATTR_VERTSHEARONE   -SDRATTR_START]=new SdrVertShearOneItem;
211 	mppLocalPoolDefaults[SDRATTR_RESIZEXALL     -SDRATTR_START]=new SdrResizeXAllItem;
212 	mppLocalPoolDefaults[SDRATTR_RESIZEYALL     -SDRATTR_START]=new SdrResizeYAllItem;
213 	mppLocalPoolDefaults[SDRATTR_ROTATEALL      -SDRATTR_START]=new SdrRotateAllItem;
214 	mppLocalPoolDefaults[SDRATTR_HORZSHEARALL   -SDRATTR_START]=new SdrHorzShearAllItem;
215 	mppLocalPoolDefaults[SDRATTR_VERTSHEARALL   -SDRATTR_START]=new SdrVertShearAllItem;
216 	mppLocalPoolDefaults[SDRATTR_TRANSFORMREF1X -SDRATTR_START]=new SdrTransformRef1XItem;
217 	mppLocalPoolDefaults[SDRATTR_TRANSFORMREF1Y -SDRATTR_START]=new SdrTransformRef1YItem;
218 	mppLocalPoolDefaults[SDRATTR_TRANSFORMREF2X -SDRATTR_START]=new SdrTransformRef2XItem;
219 	mppLocalPoolDefaults[SDRATTR_TRANSFORMREF2Y -SDRATTR_START]=new SdrTransformRef2YItem;
220     mppLocalPoolDefaults[SDRATTR_TEXTDIRECTION  -SDRATTR_START]=new SvxWritingModeItem(com::sun::star::text::WritingMode_LR_TB, SDRATTR_TEXTDIRECTION);
221 	mppLocalPoolDefaults[ SDRATTR_GRAFRED				- SDRATTR_START] = new SdrGrafRedItem;
222 	mppLocalPoolDefaults[ SDRATTR_GRAFGREEN			- SDRATTR_START] = new SdrGrafGreenItem;
223 	mppLocalPoolDefaults[ SDRATTR_GRAFBLUE			- SDRATTR_START] = new SdrGrafBlueItem;
224 	mppLocalPoolDefaults[ SDRATTR_GRAFLUMINANCE		- SDRATTR_START] = new SdrGrafLuminanceItem;
225 	mppLocalPoolDefaults[ SDRATTR_GRAFCONTRAST		- SDRATTR_START] = new SdrGrafContrastItem;
226 	mppLocalPoolDefaults[ SDRATTR_GRAFGAMMA			- SDRATTR_START] = new SdrGrafGamma100Item;
227 	mppLocalPoolDefaults[ SDRATTR_GRAFTRANSPARENCE	- SDRATTR_START] = new SdrGrafTransparenceItem;
228 	mppLocalPoolDefaults[ SDRATTR_GRAFINVERT			- SDRATTR_START] = new SdrGrafInvertItem;
229 	mppLocalPoolDefaults[ SDRATTR_GRAFMODE			- SDRATTR_START] = new SdrGrafModeItem;
230 	mppLocalPoolDefaults[ SDRATTR_GRAFCROP			- SDRATTR_START] = new SdrGrafCropItem;
231 	mppLocalPoolDefaults[ SDRATTR_3DOBJ_PERCENT_DIAGONAL - SDRATTR_START ] = new Svx3DPercentDiagonalItem;
232 	mppLocalPoolDefaults[ SDRATTR_3DOBJ_BACKSCALE - SDRATTR_START ] = new Svx3DBackscaleItem;
233 	mppLocalPoolDefaults[ SDRATTR_3DOBJ_DEPTH - SDRATTR_START ] = new Svx3DDepthItem;
234 	mppLocalPoolDefaults[ SDRATTR_3DOBJ_HORZ_SEGS - SDRATTR_START ] = new Svx3DHorizontalSegmentsItem;
235 	mppLocalPoolDefaults[ SDRATTR_3DOBJ_VERT_SEGS - SDRATTR_START ] = new Svx3DVerticalSegmentsItem;
236 	mppLocalPoolDefaults[ SDRATTR_3DOBJ_END_ANGLE - SDRATTR_START ] = new Svx3DEndAngleItem;
237 	mppLocalPoolDefaults[ SDRATTR_3DOBJ_DOUBLE_SIDED - SDRATTR_START ] = new Svx3DDoubleSidedItem;
238 	mppLocalPoolDefaults[ SDRATTR_3DOBJ_NORMALS_KIND - SDRATTR_START ] = new Svx3DNormalsKindItem;
239 	mppLocalPoolDefaults[ SDRATTR_3DOBJ_NORMALS_INVERT - SDRATTR_START ] = new Svx3DNormalsInvertItem;
240 	mppLocalPoolDefaults[ SDRATTR_3DOBJ_TEXTURE_PROJ_X - SDRATTR_START ] = new Svx3DTextureProjectionXItem;
241 	mppLocalPoolDefaults[ SDRATTR_3DOBJ_TEXTURE_PROJ_Y - SDRATTR_START ] = new Svx3DTextureProjectionYItem;
242 	mppLocalPoolDefaults[ SDRATTR_3DOBJ_SHADOW_3D - SDRATTR_START ] = new Svx3DShadow3DItem;
243 	mppLocalPoolDefaults[ SDRATTR_3DOBJ_MAT_COLOR - SDRATTR_START ] = new Svx3DMaterialColorItem;
244 	mppLocalPoolDefaults[ SDRATTR_3DOBJ_MAT_EMISSION - SDRATTR_START ] = new Svx3DMaterialEmissionItem;
245 	mppLocalPoolDefaults[ SDRATTR_3DOBJ_MAT_SPECULAR - SDRATTR_START ] = new Svx3DMaterialSpecularItem;
246 	mppLocalPoolDefaults[ SDRATTR_3DOBJ_MAT_SPECULAR_INTENSITY - SDRATTR_START ] = new Svx3DMaterialSpecularIntensityItem;
247 	mppLocalPoolDefaults[ SDRATTR_3DOBJ_TEXTURE_KIND - SDRATTR_START ] = new Svx3DTextureKindItem;
248 	mppLocalPoolDefaults[ SDRATTR_3DOBJ_TEXTURE_MODE - SDRATTR_START ] = new Svx3DTextureModeItem;
249 	mppLocalPoolDefaults[ SDRATTR_3DOBJ_TEXTURE_FILTER - SDRATTR_START ] = new Svx3DTextureFilterItem;
250 	mppLocalPoolDefaults[ SDRATTR_3DOBJ_SMOOTH_NORMALS - SDRATTR_START ] = new Svx3DSmoothNormalsItem;
251 	mppLocalPoolDefaults[ SDRATTR_3DOBJ_SMOOTH_LIDS - SDRATTR_START ] = new Svx3DSmoothLidsItem;
252 	mppLocalPoolDefaults[ SDRATTR_3DOBJ_CHARACTER_MODE - SDRATTR_START ] = new Svx3DCharacterModeItem;
253 	mppLocalPoolDefaults[ SDRATTR_3DOBJ_CLOSE_FRONT - SDRATTR_START ] = new Svx3DCloseFrontItem;
254 	mppLocalPoolDefaults[ SDRATTR_3DOBJ_CLOSE_BACK - SDRATTR_START ] = new Svx3DCloseBackItem;
255 	mppLocalPoolDefaults[ SDRATTR_3DOBJ_REDUCED_LINE_GEOMETRY - SDRATTR_START ] = new Svx3DReducedLineGeometryItem;
256 	mppLocalPoolDefaults[ SDRATTR_3DSCENE_PERSPECTIVE - SDRATTR_START ] = new Svx3DPerspectiveItem;
257 	mppLocalPoolDefaults[ SDRATTR_3DSCENE_DISTANCE - SDRATTR_START ] = new Svx3DDistanceItem;
258 	mppLocalPoolDefaults[ SDRATTR_3DSCENE_FOCAL_LENGTH - SDRATTR_START ] = new Svx3DFocalLengthItem;
259 	mppLocalPoolDefaults[ SDRATTR_3DSCENE_TWO_SIDED_LIGHTING - SDRATTR_START ] = new Svx3DTwoSidedLightingItem;
260 	mppLocalPoolDefaults[ SDRATTR_3DSCENE_LIGHTCOLOR_1 - SDRATTR_START ] = new Svx3DLightcolor1Item;
261 	mppLocalPoolDefaults[ SDRATTR_3DSCENE_LIGHTCOLOR_2 - SDRATTR_START ] = new Svx3DLightcolor2Item;
262 	mppLocalPoolDefaults[ SDRATTR_3DSCENE_LIGHTCOLOR_3 - SDRATTR_START ] = new Svx3DLightcolor3Item;
263 	mppLocalPoolDefaults[ SDRATTR_3DSCENE_LIGHTCOLOR_4 - SDRATTR_START ] = new Svx3DLightcolor4Item;
264 	mppLocalPoolDefaults[ SDRATTR_3DSCENE_LIGHTCOLOR_5 - SDRATTR_START ] = new Svx3DLightcolor5Item;
265 	mppLocalPoolDefaults[ SDRATTR_3DSCENE_LIGHTCOLOR_6 - SDRATTR_START ] = new Svx3DLightcolor6Item;
266 	mppLocalPoolDefaults[ SDRATTR_3DSCENE_LIGHTCOLOR_7 - SDRATTR_START ] = new Svx3DLightcolor7Item;
267 	mppLocalPoolDefaults[ SDRATTR_3DSCENE_LIGHTCOLOR_8 - SDRATTR_START ] = new Svx3DLightcolor8Item;
268 	mppLocalPoolDefaults[ SDRATTR_3DSCENE_AMBIENTCOLOR - SDRATTR_START ] = new Svx3DAmbientcolorItem;
269 	mppLocalPoolDefaults[ SDRATTR_3DSCENE_LIGHTON_1 - SDRATTR_START ] = new Svx3DLightOnOff1Item;
270 	mppLocalPoolDefaults[ SDRATTR_3DSCENE_LIGHTON_2 - SDRATTR_START ] = new Svx3DLightOnOff2Item;
271 	mppLocalPoolDefaults[ SDRATTR_3DSCENE_LIGHTON_3 - SDRATTR_START ] = new Svx3DLightOnOff3Item;
272 	mppLocalPoolDefaults[ SDRATTR_3DSCENE_LIGHTON_4 - SDRATTR_START ] = new Svx3DLightOnOff4Item;
273 	mppLocalPoolDefaults[ SDRATTR_3DSCENE_LIGHTON_5 - SDRATTR_START ] = new Svx3DLightOnOff5Item;
274 	mppLocalPoolDefaults[ SDRATTR_3DSCENE_LIGHTON_6 - SDRATTR_START ] = new Svx3DLightOnOff6Item;
275 	mppLocalPoolDefaults[ SDRATTR_3DSCENE_LIGHTON_7 - SDRATTR_START ] = new Svx3DLightOnOff7Item;
276 	mppLocalPoolDefaults[ SDRATTR_3DSCENE_LIGHTON_8 - SDRATTR_START ] = new Svx3DLightOnOff8Item;
277 	mppLocalPoolDefaults[ SDRATTR_3DSCENE_LIGHTDIRECTION_1 - SDRATTR_START ] = new Svx3DLightDirection1Item;
278 	mppLocalPoolDefaults[ SDRATTR_3DSCENE_LIGHTDIRECTION_2 - SDRATTR_START ] = new Svx3DLightDirection2Item;
279 	mppLocalPoolDefaults[ SDRATTR_3DSCENE_LIGHTDIRECTION_3 - SDRATTR_START ] = new Svx3DLightDirection3Item;
280 	mppLocalPoolDefaults[ SDRATTR_3DSCENE_LIGHTDIRECTION_4 - SDRATTR_START ] = new Svx3DLightDirection4Item;
281 	mppLocalPoolDefaults[ SDRATTR_3DSCENE_LIGHTDIRECTION_5 - SDRATTR_START ] = new Svx3DLightDirection5Item;
282 	mppLocalPoolDefaults[ SDRATTR_3DSCENE_LIGHTDIRECTION_6 - SDRATTR_START ] = new Svx3DLightDirection6Item;
283 	mppLocalPoolDefaults[ SDRATTR_3DSCENE_LIGHTDIRECTION_7 - SDRATTR_START ] = new Svx3DLightDirection7Item;
284 	mppLocalPoolDefaults[ SDRATTR_3DSCENE_LIGHTDIRECTION_8 - SDRATTR_START ] = new Svx3DLightDirection8Item;
285 	mppLocalPoolDefaults[ SDRATTR_3DSCENE_SHADOW_SLANT - SDRATTR_START ] = new Svx3DShadowSlantItem;
286 	mppLocalPoolDefaults[ SDRATTR_3DSCENE_SHADE_MODE - SDRATTR_START ] = new Svx3DShadeModeItem;
287 	mppLocalPoolDefaults[ SDRATTR_CUSTOMSHAPE_ENGINE - SDRATTR_START ] = new SdrCustomShapeEngineItem;
288 	mppLocalPoolDefaults[ SDRATTR_CUSTOMSHAPE_DATA - SDRATTR_START ] = new SdrCustomShapeDataItem;
289 	mppLocalPoolDefaults[ SDRATTR_CUSTOMSHAPE_GEOMETRY - SDRATTR_START ] = new SdrCustomShapeGeometryItem;
290 	mppLocalPoolDefaults[ SDRATTR_CUSTOMSHAPE_REPLACEMENT_URL - SDRATTR_START ] = new SdrCustomShapeReplacementURLItem;
291 
292 	SvxBoxItem* pboxItem = new SvxBoxItem( SDRATTR_TABLE_BORDER );
293 	pboxItem->SetDistance( 100 );
294 	mppLocalPoolDefaults[ SDRATTR_TABLE_BORDER - SDRATTR_START ] = pboxItem;
295 
296 	SvxBoxInfoItem* pBoxInfoItem = new SvxBoxInfoItem( SDRATTR_TABLE_BORDER_INNER );
297 
298 	pBoxInfoItem->SetTable( sal_True );
299 	pBoxInfoItem->SetDist( sal_True);        // Abstandsfeld immer anzeigen
300 //	pBoxInfoItem->SetMinDist( sal_True );// Minimalgroesse in Tabellen und Absaetzen setzen
301 //	pBoxInfoItem->SetDefDist( MIN_BORDER_DIST );// Default-Abstand immer setzen
302 	pBoxInfoItem->SetValid( VALID_DISABLE, sal_True ); // Einzelne Linien koennen nur in Tabellen DontCare-Status haben
303 
304 	mppLocalPoolDefaults[ SDRATTR_TABLE_BORDER_INNER - SDRATTR_START ] =  pBoxInfoItem;
305 //	mppLocalPoolDefaults[ SDRATTR_TABLE_BORDER_SHADOW - SDRATTR_START ] = new SvxShadowItem( SDRATTR_TABLE_BORDER_SHADOW );
306     mppLocalPoolDefaults[ SDRATTR_TABLE_BORDER_TLBR - SDRATTR_START ] = new SvxLineItem( SDRATTR_TABLE_BORDER_TLBR );
307     mppLocalPoolDefaults[ SDRATTR_TABLE_BORDER_BLTR - SDRATTR_START ] = new SvxLineItem( SDRATTR_TABLE_BORDER_BLTR );
308 
309 	// set own ItemInfos
310 	mpLocalItemInfos[SDRATTR_SHADOW-SDRATTR_START]._nSID=SID_ATTR_FILL_SHADOW;
311 	mpLocalItemInfos[SDRATTR_TEXT_FITTOSIZE-SDRATTR_START]._nSID=SID_ATTR_TEXT_FITTOSIZE;
312 	mpLocalItemInfos[SDRATTR_GRAFCROP-SDRATTR_START]._nSID=SID_ATTR_GRAF_CROP;
313 
314 	mpLocalItemInfos[SDRATTR_TABLE_BORDER - SDRATTR_START ]._nSID = SID_ATTR_BORDER_OUTER;
315 	mpLocalItemInfos[SDRATTR_TABLE_BORDER_INNER - SDRATTR_START ]._nSID = SID_ATTR_BORDER_INNER;
316 //	mpLocalItemInfos[SDRATTR_TABLE_BORDER_SHADOW - SDRATTR_START ]._nSID = SID_ATTR_BORDER_SHADOW;
317 	mpLocalItemInfos[SDRATTR_TABLE_BORDER_TLBR - SDRATTR_START ]._nSID = SID_ATTR_BORDER_DIAG_TLBR;
318 	mpLocalItemInfos[SDRATTR_TABLE_BORDER_BLTR - SDRATTR_START ]._nSID = SID_ATTR_BORDER_DIAG_BLTR;
319 
320 	// it's my own creation level, set Defaults and ItemInfos
321 	SetDefaults(mppLocalPoolDefaults);
322 	SetItemInfos(mpLocalItemInfos);
323 }
324 
325 /*************************************************************************
326 |*
327 |* copy ctor, sorgt dafuer, dass die static defaults gecloned werden
328 |*            (Parameter 2 = sal_True)
329 |*
330 \************************************************************************/
331 
SdrItemPool(const SdrItemPool & rPool)332 SdrItemPool::SdrItemPool(const SdrItemPool& rPool)
333 :	XOutdevItemPool(rPool)
334 {
335 }
336 
337 /*************************************************************************
338 |*
339 |* Clone()
340 |*
341 \************************************************************************/
342 
Clone() const343 SfxItemPool* __EXPORT SdrItemPool::Clone() const
344 {
345 	return new SdrItemPool(*this);
346 }
347 
348 /*************************************************************************
349 |*
350 |* Destruktor
351 |*
352 \************************************************************************/
353 
~SdrItemPool()354 SdrItemPool::~SdrItemPool()
355 {
356 	// dtor of SfxItemPool
357 	Delete();
358 
359 	// clear own static Defaults
360 	if(mppLocalPoolDefaults)
361 	{
362 		const sal_uInt16 nBeg(SDRATTR_SHADOW_FIRST - SDRATTR_START);
363 		const sal_uInt16 nEnd2(SDRATTR_END - SDRATTR_START);
364 
365 		for(sal_uInt16 i(nBeg); i <= nEnd2; i++)
366 		{
367 			SetRefCount(*mppLocalPoolDefaults[i],0);
368 			delete mppLocalPoolDefaults[i];
369 			mppLocalPoolDefaults[i] = 0L;
370 		}
371 	}
372 
373 	// split pools before detroying
374 	SetSecondaryPool(NULL);
375 }
376 
GetPresentation(const SfxPoolItem & rItem,SfxItemPresentation ePresentation,SfxMapUnit ePresentationMetric,XubString & rText,const IntlWrapper * pIntlWrapper) const377 SfxItemPresentation __EXPORT SdrItemPool::GetPresentation(
378 			  const SfxPoolItem& rItem, SfxItemPresentation ePresentation,
379 			  SfxMapUnit ePresentationMetric, XubString& rText,
380               const IntlWrapper * pIntlWrapper) const
381 {
382 	if (!IsInvalidItem(&rItem)) {
383 		sal_uInt16 nWhich=rItem.Which();
384 		if (nWhich>=SDRATTR_SHADOW_FIRST && nWhich<=SDRATTR_END) {
385 			rItem.GetPresentation(SFX_ITEM_PRESENTATION_NAMELESS,
386 						GetMetric(nWhich),ePresentationMetric,rText,
387                         pIntlWrapper);
388 			String aStr;
389 
390 			TakeItemName(nWhich, aStr);
391 			aStr += sal_Unicode(' ');
392 			rText.Insert(aStr, 0);
393 
394 			return ePresentation;
395 		}
396 	}
397     return XOutdevItemPool::GetPresentation(rItem,ePresentation,ePresentationMetric,rText,pIntlWrapper);
398 }
399 
TakeItemName(sal_uInt16 nWhich,String & rItemName)400 void SdrItemPool::TakeItemName(sal_uInt16 nWhich, String& rItemName)
401 {
402 	ResMgr* pResMgr = ImpGetResMgr();
403 	sal_uInt16	nResId = SIP_UNKNOWN_ATTR;
404 
405 	switch (nWhich)
406 	{
407 		case XATTR_LINESTYLE        : nResId = SIP_XA_LINESTYLE;break;
408 		case XATTR_LINEDASH         : nResId = SIP_XA_LINEDASH;break;
409 		case XATTR_LINEWIDTH        : nResId = SIP_XA_LINEWIDTH;break;
410 		case XATTR_LINECOLOR        : nResId = SIP_XA_LINECOLOR;break;
411 		case XATTR_LINESTART        : nResId = SIP_XA_LINESTART;break;
412 		case XATTR_LINEEND          : nResId = SIP_XA_LINEEND;break;
413 		case XATTR_LINESTARTWIDTH   : nResId = SIP_XA_LINESTARTWIDTH;break;
414 		case XATTR_LINEENDWIDTH     : nResId = SIP_XA_LINEENDWIDTH;break;
415 		case XATTR_LINESTARTCENTER  : nResId = SIP_XA_LINESTARTCENTER;break;
416 		case XATTR_LINEENDCENTER    : nResId = SIP_XA_LINEENDCENTER;break;
417 		case XATTR_LINETRANSPARENCE : nResId = SIP_XA_LINETRANSPARENCE;break;
418 		case XATTR_LINEJOINT		: nResId = SIP_XA_LINEJOINT;break;
419 		case XATTRSET_LINE          : nResId = SIP_XATTRSET_LINE;break;
420 
421 		case XATTR_FILLSTYLE			: nResId = SIP_XA_FILLSTYLE;break;
422 		case XATTR_FILLCOLOR			: nResId = SIP_XA_FILLCOLOR;break;
423 		case XATTR_FILLGRADIENT			: nResId = SIP_XA_FILLGRADIENT;break;
424 		case XATTR_FILLHATCH			: nResId = SIP_XA_FILLHATCH;break;
425 		case XATTR_FILLBITMAP			: nResId = SIP_XA_FILLBITMAP;break;
426 		case XATTR_FILLTRANSPARENCE		: nResId = SIP_XA_FILLTRANSPARENCE;break;
427 		case XATTR_GRADIENTSTEPCOUNT	: nResId = SIP_XA_GRADIENTSTEPCOUNT;break;
428 		case XATTR_FILLBMP_TILE			: nResId = SIP_XA_FILLBMP_TILE;break;
429 		case XATTR_FILLBMP_POS			: nResId = SIP_XA_FILLBMP_POS;break;
430 		case XATTR_FILLBMP_SIZEX		: nResId = SIP_XA_FILLBMP_SIZEX;break;
431 		case XATTR_FILLBMP_SIZEY		: nResId = SIP_XA_FILLBMP_SIZEY;break;
432 		case XATTR_FILLFLOATTRANSPARENCE: nResId = SIP_XA_FILLFLOATTRANSPARENCE;break;
433 		case XATTR_SECONDARYFILLCOLOR	: nResId = SIP_XA_SECONDARYFILLCOLOR;break;
434 		case XATTR_FILLBMP_SIZELOG		: nResId = SIP_XA_FILLBMP_SIZELOG;break;
435 		case XATTR_FILLBMP_TILEOFFSETX	: nResId = SIP_XA_FILLBMP_TILEOFFSETX;break;
436 		case XATTR_FILLBMP_TILEOFFSETY	: nResId = SIP_XA_FILLBMP_TILEOFFSETY;break;
437 		case XATTR_FILLBMP_STRETCH		: nResId = SIP_XA_FILLBMP_STRETCH;break;
438 		case XATTR_FILLBMP_POSOFFSETX	: nResId = SIP_XA_FILLBMP_POSOFFSETX;break;
439 		case XATTR_FILLBMP_POSOFFSETY	: nResId = SIP_XA_FILLBMP_POSOFFSETY;break;
440 		case XATTR_FILLBACKGROUND		: nResId = SIP_XA_FILLBACKGROUND;break;
441 
442 		case XATTRSET_FILL             : nResId = SIP_XATTRSET_FILL;break;
443 
444 		case XATTR_FORMTXTSTYLE     : nResId = SIP_XA_FORMTXTSTYLE;break;
445 		case XATTR_FORMTXTADJUST    : nResId = SIP_XA_FORMTXTADJUST;break;
446 		case XATTR_FORMTXTDISTANCE  : nResId = SIP_XA_FORMTXTDISTANCE;break;
447 		case XATTR_FORMTXTSTART     : nResId = SIP_XA_FORMTXTSTART;break;
448 		case XATTR_FORMTXTMIRROR    : nResId = SIP_XA_FORMTXTMIRROR;break;
449 		case XATTR_FORMTXTOUTLINE   : nResId = SIP_XA_FORMTXTOUTLINE;break;
450 		case XATTR_FORMTXTSHADOW    : nResId = SIP_XA_FORMTXTSHADOW;break;
451 		case XATTR_FORMTXTSHDWCOLOR : nResId = SIP_XA_FORMTXTSHDWCOLOR;break;
452 		case XATTR_FORMTXTSHDWXVAL  : nResId = SIP_XA_FORMTXTSHDWXVAL;break;
453 		case XATTR_FORMTXTSHDWYVAL  : nResId = SIP_XA_FORMTXTSHDWYVAL;break;
454 		case XATTR_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 
SdrFractionItem(sal_uInt16 nId,SvStream & rIn)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 
operator ==(const SfxPoolItem & rCmp) const639 int __EXPORT SdrFractionItem::operator==(const SfxPoolItem& rCmp) const
640 {
641 	return SfxPoolItem::operator==(rCmp) &&
642 		   ((SdrFractionItem&)rCmp).GetValue()==nValue;
643 }
644 
GetPresentation(SfxItemPresentation ePresentation,SfxMapUnit,SfxMapUnit,XubString & rText,const IntlWrapper *) const645 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 
Create(SvStream & rIn,sal_uInt16) const678 SfxPoolItem* __EXPORT SdrFractionItem::Create(SvStream& rIn, sal_uInt16 /*nVer*/) const
679 {
680 	return new SdrFractionItem(Which(),rIn);
681 }
682 
Store(SvStream & rOut,sal_uInt16) const683 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 
Clone(SfxItemPool *) const690 SfxPoolItem* __EXPORT SdrFractionItem::Clone(SfxItemPool * /*pPool*/) const
691 {
692 	return new SdrFractionItem(Which(),GetValue());
693 }
694 
695 #ifdef SDR_ISPOOLABLE
IsPoolable() const696 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 
GetPresentation(SfxItemPresentation ePresentation,SfxMapUnit,SfxMapUnit,XubString & rText,const IntlWrapper *) const709 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 
Create(SvStream & rIn,sal_uInt16) const739 SfxPoolItem* __EXPORT SdrScaleItem::Create(SvStream& rIn, sal_uInt16 /*nVer*/) const
740 {
741 	return new SdrScaleItem(Which(),rIn);
742 }
743 
Clone(SfxItemPool *) const744 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 
Clone(SfxItemPool *) const755 SfxPoolItem* __EXPORT SdrOnOffItem::Clone(SfxItemPool* /*pPool*/) const
756 {
757 	return new SdrOnOffItem(Which(),GetValue());
758 }
759 
Create(SvStream & rIn,sal_uInt16) const760 SfxPoolItem* __EXPORT SdrOnOffItem::Create(SvStream& rIn, sal_uInt16 /*nVer*/) const
761 {
762 	return new SdrOnOffItem(Which(),rIn);
763 }
764 
GetValueTextByVal(sal_Bool bVal) const765 XubString __EXPORT SdrOnOffItem::GetValueTextByVal(sal_Bool bVal) const
766 {
767 	if (bVal) return ImpGetResStr(STR_ItemValON);
768 	else return ImpGetResStr(STR_ItemValOFF);
769 }
770 
GetPresentation(SfxItemPresentation ePres,SfxMapUnit,SfxMapUnit,XubString & rText,const IntlWrapper *) const771 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
IsPoolable() const786 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 
Clone(SfxItemPool *) const795 SfxPoolItem* __EXPORT SdrYesNoItem::Clone(SfxItemPool* /*pPool*/) const
796 {
797 	return new SdrYesNoItem(Which(),GetValue());
798 }
799 
Create(SvStream & rIn,sal_uInt16) const800 SfxPoolItem* __EXPORT SdrYesNoItem::Create(SvStream& rIn, sal_uInt16 /*nVer*/) const
801 {
802 	return new SdrYesNoItem(Which(),rIn);
803 }
804 
GetValueTextByVal(sal_Bool bVal) const805 XubString __EXPORT SdrYesNoItem::GetValueTextByVal(sal_Bool bVal) const
806 {
807 	if (bVal) return ImpGetResStr(STR_ItemValYES);
808 	else return ImpGetResStr(STR_ItemValNO);
809 }
810 
GetPresentation(SfxItemPresentation ePres,SfxMapUnit,SfxMapUnit,XubString & rText,const IntlWrapper *) const811 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
IsPoolable() const826 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 
Clone(SfxItemPool *) const839 SfxPoolItem* __EXPORT SdrPercentItem::Clone(SfxItemPool* /*pPool*/) const
840 {
841 	return new SdrPercentItem(Which(),GetValue());
842 }
843 
Create(SvStream & rIn,sal_uInt16) const844 SfxPoolItem* __EXPORT SdrPercentItem::Create(SvStream& rIn, sal_uInt16 /*nVer*/) const
845 {
846 	return new SdrPercentItem(Which(),rIn);
847 }
848 
GetPresentation(SfxItemPresentation ePres,SfxMapUnit,SfxMapUnit,XubString & rText,const IntlWrapper *) const849 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
IsPoolable() const869 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 
Clone(SfxItemPool *) const882 SfxPoolItem* __EXPORT SdrAngleItem::Clone(SfxItemPool* /*pPool*/) const
883 {
884 	return new SdrAngleItem(Which(),GetValue());
885 }
886 
Create(SvStream & rIn,sal_uInt16) const887 SfxPoolItem* __EXPORT SdrAngleItem::Create(SvStream& rIn, sal_uInt16 /*nVer*/) const
888 {
889 	return new SdrAngleItem(Which(),rIn);
890 }
891 
GetPresentation(SfxItemPresentation ePres,SfxMapUnit,SfxMapUnit,XubString & rText,const IntlWrapper * pIntlWrapper) const892 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
IsPoolable() const966 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 
Clone(SfxItemPool *) const979 SfxPoolItem* __EXPORT SdrMetricItem::Clone(SfxItemPool* /*pPool*/) const
980 {
981 	return new SdrMetricItem(Which(),GetValue());
982 }
983 
Create(SvStream & rIn,sal_uInt16) const984 SfxPoolItem* __EXPORT SdrMetricItem::Create(SvStream& rIn, sal_uInt16 /*nVer*/) const
985 {
986 	return new SdrMetricItem(Which(),rIn);
987 }
988 
HasMetrics() const989 FASTBOOL __EXPORT SdrMetricItem::HasMetrics() const
990 {
991 	return sal_True;
992 }
993 
ScaleMetrics(long nMul,long nDiv)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 
GetPresentation(SfxItemPresentation ePres,SfxMapUnit eCoreMetric,SfxMapUnit ePresMetric,XubString & rText,const IntlWrapper *) const1006 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 += sal_Unicode(' ');
1015 	rText+=aStr;
1016 	if (ePres==SFX_ITEM_PRESENTATION_COMPLETE) {
1017 		String aStr2;
1018 
1019 		SdrItemPool::TakeItemName(Which(), aStr2);
1020 		aStr2 += sal_Unicode(' ');
1021 		rText.Insert(aStr2, 0);
1022 	}
1023 	return ePres;
1024 }
1025 
1026 #ifdef SDR_ISPOOLABLE
IsPoolable() const1027 int __EXPORT SdrMetricItem::IsPoolable() const
1028 {
1029 	sal_uInt16 nId=Which();
1030 	return nId<SDRATTR_NOTPERSIST_FIRST || nId>SDRATTR_NOTPERSIST_LAST;
1031 }
1032 #endif
1033 
1034 ////////////////////////////////////////////////////////////////////////////////
1035 // Items des Legendenobjekts
1036 ////////////////////////////////////////////////////////////////////////////////
1037 
1038 TYPEINIT1_AUTOFACTORY(SdrCaptionTypeItem,SfxEnumItem);
1039 
Clone(SfxItemPool *) const1040 SfxPoolItem* __EXPORT SdrCaptionTypeItem::Clone(SfxItemPool* /*pPool*/) const                { return new SdrCaptionTypeItem(*this); }
1041 
Create(SvStream & rIn,sal_uInt16) const1042 SfxPoolItem* __EXPORT SdrCaptionTypeItem::Create(SvStream& rIn, sal_uInt16 /*nVer*/) const       { return new SdrCaptionTypeItem(rIn); }
1043 
GetValueCount() const1044 sal_uInt16 __EXPORT SdrCaptionTypeItem::GetValueCount() const { return 4; }
1045 
GetValueTextByPos(sal_uInt16 nPos) const1046 XubString __EXPORT SdrCaptionTypeItem::GetValueTextByPos(sal_uInt16 nPos) const
1047 {
1048 	return ImpGetResStr(STR_ItemValCAPTIONTYPE1+nPos);
1049 }
1050 
GetPresentation(SfxItemPresentation ePres,SfxMapUnit,SfxMapUnit,XubString & rText,const IntlWrapper *) const1051 SfxItemPresentation __EXPORT SdrCaptionTypeItem::GetPresentation(SfxItemPresentation ePres,
1052                       SfxMapUnit /*eCoreMetric*/, SfxMapUnit /*ePresMetric*/, XubString& rText, const IntlWrapper *) const
1053 {
1054 	rText=GetValueTextByPos(sal::static_int_cast< sal_uInt16 >(GetValue()));
1055 	if (ePres==SFX_ITEM_PRESENTATION_COMPLETE) {
1056 		String aStr;
1057 
1058 		SdrItemPool::TakeItemName(Which(), aStr);
1059 		aStr += sal_Unicode(' ');
1060 		rText.Insert(aStr, 0);
1061 	}
1062 	return ePres;
1063 }
1064 
1065 TYPEINIT1_AUTOFACTORY(SdrCaptionEscDirItem,SfxEnumItem);
1066 
Clone(SfxItemPool *) const1067 SfxPoolItem* __EXPORT SdrCaptionEscDirItem::Clone(SfxItemPool* /*pPool*/) const              { return new SdrCaptionEscDirItem(*this); }
1068 
Create(SvStream & rIn,sal_uInt16) const1069 SfxPoolItem* __EXPORT SdrCaptionEscDirItem::Create(SvStream& rIn, sal_uInt16 /*nVer*/) const     { return new SdrCaptionEscDirItem(rIn); }
1070 
GetValueCount() const1071 sal_uInt16 __EXPORT SdrCaptionEscDirItem::GetValueCount() const { return 3; }
1072 
GetValueTextByPos(sal_uInt16 nPos) const1073 XubString __EXPORT SdrCaptionEscDirItem::GetValueTextByPos(sal_uInt16 nPos) const
1074 {
1075 	return ImpGetResStr(STR_ItemValCAPTIONESCHORI+nPos);
1076 }
1077 
GetPresentation(SfxItemPresentation ePres,SfxMapUnit,SfxMapUnit,XubString & rText,const IntlWrapper *) const1078 SfxItemPresentation __EXPORT SdrCaptionEscDirItem::GetPresentation(SfxItemPresentation ePres,
1079                       SfxMapUnit /*eCoreMetric*/, SfxMapUnit /*ePresMetric*/, XubString& rText, const IntlWrapper *) const
1080 {
1081 	rText=GetValueTextByPos(sal::static_int_cast< sal_uInt16 >(GetValue()));
1082 	if (ePres==SFX_ITEM_PRESENTATION_COMPLETE) {
1083 		String aStr;
1084 
1085 		SdrItemPool::TakeItemName(Which(), aStr);
1086 		aStr += sal_Unicode(' ');
1087 		rText.Insert(aStr, 0);
1088 	}
1089 	return ePres;
1090 }
1091 
1092 ////////////////////////////////////////////////////////////////////////////////
1093 // MiscItems
1094 ////////////////////////////////////////////////////////////////////////////////
1095 
1096 // FitToSize
1097 TYPEINIT1_AUTOFACTORY(SdrTextFitToSizeTypeItem,SfxEnumItem);
1098 
Clone(SfxItemPool *) const1099 SfxPoolItem* __EXPORT SdrTextFitToSizeTypeItem::Clone(SfxItemPool* /*pPool*/) const         { return new SdrTextFitToSizeTypeItem(*this); }
1100 
Create(SvStream & rIn,sal_uInt16) const1101 SfxPoolItem* __EXPORT SdrTextFitToSizeTypeItem::Create(SvStream& rIn, sal_uInt16 /*nVer*/) const { return new SdrTextFitToSizeTypeItem(rIn); }
1102 
GetValueCount() const1103 sal_uInt16 __EXPORT SdrTextFitToSizeTypeItem::GetValueCount() const { return 4; }
1104 
GetValueTextByPos(sal_uInt16 nPos) const1105 XubString __EXPORT SdrTextFitToSizeTypeItem::GetValueTextByPos(sal_uInt16 nPos) const
1106 {
1107 	return ImpGetResStr(STR_ItemValFITTOSIZENONE+nPos);
1108 }
1109 
GetPresentation(SfxItemPresentation ePres,SfxMapUnit,SfxMapUnit,XubString & rText,const IntlWrapper *) const1110 SfxItemPresentation __EXPORT SdrTextFitToSizeTypeItem::GetPresentation(SfxItemPresentation ePres,
1111                       SfxMapUnit /*eCoreMetric*/, SfxMapUnit /*ePresMetric*/, XubString& rText, const IntlWrapper *) const
1112 {
1113 	rText=GetValueTextByPos(sal::static_int_cast< sal_uInt16 >(GetValue()));
1114 	if (ePres==SFX_ITEM_PRESENTATION_COMPLETE) {
1115 		String aStr;
1116 
1117 		SdrItemPool::TakeItemName(Which(), aStr);
1118 		aStr += sal_Unicode(' ');
1119 		rText.Insert(aStr, 0);
1120 	}
1121 	return ePres;
1122 }
1123 
HasBoolValue() const1124 int  __EXPORT SdrTextFitToSizeTypeItem::HasBoolValue() const { return sal_True; }
1125 
GetBoolValue() const1126 sal_Bool __EXPORT SdrTextFitToSizeTypeItem::GetBoolValue() const { return GetValue()!=SDRTEXTFIT_NONE; }
1127 
SetBoolValue(sal_Bool bVal)1128 void __EXPORT SdrTextFitToSizeTypeItem::SetBoolValue(sal_Bool bVal) { SetValue(sal::static_int_cast< sal_uInt16 >(bVal ? SDRTEXTFIT_PROPORTIONAL : SDRTEXTFIT_NONE)); }
1129 
QueryValue(uno::Any & rVal,sal_uInt8) const1130 sal_Bool SdrTextFitToSizeTypeItem::QueryValue( uno::Any& rVal, sal_uInt8 /*nMemberId*/) const
1131 {
1132 	drawing::TextFitToSizeType eFS = (drawing::TextFitToSizeType)GetValue();
1133 	rVal <<= eFS;
1134 
1135 	return sal_True;
1136 }
1137 
PutValue(const uno::Any & rVal,sal_uInt8)1138 sal_Bool SdrTextFitToSizeTypeItem::PutValue( const uno::Any& rVal, sal_uInt8 /*nMemberId*/)
1139 {
1140 	drawing::TextFitToSizeType eFS;
1141 	if(!(rVal >>= eFS))
1142 	{
1143 		sal_Int32 nEnum = 0;
1144 		if(!(rVal >>= nEnum))
1145 			return sal_False;
1146 
1147 		eFS = (drawing::TextFitToSizeType) nEnum;
1148 	}
1149 
1150 	SetValue( sal::static_int_cast< sal_uInt16 >( (SdrFitToSizeType)eFS ) );
1151 
1152 	return sal_True;
1153 }
1154 
1155 TYPEINIT1_AUTOFACTORY(SdrTextVertAdjustItem,SfxEnumItem);
1156 
Clone(SfxItemPool *) const1157 SfxPoolItem* __EXPORT SdrTextVertAdjustItem::Clone(SfxItemPool* /*pPool*/) const            { return new SdrTextVertAdjustItem(*this); }
1158 
Create(SvStream & rIn,sal_uInt16) const1159 SfxPoolItem* __EXPORT SdrTextVertAdjustItem::Create(SvStream& rIn, sal_uInt16 /*nVer*/) const   { return new SdrTextVertAdjustItem(rIn); }
1160 
GetValueCount() const1161 sal_uInt16 __EXPORT SdrTextVertAdjustItem::GetValueCount() const { return 5; }
1162 
GetValueTextByPos(sal_uInt16 nPos) const1163 XubString __EXPORT SdrTextVertAdjustItem::GetValueTextByPos(sal_uInt16 nPos) const
1164 {
1165 	return ImpGetResStr(STR_ItemValTEXTVADJTOP+nPos);
1166 }
1167 
GetPresentation(SfxItemPresentation ePres,SfxMapUnit,SfxMapUnit,XubString & rText,const IntlWrapper *) const1168 SfxItemPresentation __EXPORT SdrTextVertAdjustItem::GetPresentation(SfxItemPresentation ePres,
1169                       SfxMapUnit /*eCoreMetric*/, SfxMapUnit /*ePresMetric*/, XubString& rText, const IntlWrapper *) const
1170 {
1171 	rText=GetValueTextByPos(sal::static_int_cast< sal_uInt16 >(GetValue()));
1172 	if (ePres==SFX_ITEM_PRESENTATION_COMPLETE) {
1173 		String aStr;
1174 
1175 		SdrItemPool::TakeItemName(Which(), aStr);
1176 		aStr += sal_Unicode(' ');
1177 		rText.Insert(aStr, 0);
1178 	}
1179 	return ePres;
1180 }
1181 
QueryValue(uno::Any & rVal,sal_uInt8) const1182 sal_Bool SdrTextVertAdjustItem::QueryValue( uno::Any& rVal, sal_uInt8 /*nMemberId*/) const
1183 {
1184 	rVal <<= (drawing::TextVerticalAdjust)GetValue();
1185 	return sal_True;
1186 }
1187 
PutValue(const uno::Any & rVal,sal_uInt8)1188 sal_Bool SdrTextVertAdjustItem::PutValue( const uno::Any& rVal, sal_uInt8 /*nMemberId*/)
1189 {
1190 	drawing::TextVerticalAdjust eAdj;
1191 	if(!(rVal >>= eAdj))
1192 	{
1193 		sal_Int32 nEnum = 0;
1194 		if(!(rVal >>= nEnum))
1195 			return sal_False;
1196 
1197 		eAdj = (drawing::TextVerticalAdjust)nEnum;
1198 	}
1199 
1200 	SetValue( sal::static_int_cast< sal_uInt16 >( (SdrTextVertAdjust)eAdj ) );
1201 
1202 	return sal_True;
1203 }
1204 
1205 TYPEINIT1_AUTOFACTORY(SdrTextHorzAdjustItem,SfxEnumItem);
1206 
Clone(SfxItemPool *) const1207 SfxPoolItem* __EXPORT SdrTextHorzAdjustItem::Clone(SfxItemPool* /*pPool*/) const            { return new SdrTextHorzAdjustItem(*this); }
1208 
Create(SvStream & rIn,sal_uInt16) const1209 SfxPoolItem* __EXPORT SdrTextHorzAdjustItem::Create(SvStream& rIn, sal_uInt16 /*nVer*/) const   { return new SdrTextHorzAdjustItem(rIn); }
1210 
GetValueCount() const1211 sal_uInt16 __EXPORT SdrTextHorzAdjustItem::GetValueCount() const { return 5; }
1212 
GetValueTextByPos(sal_uInt16 nPos) const1213 XubString __EXPORT SdrTextHorzAdjustItem::GetValueTextByPos(sal_uInt16 nPos) const
1214 {
1215 	return ImpGetResStr(STR_ItemValTEXTHADJLEFT+nPos);
1216 }
1217 
GetPresentation(SfxItemPresentation ePres,SfxMapUnit,SfxMapUnit,XubString & rText,const IntlWrapper *) const1218 SfxItemPresentation __EXPORT SdrTextHorzAdjustItem::GetPresentation(SfxItemPresentation ePres,
1219                       SfxMapUnit /*eCoreMetric*/, SfxMapUnit /*ePresMetric*/, XubString& rText, const IntlWrapper *) const
1220 {
1221 	rText=GetValueTextByPos(sal::static_int_cast< sal_uInt16 >(GetValue()));
1222 	if (ePres==SFX_ITEM_PRESENTATION_COMPLETE) {
1223 		String aStr;
1224 
1225 		SdrItemPool::TakeItemName(Which(), aStr);
1226 		aStr += sal_Unicode(' ');
1227 		rText.Insert(aStr, 0);
1228 	}
1229 	return ePres;
1230 }
1231 
QueryValue(uno::Any & rVal,sal_uInt8) const1232 sal_Bool SdrTextHorzAdjustItem::QueryValue( uno::Any& rVal, sal_uInt8 /*nMemberId*/) const
1233 {
1234 	rVal <<= (drawing::TextHorizontalAdjust)GetValue();
1235 	return sal_True;
1236 }
1237 
PutValue(const uno::Any & rVal,sal_uInt8)1238 sal_Bool SdrTextHorzAdjustItem::PutValue( const uno::Any& rVal, sal_uInt8 /*nMemberId*/)
1239 {
1240 	drawing::TextHorizontalAdjust eAdj;
1241 	if(!(rVal >>= eAdj))
1242 	{
1243 		sal_Int32 nEnum = 0;
1244 		if(!(rVal >>= nEnum))
1245 			return sal_False;
1246 
1247 		eAdj = (drawing::TextHorizontalAdjust)nEnum;
1248 	}
1249 
1250 	SetValue( sal::static_int_cast< sal_uInt16 >( (SdrTextHorzAdjust)eAdj ) );
1251 
1252 	return sal_True;
1253 }
1254 
1255 TYPEINIT1_AUTOFACTORY(SdrTextAniKindItem,SfxEnumItem);
1256 
Clone(SfxItemPool *) const1257 SfxPoolItem* __EXPORT SdrTextAniKindItem::Clone(SfxItemPool* /*pPool*/) const            { return new SdrTextAniKindItem(*this); }
1258 
Create(SvStream & rIn,sal_uInt16) const1259 SfxPoolItem* __EXPORT SdrTextAniKindItem::Create(SvStream& rIn, sal_uInt16 /*nVer*/) const   { return new SdrTextAniKindItem(rIn); }
1260 
GetValueCount() const1261 sal_uInt16 __EXPORT SdrTextAniKindItem::GetValueCount() const { return 5; }
1262 
GetValueTextByPos(sal_uInt16 nPos) const1263 XubString __EXPORT SdrTextAniKindItem::GetValueTextByPos(sal_uInt16 nPos) const
1264 {
1265 	return ImpGetResStr(STR_ItemValTEXTANI_NONE+nPos);
1266 }
1267 
GetPresentation(SfxItemPresentation ePres,SfxMapUnit,SfxMapUnit,XubString & rText,const IntlWrapper *) const1268 SfxItemPresentation __EXPORT SdrTextAniKindItem::GetPresentation(SfxItemPresentation ePres,
1269                       SfxMapUnit /*eCoreMetric*/, SfxMapUnit /*ePresMetric*/, XubString& rText, const IntlWrapper *) const
1270 {
1271 	rText=GetValueTextByPos(sal::static_int_cast< sal_uInt16 >(GetValue()));
1272 	if (ePres==SFX_ITEM_PRESENTATION_COMPLETE) {
1273 		String aStr;
1274 
1275 		SdrItemPool::TakeItemName(Which(), aStr);
1276 		aStr += sal_Unicode(' ');
1277 		rText.Insert(aStr, 0);
1278 	}
1279 	return ePres;
1280 }
1281 
QueryValue(uno::Any & rVal,sal_uInt8) const1282 sal_Bool SdrTextAniKindItem::QueryValue( uno::Any& rVal, sal_uInt8 /*nMemberId*/) const
1283 {
1284 	rVal <<= (drawing::TextAnimationKind)GetValue();
1285 	return sal_True;
1286 }
1287 
PutValue(const uno::Any & rVal,sal_uInt8)1288 sal_Bool SdrTextAniKindItem::PutValue( const uno::Any& rVal, sal_uInt8 /*nMemberId*/)
1289 {
1290 	drawing::TextAnimationKind eKind;
1291 	if(!(rVal >>= eKind))
1292 	{
1293 		sal_Int32 nEnum = 0;
1294 		if(!(rVal >>= nEnum))
1295 			return sal_False;
1296 		eKind = (drawing::TextAnimationKind)nEnum;
1297 	}
1298 
1299 	SetValue( sal::static_int_cast< sal_uInt16 >( (SdrTextAniKind)eKind ) );
1300 
1301 	return sal_True;
1302 }
1303 
1304 TYPEINIT1_AUTOFACTORY(SdrTextAniDirectionItem,SfxEnumItem);
1305 
Clone(SfxItemPool *) const1306 SfxPoolItem* __EXPORT SdrTextAniDirectionItem::Clone(SfxItemPool* /*pPool*/) const            { return new SdrTextAniDirectionItem(*this); }
1307 
Create(SvStream & rIn,sal_uInt16) const1308 SfxPoolItem* __EXPORT SdrTextAniDirectionItem::Create(SvStream& rIn, sal_uInt16 /*nVer*/) const   { return new SdrTextAniDirectionItem(rIn); }
1309 
GetValueCount() const1310 sal_uInt16 __EXPORT SdrTextAniDirectionItem::GetValueCount() const { return 4; }
1311 
GetValueTextByPos(sal_uInt16 nPos) const1312 XubString __EXPORT SdrTextAniDirectionItem::GetValueTextByPos(sal_uInt16 nPos) const
1313 {
1314 	return ImpGetResStr(STR_ItemValTEXTANI_LEFT+nPos);
1315 }
1316 
GetPresentation(SfxItemPresentation ePres,SfxMapUnit,SfxMapUnit,XubString & rText,const IntlWrapper *) const1317 SfxItemPresentation __EXPORT SdrTextAniDirectionItem::GetPresentation(SfxItemPresentation ePres,
1318                       SfxMapUnit /*eCoreMetric*/, SfxMapUnit /*ePresMetric*/, XubString& rText, const IntlWrapper *) const
1319 {
1320 	rText=GetValueTextByPos(sal::static_int_cast< sal_uInt16 >(GetValue()));
1321 	if (ePres==SFX_ITEM_PRESENTATION_COMPLETE) {
1322 		String aStr;
1323 
1324 		SdrItemPool::TakeItemName(Which(), aStr);
1325 		aStr += sal_Unicode(' ');
1326 		rText.Insert(aStr, 0);
1327 	}
1328 	return ePres;
1329 }
1330 
QueryValue(uno::Any & rVal,sal_uInt8) const1331 sal_Bool SdrTextAniDirectionItem::QueryValue( uno::Any& rVal, sal_uInt8 /*nMemberId*/) const
1332 {
1333 	rVal <<= (drawing::TextAnimationDirection)GetValue();
1334 	return sal_True;
1335 }
1336 
PutValue(const uno::Any & rVal,sal_uInt8)1337 sal_Bool SdrTextAniDirectionItem::PutValue( const uno::Any& rVal, sal_uInt8 /*nMemberId*/)
1338 {
1339 	drawing::TextAnimationDirection eDir;
1340 	if(!(rVal >>= eDir))
1341 	{
1342 		sal_Int32 nEnum = 0;
1343 		if(!(rVal >>= nEnum))
1344 			return sal_False;
1345 
1346 		eDir = (drawing::TextAnimationDirection)nEnum;
1347 	}
1348 
1349 	SetValue( sal::static_int_cast< sal_uInt16 >( (SdrTextAniDirection)eDir ) );
1350 
1351 	return sal_True;
1352 }
1353 
1354 TYPEINIT1_AUTOFACTORY(SdrTextAniDelayItem,SfxUInt16Item);
1355 
Clone(SfxItemPool *) const1356 SfxPoolItem* __EXPORT SdrTextAniDelayItem::Clone(SfxItemPool* /*pPool*/) const            { return new SdrTextAniDelayItem(*this); }
1357 
Create(SvStream & rIn,sal_uInt16) const1358 SfxPoolItem* __EXPORT SdrTextAniDelayItem::Create(SvStream& rIn, sal_uInt16 /*nVer*/) const   { return new SdrTextAniDelayItem(rIn); }
1359 
GetPresentation(SfxItemPresentation ePres,SfxMapUnit,SfxMapUnit,XubString & rText,const IntlWrapper *) const1360 SfxItemPresentation __EXPORT SdrTextAniDelayItem::GetPresentation(
1361 	SfxItemPresentation ePres, SfxMapUnit /*eCoreMetric*/, SfxMapUnit /*ePresMetric*/,
1362     XubString& rText, const IntlWrapper *) const
1363 {
1364 	rText = UniString::CreateFromInt32(GetValue());
1365 	rText += sal_Unicode('m');
1366 	rText += sal_Unicode('s');
1367 
1368 	if(ePres == SFX_ITEM_PRESENTATION_COMPLETE)
1369 	{
1370 		XubString aStr;
1371 
1372 		SdrItemPool::TakeItemName(Which(), aStr);
1373 		aStr += sal_Unicode(' ');
1374 		rText.Insert(aStr, 0);
1375 	}
1376 
1377 	return ePres;
1378 }
1379 
1380 TYPEINIT1_AUTOFACTORY(SdrTextAniAmountItem,SfxInt16Item);
1381 
Clone(SfxItemPool *) const1382 SfxPoolItem* __EXPORT SdrTextAniAmountItem::Clone(SfxItemPool* /*pPool*/) const            { return new SdrTextAniAmountItem(*this); }
1383 
Create(SvStream & rIn,sal_uInt16) const1384 SfxPoolItem* __EXPORT SdrTextAniAmountItem::Create(SvStream& rIn, sal_uInt16 /*nVer*/) const   { return new SdrTextAniAmountItem(rIn); }
1385 
HasMetrics() const1386 FASTBOOL __EXPORT SdrTextAniAmountItem::HasMetrics() const
1387 {
1388 	return GetValue()>0;
1389 }
1390 
ScaleMetrics(long nMul,long nDiv)1391 FASTBOOL __EXPORT SdrTextAniAmountItem::ScaleMetrics(long nMul, long nDiv)
1392 {
1393 	if (GetValue()>0) {
1394 		BigInt aVal(GetValue());
1395 		aVal*=nMul;
1396 		aVal+=nDiv/2; // fuer korrektes Runden
1397 		aVal/=nDiv;
1398 		SetValue(short(aVal));
1399 		return sal_True;
1400 	} else return sal_False;
1401 }
1402 
GetPresentation(SfxItemPresentation ePres,SfxMapUnit eCoreMetric,SfxMapUnit ePresMetric,XubString & rText,const IntlWrapper *) const1403 SfxItemPresentation __EXPORT SdrTextAniAmountItem::GetPresentation(
1404 	SfxItemPresentation ePres, SfxMapUnit eCoreMetric, SfxMapUnit ePresMetric,
1405     XubString& rText, const IntlWrapper *) const
1406 {
1407 	sal_Int32 nValue(GetValue());
1408 
1409 	if(!nValue)
1410 		nValue = -1L;
1411 
1412 	if(nValue < 0)
1413 	{
1414 		const sal_Char aText[] = "pixel";
1415 
1416 		rText = UniString::CreateFromInt32(-nValue);
1417 		rText += UniString(aText, sizeof(aText)-1);
1418 	}
1419 	else
1420 	{
1421 		SdrFormatter aFmt((MapUnit)eCoreMetric, (MapUnit)ePresMetric);
1422 		XubString aStr;
1423 
1424 		aFmt.TakeStr(nValue, rText);
1425 		aFmt.TakeUnitStr((MapUnit)ePresMetric, aStr);
1426 		rText += aStr;
1427 	}
1428 
1429 	if(ePres == SFX_ITEM_PRESENTATION_COMPLETE)
1430 	{
1431 		XubString aStr;
1432 
1433 		SdrItemPool::TakeItemName(Which(), aStr);
1434 		aStr += sal_Unicode(' ');
1435 		rText.Insert(aStr, 0);
1436 	}
1437 
1438 	return ePres;
1439 }
1440 
1441 TYPEINIT1_AUTOFACTORY( SdrTextFixedCellHeightItem, SfxBoolItem );
SdrTextFixedCellHeightItem(sal_Bool bUseFixedCellHeight)1442 SdrTextFixedCellHeightItem::SdrTextFixedCellHeightItem( sal_Bool bUseFixedCellHeight )
1443 	: SfxBoolItem( SDRATTR_TEXT_USEFIXEDCELLHEIGHT, bUseFixedCellHeight )
1444 {
1445 }
SdrTextFixedCellHeightItem(SvStream & rStream,sal_uInt16 nVersion)1446 SdrTextFixedCellHeightItem::SdrTextFixedCellHeightItem( SvStream & rStream, sal_uInt16 nVersion )
1447 	: SfxBoolItem( SDRATTR_TEXT_USEFIXEDCELLHEIGHT, sal_False )
1448 {
1449 	if ( nVersion )
1450 	{
1451 		sal_Bool bValue;
1452 		rStream >> bValue;
1453 		SetValue( bValue );
1454 	}
1455 }
GetPresentation(SfxItemPresentation ePres,SfxMapUnit,SfxMapUnit,String & rText,const IntlWrapper *) const1456 SfxItemPresentation __EXPORT SdrTextFixedCellHeightItem::GetPresentation( SfxItemPresentation ePres,
1457 									SfxMapUnit /*eCoreMetric*/, SfxMapUnit /*ePresentationMetric*/,
1458                                         String &rText, const IntlWrapper * ) const
1459 {
1460 	rText = GetValueTextByVal( GetValue() );
1461 	if (ePres==SFX_ITEM_PRESENTATION_COMPLETE)
1462 	{
1463 		String aStr;
1464 		SdrItemPool::TakeItemName(Which(), aStr);
1465 		aStr += sal_Unicode(' ');
1466 		rText.Insert(aStr, 0);
1467 	}
1468 	return ePres;
1469 }
Create(SvStream & rIn,sal_uInt16 nItemVersion) const1470 SfxPoolItem* __EXPORT SdrTextFixedCellHeightItem::Create( SvStream& rIn, sal_uInt16 nItemVersion ) const
1471 {
1472 	return new SdrTextFixedCellHeightItem( rIn, nItemVersion );
1473 }
Store(SvStream & rOut,sal_uInt16 nItemVersion) const1474 SvStream& __EXPORT SdrTextFixedCellHeightItem::Store( SvStream& rOut, sal_uInt16 nItemVersion ) const
1475 {
1476 	if ( nItemVersion )
1477 	{
1478 		sal_Bool bValue = (sal_Bool)GetValue();
1479 		rOut << bValue;
1480 	}
1481 	return rOut;
1482 }
Clone(SfxItemPool *) const1483 SfxPoolItem* __EXPORT SdrTextFixedCellHeightItem::Clone( SfxItemPool * /*pPool*/) const
1484 {
1485 	return new SdrTextFixedCellHeightItem( GetValue() );
1486 }
GetVersion(sal_uInt16) const1487 sal_uInt16 SdrTextFixedCellHeightItem::GetVersion( sal_uInt16 /*nFileFormatVersion*/) const
1488 {
1489 	return 1;
1490 }
QueryValue(uno::Any & rVal,sal_uInt8) const1491 sal_Bool SdrTextFixedCellHeightItem::QueryValue( uno::Any& rVal, sal_uInt8 /*nMemberId*/) const
1492 {
1493 	sal_Bool bValue = (sal_Bool)GetValue();
1494 	rVal <<= bValue;
1495 	return sal_True;
1496 }
PutValue(const uno::Any & rVal,sal_uInt8)1497 sal_Bool SdrTextFixedCellHeightItem::PutValue( const uno::Any& rVal, sal_uInt8 /*nMemberId*/)
1498 {
1499 	sal_Bool bValue = sal_Bool();
1500 	if( !( rVal >>= bValue ) )
1501 		return sal_False;
1502 	SetValue( bValue );
1503 	return sal_True;
1504 }
1505 #ifdef SDR_ISPOOLABLE
IsPoolable() const1506 int __EXPORT SdrTextFixedCellHeightItem::IsPoolable() const
1507 {
1508 	sal_uInt16 nId=Which();
1509 	return nId < SDRATTR_NOTPERSIST_FIRST || nId > SDRATTR_NOTPERSIST_LAST;
1510 }
1511 #endif
1512 
1513 TYPEINIT1_AUTOFACTORY( SdrCustomShapeAdjustmentItem, SfxPoolItem );
1514 
SdrCustomShapeAdjustmentItem()1515 SdrCustomShapeAdjustmentItem::SdrCustomShapeAdjustmentItem() : SfxPoolItem( SDRATTR_CUSTOMSHAPE_ADJUSTMENT )
1516 {
1517 }
1518 
SdrCustomShapeAdjustmentItem(SvStream & rIn,sal_uInt16 nVersion)1519 SdrCustomShapeAdjustmentItem::SdrCustomShapeAdjustmentItem( SvStream& rIn, sal_uInt16 nVersion ):
1520 	SfxPoolItem( SDRATTR_CUSTOMSHAPE_ADJUSTMENT )
1521 {
1522 	if ( nVersion )
1523 	{
1524 		SdrCustomShapeAdjustmentValue aVal;
1525 		sal_uInt32 i, nCount;
1526 		rIn >> nCount;
1527 		for ( i = 0; i < nCount; i++ )
1528 		{
1529 			rIn >> aVal.nValue;
1530 			SetValue( i, aVal );
1531 		}
1532 	}
1533 }
1534 
~SdrCustomShapeAdjustmentItem()1535 SdrCustomShapeAdjustmentItem::~SdrCustomShapeAdjustmentItem()
1536 {
1537 	void* pPtr;
1538 	for ( pPtr = aAdjustmentValueList.First(); pPtr; pPtr = aAdjustmentValueList.Next() )
1539 		delete (SdrCustomShapeAdjustmentValue*)pPtr;
1540 }
1541 
operator ==(const SfxPoolItem & rCmp) const1542 int __EXPORT SdrCustomShapeAdjustmentItem::operator==( const SfxPoolItem& rCmp ) const
1543 {
1544 	int bRet = SfxPoolItem::operator==( rCmp );
1545 	if ( bRet )
1546 	{
1547 		bRet = ((SdrCustomShapeAdjustmentItem&)rCmp).GetCount() == GetCount();
1548 		if ( bRet )
1549 		{
1550 			sal_uInt32 i;
1551 			for ( i = 0; i < GetCount(); i++ )
1552 			{
1553 				if ( ((SdrCustomShapeAdjustmentItem&)rCmp).GetValue( i ).nValue != GetValue( i ).nValue )
1554 				{
1555 					bRet = 0;
1556 					break;
1557 				}
1558 			}
1559 		}
1560 	}
1561 	return bRet;
1562 }
1563 
GetPresentation(SfxItemPresentation ePresentation,SfxMapUnit,SfxMapUnit,XubString & rText,const IntlWrapper *) const1564 SfxItemPresentation __EXPORT SdrCustomShapeAdjustmentItem::GetPresentation(
1565 	SfxItemPresentation ePresentation, SfxMapUnit /*eCoreMetric*/,
1566     SfxMapUnit /*ePresentationMetric*/, XubString &rText, const IntlWrapper *) const
1567 {
1568 	sal_uInt32 i, nCount = GetCount();
1569 	rText.Append( UniString::CreateFromInt32( nCount ) );
1570 	for ( i = 0; i < nCount; i++ )
1571 	{
1572 		rText += sal_Unicode( ' ' );
1573 		rText.Append( UniString::CreateFromInt32( GetValue( i ).nValue ) );
1574 	}
1575 	if ( ePresentation == SFX_ITEM_PRESENTATION_COMPLETE )
1576 	{
1577 		XubString aStr;
1578 
1579 		SdrItemPool::TakeItemName( Which(), aStr );
1580 		aStr += sal_Unicode( ' ' );
1581 		rText.Insert( aStr, 0 );
1582 	}
1583 	return ePresentation;
1584 }
1585 
Create(SvStream & rIn,sal_uInt16 nItemVersion) const1586 SfxPoolItem* __EXPORT SdrCustomShapeAdjustmentItem::Create( SvStream& rIn, sal_uInt16 nItemVersion ) const
1587 {
1588 	return new SdrCustomShapeAdjustmentItem( rIn, nItemVersion );
1589 }
1590 
Store(SvStream & rOut,sal_uInt16 nItemVersion) const1591 SvStream& __EXPORT SdrCustomShapeAdjustmentItem::Store( SvStream& rOut, sal_uInt16 nItemVersion ) const
1592 {
1593 	if ( nItemVersion )
1594 	{
1595 		sal_uInt32 i, nCount = GetCount();
1596 		rOut << nCount;
1597 		for ( i = 0; i < nCount; i++ )
1598 			rOut << GetValue( i ).nValue;
1599 	}
1600 	return rOut;
1601 }
1602 
Clone(SfxItemPool *) const1603 SfxPoolItem* __EXPORT SdrCustomShapeAdjustmentItem::Clone( SfxItemPool * /*pPool*/) const
1604 {
1605 	sal_uInt32 i;
1606 	SdrCustomShapeAdjustmentItem* pItem = new SdrCustomShapeAdjustmentItem;
1607 	for ( i = 0; i < GetCount(); i++ )
1608 	{
1609 		const SdrCustomShapeAdjustmentValue& rVal = GetValue( i );
1610 		pItem->SetValue( i, rVal );
1611 	}
1612 	return pItem;
1613 }
1614 
1615 #ifdef SDR_ISPOOLABLE
IsPoolable() const1616 int __EXPORT SdrCustomShapeAdjustmentItem::IsPoolable() const
1617 {
1618 	sal_uInt16 nId=Which();
1619 	return nId < SDRATTR_NOTPERSIST_FIRST || nId > SDRATTR_NOTPERSIST_LAST;
1620 }
1621 #endif
1622 
GetValue(sal_uInt32 nIndex) const1623 const SdrCustomShapeAdjustmentValue& SdrCustomShapeAdjustmentItem::GetValue( sal_uInt32 nIndex ) const
1624 {
1625 #ifdef DBG_UTIL
1626 	if ( aAdjustmentValueList.Count() <= nIndex )
1627 		DBG_ERROR( "SdrCustomShapeAdjustemntItem::GetValue - nIndex out of range (SJ)" );
1628 #endif
1629 	return *(SdrCustomShapeAdjustmentValue*)aAdjustmentValueList.GetObject( nIndex );
1630 }
1631 
SetValue(sal_uInt32 nIndex,const SdrCustomShapeAdjustmentValue & rVal)1632 void SdrCustomShapeAdjustmentItem::SetValue( sal_uInt32 nIndex, const SdrCustomShapeAdjustmentValue& rVal )
1633 {
1634 	sal_uInt32 i;
1635 	for ( i = GetCount(); i <= nIndex; i++ )
1636 	{
1637 		SdrCustomShapeAdjustmentValue* pItem = new SdrCustomShapeAdjustmentValue;
1638 		aAdjustmentValueList.Insert( pItem, LIST_APPEND );
1639 	}
1640 	SdrCustomShapeAdjustmentValue& rValue = *(SdrCustomShapeAdjustmentValue*)aAdjustmentValueList.GetObject( nIndex );
1641 	rValue.nValue = rVal.nValue;
1642 }
1643 
GetVersion(sal_uInt16) const1644 sal_uInt16 SdrCustomShapeAdjustmentItem::GetVersion( sal_uInt16 /*nFileFormatVersion*/) const
1645 {
1646 	return 1;
1647 }
1648 
QueryValue(uno::Any & rVal,sal_uInt8) const1649 sal_Bool SdrCustomShapeAdjustmentItem::QueryValue( uno::Any& rVal, sal_uInt8 /*nMemberId*/) const
1650 {
1651 	sal_uInt32 i, nCount = GetCount();
1652 	uno::Sequence< sal_Int32 > aSequence( nCount );
1653 	if ( nCount )
1654 	{
1655 		sal_Int32* pPtr = aSequence.getArray();
1656 		for ( i = 0; i < nCount; i++ )
1657 			*pPtr++ = GetValue( i ).nValue;
1658 	}
1659 	rVal <<= aSequence;
1660 	return sal_True;
1661 }
1662 
PutValue(const uno::Any & rVal,sal_uInt8)1663 sal_Bool SdrCustomShapeAdjustmentItem::PutValue( const uno::Any& rVal, sal_uInt8 /*nMemberId*/)
1664 {
1665 	uno::Sequence< sal_Int32 > aSequence;
1666 	if( !( rVal >>= aSequence ) )
1667 		return sal_False;
1668 
1669 	void* pPtr;
1670 	for ( pPtr = aAdjustmentValueList.First(); pPtr; pPtr = aAdjustmentValueList.Next() )
1671 		delete (SdrCustomShapeAdjustmentValue*)pPtr;
1672 
1673 	sal_uInt32 i, nCount = aSequence.getLength();
1674 	if ( nCount )
1675 	{
1676 		const sal_Int32* pPtr2 = aSequence.getConstArray();
1677 		for ( i = 0; i < nCount; i++ )
1678 		{
1679 			SdrCustomShapeAdjustmentValue* pItem = new SdrCustomShapeAdjustmentValue;
1680 			pItem->nValue = *pPtr2++;
1681 			aAdjustmentValueList.Insert( pItem, LIST_APPEND );
1682 		}
1683 	}
1684 	return sal_True;
1685 }
1686 
1687 
1688 //++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
1689 // Edge
1690 //++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
1691 
1692 // EdgeKind
1693 TYPEINIT1_AUTOFACTORY(SdrEdgeKindItem,SfxEnumItem);
1694 
Clone(SfxItemPool *) const1695 SfxPoolItem* __EXPORT SdrEdgeKindItem::Clone(SfxItemPool* /*pPool*/) const            { return new SdrEdgeKindItem(*this); }
1696 
Create(SvStream & rIn,sal_uInt16) const1697 SfxPoolItem* __EXPORT SdrEdgeKindItem::Create(SvStream& rIn, sal_uInt16 /*nVer*/) const   { return new SdrEdgeKindItem(rIn); }
1698 
GetValueCount() const1699 sal_uInt16 __EXPORT SdrEdgeKindItem::GetValueCount() const { return 4; }
1700 
GetValueTextByPos(sal_uInt16 nPos) const1701 XubString __EXPORT SdrEdgeKindItem::GetValueTextByPos(sal_uInt16 nPos) const
1702 {
1703 	return ImpGetResStr(STR_ItemValEDGE_ORTHOLINES+nPos);
1704 }
1705 
GetPresentation(SfxItemPresentation ePres,SfxMapUnit,SfxMapUnit,XubString & rText,const IntlWrapper *) const1706 SfxItemPresentation __EXPORT SdrEdgeKindItem::GetPresentation(SfxItemPresentation ePres,
1707                       SfxMapUnit /*eCoreMetric*/, SfxMapUnit /*ePresMetric*/, XubString& rText, const IntlWrapper *) const
1708 {
1709 	rText=GetValueTextByPos(sal::static_int_cast< sal_uInt16 >(GetValue()));
1710 	if (ePres==SFX_ITEM_PRESENTATION_COMPLETE) {
1711 		String aStr;
1712 
1713 		SdrItemPool::TakeItemName(Which(), aStr);
1714 		aStr += sal_Unicode(' ');
1715 		rText.Insert(aStr, 0);
1716 	}
1717 	return ePres;
1718 }
1719 
QueryValue(uno::Any & rVal,sal_uInt8) const1720 sal_Bool SdrEdgeKindItem::QueryValue( uno::Any& rVal, sal_uInt8 /*nMemberId*/) const
1721 {
1722 	drawing::ConnectorType eCT = drawing::ConnectorType_STANDARD;
1723 
1724 	switch( GetValue() )
1725 	{
1726 		case SDREDGE_ORTHOLINES :   eCT = drawing::ConnectorType_STANDARD; break;
1727 		case SDREDGE_THREELINES :   eCT = drawing::ConnectorType_LINES;	break;
1728 		case SDREDGE_ONELINE :		eCT = drawing::ConnectorType_LINE;	break;
1729 		case SDREDGE_BEZIER :		eCT = drawing::ConnectorType_CURVE;	break;
1730 		case SDREDGE_ARC :          eCT = drawing::ConnectorType_CURVE;	break;
1731 		default:
1732 			DBG_ERROR( "SdrEdgeKindItem::QueryValue : unknown enum" );
1733 	}
1734 
1735 	rVal <<= eCT;
1736 
1737 	return sal_True;
1738 }
1739 
PutValue(const uno::Any & rVal,sal_uInt8)1740 sal_Bool SdrEdgeKindItem::PutValue( const uno::Any& rVal, sal_uInt8 /*nMemberId*/)
1741 {
1742 	drawing::ConnectorType eCT;
1743 	if(!(rVal >>= eCT))
1744 	{
1745 		sal_Int32 nEnum = 0;
1746 		if(!(rVal >>= nEnum))
1747 			return sal_False;
1748 
1749 		eCT = (drawing::ConnectorType)nEnum;
1750 	}
1751 
1752 	SdrEdgeKind eEK = SDREDGE_ORTHOLINES;
1753 	switch( eCT )
1754 	{
1755 		case drawing::ConnectorType_STANDARD :	eEK = SDREDGE_ORTHOLINES;	break;
1756 		case drawing::ConnectorType_CURVE :		eEK = SDREDGE_BEZIER;		break;
1757 		case drawing::ConnectorType_LINE :       eEK = SDREDGE_ONELINE;		break;
1758 		case drawing::ConnectorType_LINES :      eEK = SDREDGE_THREELINES;   break;
1759 		default:
1760 			DBG_ERROR( "SdrEdgeKindItem::PuValue : unknown enum" );
1761 	}
1762 	SetValue( sal::static_int_cast< sal_uInt16 >( eEK ) );
1763 
1764 	return sal_True;
1765 }
1766 
QueryValue(uno::Any & rVal,sal_uInt8) const1767 sal_Bool SdrEdgeNode1HorzDistItem::QueryValue( uno::Any& rVal, sal_uInt8 /*nMemberId*/) const
1768 {
1769 	rVal <<= (sal_Int32)GetValue();
1770 	return sal_True;
1771 }
1772 
PutValue(const uno::Any & rVal,sal_uInt8)1773 sal_Bool SdrEdgeNode1HorzDistItem::PutValue( const uno::Any& rVal, sal_uInt8 /*nMemberId*/)
1774 {
1775 	sal_Int32 nValue = 0;
1776 	if(!(rVal >>= nValue))
1777 		return sal_False;
1778 
1779 	SetValue( nValue );
1780 	return sal_True;
1781 }
1782 
QueryValue(uno::Any & rVal,sal_uInt8) const1783 sal_Bool SdrEdgeNode1VertDistItem::QueryValue( uno::Any& rVal, sal_uInt8 /*nMemberId*/) const
1784 {
1785 	rVal <<= (sal_Int32)GetValue();
1786 	return sal_True;
1787 }
1788 
PutValue(const uno::Any & rVal,sal_uInt8)1789 sal_Bool SdrEdgeNode1VertDistItem::PutValue( const uno::Any& rVal, sal_uInt8 /*nMemberId*/)
1790 {
1791 	sal_Int32 nValue = 0;
1792 	if(!(rVal >>= nValue))
1793 		return sal_False;
1794 
1795 	SetValue( nValue );
1796 	return sal_True;
1797 }
1798 
QueryValue(uno::Any & rVal,sal_uInt8) const1799 sal_Bool SdrEdgeNode2HorzDistItem::QueryValue( uno::Any& rVal, sal_uInt8 /*nMemberId*/) const
1800 {
1801 	rVal <<= (sal_Int32)GetValue();
1802 	return sal_True;
1803 }
1804 
PutValue(const uno::Any & rVal,sal_uInt8)1805 sal_Bool SdrEdgeNode2HorzDistItem::PutValue( const uno::Any& rVal, sal_uInt8 /*nMemberId*/)
1806 {
1807 	sal_Int32 nValue = 0;
1808 	if(!(rVal >>= nValue))
1809 		return sal_False;
1810 
1811 	SetValue( nValue );
1812 	return sal_True;
1813 }
1814 
QueryValue(uno::Any & rVal,sal_uInt8) const1815 sal_Bool SdrEdgeNode2VertDistItem::QueryValue( uno::Any& rVal, sal_uInt8 /*nMemberId*/) const
1816 {
1817 	rVal <<= (sal_Int32)GetValue();
1818 	return sal_True;
1819 }
1820 
PutValue(const uno::Any & rVal,sal_uInt8)1821 sal_Bool SdrEdgeNode2VertDistItem::PutValue( const uno::Any& rVal, sal_uInt8 /*nMemberId*/)
1822 {
1823 	sal_Int32 nValue = 0;
1824 	if(!(rVal >>= nValue))
1825 		return sal_False;
1826 
1827 	SetValue( nValue );
1828 	return sal_True;
1829 }
1830 
QueryValue(uno::Any & rVal,sal_uInt8) const1831 sal_Bool SdrEdgeLine1DeltaItem::QueryValue( uno::Any& rVal, sal_uInt8 /*nMemberId*/) const
1832 {
1833 	rVal <<= (sal_Int32)GetValue();
1834 	return sal_True;
1835 }
1836 
PutValue(const uno::Any & rVal,sal_uInt8)1837 sal_Bool SdrEdgeLine1DeltaItem::PutValue( const uno::Any& rVal, sal_uInt8 /*nMemberId*/)
1838 {
1839 	sal_Int32 nValue = 0;
1840 	if(!(rVal >>= nValue))
1841 		return sal_False;
1842 
1843 	SetValue( nValue );
1844 	return sal_True;
1845 }
1846 
QueryValue(uno::Any & rVal,sal_uInt8) const1847 sal_Bool SdrEdgeLine2DeltaItem::QueryValue( uno::Any& rVal, sal_uInt8 /*nMemberId*/) const
1848 {
1849 	rVal <<= (sal_Int32)GetValue();
1850 	return sal_True;
1851 }
1852 
PutValue(const uno::Any & rVal,sal_uInt8)1853 sal_Bool SdrEdgeLine2DeltaItem::PutValue( const uno::Any& rVal, sal_uInt8 /*nMemberId*/)
1854 {
1855 	sal_Int32 nValue = 0;
1856 	if(!(rVal >>= nValue))
1857 		return sal_False;
1858 
1859 	SetValue( nValue );
1860 	return sal_True;
1861 }
1862 
QueryValue(uno::Any & rVal,sal_uInt8) const1863 sal_Bool SdrEdgeLine3DeltaItem::QueryValue( uno::Any& rVal, sal_uInt8 /*nMemberId*/) const
1864 {
1865 	rVal <<= (sal_Int32)GetValue();
1866 	return sal_True;
1867 }
1868 
PutValue(const uno::Any & rVal,sal_uInt8)1869 sal_Bool SdrEdgeLine3DeltaItem::PutValue( const uno::Any& rVal, sal_uInt8 /*nMemberId*/)
1870 {
1871 	sal_Int32 nValue = 0;
1872 	if(!(rVal >>= nValue))
1873 		return sal_False;
1874 
1875 	SetValue( nValue );
1876 	return sal_True;
1877 }
1878 
1879 //++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
1880 // Measure
1881 //++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
1882 
1883 // MeasureKind
1884 TYPEINIT1_AUTOFACTORY(SdrMeasureKindItem,SfxEnumItem);
1885 
Clone(SfxItemPool *) const1886 SfxPoolItem* __EXPORT SdrMeasureKindItem::Clone(SfxItemPool* /*pPool*/) const            { return new SdrMeasureKindItem(*this); }
1887 
Create(SvStream & rIn,sal_uInt16) const1888 SfxPoolItem* __EXPORT SdrMeasureKindItem::Create(SvStream& rIn, sal_uInt16 /*nVer*/) const   { return new SdrMeasureKindItem(rIn); }
1889 
GetValueCount() const1890 sal_uInt16 __EXPORT SdrMeasureKindItem::GetValueCount() const { return 2; }
1891 
GetValueTextByPos(sal_uInt16 nPos) const1892 XubString __EXPORT SdrMeasureKindItem::GetValueTextByPos(sal_uInt16 nPos) const
1893 {
1894 	return ImpGetResStr(STR_ItemValMEASURE_STD+nPos);
1895 }
1896 
GetPresentation(SfxItemPresentation ePres,SfxMapUnit,SfxMapUnit,XubString & rText,const IntlWrapper *) const1897 SfxItemPresentation __EXPORT SdrMeasureKindItem::GetPresentation(SfxItemPresentation ePres,
1898                       SfxMapUnit /*eCoreMetric*/, SfxMapUnit /*ePresMetric*/, XubString& rText, const IntlWrapper *) const
1899 {
1900 	rText=GetValueTextByPos(sal::static_int_cast< sal_uInt16 >(GetValue()));
1901 	if (ePres==SFX_ITEM_PRESENTATION_COMPLETE) {
1902 		String aStr;
1903 
1904 		SdrItemPool::TakeItemName(Which(), aStr);
1905 		aStr += sal_Unicode(' ');
1906 		rText.Insert(aStr, 0);
1907 	}
1908 	return ePres;
1909 }
1910 
QueryValue(uno::Any & rVal,sal_uInt8) const1911 sal_Bool SdrMeasureKindItem::QueryValue( uno::Any& rVal, sal_uInt8 /*nMemberId*/) const
1912 {
1913 	rVal <<= (drawing::MeasureKind)GetValue();
1914 	return sal_True;
1915 }
1916 
PutValue(const uno::Any & rVal,sal_uInt8)1917 sal_Bool SdrMeasureKindItem::PutValue( const uno::Any& rVal, sal_uInt8 /*nMemberId*/)
1918 {
1919 	drawing::MeasureKind eKind;
1920 	if(!(rVal >>= eKind))
1921 	{
1922 		sal_Int32 nEnum = 0;
1923 		if(!(rVal >>= nEnum))
1924 			return sal_False;
1925 
1926 		eKind = (drawing::MeasureKind)nEnum;
1927 	}
1928 
1929 	SetValue( sal::static_int_cast< sal_uInt16 >( (SdrMeasureKind)eKind ) );
1930 	return sal_True;
1931 }
1932 
1933 TYPEINIT1_AUTOFACTORY(SdrMeasureTextHPosItem,SfxEnumItem);
1934 
Clone(SfxItemPool *) const1935 SfxPoolItem* __EXPORT SdrMeasureTextHPosItem::Clone(SfxItemPool* /*pPool*/) const            { return new SdrMeasureTextHPosItem(*this); }
1936 
Create(SvStream & rIn,sal_uInt16) const1937 SfxPoolItem* __EXPORT SdrMeasureTextHPosItem::Create(SvStream& rIn, sal_uInt16 /*nVer*/) const   { return new SdrMeasureTextHPosItem(rIn); }
1938 
GetValueCount() const1939 sal_uInt16 __EXPORT SdrMeasureTextHPosItem::GetValueCount() const { return 4; }
1940 
GetValueTextByPos(sal_uInt16 nPos) const1941 XubString __EXPORT SdrMeasureTextHPosItem::GetValueTextByPos(sal_uInt16 nPos) const
1942 {
1943 	return ImpGetResStr(STR_ItemValMEASURE_TEXTHAUTO+nPos);
1944 }
1945 
GetPresentation(SfxItemPresentation ePres,SfxMapUnit,SfxMapUnit,XubString & rText,const IntlWrapper *) const1946 SfxItemPresentation __EXPORT SdrMeasureTextHPosItem::GetPresentation(SfxItemPresentation ePres,
1947                       SfxMapUnit /*eCoreMetric*/, SfxMapUnit /*ePresMetric*/, XubString& rText, const IntlWrapper *) const
1948 {
1949 	rText=GetValueTextByPos(sal::static_int_cast< sal_uInt16 >(GetValue()));
1950 	if (ePres==SFX_ITEM_PRESENTATION_COMPLETE) {
1951 		String aStr;
1952 
1953 		SdrItemPool::TakeItemName(Which(), aStr);
1954 		aStr += sal_Unicode(' ');
1955 		rText.Insert(aStr, 0);
1956 	}
1957 	return ePres;
1958 }
1959 
QueryValue(uno::Any & rVal,sal_uInt8) const1960 sal_Bool SdrMeasureTextHPosItem::QueryValue( uno::Any& rVal, sal_uInt8 /*nMemberId*/) const
1961 {
1962 	rVal <<= (drawing::MeasureTextHorzPos)GetValue();
1963 	return sal_True;
1964 }
1965 
PutValue(const uno::Any & rVal,sal_uInt8)1966 sal_Bool SdrMeasureTextHPosItem::PutValue( const uno::Any& rVal, sal_uInt8 /*nMemberId*/)
1967 {
1968 	drawing::MeasureTextHorzPos ePos;
1969 	if(!(rVal >>= ePos))
1970 	{
1971 		sal_Int32 nEnum = 0;
1972 		if(!(rVal >>= nEnum))
1973 			return sal_False;
1974 
1975 		ePos = (drawing::MeasureTextHorzPos)nEnum;
1976 	}
1977 
1978 	SetValue( sal::static_int_cast< sal_uInt16 >( (SdrMeasureTextHPos)ePos ) );
1979 	return sal_True;
1980 }
1981 
1982 TYPEINIT1_AUTOFACTORY(SdrMeasureTextVPosItem,SfxEnumItem);
1983 
Clone(SfxItemPool *) const1984 SfxPoolItem* __EXPORT SdrMeasureTextVPosItem::Clone(SfxItemPool* /*pPool*/) const            { return new SdrMeasureTextVPosItem(*this); }
1985 
Create(SvStream & rIn,sal_uInt16) const1986 SfxPoolItem* __EXPORT SdrMeasureTextVPosItem::Create(SvStream& rIn, sal_uInt16 /*nVer*/) const   { return new SdrMeasureTextVPosItem(rIn); }
1987 
GetValueCount() const1988 sal_uInt16 __EXPORT SdrMeasureTextVPosItem::GetValueCount() const { return 5; }
1989 
GetValueTextByPos(sal_uInt16 nPos) const1990 XubString __EXPORT SdrMeasureTextVPosItem::GetValueTextByPos(sal_uInt16 nPos) const
1991 {
1992 	return ImpGetResStr(STR_ItemValMEASURE_TEXTVAUTO+nPos);
1993 }
1994 
GetPresentation(SfxItemPresentation ePres,SfxMapUnit,SfxMapUnit,XubString & rText,const IntlWrapper *) const1995 SfxItemPresentation __EXPORT SdrMeasureTextVPosItem::GetPresentation(SfxItemPresentation ePres,
1996                       SfxMapUnit /*eCoreMetric*/, SfxMapUnit /*ePresMetric*/, XubString& rText, const IntlWrapper *) const
1997 {
1998 	rText=GetValueTextByPos(sal::static_int_cast< sal_uInt16 >(GetValue()));
1999 	if (ePres==SFX_ITEM_PRESENTATION_COMPLETE) {
2000 		String aStr;
2001 
2002 		SdrItemPool::TakeItemName(Which(), aStr);
2003 		aStr += sal_Unicode(' ');
2004 		rText.Insert(aStr, 0);
2005 	}
2006 	return ePres;
2007 }
2008 
QueryValue(uno::Any & rVal,sal_uInt8) const2009 sal_Bool SdrMeasureTextVPosItem::QueryValue( uno::Any& rVal, sal_uInt8 /*nMemberId*/) const
2010 {
2011 	rVal <<= (drawing::MeasureTextVertPos)GetValue();
2012 	return sal_True;
2013 }
2014 
PutValue(const uno::Any & rVal,sal_uInt8)2015 sal_Bool SdrMeasureTextVPosItem::PutValue( const uno::Any& rVal, sal_uInt8 /*nMemberId*/)
2016 {
2017 	drawing::MeasureTextVertPos ePos;
2018 	if(!(rVal >>= ePos))
2019 	{
2020 		sal_Int32 nEnum = 0;
2021 		if(!(rVal >>= nEnum))
2022 			return sal_False;
2023 
2024 		ePos = (drawing::MeasureTextVertPos)nEnum;
2025 	}
2026 
2027 	SetValue( sal::static_int_cast< sal_uInt16 >( (SdrMeasureTextHPos)ePos ) );
2028 	return sal_True;
2029 }
2030 
2031 TYPEINIT1_AUTOFACTORY(SdrMeasureUnitItem,SfxEnumItem);
2032 
Clone(SfxItemPool *) const2033 SfxPoolItem* __EXPORT SdrMeasureUnitItem::Clone(SfxItemPool* /*pPool*/) const            { return new SdrMeasureUnitItem(*this); }
2034 
Create(SvStream & rIn,sal_uInt16) const2035 SfxPoolItem* __EXPORT SdrMeasureUnitItem::Create(SvStream& rIn, sal_uInt16 /*nVer*/) const   { return new SdrMeasureUnitItem(rIn); }
2036 
GetValueCount() const2037 sal_uInt16 __EXPORT SdrMeasureUnitItem::GetValueCount() const { return 14; }
2038 
GetValueTextByPos(sal_uInt16 nPos) const2039 XubString __EXPORT SdrMeasureUnitItem::GetValueTextByPos(sal_uInt16 nPos) const
2040 {
2041 	XubString aRetval;
2042 
2043 	if((FieldUnit)nPos == FUNIT_NONE)
2044 	{
2045 		const sal_Char aText[] = "default";
2046 		aRetval += UniString(aText, sizeof(aText)-1);
2047 	}
2048 	else
2049 	{
2050 		SdrFormatter::TakeUnitStr((FieldUnit)nPos, aRetval);
2051 	}
2052 
2053 	return aRetval;
2054 }
2055 
GetPresentation(SfxItemPresentation ePres,SfxMapUnit,SfxMapUnit,XubString & rText,const IntlWrapper *) const2056 SfxItemPresentation __EXPORT SdrMeasureUnitItem::GetPresentation(SfxItemPresentation ePres,
2057                       SfxMapUnit /*eCoreMetric*/, SfxMapUnit /*ePresMetric*/, XubString& rText, const IntlWrapper *) const
2058 {
2059 	rText=GetValueTextByPos(sal::static_int_cast< sal_uInt16 >(GetValue()));
2060 	if (ePres==SFX_ITEM_PRESENTATION_COMPLETE) {
2061 		String aStr;
2062 
2063 		SdrItemPool::TakeItemName(Which(), aStr);
2064 		aStr += sal_Unicode(' ');
2065 		rText.Insert(aStr, 0);
2066 	}
2067 	return ePres;
2068 }
2069 
QueryValue(uno::Any & rVal,sal_uInt8) const2070 sal_Bool SdrMeasureUnitItem::QueryValue( uno::Any& rVal, sal_uInt8 /*nMemberId*/) const
2071 {
2072 	rVal <<= (sal_Int32)GetValue();
2073 	return sal_True;
2074 }
2075 
PutValue(const uno::Any & rVal,sal_uInt8)2076 sal_Bool SdrMeasureUnitItem::PutValue( const uno::Any& rVal, sal_uInt8 /*nMemberId*/)
2077 {
2078 	sal_Int32 nMeasure = 0;
2079 	if(!(rVal >>= nMeasure))
2080 		return sal_False;
2081 
2082 	SetValue( sal::static_int_cast< sal_uInt16 >( (FieldUnit)nMeasure ) );
2083 	return sal_True;
2084 }
2085 
2086 //++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
2087 // Circ
2088 //++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
2089 
2090 // CircKind
2091 TYPEINIT1_AUTOFACTORY(SdrCircKindItem,SfxEnumItem);
2092 
Clone(SfxItemPool *) const2093 SfxPoolItem* __EXPORT SdrCircKindItem::Clone(SfxItemPool* /*pPool*/) const          { return new SdrCircKindItem(*this); }
2094 
Create(SvStream & rIn,sal_uInt16) const2095 SfxPoolItem* __EXPORT SdrCircKindItem::Create(SvStream& rIn, sal_uInt16 /*nVer*/) const { return new SdrCircKindItem(rIn); }
2096 
GetValueCount() const2097 sal_uInt16 __EXPORT SdrCircKindItem::GetValueCount() const { return 4; }
2098 
GetValueTextByPos(sal_uInt16 nPos) const2099 XubString __EXPORT SdrCircKindItem::GetValueTextByPos(sal_uInt16 nPos) const
2100 {
2101 	return ImpGetResStr(STR_ItemValCIRC_FULL+nPos);
2102 }
2103 
GetPresentation(SfxItemPresentation ePres,SfxMapUnit,SfxMapUnit,XubString & rText,const IntlWrapper *) const2104 SfxItemPresentation __EXPORT SdrCircKindItem::GetPresentation(SfxItemPresentation ePres,
2105                       SfxMapUnit /*eCoreMetric*/, SfxMapUnit /*ePresMetric*/, XubString& rText, const IntlWrapper *) const
2106 {
2107 	rText=GetValueTextByPos(sal::static_int_cast< sal_uInt16 >(GetValue()));
2108 	if (ePres==SFX_ITEM_PRESENTATION_COMPLETE) {
2109 		String aStr;
2110 
2111 		SdrItemPool::TakeItemName(Which(), aStr);
2112 		aStr += sal_Unicode(' ');
2113 		rText.Insert(aStr, 0);
2114 	}
2115 	return ePres;
2116 }
2117 
QueryValue(uno::Any & rVal,sal_uInt8) const2118 sal_Bool SdrCircKindItem::QueryValue( uno::Any& rVal, sal_uInt8 /*nMemberId*/) const
2119 {
2120 	rVal <<= (drawing::CircleKind)GetValue();
2121 	return sal_True;
2122 }
2123 
PutValue(const uno::Any & rVal,sal_uInt8)2124 sal_Bool SdrCircKindItem::PutValue( const uno::Any& rVal, sal_uInt8 /*nMemberId*/)
2125 {
2126 	drawing::CircleKind eKind;
2127 	if(!(rVal >>= eKind))
2128 	{
2129 		sal_Int32 nEnum = 0;
2130 		if(!(rVal >>= nEnum))
2131 			return sal_False;
2132 
2133 		eKind = (drawing::CircleKind)nEnum;
2134 	}
2135 
2136 	SetValue( sal::static_int_cast< sal_uInt16 >( (SdrCircKind)eKind ) );
2137 	return sal_True;
2138 }
2139 
2140 //------------------------------------------------------------
2141 // class SdrSignedPercentItem
2142 //------------------------------------------------------------
2143 
2144 TYPEINIT1_AUTOFACTORY( SdrSignedPercentItem, SfxInt16Item );
2145 
2146 
Clone(SfxItemPool *) const2147 SfxPoolItem* __EXPORT SdrSignedPercentItem::Clone(SfxItemPool* /*pPool*/) const
2148 {
2149 	return new SdrSignedPercentItem( Which(), GetValue() );
2150 }
2151 
Create(SvStream & rIn,sal_uInt16) const2152 SfxPoolItem* __EXPORT SdrSignedPercentItem::Create( SvStream& rIn, sal_uInt16 /*nVer*/) const
2153 {
2154 	return new SdrSignedPercentItem( Which(), rIn );
2155 }
2156 
GetPresentation(SfxItemPresentation ePres,SfxMapUnit,SfxMapUnit,XubString & rText,const IntlWrapper *) const2157 SfxItemPresentation __EXPORT SdrSignedPercentItem::GetPresentation(
2158 	SfxItemPresentation ePres, SfxMapUnit /*eCoreMetric*/, SfxMapUnit /*ePresMetric*/,
2159     XubString& rText, const IntlWrapper *) const
2160 {
2161 	rText = UniString::CreateFromInt32(GetValue());
2162 	rText += sal_Unicode('%');
2163 
2164 	if(ePres == SFX_ITEM_PRESENTATION_COMPLETE)
2165 	{
2166 		XubString aStr;
2167 
2168 		SdrItemPool::TakeItemName(Which(), aStr);
2169 		aStr += sal_Unicode(' ');
2170 		rText.Insert(aStr, 0);
2171 	}
2172 
2173 	return ePres;
2174 }
2175 
2176 #ifdef SDR_ISPOOLABLE
2177 
IsPoolable() const2178 int __EXPORT SdrSignedPercentItem::IsPoolable() const
2179 {
2180 	sal_uInt16 nId=Which();
2181 	return nId < SDRATTR_NOTPERSIST_FIRST || nId > SDRATTR_NOTPERSIST_LAST;
2182 }
2183 #endif
2184 
2185 //++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
2186 // SdrGrafRedItem
2187 //++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
2188 
2189 TYPEINIT1( SdrGrafRedItem, SdrSignedPercentItem );
2190 
Clone(SfxItemPool *) const2191 SfxPoolItem* __EXPORT SdrGrafRedItem::Clone( SfxItemPool* /*pPool*/) const
2192 {
2193 	return new SdrGrafRedItem( *this );
2194 }
2195 
Create(SvStream & rIn,sal_uInt16) const2196 SfxPoolItem* __EXPORT SdrGrafRedItem::Create( SvStream& rIn, sal_uInt16 /*nVer*/) const
2197 {
2198 	return new SdrGrafRedItem( rIn );
2199 }
2200 
2201 //++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
2202 // SdrGrafGreenItem
2203 //++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
2204 
2205 TYPEINIT1( SdrGrafGreenItem, SdrSignedPercentItem );
2206 
Clone(SfxItemPool *) const2207 SfxPoolItem* __EXPORT SdrGrafGreenItem::Clone( SfxItemPool* /*pPool*/) const
2208 {
2209 	return new SdrGrafGreenItem( *this );
2210 }
2211 
Create(SvStream & rIn,sal_uInt16) const2212 SfxPoolItem* __EXPORT SdrGrafGreenItem::Create( SvStream& rIn, sal_uInt16 /*nVer*/) const
2213 {
2214 	return new SdrGrafGreenItem( rIn );
2215 }
2216 
2217 //++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
2218 // SdrGrafBlueItem
2219 //++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
2220 
2221 TYPEINIT1( SdrGrafBlueItem, SdrSignedPercentItem );
2222 
Clone(SfxItemPool *) const2223 SfxPoolItem* __EXPORT SdrGrafBlueItem::Clone( SfxItemPool* /*pPool*/) const
2224 {
2225 	return new SdrGrafBlueItem( *this );
2226 }
2227 
Create(SvStream & rIn,sal_uInt16) const2228 SfxPoolItem* __EXPORT SdrGrafBlueItem::Create( SvStream& rIn, sal_uInt16 /*nVer*/) const
2229 {
2230 	return new SdrGrafBlueItem( rIn );
2231 }
2232 
2233 //++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
2234 // SdrGrafLuminanceItem
2235 //++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
2236 
2237 TYPEINIT1( SdrGrafLuminanceItem, SdrSignedPercentItem );
2238 
Clone(SfxItemPool *) const2239 SfxPoolItem* __EXPORT SdrGrafLuminanceItem::Clone( SfxItemPool* /*pPool*/) const
2240 {
2241 	return new SdrGrafLuminanceItem( *this );
2242 }
2243 
Create(SvStream & rIn,sal_uInt16) const2244 SfxPoolItem* __EXPORT SdrGrafLuminanceItem::Create( SvStream& rIn, sal_uInt16 /*nVer*/) const
2245 {
2246 	return new SdrGrafLuminanceItem( rIn );
2247 }
2248 
2249 //++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
2250 // SdrGrafContrastItem
2251 //++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
2252 
2253 TYPEINIT1( SdrGrafContrastItem, SdrSignedPercentItem );
2254 
Clone(SfxItemPool *) const2255 SfxPoolItem* __EXPORT SdrGrafContrastItem::Clone( SfxItemPool* /*pPool*/) const
2256 {
2257 	return new SdrGrafContrastItem( *this );
2258 }
2259 
Create(SvStream & rIn,sal_uInt16) const2260 SfxPoolItem* __EXPORT SdrGrafContrastItem::Create( SvStream& rIn, sal_uInt16 /*nVer*/) const
2261 {
2262 	return new SdrGrafContrastItem( rIn );
2263 }
2264 
2265 //++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
2266 // SdrGrafGamma100Item
2267 //++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
2268 
2269 TYPEINIT1( SdrGrafGamma100Item, SfxUInt32Item );
2270 
Clone(SfxItemPool *) const2271 SfxPoolItem* __EXPORT SdrGrafGamma100Item::Clone( SfxItemPool* /*pPool */) const
2272 {
2273 	return new SdrGrafGamma100Item( *this );
2274 }
2275 
Create(SvStream & rIn,sal_uInt16) const2276 SfxPoolItem* __EXPORT SdrGrafGamma100Item::Create( SvStream& rIn, sal_uInt16 /*nVer*/) const
2277 {
2278 	return new SdrGrafGamma100Item( rIn );
2279 }
2280 
QueryValue(uno::Any & rVal,sal_uInt8) const2281 sal_Bool SdrGrafGamma100Item::QueryValue( uno::Any& rVal, sal_uInt8 /*nMemberId*/) const
2282 {
2283 	rVal <<= ((double)GetValue()) / 100.0;
2284 	return sal_True;
2285 }
2286 
PutValue(const uno::Any & rVal,sal_uInt8)2287 sal_Bool SdrGrafGamma100Item::PutValue( const uno::Any& rVal, sal_uInt8 /*nMemberId*/)
2288 {
2289 	double nGamma = 0;
2290 	if(!(rVal >>= nGamma))
2291 		return sal_False;
2292 
2293 	SetValue( (sal_uInt32)(nGamma * 100.0  ) );
2294 	return sal_True;
2295 }
2296 
2297 //++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
2298 // SdrGrafInvertItem
2299 //++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
2300 
2301 TYPEINIT1( SdrGrafInvertItem, SdrOnOffItem );
2302 
Clone(SfxItemPool *) const2303 SfxPoolItem* __EXPORT SdrGrafInvertItem::Clone( SfxItemPool* /*pPool*/) const
2304 {
2305 	return new SdrGrafInvertItem( *this );
2306 }
2307 
Create(SvStream & rIn,sal_uInt16) const2308 SfxPoolItem* __EXPORT SdrGrafInvertItem::Create( SvStream& rIn, sal_uInt16 /*nVer*/) const
2309 {
2310 	return new SdrGrafInvertItem( rIn );
2311 }
2312 
2313 //++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
2314 // SdrGrafTransparenceItem
2315 //++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
2316 
2317 TYPEINIT1( SdrGrafTransparenceItem, SdrPercentItem );
2318 
Clone(SfxItemPool *) const2319 SfxPoolItem* __EXPORT SdrGrafTransparenceItem::Clone( SfxItemPool* /*pPool*/) const
2320 {
2321 	return new SdrGrafTransparenceItem( *this );
2322 }
2323 
Create(SvStream & rIn,sal_uInt16) const2324 SfxPoolItem* __EXPORT SdrGrafTransparenceItem::Create( SvStream& rIn, sal_uInt16 /*nVer*/) const
2325 {
2326 	return new SdrGrafTransparenceItem( rIn );
2327 }
2328 
2329 //++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
2330 // SdrGrafModeItem
2331 //++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
2332 
2333 TYPEINIT1( SdrGrafModeItem, SfxEnumItem );
2334 
Clone(SfxItemPool *) const2335 SfxPoolItem* __EXPORT SdrGrafModeItem::Clone(SfxItemPool* /*pPool*/) const
2336 {
2337 	return new SdrGrafModeItem( *this );
2338 }
2339 
Create(SvStream & rIn,sal_uInt16) const2340 SfxPoolItem* __EXPORT SdrGrafModeItem::Create( SvStream& rIn, sal_uInt16 /*nVer*/) const
2341 {
2342 	return new SdrGrafModeItem( rIn );
2343 }
2344 
GetValueCount() const2345 sal_uInt16 __EXPORT SdrGrafModeItem::GetValueCount() const
2346 {
2347 	return 4;
2348 }
2349 
GetValueTextByPos(sal_uInt16 nPos) const2350 XubString __EXPORT SdrGrafModeItem::GetValueTextByPos(sal_uInt16 nPos) const
2351 {
2352 	XubString aStr;
2353 
2354 	switch(nPos)
2355 	{
2356 		case 1:
2357 		{
2358 			const sal_Char aTextGreys[] = "Greys";
2359 			aStr += UniString(aTextGreys, sizeof(aTextGreys)-1);
2360 			break;
2361 		}
2362 		case 2:
2363 		{
2364 			const sal_Char aTextBlackWhite[] = "Black/White";
2365 			aStr += UniString(aTextBlackWhite, sizeof(aTextBlackWhite)-1);
2366 			break;
2367 		}
2368 		case 3:
2369 		{
2370 			const sal_Char aTextWatermark[] = "Watermark";
2371 			aStr += UniString(aTextWatermark, sizeof(aTextWatermark)-1);
2372 			break;
2373 		}
2374 		default:
2375 		{
2376 			const sal_Char aTextStandard[] = "Standard";
2377 			aStr += UniString(aTextStandard, sizeof(aTextStandard)-1);
2378 			break;
2379 		}
2380 	}
2381 
2382 	return aStr;
2383 }
2384 
GetPresentation(SfxItemPresentation ePres,SfxMapUnit,SfxMapUnit,XubString & rText,const IntlWrapper *) const2385 SfxItemPresentation __EXPORT SdrGrafModeItem::GetPresentation( SfxItemPresentation ePres,
2386 															   SfxMapUnit /*eCoreMetric*/, SfxMapUnit /*ePresMetric*/,
2387                                                                XubString& rText, const IntlWrapper *) const
2388 {
2389 	rText = GetValueTextByPos( sal::static_int_cast< sal_uInt16 >( GetValue() ) );
2390 
2391 	if( ePres == SFX_ITEM_PRESENTATION_COMPLETE )
2392 	{
2393 		String aStr;
2394 
2395 		SdrItemPool::TakeItemName( Which(), aStr );
2396 		aStr += sal_Unicode(' ');
2397 		rText.Insert( aStr, 0 );
2398 	}
2399 
2400 	return ePres;
2401 }
2402 
2403 //++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
2404 // SdrGrafCropItem
2405 //++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
2406 
2407 TYPEINIT1( SdrGrafCropItem, SvxGrfCrop );
2408 
Clone(SfxItemPool *) const2409 SfxPoolItem* SdrGrafCropItem::Clone( SfxItemPool* /*pPool*/) const
2410 {
2411 	return new SdrGrafCropItem( *this );
2412 }
2413 
Create(SvStream & rIn,sal_uInt16 nVer) const2414 SfxPoolItem* SdrGrafCropItem::Create( SvStream& rIn, sal_uInt16 nVer ) const
2415 {
2416 	return( ( 0 == nVer ) ? Clone( NULL ) : SvxGrfCrop::Create( rIn, nVer ) );
2417 }
2418 
GetVersion(sal_uInt16) const2419 sal_uInt16 SdrGrafCropItem::GetVersion( sal_uInt16 /*nFileVersion*/) const
2420 {
2421 	// GRFCROP_VERSION_MOVETOSVX is 1
2422 	return GRFCROP_VERSION_MOVETOSVX;
2423 }
2424 
2425 // eof
2426