Version 7.1.7.1, tag libreoffice-7.1.7.1
[LibreOffice.git] / svx / source / svdraw / svdattr.cxx
blob28bbfe39afce3687800f81af95b359537677cc0f
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>
32 #include <editeng/boxitem.hxx>
33 #include <editeng/eeitem.hxx>
34 #include <editeng/lineitem.hxx>
35 #include <editeng/xmlcnitm.hxx>
36 #include <editeng/adjustitem.hxx>
37 #include <editeng/writingmodeitem.hxx>
38 #include <editeng/charrotateitem.hxx>
39 #include <osl/diagnose.h>
40 #include <i18nutil/unicode.hxx>
41 #include <tools/bigint.hxx>
42 #include <unotools/intlwrapper.hxx>
43 #include <unotools/localedatawrapper.hxx>
44 #include <vcl/svapp.hxx>
45 #include <vcl/settings.hxx>
47 #include <svx/strings.hrc>
48 #include <svx/dialmgr.hxx>
49 #include <svx/sdgcpitm.hxx>
50 #include <svx/sdtfchim.hxx>
51 #include <svx/sdasitm.hxx>
52 #include <sdgcoitm.hxx>
53 #include <svx/sdggaitm.hxx>
54 #include <sdginitm.hxx>
55 #include <svx/sdgluitm.hxx>
56 #include <svx/sdgmoitm.hxx>
57 #include <sdgtritm.hxx>
58 #include <svx/sdprcitm.hxx>
59 #include <svx/sdtaaitm.hxx>
60 #include <svx/sdtacitm.hxx>
61 #include <svx/sdtaditm.hxx>
62 #include <svx/sdtaiitm.hxx>
63 #include <svx/sdtaitm.hxx>
64 #include <svx/sdtakitm.hxx>
65 #include <svx/sdtayitm.hxx>
66 #include <svx/sdtfsitm.hxx>
67 #include <svx/svdmodel.hxx>
68 #include <svx/svdpool.hxx>
69 #include <svx/svdtrans.hxx>
70 #include <svx/svx3ditems.hxx>
71 #include <svx/svxids.hrc>
72 #include <sxallitm.hxx>
73 #include <sxcaitm.hxx>
74 #include <svx/sxcecitm.hxx>
75 #include <svx/sxcgitm.hxx>
76 #include <sxcikitm.hxx>
77 #include <svx/sxcllitm.hxx>
78 #include <svx/sxctitm.hxx>
79 #include <svx/sxekitm.hxx>
80 #include <svx/sxelditm.hxx>
81 #include <svx/sxenditm.hxx>
82 #include <sxfiitm.hxx>
83 #include <sxlayitm.hxx>
84 #include <sxlogitm.hxx>
85 #include <svx/sxmbritm.hxx>
86 #include <sxmfsitm.hxx>
87 #include <sxmkitm.hxx>
88 #include <sxmoitm.hxx>
89 #include <sxmovitm.hxx>
90 #include <sxmsitm.hxx>
91 #include <sxmtaitm.hxx>
92 #include <svx/sxmtfitm.hxx>
93 #include <svx/sxmtpitm.hxx>
94 #include <svx/sxmtritm.hxx>
95 #include <svx/sxmuitm.hxx>
96 #include <sxoneitm.hxx>
97 #include <sxopitm.hxx>
98 #include <sxreaitm.hxx>
99 #include <sxreoitm.hxx>
100 #include <sxroaitm.hxx>
101 #include <sxrooitm.hxx>
102 #include <sxsaitm.hxx>
103 #include <sxsalitm.hxx>
104 #include <sxsiitm.hxx>
105 #include <sxsoitm.hxx>
106 #include <sxtraitm.hxx>
107 #include <svx/xfillit0.hxx>
108 #include <svx/xflclit.hxx>
109 #include <svx/xlineit0.hxx>
110 #include <libxml/xmlwriter.h>
112 using namespace ::com::sun::star;
114 SdrItemPool::SdrItemPool(
115 SfxItemPool* _pMaster)
116 : XOutdevItemPool(_pMaster)
118 // prepare some constants
119 const Color aNullCol(COL_BLACK);
120 const sal_Int32 nDefEdgeDist(500); // Defaulting hard for Draw (100TH_MM) currently. MapMode will have to be taken into account in the future.
122 // init the non-persistent items
123 for(sal_uInt16 i(SDRATTR_NOTPERSIST_FIRST); i <= SDRATTR_NOTPERSIST_LAST; i++)
125 mpLocalItemInfos[i - SDRATTR_START]._bPoolable = false;
128 // init own PoolDefaults
129 std::vector<SfxPoolItem*>& rPoolDefaults = *mpLocalPoolDefaults;
130 rPoolDefaults[SDRATTR_SHADOW -SDRATTR_START]=new SdrOnOffItem(SDRATTR_SHADOW, false);
131 rPoolDefaults[SDRATTR_SHADOWCOLOR -SDRATTR_START]=new XColorItem(SDRATTR_SHADOWCOLOR, aNullCol);
132 rPoolDefaults[SDRATTR_SHADOWXDIST -SDRATTR_START]=new SdrMetricItem(SDRATTR_SHADOWXDIST, 0);
133 rPoolDefaults[SDRATTR_SHADOWYDIST -SDRATTR_START]=new SdrMetricItem(SDRATTR_SHADOWYDIST, 0);
134 rPoolDefaults[SDRATTR_SHADOWSIZEX -SDRATTR_START]=new SdrMetricItem(SDRATTR_SHADOWSIZEX, 100000);
135 rPoolDefaults[SDRATTR_SHADOWSIZEY -SDRATTR_START]=new SdrMetricItem(SDRATTR_SHADOWSIZEY, 100000);
136 rPoolDefaults[SDRATTR_SHADOWTRANSPARENCE-SDRATTR_START]=new SdrPercentItem(SDRATTR_SHADOWTRANSPARENCE, 0);
137 rPoolDefaults[SDRATTR_SHADOWBLUR -SDRATTR_START]=new SdrMetricItem(SDRATTR_SHADOWBLUR, 0);
138 rPoolDefaults[SDRATTR_SHADOW3D -SDRATTR_START]=new SfxVoidItem(SDRATTR_SHADOW3D );
139 rPoolDefaults[SDRATTR_SHADOWPERSP -SDRATTR_START]=new SfxVoidItem(SDRATTR_SHADOWPERSP );
140 rPoolDefaults[SDRATTR_CAPTIONTYPE -SDRATTR_START]=new SdrCaptionTypeItem ;
141 rPoolDefaults[SDRATTR_CAPTIONFIXEDANGLE-SDRATTR_START]=new SdrOnOffItem(SDRATTR_CAPTIONFIXEDANGLE, true);
142 rPoolDefaults[SDRATTR_CAPTIONANGLE -SDRATTR_START]=new SdrCaptionAngleItem ;
143 rPoolDefaults[SDRATTR_CAPTIONGAP -SDRATTR_START]=new SdrCaptionGapItem ;
144 rPoolDefaults[SDRATTR_CAPTIONESCDIR -SDRATTR_START]=new SdrCaptionEscDirItem ;
145 rPoolDefaults[SDRATTR_CAPTIONESCISREL -SDRATTR_START]=new SdrCaptionEscIsRelItem ;
146 rPoolDefaults[SDRATTR_CAPTIONESCREL -SDRATTR_START]=new SdrCaptionEscRelItem ;
147 rPoolDefaults[SDRATTR_CAPTIONESCABS -SDRATTR_START]=new SdrCaptionEscAbsItem ;
148 rPoolDefaults[SDRATTR_CAPTIONLINELEN -SDRATTR_START]=new SdrCaptionLineLenItem ;
149 rPoolDefaults[SDRATTR_CAPTIONFITLINELEN-SDRATTR_START]=new SdrCaptionFitLineLenItem;
150 rPoolDefaults[SDRATTR_ECKENRADIUS -SDRATTR_START]=new SdrMetricItem(SDRATTR_ECKENRADIUS, 0);
151 rPoolDefaults[SDRATTR_TEXT_MINFRAMEHEIGHT -SDRATTR_START]=new SdrMetricItem(SDRATTR_TEXT_MINFRAMEHEIGHT, 0);
152 rPoolDefaults[SDRATTR_TEXT_AUTOGROWHEIGHT -SDRATTR_START]=new SdrOnOffItem(SDRATTR_TEXT_AUTOGROWHEIGHT, true);
153 rPoolDefaults[SDRATTR_TEXT_FITTOSIZE -SDRATTR_START]=new SdrTextFitToSizeTypeItem;
154 rPoolDefaults[SDRATTR_TEXT_LEFTDIST -SDRATTR_START]=new SdrMetricItem(SDRATTR_TEXT_LEFTDIST, 0);
155 rPoolDefaults[SDRATTR_TEXT_RIGHTDIST -SDRATTR_START]=new SdrMetricItem(SDRATTR_TEXT_RIGHTDIST, 0);
156 rPoolDefaults[SDRATTR_TEXT_UPPERDIST -SDRATTR_START]=new SdrMetricItem(SDRATTR_TEXT_UPPERDIST, 0);
157 rPoolDefaults[SDRATTR_TEXT_LOWERDIST -SDRATTR_START]=new SdrMetricItem(SDRATTR_TEXT_LOWERDIST, 0);
158 rPoolDefaults[SDRATTR_TEXT_VERTADJUST -SDRATTR_START]=new SdrTextVertAdjustItem;
159 rPoolDefaults[SDRATTR_TEXT_MAXFRAMEHEIGHT -SDRATTR_START]=new SdrMetricItem(SDRATTR_TEXT_MAXFRAMEHEIGHT, 0);
160 rPoolDefaults[SDRATTR_TEXT_MINFRAMEWIDTH -SDRATTR_START]=new SdrMetricItem(SDRATTR_TEXT_MINFRAMEWIDTH, 0);
161 rPoolDefaults[SDRATTR_TEXT_MAXFRAMEWIDTH -SDRATTR_START]=new SdrMetricItem(SDRATTR_TEXT_MAXFRAMEWIDTH, 0);
162 rPoolDefaults[SDRATTR_TEXT_AUTOGROWWIDTH -SDRATTR_START]=new SdrOnOffItem(SDRATTR_TEXT_AUTOGROWWIDTH, false);
163 rPoolDefaults[SDRATTR_TEXT_HORZADJUST -SDRATTR_START]=new SdrTextHorzAdjustItem;
164 rPoolDefaults[SDRATTR_TEXT_ANIKIND -SDRATTR_START]=new SdrTextAniKindItem;
165 rPoolDefaults[SDRATTR_TEXT_ANIDIRECTION -SDRATTR_START]=new SdrTextAniDirectionItem;
166 rPoolDefaults[SDRATTR_TEXT_ANISTARTINSIDE -SDRATTR_START]=new SdrTextAniStartInsideItem;
167 rPoolDefaults[SDRATTR_TEXT_ANISTOPINSIDE -SDRATTR_START]=new SdrTextAniStopInsideItem;
168 rPoolDefaults[SDRATTR_TEXT_ANICOUNT -SDRATTR_START]=new SdrTextAniCountItem;
169 rPoolDefaults[SDRATTR_TEXT_ANIDELAY -SDRATTR_START]=new SdrTextAniDelayItem;
170 rPoolDefaults[SDRATTR_TEXT_ANIAMOUNT -SDRATTR_START]=new SdrTextAniAmountItem;
171 rPoolDefaults[SDRATTR_TEXT_CONTOURFRAME -SDRATTR_START]=new SdrOnOffItem(SDRATTR_TEXT_CONTOURFRAME, false);
172 rPoolDefaults[SDRATTR_XMLATTRIBUTES -SDRATTR_START]=new SvXMLAttrContainerItem( SDRATTR_XMLATTRIBUTES );
173 rPoolDefaults[SDRATTR_TEXT_CHAINNEXTNAME -SDRATTR_START]=new SfxStringItem(SDRATTR_TEXT_CHAINNEXTNAME, "");
174 rPoolDefaults[SDRATTR_TEXT_USEFIXEDCELLHEIGHT -SDRATTR_START]=new SdrTextFixedCellHeightItem;
175 rPoolDefaults[SDRATTR_TEXT_WORDWRAP -SDRATTR_START]=new SdrOnOffItem(SDRATTR_TEXT_WORDWRAP, true);
176 rPoolDefaults[SDRATTR_EDGEKIND -SDRATTR_START]=new SdrEdgeKindItem;
177 rPoolDefaults[SDRATTR_EDGENODE1HORZDIST-SDRATTR_START]=new SdrEdgeNode1HorzDistItem(nDefEdgeDist);
178 rPoolDefaults[SDRATTR_EDGENODE1VERTDIST-SDRATTR_START]=new SdrEdgeNode1VertDistItem(nDefEdgeDist);
179 rPoolDefaults[SDRATTR_EDGENODE2HORZDIST-SDRATTR_START]=new SdrEdgeNode2HorzDistItem(nDefEdgeDist);
180 rPoolDefaults[SDRATTR_EDGENODE2VERTDIST-SDRATTR_START]=new SdrEdgeNode2VertDistItem(nDefEdgeDist);
181 rPoolDefaults[SDRATTR_EDGENODE1GLUEDIST-SDRATTR_START]=new SdrEdgeNode1GlueDistItem;
182 rPoolDefaults[SDRATTR_EDGENODE2GLUEDIST-SDRATTR_START]=new SdrEdgeNode2GlueDistItem;
183 rPoolDefaults[SDRATTR_EDGELINEDELTACOUNT-SDRATTR_START]=new SdrEdgeLineDeltaCountItem;
184 rPoolDefaults[SDRATTR_EDGELINE1DELTA -SDRATTR_START]=new SdrMetricItem(SDRATTR_EDGELINE1DELTA, 0);
185 rPoolDefaults[SDRATTR_EDGELINE2DELTA -SDRATTR_START]=new SdrMetricItem(SDRATTR_EDGELINE2DELTA, 0);
186 rPoolDefaults[SDRATTR_EDGELINE3DELTA -SDRATTR_START]=new SdrMetricItem(SDRATTR_EDGELINE3DELTA, 0);
187 rPoolDefaults[SDRATTR_MEASUREKIND -SDRATTR_START]=new SdrMeasureKindItem;
188 rPoolDefaults[SDRATTR_MEASURETEXTHPOS -SDRATTR_START]=new SdrMeasureTextHPosItem;
189 rPoolDefaults[SDRATTR_MEASURETEXTVPOS -SDRATTR_START]=new SdrMeasureTextVPosItem;
190 rPoolDefaults[SDRATTR_MEASURELINEDIST -SDRATTR_START]=new SdrMetricItem(SDRATTR_MEASURELINEDIST, 800);
191 rPoolDefaults[SDRATTR_MEASUREHELPLINEOVERHANG -SDRATTR_START]=new SdrMetricItem(SDRATTR_MEASUREHELPLINEOVERHANG, 200);
192 rPoolDefaults[SDRATTR_MEASUREHELPLINEDIST -SDRATTR_START]=new SdrMetricItem(SDRATTR_MEASUREHELPLINEDIST, 100);
193 rPoolDefaults[SDRATTR_MEASUREHELPLINE1LEN -SDRATTR_START]=new SdrMetricItem(SDRATTR_MEASUREHELPLINE1LEN, 0);
194 rPoolDefaults[SDRATTR_MEASUREHELPLINE2LEN -SDRATTR_START]=new SdrMetricItem(SDRATTR_MEASUREHELPLINE2LEN, 0);
195 rPoolDefaults[SDRATTR_MEASUREBELOWREFEDGE -SDRATTR_START]=new SdrMeasureBelowRefEdgeItem;
196 rPoolDefaults[SDRATTR_MEASURETEXTROTA90 -SDRATTR_START]=new SdrMeasureTextRota90Item;
197 rPoolDefaults[SDRATTR_MEASURETEXTUPSIDEDOWN -SDRATTR_START]=new SdrMeasureTextUpsideDownItem;
198 rPoolDefaults[SDRATTR_MEASUREOVERHANG -SDRATTR_START]=new SdrMeasureOverhangItem(600);
199 rPoolDefaults[SDRATTR_MEASUREUNIT -SDRATTR_START]=new SdrMeasureUnitItem;
200 rPoolDefaults[SDRATTR_MEASURESCALE -SDRATTR_START]=new SdrMeasureScaleItem;
201 rPoolDefaults[SDRATTR_MEASURESHOWUNIT -SDRATTR_START]=new SdrYesNoItem(SDRATTR_MEASURESHOWUNIT, false);
202 rPoolDefaults[SDRATTR_MEASUREFORMATSTRING -SDRATTR_START]=new SdrMeasureFormatStringItem();
203 rPoolDefaults[SDRATTR_MEASURETEXTAUTOANGLE -SDRATTR_START]=new SdrMeasureTextAutoAngleItem();
204 rPoolDefaults[SDRATTR_MEASURETEXTAUTOANGLEVIEW-SDRATTR_START]=new SdrMeasureTextAutoAngleViewItem();
205 rPoolDefaults[SDRATTR_MEASURETEXTISFIXEDANGLE -SDRATTR_START]=new SdrMeasureTextIsFixedAngleItem();
206 rPoolDefaults[SDRATTR_MEASURETEXTFIXEDANGLE -SDRATTR_START]=new SdrMeasureTextFixedAngleItem();
207 rPoolDefaults[SDRATTR_MEASUREDECIMALPLACES -SDRATTR_START]=new SdrMeasureDecimalPlacesItem();
208 rPoolDefaults[SDRATTR_CIRCKIND -SDRATTR_START]=new SdrCircKindItem;
209 rPoolDefaults[SDRATTR_CIRCSTARTANGLE-SDRATTR_START]=new SdrAngleItem(SDRATTR_CIRCSTARTANGLE, 0);
210 rPoolDefaults[SDRATTR_CIRCENDANGLE -SDRATTR_START]=new SdrAngleItem(SDRATTR_CIRCENDANGLE, 36000);
211 rPoolDefaults[SDRATTR_OBJMOVEPROTECT -SDRATTR_START]=new SdrYesNoItem(SDRATTR_OBJMOVEPROTECT, false);
212 rPoolDefaults[SDRATTR_OBJSIZEPROTECT -SDRATTR_START]=new SdrYesNoItem(SDRATTR_OBJSIZEPROTECT, false);
213 rPoolDefaults[SDRATTR_OBJPRINTABLE -SDRATTR_START]=new SdrObjPrintableItem;
214 rPoolDefaults[SDRATTR_OBJVISIBLE -SDRATTR_START]=new SdrObjVisibleItem;
215 rPoolDefaults[SDRATTR_LAYERID -SDRATTR_START]=new SdrLayerIdItem(SdrLayerID(0));
216 rPoolDefaults[SDRATTR_LAYERNAME -SDRATTR_START]=new SdrLayerNameItem;
217 rPoolDefaults[SDRATTR_OBJECTNAME -SDRATTR_START]=new SfxStringItem(SDRATTR_OBJECTNAME);
218 rPoolDefaults[SDRATTR_ALLPOSITIONX -SDRATTR_START]=new SdrAllPositionXItem;
219 rPoolDefaults[SDRATTR_ALLPOSITIONY -SDRATTR_START]=new SdrAllPositionYItem;
220 rPoolDefaults[SDRATTR_ALLSIZEWIDTH -SDRATTR_START]=new SdrAllSizeWidthItem;
221 rPoolDefaults[SDRATTR_ALLSIZEHEIGHT -SDRATTR_START]=new SdrAllSizeHeightItem;
222 rPoolDefaults[SDRATTR_ONEPOSITIONX -SDRATTR_START]=new SdrOnePositionXItem;
223 rPoolDefaults[SDRATTR_ONEPOSITIONY -SDRATTR_START]=new SdrOnePositionYItem;
224 rPoolDefaults[SDRATTR_ONESIZEWIDTH -SDRATTR_START]=new SdrOneSizeWidthItem;
225 rPoolDefaults[SDRATTR_ONESIZEHEIGHT -SDRATTR_START]=new SdrOneSizeHeightItem;
226 rPoolDefaults[SDRATTR_LOGICSIZEWIDTH -SDRATTR_START]=new SdrLogicSizeWidthItem;
227 rPoolDefaults[SDRATTR_LOGICSIZEHEIGHT-SDRATTR_START]=new SdrLogicSizeHeightItem;
228 rPoolDefaults[SDRATTR_ROTATEANGLE -SDRATTR_START]=new SdrAngleItem(SDRATTR_ROTATEANGLE, 0);
229 rPoolDefaults[SDRATTR_SHEARANGLE -SDRATTR_START]=new SdrShearAngleItem;
230 rPoolDefaults[SDRATTR_MOVEX -SDRATTR_START]=new SdrMoveXItem;
231 rPoolDefaults[SDRATTR_MOVEY -SDRATTR_START]=new SdrMoveYItem;
232 rPoolDefaults[SDRATTR_RESIZEXONE -SDRATTR_START]=new SdrResizeXOneItem;
233 rPoolDefaults[SDRATTR_RESIZEYONE -SDRATTR_START]=new SdrResizeYOneItem;
234 rPoolDefaults[SDRATTR_ROTATEONE -SDRATTR_START]=new SdrRotateOneItem;
235 rPoolDefaults[SDRATTR_HORZSHEARONE -SDRATTR_START]=new SdrHorzShearOneItem;
236 rPoolDefaults[SDRATTR_VERTSHEARONE -SDRATTR_START]=new SdrVertShearOneItem;
237 rPoolDefaults[SDRATTR_RESIZEXALL -SDRATTR_START]=new SdrResizeXAllItem;
238 rPoolDefaults[SDRATTR_RESIZEYALL -SDRATTR_START]=new SdrResizeYAllItem;
239 rPoolDefaults[SDRATTR_ROTATEALL -SDRATTR_START]=new SdrRotateAllItem;
240 rPoolDefaults[SDRATTR_HORZSHEARALL -SDRATTR_START]=new SdrHorzShearAllItem;
241 rPoolDefaults[SDRATTR_VERTSHEARALL -SDRATTR_START]=new SdrVertShearAllItem;
242 rPoolDefaults[SDRATTR_TRANSFORMREF1X -SDRATTR_START]=new SdrTransformRef1XItem;
243 rPoolDefaults[SDRATTR_TRANSFORMREF1Y -SDRATTR_START]=new SdrTransformRef1YItem;
244 rPoolDefaults[SDRATTR_TRANSFORMREF2X -SDRATTR_START]=new SdrTransformRef2XItem;
245 rPoolDefaults[SDRATTR_TRANSFORMREF2Y -SDRATTR_START]=new SdrTransformRef2YItem;
246 rPoolDefaults[SDRATTR_TEXTDIRECTION -SDRATTR_START]=new SvxWritingModeItem(css::text::WritingMode_LR_TB, SDRATTR_TEXTDIRECTION);
247 rPoolDefaults[ SDRATTR_GRAFRED - SDRATTR_START] = new SdrGrafRedItem;
248 rPoolDefaults[ SDRATTR_GRAFGREEN - SDRATTR_START] = new SdrGrafGreenItem;
249 rPoolDefaults[ SDRATTR_GRAFBLUE - SDRATTR_START] = new SdrGrafBlueItem;
250 rPoolDefaults[ SDRATTR_GRAFLUMINANCE - SDRATTR_START] = new SdrGrafLuminanceItem;
251 rPoolDefaults[ SDRATTR_GRAFCONTRAST - SDRATTR_START] = new SdrGrafContrastItem;
252 rPoolDefaults[ SDRATTR_GRAFGAMMA - SDRATTR_START] = new SdrGrafGamma100Item;
253 rPoolDefaults[ SDRATTR_GRAFTRANSPARENCE - SDRATTR_START] = new SdrGrafTransparenceItem;
254 rPoolDefaults[ SDRATTR_GRAFINVERT - SDRATTR_START] = new SdrGrafInvertItem;
255 rPoolDefaults[ SDRATTR_GRAFMODE - SDRATTR_START] = new SdrGrafModeItem;
256 rPoolDefaults[ SDRATTR_GRAFCROP - SDRATTR_START] = new SdrGrafCropItem;
257 rPoolDefaults[ SDRATTR_3DOBJ_PERCENT_DIAGONAL - SDRATTR_START ] = new SfxUInt16Item(SDRATTR_3DOBJ_PERCENT_DIAGONAL, 10);
258 rPoolDefaults[ SDRATTR_3DOBJ_BACKSCALE - SDRATTR_START ] = new SfxUInt16Item(SDRATTR_3DOBJ_BACKSCALE, 100);
259 rPoolDefaults[ SDRATTR_3DOBJ_DEPTH - SDRATTR_START ] = new SfxUInt32Item(SDRATTR_3DOBJ_DEPTH, 1000);
260 rPoolDefaults[ SDRATTR_3DOBJ_HORZ_SEGS - SDRATTR_START ] = new SfxUInt32Item(SDRATTR_3DOBJ_HORZ_SEGS, 24);
261 rPoolDefaults[ SDRATTR_3DOBJ_VERT_SEGS - SDRATTR_START ] = new SfxUInt32Item(SDRATTR_3DOBJ_VERT_SEGS, 24);
262 rPoolDefaults[ SDRATTR_3DOBJ_END_ANGLE - SDRATTR_START ] = new SfxUInt32Item(SDRATTR_3DOBJ_END_ANGLE, 3600);
263 rPoolDefaults[ SDRATTR_3DOBJ_DOUBLE_SIDED - SDRATTR_START ] = new SfxBoolItem(SDRATTR_3DOBJ_DOUBLE_SIDED, false);
264 rPoolDefaults[ SDRATTR_3DOBJ_NORMALS_KIND - SDRATTR_START ] = new Svx3DNormalsKindItem;
265 rPoolDefaults[ SDRATTR_3DOBJ_NORMALS_INVERT - SDRATTR_START ] = new SfxBoolItem(SDRATTR_3DOBJ_NORMALS_INVERT, false);
266 rPoolDefaults[ SDRATTR_3DOBJ_TEXTURE_PROJ_X - SDRATTR_START ] = new Svx3DTextureProjectionXItem;
267 rPoolDefaults[ SDRATTR_3DOBJ_TEXTURE_PROJ_Y - SDRATTR_START ] = new Svx3DTextureProjectionYItem;
268 rPoolDefaults[ SDRATTR_3DOBJ_SHADOW_3D - SDRATTR_START ] = new SfxBoolItem(SDRATTR_3DOBJ_SHADOW_3D, false);
269 rPoolDefaults[ SDRATTR_3DOBJ_MAT_COLOR - SDRATTR_START ] = new SvxColorItem(Color(0x0000b8ff), SDRATTR_3DOBJ_MAT_COLOR);
270 rPoolDefaults[ SDRATTR_3DOBJ_MAT_EMISSION - SDRATTR_START ] = new SvxColorItem(Color(0x00000000), SDRATTR_3DOBJ_MAT_EMISSION);
271 rPoolDefaults[ SDRATTR_3DOBJ_MAT_SPECULAR - SDRATTR_START ] = new SvxColorItem(Color(0x00ffffff), SDRATTR_3DOBJ_MAT_SPECULAR);
272 rPoolDefaults[ SDRATTR_3DOBJ_MAT_SPECULAR_INTENSITY - SDRATTR_START ] = new SfxUInt16Item(SDRATTR_3DOBJ_MAT_SPECULAR_INTENSITY, 15);
273 rPoolDefaults[ SDRATTR_3DOBJ_TEXTURE_KIND - SDRATTR_START ] = new Svx3DTextureKindItem;
274 rPoolDefaults[ SDRATTR_3DOBJ_TEXTURE_MODE - SDRATTR_START ] = new Svx3DTextureModeItem;
275 rPoolDefaults[ SDRATTR_3DOBJ_TEXTURE_FILTER - SDRATTR_START ] = new SfxBoolItem(SDRATTR_3DOBJ_TEXTURE_FILTER, false);
276 rPoolDefaults[ SDRATTR_3DOBJ_SMOOTH_NORMALS - SDRATTR_START ] = new Svx3DSmoothNormalsItem;
277 rPoolDefaults[ SDRATTR_3DOBJ_SMOOTH_LIDS - SDRATTR_START ] = new Svx3DSmoothLidsItem;
278 rPoolDefaults[ SDRATTR_3DOBJ_CHARACTER_MODE - SDRATTR_START ] = new Svx3DCharacterModeItem;
279 rPoolDefaults[ SDRATTR_3DOBJ_CLOSE_FRONT - SDRATTR_START ] = new Svx3DCloseFrontItem;
280 rPoolDefaults[ SDRATTR_3DOBJ_CLOSE_BACK - SDRATTR_START ] = new Svx3DCloseBackItem;
281 rPoolDefaults[ SDRATTR_3DOBJ_REDUCED_LINE_GEOMETRY - SDRATTR_START ] = new Svx3DReducedLineGeometryItem;
282 rPoolDefaults[ SDRATTR_3DSCENE_PERSPECTIVE - SDRATTR_START ] = new Svx3DPerspectiveItem;
283 rPoolDefaults[ SDRATTR_3DSCENE_DISTANCE - SDRATTR_START ] = new SfxUInt32Item(SDRATTR_3DSCENE_DISTANCE, 100);
284 rPoolDefaults[ SDRATTR_3DSCENE_FOCAL_LENGTH - SDRATTR_START ] = new SfxUInt32Item(SDRATTR_3DSCENE_FOCAL_LENGTH, 100);
285 rPoolDefaults[ SDRATTR_3DSCENE_TWO_SIDED_LIGHTING - SDRATTR_START ] = new SfxBoolItem(SDRATTR_3DSCENE_TWO_SIDED_LIGHTING, false);
286 rPoolDefaults[ SDRATTR_3DSCENE_LIGHTCOLOR_1 - SDRATTR_START ] = new SvxColorItem(Color(0xffcccccc), SDRATTR_3DSCENE_LIGHTCOLOR_1);
287 rPoolDefaults[ SDRATTR_3DSCENE_LIGHTCOLOR_2 - SDRATTR_START ] = new SvxColorItem(Color(0x00000000), SDRATTR_3DSCENE_LIGHTCOLOR_2);
288 rPoolDefaults[ SDRATTR_3DSCENE_LIGHTCOLOR_3 - SDRATTR_START ] = new SvxColorItem(Color(0x00000000), SDRATTR_3DSCENE_LIGHTCOLOR_3);
289 rPoolDefaults[ SDRATTR_3DSCENE_LIGHTCOLOR_4 - SDRATTR_START ] = new SvxColorItem(Color(0x00000000), SDRATTR_3DSCENE_LIGHTCOLOR_4);
290 rPoolDefaults[ SDRATTR_3DSCENE_LIGHTCOLOR_5 - SDRATTR_START ] = new SvxColorItem(Color(0x00000000), SDRATTR_3DSCENE_LIGHTCOLOR_5);
291 rPoolDefaults[ SDRATTR_3DSCENE_LIGHTCOLOR_6 - SDRATTR_START ] = new SvxColorItem(Color(0x00000000), SDRATTR_3DSCENE_LIGHTCOLOR_6);
292 rPoolDefaults[ SDRATTR_3DSCENE_LIGHTCOLOR_7 - SDRATTR_START ] = new SvxColorItem(Color(0x00000000), SDRATTR_3DSCENE_LIGHTCOLOR_7);
293 rPoolDefaults[ SDRATTR_3DSCENE_LIGHTCOLOR_8 - SDRATTR_START ] = new SvxColorItem(Color(0x00000000), SDRATTR_3DSCENE_LIGHTCOLOR_8);
294 rPoolDefaults[ SDRATTR_3DSCENE_AMBIENTCOLOR - SDRATTR_START ] = new SvxColorItem(Color(0x00666666), SDRATTR_3DSCENE_AMBIENTCOLOR);
295 rPoolDefaults[ SDRATTR_3DSCENE_LIGHTON_1 - SDRATTR_START ] = new SfxBoolItem(SDRATTR_3DSCENE_LIGHTON_1, true);
296 rPoolDefaults[ SDRATTR_3DSCENE_LIGHTON_2 - SDRATTR_START ] = new SfxBoolItem(SDRATTR_3DSCENE_LIGHTON_2, false);
297 rPoolDefaults[ SDRATTR_3DSCENE_LIGHTON_3 - SDRATTR_START ] = new SfxBoolItem(SDRATTR_3DSCENE_LIGHTON_3, false);
298 rPoolDefaults[ SDRATTR_3DSCENE_LIGHTON_4 - SDRATTR_START ] = new SfxBoolItem(SDRATTR_3DSCENE_LIGHTON_4, false);
299 rPoolDefaults[ SDRATTR_3DSCENE_LIGHTON_5 - SDRATTR_START ] = new SfxBoolItem(SDRATTR_3DSCENE_LIGHTON_5, false);
300 rPoolDefaults[ SDRATTR_3DSCENE_LIGHTON_6 - SDRATTR_START ] = new SfxBoolItem(SDRATTR_3DSCENE_LIGHTON_6, false);
301 rPoolDefaults[ SDRATTR_3DSCENE_LIGHTON_7 - SDRATTR_START ] = new SfxBoolItem(SDRATTR_3DSCENE_LIGHTON_7, false);
302 rPoolDefaults[ SDRATTR_3DSCENE_LIGHTON_8 - SDRATTR_START ] = new SfxBoolItem(SDRATTR_3DSCENE_LIGHTON_8, false);
303 rPoolDefaults[ SDRATTR_3DSCENE_LIGHTDIRECTION_1 - SDRATTR_START ] = new SvxB3DVectorItem(SDRATTR_3DSCENE_LIGHTDIRECTION_1, basegfx::B3DVector(0.57735026918963, 0.57735026918963, 0.57735026918963));
304 rPoolDefaults[ SDRATTR_3DSCENE_LIGHTDIRECTION_2 - SDRATTR_START ] = new SvxB3DVectorItem(SDRATTR_3DSCENE_LIGHTDIRECTION_2, basegfx::B3DVector(0.0,0.0,1.0));
305 rPoolDefaults[ SDRATTR_3DSCENE_LIGHTDIRECTION_3 - SDRATTR_START ] = new SvxB3DVectorItem(SDRATTR_3DSCENE_LIGHTDIRECTION_3, basegfx::B3DVector(0.0,0.0,1.0));
306 rPoolDefaults[ SDRATTR_3DSCENE_LIGHTDIRECTION_4 - SDRATTR_START ] = new SvxB3DVectorItem(SDRATTR_3DSCENE_LIGHTDIRECTION_4, basegfx::B3DVector(0.0,0.0,1.0));
307 rPoolDefaults[ SDRATTR_3DSCENE_LIGHTDIRECTION_5 - SDRATTR_START ] = new SvxB3DVectorItem(SDRATTR_3DSCENE_LIGHTDIRECTION_5, basegfx::B3DVector(0.0,0.0,1.0));
308 rPoolDefaults[ SDRATTR_3DSCENE_LIGHTDIRECTION_6 - SDRATTR_START ] = new SvxB3DVectorItem(SDRATTR_3DSCENE_LIGHTDIRECTION_6, basegfx::B3DVector(0.0,0.0,1.0));
309 rPoolDefaults[ SDRATTR_3DSCENE_LIGHTDIRECTION_7 - SDRATTR_START ] = new SvxB3DVectorItem(SDRATTR_3DSCENE_LIGHTDIRECTION_7, basegfx::B3DVector(0.0,0.0,1.0));
310 rPoolDefaults[ SDRATTR_3DSCENE_LIGHTDIRECTION_8 - SDRATTR_START ] = new SvxB3DVectorItem(SDRATTR_3DSCENE_LIGHTDIRECTION_8, basegfx::B3DVector(0.0,0.0,1.0));
311 rPoolDefaults[ SDRATTR_3DSCENE_SHADOW_SLANT - SDRATTR_START ] = new SfxUInt16Item(SDRATTR_3DSCENE_SHADOW_SLANT, 0);
312 rPoolDefaults[ SDRATTR_3DSCENE_SHADE_MODE - SDRATTR_START ] = new Svx3DShadeModeItem;
313 rPoolDefaults[ SDRATTR_CUSTOMSHAPE_ENGINE - SDRATTR_START ] = new SfxStringItem(SDRATTR_CUSTOMSHAPE_ENGINE, "");
314 rPoolDefaults[ SDRATTR_CUSTOMSHAPE_DATA - SDRATTR_START ] = new SfxStringItem(SDRATTR_CUSTOMSHAPE_DATA, "");
315 rPoolDefaults[ SDRATTR_CUSTOMSHAPE_GEOMETRY - SDRATTR_START ] = new SdrCustomShapeGeometryItem;
317 SvxBoxItem* pboxItem = new SvxBoxItem( SDRATTR_TABLE_BORDER );
318 pboxItem->SetAllDistances( 100 );
319 rPoolDefaults[ SDRATTR_TABLE_BORDER - SDRATTR_START ] = pboxItem;
321 SvxBoxInfoItem* pBoxInfoItem = new SvxBoxInfoItem( SDRATTR_TABLE_BORDER_INNER );
323 pBoxInfoItem->SetTable( true );
324 pBoxInfoItem->SetDist( true); // always show margin field
325 pBoxInfoItem->SetValid( SvxBoxInfoItemValidFlags::DISABLE ); // some lines may have DontCare state only in tables
327 rPoolDefaults[ SDRATTR_TABLE_BORDER_INNER - SDRATTR_START ] = pBoxInfoItem;
328 rPoolDefaults[ SDRATTR_TABLE_BORDER_TLBR - SDRATTR_START ] = new SvxLineItem( SDRATTR_TABLE_BORDER_TLBR );
329 rPoolDefaults[ SDRATTR_TABLE_BORDER_BLTR - SDRATTR_START ] = new SvxLineItem( SDRATTR_TABLE_BORDER_BLTR );
330 rPoolDefaults[ SDRATTR_TABLE_TEXT_ROTATION - SDRATTR_START ] = new SvxTextRotateItem(Degree10(0), SDRATTR_TABLE_TEXT_ROTATION);
332 rPoolDefaults[ SDRATTR_GLOW_RADIUS - SDRATTR_START ] = new SdrMetricItem(SDRATTR_GLOW_RADIUS, 0);
333 rPoolDefaults[ SDRATTR_GLOW_COLOR - SDRATTR_START ] = new XColorItem(SDRATTR_GLOW_COLOR, aNullCol);
334 rPoolDefaults[ SDRATTR_GLOW_TRANSPARENCY - SDRATTR_START ] = new SdrPercentItem(SDRATTR_GLOW_TRANSPARENCY, 0);
336 rPoolDefaults[SDRATTR_SOFTEDGE_RADIUS - SDRATTR_START] = new SdrMetricItem(SDRATTR_SOFTEDGE_RADIUS, 0);
338 // set own ItemInfos
339 mpLocalItemInfos[SDRATTR_SHADOW-SDRATTR_START]._nSID=SID_ATTR_FILL_SHADOW;
340 mpLocalItemInfos[SDRATTR_SHADOWCOLOR-SDRATTR_START]._nSID=SID_ATTR_SHADOW_COLOR;
341 mpLocalItemInfos[SDRATTR_SHADOWTRANSPARENCE-SDRATTR_START]._nSID=SID_ATTR_SHADOW_TRANSPARENCE;
342 mpLocalItemInfos[SDRATTR_SHADOWBLUR-SDRATTR_START]._nSID=SID_ATTR_SHADOW_BLUR;
343 mpLocalItemInfos[SDRATTR_SHADOWXDIST-SDRATTR_START]._nSID=SID_ATTR_SHADOW_XDISTANCE;
344 mpLocalItemInfos[SDRATTR_SHADOWYDIST-SDRATTR_START]._nSID=SID_ATTR_SHADOW_YDISTANCE;
345 mpLocalItemInfos[SDRATTR_TEXT_FITTOSIZE-SDRATTR_START]._nSID=SID_ATTR_TEXT_FITTOSIZE;
346 mpLocalItemInfos[SDRATTR_GRAFCROP-SDRATTR_START]._nSID=SID_ATTR_GRAF_CROP;
348 mpLocalItemInfos[SDRATTR_TABLE_BORDER - SDRATTR_START ]._nSID = SID_ATTR_BORDER_OUTER;
349 mpLocalItemInfos[SDRATTR_TABLE_BORDER_INNER - SDRATTR_START ]._nSID = SID_ATTR_BORDER_INNER;
350 mpLocalItemInfos[SDRATTR_TABLE_BORDER_TLBR - SDRATTR_START ]._nSID = SID_ATTR_BORDER_DIAG_TLBR;
351 mpLocalItemInfos[SDRATTR_TABLE_BORDER_BLTR - SDRATTR_START ]._nSID = SID_ATTR_BORDER_DIAG_BLTR;
353 mpLocalItemInfos[SDRATTR_GLOW_RADIUS - SDRATTR_START]._nSID = SID_ATTR_GLOW_RADIUS;
354 mpLocalItemInfos[SDRATTR_GLOW_COLOR - SDRATTR_START]._nSID = SID_ATTR_GLOW_COLOR;
355 mpLocalItemInfos[SDRATTR_GLOW_TRANSPARENCY - SDRATTR_START]._nSID = SID_ATTR_GLOW_TRANSPARENCY;
357 mpLocalItemInfos[SDRATTR_SOFTEDGE_RADIUS - SDRATTR_START]._nSID = SID_ATTR_SOFTEDGE_RADIUS;
359 // it's my own creation level, set Defaults and ItemInfos
360 SetDefaults(mpLocalPoolDefaults);
361 SetItemInfos(mpLocalItemInfos.get());
364 // copy ctor, so that static defaults are cloned
365 // (Parameter 2 = sal_True)
366 SdrItemPool::SdrItemPool(const SdrItemPool& rPool)
367 : XOutdevItemPool(rPool)
371 SdrItemPool* SdrItemPool::Clone() const
373 return new SdrItemPool(*this);
376 SdrItemPool::~SdrItemPool()
378 // split pools before destroying
379 SetSecondaryPool(nullptr);
382 bool SdrItemPool::GetPresentation(
383 const SfxPoolItem& rItem,
384 MapUnit ePresentationMetric, OUString& rText,
385 const IntlWrapper& rIntlWrapper) const
387 if (!IsInvalidItem(&rItem)) {
388 sal_uInt16 nWhich=rItem.Which();
389 if (nWhich>=SDRATTR_SHADOW_FIRST && nWhich<=SDRATTR_END) {
390 rItem.GetPresentation(SfxItemPresentation::Nameless,
391 GetMetric(nWhich),ePresentationMetric,rText,
392 rIntlWrapper);
393 rText = GetItemName(nWhich) + " " + rText;
395 return true;
398 return XOutdevItemPool::GetPresentation(rItem,ePresentationMetric,rText,rIntlWrapper);
401 OUString SdrItemPool::GetItemName(sal_uInt16 nWhich)
403 const char* pResId = SIP_UNKNOWN_ATTR;
405 switch (nWhich)
407 case XATTR_LINESTYLE : pResId = SIP_XA_LINESTYLE;break;
408 case XATTR_LINEDASH : pResId = SIP_XA_LINEDASH;break;
409 case XATTR_LINEWIDTH : pResId = SIP_XA_LINEWIDTH;break;
410 case XATTR_LINECOLOR : pResId = SIP_XA_LINECOLOR;break;
411 case XATTR_LINESTART : pResId = SIP_XA_LINESTART;break;
412 case XATTR_LINEEND : pResId = SIP_XA_LINEEND;break;
413 case XATTR_LINESTARTWIDTH : pResId = SIP_XA_LINESTARTWIDTH;break;
414 case XATTR_LINEENDWIDTH : pResId = SIP_XA_LINEENDWIDTH;break;
415 case XATTR_LINESTARTCENTER : pResId = SIP_XA_LINESTARTCENTER;break;
416 case XATTR_LINEENDCENTER : pResId = SIP_XA_LINEENDCENTER;break;
417 case XATTR_LINETRANSPARENCE : pResId = SIP_XA_LINETRANSPARENCE;break;
418 case XATTR_LINEJOINT : pResId = SIP_XA_LINEJOINT;break;
419 case XATTRSET_LINE : pResId = SIP_XATTRSET_LINE;break;
421 case XATTR_FILLSTYLE : pResId = SIP_XA_FILLSTYLE;break;
422 case XATTR_FILLCOLOR : pResId = SIP_XA_FILLCOLOR;break;
423 case XATTR_FILLGRADIENT : pResId = SIP_XA_FILLGRADIENT;break;
424 case XATTR_FILLHATCH : pResId = SIP_XA_FILLHATCH;break;
425 case XATTR_FILLBITMAP : pResId = SIP_XA_FILLBITMAP;break;
426 case XATTR_FILLTRANSPARENCE : pResId = SIP_XA_FILLTRANSPARENCE;break;
427 case XATTR_GRADIENTSTEPCOUNT : pResId = SIP_XA_GRADIENTSTEPCOUNT;break;
428 case XATTR_FILLBMP_TILE : pResId = SIP_XA_FILLBMP_TILE;break;
429 case XATTR_FILLBMP_POS : pResId = SIP_XA_FILLBMP_POS;break;
430 case XATTR_FILLBMP_SIZEX : pResId = SIP_XA_FILLBMP_SIZEX;break;
431 case XATTR_FILLBMP_SIZEY : pResId = SIP_XA_FILLBMP_SIZEY;break;
432 case XATTR_FILLFLOATTRANSPARENCE: pResId = SIP_XA_FILLFLOATTRANSPARENCE;break;
433 case XATTR_SECONDARYFILLCOLOR : pResId = SIP_XA_SECONDARYFILLCOLOR;break;
434 case XATTR_FILLBMP_SIZELOG : pResId = SIP_XA_FILLBMP_SIZELOG;break;
435 case XATTR_FILLBMP_TILEOFFSETX : pResId = SIP_XA_FILLBMP_TILEOFFSETX;break;
436 case XATTR_FILLBMP_TILEOFFSETY : pResId = SIP_XA_FILLBMP_TILEOFFSETY;break;
437 case XATTR_FILLBMP_STRETCH : pResId = SIP_XA_FILLBMP_STRETCH;break;
438 case XATTR_FILLBMP_POSOFFSETX : pResId = SIP_XA_FILLBMP_POSOFFSETX;break;
439 case XATTR_FILLBMP_POSOFFSETY : pResId = SIP_XA_FILLBMP_POSOFFSETY;break;
440 case XATTR_FILLBACKGROUND : pResId = SIP_XA_FILLBACKGROUND;break;
442 case XATTRSET_FILL : pResId = SIP_XATTRSET_FILL;break;
444 case XATTR_FORMTXTSTYLE : pResId = SIP_XA_FORMTXTSTYLE;break;
445 case XATTR_FORMTXTADJUST : pResId = SIP_XA_FORMTXTADJUST;break;
446 case XATTR_FORMTXTDISTANCE : pResId = SIP_XA_FORMTXTDISTANCE;break;
447 case XATTR_FORMTXTSTART : pResId = SIP_XA_FORMTXTSTART;break;
448 case XATTR_FORMTXTMIRROR : pResId = SIP_XA_FORMTXTMIRROR;break;
449 case XATTR_FORMTXTOUTLINE : pResId = SIP_XA_FORMTXTOUTLINE;break;
450 case XATTR_FORMTXTSHADOW : pResId = SIP_XA_FORMTXTSHADOW;break;
451 case XATTR_FORMTXTSHDWCOLOR : pResId = SIP_XA_FORMTXTSHDWCOLOR;break;
452 case XATTR_FORMTXTSHDWXVAL : pResId = SIP_XA_FORMTXTSHDWXVAL;break;
453 case XATTR_FORMTXTSHDWYVAL : pResId = SIP_XA_FORMTXTSHDWYVAL;break;
454 case XATTR_FORMTXTHIDEFORM : pResId = SIP_XA_FORMTXTHIDEFORM;break;
455 case XATTR_FORMTXTSHDWTRANSP: pResId = SIP_XA_FORMTXTSHDWTRANSP;break;
457 case SDRATTR_SHADOW : pResId = SIP_SA_SHADOW;break;
458 case SDRATTR_SHADOWCOLOR : pResId = SIP_SA_SHADOWCOLOR;break;
459 case SDRATTR_SHADOWXDIST : pResId = SIP_SA_SHADOWXDIST;break;
460 case SDRATTR_SHADOWYDIST : pResId = SIP_SA_SHADOWYDIST;break;
461 case SDRATTR_SHADOWTRANSPARENCE: pResId = SIP_SA_SHADOWTRANSPARENCE;break;
462 case SDRATTR_SHADOWBLUR : pResId = SIP_SA_SHADOWBLUR;break;
463 case SDRATTR_SHADOW3D : pResId = SIP_SA_SHADOW3D;break;
464 case SDRATTR_SHADOWPERSP : pResId = SIP_SA_SHADOWPERSP;break;
466 case SDRATTR_GLOW_RADIUS : pResId = SIP_SA_GLOW_RADIUS;break;
467 case SDRATTR_GLOW_COLOR : pResId = SIP_SA_GLOW_COLOR;break;
468 case SDRATTR_GLOW_TRANSPARENCY : pResId = SIP_SA_GLOW_TRANSPARENCY;break;
470 case SDRATTR_SOFTEDGE_RADIUS : pResId = SIP_SA_SOFTEDGE_RADIUS; break;
472 case SDRATTR_CAPTIONTYPE : pResId = SIP_SA_CAPTIONTYPE;break;
473 case SDRATTR_CAPTIONFIXEDANGLE: pResId = SIP_SA_CAPTIONFIXEDANGLE;break;
474 case SDRATTR_CAPTIONANGLE : pResId = SIP_SA_CAPTIONANGLE;break;
475 case SDRATTR_CAPTIONGAP : pResId = SIP_SA_CAPTIONGAP;break;
476 case SDRATTR_CAPTIONESCDIR : pResId = SIP_SA_CAPTIONESCDIR;break;
477 case SDRATTR_CAPTIONESCISREL : pResId = SIP_SA_CAPTIONESCISREL;break;
478 case SDRATTR_CAPTIONESCREL : pResId = SIP_SA_CAPTIONESCREL;break;
479 case SDRATTR_CAPTIONESCABS : pResId = SIP_SA_CAPTIONESCABS;break;
480 case SDRATTR_CAPTIONLINELEN : pResId = SIP_SA_CAPTIONLINELEN;break;
481 case SDRATTR_CAPTIONFITLINELEN: pResId = SIP_SA_CAPTIONFITLINELEN;break;
483 case SDRATTR_ECKENRADIUS : pResId = SIP_SA_ECKENRADIUS;break;
484 case SDRATTR_TEXT_MINFRAMEHEIGHT : pResId = SIP_SA_TEXT_MINFRAMEHEIGHT;break;
485 case SDRATTR_TEXT_AUTOGROWHEIGHT : pResId = SIP_SA_TEXT_AUTOGROWHEIGHT;break;
486 case SDRATTR_TEXT_FITTOSIZE : pResId = SIP_SA_TEXT_FITTOSIZE;break;
487 case SDRATTR_TEXT_LEFTDIST : pResId = SIP_SA_TEXT_LEFTDIST;break;
488 case SDRATTR_TEXT_RIGHTDIST : pResId = SIP_SA_TEXT_RIGHTDIST;break;
489 case SDRATTR_TEXT_UPPERDIST : pResId = SIP_SA_TEXT_UPPERDIST;break;
490 case SDRATTR_TEXT_LOWERDIST : pResId = SIP_SA_TEXT_LOWERDIST;break;
491 case SDRATTR_TEXT_VERTADJUST : pResId = SIP_SA_TEXT_VERTADJUST;break;
492 case SDRATTR_TEXT_MAXFRAMEHEIGHT : pResId = SIP_SA_TEXT_MAXFRAMEHEIGHT;break;
493 case SDRATTR_TEXT_MINFRAMEWIDTH : pResId = SIP_SA_TEXT_MINFRAMEWIDTH;break;
494 case SDRATTR_TEXT_MAXFRAMEWIDTH : pResId = SIP_SA_TEXT_MAXFRAMEWIDTH;break;
495 case SDRATTR_TEXT_AUTOGROWWIDTH : pResId = SIP_SA_TEXT_AUTOGROWWIDTH;break;
496 case SDRATTR_TEXT_HORZADJUST : pResId = SIP_SA_TEXT_HORZADJUST;break;
497 case SDRATTR_TEXT_ANIKIND : pResId = SIP_SA_TEXT_ANIKIND;break;
498 case SDRATTR_TEXT_ANIDIRECTION : pResId = SIP_SA_TEXT_ANIDIRECTION;break;
499 case SDRATTR_TEXT_ANISTARTINSIDE : pResId = SIP_SA_TEXT_ANISTARTINSIDE;break;
500 case SDRATTR_TEXT_ANISTOPINSIDE : pResId = SIP_SA_TEXT_ANISTOPINSIDE;break;
501 case SDRATTR_TEXT_ANICOUNT : pResId = SIP_SA_TEXT_ANICOUNT;break;
502 case SDRATTR_TEXT_ANIDELAY : pResId = SIP_SA_TEXT_ANIDELAY;break;
503 case SDRATTR_TEXT_ANIAMOUNT : pResId = SIP_SA_TEXT_ANIAMOUNT;break;
504 case SDRATTR_TEXT_CONTOURFRAME : pResId = SIP_SA_TEXT_CONTOURFRAME;break;
505 case SDRATTR_XMLATTRIBUTES : pResId = SIP_SA_XMLATTRIBUTES;break;
506 case SDRATTR_TEXT_USEFIXEDCELLHEIGHT: pResId = SIP_SA_TEXT_USEFIXEDCELLHEIGHT;break;
507 case SDRATTR_TEXT_WORDWRAP : pResId = SIP_SA_WORDWRAP;break;
508 case SDRATTR_TEXT_CHAINNEXTNAME : pResId = SIP_SA_CHAINNEXTNAME;break;
510 case SDRATTR_EDGEKIND : pResId = SIP_SA_EDGEKIND;break;
511 case SDRATTR_EDGENODE1HORZDIST : pResId = SIP_SA_EDGENODE1HORZDIST;break;
512 case SDRATTR_EDGENODE1VERTDIST : pResId = SIP_SA_EDGENODE1VERTDIST;break;
513 case SDRATTR_EDGENODE2HORZDIST : pResId = SIP_SA_EDGENODE2HORZDIST;break;
514 case SDRATTR_EDGENODE2VERTDIST : pResId = SIP_SA_EDGENODE2VERTDIST;break;
515 case SDRATTR_EDGENODE1GLUEDIST : pResId = SIP_SA_EDGENODE1GLUEDIST;break;
516 case SDRATTR_EDGENODE2GLUEDIST : pResId = SIP_SA_EDGENODE2GLUEDIST;break;
517 case SDRATTR_EDGELINEDELTACOUNT : pResId = SIP_SA_EDGELINEDELTACOUNT;break;
518 case SDRATTR_EDGELINE1DELTA : pResId = SIP_SA_EDGELINE1DELTA;break;
519 case SDRATTR_EDGELINE2DELTA : pResId = SIP_SA_EDGELINE2DELTA;break;
520 case SDRATTR_EDGELINE3DELTA : pResId = SIP_SA_EDGELINE3DELTA;break;
522 case SDRATTR_MEASUREKIND : pResId = SIP_SA_MEASUREKIND;break;
523 case SDRATTR_MEASURETEXTHPOS : pResId = SIP_SA_MEASURETEXTHPOS;break;
524 case SDRATTR_MEASURETEXTVPOS : pResId = SIP_SA_MEASURETEXTVPOS;break;
525 case SDRATTR_MEASURELINEDIST : pResId = SIP_SA_MEASURELINEDIST;break;
526 case SDRATTR_MEASUREHELPLINEOVERHANG : pResId = SIP_SA_MEASUREHELPLINEOVERHANG;break;
527 case SDRATTR_MEASUREHELPLINEDIST : pResId = SIP_SA_MEASUREHELPLINEDIST;break;
528 case SDRATTR_MEASUREHELPLINE1LEN : pResId = SIP_SA_MEASUREHELPLINE1LEN;break;
529 case SDRATTR_MEASUREHELPLINE2LEN : pResId = SIP_SA_MEASUREHELPLINE2LEN;break;
530 case SDRATTR_MEASUREBELOWREFEDGE : pResId = SIP_SA_MEASUREBELOWREFEDGE;break;
531 case SDRATTR_MEASURETEXTROTA90 : pResId = SIP_SA_MEASURETEXTROTA90;break;
532 case SDRATTR_MEASURETEXTUPSIDEDOWN : pResId = SIP_SA_MEASURETEXTUPSIDEDOWN;break;
533 case SDRATTR_MEASUREOVERHANG : pResId = SIP_SA_MEASUREOVERHANG;break;
534 case SDRATTR_MEASUREUNIT : pResId = SIP_SA_MEASUREUNIT;break;
535 case SDRATTR_MEASURESCALE : pResId = SIP_SA_MEASURESCALE;break;
536 case SDRATTR_MEASURESHOWUNIT : pResId = SIP_SA_MEASURESHOWUNIT;break;
537 case SDRATTR_MEASUREFORMATSTRING : pResId = SIP_SA_MEASUREFORMATSTRING;break;
538 case SDRATTR_MEASURETEXTAUTOANGLE : pResId = SIP_SA_MEASURETEXTAUTOANGLE;break;
539 case SDRATTR_MEASURETEXTAUTOANGLEVIEW: pResId = SIP_SA_MEASURETEXTAUTOANGLEVIEW;break;
540 case SDRATTR_MEASURETEXTISFIXEDANGLE : pResId = SIP_SA_MEASURETEXTISFIXEDANGLE;break;
541 case SDRATTR_MEASURETEXTFIXEDANGLE : pResId = SIP_SA_MEASURETEXTFIXEDANGLE;break;
542 case SDRATTR_MEASUREDECIMALPLACES : pResId = SIP_SA_MEASUREDECIMALPLACES;break;
544 case SDRATTR_CIRCKIND : pResId = SIP_SA_CIRCKIND;break;
545 case SDRATTR_CIRCSTARTANGLE: pResId = SIP_SA_CIRCSTARTANGLE;break;
546 case SDRATTR_CIRCENDANGLE : pResId = SIP_SA_CIRCENDANGLE;break;
548 case SDRATTR_OBJMOVEPROTECT : pResId = SIP_SA_OBJMOVEPROTECT;break;
549 case SDRATTR_OBJSIZEPROTECT : pResId = SIP_SA_OBJSIZEPROTECT;break;
550 case SDRATTR_OBJPRINTABLE : pResId = SIP_SA_OBJPRINTABLE;break;
551 case SDRATTR_OBJVISIBLE : pResId = SIP_SA_OBJVISIBLE;break;
552 case SDRATTR_LAYERID : pResId = SIP_SA_LAYERID;break;
553 case SDRATTR_LAYERNAME : pResId = SIP_SA_LAYERNAME;break;
554 case SDRATTR_OBJECTNAME : pResId = SIP_SA_OBJECTNAME;break;
555 case SDRATTR_ALLPOSITIONX : pResId = SIP_SA_ALLPOSITIONX;break;
556 case SDRATTR_ALLPOSITIONY : pResId = SIP_SA_ALLPOSITIONY;break;
557 case SDRATTR_ALLSIZEWIDTH : pResId = SIP_SA_ALLSIZEWIDTH;break;
558 case SDRATTR_ALLSIZEHEIGHT : pResId = SIP_SA_ALLSIZEHEIGHT;break;
559 case SDRATTR_ONEPOSITIONX : pResId = SIP_SA_ONEPOSITIONX;break;
560 case SDRATTR_ONEPOSITIONY : pResId = SIP_SA_ONEPOSITIONY;break;
561 case SDRATTR_ONESIZEWIDTH : pResId = SIP_SA_ONESIZEWIDTH;break;
562 case SDRATTR_ONESIZEHEIGHT : pResId = SIP_SA_ONESIZEHEIGHT;break;
563 case SDRATTR_LOGICSIZEWIDTH : pResId = SIP_SA_LOGICSIZEWIDTH;break;
564 case SDRATTR_LOGICSIZEHEIGHT: pResId = SIP_SA_LOGICSIZEHEIGHT;break;
565 case SDRATTR_ROTATEANGLE : pResId = SIP_SA_ROTATEANGLE;break;
566 case SDRATTR_SHEARANGLE : pResId = SIP_SA_SHEARANGLE;break;
567 case SDRATTR_MOVEX : pResId = SIP_SA_MOVEX;break;
568 case SDRATTR_MOVEY : pResId = SIP_SA_MOVEY;break;
569 case SDRATTR_RESIZEXONE : pResId = SIP_SA_RESIZEXONE;break;
570 case SDRATTR_RESIZEYONE : pResId = SIP_SA_RESIZEYONE;break;
571 case SDRATTR_ROTATEONE : pResId = SIP_SA_ROTATEONE;break;
572 case SDRATTR_HORZSHEARONE : pResId = SIP_SA_HORZSHEARONE;break;
573 case SDRATTR_VERTSHEARONE : pResId = SIP_SA_VERTSHEARONE;break;
574 case SDRATTR_RESIZEXALL : pResId = SIP_SA_RESIZEXALL;break;
575 case SDRATTR_RESIZEYALL : pResId = SIP_SA_RESIZEYALL;break;
576 case SDRATTR_ROTATEALL : pResId = SIP_SA_ROTATEALL;break;
577 case SDRATTR_HORZSHEARALL : pResId = SIP_SA_HORZSHEARALL;break;
578 case SDRATTR_VERTSHEARALL : pResId = SIP_SA_VERTSHEARALL;break;
579 case SDRATTR_TRANSFORMREF1X : pResId = SIP_SA_TRANSFORMREF1X;break;
580 case SDRATTR_TRANSFORMREF1Y : pResId = SIP_SA_TRANSFORMREF1Y;break;
581 case SDRATTR_TRANSFORMREF2X : pResId = SIP_SA_TRANSFORMREF2X;break;
582 case SDRATTR_TRANSFORMREF2Y : pResId = SIP_SA_TRANSFORMREF2Y;break;
584 case SDRATTR_GRAFRED : pResId = SIP_SA_GRAFRED;break;
585 case SDRATTR_GRAFGREEN : pResId = SIP_SA_GRAFGREEN;break;
586 case SDRATTR_GRAFBLUE : pResId = SIP_SA_GRAFBLUE;break;
587 case SDRATTR_GRAFLUMINANCE : pResId = SIP_SA_GRAFLUMINANCE;break;
588 case SDRATTR_GRAFCONTRAST : pResId = SIP_SA_GRAFCONTRAST;break;
589 case SDRATTR_GRAFGAMMA : pResId = SIP_SA_GRAFGAMMA;break;
590 case SDRATTR_GRAFTRANSPARENCE : pResId = SIP_SA_GRAFTRANSPARENCE;break;
591 case SDRATTR_GRAFINVERT : pResId = SIP_SA_GRAFINVERT;break;
592 case SDRATTR_GRAFMODE : pResId = SIP_SA_GRAFMODE;break;
593 case SDRATTR_GRAFCROP : pResId = SIP_SA_GRAFCROP;break;
595 case EE_PARA_HYPHENATE : pResId = SIP_EE_PARA_HYPHENATE;break;
596 case EE_PARA_BULLETSTATE: pResId = SIP_EE_PARA_BULLETSTATE;break;
597 case EE_PARA_OUTLLRSPACE: pResId = SIP_EE_PARA_OUTLLRSPACE;break;
598 case EE_PARA_OUTLLEVEL : pResId = SIP_EE_PARA_OUTLLEVEL;break;
599 case EE_PARA_BULLET : pResId = SIP_EE_PARA_BULLET;break;
600 case EE_PARA_LRSPACE : pResId = SIP_EE_PARA_LRSPACE;break;
601 case EE_PARA_ULSPACE : pResId = SIP_EE_PARA_ULSPACE;break;
602 case EE_PARA_SBL : pResId = SIP_EE_PARA_SBL;break;
603 case EE_PARA_JUST : pResId = SIP_EE_PARA_JUST;break;
604 case EE_PARA_TABS : pResId = SIP_EE_PARA_TABS;break;
606 case EE_CHAR_COLOR : pResId = SIP_EE_CHAR_COLOR;break;
607 case EE_CHAR_FONTINFO : pResId = SIP_EE_CHAR_FONTINFO;break;
608 case EE_CHAR_FONTHEIGHT : pResId = SIP_EE_CHAR_FONTHEIGHT;break;
609 case EE_CHAR_FONTWIDTH : pResId = SIP_EE_CHAR_FONTWIDTH;break;
610 case EE_CHAR_WEIGHT : pResId = SIP_EE_CHAR_WEIGHT;break;
611 case EE_CHAR_UNDERLINE : pResId = SIP_EE_CHAR_UNDERLINE;break;
612 case EE_CHAR_OVERLINE : pResId = SIP_EE_CHAR_OVERLINE;break;
613 case EE_CHAR_STRIKEOUT : pResId = SIP_EE_CHAR_STRIKEOUT;break;
614 case EE_CHAR_ITALIC : pResId = SIP_EE_CHAR_ITALIC;break;
615 case EE_CHAR_OUTLINE : pResId = SIP_EE_CHAR_OUTLINE;break;
616 case EE_CHAR_SHADOW : pResId = SIP_EE_CHAR_SHADOW;break;
617 case EE_CHAR_ESCAPEMENT : pResId = SIP_EE_CHAR_ESCAPEMENT;break;
618 case EE_CHAR_PAIRKERNING: pResId = SIP_EE_CHAR_PAIRKERNING;break;
619 case EE_CHAR_KERNING : pResId = SIP_EE_CHAR_KERNING;break;
620 case EE_CHAR_WLM : pResId = SIP_EE_CHAR_WLM;break;
621 case EE_FEATURE_TAB : pResId = SIP_EE_FEATURE_TAB;break;
622 case EE_FEATURE_LINEBR : pResId = SIP_EE_FEATURE_LINEBR;break;
623 case EE_FEATURE_NOTCONV : pResId = SIP_EE_FEATURE_NOTCONV;break;
624 case EE_FEATURE_FIELD : pResId = SIP_EE_FEATURE_FIELD;break;
625 } // switch
627 return SvxResId(pResId);
631 // FractionItem
634 bool SdrFractionItem::operator==(const SfxPoolItem& rCmp) const
636 return SfxPoolItem::operator==(rCmp) &&
637 static_cast<const SdrFractionItem&>(rCmp).GetValue()==nValue;
640 bool SdrFractionItem::GetPresentation(
641 SfxItemPresentation ePresentation, MapUnit /*eCoreMetric*/,
642 MapUnit /*ePresentationMetric*/, OUString &rText, const IntlWrapper&) const
644 if(nValue.IsValid())
646 sal_Int32 nDiv = nValue.GetDenominator();
647 rText = OUString::number(nValue.GetNumerator());
649 if(nDiv != 1)
651 rText += "/" + OUString::number(nDiv);
654 else
656 rText = "?";
659 if(ePresentation == SfxItemPresentation::Complete)
661 rText = SdrItemPool::GetItemName(Which()) + " " + rText;
662 return true;
664 else if(ePresentation == SfxItemPresentation::Nameless)
665 return true;
667 return false;
670 SdrFractionItem* SdrFractionItem::Clone(SfxItemPool * /*pPool*/) const
672 return new SdrFractionItem(Which(),GetValue());
676 // ScaleItem
679 bool SdrScaleItem::GetPresentation(
680 SfxItemPresentation ePresentation, MapUnit /*eCoreMetric*/,
681 MapUnit /*ePresentationMetric*/, OUString &rText, const IntlWrapper&) const
683 if(GetValue().IsValid())
685 sal_Int32 nDiv = GetValue().GetDenominator();
687 rText = OUString::number(GetValue().GetNumerator()) + ":" + OUString::number(nDiv);
689 else
691 rText = "?";
694 if(ePresentation == SfxItemPresentation::Complete)
696 rText = SdrItemPool::GetItemName(Which()) + " " + rText;
699 return true;
702 SdrScaleItem* SdrScaleItem::Clone(SfxItemPool * /*pPool*/) const
704 return new SdrScaleItem(Which(),GetValue());
708 // OnOffItem
711 SdrOnOffItem* SdrOnOffItem::Clone(SfxItemPool* /*pPool*/) const
713 return new SdrOnOffItem(Which(),GetValue());
716 OUString SdrOnOffItem::GetValueTextByVal(bool bVal) const
718 if (bVal)
719 return SvxResId(STR_ItemValON);
720 return SvxResId(STR_ItemValOFF);
723 bool SdrOnOffItem::GetPresentation(SfxItemPresentation ePres,
724 MapUnit /*eCoreMetric*/, MapUnit /*ePresMetric*/, OUString& rText, const IntlWrapper&) const
726 rText=GetValueTextByVal(GetValue());
727 if (ePres==SfxItemPresentation::Complete) {
728 rText = SdrItemPool::GetItemName(Which()) + " " + rText;
730 return true;
733 void SdrOnOffItem::dumpAsXml(xmlTextWriterPtr pWriter) const
735 xmlTextWriterStartElement(pWriter, BAD_CAST("SdrOnOffItem"));
736 if (Which() == SDRATTR_SHADOW)
738 xmlTextWriterWriteAttribute(pWriter, BAD_CAST("whichId"), BAD_CAST("SDRATTR_SHADOW"));
741 SfxBoolItem::dumpAsXml(pWriter);
743 xmlTextWriterEndElement(pWriter);
746 SdrYesNoItem* SdrYesNoItem::Clone(SfxItemPool* /*pPool*/) const
748 return new SdrYesNoItem(Which(),GetValue());
751 OUString SdrYesNoItem::GetValueTextByVal(bool bVal) const
753 if (bVal)
754 return SvxResId(STR_ItemValYES);
755 return SvxResId(STR_ItemValNO);
758 bool SdrYesNoItem::GetPresentation(SfxItemPresentation ePres,
759 MapUnit /*eCoreMetric*/, MapUnit /*ePresMetric*/, OUString& rText, const IntlWrapper&) const
761 rText=GetValueTextByVal(GetValue());
762 if (ePres==SfxItemPresentation::Complete) {
763 rText = SdrItemPool::GetItemName(Which()) + " " + rText;
765 return true;
768 SdrPercentItem* SdrPercentItem::Clone(SfxItemPool* /*pPool*/) const
770 return new SdrPercentItem(Which(),GetValue());
773 bool SdrPercentItem::GetPresentation(
774 SfxItemPresentation ePres, MapUnit /*eCoreMetric*/,
775 MapUnit /*ePresMetric*/, OUString& rText, const IntlWrapper&) const
777 rText = unicode::formatPercent(GetValue(),
778 Application::GetSettings().GetUILanguageTag());
780 if(ePres == SfxItemPresentation::Complete)
782 rText = SdrItemPool::GetItemName(Which()) + " " + rText;
785 return true;
788 void SdrPercentItem::dumpAsXml(xmlTextWriterPtr pWriter) const
790 xmlTextWriterStartElement(pWriter, BAD_CAST("SdrPercentItem"));
791 if (Which() == SDRATTR_SHADOWTRANSPARENCE)
793 xmlTextWriterWriteAttribute(pWriter, BAD_CAST("whichId"),
794 BAD_CAST("SDRATTR_SHADOWTRANSPARENCE"));
797 SfxUInt16Item::dumpAsXml(pWriter);
799 xmlTextWriterEndElement(pWriter);
802 SdrAngleItem* SdrAngleItem::Clone(SfxItemPool* /*pPool*/) const
804 return new SdrAngleItem(Which(),GetValue());
807 bool SdrAngleItem::GetPresentation(
808 SfxItemPresentation ePres, MapUnit /*eCoreMetric*/, MapUnit /*ePresMetric*/,
809 OUString& rText, const IntlWrapper& rIntlWrapper) const
811 sal_Int32 nValue(GetValue());
812 bool bNeg(nValue < 0);
814 if(bNeg)
815 nValue = -nValue;
817 OUStringBuffer aText = OUString::number(nValue);
819 if(nValue)
821 sal_Unicode aUnicodeNull('0');
822 sal_Int32 nCount(2);
824 if(LocaleDataWrapper::isNumLeadingZero())
825 nCount++;
827 while(aText.getLength() < nCount)
828 aText.insert(0, aUnicodeNull);
830 sal_Int32 nLen = aText.getLength();
831 bool bNull1(aText[nLen-1] == aUnicodeNull);
832 bool bNull2(bNull1 && aText[nLen-2] == aUnicodeNull);
834 if(bNull2)
836 // no decimal place(s)
837 sal_Int32 idx = nLen-2;
838 aText.remove(idx, aText.getLength()-idx);
840 else
842 sal_Unicode cDec =
843 rIntlWrapper.getLocaleData()->getNumDecimalSep()[0];
844 aText.insert(nLen-2, cDec);
846 if(bNull1)
847 aText.remove(nLen, aText.getLength()-nLen);
850 if(bNeg)
851 aText.insert(0, '-');
854 aText.append(sal_Unicode(DEGREE_CHAR));
856 if(ePres == SfxItemPresentation::Complete)
858 OUString aStr = SdrItemPool::GetItemName(Which());
859 aText.insert(0, ' ');
860 aText.insert(0, aStr);
863 rText = aText.makeStringAndClear();
864 return true;
867 SdrMetricItem* SdrMetricItem::Clone(SfxItemPool* /*pPool*/) const
869 return new SdrMetricItem(Which(),GetValue());
872 bool SdrMetricItem::HasMetrics() const
874 return true;
877 void SdrMetricItem::ScaleMetrics(tools::Long nMul, tools::Long nDiv)
879 if (GetValue()!=0) {
880 BigInt aVal(GetValue());
881 aVal*=nMul;
882 aVal+=nDiv/2; // to round accurately
883 aVal/=nDiv;
884 SetValue(tools::Long(aVal));
888 bool SdrMetricItem::GetPresentation(SfxItemPresentation ePres,
889 MapUnit eCoreMetric, MapUnit ePresMetric, OUString& rText, const IntlWrapper&) const
891 tools::Long nValue=GetValue();
892 SdrFormatter aFmt(eCoreMetric,ePresMetric);
893 rText = aFmt.GetStr(nValue);
894 rText += " " + SdrFormatter::GetUnitStr(ePresMetric);
895 if (ePres==SfxItemPresentation::Complete) {
896 rText = SdrItemPool::GetItemName(Which()) + " " + rText;
898 return true;
901 void SdrMetricItem::dumpAsXml(xmlTextWriterPtr pWriter) const
903 xmlTextWriterStartElement(pWriter, BAD_CAST("SdrMetricItem"));
904 if (Which() == SDRATTR_SHADOWXDIST)
906 xmlTextWriterWriteAttribute(pWriter, BAD_CAST("whichId"), BAD_CAST("SDRATTR_SHADOWXDIST"));
908 else if (Which() == SDRATTR_SHADOWYDIST)
910 xmlTextWriterWriteAttribute(pWriter, BAD_CAST("whichId"), BAD_CAST("SDRATTR_SHADOWYDIST"));
912 else if (Which() == SDRATTR_SHADOWSIZEX)
914 xmlTextWriterWriteAttribute(pWriter, BAD_CAST("whichId"), BAD_CAST("SDRATTR_SHADOWSIZEX"));
916 else if (Which() == SDRATTR_SHADOWSIZEY)
918 xmlTextWriterWriteAttribute(pWriter, BAD_CAST("whichId"), BAD_CAST("SDRATTR_SHADOWSIZEY"));
920 else if (Which() == SDRATTR_SHADOWBLUR)
922 xmlTextWriterWriteAttribute(pWriter, BAD_CAST("whichId"), BAD_CAST("SDRATTR_SHADOWBLUR"));
925 SfxInt32Item::dumpAsXml(pWriter);
927 xmlTextWriterEndElement(pWriter);
930 // items of the legend object
933 SdrCaptionTypeItem* SdrCaptionTypeItem::Clone(SfxItemPool* /*pPool*/) const { return new SdrCaptionTypeItem(*this); }
935 sal_uInt16 SdrCaptionTypeItem::GetValueCount() const { return 4; }
937 OUString SdrCaptionTypeItem::GetValueTextByPos(sal_uInt16 nPos)
939 static const char* ITEMVALCAPTIONTYPES[] =
941 STR_ItemValCAPTIONTYPE1,
942 STR_ItemValCAPTIONTYPE2,
943 STR_ItemValCAPTIONTYPE3,
944 STR_ItemValCAPTIONTYPE4
946 assert(nPos < SAL_N_ELEMENTS(ITEMVALCAPTIONTYPES) && "wrong pos!");
947 return SvxResId(ITEMVALCAPTIONTYPES[nPos]);
950 bool SdrCaptionTypeItem::GetPresentation(SfxItemPresentation ePres,
951 MapUnit /*eCoreMetric*/, MapUnit /*ePresMetric*/, OUString& rText, const IntlWrapper&) const
953 rText=GetValueTextByPos(sal::static_int_cast< sal_uInt16 >(GetValue()));
954 if (ePres==SfxItemPresentation::Complete) {
955 rText = SdrItemPool::GetItemName(Which()) + " " + rText;
957 return true;
961 SdrCaptionEscDirItem* SdrCaptionEscDirItem::Clone(SfxItemPool* /*pPool*/) const { return new SdrCaptionEscDirItem(*this); }
963 sal_uInt16 SdrCaptionEscDirItem::GetValueCount() const { return 3; }
965 OUString SdrCaptionEscDirItem::GetValueTextByPos(sal_uInt16 nPos)
967 static const char* ITEMVALCAPTIONTYPES[] =
969 STR_ItemValCAPTIONESCHORI,
970 STR_ItemValCAPTIONESCVERT,
971 STR_ItemValCAPTIONESCBESTFIT
973 assert(nPos < SAL_N_ELEMENTS(ITEMVALCAPTIONTYPES) && "wrong pos!");
974 return SvxResId(ITEMVALCAPTIONTYPES[nPos]);
977 bool SdrCaptionEscDirItem::GetPresentation(SfxItemPresentation ePres,
978 MapUnit /*eCoreMetric*/, MapUnit /*ePresMetric*/, OUString& rText, const IntlWrapper&) const
980 rText=GetValueTextByPos(sal::static_int_cast< sal_uInt16 >(GetValue()));
981 if (ePres==SfxItemPresentation::Complete) {
982 rText = SdrItemPool::GetItemName(Which()) + " " + rText;
984 return true;
988 // MiscItems
991 // FitToSize
993 SfxPoolItem* SdrTextFitToSizeTypeItem::CreateDefault() { return new SdrTextFitToSizeTypeItem; }
995 SdrTextFitToSizeTypeItem* SdrTextFitToSizeTypeItem::Clone(SfxItemPool* /*pPool*/) const { return new SdrTextFitToSizeTypeItem(*this); }
997 bool SdrTextFitToSizeTypeItem::operator==(const SfxPoolItem& rItem) const
999 if (!SfxEnumItem<css::drawing::TextFitToSizeType>::operator==(rItem))
1001 return false;
1004 return m_nMaxScale == static_cast<const SdrTextFitToSizeTypeItem&>(rItem).m_nMaxScale;
1007 sal_uInt16 SdrTextFitToSizeTypeItem::GetValueCount() const { return 4; }
1009 OUString SdrTextFitToSizeTypeItem::GetValueTextByPos(sal_uInt16 nPos)
1011 static const char* ITEMVALFITTISIZETYPES[] =
1013 STR_ItemValFITTOSIZENONE,
1014 STR_ItemValFITTOSIZEPROP,
1015 STR_ItemValFITTOSIZEALLLINES,
1016 STR_ItemValFITTOSIZERESIZEAT
1018 assert(nPos < SAL_N_ELEMENTS(ITEMVALFITTISIZETYPES) && "wrong pos!");
1019 return SvxResId(ITEMVALFITTISIZETYPES[nPos]);
1022 bool SdrTextFitToSizeTypeItem::GetPresentation(SfxItemPresentation ePres,
1023 MapUnit /*eCoreMetric*/, MapUnit /*ePresMetric*/, OUString& rText, const IntlWrapper&) const
1025 rText=GetValueTextByPos(sal::static_int_cast< sal_uInt16 >(GetValue()));
1026 if (ePres==SfxItemPresentation::Complete) {
1027 rText = SdrItemPool::GetItemName(Which()) + " " + rText;
1029 return true;
1032 bool SdrTextFitToSizeTypeItem::HasBoolValue() const { return true; }
1034 bool SdrTextFitToSizeTypeItem::GetBoolValue() const { return GetValue() != drawing::TextFitToSizeType_NONE; }
1036 void SdrTextFitToSizeTypeItem::SetBoolValue(bool bVal)
1038 SetValue(bVal ? drawing::TextFitToSizeType_PROPORTIONAL : drawing::TextFitToSizeType_NONE);
1041 bool SdrTextFitToSizeTypeItem::QueryValue( uno::Any& rVal, sal_uInt8 /*nMemberId*/) const
1043 drawing::TextFitToSizeType eFS = GetValue();
1044 rVal <<= eFS;
1046 return true;
1049 bool SdrTextFitToSizeTypeItem::PutValue( const uno::Any& rVal, sal_uInt8 /*nMemberId*/)
1051 drawing::TextFitToSizeType eFS;
1052 if(!(rVal >>= eFS))
1054 sal_Int32 nEnum = 0;
1055 if(!(rVal >>= nEnum))
1056 return false;
1058 eFS = static_cast<drawing::TextFitToSizeType>(nEnum);
1061 SetValue(eFS);
1063 return true;
1067 SdrTextVertAdjustItem* SdrTextVertAdjustItem::Clone(SfxItemPool* /*pPool*/) const { return new SdrTextVertAdjustItem(*this); }
1069 sal_uInt16 SdrTextVertAdjustItem::GetValueCount() const { return 5; }
1071 OUString SdrTextVertAdjustItem::GetValueTextByPos(sal_uInt16 nPos)
1073 static const char* ITEMVALTEXTVADJTYPES[] =
1075 STR_ItemValTEXTVADJTOP,
1076 STR_ItemValTEXTVADJCENTER,
1077 STR_ItemValTEXTVADJBOTTOM,
1078 STR_ItemValTEXTVADJBLOCK,
1079 STR_ItemValTEXTVADJSTRETCH
1081 assert(nPos < SAL_N_ELEMENTS(ITEMVALTEXTVADJTYPES) && "wrong pos!");
1082 return SvxResId(ITEMVALTEXTVADJTYPES[nPos]);
1085 bool SdrTextVertAdjustItem::GetPresentation(SfxItemPresentation ePres,
1086 MapUnit /*eCoreMetric*/, MapUnit /*ePresMetric*/, OUString& rText, const IntlWrapper&) const
1088 rText=GetValueTextByPos(sal::static_int_cast< sal_uInt16 >(GetValue()));
1089 if (ePres==SfxItemPresentation::Complete) {
1090 rText = SdrItemPool::GetItemName(Which()) + " " + rText;
1092 return true;
1095 bool SdrTextVertAdjustItem::QueryValue( uno::Any& rVal, sal_uInt8 /*nMemberId*/) const
1097 rVal <<= static_cast<drawing::TextVerticalAdjust>(GetValue());
1098 return true;
1101 bool SdrTextVertAdjustItem::PutValue( const uno::Any& rVal, sal_uInt8 /*nMemberId*/)
1103 drawing::TextVerticalAdjust eAdj;
1104 if(!(rVal >>= eAdj))
1106 sal_Int32 nEnum = 0;
1107 if(!(rVal >>= nEnum))
1108 return false;
1110 eAdj = static_cast<drawing::TextVerticalAdjust>(nEnum);
1113 SetValue( static_cast<SdrTextVertAdjust>(eAdj) );
1115 return true;
1118 void SdrTextVertAdjustItem::dumpAsXml(xmlTextWriterPtr pWriter) const
1120 xmlTextWriterStartElement(pWriter, BAD_CAST("SdrTextVertAdjustItem"));
1121 xmlTextWriterWriteAttribute(pWriter, BAD_CAST("whichId"), BAD_CAST(OString::number(Which()).getStr()));
1122 xmlTextWriterWriteAttribute(pWriter, BAD_CAST("value"), BAD_CAST(OString::number(GetValue()).getStr()));
1123 xmlTextWriterEndElement(pWriter);
1126 SdrTextHorzAdjustItem* SdrTextHorzAdjustItem::Clone(SfxItemPool* /*pPool*/) const { return new SdrTextHorzAdjustItem(*this); }
1128 sal_uInt16 SdrTextHorzAdjustItem::GetValueCount() const { return 5; }
1130 OUString SdrTextHorzAdjustItem::GetValueTextByPos(sal_uInt16 nPos)
1132 static const char* ITEMVALTEXTHADJTYPES[] =
1134 STR_ItemValTEXTHADJLEFT,
1135 STR_ItemValTEXTHADJCENTER,
1136 STR_ItemValTEXTHADJRIGHT,
1137 STR_ItemValTEXTHADJBLOCK,
1138 STR_ItemValTEXTHADJSTRETCH
1140 assert(nPos < SAL_N_ELEMENTS(ITEMVALTEXTHADJTYPES) && "wrong pos!");
1141 return SvxResId(ITEMVALTEXTHADJTYPES[nPos]);
1144 bool SdrTextHorzAdjustItem::GetPresentation(SfxItemPresentation ePres,
1145 MapUnit /*eCoreMetric*/, MapUnit /*ePresMetric*/, OUString& rText, const IntlWrapper&) const
1147 rText=GetValueTextByPos(sal::static_int_cast< sal_uInt16 >(GetValue()));
1148 if (ePres==SfxItemPresentation::Complete) {
1149 rText = SdrItemPool::GetItemName(Which()) + " " + rText;
1151 return true;
1154 bool SdrTextHorzAdjustItem::QueryValue( uno::Any& rVal, sal_uInt8 /*nMemberId*/) const
1156 rVal <<= static_cast<drawing::TextHorizontalAdjust>(GetValue());
1157 return true;
1160 bool SdrTextHorzAdjustItem::PutValue( const uno::Any& rVal, sal_uInt8 /*nMemberId*/)
1162 drawing::TextHorizontalAdjust eAdj;
1163 if(!(rVal >>= eAdj))
1165 sal_Int32 nEnum = 0;
1166 if(!(rVal >>= nEnum))
1167 return false;
1169 eAdj = static_cast<drawing::TextHorizontalAdjust>(nEnum);
1172 SetValue( static_cast<SdrTextHorzAdjust>(eAdj) );
1174 return true;
1178 SdrTextAniKindItem* SdrTextAniKindItem::Clone(SfxItemPool* /*pPool*/) const { return new SdrTextAniKindItem(*this); }
1180 sal_uInt16 SdrTextAniKindItem::GetValueCount() const { return 5; }
1182 OUString SdrTextAniKindItem::GetValueTextByPos(sal_uInt16 nPos)
1184 static const char* ITEMVALTEXTANITYPES[] =
1186 STR_ItemValTEXTANI_NONE,
1187 STR_ItemValTEXTANI_BLINK,
1188 STR_ItemValTEXTANI_SCROLL,
1189 STR_ItemValTEXTANI_ALTERNATE,
1190 STR_ItemValTEXTANI_SLIDE
1192 assert(nPos < SAL_N_ELEMENTS(ITEMVALTEXTANITYPES) && "wrong pos!");
1193 return SvxResId(ITEMVALTEXTANITYPES[nPos]);
1196 bool SdrTextAniKindItem::GetPresentation(SfxItemPresentation ePres,
1197 MapUnit /*eCoreMetric*/, MapUnit /*ePresMetric*/, OUString& rText, const IntlWrapper&) const
1199 rText=GetValueTextByPos(sal::static_int_cast< sal_uInt16 >(GetValue()));
1200 if (ePres==SfxItemPresentation::Complete) {
1201 rText = SdrItemPool::GetItemName(Which()) + " " + rText;
1203 return true;
1206 bool SdrTextAniKindItem::QueryValue( uno::Any& rVal, sal_uInt8 /*nMemberId*/) const
1208 rVal <<= static_cast<drawing::TextAnimationKind>(GetValue());
1209 return true;
1212 bool SdrTextAniKindItem::PutValue( const uno::Any& rVal, sal_uInt8 /*nMemberId*/)
1214 drawing::TextAnimationKind eKind;
1215 if(!(rVal >>= eKind))
1217 sal_Int32 nEnum = 0;
1218 if(!(rVal >>= nEnum))
1219 return false;
1220 eKind = static_cast<drawing::TextAnimationKind>(nEnum);
1223 SetValue( static_cast<SdrTextAniKind>(eKind) );
1225 return true;
1229 SdrTextAniDirectionItem* SdrTextAniDirectionItem::Clone(SfxItemPool* /*pPool*/) const { return new SdrTextAniDirectionItem(*this); }
1231 sal_uInt16 SdrTextAniDirectionItem::GetValueCount() const { return 4; }
1233 OUString SdrTextAniDirectionItem::GetValueTextByPos(sal_uInt16 nPos)
1235 static const char* ITEMVALTEXTANITYPES[] =
1237 STR_ItemValTEXTANI_LEFT,
1238 STR_ItemValTEXTANI_UP,
1239 STR_ItemValTEXTANI_RIGHT,
1240 STR_ItemValTEXTANI_DOWN
1242 assert(nPos < SAL_N_ELEMENTS(ITEMVALTEXTANITYPES) && "wrong pos!");
1243 return SvxResId(ITEMVALTEXTANITYPES[nPos]);
1246 bool SdrTextAniDirectionItem::GetPresentation(SfxItemPresentation ePres,
1247 MapUnit /*eCoreMetric*/, MapUnit /*ePresMetric*/, OUString& rText, const IntlWrapper&) const
1249 rText=GetValueTextByPos(sal::static_int_cast< sal_uInt16 >(GetValue()));
1250 if (ePres==SfxItemPresentation::Complete) {
1251 rText = SdrItemPool::GetItemName(Which()) + " " + rText;
1253 return true;
1256 bool SdrTextAniDirectionItem::QueryValue( uno::Any& rVal, sal_uInt8 /*nMemberId*/) const
1258 rVal <<= static_cast<drawing::TextAnimationDirection>(GetValue());
1259 return true;
1262 bool SdrTextAniDirectionItem::PutValue( const uno::Any& rVal, sal_uInt8 /*nMemberId*/)
1264 drawing::TextAnimationDirection eDir;
1265 if(!(rVal >>= eDir))
1267 sal_Int32 nEnum = 0;
1268 if(!(rVal >>= nEnum))
1269 return false;
1271 eDir = static_cast<drawing::TextAnimationDirection>(nEnum);
1274 SetValue( static_cast<SdrTextAniDirection>(eDir) );
1276 return true;
1280 SdrTextAniDelayItem* SdrTextAniDelayItem::Clone(SfxItemPool* /*pPool*/) const { return new SdrTextAniDelayItem(*this); }
1282 bool SdrTextAniDelayItem::GetPresentation(
1283 SfxItemPresentation ePres, MapUnit /*eCoreMetric*/, MapUnit /*ePresMetric*/,
1284 OUString& rText, const IntlWrapper&) const
1286 rText = OUString::number(GetValue()) + "ms";
1288 if(ePres == SfxItemPresentation::Complete)
1290 rText = SdrItemPool::GetItemName(Which()) + " " + rText;
1293 return true;
1297 SdrTextAniAmountItem* SdrTextAniAmountItem::Clone(SfxItemPool* /*pPool*/) const { return new SdrTextAniAmountItem(*this); }
1299 bool SdrTextAniAmountItem::HasMetrics() const
1301 return GetValue()>0;
1304 void SdrTextAniAmountItem::ScaleMetrics(tools::Long nMul, tools::Long nDiv)
1306 if (GetValue()>0) {
1307 BigInt aVal(GetValue());
1308 aVal*=nMul;
1309 aVal+=nDiv/2; // to round accurately
1310 aVal/=nDiv;
1311 SetValue(short(aVal));
1315 bool SdrTextAniAmountItem::GetPresentation(
1316 SfxItemPresentation ePres, MapUnit eCoreMetric, MapUnit ePresMetric,
1317 OUString& rText, const IntlWrapper&) const
1319 sal_Int32 nValue(GetValue());
1321 if(!nValue)
1322 nValue = -1;
1324 if(nValue < 0)
1326 rText = OUString::number(-nValue) + "pixel";
1328 else
1330 SdrFormatter aFmt(eCoreMetric, ePresMetric);
1331 rText = aFmt.GetStr(nValue) +
1332 SdrFormatter::GetUnitStr(ePresMetric);
1335 if(ePres == SfxItemPresentation::Complete)
1337 rText = SdrItemPool::GetItemName(Which()) + " " + rText;
1340 return true;
1344 SdrTextFixedCellHeightItem::SdrTextFixedCellHeightItem( bool bUseFixedCellHeight )
1345 : SfxBoolItem( SDRATTR_TEXT_USEFIXEDCELLHEIGHT, bUseFixedCellHeight )
1348 bool SdrTextFixedCellHeightItem::GetPresentation( SfxItemPresentation ePres,
1349 MapUnit /*eCoreMetric*/, MapUnit /*ePresentationMetric*/,
1350 OUString &rText, const IntlWrapper& ) const
1352 rText = GetValueTextByVal( GetValue() );
1353 if (ePres==SfxItemPresentation::Complete)
1355 rText = SdrItemPool::GetItemName(Which()) + " " + rText;
1357 return true;
1360 SdrTextFixedCellHeightItem* SdrTextFixedCellHeightItem::Clone( SfxItemPool * /*pPool*/) const
1362 return new SdrTextFixedCellHeightItem( GetValue() );
1365 bool SdrTextFixedCellHeightItem::QueryValue( uno::Any& rVal, sal_uInt8 /*nMemberId*/) const
1367 bool bValue = GetValue();
1368 rVal <<= bValue;
1369 return true;
1371 bool SdrTextFixedCellHeightItem::PutValue( const uno::Any& rVal, sal_uInt8 /*nMemberId*/)
1373 bool bValue;
1374 if( !( rVal >>= bValue ) )
1375 return false;
1376 SetValue( bValue );
1377 return true;
1380 // EdgeKind
1382 SdrEdgeKindItem* SdrEdgeKindItem::Clone(SfxItemPool* /*pPool*/) const { return new SdrEdgeKindItem(*this); }
1384 sal_uInt16 SdrEdgeKindItem::GetValueCount() const { return 4; }
1386 OUString SdrEdgeKindItem::GetValueTextByPos(sal_uInt16 nPos)
1388 static const char* ITEMVALEDGES[] =
1390 STR_ItemValEDGE_ORTHOLINES,
1391 STR_ItemValEDGE_THREELINES,
1392 STR_ItemValEDGE_ONELINE,
1393 STR_ItemValEDGE_BEZIER
1395 assert(nPos < SAL_N_ELEMENTS(ITEMVALEDGES) && "wrong pos!");
1396 return SvxResId(ITEMVALEDGES[nPos]);
1399 bool SdrEdgeKindItem::GetPresentation(SfxItemPresentation ePres,
1400 MapUnit /*eCoreMetric*/, MapUnit /*ePresMetric*/, OUString& rText, const IntlWrapper&) const
1402 rText=GetValueTextByPos(sal::static_int_cast< sal_uInt16 >(GetValue()));
1403 if (ePres==SfxItemPresentation::Complete) {
1404 rText = SdrItemPool::GetItemName(Which()) + " " + rText;
1406 return true;
1409 bool SdrEdgeKindItem::QueryValue( uno::Any& rVal, sal_uInt8 /*nMemberId*/) const
1411 drawing::ConnectorType eCT = drawing::ConnectorType_STANDARD;
1413 switch( GetValue() )
1415 case SdrEdgeKind::OrthoLines : eCT = drawing::ConnectorType_STANDARD; break;
1416 case SdrEdgeKind::ThreeLines : eCT = drawing::ConnectorType_LINES; break;
1417 case SdrEdgeKind::OneLine : eCT = drawing::ConnectorType_LINE; break;
1418 case SdrEdgeKind::Bezier : eCT = drawing::ConnectorType_CURVE; break;
1419 case SdrEdgeKind::Arc : eCT = drawing::ConnectorType_CURVE; break;
1420 default:
1421 OSL_FAIL( "SdrEdgeKindItem::QueryValue : unknown enum" );
1424 rVal <<= eCT;
1426 return true;
1429 bool SdrEdgeKindItem::PutValue( const uno::Any& rVal, sal_uInt8 /*nMemberId*/)
1431 drawing::ConnectorType eCT;
1432 if(!(rVal >>= eCT))
1434 sal_Int32 nEnum = 0;
1435 if(!(rVal >>= nEnum))
1436 return false;
1438 eCT = static_cast<drawing::ConnectorType>(nEnum);
1441 SdrEdgeKind eEK = SdrEdgeKind::OrthoLines;
1442 switch( eCT )
1444 case drawing::ConnectorType_STANDARD : eEK = SdrEdgeKind::OrthoLines; break;
1445 case drawing::ConnectorType_CURVE : eEK = SdrEdgeKind::Bezier; break;
1446 case drawing::ConnectorType_LINE : eEK = SdrEdgeKind::OneLine; break;
1447 case drawing::ConnectorType_LINES : eEK = SdrEdgeKind::ThreeLines; break;
1448 default:
1449 OSL_FAIL( "SdrEdgeKindItem::PuValue : unknown enum" );
1451 SetValue( eEK );
1453 return true;
1456 bool SdrEdgeNode1HorzDistItem::QueryValue( uno::Any& rVal, sal_uInt8 /*nMemberId*/) const
1458 rVal <<= GetValue();
1459 return true;
1462 bool SdrEdgeNode1HorzDistItem::PutValue( const uno::Any& rVal, sal_uInt8 /*nMemberId*/)
1464 sal_Int32 nValue = 0;
1465 if(!(rVal >>= nValue))
1466 return false;
1468 SetValue( nValue );
1469 return true;
1472 SdrEdgeNode1HorzDistItem* SdrEdgeNode1HorzDistItem::Clone(SfxItemPool* /*pPool*/) const
1474 return new SdrEdgeNode1HorzDistItem(*this);
1477 bool SdrEdgeNode1VertDistItem::QueryValue( uno::Any& rVal, sal_uInt8 /*nMemberId*/) const
1479 rVal <<= GetValue();
1480 return true;
1483 bool SdrEdgeNode1VertDistItem::PutValue( const uno::Any& rVal, sal_uInt8 /*nMemberId*/)
1485 sal_Int32 nValue = 0;
1486 if(!(rVal >>= nValue))
1487 return false;
1489 SetValue( nValue );
1490 return true;
1493 SdrEdgeNode1VertDistItem* SdrEdgeNode1VertDistItem::Clone(SfxItemPool* /*pPool*/) const
1495 return new SdrEdgeNode1VertDistItem(*this);
1498 bool SdrEdgeNode2HorzDistItem::QueryValue( uno::Any& rVal, sal_uInt8 /*nMemberId*/) const
1500 rVal <<= GetValue();
1501 return true;
1504 bool SdrEdgeNode2HorzDistItem::PutValue( const uno::Any& rVal, sal_uInt8 /*nMemberId*/)
1506 sal_Int32 nValue = 0;
1507 if(!(rVal >>= nValue))
1508 return false;
1510 SetValue( nValue );
1511 return true;
1514 SdrEdgeNode2HorzDistItem* SdrEdgeNode2HorzDistItem::Clone(SfxItemPool* /*pPool*/) const
1516 return new SdrEdgeNode2HorzDistItem(*this);
1519 bool SdrEdgeNode2VertDistItem::QueryValue( uno::Any& rVal, sal_uInt8 /*nMemberId*/) const
1521 rVal <<= GetValue();
1522 return true;
1525 bool SdrEdgeNode2VertDistItem::PutValue( const uno::Any& rVal, sal_uInt8 /*nMemberId*/)
1527 sal_Int32 nValue = 0;
1528 if(!(rVal >>= nValue))
1529 return false;
1531 SetValue( nValue );
1532 return true;
1535 SdrEdgeNode2VertDistItem* SdrEdgeNode2VertDistItem::Clone(SfxItemPool* /*pPool*/) const
1537 return new SdrEdgeNode2VertDistItem(*this);
1540 SdrEdgeNode1GlueDistItem* SdrEdgeNode1GlueDistItem::Clone(SfxItemPool* /*pPool*/) const
1542 return new SdrEdgeNode1GlueDistItem(*this);
1545 SdrEdgeNode2GlueDistItem* SdrEdgeNode2GlueDistItem::Clone(SfxItemPool* /*pPool*/) const
1547 return new SdrEdgeNode2GlueDistItem(*this);
1550 SdrMeasureKindItem* SdrMeasureKindItem::Clone(SfxItemPool* /*pPool*/) const { return new SdrMeasureKindItem(*this); }
1552 sal_uInt16 SdrMeasureKindItem::GetValueCount() const { return 2; }
1554 OUString SdrMeasureKindItem::GetValueTextByPos(sal_uInt16 nPos)
1556 static const char* ITEMVALMEASURETYPES[] =
1558 STR_ItemValMEASURE_STD,
1559 STR_ItemValMEASURE_RADIUS
1561 assert(nPos < SAL_N_ELEMENTS(ITEMVALMEASURETYPES) && "wrong pos!");
1562 return SvxResId(ITEMVALMEASURETYPES[nPos]);
1565 bool SdrMeasureKindItem::GetPresentation(SfxItemPresentation ePres,
1566 MapUnit /*eCoreMetric*/, MapUnit /*ePresMetric*/, OUString& rText, const IntlWrapper&) const
1568 rText=GetValueTextByPos(sal::static_int_cast< sal_uInt16 >(GetValue()));
1569 if (ePres==SfxItemPresentation::Complete) {
1570 rText = SdrItemPool::GetItemName(Which()) + " " + rText;
1572 return true;
1575 bool SdrMeasureKindItem::QueryValue( uno::Any& rVal, sal_uInt8 /*nMemberId*/) const
1577 rVal <<= static_cast<drawing::MeasureKind>(GetValue());
1578 return true;
1581 bool SdrMeasureKindItem::PutValue( const uno::Any& rVal, sal_uInt8 /*nMemberId*/)
1583 drawing::MeasureKind eKind;
1584 if(!(rVal >>= eKind))
1586 sal_Int32 nEnum = 0;
1587 if(!(rVal >>= nEnum))
1588 return false;
1590 eKind = static_cast<drawing::MeasureKind>(nEnum);
1593 SetValue( static_cast<SdrMeasureKind>(eKind) );
1594 return true;
1598 SdrMeasureTextHPosItem* SdrMeasureTextHPosItem::Clone(SfxItemPool* /*pPool*/) const { return new SdrMeasureTextHPosItem(*this); }
1600 sal_uInt16 SdrMeasureTextHPosItem::GetValueCount() const { return 4; }
1602 OUString SdrMeasureTextHPosItem::GetValueTextByPos(sal_uInt16 nPos)
1604 static const char* ITEMVALMEASURETEXTTYPES[] =
1606 STR_ItemValMEASURE_TEXTHAUTO,
1607 STR_ItemValMEASURE_TEXTLEFTOUTSIDE,
1608 STR_ItemValMEASURE_TEXTINSIDE,
1609 STR_ItemValMEASURE_TEXTRIGHTOUTSID
1611 assert(nPos < SAL_N_ELEMENTS(ITEMVALMEASURETEXTTYPES) && "wrong pos!");
1612 return SvxResId(ITEMVALMEASURETEXTTYPES[nPos]);
1615 bool SdrMeasureTextHPosItem::GetPresentation(SfxItemPresentation ePres,
1616 MapUnit /*eCoreMetric*/, MapUnit /*ePresMetric*/, OUString& rText, const IntlWrapper&) const
1618 rText=GetValueTextByPos(sal::static_int_cast< sal_uInt16 >(GetValue()));
1619 if (ePres==SfxItemPresentation::Complete) {
1620 rText = SdrItemPool::GetItemName(Which()) + " " + rText;
1622 return true;
1625 bool SdrMeasureTextHPosItem::QueryValue( uno::Any& rVal, sal_uInt8 /*nMemberId*/) const
1627 rVal <<= GetValue();
1628 return true;
1631 bool SdrMeasureTextHPosItem::PutValue( const uno::Any& rVal, sal_uInt8 /*nMemberId*/)
1633 drawing::MeasureTextHorzPos ePos;
1634 if(!(rVal >>= ePos))
1636 sal_Int32 nEnum = 0;
1637 if(!(rVal >>= nEnum))
1638 return false;
1640 ePos = static_cast<drawing::MeasureTextHorzPos>(nEnum);
1643 SetValue(ePos);
1644 return true;
1647 SdrMeasureTextVPosItem* SdrMeasureTextVPosItem::Clone(SfxItemPool* /*pPool*/) const { return new SdrMeasureTextVPosItem(*this); }
1649 sal_uInt16 SdrMeasureTextVPosItem::GetValueCount() const { return 5; }
1651 OUString SdrMeasureTextVPosItem::GetValueTextByPos(sal_uInt16 nPos)
1653 static const char* ITEMVALMEASURETEXTTYPES[] =
1655 STR_ItemValMEASURE_TEXTVAUTO,
1656 STR_ItemValMEASURE_ABOVE,
1657 STR_ItemValMEASURETEXT_BREAKEDLINE,
1658 STR_ItemValMEASURE_BELOW,
1659 STR_ItemValMEASURETEXT_VERTICALCEN
1661 assert(nPos < SAL_N_ELEMENTS(ITEMVALMEASURETEXTTYPES) && "wrong pos!");
1662 return SvxResId(ITEMVALMEASURETEXTTYPES[nPos]);
1665 bool SdrMeasureTextVPosItem::GetPresentation(SfxItemPresentation ePres,
1666 MapUnit /*eCoreMetric*/, MapUnit /*ePresMetric*/, OUString& rText, const IntlWrapper&) const
1668 rText=GetValueTextByPos(sal::static_int_cast< sal_uInt16 >(GetValue()));
1669 if (ePres==SfxItemPresentation::Complete) {
1670 rText = SdrItemPool::GetItemName(Which()) + " " + rText;
1672 return true;
1675 bool SdrMeasureTextVPosItem::QueryValue( uno::Any& rVal, sal_uInt8 /*nMemberId*/) const
1677 rVal <<= GetValue();
1678 return true;
1681 bool SdrMeasureTextVPosItem::PutValue( const uno::Any& rVal, sal_uInt8 /*nMemberId*/)
1683 drawing::MeasureTextVertPos ePos;
1684 if(!(rVal >>= ePos))
1686 sal_Int32 nEnum = 0;
1687 if(!(rVal >>= nEnum))
1688 return false;
1690 ePos = static_cast<drawing::MeasureTextVertPos>(nEnum);
1693 SetValue(ePos);
1694 return true;
1697 SdrMeasureUnitItem* SdrMeasureUnitItem::Clone(SfxItemPool* /*pPool*/) const { return new SdrMeasureUnitItem(*this); }
1699 sal_uInt16 SdrMeasureUnitItem::GetValueCount() const { return 14; }
1701 OUString SdrMeasureUnitItem::GetValueTextByPos(sal_uInt16 nPos)
1703 if(static_cast<FieldUnit>(nPos) == FieldUnit::NONE)
1704 return "default";
1705 else
1706 return SdrFormatter::GetUnitStr(static_cast<FieldUnit>(nPos));
1709 bool SdrMeasureUnitItem::GetPresentation(SfxItemPresentation ePres,
1710 MapUnit /*eCoreMetric*/, MapUnit /*ePresMetric*/, OUString& rText, const IntlWrapper&) const
1712 rText=GetValueTextByPos(sal::static_int_cast< sal_uInt16 >(GetValue()));
1713 if (ePres==SfxItemPresentation::Complete) {
1714 rText = SdrItemPool::GetItemName(Which()) + " " + rText;
1716 return true;
1719 bool SdrMeasureUnitItem::QueryValue( uno::Any& rVal, sal_uInt8 /*nMemberId*/) const
1721 rVal <<= static_cast<sal_Int32>(GetValue());
1722 return true;
1725 bool SdrMeasureUnitItem::PutValue( const uno::Any& rVal, sal_uInt8 /*nMemberId*/)
1727 sal_Int32 nMeasure = 0;
1728 if(!(rVal >>= nMeasure))
1729 return false;
1731 SetValue( static_cast<FieldUnit>(nMeasure) );
1732 return true;
1736 SdrCircKindItem* SdrCircKindItem::Clone(SfxItemPool* /*pPool*/) const { return new SdrCircKindItem(*this); }
1738 sal_uInt16 SdrCircKindItem::GetValueCount() const { return 4; }
1740 OUString SdrCircKindItem::GetValueTextByPos(sal_uInt16 nPos)
1742 static const char* ITEMVALCIRCTYPES[] =
1744 STR_ItemValCIRC_FULL,
1745 STR_ItemValCIRC_SECT,
1746 STR_ItemValCIRC_CUT,
1747 STR_ItemValCIRC_ARC
1749 assert(nPos < SAL_N_ELEMENTS(ITEMVALCIRCTYPES) && "wrong pos!");
1750 return SvxResId(ITEMVALCIRCTYPES[nPos]);
1753 bool SdrCircKindItem::GetPresentation(SfxItemPresentation ePres,
1754 MapUnit /*eCoreMetric*/, MapUnit /*ePresMetric*/, OUString& rText, const IntlWrapper&) const
1756 rText=GetValueTextByPos(sal::static_int_cast< sal_uInt16 >(GetValue()));
1757 if (ePres==SfxItemPresentation::Complete) {
1758 rText = SdrItemPool::GetItemName(Which()) + " " + rText;
1760 return true;
1763 bool SdrCircKindItem::QueryValue( uno::Any& rVal, sal_uInt8 /*nMemberId*/) const
1765 rVal <<= static_cast<drawing::CircleKind>(GetValue());
1766 return true;
1769 bool SdrCircKindItem::PutValue( const uno::Any& rVal, sal_uInt8 /*nMemberId*/)
1771 drawing::CircleKind eKind;
1772 if(!(rVal >>= eKind))
1774 sal_Int32 nEnum = 0;
1775 if(!(rVal >>= nEnum))
1776 return false;
1778 eKind = static_cast<drawing::CircleKind>(nEnum);
1781 SetValue( static_cast<SdrCircKind>(eKind) );
1782 return true;
1785 SdrSignedPercentItem* SdrSignedPercentItem::Clone(SfxItemPool* /*pPool*/) const
1787 return new SdrSignedPercentItem( Which(), GetValue() );
1790 bool SdrSignedPercentItem::GetPresentation(
1791 SfxItemPresentation ePres, MapUnit /*eCoreMetric*/, MapUnit /*ePresMetric*/,
1792 OUString& rText, const IntlWrapper&) const
1794 rText = unicode::formatPercent(GetValue(),
1795 Application::GetSettings().GetUILanguageTag());
1797 if(ePres == SfxItemPresentation::Complete)
1799 rText = SdrItemPool::GetItemName(Which()) + " " + rText;
1802 return true;
1805 SdrGrafRedItem* SdrGrafRedItem::Clone( SfxItemPool* /*pPool*/) const
1807 return new SdrGrafRedItem( *this );
1810 SdrGrafGreenItem* SdrGrafGreenItem::Clone( SfxItemPool* /*pPool*/) const
1812 return new SdrGrafGreenItem( *this );
1815 SdrGrafBlueItem* SdrGrafBlueItem::Clone( SfxItemPool* /*pPool*/) const
1817 return new SdrGrafBlueItem( *this );
1820 SdrGrafLuminanceItem* SdrGrafLuminanceItem::Clone( SfxItemPool* /*pPool*/) const
1822 return new SdrGrafLuminanceItem( *this );
1825 SdrGrafContrastItem* SdrGrafContrastItem::Clone( SfxItemPool* /*pPool*/) const
1827 return new SdrGrafContrastItem( *this );
1830 SdrGrafGamma100Item* SdrGrafGamma100Item::Clone( SfxItemPool* /*pPool */) const
1832 return new SdrGrafGamma100Item( *this );
1835 bool SdrGrafGamma100Item::QueryValue( uno::Any& rVal, sal_uInt8 /*nMemberId*/) const
1837 rVal <<= static_cast<double>(GetValue()) / 100.0;
1838 return true;
1841 bool SdrGrafGamma100Item::PutValue( const uno::Any& rVal, sal_uInt8 /*nMemberId*/)
1843 double nGamma = 0;
1844 if(!(rVal >>= nGamma))
1845 return false;
1847 SetValue( static_cast<sal_uInt32>(nGamma * 100.0 ) );
1848 return true;
1851 SdrGrafInvertItem* SdrGrafInvertItem::Clone( SfxItemPool* /*pPool*/) const
1853 return new SdrGrafInvertItem( *this );
1856 SdrGrafTransparenceItem* SdrGrafTransparenceItem::Clone( SfxItemPool* /*pPool*/) const
1858 return new SdrGrafTransparenceItem( *this );
1861 SdrGrafModeItem* SdrGrafModeItem::Clone(SfxItemPool* /*pPool*/) const
1863 return new SdrGrafModeItem( *this );
1866 sal_uInt16 SdrGrafModeItem::GetValueCount() const
1868 return 4;
1871 OUString SdrGrafModeItem::GetValueTextByPos(sal_uInt16 nPos)
1873 OUString aStr;
1875 switch(nPos)
1877 case 1:
1879 aStr = "Greys";
1880 break;
1882 case 2:
1884 aStr = "Black/White";
1885 break;
1887 case 3:
1889 aStr = "Watermark";
1890 break;
1892 default:
1894 aStr = "Standard";
1895 break;
1899 return aStr;
1902 bool SdrGrafModeItem::GetPresentation( SfxItemPresentation ePres,
1903 MapUnit /*eCoreMetric*/, MapUnit /*ePresMetric*/,
1904 OUString& rText, const IntlWrapper&) const
1906 rText = GetValueTextByPos( sal::static_int_cast< sal_uInt16 >( GetValue() ) );
1908 if( ePres == SfxItemPresentation::Complete )
1910 rText = SdrItemPool::GetItemName( Which() ) + " " + rText;
1913 return true;
1916 SdrGrafCropItem* SdrGrafCropItem::Clone( SfxItemPool* /*pPool*/) const
1918 return new SdrGrafCropItem( *this );
1921 SdrTextAniStartInsideItem::~SdrTextAniStartInsideItem()
1925 SdrTextAniStartInsideItem* SdrTextAniStartInsideItem::Clone(SfxItemPool* ) const
1927 return new SdrTextAniStartInsideItem(*this);
1930 SdrTextAniStopInsideItem::~SdrTextAniStopInsideItem()
1934 SdrTextAniStopInsideItem* SdrTextAniStopInsideItem::Clone(SfxItemPool* ) const
1936 return new SdrTextAniStopInsideItem(*this);
1939 SdrCaptionEscIsRelItem::~SdrCaptionEscIsRelItem()
1943 SdrCaptionEscIsRelItem* SdrCaptionEscIsRelItem::Clone(SfxItemPool* ) const
1945 return new SdrCaptionEscIsRelItem(*this);
1948 SdrCaptionEscRelItem::~SdrCaptionEscRelItem()
1952 SdrCaptionEscRelItem* SdrCaptionEscRelItem::Clone(SfxItemPool*) const
1954 return new SdrCaptionEscRelItem(*this);
1957 SdrCaptionFitLineLenItem::~SdrCaptionFitLineLenItem()
1961 SdrCaptionFitLineLenItem* SdrCaptionFitLineLenItem::Clone(SfxItemPool* ) const
1963 return new SdrCaptionFitLineLenItem(*this);
1966 SdrCaptionLineLenItem::~SdrCaptionLineLenItem()
1970 SdrCaptionLineLenItem* SdrCaptionLineLenItem::Clone(SfxItemPool*) const
1972 return new SdrCaptionLineLenItem(*this);
1975 SdrMeasureBelowRefEdgeItem::~SdrMeasureBelowRefEdgeItem()
1979 SdrMeasureBelowRefEdgeItem* SdrMeasureBelowRefEdgeItem::Clone(SfxItemPool* ) const
1981 return new SdrMeasureBelowRefEdgeItem(*this);
1984 SdrMeasureTextIsFixedAngleItem::~SdrMeasureTextIsFixedAngleItem()
1988 SdrMeasureTextIsFixedAngleItem* SdrMeasureTextIsFixedAngleItem::Clone(SfxItemPool* ) const
1990 return new SdrMeasureTextIsFixedAngleItem(*this);
1993 SdrMeasureTextFixedAngleItem::~SdrMeasureTextFixedAngleItem()
1997 SdrMeasureTextFixedAngleItem* SdrMeasureTextFixedAngleItem::Clone(SfxItemPool* ) const
1999 return new SdrMeasureTextFixedAngleItem(*this);
2002 SdrMeasureDecimalPlacesItem::~SdrMeasureDecimalPlacesItem()
2006 SdrMeasureDecimalPlacesItem* SdrMeasureDecimalPlacesItem::Clone(SfxItemPool* ) const
2008 return new SdrMeasureDecimalPlacesItem(*this);
2011 SdrMeasureTextRota90Item::~SdrMeasureTextRota90Item()
2015 SdrMeasureTextRota90Item* SdrMeasureTextRota90Item::Clone(SfxItemPool* ) const
2017 return new SdrMeasureTextRota90Item(*this);
2020 SdrMeasureTextUpsideDownItem::~SdrMeasureTextUpsideDownItem()
2024 SdrMeasureTextUpsideDownItem* SdrMeasureTextUpsideDownItem::Clone(SfxItemPool* ) const
2026 return new SdrMeasureTextUpsideDownItem(*this);
2029 SdrLayerIdItem* SdrLayerIdItem::Clone(SfxItemPool* /*pPool*/) const
2031 return new SdrLayerIdItem(*this);
2034 SdrLayerNameItem* SdrLayerNameItem::Clone(SfxItemPool* /*pPool*/) const
2036 return new SdrLayerNameItem(*this);
2039 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */