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