bump product version to 5.0.4.1
[LibreOffice.git] / svx / source / svdraw / svdattr.cxx
blob408a694623dcc8087f30ad98752e26a98b97ab79
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*
3 * This file is part of the LibreOffice project.
5 * This Source Code Form is subject to the terms of the Mozilla Public
6 * License, v. 2.0. If a copy of the MPL was not distributed with this
7 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
9 * This file incorporates work covered by the following license notice:
11 * Licensed to the Apache Software Foundation (ASF) under one or more
12 * contributor license agreements. See the NOTICE file distributed
13 * with this work for additional information regarding copyright
14 * ownership. The ASF licenses this file to you under the Apache
15 * License, Version 2.0 (the "License"); you may not use this file
16 * except in compliance with the License. You may obtain a copy of
17 * the License at http://www.apache.org/licenses/LICENSE-2.0 .
20 #include <com/sun/star/drawing/TextFitToSizeType.hpp>
21 #include <com/sun/star/drawing/TextHorizontalAdjust.hpp>
22 #include <com/sun/star/drawing/TextVerticalAdjust.hpp>
23 #include <com/sun/star/drawing/TextAnimationKind.hpp>
24 #include <com/sun/star/uno/Any.hxx>
25 #include <com/sun/star/drawing/TextAnimationDirection.hpp>
26 #include <com/sun/star/drawing/ConnectorType.hpp>
27 #include <com/sun/star/drawing/MeasureKind.hpp>
28 #include <com/sun/star/drawing/MeasureTextHorzPos.hpp>
29 #include <com/sun/star/drawing/MeasureTextVertPos.hpp>
30 #include <com/sun/star/drawing/CircleKind.hpp>
31 #include <com/sun/star/uno/Sequence.hxx>
33 #include "editeng/boxitem.hxx"
34 #include "editeng/lineitem.hxx"
35 #include "editeng/shaditem.hxx"
36 #include "editeng/xmlcnitm.hxx"
37 #include <comphelper/processfactory.hxx>
38 #include <editeng/adjustitem.hxx>
39 #include <editeng/editdata.hxx>
40 #include <editeng/writingmodeitem.hxx>
41 #include <i18nutil/unicode.hxx>
42 #include <svl/solar.hrc>
43 #include <tools/bigint.hxx>
44 #include <tools/stream.hxx>
45 #include <unotools/intlwrapper.hxx>
46 #include <vcl/svapp.hxx>
47 #include <vcl/settings.hxx>
49 #include "svdglob.hxx"
50 #include "svx/svdstr.hrc"
52 #include <svx/sdgcpitm.hxx>
53 #include <svx/sdtfchim.hxx>
54 #include <svx/svdattr.hxx>
55 #include <svx/svdmodel.hxx>
56 #include <svx/svdpool.hxx>
57 #include <svx/svdtrans.hxx>
58 #include <svx/svx3ditems.hxx>
59 #include <svx/svxids.hrc>
60 #include <sxallitm.hxx>
61 #include <svx/sxcaitm.hxx>
62 #include <svx/sxcecitm.hxx>
63 #include <svx/sxcgitm.hxx>
64 #include <svx/sxciaitm.hxx>
65 #include <sxcikitm.hxx>
66 #include <svx/sxcllitm.hxx>
67 #include <svx/sxctitm.hxx>
68 #include <svx/sxekitm.hxx>
69 #include <svx/sxelditm.hxx>
70 #include <svx/sxenditm.hxx>
71 #include <svx/sxfiitm.hxx>
72 #include <sxlayitm.hxx>
73 #include <sxlogitm.hxx>
74 #include <svx/sxmbritm.hxx>
75 #include <svx/sxmfsitm.hxx>
76 #include <sxmkitm.hxx>
77 #include <svx/sxmlhitm.hxx>
78 #include <sxmoitm.hxx>
79 #include <sxmovitm.hxx>
80 #include <sxmsitm.hxx>
81 #include <svx/sxmspitm.hxx>
82 #include <svx/sxmsuitm.hxx>
83 #include <sxmtaitm.hxx>
84 #include <svx/sxmtfitm.hxx>
85 #include <svx/sxmtpitm.hxx>
86 #include <svx/sxmtritm.hxx>
87 #include <svx/sxmuitm.hxx>
88 #include <sxoneitm.hxx>
89 #include <sxonitm.hxx>
90 #include <sxopitm.hxx>
91 #include <sxraitm.hxx>
92 #include <sxreaitm.hxx>
93 #include <sxreoitm.hxx>
94 #include <sxroaitm.hxx>
95 #include <sxrooitm.hxx>
96 #include <sxsaitm.hxx>
97 #include <sxsalitm.hxx>
98 #include <svx/sxsiitm.hxx>
99 #include <sxsoitm.hxx>
100 #include <sxtraitm.hxx>
101 #include <svx/xfillit0.hxx>
102 #include <svx/xflclit.hxx>
103 #include <svx/xlineit0.hxx>
104 #include <svx/xtable.hxx>
106 using namespace ::com::sun::star;
108 SdrItemPool::SdrItemPool(
109 SfxItemPool* _pMaster,
110 bool bLoadRefCounts)
111 : XOutdevItemPool(_pMaster, SDRATTR_START, SDRATTR_END, bLoadRefCounts)
113 // prepare some constants
114 const Color aNullCol(RGB_Color(COL_BLACK));
115 const sal_Int32 nDefEdgeDist(500L); // Defaulting hard for Draw (100TH_MM) currently. MapMode will have to be taken into account in the future.
117 // init the non-persistent items
118 for(sal_uInt16 i(SDRATTR_NOTPERSIST_FIRST); i <= SDRATTR_NOTPERSIST_LAST; i++)
120 mpLocalItemInfos[i - SDRATTR_START]._nFlags = SfxItemPoolFlags::NONE;
123 // init own PoolDefaults
124 mppLocalPoolDefaults[SDRATTR_SHADOW -SDRATTR_START]=new SdrOnOffItem(SDRATTR_SHADOW, false);
125 mppLocalPoolDefaults[SDRATTR_SHADOWCOLOR -SDRATTR_START]=new XColorItem(SDRATTR_SHADOWCOLOR, aNullCol);
126 mppLocalPoolDefaults[SDRATTR_SHADOWXDIST -SDRATTR_START]=new SdrMetricItem(SDRATTR_SHADOWXDIST, 0);
127 mppLocalPoolDefaults[SDRATTR_SHADOWYDIST -SDRATTR_START]=new SdrMetricItem(SDRATTR_SHADOWYDIST, 0);
128 mppLocalPoolDefaults[SDRATTR_SHADOWTRANSPARENCE-SDRATTR_START]=new SdrPercentItem(SDRATTR_SHADOWTRANSPARENCE, 0);
129 mppLocalPoolDefaults[SDRATTR_SHADOW3D -SDRATTR_START]=new SfxVoidItem(SDRATTR_SHADOW3D );
130 mppLocalPoolDefaults[SDRATTR_SHADOWPERSP -SDRATTR_START]=new SfxVoidItem(SDRATTR_SHADOWPERSP );
131 mppLocalPoolDefaults[SDRATTR_CAPTIONTYPE -SDRATTR_START]=new SdrCaptionTypeItem ;
132 mppLocalPoolDefaults[SDRATTR_CAPTIONFIXEDANGLE-SDRATTR_START]=new SdrOnOffItem(SDRATTR_CAPTIONFIXEDANGLE, true);
133 mppLocalPoolDefaults[SDRATTR_CAPTIONANGLE -SDRATTR_START]=new SdrCaptionAngleItem ;
134 mppLocalPoolDefaults[SDRATTR_CAPTIONGAP -SDRATTR_START]=new SdrCaptionGapItem ;
135 mppLocalPoolDefaults[SDRATTR_CAPTIONESCDIR -SDRATTR_START]=new SdrCaptionEscDirItem ;
136 mppLocalPoolDefaults[SDRATTR_CAPTIONESCISREL -SDRATTR_START]=new SdrCaptionEscIsRelItem ;
137 mppLocalPoolDefaults[SDRATTR_CAPTIONESCREL -SDRATTR_START]=new SdrCaptionEscRelItem ;
138 mppLocalPoolDefaults[SDRATTR_CAPTIONESCABS -SDRATTR_START]=new SdrCaptionEscAbsItem ;
139 mppLocalPoolDefaults[SDRATTR_CAPTIONLINELEN -SDRATTR_START]=new SdrCaptionLineLenItem ;
140 mppLocalPoolDefaults[SDRATTR_CAPTIONFITLINELEN-SDRATTR_START]=new SdrCaptionFitLineLenItem;
141 mppLocalPoolDefaults[SDRATTR_ECKENRADIUS -SDRATTR_START]=new SdrMetricItem(SDRATTR_ECKENRADIUS, 0);
142 mppLocalPoolDefaults[SDRATTR_TEXT_MINFRAMEHEIGHT -SDRATTR_START]=new SdrMetricItem(SDRATTR_TEXT_MINFRAMEHEIGHT, 0);
143 mppLocalPoolDefaults[SDRATTR_TEXT_AUTOGROWHEIGHT -SDRATTR_START]=new SdrOnOffItem(SDRATTR_TEXT_AUTOGROWHEIGHT, true);
144 mppLocalPoolDefaults[SDRATTR_TEXT_FITTOSIZE -SDRATTR_START]=new SdrTextFitToSizeTypeItem;
145 mppLocalPoolDefaults[SDRATTR_TEXT_LEFTDIST -SDRATTR_START]=new SdrMetricItem(SDRATTR_TEXT_LEFTDIST, 0);
146 mppLocalPoolDefaults[SDRATTR_TEXT_RIGHTDIST -SDRATTR_START]=new SdrMetricItem(SDRATTR_TEXT_RIGHTDIST, 0);
147 mppLocalPoolDefaults[SDRATTR_TEXT_UPPERDIST -SDRATTR_START]=new SdrMetricItem(SDRATTR_TEXT_UPPERDIST, 0);
148 mppLocalPoolDefaults[SDRATTR_TEXT_LOWERDIST -SDRATTR_START]=new SdrMetricItem(SDRATTR_TEXT_LOWERDIST, 0);
149 mppLocalPoolDefaults[SDRATTR_TEXT_VERTADJUST -SDRATTR_START]=new SdrTextVertAdjustItem;
150 mppLocalPoolDefaults[SDRATTR_TEXT_MAXFRAMEHEIGHT -SDRATTR_START]=new SdrMetricItem(SDRATTR_TEXT_MAXFRAMEHEIGHT, 0);
151 mppLocalPoolDefaults[SDRATTR_TEXT_MINFRAMEWIDTH -SDRATTR_START]=new SdrMetricItem(SDRATTR_TEXT_MINFRAMEWIDTH, 0);
152 mppLocalPoolDefaults[SDRATTR_TEXT_MAXFRAMEWIDTH -SDRATTR_START]=new SdrMetricItem(SDRATTR_TEXT_MAXFRAMEWIDTH, 0);
153 mppLocalPoolDefaults[SDRATTR_TEXT_AUTOGROWWIDTH -SDRATTR_START]=new SdrOnOffItem(SDRATTR_TEXT_AUTOGROWWIDTH, false);
154 mppLocalPoolDefaults[SDRATTR_TEXT_HORZADJUST -SDRATTR_START]=new SdrTextHorzAdjustItem;
155 mppLocalPoolDefaults[SDRATTR_TEXT_ANIKIND -SDRATTR_START]=new SdrTextAniKindItem;
156 mppLocalPoolDefaults[SDRATTR_TEXT_ANIDIRECTION -SDRATTR_START]=new SdrTextAniDirectionItem;
157 mppLocalPoolDefaults[SDRATTR_TEXT_ANISTARTINSIDE -SDRATTR_START]=new SdrTextAniStartInsideItem;
158 mppLocalPoolDefaults[SDRATTR_TEXT_ANISTOPINSIDE -SDRATTR_START]=new SdrTextAniStopInsideItem;
159 mppLocalPoolDefaults[SDRATTR_TEXT_ANICOUNT -SDRATTR_START]=new SdrTextAniCountItem;
160 mppLocalPoolDefaults[SDRATTR_TEXT_ANIDELAY -SDRATTR_START]=new SdrTextAniDelayItem;
161 mppLocalPoolDefaults[SDRATTR_TEXT_ANIAMOUNT -SDRATTR_START]=new SdrTextAniAmountItem;
162 mppLocalPoolDefaults[SDRATTR_TEXT_CONTOURFRAME -SDRATTR_START]=new SdrOnOffItem(SDRATTR_TEXT_CONTOURFRAME, false);
163 mppLocalPoolDefaults[SDRATTR_CUSTOMSHAPE_ADJUSTMENT -SDRATTR_START]=new SdrCustomShapeAdjustmentItem;
164 mppLocalPoolDefaults[SDRATTR_XMLATTRIBUTES -SDRATTR_START]=new SvXMLAttrContainerItem( SDRATTR_XMLATTRIBUTES );
165 mppLocalPoolDefaults[SDRATTR_TEXT_USEFIXEDCELLHEIGHT -SDRATTR_START]=new SdrTextFixedCellHeightItem;
166 mppLocalPoolDefaults[SDRATTR_TEXT_WORDWRAP -SDRATTR_START]=new SdrOnOffItem(SDRATTR_TEXT_WORDWRAP, true);
167 mppLocalPoolDefaults[SDRATTR_TEXT_AUTOGROWSIZE -SDRATTR_START]=new SdrOnOffItem(SDRATTR_TEXT_AUTOGROWSIZE, false);
168 mppLocalPoolDefaults[SDRATTR_EDGEKIND -SDRATTR_START]=new SdrEdgeKindItem;
169 mppLocalPoolDefaults[SDRATTR_EDGENODE1HORZDIST-SDRATTR_START]=new SdrEdgeNode1HorzDistItem(nDefEdgeDist);
170 mppLocalPoolDefaults[SDRATTR_EDGENODE1VERTDIST-SDRATTR_START]=new SdrEdgeNode1VertDistItem(nDefEdgeDist);
171 mppLocalPoolDefaults[SDRATTR_EDGENODE2HORZDIST-SDRATTR_START]=new SdrEdgeNode2HorzDistItem(nDefEdgeDist);
172 mppLocalPoolDefaults[SDRATTR_EDGENODE2VERTDIST-SDRATTR_START]=new SdrEdgeNode2VertDistItem(nDefEdgeDist);
173 mppLocalPoolDefaults[SDRATTR_EDGENODE1GLUEDIST-SDRATTR_START]=new SdrEdgeNode1GlueDistItem;
174 mppLocalPoolDefaults[SDRATTR_EDGENODE2GLUEDIST-SDRATTR_START]=new SdrEdgeNode2GlueDistItem;
175 mppLocalPoolDefaults[SDRATTR_EDGELINEDELTAANZ -SDRATTR_START]=new SdrEdgeLineDeltaAnzItem;
176 mppLocalPoolDefaults[SDRATTR_EDGELINE1DELTA -SDRATTR_START]=new SdrMetricItem(SDRATTR_EDGELINE1DELTA, 0);
177 mppLocalPoolDefaults[SDRATTR_EDGELINE2DELTA -SDRATTR_START]=new SdrMetricItem(SDRATTR_EDGELINE2DELTA, 0);
178 mppLocalPoolDefaults[SDRATTR_EDGELINE3DELTA -SDRATTR_START]=new SdrMetricItem(SDRATTR_EDGELINE3DELTA, 0);
179 mppLocalPoolDefaults[SDRATTR_MEASUREKIND -SDRATTR_START]=new SdrMeasureKindItem;
180 mppLocalPoolDefaults[SDRATTR_MEASURETEXTHPOS -SDRATTR_START]=new SdrMeasureTextHPosItem;
181 mppLocalPoolDefaults[SDRATTR_MEASURETEXTVPOS -SDRATTR_START]=new SdrMeasureTextVPosItem;
182 mppLocalPoolDefaults[SDRATTR_MEASURELINEDIST -SDRATTR_START]=new SdrMetricItem(SDRATTR_MEASURELINEDIST, 800);
183 mppLocalPoolDefaults[SDRATTR_MEASUREHELPLINEOVERHANG -SDRATTR_START]=new SdrMetricItem(SDRATTR_MEASUREHELPLINEOVERHANG, 200);
184 mppLocalPoolDefaults[SDRATTR_MEASUREHELPLINEDIST -SDRATTR_START]=new SdrMetricItem(SDRATTR_MEASUREHELPLINEDIST, 100);
185 mppLocalPoolDefaults[SDRATTR_MEASUREHELPLINE1LEN -SDRATTR_START]=new SdrMetricItem(SDRATTR_MEASUREHELPLINE1LEN, 0);
186 mppLocalPoolDefaults[SDRATTR_MEASUREHELPLINE2LEN -SDRATTR_START]=new SdrMetricItem(SDRATTR_MEASUREHELPLINE2LEN, 0);
187 mppLocalPoolDefaults[SDRATTR_MEASUREBELOWREFEDGE -SDRATTR_START]=new SdrMeasureBelowRefEdgeItem;
188 mppLocalPoolDefaults[SDRATTR_MEASURETEXTROTA90 -SDRATTR_START]=new SdrMeasureTextRota90Item;
189 mppLocalPoolDefaults[SDRATTR_MEASURETEXTUPSIDEDOWN -SDRATTR_START]=new SdrMeasureTextUpsideDownItem;
190 mppLocalPoolDefaults[SDRATTR_MEASUREOVERHANG -SDRATTR_START]=new SdrMeasureOverhangItem(600);
191 mppLocalPoolDefaults[SDRATTR_MEASUREUNIT -SDRATTR_START]=new SdrMeasureUnitItem;
192 mppLocalPoolDefaults[SDRATTR_MEASURESCALE -SDRATTR_START]=new SdrMeasureScaleItem;
193 mppLocalPoolDefaults[SDRATTR_MEASURESHOWUNIT -SDRATTR_START]=new SdrYesNoItem(SDRATTR_MEASURESHOWUNIT, false);
194 mppLocalPoolDefaults[SDRATTR_MEASUREFORMATSTRING -SDRATTR_START]=new SdrMeasureFormatStringItem();
195 mppLocalPoolDefaults[SDRATTR_MEASURETEXTAUTOANGLE -SDRATTR_START]=new SdrMeasureTextAutoAngleItem();
196 mppLocalPoolDefaults[SDRATTR_MEASURETEXTAUTOANGLEVIEW-SDRATTR_START]=new SdrMeasureTextAutoAngleViewItem();
197 mppLocalPoolDefaults[SDRATTR_MEASURETEXTISFIXEDANGLE -SDRATTR_START]=new SdrMeasureTextIsFixedAngleItem();
198 mppLocalPoolDefaults[SDRATTR_MEASURETEXTFIXEDANGLE -SDRATTR_START]=new SdrMeasureTextFixedAngleItem();
199 mppLocalPoolDefaults[SDRATTR_MEASUREDECIMALPLACES -SDRATTR_START]=new SdrMeasureDecimalPlacesItem();
200 mppLocalPoolDefaults[SDRATTR_CIRCKIND -SDRATTR_START]=new SdrCircKindItem;
201 mppLocalPoolDefaults[SDRATTR_CIRCSTARTANGLE-SDRATTR_START]=new SdrAngleItem(SDRATTR_CIRCSTARTANGLE, 0);
202 mppLocalPoolDefaults[SDRATTR_CIRCENDANGLE -SDRATTR_START]=new SdrAngleItem(SDRATTR_CIRCENDANGLE, 36000);
203 mppLocalPoolDefaults[SDRATTR_OBJMOVEPROTECT -SDRATTR_START]=new SdrYesNoItem(SDRATTR_OBJMOVEPROTECT, false);
204 mppLocalPoolDefaults[SDRATTR_OBJSIZEPROTECT -SDRATTR_START]=new SdrYesNoItem(SDRATTR_OBJSIZEPROTECT, false);
205 mppLocalPoolDefaults[SDRATTR_OBJPRINTABLE -SDRATTR_START]=new SdrObjPrintableItem;
206 mppLocalPoolDefaults[SDRATTR_OBJVISIBLE -SDRATTR_START]=new SdrObjVisibleItem;
207 mppLocalPoolDefaults[SDRATTR_LAYERID -SDRATTR_START]=new SdrLayerIdItem;
208 mppLocalPoolDefaults[SDRATTR_LAYERNAME -SDRATTR_START]=new SdrLayerNameItem;
209 mppLocalPoolDefaults[SDRATTR_OBJECTNAME -SDRATTR_START]=new SfxStringItem(SDRATTR_OBJECTNAME);
210 mppLocalPoolDefaults[SDRATTR_ALLPOSITIONX -SDRATTR_START]=new SdrAllPositionXItem;
211 mppLocalPoolDefaults[SDRATTR_ALLPOSITIONY -SDRATTR_START]=new SdrAllPositionYItem;
212 mppLocalPoolDefaults[SDRATTR_ALLSIZEWIDTH -SDRATTR_START]=new SdrAllSizeWidthItem;
213 mppLocalPoolDefaults[SDRATTR_ALLSIZEHEIGHT -SDRATTR_START]=new SdrAllSizeHeightItem;
214 mppLocalPoolDefaults[SDRATTR_ONEPOSITIONX -SDRATTR_START]=new SdrOnePositionXItem;
215 mppLocalPoolDefaults[SDRATTR_ONEPOSITIONY -SDRATTR_START]=new SdrOnePositionYItem;
216 mppLocalPoolDefaults[SDRATTR_ONESIZEWIDTH -SDRATTR_START]=new SdrOneSizeWidthItem;
217 mppLocalPoolDefaults[SDRATTR_ONESIZEHEIGHT -SDRATTR_START]=new SdrOneSizeHeightItem;
218 mppLocalPoolDefaults[SDRATTR_LOGICSIZEWIDTH -SDRATTR_START]=new SdrLogicSizeWidthItem;
219 mppLocalPoolDefaults[SDRATTR_LOGICSIZEHEIGHT-SDRATTR_START]=new SdrLogicSizeHeightItem;
220 mppLocalPoolDefaults[SDRATTR_ROTATEANGLE -SDRATTR_START]=new SdrAngleItem(SDRATTR_ROTATEANGLE, 0);
221 mppLocalPoolDefaults[SDRATTR_SHEARANGLE -SDRATTR_START]=new SdrShearAngleItem;
222 mppLocalPoolDefaults[SDRATTR_MOVEX -SDRATTR_START]=new SdrMoveXItem;
223 mppLocalPoolDefaults[SDRATTR_MOVEY -SDRATTR_START]=new SdrMoveYItem;
224 mppLocalPoolDefaults[SDRATTR_RESIZEXONE -SDRATTR_START]=new SdrResizeXOneItem;
225 mppLocalPoolDefaults[SDRATTR_RESIZEYONE -SDRATTR_START]=new SdrResizeYOneItem;
226 mppLocalPoolDefaults[SDRATTR_ROTATEONE -SDRATTR_START]=new SdrRotateOneItem;
227 mppLocalPoolDefaults[SDRATTR_HORZSHEARONE -SDRATTR_START]=new SdrHorzShearOneItem;
228 mppLocalPoolDefaults[SDRATTR_VERTSHEARONE -SDRATTR_START]=new SdrVertShearOneItem;
229 mppLocalPoolDefaults[SDRATTR_RESIZEXALL -SDRATTR_START]=new SdrResizeXAllItem;
230 mppLocalPoolDefaults[SDRATTR_RESIZEYALL -SDRATTR_START]=new SdrResizeYAllItem;
231 mppLocalPoolDefaults[SDRATTR_ROTATEALL -SDRATTR_START]=new SdrRotateAllItem;
232 mppLocalPoolDefaults[SDRATTR_HORZSHEARALL -SDRATTR_START]=new SdrHorzShearAllItem;
233 mppLocalPoolDefaults[SDRATTR_VERTSHEARALL -SDRATTR_START]=new SdrVertShearAllItem;
234 mppLocalPoolDefaults[SDRATTR_TRANSFORMREF1X -SDRATTR_START]=new SdrTransformRef1XItem;
235 mppLocalPoolDefaults[SDRATTR_TRANSFORMREF1Y -SDRATTR_START]=new SdrTransformRef1YItem;
236 mppLocalPoolDefaults[SDRATTR_TRANSFORMREF2X -SDRATTR_START]=new SdrTransformRef2XItem;
237 mppLocalPoolDefaults[SDRATTR_TRANSFORMREF2Y -SDRATTR_START]=new SdrTransformRef2YItem;
238 mppLocalPoolDefaults[SDRATTR_TEXTDIRECTION -SDRATTR_START]=new SvxWritingModeItem(com::sun::star::text::WritingMode_LR_TB, SDRATTR_TEXTDIRECTION);
239 mppLocalPoolDefaults[ SDRATTR_GRAFRED - SDRATTR_START] = new SdrGrafRedItem;
240 mppLocalPoolDefaults[ SDRATTR_GRAFGREEN - SDRATTR_START] = new SdrGrafGreenItem;
241 mppLocalPoolDefaults[ SDRATTR_GRAFBLUE - SDRATTR_START] = new SdrGrafBlueItem;
242 mppLocalPoolDefaults[ SDRATTR_GRAFLUMINANCE - SDRATTR_START] = new SdrGrafLuminanceItem;
243 mppLocalPoolDefaults[ SDRATTR_GRAFCONTRAST - SDRATTR_START] = new SdrGrafContrastItem;
244 mppLocalPoolDefaults[ SDRATTR_GRAFGAMMA - SDRATTR_START] = new SdrGrafGamma100Item;
245 mppLocalPoolDefaults[ SDRATTR_GRAFTRANSPARENCE - SDRATTR_START] = new SdrGrafTransparenceItem;
246 mppLocalPoolDefaults[ SDRATTR_GRAFINVERT - SDRATTR_START] = new SdrGrafInvertItem;
247 mppLocalPoolDefaults[ SDRATTR_GRAFMODE - SDRATTR_START] = new SdrGrafModeItem;
248 mppLocalPoolDefaults[ SDRATTR_GRAFCROP - SDRATTR_START] = new SdrGrafCropItem;
249 mppLocalPoolDefaults[ SDRATTR_3DOBJ_PERCENT_DIAGONAL - SDRATTR_START ] = new SfxUInt16Item(SDRATTR_3DOBJ_PERCENT_DIAGONAL, 10);
250 mppLocalPoolDefaults[ SDRATTR_3DOBJ_BACKSCALE - SDRATTR_START ] = new SfxUInt16Item(SDRATTR_3DOBJ_BACKSCALE, 100);
251 mppLocalPoolDefaults[ SDRATTR_3DOBJ_DEPTH - SDRATTR_START ] = new SfxUInt32Item(SDRATTR_3DOBJ_DEPTH, 1000);
252 mppLocalPoolDefaults[ SDRATTR_3DOBJ_HORZ_SEGS - SDRATTR_START ] = new SfxUInt32Item(SDRATTR_3DOBJ_HORZ_SEGS, 24);
253 mppLocalPoolDefaults[ SDRATTR_3DOBJ_VERT_SEGS - SDRATTR_START ] = new SfxUInt32Item(SDRATTR_3DOBJ_VERT_SEGS, 24);
254 mppLocalPoolDefaults[ SDRATTR_3DOBJ_END_ANGLE - SDRATTR_START ] = new SfxUInt32Item(SDRATTR_3DOBJ_END_ANGLE, 3600);
255 mppLocalPoolDefaults[ SDRATTR_3DOBJ_DOUBLE_SIDED - SDRATTR_START ] = new SfxBoolItem(SDRATTR_3DOBJ_DOUBLE_SIDED, false);
256 mppLocalPoolDefaults[ SDRATTR_3DOBJ_NORMALS_KIND - SDRATTR_START ] = new Svx3DNormalsKindItem;
257 mppLocalPoolDefaults[ SDRATTR_3DOBJ_NORMALS_INVERT - SDRATTR_START ] = new SfxBoolItem(SDRATTR_3DOBJ_NORMALS_INVERT, false);
258 mppLocalPoolDefaults[ SDRATTR_3DOBJ_TEXTURE_PROJ_X - SDRATTR_START ] = new Svx3DTextureProjectionXItem;
259 mppLocalPoolDefaults[ SDRATTR_3DOBJ_TEXTURE_PROJ_Y - SDRATTR_START ] = new Svx3DTextureProjectionYItem;
260 mppLocalPoolDefaults[ SDRATTR_3DOBJ_SHADOW_3D - SDRATTR_START ] = new SfxBoolItem(SDRATTR_3DOBJ_SHADOW_3D, false);
261 mppLocalPoolDefaults[ SDRATTR_3DOBJ_MAT_COLOR - SDRATTR_START ] = new SvxColorItem(Color(0x0000b8ff), SDRATTR_3DOBJ_MAT_COLOR);
262 mppLocalPoolDefaults[ SDRATTR_3DOBJ_MAT_EMISSION - SDRATTR_START ] = new SvxColorItem(Color(0x00000000), SDRATTR_3DOBJ_MAT_EMISSION);
263 mppLocalPoolDefaults[ SDRATTR_3DOBJ_MAT_SPECULAR - SDRATTR_START ] = new SvxColorItem(Color(0x00ffffff), SDRATTR_3DOBJ_MAT_SPECULAR);
264 mppLocalPoolDefaults[ SDRATTR_3DOBJ_MAT_SPECULAR_INTENSITY - SDRATTR_START ] = new SfxUInt16Item(SDRATTR_3DOBJ_MAT_SPECULAR_INTENSITY, 15);
265 mppLocalPoolDefaults[ SDRATTR_3DOBJ_TEXTURE_KIND - SDRATTR_START ] = new Svx3DTextureKindItem;
266 mppLocalPoolDefaults[ SDRATTR_3DOBJ_TEXTURE_MODE - SDRATTR_START ] = new Svx3DTextureModeItem;
267 mppLocalPoolDefaults[ SDRATTR_3DOBJ_TEXTURE_FILTER - SDRATTR_START ] = new SfxBoolItem(SDRATTR_3DOBJ_TEXTURE_FILTER, false);
268 mppLocalPoolDefaults[ SDRATTR_3DOBJ_SMOOTH_NORMALS - SDRATTR_START ] = new Svx3DSmoothNormalsItem;
269 mppLocalPoolDefaults[ SDRATTR_3DOBJ_SMOOTH_LIDS - SDRATTR_START ] = new Svx3DSmoothLidsItem;
270 mppLocalPoolDefaults[ SDRATTR_3DOBJ_CHARACTER_MODE - SDRATTR_START ] = new Svx3DCharacterModeItem;
271 mppLocalPoolDefaults[ SDRATTR_3DOBJ_CLOSE_FRONT - SDRATTR_START ] = new Svx3DCloseFrontItem;
272 mppLocalPoolDefaults[ SDRATTR_3DOBJ_CLOSE_BACK - SDRATTR_START ] = new Svx3DCloseBackItem;
273 mppLocalPoolDefaults[ SDRATTR_3DOBJ_REDUCED_LINE_GEOMETRY - SDRATTR_START ] = new Svx3DReducedLineGeometryItem;
274 mppLocalPoolDefaults[ SDRATTR_3DSCENE_PERSPECTIVE - SDRATTR_START ] = new Svx3DPerspectiveItem;
275 mppLocalPoolDefaults[ SDRATTR_3DSCENE_DISTANCE - SDRATTR_START ] = new SfxUInt32Item(SDRATTR_3DSCENE_DISTANCE, 100);
276 mppLocalPoolDefaults[ SDRATTR_3DSCENE_FOCAL_LENGTH - SDRATTR_START ] = new SfxUInt32Item(SDRATTR_3DSCENE_FOCAL_LENGTH, 100);
277 mppLocalPoolDefaults[ SDRATTR_3DSCENE_TWO_SIDED_LIGHTING - SDRATTR_START ] = new SfxBoolItem(SDRATTR_3DSCENE_TWO_SIDED_LIGHTING, false);
278 mppLocalPoolDefaults[ SDRATTR_3DSCENE_LIGHTCOLOR_1 - SDRATTR_START ] = new SvxColorItem(Color(0xffcccccc), SDRATTR_3DSCENE_LIGHTCOLOR_1);
279 mppLocalPoolDefaults[ SDRATTR_3DSCENE_LIGHTCOLOR_2 - SDRATTR_START ] = new SvxColorItem(Color(0x00000000), SDRATTR_3DSCENE_LIGHTCOLOR_2);
280 mppLocalPoolDefaults[ SDRATTR_3DSCENE_LIGHTCOLOR_3 - SDRATTR_START ] = new SvxColorItem(Color(0x00000000), SDRATTR_3DSCENE_LIGHTCOLOR_3);
281 mppLocalPoolDefaults[ SDRATTR_3DSCENE_LIGHTCOLOR_4 - SDRATTR_START ] = new SvxColorItem(Color(0x00000000), SDRATTR_3DSCENE_LIGHTCOLOR_4);
282 mppLocalPoolDefaults[ SDRATTR_3DSCENE_LIGHTCOLOR_5 - SDRATTR_START ] = new SvxColorItem(Color(0x00000000), SDRATTR_3DSCENE_LIGHTCOLOR_5);
283 mppLocalPoolDefaults[ SDRATTR_3DSCENE_LIGHTCOLOR_6 - SDRATTR_START ] = new SvxColorItem(Color(0x00000000), SDRATTR_3DSCENE_LIGHTCOLOR_6);
284 mppLocalPoolDefaults[ SDRATTR_3DSCENE_LIGHTCOLOR_7 - SDRATTR_START ] = new SvxColorItem(Color(0x00000000), SDRATTR_3DSCENE_LIGHTCOLOR_7);
285 mppLocalPoolDefaults[ SDRATTR_3DSCENE_LIGHTCOLOR_8 - SDRATTR_START ] = new SvxColorItem(Color(0x00000000), SDRATTR_3DSCENE_LIGHTCOLOR_8);
286 mppLocalPoolDefaults[ SDRATTR_3DSCENE_AMBIENTCOLOR - SDRATTR_START ] = new SvxColorItem(Color(0x00666666), SDRATTR_3DSCENE_AMBIENTCOLOR);
287 mppLocalPoolDefaults[ SDRATTR_3DSCENE_LIGHTON_1 - SDRATTR_START ] = new SfxBoolItem(SDRATTR_3DSCENE_LIGHTON_1, true);
288 mppLocalPoolDefaults[ SDRATTR_3DSCENE_LIGHTON_2 - SDRATTR_START ] = new SfxBoolItem(SDRATTR_3DSCENE_LIGHTON_2, false);
289 mppLocalPoolDefaults[ SDRATTR_3DSCENE_LIGHTON_3 - SDRATTR_START ] = new SfxBoolItem(SDRATTR_3DSCENE_LIGHTON_3, false);
290 mppLocalPoolDefaults[ SDRATTR_3DSCENE_LIGHTON_4 - SDRATTR_START ] = new SfxBoolItem(SDRATTR_3DSCENE_LIGHTON_4, false);
291 mppLocalPoolDefaults[ SDRATTR_3DSCENE_LIGHTON_5 - SDRATTR_START ] = new SfxBoolItem(SDRATTR_3DSCENE_LIGHTON_5, false);
292 mppLocalPoolDefaults[ SDRATTR_3DSCENE_LIGHTON_6 - SDRATTR_START ] = new SfxBoolItem(SDRATTR_3DSCENE_LIGHTON_6, false);
293 mppLocalPoolDefaults[ SDRATTR_3DSCENE_LIGHTON_7 - SDRATTR_START ] = new SfxBoolItem(SDRATTR_3DSCENE_LIGHTON_7, false);
294 mppLocalPoolDefaults[ SDRATTR_3DSCENE_LIGHTON_8 - SDRATTR_START ] = new SfxBoolItem(SDRATTR_3DSCENE_LIGHTON_8, false);
295 mppLocalPoolDefaults[ SDRATTR_3DSCENE_LIGHTDIRECTION_1 - SDRATTR_START ] = new SvxB3DVectorItem(SDRATTR_3DSCENE_LIGHTDIRECTION_1, basegfx::B3DVector(0.57735026918963, 0.57735026918963, 0.57735026918963));
296 mppLocalPoolDefaults[ SDRATTR_3DSCENE_LIGHTDIRECTION_2 - SDRATTR_START ] = new SvxB3DVectorItem(SDRATTR_3DSCENE_LIGHTDIRECTION_2, basegfx::B3DVector(0.0,0.0,1.0));
297 mppLocalPoolDefaults[ SDRATTR_3DSCENE_LIGHTDIRECTION_3 - SDRATTR_START ] = new SvxB3DVectorItem(SDRATTR_3DSCENE_LIGHTDIRECTION_3, basegfx::B3DVector(0.0,0.0,1.0));
298 mppLocalPoolDefaults[ SDRATTR_3DSCENE_LIGHTDIRECTION_4 - SDRATTR_START ] = new SvxB3DVectorItem(SDRATTR_3DSCENE_LIGHTDIRECTION_4, basegfx::B3DVector(0.0,0.0,1.0));
299 mppLocalPoolDefaults[ SDRATTR_3DSCENE_LIGHTDIRECTION_5 - SDRATTR_START ] = new SvxB3DVectorItem(SDRATTR_3DSCENE_LIGHTDIRECTION_5, basegfx::B3DVector(0.0,0.0,1.0));
300 mppLocalPoolDefaults[ SDRATTR_3DSCENE_LIGHTDIRECTION_6 - SDRATTR_START ] = new SvxB3DVectorItem(SDRATTR_3DSCENE_LIGHTDIRECTION_6, basegfx::B3DVector(0.0,0.0,1.0));
301 mppLocalPoolDefaults[ SDRATTR_3DSCENE_LIGHTDIRECTION_7 - SDRATTR_START ] = new SvxB3DVectorItem(SDRATTR_3DSCENE_LIGHTDIRECTION_7, basegfx::B3DVector(0.0,0.0,1.0));
302 mppLocalPoolDefaults[ SDRATTR_3DSCENE_LIGHTDIRECTION_8 - SDRATTR_START ] = new SvxB3DVectorItem(SDRATTR_3DSCENE_LIGHTDIRECTION_8, basegfx::B3DVector(0.0,0.0,1.0));
303 mppLocalPoolDefaults[ SDRATTR_3DSCENE_SHADOW_SLANT - SDRATTR_START ] = new SfxUInt16Item(SDRATTR_3DSCENE_SHADOW_SLANT, 0);
304 mppLocalPoolDefaults[ SDRATTR_3DSCENE_SHADE_MODE - SDRATTR_START ] = new Svx3DShadeModeItem;
305 mppLocalPoolDefaults[ SDRATTR_CUSTOMSHAPE_ENGINE - SDRATTR_START ] = new SdrCustomShapeEngineItem;
306 mppLocalPoolDefaults[ SDRATTR_CUSTOMSHAPE_DATA - SDRATTR_START ] = new SdrCustomShapeDataItem;
307 mppLocalPoolDefaults[ SDRATTR_CUSTOMSHAPE_GEOMETRY - SDRATTR_START ] = new SdrCustomShapeGeometryItem;
308 mppLocalPoolDefaults[ SDRATTR_CUSTOMSHAPE_REPLACEMENT_URL - SDRATTR_START ] = new SdrCustomShapeReplacementURLItem;
310 SvxBoxItem* pboxItem = new SvxBoxItem( SDRATTR_TABLE_BORDER );
311 pboxItem->SetDistance( 100 );
312 mppLocalPoolDefaults[ SDRATTR_TABLE_BORDER - SDRATTR_START ] = pboxItem;
314 SvxBoxInfoItem* pBoxInfoItem = new SvxBoxInfoItem( SDRATTR_TABLE_BORDER_INNER );
316 pBoxInfoItem->SetTable( true );
317 pBoxInfoItem->SetDist( true); // always show margin field
318 pBoxInfoItem->SetValid( SvxBoxInfoItemValidFlags::DISABLE, true ); // some lines may have DontCare state only in tables
320 mppLocalPoolDefaults[ SDRATTR_TABLE_BORDER_INNER - SDRATTR_START ] = pBoxInfoItem;
321 mppLocalPoolDefaults[ SDRATTR_TABLE_BORDER_TLBR - SDRATTR_START ] = new SvxLineItem( SDRATTR_TABLE_BORDER_TLBR );
322 mppLocalPoolDefaults[ SDRATTR_TABLE_BORDER_BLTR - SDRATTR_START ] = new SvxLineItem( SDRATTR_TABLE_BORDER_BLTR );
324 // set own ItemInfos
325 mpLocalItemInfos[SDRATTR_SHADOW-SDRATTR_START]._nSID=SID_ATTR_FILL_SHADOW;
326 mpLocalItemInfos[SDRATTR_TEXT_FITTOSIZE-SDRATTR_START]._nSID=SID_ATTR_TEXT_FITTOSIZE;
327 mpLocalItemInfos[SDRATTR_GRAFCROP-SDRATTR_START]._nSID=SID_ATTR_GRAF_CROP;
329 mpLocalItemInfos[SDRATTR_TABLE_BORDER - SDRATTR_START ]._nSID = SID_ATTR_BORDER_OUTER;
330 mpLocalItemInfos[SDRATTR_TABLE_BORDER_INNER - SDRATTR_START ]._nSID = SID_ATTR_BORDER_INNER;
331 mpLocalItemInfos[SDRATTR_TABLE_BORDER_TLBR - SDRATTR_START ]._nSID = SID_ATTR_BORDER_DIAG_TLBR;
332 mpLocalItemInfos[SDRATTR_TABLE_BORDER_BLTR - SDRATTR_START ]._nSID = SID_ATTR_BORDER_DIAG_BLTR;
334 // it's my own creation level, set Defaults and ItemInfos
335 SetDefaults(mppLocalPoolDefaults);
336 SetItemInfos(mpLocalItemInfos);
339 // copy ctor, so that static defaults are cloned
340 // (Parameter 2 = sal_True)
341 SdrItemPool::SdrItemPool(const SdrItemPool& rPool)
342 : XOutdevItemPool(rPool)
346 SfxItemPool* SdrItemPool::Clone() const
348 return new SdrItemPool(*this);
351 SdrItemPool::~SdrItemPool()
353 // dtor of SfxItemPool
354 Delete();
356 // clear own static Defaults
357 if(mppLocalPoolDefaults)
359 const sal_uInt16 nBeg(SDRATTR_SHADOW_FIRST - SDRATTR_START);
360 const sal_uInt16 nEnd2(SDRATTR_END - SDRATTR_START);
362 for(sal_uInt16 i(nBeg); i <= nEnd2; i++)
364 SetRefCount(*mppLocalPoolDefaults[i],0);
365 delete mppLocalPoolDefaults[i];
366 mppLocalPoolDefaults[i] = 0L;
370 // split pools before destroying
371 SetSecondaryPool(NULL);
374 bool SdrItemPool::GetPresentation(
375 const SfxPoolItem& rItem,
376 SfxMapUnit ePresentationMetric, OUString& rText,
377 const IntlWrapper * pIntlWrapper) const
379 if (!IsInvalidItem(&rItem)) {
380 sal_uInt16 nWhich=rItem.Which();
381 if (nWhich>=SDRATTR_SHADOW_FIRST && nWhich<=SDRATTR_END) {
382 rItem.GetPresentation(SFX_ITEM_PRESENTATION_NAMELESS,
383 GetMetric(nWhich),ePresentationMetric,rText,
384 pIntlWrapper);
385 OUString aStr;
387 TakeItemName(nWhich, aStr);
388 rText = aStr + " " + rText;
390 return true;
393 return XOutdevItemPool::GetPresentation(rItem,ePresentationMetric,rText,pIntlWrapper);
396 void SdrItemPool::TakeItemName(sal_uInt16 nWhich, OUString& rItemName)
398 ResMgr* pResMgr = ImpGetResMgr();
399 sal_uInt16 nResId = SIP_UNKNOWN_ATTR;
401 switch (nWhich)
403 case XATTR_LINESTYLE : nResId = SIP_XA_LINESTYLE;break;
404 case XATTR_LINEDASH : nResId = SIP_XA_LINEDASH;break;
405 case XATTR_LINEWIDTH : nResId = SIP_XA_LINEWIDTH;break;
406 case XATTR_LINECOLOR : nResId = SIP_XA_LINECOLOR;break;
407 case XATTR_LINESTART : nResId = SIP_XA_LINESTART;break;
408 case XATTR_LINEEND : nResId = SIP_XA_LINEEND;break;
409 case XATTR_LINESTARTWIDTH : nResId = SIP_XA_LINESTARTWIDTH;break;
410 case XATTR_LINEENDWIDTH : nResId = SIP_XA_LINEENDWIDTH;break;
411 case XATTR_LINESTARTCENTER : nResId = SIP_XA_LINESTARTCENTER;break;
412 case XATTR_LINEENDCENTER : nResId = SIP_XA_LINEENDCENTER;break;
413 case XATTR_LINETRANSPARENCE : nResId = SIP_XA_LINETRANSPARENCE;break;
414 case XATTR_LINEJOINT : nResId = SIP_XA_LINEJOINT;break;
415 case XATTRSET_LINE : nResId = SIP_XATTRSET_LINE;break;
417 case XATTR_FILLSTYLE : nResId = SIP_XA_FILLSTYLE;break;
418 case XATTR_FILLCOLOR : nResId = SIP_XA_FILLCOLOR;break;
419 case XATTR_FILLGRADIENT : nResId = SIP_XA_FILLGRADIENT;break;
420 case XATTR_FILLHATCH : nResId = SIP_XA_FILLHATCH;break;
421 case XATTR_FILLBITMAP : nResId = SIP_XA_FILLBITMAP;break;
422 case XATTR_FILLTRANSPARENCE : nResId = SIP_XA_FILLTRANSPARENCE;break;
423 case XATTR_GRADIENTSTEPCOUNT : nResId = SIP_XA_GRADIENTSTEPCOUNT;break;
424 case XATTR_FILLBMP_TILE : nResId = SIP_XA_FILLBMP_TILE;break;
425 case XATTR_FILLBMP_POS : nResId = SIP_XA_FILLBMP_POS;break;
426 case XATTR_FILLBMP_SIZEX : nResId = SIP_XA_FILLBMP_SIZEX;break;
427 case XATTR_FILLBMP_SIZEY : nResId = SIP_XA_FILLBMP_SIZEY;break;
428 case XATTR_FILLFLOATTRANSPARENCE: nResId = SIP_XA_FILLFLOATTRANSPARENCE;break;
429 case XATTR_SECONDARYFILLCOLOR : nResId = SIP_XA_SECONDARYFILLCOLOR;break;
430 case XATTR_FILLBMP_SIZELOG : nResId = SIP_XA_FILLBMP_SIZELOG;break;
431 case XATTR_FILLBMP_TILEOFFSETX : nResId = SIP_XA_FILLBMP_TILEOFFSETX;break;
432 case XATTR_FILLBMP_TILEOFFSETY : nResId = SIP_XA_FILLBMP_TILEOFFSETY;break;
433 case XATTR_FILLBMP_STRETCH : nResId = SIP_XA_FILLBMP_STRETCH;break;
434 case XATTR_FILLBMP_POSOFFSETX : nResId = SIP_XA_FILLBMP_POSOFFSETX;break;
435 case XATTR_FILLBMP_POSOFFSETY : nResId = SIP_XA_FILLBMP_POSOFFSETY;break;
436 case XATTR_FILLBACKGROUND : nResId = SIP_XA_FILLBACKGROUND;break;
438 case XATTRSET_FILL : nResId = SIP_XATTRSET_FILL;break;
440 case XATTR_FORMTXTSTYLE : nResId = SIP_XA_FORMTXTSTYLE;break;
441 case XATTR_FORMTXTADJUST : nResId = SIP_XA_FORMTXTADJUST;break;
442 case XATTR_FORMTXTDISTANCE : nResId = SIP_XA_FORMTXTDISTANCE;break;
443 case XATTR_FORMTXTSTART : nResId = SIP_XA_FORMTXTSTART;break;
444 case XATTR_FORMTXTMIRROR : nResId = SIP_XA_FORMTXTMIRROR;break;
445 case XATTR_FORMTXTOUTLINE : nResId = SIP_XA_FORMTXTOUTLINE;break;
446 case XATTR_FORMTXTSHADOW : nResId = SIP_XA_FORMTXTSHADOW;break;
447 case XATTR_FORMTXTSHDWCOLOR : nResId = SIP_XA_FORMTXTSHDWCOLOR;break;
448 case XATTR_FORMTXTSHDWXVAL : nResId = SIP_XA_FORMTXTSHDWXVAL;break;
449 case XATTR_FORMTXTSHDWYVAL : nResId = SIP_XA_FORMTXTSHDWYVAL;break;
450 case XATTR_FORMTXTHIDEFORM : nResId = SIP_XA_FORMTXTHIDEFORM;break;
451 case XATTR_FORMTXTSHDWTRANSP: nResId = SIP_XA_FORMTXTSHDWTRANSP;break;
453 case SDRATTR_SHADOW : nResId = SIP_SA_SHADOW;break;
454 case SDRATTR_SHADOWCOLOR : nResId = SIP_SA_SHADOWCOLOR;break;
455 case SDRATTR_SHADOWXDIST : nResId = SIP_SA_SHADOWXDIST;break;
456 case SDRATTR_SHADOWYDIST : nResId = SIP_SA_SHADOWYDIST;break;
457 case SDRATTR_SHADOWTRANSPARENCE: nResId = SIP_SA_SHADOWTRANSPARENCE;break;
458 case SDRATTR_SHADOW3D : nResId = SIP_SA_SHADOW3D;break;
459 case SDRATTR_SHADOWPERSP : nResId = SIP_SA_SHADOWPERSP;break;
461 case SDRATTR_CAPTIONTYPE : nResId = SIP_SA_CAPTIONTYPE;break;
462 case SDRATTR_CAPTIONFIXEDANGLE: nResId = SIP_SA_CAPTIONFIXEDANGLE;break;
463 case SDRATTR_CAPTIONANGLE : nResId = SIP_SA_CAPTIONANGLE;break;
464 case SDRATTR_CAPTIONGAP : nResId = SIP_SA_CAPTIONGAP;break;
465 case SDRATTR_CAPTIONESCDIR : nResId = SIP_SA_CAPTIONESCDIR;break;
466 case SDRATTR_CAPTIONESCISREL : nResId = SIP_SA_CAPTIONESCISREL;break;
467 case SDRATTR_CAPTIONESCREL : nResId = SIP_SA_CAPTIONESCREL;break;
468 case SDRATTR_CAPTIONESCABS : nResId = SIP_SA_CAPTIONESCABS;break;
469 case SDRATTR_CAPTIONLINELEN : nResId = SIP_SA_CAPTIONLINELEN;break;
470 case SDRATTR_CAPTIONFITLINELEN: nResId = SIP_SA_CAPTIONFITLINELEN;break;
472 case SDRATTR_ECKENRADIUS : nResId = SIP_SA_ECKENRADIUS;break;
473 case SDRATTR_TEXT_MINFRAMEHEIGHT : nResId = SIP_SA_TEXT_MINFRAMEHEIGHT;break;
474 case SDRATTR_TEXT_AUTOGROWHEIGHT : nResId = SIP_SA_TEXT_AUTOGROWHEIGHT;break;
475 case SDRATTR_TEXT_FITTOSIZE : nResId = SIP_SA_TEXT_FITTOSIZE;break;
476 case SDRATTR_TEXT_LEFTDIST : nResId = SIP_SA_TEXT_LEFTDIST;break;
477 case SDRATTR_TEXT_RIGHTDIST : nResId = SIP_SA_TEXT_RIGHTDIST;break;
478 case SDRATTR_TEXT_UPPERDIST : nResId = SIP_SA_TEXT_UPPERDIST;break;
479 case SDRATTR_TEXT_LOWERDIST : nResId = SIP_SA_TEXT_LOWERDIST;break;
480 case SDRATTR_TEXT_VERTADJUST : nResId = SIP_SA_TEXT_VERTADJUST;break;
481 case SDRATTR_TEXT_MAXFRAMEHEIGHT : nResId = SIP_SA_TEXT_MAXFRAMEHEIGHT;break;
482 case SDRATTR_TEXT_MINFRAMEWIDTH : nResId = SIP_SA_TEXT_MINFRAMEWIDTH;break;
483 case SDRATTR_TEXT_MAXFRAMEWIDTH : nResId = SIP_SA_TEXT_MAXFRAMEWIDTH;break;
484 case SDRATTR_TEXT_AUTOGROWWIDTH : nResId = SIP_SA_TEXT_AUTOGROWWIDTH;break;
485 case SDRATTR_TEXT_HORZADJUST : nResId = SIP_SA_TEXT_HORZADJUST;break;
486 case SDRATTR_TEXT_ANIKIND : nResId = SIP_SA_TEXT_ANIKIND;break;
487 case SDRATTR_TEXT_ANIDIRECTION : nResId = SIP_SA_TEXT_ANIDIRECTION;break;
488 case SDRATTR_TEXT_ANISTARTINSIDE : nResId = SIP_SA_TEXT_ANISTARTINSIDE;break;
489 case SDRATTR_TEXT_ANISTOPINSIDE : nResId = SIP_SA_TEXT_ANISTOPINSIDE;break;
490 case SDRATTR_TEXT_ANICOUNT : nResId = SIP_SA_TEXT_ANICOUNT;break;
491 case SDRATTR_TEXT_ANIDELAY : nResId = SIP_SA_TEXT_ANIDELAY;break;
492 case SDRATTR_TEXT_ANIAMOUNT : nResId = SIP_SA_TEXT_ANIAMOUNT;break;
493 case SDRATTR_TEXT_CONTOURFRAME : nResId = SIP_SA_TEXT_CONTOURFRAME;break;
494 case SDRATTR_CUSTOMSHAPE_ADJUSTMENT : nResId = SIP_SA_CUSTOMSHAPE_ADJUSTMENT;break;
495 case SDRATTR_XMLATTRIBUTES : nResId = SIP_SA_XMLATTRIBUTES;break;
496 case SDRATTR_TEXT_USEFIXEDCELLHEIGHT: nResId = SIP_SA_TEXT_USEFIXEDCELLHEIGHT;break;
497 case SDRATTR_TEXT_WORDWRAP : nResId = SIP_SA_WORDWRAP;break;
498 case SDRATTR_TEXT_AUTOGROWSIZE : nResId = SIP_SA_AUTOGROWSIZE;break;
500 case SDRATTR_EDGEKIND : nResId = SIP_SA_EDGEKIND;break;
501 case SDRATTR_EDGENODE1HORZDIST : nResId = SIP_SA_EDGENODE1HORZDIST;break;
502 case SDRATTR_EDGENODE1VERTDIST : nResId = SIP_SA_EDGENODE1VERTDIST;break;
503 case SDRATTR_EDGENODE2HORZDIST : nResId = SIP_SA_EDGENODE2HORZDIST;break;
504 case SDRATTR_EDGENODE2VERTDIST : nResId = SIP_SA_EDGENODE2VERTDIST;break;
505 case SDRATTR_EDGENODE1GLUEDIST : nResId = SIP_SA_EDGENODE1GLUEDIST;break;
506 case SDRATTR_EDGENODE2GLUEDIST : nResId = SIP_SA_EDGENODE2GLUEDIST;break;
507 case SDRATTR_EDGELINEDELTAANZ : nResId = SIP_SA_EDGELINEDELTAANZ;break;
508 case SDRATTR_EDGELINE1DELTA : nResId = SIP_SA_EDGELINE1DELTA;break;
509 case SDRATTR_EDGELINE2DELTA : nResId = SIP_SA_EDGELINE2DELTA;break;
510 case SDRATTR_EDGELINE3DELTA : nResId = SIP_SA_EDGELINE3DELTA;break;
512 case SDRATTR_MEASUREKIND : nResId = SIP_SA_MEASUREKIND;break;
513 case SDRATTR_MEASURETEXTHPOS : nResId = SIP_SA_MEASURETEXTHPOS;break;
514 case SDRATTR_MEASURETEXTVPOS : nResId = SIP_SA_MEASURETEXTVPOS;break;
515 case SDRATTR_MEASURELINEDIST : nResId = SIP_SA_MEASURELINEDIST;break;
516 case SDRATTR_MEASUREHELPLINEOVERHANG : nResId = SIP_SA_MEASUREHELPLINEOVERHANG;break;
517 case SDRATTR_MEASUREHELPLINEDIST : nResId = SIP_SA_MEASUREHELPLINEDIST;break;
518 case SDRATTR_MEASUREHELPLINE1LEN : nResId = SIP_SA_MEASUREHELPLINE1LEN;break;
519 case SDRATTR_MEASUREHELPLINE2LEN : nResId = SIP_SA_MEASUREHELPLINE2LEN;break;
520 case SDRATTR_MEASUREBELOWREFEDGE : nResId = SIP_SA_MEASUREBELOWREFEDGE;break;
521 case SDRATTR_MEASURETEXTROTA90 : nResId = SIP_SA_MEASURETEXTROTA90;break;
522 case SDRATTR_MEASURETEXTUPSIDEDOWN : nResId = SIP_SA_MEASURETEXTUPSIDEDOWN;break;
523 case SDRATTR_MEASUREOVERHANG : nResId = SIP_SA_MEASUREOVERHANG;break;
524 case SDRATTR_MEASUREUNIT : nResId = SIP_SA_MEASUREUNIT;break;
525 case SDRATTR_MEASURESCALE : nResId = SIP_SA_MEASURESCALE;break;
526 case SDRATTR_MEASURESHOWUNIT : nResId = SIP_SA_MEASURESHOWUNIT;break;
527 case SDRATTR_MEASUREFORMATSTRING : nResId = SIP_SA_MEASUREFORMATSTRING;break;
528 case SDRATTR_MEASURETEXTAUTOANGLE : nResId = SIP_SA_MEASURETEXTAUTOANGLE;break;
529 case SDRATTR_MEASURETEXTAUTOANGLEVIEW: nResId = SIP_SA_MEASURETEXTAUTOANGLEVIEW;break;
530 case SDRATTR_MEASURETEXTISFIXEDANGLE : nResId = SIP_SA_MEASURETEXTISFIXEDANGLE;break;
531 case SDRATTR_MEASURETEXTFIXEDANGLE : nResId = SIP_SA_MEASURETEXTFIXEDANGLE;break;
532 case SDRATTR_MEASUREDECIMALPLACES : nResId = SIP_SA_MEASUREDECIMALPLACES;break;
534 case SDRATTR_CIRCKIND : nResId = SIP_SA_CIRCKIND;break;
535 case SDRATTR_CIRCSTARTANGLE: nResId = SIP_SA_CIRCSTARTANGLE;break;
536 case SDRATTR_CIRCENDANGLE : nResId = SIP_SA_CIRCENDANGLE;break;
538 case SDRATTR_OBJMOVEPROTECT : nResId = SIP_SA_OBJMOVEPROTECT;break;
539 case SDRATTR_OBJSIZEPROTECT : nResId = SIP_SA_OBJSIZEPROTECT;break;
540 case SDRATTR_OBJPRINTABLE : nResId = SIP_SA_OBJPRINTABLE;break;
541 case SDRATTR_OBJVISIBLE : nResId = SIP_SA_OBJVISIBLE;break;
542 case SDRATTR_LAYERID : nResId = SIP_SA_LAYERID;break;
543 case SDRATTR_LAYERNAME : nResId = SIP_SA_LAYERNAME;break;
544 case SDRATTR_OBJECTNAME : nResId = SIP_SA_OBJECTNAME;break;
545 case SDRATTR_ALLPOSITIONX : nResId = SIP_SA_ALLPOSITIONX;break;
546 case SDRATTR_ALLPOSITIONY : nResId = SIP_SA_ALLPOSITIONY;break;
547 case SDRATTR_ALLSIZEWIDTH : nResId = SIP_SA_ALLSIZEWIDTH;break;
548 case SDRATTR_ALLSIZEHEIGHT : nResId = SIP_SA_ALLSIZEHEIGHT;break;
549 case SDRATTR_ONEPOSITIONX : nResId = SIP_SA_ONEPOSITIONX;break;
550 case SDRATTR_ONEPOSITIONY : nResId = SIP_SA_ONEPOSITIONY;break;
551 case SDRATTR_ONESIZEWIDTH : nResId = SIP_SA_ONESIZEWIDTH;break;
552 case SDRATTR_ONESIZEHEIGHT : nResId = SIP_SA_ONESIZEHEIGHT;break;
553 case SDRATTR_LOGICSIZEWIDTH : nResId = SIP_SA_LOGICSIZEWIDTH;break;
554 case SDRATTR_LOGICSIZEHEIGHT: nResId = SIP_SA_LOGICSIZEHEIGHT;break;
555 case SDRATTR_ROTATEANGLE : nResId = SIP_SA_ROTATEANGLE;break;
556 case SDRATTR_SHEARANGLE : nResId = SIP_SA_SHEARANGLE;break;
557 case SDRATTR_MOVEX : nResId = SIP_SA_MOVEX;break;
558 case SDRATTR_MOVEY : nResId = SIP_SA_MOVEY;break;
559 case SDRATTR_RESIZEXONE : nResId = SIP_SA_RESIZEXONE;break;
560 case SDRATTR_RESIZEYONE : nResId = SIP_SA_RESIZEYONE;break;
561 case SDRATTR_ROTATEONE : nResId = SIP_SA_ROTATEONE;break;
562 case SDRATTR_HORZSHEARONE : nResId = SIP_SA_HORZSHEARONE;break;
563 case SDRATTR_VERTSHEARONE : nResId = SIP_SA_VERTSHEARONE;break;
564 case SDRATTR_RESIZEXALL : nResId = SIP_SA_RESIZEXALL;break;
565 case SDRATTR_RESIZEYALL : nResId = SIP_SA_RESIZEYALL;break;
566 case SDRATTR_ROTATEALL : nResId = SIP_SA_ROTATEALL;break;
567 case SDRATTR_HORZSHEARALL : nResId = SIP_SA_HORZSHEARALL;break;
568 case SDRATTR_VERTSHEARALL : nResId = SIP_SA_VERTSHEARALL;break;
569 case SDRATTR_TRANSFORMREF1X : nResId = SIP_SA_TRANSFORMREF1X;break;
570 case SDRATTR_TRANSFORMREF1Y : nResId = SIP_SA_TRANSFORMREF1Y;break;
571 case SDRATTR_TRANSFORMREF2X : nResId = SIP_SA_TRANSFORMREF2X;break;
572 case SDRATTR_TRANSFORMREF2Y : nResId = SIP_SA_TRANSFORMREF2Y;break;
574 case SDRATTR_GRAFRED : nResId = SIP_SA_GRAFRED;break;
575 case SDRATTR_GRAFGREEN : nResId = SIP_SA_GRAFGREEN;break;
576 case SDRATTR_GRAFBLUE : nResId = SIP_SA_GRAFBLUE;break;
577 case SDRATTR_GRAFLUMINANCE : nResId = SIP_SA_GRAFLUMINANCE;break;
578 case SDRATTR_GRAFCONTRAST : nResId = SIP_SA_GRAFCONTRAST;break;
579 case SDRATTR_GRAFGAMMA : nResId = SIP_SA_GRAFGAMMA;break;
580 case SDRATTR_GRAFTRANSPARENCE : nResId = SIP_SA_GRAFTRANSPARENCE;break;
581 case SDRATTR_GRAFINVERT : nResId = SIP_SA_GRAFINVERT;break;
582 case SDRATTR_GRAFMODE : nResId = SIP_SA_GRAFMODE;break;
583 case SDRATTR_GRAFCROP : nResId = SIP_SA_GRAFCROP;break;
585 case EE_PARA_HYPHENATE : nResId = SIP_EE_PARA_HYPHENATE;break;
586 case EE_PARA_BULLETSTATE: nResId = SIP_EE_PARA_BULLETSTATE;break;
587 case EE_PARA_OUTLLRSPACE: nResId = SIP_EE_PARA_OUTLLRSPACE;break;
588 case EE_PARA_OUTLLEVEL : nResId = SIP_EE_PARA_OUTLLEVEL;break;
589 case EE_PARA_BULLET : nResId = SIP_EE_PARA_BULLET;break;
590 case EE_PARA_LRSPACE : nResId = SIP_EE_PARA_LRSPACE;break;
591 case EE_PARA_ULSPACE : nResId = SIP_EE_PARA_ULSPACE;break;
592 case EE_PARA_SBL : nResId = SIP_EE_PARA_SBL;break;
593 case EE_PARA_JUST : nResId = SIP_EE_PARA_JUST;break;
594 case EE_PARA_TABS : nResId = SIP_EE_PARA_TABS;break;
596 case EE_CHAR_COLOR : nResId = SIP_EE_CHAR_COLOR;break;
597 case EE_CHAR_FONTINFO : nResId = SIP_EE_CHAR_FONTINFO;break;
598 case EE_CHAR_FONTHEIGHT : nResId = SIP_EE_CHAR_FONTHEIGHT;break;
599 case EE_CHAR_FONTWIDTH : nResId = SIP_EE_CHAR_FONTWIDTH;break;
600 case EE_CHAR_WEIGHT : nResId = SIP_EE_CHAR_WEIGHT;break;
601 case EE_CHAR_UNDERLINE : nResId = SIP_EE_CHAR_UNDERLINE;break;
602 case EE_CHAR_OVERLINE : nResId = SIP_EE_CHAR_OVERLINE;break;
603 case EE_CHAR_STRIKEOUT : nResId = SIP_EE_CHAR_STRIKEOUT;break;
604 case EE_CHAR_ITALIC : nResId = SIP_EE_CHAR_ITALIC;break;
605 case EE_CHAR_OUTLINE : nResId = SIP_EE_CHAR_OUTLINE;break;
606 case EE_CHAR_SHADOW : nResId = SIP_EE_CHAR_SHADOW;break;
607 case EE_CHAR_ESCAPEMENT : nResId = SIP_EE_CHAR_ESCAPEMENT;break;
608 case EE_CHAR_PAIRKERNING: nResId = SIP_EE_CHAR_PAIRKERNING;break;
609 case EE_CHAR_KERNING : nResId = SIP_EE_CHAR_KERNING;break;
610 case EE_CHAR_WLM : nResId = SIP_EE_CHAR_WLM;break;
611 case EE_FEATURE_TAB : nResId = SIP_EE_FEATURE_TAB;break;
612 case EE_FEATURE_LINEBR : nResId = SIP_EE_FEATURE_LINEBR;break;
613 case EE_FEATURE_NOTCONV : nResId = SIP_EE_FEATURE_NOTCONV;break;
614 case EE_FEATURE_FIELD : nResId = SIP_EE_FEATURE_FIELD;break;
615 } // switch
617 rItemName = ResId( nResId, *pResMgr );
621 // FractionItem
624 TYPEINIT1_AUTOFACTORY(SdrFractionItem,SfxPoolItem);
626 SdrFractionItem::SdrFractionItem(sal_uInt16 nId, SvStream& rIn):
627 SfxPoolItem(nId)
629 sal_Int32 nMul,nDiv;
630 rIn.ReadInt32( nMul );
631 rIn.ReadInt32( nDiv );
632 nValue=Fraction(nMul,nDiv);
635 bool SdrFractionItem::operator==(const SfxPoolItem& rCmp) const
637 return SfxPoolItem::operator==(rCmp) &&
638 static_cast<const SdrFractionItem&>(rCmp).GetValue()==nValue;
641 bool SdrFractionItem::GetPresentation(
642 SfxItemPresentation ePresentation, SfxMapUnit /*eCoreMetric*/,
643 SfxMapUnit /*ePresentationMetric*/, OUString &rText, const IntlWrapper *) const
645 if(nValue.IsValid())
647 sal_Int32 nDiv = nValue.GetDenominator();
648 rText = OUString::number(nValue.GetNumerator());
650 if(nDiv != 1)
652 rText = rText + "/" + OUString::number(nDiv);
655 else
657 rText = "?";
660 if(ePresentation == SFX_ITEM_PRESENTATION_COMPLETE)
662 OUString aStr;
664 SdrItemPool::TakeItemName(Which(), aStr);
665 rText = aStr + " " + rText;
666 return true;
668 else if(ePresentation == SFX_ITEM_PRESENTATION_NAMELESS)
669 return true;
671 return false;
674 SfxPoolItem* SdrFractionItem::Create(SvStream& rIn, sal_uInt16 /*nVer*/) const
676 return new SdrFractionItem(Which(),rIn);
679 SvStream& SdrFractionItem::Store(SvStream& rOut, sal_uInt16 /*nItemVers*/) const
681 rOut.WriteInt32( nValue.GetNumerator() );
682 rOut.WriteInt32( nValue.GetDenominator() );
683 return rOut;
686 SfxPoolItem* SdrFractionItem::Clone(SfxItemPool * /*pPool*/) const
688 return new SdrFractionItem(Which(),GetValue());
692 // ScaleItem
695 TYPEINIT1_AUTOFACTORY(SdrScaleItem,SdrFractionItem);
697 bool SdrScaleItem::GetPresentation(
698 SfxItemPresentation ePresentation, SfxMapUnit /*eCoreMetric*/,
699 SfxMapUnit /*ePresentationMetric*/, OUString &rText, const IntlWrapper *) const
701 if(GetValue().IsValid())
703 sal_Int32 nDiv = GetValue().GetDenominator();
705 rText = OUString::number(GetValue().GetNumerator()) + ":" + OUString::number(nDiv);
707 else
709 rText = "?";
712 if(ePresentation == SFX_ITEM_PRESENTATION_COMPLETE)
714 OUString aStr;
716 SdrItemPool::TakeItemName(Which(), aStr);
717 rText = aStr + " " + rText;
720 return true;
723 SfxPoolItem* SdrScaleItem::Create(SvStream& rIn, sal_uInt16 /*nVer*/) const
725 return new SdrScaleItem(Which(),rIn);
728 SfxPoolItem* SdrScaleItem::Clone(SfxItemPool * /*pPool*/) const
730 return new SdrScaleItem(Which(),GetValue());
734 // OnOffItem
737 TYPEINIT1_AUTOFACTORY(SdrOnOffItem,SfxBoolItem);
739 SfxPoolItem* SdrOnOffItem::Clone(SfxItemPool* /*pPool*/) const
741 return new SdrOnOffItem(Which(),GetValue());
744 SfxPoolItem* SdrOnOffItem::Create(SvStream& rIn, sal_uInt16 /*nVer*/) const
746 return new SdrOnOffItem(Which(),rIn);
749 OUString SdrOnOffItem::GetValueTextByVal(bool bVal) const
751 if (bVal)
752 return ImpGetResStr(STR_ItemValON);
753 return ImpGetResStr(STR_ItemValOFF);
756 bool SdrOnOffItem::GetPresentation(SfxItemPresentation ePres,
757 SfxMapUnit /*eCoreMetric*/, SfxMapUnit /*ePresMetric*/, OUString& rText, const IntlWrapper *) const
759 rText=GetValueTextByVal(GetValue());
760 if (ePres==SFX_ITEM_PRESENTATION_COMPLETE) {
761 OUString aStr;
763 SdrItemPool::TakeItemName(Which(), aStr);
764 rText = aStr + " " + rText;
766 return true;
769 TYPEINIT1_AUTOFACTORY(SdrYesNoItem,SfxBoolItem);
771 SfxPoolItem* SdrYesNoItem::Clone(SfxItemPool* /*pPool*/) const
773 return new SdrYesNoItem(Which(),GetValue());
776 SfxPoolItem* SdrYesNoItem::Create(SvStream& rIn, sal_uInt16 /*nVer*/) const
778 return new SdrYesNoItem(Which(),rIn);
781 OUString SdrYesNoItem::GetValueTextByVal(bool bVal) const
783 if (bVal)
784 return ImpGetResStr(STR_ItemValYES);
785 return ImpGetResStr(STR_ItemValNO);
788 bool SdrYesNoItem::GetPresentation(SfxItemPresentation ePres,
789 SfxMapUnit /*eCoreMetric*/, SfxMapUnit /*ePresMetric*/, OUString& rText, const IntlWrapper *) const
791 rText=GetValueTextByVal(GetValue());
792 if (ePres==SFX_ITEM_PRESENTATION_COMPLETE) {
793 OUString aStr;
795 SdrItemPool::TakeItemName(Which(), aStr);
796 rText = aStr + " " + rText;
798 return true;
802 // class SdrPercentItem
805 TYPEINIT1_AUTOFACTORY(SdrPercentItem,SfxUInt16Item);
807 SfxPoolItem* SdrPercentItem::Clone(SfxItemPool* /*pPool*/) const
809 return new SdrPercentItem(Which(),GetValue());
812 SfxPoolItem* SdrPercentItem::Create(SvStream& rIn, sal_uInt16 /*nVer*/) const
814 return new SdrPercentItem(Which(),rIn);
817 bool SdrPercentItem::GetPresentation(
818 SfxItemPresentation ePres, SfxMapUnit /*eCoreMetric*/,
819 SfxMapUnit /*ePresMetric*/, OUString& rText, const IntlWrapper *) const
821 rText = unicode::formatPercent(GetValue(),
822 Application::GetSettings().GetUILanguageTag());
824 if(ePres == SFX_ITEM_PRESENTATION_COMPLETE)
826 OUString aStr;
828 SdrItemPool::TakeItemName(Which(), aStr);
829 rText = aStr + " " + rText;
832 return true;
836 // class SdrAngleItem
839 TYPEINIT1_AUTOFACTORY(SdrAngleItem,SfxInt32Item);
841 SfxPoolItem* SdrAngleItem::Clone(SfxItemPool* /*pPool*/) const
843 return new SdrAngleItem(Which(),GetValue());
846 SfxPoolItem* SdrAngleItem::Create(SvStream& rIn, sal_uInt16 /*nVer*/) const
848 return new SdrAngleItem(Which(),rIn);
851 bool SdrAngleItem::GetPresentation(
852 SfxItemPresentation ePres, SfxMapUnit /*eCoreMetric*/, SfxMapUnit /*ePresMetric*/,
853 OUString& rText, const IntlWrapper * pIntlWrapper) const
855 sal_Int32 nValue(GetValue());
856 bool bNeg(nValue < 0);
858 if(bNeg)
859 nValue = -nValue;
861 OUStringBuffer aText = OUString::number(nValue);
863 if(nValue)
865 sal_Unicode aUnicodeNull('0');
866 sal_Int32 nCount(2);
868 const IntlWrapper* pMyIntlWrapper = NULL;
869 if(!pIntlWrapper)
870 pIntlWrapper = pMyIntlWrapper = new IntlWrapper(
871 Application::GetSettings().GetLanguageTag() );
873 if(LocaleDataWrapper::isNumLeadingZero())
874 nCount++;
876 while(aText.getLength() < nCount)
877 aText.insert(0, aUnicodeNull);
879 sal_Int32 nLen = aText.getLength();
880 bool bNull1(aText[nLen-1] == aUnicodeNull);
881 bool bNull2(bNull1 && aText[nLen-2] == aUnicodeNull);
883 if(bNull2)
885 // no decimal place(s)
886 sal_Int32 idx = nLen-2;
887 aText.remove(idx, aText.getLength()-idx);
889 else
891 sal_Unicode cDec =
892 pIntlWrapper->getLocaleData()->getNumDecimalSep()[0];
893 aText.insert(nLen-2, cDec);
895 if(bNull1)
896 aText.remove(nLen, aText.getLength()-nLen);
899 if(bNeg)
900 aText.insert(0, '-');
902 if ( pMyIntlWrapper )
904 delete pMyIntlWrapper;
905 pIntlWrapper = NULL;
909 aText.insert(aText.getLength(), sal_Unicode(DEGREE_CHAR));
911 if(ePres == SFX_ITEM_PRESENTATION_COMPLETE)
913 OUString aStr;
915 SdrItemPool::TakeItemName(Which(), aStr);
916 aText.insert(0, ' ');
917 aText.insert(0, aStr);
920 rText = aText.makeStringAndClear();
921 return true;
925 // class SdrMetricItem
928 TYPEINIT1_AUTOFACTORY(SdrMetricItem,SfxInt32Item);
930 SfxPoolItem* SdrMetricItem::Clone(SfxItemPool* /*pPool*/) const
932 return new SdrMetricItem(Which(),GetValue());
935 SfxPoolItem* SdrMetricItem::Create(SvStream& rIn, sal_uInt16 /*nVer*/) const
937 return new SdrMetricItem(Which(),rIn);
940 bool SdrMetricItem::HasMetrics() const
942 return true;
945 bool SdrMetricItem::ScaleMetrics(long nMul, long nDiv)
947 if (GetValue()!=0) {
948 BigInt aVal(GetValue());
949 aVal*=nMul;
950 aVal+=nDiv/2; // to round accurately
951 aVal/=nDiv;
952 SetValue(long(aVal));
954 return true;
957 bool SdrMetricItem::GetPresentation(SfxItemPresentation ePres,
958 SfxMapUnit eCoreMetric, SfxMapUnit ePresMetric, OUString& rText, const IntlWrapper *) const
960 long nValue=GetValue();
961 SdrFormatter aFmt((MapUnit)eCoreMetric,(MapUnit)ePresMetric);
962 aFmt.TakeStr(nValue,rText);
963 OUString aStr;
964 SdrFormatter::TakeUnitStr((MapUnit)ePresMetric,aStr);
965 rText += " " + aStr;
966 if (ePres==SFX_ITEM_PRESENTATION_COMPLETE) {
967 OUString aStr2;
969 SdrItemPool::TakeItemName(Which(), aStr2);
970 rText = aStr2 + " " + rText;
972 return true;
976 // items of the legend object
979 TYPEINIT1_AUTOFACTORY(SdrCaptionTypeItem,SfxEnumItem);
981 SfxPoolItem* SdrCaptionTypeItem::Clone(SfxItemPool* /*pPool*/) const { return new SdrCaptionTypeItem(*this); }
983 SfxPoolItem* SdrCaptionTypeItem::Create(SvStream& rIn, sal_uInt16 /*nVer*/) const { return new SdrCaptionTypeItem(rIn); }
985 sal_uInt16 SdrCaptionTypeItem::GetValueCount() const { return 4; }
987 OUString SdrCaptionTypeItem::GetValueTextByPos(sal_uInt16 nPos) const
989 return ImpGetResStr(STR_ItemValCAPTIONTYPE1+nPos);
992 bool SdrCaptionTypeItem::GetPresentation(SfxItemPresentation ePres,
993 SfxMapUnit /*eCoreMetric*/, SfxMapUnit /*ePresMetric*/, OUString& rText, const IntlWrapper *) const
995 rText=GetValueTextByPos(sal::static_int_cast< sal_uInt16 >(GetValue()));
996 if (ePres==SFX_ITEM_PRESENTATION_COMPLETE) {
997 OUString aStr;
999 SdrItemPool::TakeItemName(Which(), aStr);
1000 rText = aStr + " " + rText;
1002 return true;
1005 TYPEINIT1_AUTOFACTORY(SdrCaptionEscDirItem,SfxEnumItem);
1007 SfxPoolItem* SdrCaptionEscDirItem::Clone(SfxItemPool* /*pPool*/) const { return new SdrCaptionEscDirItem(*this); }
1009 SfxPoolItem* SdrCaptionEscDirItem::Create(SvStream& rIn, sal_uInt16 /*nVer*/) const { return new SdrCaptionEscDirItem(rIn); }
1011 sal_uInt16 SdrCaptionEscDirItem::GetValueCount() const { return 3; }
1013 OUString SdrCaptionEscDirItem::GetValueTextByPos(sal_uInt16 nPos) const
1015 return ImpGetResStr(STR_ItemValCAPTIONESCHORI+nPos);
1018 bool SdrCaptionEscDirItem::GetPresentation(SfxItemPresentation ePres,
1019 SfxMapUnit /*eCoreMetric*/, SfxMapUnit /*ePresMetric*/, OUString& rText, const IntlWrapper *) const
1021 rText=GetValueTextByPos(sal::static_int_cast< sal_uInt16 >(GetValue()));
1022 if (ePres==SFX_ITEM_PRESENTATION_COMPLETE) {
1023 OUString aStr;
1025 SdrItemPool::TakeItemName(Which(), aStr);
1026 rText = aStr + " " + rText;
1028 return true;
1032 // MiscItems
1035 // FitToSize
1036 TYPEINIT1_AUTOFACTORY(SdrTextFitToSizeTypeItem,SfxEnumItem);
1038 SfxPoolItem* SdrTextFitToSizeTypeItem::Clone(SfxItemPool* /*pPool*/) const { return new SdrTextFitToSizeTypeItem(*this); }
1040 SfxPoolItem* SdrTextFitToSizeTypeItem::Create(SvStream& rIn, sal_uInt16 /*nVer*/) const { return new SdrTextFitToSizeTypeItem(rIn); }
1042 sal_uInt16 SdrTextFitToSizeTypeItem::GetValueCount() const { return 4; }
1044 OUString SdrTextFitToSizeTypeItem::GetValueTextByPos(sal_uInt16 nPos) const
1046 return ImpGetResStr(STR_ItemValFITTOSIZENONE+nPos);
1049 bool SdrTextFitToSizeTypeItem::GetPresentation(SfxItemPresentation ePres,
1050 SfxMapUnit /*eCoreMetric*/, SfxMapUnit /*ePresMetric*/, OUString& rText, const IntlWrapper *) const
1052 rText=GetValueTextByPos(sal::static_int_cast< sal_uInt16 >(GetValue()));
1053 if (ePres==SFX_ITEM_PRESENTATION_COMPLETE) {
1054 OUString aStr;
1056 SdrItemPool::TakeItemName(Which(), aStr);
1057 rText = aStr + " " + rText;
1059 return true;
1062 bool SdrTextFitToSizeTypeItem::HasBoolValue() const { return true; }
1064 bool SdrTextFitToSizeTypeItem::GetBoolValue() const { return GetValue()!=SDRTEXTFIT_NONE; }
1066 void SdrTextFitToSizeTypeItem::SetBoolValue(bool bVal)
1068 SetValue(sal::static_int_cast< sal_uInt16 >(bVal ? SDRTEXTFIT_PROPORTIONAL : SDRTEXTFIT_NONE));
1071 bool SdrTextFitToSizeTypeItem::QueryValue( uno::Any& rVal, sal_uInt8 /*nMemberId*/) const
1073 drawing::TextFitToSizeType eFS = (drawing::TextFitToSizeType)GetValue();
1074 rVal <<= eFS;
1076 return true;
1079 bool SdrTextFitToSizeTypeItem::PutValue( const uno::Any& rVal, sal_uInt8 /*nMemberId*/)
1081 drawing::TextFitToSizeType eFS;
1082 if(!(rVal >>= eFS))
1084 sal_Int32 nEnum = 0;
1085 if(!(rVal >>= nEnum))
1086 return false;
1088 eFS = (drawing::TextFitToSizeType) nEnum;
1091 SetValue( sal::static_int_cast< sal_uInt16 >( (SdrFitToSizeType)eFS ) );
1093 return true;
1096 TYPEINIT1_AUTOFACTORY(SdrTextVertAdjustItem,SfxEnumItem);
1098 SfxPoolItem* SdrTextVertAdjustItem::Clone(SfxItemPool* /*pPool*/) const { return new SdrTextVertAdjustItem(*this); }
1100 SfxPoolItem* SdrTextVertAdjustItem::Create(SvStream& rIn, sal_uInt16 /*nVer*/) const { return new SdrTextVertAdjustItem(rIn); }
1102 sal_uInt16 SdrTextVertAdjustItem::GetValueCount() const { return 5; }
1104 OUString SdrTextVertAdjustItem::GetValueTextByPos(sal_uInt16 nPos) const
1106 return ImpGetResStr(STR_ItemValTEXTVADJTOP+nPos);
1109 bool SdrTextVertAdjustItem::GetPresentation(SfxItemPresentation ePres,
1110 SfxMapUnit /*eCoreMetric*/, SfxMapUnit /*ePresMetric*/, OUString& rText, const IntlWrapper *) const
1112 rText=GetValueTextByPos(sal::static_int_cast< sal_uInt16 >(GetValue()));
1113 if (ePres==SFX_ITEM_PRESENTATION_COMPLETE) {
1114 OUString aStr;
1116 SdrItemPool::TakeItemName(Which(), aStr);
1117 rText = aStr + " " + rText;
1119 return true;
1122 bool SdrTextVertAdjustItem::QueryValue( uno::Any& rVal, sal_uInt8 /*nMemberId*/) const
1124 rVal <<= (drawing::TextVerticalAdjust)GetValue();
1125 return true;
1128 bool SdrTextVertAdjustItem::PutValue( const uno::Any& rVal, sal_uInt8 /*nMemberId*/)
1130 drawing::TextVerticalAdjust eAdj;
1131 if(!(rVal >>= eAdj))
1133 sal_Int32 nEnum = 0;
1134 if(!(rVal >>= nEnum))
1135 return false;
1137 eAdj = (drawing::TextVerticalAdjust)nEnum;
1140 SetValue( sal::static_int_cast< sal_uInt16 >( (SdrTextVertAdjust)eAdj ) );
1142 return true;
1145 TYPEINIT1_AUTOFACTORY(SdrTextHorzAdjustItem,SfxEnumItem);
1147 SfxPoolItem* SdrTextHorzAdjustItem::Clone(SfxItemPool* /*pPool*/) const { return new SdrTextHorzAdjustItem(*this); }
1149 SfxPoolItem* SdrTextHorzAdjustItem::Create(SvStream& rIn, sal_uInt16 /*nVer*/) const { return new SdrTextHorzAdjustItem(rIn); }
1151 sal_uInt16 SdrTextHorzAdjustItem::GetValueCount() const { return 5; }
1153 OUString SdrTextHorzAdjustItem::GetValueTextByPos(sal_uInt16 nPos) const
1155 return ImpGetResStr(STR_ItemValTEXTHADJLEFT+nPos);
1158 bool SdrTextHorzAdjustItem::GetPresentation(SfxItemPresentation ePres,
1159 SfxMapUnit /*eCoreMetric*/, SfxMapUnit /*ePresMetric*/, OUString& rText, const IntlWrapper *) const
1161 rText=GetValueTextByPos(sal::static_int_cast< sal_uInt16 >(GetValue()));
1162 if (ePres==SFX_ITEM_PRESENTATION_COMPLETE) {
1163 OUString aStr;
1165 SdrItemPool::TakeItemName(Which(), aStr);
1166 rText = aStr + " " + rText;
1168 return true;
1171 bool SdrTextHorzAdjustItem::QueryValue( uno::Any& rVal, sal_uInt8 /*nMemberId*/) const
1173 rVal <<= (drawing::TextHorizontalAdjust)GetValue();
1174 return true;
1177 bool SdrTextHorzAdjustItem::PutValue( const uno::Any& rVal, sal_uInt8 /*nMemberId*/)
1179 drawing::TextHorizontalAdjust eAdj;
1180 if(!(rVal >>= eAdj))
1182 sal_Int32 nEnum = 0;
1183 if(!(rVal >>= nEnum))
1184 return false;
1186 eAdj = (drawing::TextHorizontalAdjust)nEnum;
1189 SetValue( sal::static_int_cast< sal_uInt16 >( (SdrTextHorzAdjust)eAdj ) );
1191 return true;
1194 TYPEINIT1_AUTOFACTORY(SdrTextAniKindItem,SfxEnumItem);
1196 SfxPoolItem* SdrTextAniKindItem::Clone(SfxItemPool* /*pPool*/) const { return new SdrTextAniKindItem(*this); }
1198 SfxPoolItem* SdrTextAniKindItem::Create(SvStream& rIn, sal_uInt16 /*nVer*/) const { return new SdrTextAniKindItem(rIn); }
1200 sal_uInt16 SdrTextAniKindItem::GetValueCount() const { return 5; }
1202 OUString SdrTextAniKindItem::GetValueTextByPos(sal_uInt16 nPos) const
1204 return ImpGetResStr(STR_ItemValTEXTANI_NONE+nPos);
1207 bool SdrTextAniKindItem::GetPresentation(SfxItemPresentation ePres,
1208 SfxMapUnit /*eCoreMetric*/, SfxMapUnit /*ePresMetric*/, OUString& rText, const IntlWrapper *) const
1210 rText=GetValueTextByPos(sal::static_int_cast< sal_uInt16 >(GetValue()));
1211 if (ePres==SFX_ITEM_PRESENTATION_COMPLETE) {
1212 OUString aStr;
1214 SdrItemPool::TakeItemName(Which(), aStr);
1215 rText = aStr + " " + rText;
1217 return true;
1220 bool SdrTextAniKindItem::QueryValue( uno::Any& rVal, sal_uInt8 /*nMemberId*/) const
1222 rVal <<= (drawing::TextAnimationKind)GetValue();
1223 return true;
1226 bool SdrTextAniKindItem::PutValue( const uno::Any& rVal, sal_uInt8 /*nMemberId*/)
1228 drawing::TextAnimationKind eKind;
1229 if(!(rVal >>= eKind))
1231 sal_Int32 nEnum = 0;
1232 if(!(rVal >>= nEnum))
1233 return false;
1234 eKind = (drawing::TextAnimationKind)nEnum;
1237 SetValue( sal::static_int_cast< sal_uInt16 >( (SdrTextAniKind)eKind ) );
1239 return true;
1242 TYPEINIT1_AUTOFACTORY(SdrTextAniDirectionItem,SfxEnumItem);
1244 SfxPoolItem* SdrTextAniDirectionItem::Clone(SfxItemPool* /*pPool*/) const { return new SdrTextAniDirectionItem(*this); }
1246 SfxPoolItem* SdrTextAniDirectionItem::Create(SvStream& rIn, sal_uInt16 /*nVer*/) const { return new SdrTextAniDirectionItem(rIn); }
1248 sal_uInt16 SdrTextAniDirectionItem::GetValueCount() const { return 4; }
1250 OUString SdrTextAniDirectionItem::GetValueTextByPos(sal_uInt16 nPos) const
1252 return ImpGetResStr(STR_ItemValTEXTANI_LEFT+nPos);
1255 bool SdrTextAniDirectionItem::GetPresentation(SfxItemPresentation ePres,
1256 SfxMapUnit /*eCoreMetric*/, SfxMapUnit /*ePresMetric*/, OUString& rText, const IntlWrapper *) const
1258 rText=GetValueTextByPos(sal::static_int_cast< sal_uInt16 >(GetValue()));
1259 if (ePres==SFX_ITEM_PRESENTATION_COMPLETE) {
1260 OUString aStr;
1262 SdrItemPool::TakeItemName(Which(), aStr);
1263 rText = aStr + " " + rText;
1265 return true;
1268 bool SdrTextAniDirectionItem::QueryValue( uno::Any& rVal, sal_uInt8 /*nMemberId*/) const
1270 rVal <<= (drawing::TextAnimationDirection)GetValue();
1271 return true;
1274 bool SdrTextAniDirectionItem::PutValue( const uno::Any& rVal, sal_uInt8 /*nMemberId*/)
1276 drawing::TextAnimationDirection eDir;
1277 if(!(rVal >>= eDir))
1279 sal_Int32 nEnum = 0;
1280 if(!(rVal >>= nEnum))
1281 return false;
1283 eDir = (drawing::TextAnimationDirection)nEnum;
1286 SetValue( sal::static_int_cast< sal_uInt16 >( (SdrTextAniDirection)eDir ) );
1288 return true;
1291 TYPEINIT1_AUTOFACTORY(SdrTextAniDelayItem,SfxUInt16Item);
1293 SfxPoolItem* SdrTextAniDelayItem::Clone(SfxItemPool* /*pPool*/) const { return new SdrTextAniDelayItem(*this); }
1295 SfxPoolItem* SdrTextAniDelayItem::Create(SvStream& rIn, sal_uInt16 /*nVer*/) const { return new SdrTextAniDelayItem(rIn); }
1297 bool SdrTextAniDelayItem::GetPresentation(
1298 SfxItemPresentation ePres, SfxMapUnit /*eCoreMetric*/, SfxMapUnit /*ePresMetric*/,
1299 OUString& rText, const IntlWrapper *) const
1301 rText = OUString::number(GetValue()) + "ms";
1303 if(ePres == SFX_ITEM_PRESENTATION_COMPLETE)
1305 OUString aStr;
1307 SdrItemPool::TakeItemName(Which(), aStr);
1308 rText = aStr + " " + rText;
1311 return true;
1314 TYPEINIT1_AUTOFACTORY(SdrTextAniAmountItem,SfxInt16Item);
1316 SfxPoolItem* SdrTextAniAmountItem::Clone(SfxItemPool* /*pPool*/) const { return new SdrTextAniAmountItem(*this); }
1318 SfxPoolItem* SdrTextAniAmountItem::Create(SvStream& rIn, sal_uInt16 /*nVer*/) const { return new SdrTextAniAmountItem(rIn); }
1320 bool SdrTextAniAmountItem::HasMetrics() const
1322 return GetValue()>0;
1325 bool SdrTextAniAmountItem::ScaleMetrics(long nMul, long nDiv)
1327 if (GetValue()>0) {
1328 BigInt aVal(GetValue());
1329 aVal*=nMul;
1330 aVal+=nDiv/2; // to round accurately
1331 aVal/=nDiv;
1332 SetValue(short(aVal));
1333 return true;
1334 } else return false;
1337 bool SdrTextAniAmountItem::GetPresentation(
1338 SfxItemPresentation ePres, SfxMapUnit eCoreMetric, SfxMapUnit ePresMetric,
1339 OUString& rText, const IntlWrapper *) const
1341 sal_Int32 nValue(GetValue());
1343 if(!nValue)
1344 nValue = -1L;
1346 if(nValue < 0)
1348 rText = OUString::number(-nValue) + "pixel";
1350 else
1352 SdrFormatter aFmt((MapUnit)eCoreMetric, (MapUnit)ePresMetric);
1353 OUString aStr;
1355 aFmt.TakeStr(nValue, rText);
1356 SdrFormatter::TakeUnitStr((MapUnit)ePresMetric, aStr);
1357 rText += aStr;
1360 if(ePres == SFX_ITEM_PRESENTATION_COMPLETE)
1362 OUString aStr;
1364 SdrItemPool::TakeItemName(Which(), aStr);
1365 rText = aStr + " " + rText;
1368 return true;
1371 TYPEINIT1_AUTOFACTORY( SdrTextFixedCellHeightItem, SfxBoolItem );
1372 SdrTextFixedCellHeightItem::SdrTextFixedCellHeightItem( bool bUseFixedCellHeight )
1373 : SfxBoolItem( SDRATTR_TEXT_USEFIXEDCELLHEIGHT, bUseFixedCellHeight )
1376 SdrTextFixedCellHeightItem::SdrTextFixedCellHeightItem( SvStream & rStream, sal_uInt16 nVersion )
1377 : SfxBoolItem( SDRATTR_TEXT_USEFIXEDCELLHEIGHT, false )
1379 if ( nVersion )
1381 bool bValue;
1382 rStream.ReadCharAsBool( bValue );
1383 SetValue( bValue );
1386 bool SdrTextFixedCellHeightItem::GetPresentation( SfxItemPresentation ePres,
1387 SfxMapUnit /*eCoreMetric*/, SfxMapUnit /*ePresentationMetric*/,
1388 OUString &rText, const IntlWrapper * ) const
1390 rText = GetValueTextByVal( GetValue() );
1391 if (ePres==SFX_ITEM_PRESENTATION_COMPLETE)
1393 OUString aStr;
1394 SdrItemPool::TakeItemName(Which(), aStr);
1395 rText = aStr + " " + rText;
1397 return true;
1399 SfxPoolItem* SdrTextFixedCellHeightItem::Create( SvStream& rIn, sal_uInt16 nItemVersion ) const
1401 return new SdrTextFixedCellHeightItem( rIn, nItemVersion );
1403 SvStream& SdrTextFixedCellHeightItem::Store( SvStream& rOut, sal_uInt16 nItemVersion ) const
1405 if ( nItemVersion )
1407 bool bValue = GetValue();
1408 rOut.WriteBool( bValue );
1410 return rOut;
1412 SfxPoolItem* SdrTextFixedCellHeightItem::Clone( SfxItemPool * /*pPool*/) const
1414 return new SdrTextFixedCellHeightItem( GetValue() );
1416 sal_uInt16 SdrTextFixedCellHeightItem::GetVersion( sal_uInt16 /*nFileFormatVersion*/) const
1418 return 1;
1420 bool SdrTextFixedCellHeightItem::QueryValue( uno::Any& rVal, sal_uInt8 /*nMemberId*/) const
1422 bool bValue = GetValue();
1423 rVal <<= bValue;
1424 return true;
1426 bool SdrTextFixedCellHeightItem::PutValue( const uno::Any& rVal, sal_uInt8 /*nMemberId*/)
1428 bool bValue;
1429 if( !( rVal >>= bValue ) )
1430 return false;
1431 SetValue( bValue );
1432 return true;
1435 TYPEINIT1_AUTOFACTORY( SdrCustomShapeAdjustmentItem, SfxPoolItem );
1437 SdrCustomShapeAdjustmentItem::SdrCustomShapeAdjustmentItem() : SfxPoolItem( SDRATTR_CUSTOMSHAPE_ADJUSTMENT )
1441 SdrCustomShapeAdjustmentItem::SdrCustomShapeAdjustmentItem( SvStream& rIn, sal_uInt16 nVersion ):
1442 SfxPoolItem( SDRATTR_CUSTOMSHAPE_ADJUSTMENT )
1444 if ( nVersion )
1446 SdrCustomShapeAdjustmentValue aVal;
1447 sal_uInt32 i, nCount;
1448 rIn.ReadUInt32( nCount );
1449 for ( i = 0; i < nCount; i++ )
1451 rIn.ReadUInt32( aVal.nValue );
1452 SetValue( i, aVal );
1457 SdrCustomShapeAdjustmentItem::~SdrCustomShapeAdjustmentItem()
1461 bool SdrCustomShapeAdjustmentItem::operator==( const SfxPoolItem& rCmp ) const
1463 bool bRet = SfxPoolItem::operator==( rCmp );
1464 if ( bRet )
1466 bRet = GetCount() == static_cast<const SdrCustomShapeAdjustmentItem&>(rCmp).GetCount();
1468 if (bRet)
1470 for (sal_uInt32 i = 0; i < GetCount(); ++i)
1471 if (aAdjustmentValueList[i].nValue != static_cast<const SdrCustomShapeAdjustmentItem&>(rCmp).aAdjustmentValueList[i].nValue)
1472 return false;
1475 return bRet;
1478 bool SdrCustomShapeAdjustmentItem::GetPresentation(
1479 SfxItemPresentation ePresentation, SfxMapUnit /*eCoreMetric*/,
1480 SfxMapUnit /*ePresentationMetric*/, OUString &rText, const IntlWrapper *) const
1482 sal_uInt32 i, nCount = GetCount();
1483 rText += OUString::number( nCount );
1484 for ( i = 0; i < nCount; i++ )
1486 rText = rText + " " + OUString::number( GetValue( i ).nValue );
1488 if ( ePresentation == SFX_ITEM_PRESENTATION_COMPLETE )
1490 OUString aStr;
1492 SdrItemPool::TakeItemName( Which(), aStr );
1493 rText = aStr + " " + rText;
1495 return true;
1498 SfxPoolItem* SdrCustomShapeAdjustmentItem::Create( SvStream& rIn, sal_uInt16 nItemVersion ) const
1500 return new SdrCustomShapeAdjustmentItem( rIn, nItemVersion );
1503 SvStream& SdrCustomShapeAdjustmentItem::Store( SvStream& rOut, sal_uInt16 nItemVersion ) const
1505 if ( nItemVersion )
1507 sal_uInt32 i, nCount = GetCount();
1508 rOut.WriteUInt32( nCount );
1509 for ( i = 0; i < nCount; i++ )
1510 rOut.WriteUInt32( GetValue( i ).nValue );
1512 return rOut;
1515 SfxPoolItem* SdrCustomShapeAdjustmentItem::Clone( SfxItemPool * /*pPool*/) const
1517 SdrCustomShapeAdjustmentItem* pItem = new SdrCustomShapeAdjustmentItem;
1518 pItem->aAdjustmentValueList = aAdjustmentValueList;
1519 return pItem;
1522 const SdrCustomShapeAdjustmentValue& SdrCustomShapeAdjustmentItem::GetValue( sal_uInt32 nIndex ) const
1524 #ifdef DBG_UTIL
1525 if ( aAdjustmentValueList.size() <= nIndex )
1526 OSL_FAIL( "SdrCustomShapeAdjustemntItem::GetValue - nIndex out of range (SJ)" );
1527 #endif
1528 return aAdjustmentValueList[nIndex];
1531 void SdrCustomShapeAdjustmentItem::SetValue( sal_uInt32 nIndex, const SdrCustomShapeAdjustmentValue& rVal )
1533 for (sal_uInt32 i = aAdjustmentValueList.size(); i <= nIndex; i++ )
1534 aAdjustmentValueList.push_back(SdrCustomShapeAdjustmentValue());
1536 aAdjustmentValueList[nIndex] = rVal;
1539 sal_uInt16 SdrCustomShapeAdjustmentItem::GetVersion( sal_uInt16 /*nFileFormatVersion*/) const
1541 return 1;
1544 bool SdrCustomShapeAdjustmentItem::QueryValue( uno::Any& rVal, sal_uInt8 /*nMemberId*/) const
1546 sal_uInt32 i, nCount = GetCount();
1547 uno::Sequence< sal_Int32 > aSequence( nCount );
1548 if ( nCount )
1550 sal_Int32* pPtr = aSequence.getArray();
1551 for ( i = 0; i < nCount; i++ )
1552 *pPtr++ = GetValue( i ).nValue;
1554 rVal <<= aSequence;
1555 return true;
1558 bool SdrCustomShapeAdjustmentItem::PutValue( const uno::Any& rVal, sal_uInt8 /*nMemberId*/)
1560 uno::Sequence< sal_Int32 > aSequence;
1561 if( !( rVal >>= aSequence ) )
1562 return false;
1564 aAdjustmentValueList.clear();
1566 sal_uInt32 i, nCount = aSequence.getLength();
1567 if ( nCount )
1569 SdrCustomShapeAdjustmentValue val;
1570 const sal_Int32* pPtr2 = aSequence.getConstArray();
1571 for ( i = 0; i < nCount; i++ )
1573 val.nValue = *pPtr2++;
1574 aAdjustmentValueList.push_back(val);
1577 return true;
1580 // EdgeKind
1581 TYPEINIT1_AUTOFACTORY(SdrEdgeKindItem,SfxEnumItem);
1583 SfxPoolItem* SdrEdgeKindItem::Clone(SfxItemPool* /*pPool*/) const { return new SdrEdgeKindItem(*this); }
1585 SfxPoolItem* SdrEdgeKindItem::Create(SvStream& rIn, sal_uInt16 /*nVer*/) const { return new SdrEdgeKindItem(rIn); }
1587 sal_uInt16 SdrEdgeKindItem::GetValueCount() const { return 4; }
1589 OUString SdrEdgeKindItem::GetValueTextByPos(sal_uInt16 nPos) const
1591 return ImpGetResStr(STR_ItemValEDGE_ORTHOLINES+nPos);
1594 bool SdrEdgeKindItem::GetPresentation(SfxItemPresentation ePres,
1595 SfxMapUnit /*eCoreMetric*/, SfxMapUnit /*ePresMetric*/, OUString& rText, const IntlWrapper *) const
1597 rText=GetValueTextByPos(sal::static_int_cast< sal_uInt16 >(GetValue()));
1598 if (ePres==SFX_ITEM_PRESENTATION_COMPLETE) {
1599 OUString aStr;
1601 SdrItemPool::TakeItemName(Which(), aStr);
1602 rText = aStr + " " + rText;
1604 return true;
1607 bool SdrEdgeKindItem::QueryValue( uno::Any& rVal, sal_uInt8 /*nMemberId*/) const
1609 drawing::ConnectorType eCT = drawing::ConnectorType_STANDARD;
1611 switch( GetValue() )
1613 case SDREDGE_ORTHOLINES : eCT = drawing::ConnectorType_STANDARD; break;
1614 case SDREDGE_THREELINES : eCT = drawing::ConnectorType_LINES; break;
1615 case SDREDGE_ONELINE : eCT = drawing::ConnectorType_LINE; break;
1616 case SDREDGE_BEZIER : eCT = drawing::ConnectorType_CURVE; break;
1617 case SDREDGE_ARC : eCT = drawing::ConnectorType_CURVE; break;
1618 default:
1619 OSL_FAIL( "SdrEdgeKindItem::QueryValue : unknown enum" );
1622 rVal <<= eCT;
1624 return true;
1627 bool SdrEdgeKindItem::PutValue( const uno::Any& rVal, sal_uInt8 /*nMemberId*/)
1629 drawing::ConnectorType eCT;
1630 if(!(rVal >>= eCT))
1632 sal_Int32 nEnum = 0;
1633 if(!(rVal >>= nEnum))
1634 return false;
1636 eCT = (drawing::ConnectorType)nEnum;
1639 SdrEdgeKind eEK = SDREDGE_ORTHOLINES;
1640 switch( eCT )
1642 case drawing::ConnectorType_STANDARD : eEK = SDREDGE_ORTHOLINES; break;
1643 case drawing::ConnectorType_CURVE : eEK = SDREDGE_BEZIER; break;
1644 case drawing::ConnectorType_LINE : eEK = SDREDGE_ONELINE; break;
1645 case drawing::ConnectorType_LINES : eEK = SDREDGE_THREELINES; break;
1646 default:
1647 OSL_FAIL( "SdrEdgeKindItem::PuValue : unknown enum" );
1649 SetValue( sal::static_int_cast< sal_uInt16 >( eEK ) );
1651 return true;
1654 bool SdrEdgeNode1HorzDistItem::QueryValue( uno::Any& rVal, sal_uInt8 /*nMemberId*/) const
1656 rVal <<= (sal_Int32)GetValue();
1657 return true;
1660 bool SdrEdgeNode1HorzDistItem::PutValue( const uno::Any& rVal, sal_uInt8 /*nMemberId*/)
1662 sal_Int32 nValue = 0;
1663 if(!(rVal >>= nValue))
1664 return false;
1666 SetValue( nValue );
1667 return true;
1670 bool SdrEdgeNode1VertDistItem::QueryValue( uno::Any& rVal, sal_uInt8 /*nMemberId*/) const
1672 rVal <<= (sal_Int32)GetValue();
1673 return true;
1676 bool SdrEdgeNode1VertDistItem::PutValue( const uno::Any& rVal, sal_uInt8 /*nMemberId*/)
1678 sal_Int32 nValue = 0;
1679 if(!(rVal >>= nValue))
1680 return false;
1682 SetValue( nValue );
1683 return true;
1686 bool SdrEdgeNode2HorzDistItem::QueryValue( uno::Any& rVal, sal_uInt8 /*nMemberId*/) const
1688 rVal <<= (sal_Int32)GetValue();
1689 return true;
1692 bool SdrEdgeNode2HorzDistItem::PutValue( const uno::Any& rVal, sal_uInt8 /*nMemberId*/)
1694 sal_Int32 nValue = 0;
1695 if(!(rVal >>= nValue))
1696 return false;
1698 SetValue( nValue );
1699 return true;
1702 bool SdrEdgeNode2VertDistItem::QueryValue( uno::Any& rVal, sal_uInt8 /*nMemberId*/) const
1704 rVal <<= (sal_Int32)GetValue();
1705 return true;
1708 bool SdrEdgeNode2VertDistItem::PutValue( const uno::Any& rVal, sal_uInt8 /*nMemberId*/)
1710 sal_Int32 nValue = 0;
1711 if(!(rVal >>= nValue))
1712 return false;
1714 SetValue( nValue );
1715 return true;
1718 TYPEINIT1_AUTOFACTORY(SdrMeasureKindItem,SfxEnumItem);
1720 SfxPoolItem* SdrMeasureKindItem::Clone(SfxItemPool* /*pPool*/) const { return new SdrMeasureKindItem(*this); }
1722 SfxPoolItem* SdrMeasureKindItem::Create(SvStream& rIn, sal_uInt16 /*nVer*/) const { return new SdrMeasureKindItem(rIn); }
1724 sal_uInt16 SdrMeasureKindItem::GetValueCount() const { return 2; }
1726 OUString SdrMeasureKindItem::GetValueTextByPos(sal_uInt16 nPos) const
1728 return ImpGetResStr(STR_ItemValMEASURE_STD+nPos);
1731 bool SdrMeasureKindItem::GetPresentation(SfxItemPresentation ePres,
1732 SfxMapUnit /*eCoreMetric*/, SfxMapUnit /*ePresMetric*/, OUString& rText, const IntlWrapper *) const
1734 rText=GetValueTextByPos(sal::static_int_cast< sal_uInt16 >(GetValue()));
1735 if (ePres==SFX_ITEM_PRESENTATION_COMPLETE) {
1736 OUString aStr;
1738 SdrItemPool::TakeItemName(Which(), aStr);
1739 rText = aStr + " " + rText;
1741 return true;
1744 bool SdrMeasureKindItem::QueryValue( uno::Any& rVal, sal_uInt8 /*nMemberId*/) const
1746 rVal <<= (drawing::MeasureKind)GetValue();
1747 return true;
1750 bool SdrMeasureKindItem::PutValue( const uno::Any& rVal, sal_uInt8 /*nMemberId*/)
1752 drawing::MeasureKind eKind;
1753 if(!(rVal >>= eKind))
1755 sal_Int32 nEnum = 0;
1756 if(!(rVal >>= nEnum))
1757 return false;
1759 eKind = (drawing::MeasureKind)nEnum;
1762 SetValue( sal::static_int_cast< sal_uInt16 >( (SdrMeasureKind)eKind ) );
1763 return true;
1766 TYPEINIT1_AUTOFACTORY(SdrMeasureTextHPosItem,SfxEnumItem);
1768 SfxPoolItem* SdrMeasureTextHPosItem::Clone(SfxItemPool* /*pPool*/) const { return new SdrMeasureTextHPosItem(*this); }
1770 SfxPoolItem* SdrMeasureTextHPosItem::Create(SvStream& rIn, sal_uInt16 /*nVer*/) const { return new SdrMeasureTextHPosItem(rIn); }
1772 sal_uInt16 SdrMeasureTextHPosItem::GetValueCount() const { return 4; }
1774 OUString SdrMeasureTextHPosItem::GetValueTextByPos(sal_uInt16 nPos) const
1776 return ImpGetResStr(STR_ItemValMEASURE_TEXTHAUTO+nPos);
1779 bool SdrMeasureTextHPosItem::GetPresentation(SfxItemPresentation ePres,
1780 SfxMapUnit /*eCoreMetric*/, SfxMapUnit /*ePresMetric*/, OUString& rText, const IntlWrapper *) const
1782 rText=GetValueTextByPos(sal::static_int_cast< sal_uInt16 >(GetValue()));
1783 if (ePres==SFX_ITEM_PRESENTATION_COMPLETE) {
1784 OUString aStr;
1786 SdrItemPool::TakeItemName(Which(), aStr);
1787 rText = aStr + " " + rText;
1789 return true;
1792 bool SdrMeasureTextHPosItem::QueryValue( uno::Any& rVal, sal_uInt8 /*nMemberId*/) const
1794 rVal <<= (drawing::MeasureTextHorzPos)GetValue();
1795 return true;
1798 bool SdrMeasureTextHPosItem::PutValue( const uno::Any& rVal, sal_uInt8 /*nMemberId*/)
1800 drawing::MeasureTextHorzPos ePos;
1801 if(!(rVal >>= ePos))
1803 sal_Int32 nEnum = 0;
1804 if(!(rVal >>= nEnum))
1805 return false;
1807 ePos = (drawing::MeasureTextHorzPos)nEnum;
1810 SetValue( sal::static_int_cast< sal_uInt16 >( (SdrMeasureTextHPos)ePos ) );
1811 return true;
1814 TYPEINIT1_AUTOFACTORY(SdrMeasureTextVPosItem,SfxEnumItem);
1816 SfxPoolItem* SdrMeasureTextVPosItem::Clone(SfxItemPool* /*pPool*/) const { return new SdrMeasureTextVPosItem(*this); }
1818 SfxPoolItem* SdrMeasureTextVPosItem::Create(SvStream& rIn, sal_uInt16 /*nVer*/) const { return new SdrMeasureTextVPosItem(rIn); }
1820 sal_uInt16 SdrMeasureTextVPosItem::GetValueCount() const { return 5; }
1822 OUString SdrMeasureTextVPosItem::GetValueTextByPos(sal_uInt16 nPos) const
1824 return ImpGetResStr(STR_ItemValMEASURE_TEXTVAUTO+nPos);
1827 bool SdrMeasureTextVPosItem::GetPresentation(SfxItemPresentation ePres,
1828 SfxMapUnit /*eCoreMetric*/, SfxMapUnit /*ePresMetric*/, OUString& rText, const IntlWrapper *) const
1830 rText=GetValueTextByPos(sal::static_int_cast< sal_uInt16 >(GetValue()));
1831 if (ePres==SFX_ITEM_PRESENTATION_COMPLETE) {
1832 OUString aStr;
1834 SdrItemPool::TakeItemName(Which(), aStr);
1835 rText = aStr + " " + rText;
1837 return true;
1840 bool SdrMeasureTextVPosItem::QueryValue( uno::Any& rVal, sal_uInt8 /*nMemberId*/) const
1842 rVal <<= (drawing::MeasureTextVertPos)GetValue();
1843 return true;
1846 bool SdrMeasureTextVPosItem::PutValue( const uno::Any& rVal, sal_uInt8 /*nMemberId*/)
1848 drawing::MeasureTextVertPos ePos;
1849 if(!(rVal >>= ePos))
1851 sal_Int32 nEnum = 0;
1852 if(!(rVal >>= nEnum))
1853 return false;
1855 ePos = (drawing::MeasureTextVertPos)nEnum;
1858 SetValue( sal::static_int_cast< sal_uInt16 >( (SdrMeasureTextHPos)ePos ) );
1859 return true;
1862 TYPEINIT1_AUTOFACTORY(SdrMeasureUnitItem,SfxEnumItem);
1864 SfxPoolItem* SdrMeasureUnitItem::Clone(SfxItemPool* /*pPool*/) const { return new SdrMeasureUnitItem(*this); }
1866 SfxPoolItem* SdrMeasureUnitItem::Create(SvStream& rIn, sal_uInt16 /*nVer*/) const { return new SdrMeasureUnitItem(rIn); }
1868 sal_uInt16 SdrMeasureUnitItem::GetValueCount() const { return 14; }
1870 OUString SdrMeasureUnitItem::GetValueTextByPos(sal_uInt16 nPos) const
1872 OUString aRetval;
1874 if((FieldUnit)nPos == FUNIT_NONE)
1875 aRetval = "default";
1876 else
1877 SdrFormatter::TakeUnitStr((FieldUnit)nPos, aRetval);
1879 return aRetval;
1882 bool SdrMeasureUnitItem::GetPresentation(SfxItemPresentation ePres,
1883 SfxMapUnit /*eCoreMetric*/, SfxMapUnit /*ePresMetric*/, OUString& rText, const IntlWrapper *) const
1885 rText=GetValueTextByPos(sal::static_int_cast< sal_uInt16 >(GetValue()));
1886 if (ePres==SFX_ITEM_PRESENTATION_COMPLETE) {
1887 OUString aStr;
1889 SdrItemPool::TakeItemName(Which(), aStr);
1890 rText = aStr + " " + rText;
1892 return true;
1895 bool SdrMeasureUnitItem::QueryValue( uno::Any& rVal, sal_uInt8 /*nMemberId*/) const
1897 rVal <<= (sal_Int32)GetValue();
1898 return true;
1901 bool SdrMeasureUnitItem::PutValue( const uno::Any& rVal, sal_uInt8 /*nMemberId*/)
1903 sal_Int32 nMeasure = 0;
1904 if(!(rVal >>= nMeasure))
1905 return false;
1907 SetValue( sal::static_int_cast< sal_uInt16 >( (FieldUnit)nMeasure ) );
1908 return true;
1911 TYPEINIT1_AUTOFACTORY(SdrCircKindItem,SfxEnumItem);
1913 SfxPoolItem* SdrCircKindItem::Clone(SfxItemPool* /*pPool*/) const { return new SdrCircKindItem(*this); }
1915 SfxPoolItem* SdrCircKindItem::Create(SvStream& rIn, sal_uInt16 /*nVer*/) const { return new SdrCircKindItem(rIn); }
1917 sal_uInt16 SdrCircKindItem::GetValueCount() const { return 4; }
1919 OUString SdrCircKindItem::GetValueTextByPos(sal_uInt16 nPos) const
1921 return ImpGetResStr(STR_ItemValCIRC_FULL+nPos);
1924 bool SdrCircKindItem::GetPresentation(SfxItemPresentation ePres,
1925 SfxMapUnit /*eCoreMetric*/, SfxMapUnit /*ePresMetric*/, OUString& rText, const IntlWrapper *) const
1927 rText=GetValueTextByPos(sal::static_int_cast< sal_uInt16 >(GetValue()));
1928 if (ePres==SFX_ITEM_PRESENTATION_COMPLETE) {
1929 OUString aStr;
1931 SdrItemPool::TakeItemName(Which(), aStr);
1932 rText = aStr + " " + rText;
1934 return true;
1937 bool SdrCircKindItem::QueryValue( uno::Any& rVal, sal_uInt8 /*nMemberId*/) const
1939 rVal <<= (drawing::CircleKind)GetValue();
1940 return true;
1943 bool SdrCircKindItem::PutValue( const uno::Any& rVal, sal_uInt8 /*nMemberId*/)
1945 drawing::CircleKind eKind;
1946 if(!(rVal >>= eKind))
1948 sal_Int32 nEnum = 0;
1949 if(!(rVal >>= nEnum))
1950 return false;
1952 eKind = (drawing::CircleKind)nEnum;
1955 SetValue( sal::static_int_cast< sal_uInt16 >( (SdrCircKind)eKind ) );
1956 return true;
1960 // class SdrSignedPercentItem
1963 TYPEINIT1_AUTOFACTORY( SdrSignedPercentItem, SfxInt16Item );
1966 SfxPoolItem* SdrSignedPercentItem::Clone(SfxItemPool* /*pPool*/) const
1968 return new SdrSignedPercentItem( Which(), GetValue() );
1971 SfxPoolItem* SdrSignedPercentItem::Create( SvStream& rIn, sal_uInt16 /*nVer*/) const
1973 return new SdrSignedPercentItem( Which(), rIn );
1976 bool SdrSignedPercentItem::GetPresentation(
1977 SfxItemPresentation ePres, SfxMapUnit /*eCoreMetric*/, SfxMapUnit /*ePresMetric*/,
1978 OUString& rText, const IntlWrapper *) const
1980 rText = unicode::formatPercent(GetValue(),
1981 Application::GetSettings().GetUILanguageTag());
1983 if(ePres == SFX_ITEM_PRESENTATION_COMPLETE)
1985 OUString aStr;
1987 SdrItemPool::TakeItemName(Which(), aStr);
1988 rText = aStr + " " + rText;
1991 return true;
1994 TYPEINIT1( SdrGrafRedItem, SdrSignedPercentItem );
1996 SfxPoolItem* SdrGrafRedItem::Clone( SfxItemPool* /*pPool*/) const
1998 return new SdrGrafRedItem( *this );
2001 SfxPoolItem* SdrGrafRedItem::Create( SvStream& rIn, sal_uInt16 /*nVer*/) const
2003 return new SdrGrafRedItem( rIn );
2006 TYPEINIT1( SdrGrafGreenItem, SdrSignedPercentItem );
2008 SfxPoolItem* SdrGrafGreenItem::Clone( SfxItemPool* /*pPool*/) const
2010 return new SdrGrafGreenItem( *this );
2013 SfxPoolItem* SdrGrafGreenItem::Create( SvStream& rIn, sal_uInt16 /*nVer*/) const
2015 return new SdrGrafGreenItem( rIn );
2018 TYPEINIT1( SdrGrafBlueItem, SdrSignedPercentItem );
2020 SfxPoolItem* SdrGrafBlueItem::Clone( SfxItemPool* /*pPool*/) const
2022 return new SdrGrafBlueItem( *this );
2025 SfxPoolItem* SdrGrafBlueItem::Create( SvStream& rIn, sal_uInt16 /*nVer*/) const
2027 return new SdrGrafBlueItem( rIn );
2030 TYPEINIT1( SdrGrafLuminanceItem, SdrSignedPercentItem );
2032 SfxPoolItem* SdrGrafLuminanceItem::Clone( SfxItemPool* /*pPool*/) const
2034 return new SdrGrafLuminanceItem( *this );
2037 SfxPoolItem* SdrGrafLuminanceItem::Create( SvStream& rIn, sal_uInt16 /*nVer*/) const
2039 return new SdrGrafLuminanceItem( rIn );
2042 TYPEINIT1( SdrGrafContrastItem, SdrSignedPercentItem );
2044 SfxPoolItem* SdrGrafContrastItem::Clone( SfxItemPool* /*pPool*/) const
2046 return new SdrGrafContrastItem( *this );
2049 SfxPoolItem* SdrGrafContrastItem::Create( SvStream& rIn, sal_uInt16 /*nVer*/) const
2051 return new SdrGrafContrastItem( rIn );
2054 TYPEINIT1( SdrGrafGamma100Item, SfxUInt32Item );
2056 SfxPoolItem* SdrGrafGamma100Item::Clone( SfxItemPool* /*pPool */) const
2058 return new SdrGrafGamma100Item( *this );
2061 SfxPoolItem* SdrGrafGamma100Item::Create( SvStream& rIn, sal_uInt16 /*nVer*/) const
2063 return new SdrGrafGamma100Item( rIn );
2066 bool SdrGrafGamma100Item::QueryValue( uno::Any& rVal, sal_uInt8 /*nMemberId*/) const
2068 rVal <<= ((double)GetValue()) / 100.0;
2069 return true;
2072 bool SdrGrafGamma100Item::PutValue( const uno::Any& rVal, sal_uInt8 /*nMemberId*/)
2074 double nGamma = 0;
2075 if(!(rVal >>= nGamma))
2076 return false;
2078 SetValue( (sal_uInt32)(nGamma * 100.0 ) );
2079 return true;
2082 TYPEINIT1( SdrGrafInvertItem, SdrOnOffItem );
2084 SfxPoolItem* SdrGrafInvertItem::Clone( SfxItemPool* /*pPool*/) const
2086 return new SdrGrafInvertItem( *this );
2089 SfxPoolItem* SdrGrafInvertItem::Create( SvStream& rIn, sal_uInt16 /*nVer*/) const
2091 return new SdrGrafInvertItem( rIn );
2094 TYPEINIT1( SdrGrafTransparenceItem, SdrPercentItem );
2096 SfxPoolItem* SdrGrafTransparenceItem::Clone( SfxItemPool* /*pPool*/) const
2098 return new SdrGrafTransparenceItem( *this );
2101 SfxPoolItem* SdrGrafTransparenceItem::Create( SvStream& rIn, sal_uInt16 /*nVer*/) const
2103 return new SdrGrafTransparenceItem( rIn );
2106 TYPEINIT1( SdrGrafModeItem, SfxEnumItem );
2108 SfxPoolItem* SdrGrafModeItem::Clone(SfxItemPool* /*pPool*/) const
2110 return new SdrGrafModeItem( *this );
2113 SfxPoolItem* SdrGrafModeItem::Create( SvStream& rIn, sal_uInt16 /*nVer*/) const
2115 return new SdrGrafModeItem( rIn );
2118 sal_uInt16 SdrGrafModeItem::GetValueCount() const
2120 return 4;
2123 OUString SdrGrafModeItem::GetValueTextByPos(sal_uInt16 nPos) const
2125 OUString aStr;
2127 switch(nPos)
2129 case 1:
2131 aStr = "Greys";
2132 break;
2134 case 2:
2136 aStr = "Black/White";
2137 break;
2139 case 3:
2141 aStr = "Watermark";
2142 break;
2144 default:
2146 aStr = "Standard";
2147 break;
2151 return aStr;
2154 bool SdrGrafModeItem::GetPresentation( SfxItemPresentation ePres,
2155 SfxMapUnit /*eCoreMetric*/, SfxMapUnit /*ePresMetric*/,
2156 OUString& rText, const IntlWrapper *) const
2158 rText = GetValueTextByPos( sal::static_int_cast< sal_uInt16 >( GetValue() ) );
2160 if( ePres == SFX_ITEM_PRESENTATION_COMPLETE )
2162 OUString aStr;
2164 SdrItemPool::TakeItemName( Which(), aStr );
2165 rText = aStr + " " + rText;
2168 return true;
2171 TYPEINIT1( SdrGrafCropItem, SvxGrfCrop );
2173 SfxPoolItem* SdrGrafCropItem::Clone( SfxItemPool* /*pPool*/) const
2175 return new SdrGrafCropItem( *this );
2178 SfxPoolItem* SdrGrafCropItem::Create( SvStream& rIn, sal_uInt16 nVer ) const
2180 return( ( 0 == nVer ) ? Clone( NULL ) : SvxGrfCrop::Create( rIn, nVer ) );
2183 sal_uInt16 SdrGrafCropItem::GetVersion( sal_uInt16 /*nFileVersion*/) const
2185 // GRFCROP_VERSION_MOVETOSVX is 1
2186 return GRFCROP_VERSION_MOVETOSVX;
2189 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */