1*cdf0e10cSrcweir /************************************************************************* 2*cdf0e10cSrcweir * 3*cdf0e10cSrcweir * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 4*cdf0e10cSrcweir * 5*cdf0e10cSrcweir * Copyright 2000, 2010 Oracle and/or its affiliates. 6*cdf0e10cSrcweir * 7*cdf0e10cSrcweir * OpenOffice.org - a multi-platform office productivity suite 8*cdf0e10cSrcweir * 9*cdf0e10cSrcweir * This file is part of OpenOffice.org. 10*cdf0e10cSrcweir * 11*cdf0e10cSrcweir * OpenOffice.org is free software: you can redistribute it and/or modify 12*cdf0e10cSrcweir * it under the terms of the GNU Lesser General Public License version 3 13*cdf0e10cSrcweir * only, as published by the Free Software Foundation. 14*cdf0e10cSrcweir * 15*cdf0e10cSrcweir * OpenOffice.org is distributed in the hope that it will be useful, 16*cdf0e10cSrcweir * but WITHOUT ANY WARRANTY; without even the implied warranty of 17*cdf0e10cSrcweir * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 18*cdf0e10cSrcweir * GNU Lesser General Public License version 3 for more details 19*cdf0e10cSrcweir * (a copy is included in the LICENSE file that accompanied this code). 20*cdf0e10cSrcweir * 21*cdf0e10cSrcweir * You should have received a copy of the GNU Lesser General Public License 22*cdf0e10cSrcweir * version 3 along with OpenOffice.org. If not, see 23*cdf0e10cSrcweir * <http://www.openoffice.org/license.html> 24*cdf0e10cSrcweir * for a copy of the LGPLv3 License. 25*cdf0e10cSrcweir * 26*cdf0e10cSrcweir ************************************************************************/ 27*cdf0e10cSrcweir 28*cdf0e10cSrcweir // MARKER(update_precomp.py): autogen include statement, do not remove 29*cdf0e10cSrcweir #include "precompiled_svx.hxx" 30*cdf0e10cSrcweir 31*cdf0e10cSrcweir // include --------------------------------------------------------------- 32*cdf0e10cSrcweir #include <com/sun/star/drawing/PolyPolygonBezierCoords.hpp> 33*cdf0e10cSrcweir #include <com/sun/star/drawing/Hatch.hpp> 34*cdf0e10cSrcweir #include <com/sun/star/drawing/LineStyle.hpp> 35*cdf0e10cSrcweir #include <com/sun/star/drawing/LineDash.hpp> 36*cdf0e10cSrcweir #include <com/sun/star/drawing/DashStyle.hpp> 37*cdf0e10cSrcweir #include <com/sun/star/awt/Point.hpp> 38*cdf0e10cSrcweir #include <com/sun/star/drawing/PointSequence.hpp> 39*cdf0e10cSrcweir #include <com/sun/star/drawing/FillStyle.hpp> 40*cdf0e10cSrcweir #include <com/sun/star/awt/Gradient.hpp> 41*cdf0e10cSrcweir #include <com/sun/star/uno/Sequence.hxx> 42*cdf0e10cSrcweir #include <com/sun/star/beans/PropertyValue.hpp> 43*cdf0e10cSrcweir #include <svl/itempool.hxx> 44*cdf0e10cSrcweir #include <editeng/memberids.hrc> 45*cdf0e10cSrcweir #include <tools/stream.hxx> 46*cdf0e10cSrcweir 47*cdf0e10cSrcweir #include "svx/unoapi.hxx" 48*cdf0e10cSrcweir #include <svl/style.hxx> 49*cdf0e10cSrcweir #include "unopolyhelper.hxx" 50*cdf0e10cSrcweir 51*cdf0e10cSrcweir #include <tools/bigint.hxx> 52*cdf0e10cSrcweir #include <svl/itemset.hxx> 53*cdf0e10cSrcweir #include <svx/dialogs.hrc> 54*cdf0e10cSrcweir #include "svx/svdstr.hrc" 55*cdf0e10cSrcweir #include "svx/xattr.hxx" 56*cdf0e10cSrcweir #include <svx/xtable.hxx> 57*cdf0e10cSrcweir #include <svx/dialmgr.hxx> 58*cdf0e10cSrcweir #include <editeng/itemtype.hxx> 59*cdf0e10cSrcweir #include <svx/xdef.hxx> 60*cdf0e10cSrcweir #include <svx/unomid.hxx> 61*cdf0e10cSrcweir #include <svx/svdmodel.hxx> 62*cdf0e10cSrcweir #include <basegfx/polygon/b2dpolygon.hxx> 63*cdf0e10cSrcweir #include <basegfx/point/b2dpoint.hxx> 64*cdf0e10cSrcweir #include <basegfx/vector/b2dvector.hxx> 65*cdf0e10cSrcweir 66*cdf0e10cSrcweir #include <stdio.h> 67*cdf0e10cSrcweir 68*cdf0e10cSrcweir using namespace ::rtl; 69*cdf0e10cSrcweir using namespace ::com::sun::star; 70*cdf0e10cSrcweir 71*cdf0e10cSrcweir #define GLOBALOVERFLOW 72*cdf0e10cSrcweir 73*cdf0e10cSrcweir #define TWIP_TO_MM100(TWIP) ((TWIP) >= 0 ? (((TWIP)*127L+36L)/72L) : (((TWIP)*127L-36L)/72L)) 74*cdf0e10cSrcweir #define MM100_TO_TWIP(MM100) ((MM100) >= 0 ? (((MM100)*72L+63L)/127L) : (((MM100)*72L-63L)/127L)) 75*cdf0e10cSrcweir 76*cdf0e10cSrcweir /************************************************************************/ 77*cdf0e10cSrcweir 78*cdf0e10cSrcweir #define VCLTOSVCOL( rCol ) (sal_uInt16)((((sal_uInt16)(rCol))<<8)|(rCol)) 79*cdf0e10cSrcweir 80*cdf0e10cSrcweir /************************************************************************/ 81*cdf0e10cSrcweir 82*cdf0e10cSrcweir XubString aNameOrIndexEmptyString; 83*cdf0e10cSrcweir 84*cdf0e10cSrcweir TYPEINIT1_AUTOFACTORY(NameOrIndex, SfxStringItem); 85*cdf0e10cSrcweir 86*cdf0e10cSrcweir /************************************************************************* 87*cdf0e10cSrcweir |* 88*cdf0e10cSrcweir |* 89*cdf0e10cSrcweir |* 90*cdf0e10cSrcweir \*************************************************************************/ 91*cdf0e10cSrcweir 92*cdf0e10cSrcweir long ScaleMetricValue( long nVal, long nMul, long nDiv ) 93*cdf0e10cSrcweir { 94*cdf0e10cSrcweir BigInt aVal( nVal ); 95*cdf0e10cSrcweir 96*cdf0e10cSrcweir aVal *= nMul; 97*cdf0e10cSrcweir 98*cdf0e10cSrcweir if ( aVal.IsNeg() != ( nDiv < 0 ) ) 99*cdf0e10cSrcweir aVal-=nDiv/2; // fuer korrektes Runden 100*cdf0e10cSrcweir else 101*cdf0e10cSrcweir aVal+=nDiv/2; // fuer korrektes Runden 102*cdf0e10cSrcweir 103*cdf0e10cSrcweir aVal/=nDiv; 104*cdf0e10cSrcweir 105*cdf0e10cSrcweir return long( aVal ); 106*cdf0e10cSrcweir } 107*cdf0e10cSrcweir 108*cdf0e10cSrcweir /************************************************************************* 109*cdf0e10cSrcweir |* 110*cdf0e10cSrcweir |* NameOrIndex::NameOrIndex(sal_uInt16 nWhich, sal_Int32 nIndex) 111*cdf0e10cSrcweir |* 112*cdf0e10cSrcweir |* Beschreibung 113*cdf0e10cSrcweir |* Ersterstellung 14.11.94 114*cdf0e10cSrcweir |* Letzte Aenderung 14.11.94 115*cdf0e10cSrcweir |* 116*cdf0e10cSrcweir *************************************************************************/ 117*cdf0e10cSrcweir 118*cdf0e10cSrcweir NameOrIndex::NameOrIndex(sal_uInt16 _nWhich, sal_Int32 nIndex) : 119*cdf0e10cSrcweir SfxStringItem(_nWhich, aNameOrIndexEmptyString), 120*cdf0e10cSrcweir nPalIndex(nIndex) 121*cdf0e10cSrcweir { 122*cdf0e10cSrcweir } 123*cdf0e10cSrcweir 124*cdf0e10cSrcweir /************************************************************************* 125*cdf0e10cSrcweir |* 126*cdf0e10cSrcweir |* NameOrIndex::NameOrIndex(sal_uInt16 nWhich, const String& rName) 127*cdf0e10cSrcweir |* 128*cdf0e10cSrcweir |* Beschreibung 129*cdf0e10cSrcweir |* Ersterstellung 14.11.94 130*cdf0e10cSrcweir |* Letzte Aenderung 14.11.94 131*cdf0e10cSrcweir |* 132*cdf0e10cSrcweir *************************************************************************/ 133*cdf0e10cSrcweir 134*cdf0e10cSrcweir NameOrIndex::NameOrIndex(sal_uInt16 _nWhich, const XubString& rName) : 135*cdf0e10cSrcweir SfxStringItem(_nWhich, rName), 136*cdf0e10cSrcweir nPalIndex(-1) 137*cdf0e10cSrcweir { 138*cdf0e10cSrcweir } 139*cdf0e10cSrcweir 140*cdf0e10cSrcweir /************************************************************************* 141*cdf0e10cSrcweir |* 142*cdf0e10cSrcweir |* NameOrIndex::NameOrIndex(sal_uInt16 nWhich, SvStream& rIn) 143*cdf0e10cSrcweir |* 144*cdf0e10cSrcweir |* Beschreibung 145*cdf0e10cSrcweir |* Ersterstellung 14.11.94 146*cdf0e10cSrcweir |* Letzte Aenderung 14.11.94 147*cdf0e10cSrcweir |* 148*cdf0e10cSrcweir *************************************************************************/ 149*cdf0e10cSrcweir 150*cdf0e10cSrcweir NameOrIndex::NameOrIndex(sal_uInt16 _nWhich, SvStream& rIn) : 151*cdf0e10cSrcweir SfxStringItem(_nWhich, rIn) 152*cdf0e10cSrcweir { 153*cdf0e10cSrcweir rIn >> nPalIndex; 154*cdf0e10cSrcweir } 155*cdf0e10cSrcweir 156*cdf0e10cSrcweir /************************************************************************* 157*cdf0e10cSrcweir |* 158*cdf0e10cSrcweir |* NameOrIndex::NameOrIndex(const NameOrIndex& rNameOrIndex) 159*cdf0e10cSrcweir |* 160*cdf0e10cSrcweir |* Beschreibung 161*cdf0e10cSrcweir |* Ersterstellung 14.11.94 162*cdf0e10cSrcweir |* Letzte Aenderung 14.11.94 163*cdf0e10cSrcweir |* 164*cdf0e10cSrcweir *************************************************************************/ 165*cdf0e10cSrcweir 166*cdf0e10cSrcweir NameOrIndex::NameOrIndex(const NameOrIndex& rNameOrIndex) : 167*cdf0e10cSrcweir SfxStringItem(rNameOrIndex), 168*cdf0e10cSrcweir nPalIndex(rNameOrIndex.nPalIndex) 169*cdf0e10cSrcweir { 170*cdf0e10cSrcweir } 171*cdf0e10cSrcweir 172*cdf0e10cSrcweir /************************************************************************* 173*cdf0e10cSrcweir |* 174*cdf0e10cSrcweir |* int NameOrIndex::operator==(const SfxPoolItem& rItem) const 175*cdf0e10cSrcweir |* 176*cdf0e10cSrcweir |* Beschreibung 177*cdf0e10cSrcweir |* Ersterstellung 14.11.94 178*cdf0e10cSrcweir |* Letzte Aenderung 14.11.94 179*cdf0e10cSrcweir |* 180*cdf0e10cSrcweir *************************************************************************/ 181*cdf0e10cSrcweir 182*cdf0e10cSrcweir int NameOrIndex::operator==(const SfxPoolItem& rItem) const 183*cdf0e10cSrcweir { 184*cdf0e10cSrcweir return ( SfxStringItem::operator==(rItem) && 185*cdf0e10cSrcweir ((const NameOrIndex&) rItem).nPalIndex == nPalIndex ); 186*cdf0e10cSrcweir } 187*cdf0e10cSrcweir 188*cdf0e10cSrcweir /************************************************************************* 189*cdf0e10cSrcweir |* 190*cdf0e10cSrcweir |* SfxPoolItem* NameOrIndex::Clone(SfxItemPool* pPool) const 191*cdf0e10cSrcweir |* 192*cdf0e10cSrcweir |* Beschreibung 193*cdf0e10cSrcweir |* Ersterstellung 14.11.94 194*cdf0e10cSrcweir |* Letzte Aenderung 14.11.94 195*cdf0e10cSrcweir |* 196*cdf0e10cSrcweir *************************************************************************/ 197*cdf0e10cSrcweir 198*cdf0e10cSrcweir SfxPoolItem* NameOrIndex::Clone(SfxItemPool* /*pPool*/) const 199*cdf0e10cSrcweir { 200*cdf0e10cSrcweir 201*cdf0e10cSrcweir return new NameOrIndex(*this); 202*cdf0e10cSrcweir } 203*cdf0e10cSrcweir 204*cdf0e10cSrcweir /************************************************************************* 205*cdf0e10cSrcweir |* 206*cdf0e10cSrcweir |* SfxPoolItem* NameOrIndex::Create(SvStream& rIn, sal_uInt16 nVer) const 207*cdf0e10cSrcweir |* 208*cdf0e10cSrcweir |* Beschreibung 209*cdf0e10cSrcweir |* Ersterstellung 14.11.94 210*cdf0e10cSrcweir |* Letzte Aenderung 14.11.94 211*cdf0e10cSrcweir |* 212*cdf0e10cSrcweir *************************************************************************/ 213*cdf0e10cSrcweir 214*cdf0e10cSrcweir SfxPoolItem* NameOrIndex::Create(SvStream& rIn, sal_uInt16 /*nVer*/) const 215*cdf0e10cSrcweir { 216*cdf0e10cSrcweir return new NameOrIndex(Which(), rIn); 217*cdf0e10cSrcweir } 218*cdf0e10cSrcweir 219*cdf0e10cSrcweir /************************************************************************* 220*cdf0e10cSrcweir |* 221*cdf0e10cSrcweir |* SvStream* NameOrIndex::Store(SvStream& rIn) const 222*cdf0e10cSrcweir |* 223*cdf0e10cSrcweir |* Beschreibung 224*cdf0e10cSrcweir |* Ersterstellung 14.11.94 225*cdf0e10cSrcweir |* Letzte Aenderung 14.11.94 226*cdf0e10cSrcweir |* 227*cdf0e10cSrcweir *************************************************************************/ 228*cdf0e10cSrcweir 229*cdf0e10cSrcweir SvStream& NameOrIndex::Store( SvStream& rOut, sal_uInt16 nItemVersion ) const 230*cdf0e10cSrcweir { 231*cdf0e10cSrcweir SfxStringItem::Store( rOut, nItemVersion ); 232*cdf0e10cSrcweir rOut << nPalIndex; 233*cdf0e10cSrcweir return rOut; 234*cdf0e10cSrcweir } 235*cdf0e10cSrcweir 236*cdf0e10cSrcweir /** this static checks if the given NameOrIndex item has a unique name for its value. 237*cdf0e10cSrcweir The returned String is a unique name for an item with this value in both given pools. 238*cdf0e10cSrcweir Argument pPool2 can be null. 239*cdf0e10cSrcweir If returned string equals NameOrIndex->GetName(), the name was already unique. 240*cdf0e10cSrcweir */ 241*cdf0e10cSrcweir String NameOrIndex::CheckNamedItem( const NameOrIndex* pCheckItem, const sal_uInt16 nWhich, const SfxItemPool* pPool1, const SfxItemPool* /*pPool2*/, SvxCompareValueFunc pCompareValueFunc, sal_uInt16 nPrefixResId, XPropertyList* pDefaults ) 242*cdf0e10cSrcweir { 243*cdf0e10cSrcweir sal_Bool bForceNew = sal_False; 244*cdf0e10cSrcweir 245*cdf0e10cSrcweir String aUniqueName; 246*cdf0e10cSrcweir SvxUnogetInternalNameForItem( nWhich, pCheckItem->GetName(), aUniqueName ); 247*cdf0e10cSrcweir 248*cdf0e10cSrcweir // 2. if we have a name check if there is already an item with the 249*cdf0e10cSrcweir // same name in the documents pool with a different line end or start 250*cdf0e10cSrcweir 251*cdf0e10cSrcweir if( aUniqueName.Len() && pPool1 ) 252*cdf0e10cSrcweir { 253*cdf0e10cSrcweir const sal_uInt32 nCount = pPool1->GetItemCount2( nWhich ); 254*cdf0e10cSrcweir 255*cdf0e10cSrcweir const NameOrIndex *pItem; 256*cdf0e10cSrcweir for( sal_uInt32 nSurrogate = 0; nSurrogate < nCount; nSurrogate++ ) 257*cdf0e10cSrcweir { 258*cdf0e10cSrcweir pItem = (NameOrIndex*)pPool1->GetItem2( nWhich, nSurrogate ); 259*cdf0e10cSrcweir 260*cdf0e10cSrcweir if( pItem && ( pItem->GetName() == pCheckItem->GetName() ) ) 261*cdf0e10cSrcweir { 262*cdf0e10cSrcweir // if there is already an item with the same name and the same 263*cdf0e10cSrcweir // value its ok to set it 264*cdf0e10cSrcweir if( !pCompareValueFunc( pItem, pCheckItem ) ) 265*cdf0e10cSrcweir { 266*cdf0e10cSrcweir // same name but different value, we need a new name for this item 267*cdf0e10cSrcweir aUniqueName = String(); 268*cdf0e10cSrcweir bForceNew = sal_True; 269*cdf0e10cSrcweir } 270*cdf0e10cSrcweir break; 271*cdf0e10cSrcweir } 272*cdf0e10cSrcweir } 273*cdf0e10cSrcweir } 274*cdf0e10cSrcweir 275*cdf0e10cSrcweir // if we have no name yet, find existing item with same conent or 276*cdf0e10cSrcweir // create a unique name 277*cdf0e10cSrcweir if( aUniqueName.Len() == 0 ) 278*cdf0e10cSrcweir { 279*cdf0e10cSrcweir sal_Int32 nUserIndex = 1; 280*cdf0e10cSrcweir const ResId aRes(SVX_RES(nPrefixResId)); 281*cdf0e10cSrcweir String aUser( aRes ); 282*cdf0e10cSrcweir aUser += sal_Unicode( ' ' ); 283*cdf0e10cSrcweir 284*cdf0e10cSrcweir if( pDefaults ) 285*cdf0e10cSrcweir { 286*cdf0e10cSrcweir const int nCount = pDefaults->Count(); 287*cdf0e10cSrcweir int nIndex; 288*cdf0e10cSrcweir for( nIndex = 0; nIndex < nCount; nIndex++ ) 289*cdf0e10cSrcweir { 290*cdf0e10cSrcweir XPropertyEntry* pEntry = pDefaults->Get( nIndex, 0 ); 291*cdf0e10cSrcweir if( pEntry ) 292*cdf0e10cSrcweir { 293*cdf0e10cSrcweir bool bFound = false; 294*cdf0e10cSrcweir 295*cdf0e10cSrcweir switch( nWhich ) 296*cdf0e10cSrcweir { 297*cdf0e10cSrcweir case XATTR_FILLBITMAP: 298*cdf0e10cSrcweir bFound = (((XFillBitmapItem*)pCheckItem)->GetBitmapValue().GetGraphicObject().GetUniqueID() == 299*cdf0e10cSrcweir ((XBitmapEntry*)pEntry)->GetXBitmap().GetGraphicObject().GetUniqueID()); 300*cdf0e10cSrcweir break; 301*cdf0e10cSrcweir case XATTR_LINEDASH: 302*cdf0e10cSrcweir bFound = (((XLineDashItem*)pCheckItem)->GetDashValue() == ((XDashEntry*)pEntry) ->GetDash()); 303*cdf0e10cSrcweir break; 304*cdf0e10cSrcweir case XATTR_LINESTART: 305*cdf0e10cSrcweir bFound = (((XLineStartItem*)pCheckItem)->GetLineStartValue() == ((XLineEndEntry*)pEntry)->GetLineEnd()); 306*cdf0e10cSrcweir break; 307*cdf0e10cSrcweir case XATTR_LINEEND: 308*cdf0e10cSrcweir bFound = (((XLineEndItem*)pCheckItem)->GetLineEndValue() == ((XLineEndEntry*)pEntry)->GetLineEnd()); 309*cdf0e10cSrcweir break; 310*cdf0e10cSrcweir case XATTR_FILLGRADIENT: 311*cdf0e10cSrcweir bFound = (((XFillGradientItem*)pCheckItem)->GetGradientValue() == ((XGradientEntry*)pEntry)->GetGradient()); 312*cdf0e10cSrcweir break; 313*cdf0e10cSrcweir case XATTR_FILLHATCH: 314*cdf0e10cSrcweir bFound = (((XFillHatchItem*)pCheckItem)->GetHatchValue() == ((XHatchEntry*)pEntry)->GetHatch()); 315*cdf0e10cSrcweir break; 316*cdf0e10cSrcweir } 317*cdf0e10cSrcweir 318*cdf0e10cSrcweir if( bFound ) 319*cdf0e10cSrcweir { 320*cdf0e10cSrcweir aUniqueName = pEntry->GetName(); 321*cdf0e10cSrcweir break; 322*cdf0e10cSrcweir } 323*cdf0e10cSrcweir else 324*cdf0e10cSrcweir { 325*cdf0e10cSrcweir sal_Int32 nThisIndex = pEntry->GetName().Copy( aUser.Len() ).ToInt32(); 326*cdf0e10cSrcweir if( nThisIndex >= nUserIndex ) 327*cdf0e10cSrcweir nUserIndex = nThisIndex + 1; 328*cdf0e10cSrcweir } 329*cdf0e10cSrcweir } 330*cdf0e10cSrcweir } 331*cdf0e10cSrcweir } 332*cdf0e10cSrcweir 333*cdf0e10cSrcweir if( (aUniqueName.Len() == 0) && pPool1 ) 334*cdf0e10cSrcweir { 335*cdf0e10cSrcweir const sal_uInt32 nCount = pPool1->GetItemCount2( nWhich ); 336*cdf0e10cSrcweir const NameOrIndex *pItem; 337*cdf0e10cSrcweir for( sal_uInt32 nSurrogate = 0; nSurrogate < nCount; nSurrogate++ ) 338*cdf0e10cSrcweir { 339*cdf0e10cSrcweir pItem = (NameOrIndex*)pPool1->GetItem2( nWhich, nSurrogate ); 340*cdf0e10cSrcweir 341*cdf0e10cSrcweir if( pItem && pItem->GetName().Len() ) 342*cdf0e10cSrcweir { 343*cdf0e10cSrcweir if( !bForceNew && pCompareValueFunc( pItem, pCheckItem ) ) 344*cdf0e10cSrcweir return pItem->GetName(); 345*cdf0e10cSrcweir 346*cdf0e10cSrcweir if( pItem->GetName().CompareTo( aUser, aUser.Len() ) == 0 ) 347*cdf0e10cSrcweir { 348*cdf0e10cSrcweir sal_Int32 nThisIndex = pItem->GetName().Copy( aUser.Len() ).ToInt32(); 349*cdf0e10cSrcweir if( nThisIndex >= nUserIndex ) 350*cdf0e10cSrcweir nUserIndex = nThisIndex + 1; 351*cdf0e10cSrcweir } 352*cdf0e10cSrcweir } 353*cdf0e10cSrcweir } 354*cdf0e10cSrcweir aUniqueName = aUser; 355*cdf0e10cSrcweir aUniqueName += String::CreateFromInt32( nUserIndex ); 356*cdf0e10cSrcweir } 357*cdf0e10cSrcweir } 358*cdf0e10cSrcweir 359*cdf0e10cSrcweir return aUniqueName; 360*cdf0e10cSrcweir } 361*cdf0e10cSrcweir 362*cdf0e10cSrcweir //************************************************************************* 363*cdf0e10cSrcweir 364*cdf0e10cSrcweir // ------------------- 365*cdf0e10cSrcweir // class XColorItem 366*cdf0e10cSrcweir // ------------------- 367*cdf0e10cSrcweir TYPEINIT1_AUTOFACTORY(XColorItem, NameOrIndex); 368*cdf0e10cSrcweir 369*cdf0e10cSrcweir /************************************************************************* 370*cdf0e10cSrcweir |* 371*cdf0e10cSrcweir |* XColorItem::XColorItem(sal_uInt16 nWhich, sal_Int32 nIndex, const Color& rTheColor) 372*cdf0e10cSrcweir |* 373*cdf0e10cSrcweir \************************************************************************/ 374*cdf0e10cSrcweir 375*cdf0e10cSrcweir XColorItem::XColorItem(sal_uInt16 _nWhich, sal_Int32 nIndex, const Color& rTheColor) : 376*cdf0e10cSrcweir NameOrIndex(_nWhich, nIndex), 377*cdf0e10cSrcweir aColor(rTheColor) 378*cdf0e10cSrcweir { 379*cdf0e10cSrcweir } 380*cdf0e10cSrcweir 381*cdf0e10cSrcweir /************************************************************************* 382*cdf0e10cSrcweir |* 383*cdf0e10cSrcweir |* XColorItem::XColorItem(sal_uInt16 nWhich, const String& rName, const Color& rTheColor) 384*cdf0e10cSrcweir |* 385*cdf0e10cSrcweir \************************************************************************/ 386*cdf0e10cSrcweir 387*cdf0e10cSrcweir XColorItem::XColorItem(sal_uInt16 _nWhich, const XubString& rName, const Color& rTheColor) : 388*cdf0e10cSrcweir NameOrIndex(_nWhich, rName), 389*cdf0e10cSrcweir aColor(rTheColor) 390*cdf0e10cSrcweir { 391*cdf0e10cSrcweir } 392*cdf0e10cSrcweir 393*cdf0e10cSrcweir /************************************************************************* 394*cdf0e10cSrcweir |* 395*cdf0e10cSrcweir |* XColorItem::XColorItem(const XColorItem& rItem) 396*cdf0e10cSrcweir |* 397*cdf0e10cSrcweir \************************************************************************/ 398*cdf0e10cSrcweir 399*cdf0e10cSrcweir XColorItem::XColorItem(const XColorItem& rItem) : 400*cdf0e10cSrcweir NameOrIndex(rItem), 401*cdf0e10cSrcweir aColor(rItem.aColor) 402*cdf0e10cSrcweir { 403*cdf0e10cSrcweir } 404*cdf0e10cSrcweir 405*cdf0e10cSrcweir /************************************************************************* 406*cdf0e10cSrcweir |* 407*cdf0e10cSrcweir |* XColorItem::XColorItem(sal_uInt16 nWhich, SvStream& rIn) 408*cdf0e10cSrcweir |* 409*cdf0e10cSrcweir \************************************************************************/ 410*cdf0e10cSrcweir 411*cdf0e10cSrcweir XColorItem::XColorItem(sal_uInt16 _nWhich, SvStream& rIn) : 412*cdf0e10cSrcweir NameOrIndex(_nWhich, rIn) 413*cdf0e10cSrcweir { 414*cdf0e10cSrcweir if (!IsIndex()) 415*cdf0e10cSrcweir { 416*cdf0e10cSrcweir rIn >> aColor; 417*cdf0e10cSrcweir } 418*cdf0e10cSrcweir } 419*cdf0e10cSrcweir 420*cdf0e10cSrcweir /************************************************************************* 421*cdf0e10cSrcweir |* 422*cdf0e10cSrcweir |* XColorItem::Clone(SfxItemPool* pPool) const 423*cdf0e10cSrcweir |* 424*cdf0e10cSrcweir \************************************************************************/ 425*cdf0e10cSrcweir 426*cdf0e10cSrcweir SfxPoolItem* XColorItem::Clone(SfxItemPool* /*pPool*/) const 427*cdf0e10cSrcweir { 428*cdf0e10cSrcweir return new XColorItem(*this); 429*cdf0e10cSrcweir } 430*cdf0e10cSrcweir 431*cdf0e10cSrcweir /************************************************************************* 432*cdf0e10cSrcweir |* 433*cdf0e10cSrcweir |* int XColorItem::operator==(const SfxPoolItem& rItem) const 434*cdf0e10cSrcweir |* 435*cdf0e10cSrcweir \************************************************************************/ 436*cdf0e10cSrcweir 437*cdf0e10cSrcweir int XColorItem::operator==(const SfxPoolItem& rItem) const 438*cdf0e10cSrcweir { 439*cdf0e10cSrcweir return ( NameOrIndex::operator==(rItem) && 440*cdf0e10cSrcweir ((const XColorItem&) rItem).aColor == aColor ); 441*cdf0e10cSrcweir } 442*cdf0e10cSrcweir 443*cdf0e10cSrcweir /************************************************************************* 444*cdf0e10cSrcweir |* 445*cdf0e10cSrcweir |* SfxPoolItem* XColorItem::Create(SvStream& rIn, sal_uInt16 nVer) const 446*cdf0e10cSrcweir |* 447*cdf0e10cSrcweir \************************************************************************/ 448*cdf0e10cSrcweir 449*cdf0e10cSrcweir SfxPoolItem* XColorItem::Create(SvStream& rIn, sal_uInt16 /*nVer*/) const 450*cdf0e10cSrcweir { 451*cdf0e10cSrcweir return new XColorItem(Which(), rIn); 452*cdf0e10cSrcweir } 453*cdf0e10cSrcweir 454*cdf0e10cSrcweir /************************************************************************* 455*cdf0e10cSrcweir |* 456*cdf0e10cSrcweir |* SfxPoolItem* XColorItem::Store(SvStream& rOut) const 457*cdf0e10cSrcweir |* 458*cdf0e10cSrcweir \************************************************************************/ 459*cdf0e10cSrcweir 460*cdf0e10cSrcweir SvStream& XColorItem::Store( SvStream& rOut, sal_uInt16 nItemVersion ) const 461*cdf0e10cSrcweir { 462*cdf0e10cSrcweir NameOrIndex::Store( rOut, nItemVersion ); 463*cdf0e10cSrcweir 464*cdf0e10cSrcweir if ( !IsIndex() ) 465*cdf0e10cSrcweir { 466*cdf0e10cSrcweir rOut << aColor; 467*cdf0e10cSrcweir } 468*cdf0e10cSrcweir 469*cdf0e10cSrcweir return rOut; 470*cdf0e10cSrcweir } 471*cdf0e10cSrcweir 472*cdf0e10cSrcweir /************************************************************************* 473*cdf0e10cSrcweir |* 474*cdf0e10cSrcweir |* const XColor& XColorItem::GetColorValue(const XColorTable* pTable) const 475*cdf0e10cSrcweir |* 476*cdf0e10cSrcweir \************************************************************************/ 477*cdf0e10cSrcweir 478*cdf0e10cSrcweir const Color& XColorItem::GetColorValue(const XColorTable* pTable) const 479*cdf0e10cSrcweir { 480*cdf0e10cSrcweir if (!IsIndex()) 481*cdf0e10cSrcweir return aColor; 482*cdf0e10cSrcweir else 483*cdf0e10cSrcweir return pTable->GetColor(GetIndex())->GetColor(); 484*cdf0e10cSrcweir 485*cdf0e10cSrcweir } 486*cdf0e10cSrcweir 487*cdf0e10cSrcweir sal_Bool XColorItem::QueryValue( ::com::sun::star::uno::Any& rVal, sal_uInt8 /*nMemberId*/) const 488*cdf0e10cSrcweir { 489*cdf0e10cSrcweir rVal <<= (sal_Int32)GetColorValue().GetRGBColor(); 490*cdf0e10cSrcweir return sal_True; 491*cdf0e10cSrcweir } 492*cdf0e10cSrcweir 493*cdf0e10cSrcweir sal_Bool XColorItem::PutValue( const ::com::sun::star::uno::Any& rVal, sal_uInt8 /*nMemberId*/) 494*cdf0e10cSrcweir { 495*cdf0e10cSrcweir sal_Int32 nValue = 0; 496*cdf0e10cSrcweir rVal >>= nValue; 497*cdf0e10cSrcweir SetColorValue( nValue ); 498*cdf0e10cSrcweir 499*cdf0e10cSrcweir return sal_True; 500*cdf0e10cSrcweir } 501*cdf0e10cSrcweir 502*cdf0e10cSrcweir 503*cdf0e10cSrcweir //++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 504*cdf0e10cSrcweir // Linienattribute 505*cdf0e10cSrcweir //++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 506*cdf0e10cSrcweir 507*cdf0e10cSrcweir //--------------------- 508*cdf0e10cSrcweir // class XLineStyleItem 509*cdf0e10cSrcweir //--------------------- 510*cdf0e10cSrcweir TYPEINIT1_AUTOFACTORY(XLineStyleItem, SfxEnumItem); 511*cdf0e10cSrcweir 512*cdf0e10cSrcweir /************************************************************************* 513*cdf0e10cSrcweir |* 514*cdf0e10cSrcweir |* XLineStyleItem::XLineStyleItem(XLineStyle eTheLineStyle) 515*cdf0e10cSrcweir |* 516*cdf0e10cSrcweir |* Beschreibung 517*cdf0e10cSrcweir |* Ersterstellung 15.11.94 518*cdf0e10cSrcweir |* Letzte Aenderung 18.11.94 519*cdf0e10cSrcweir |* 520*cdf0e10cSrcweir *************************************************************************/ 521*cdf0e10cSrcweir 522*cdf0e10cSrcweir XLineStyleItem::XLineStyleItem(XLineStyle eTheLineStyle) : 523*cdf0e10cSrcweir SfxEnumItem(XATTR_LINESTYLE, sal::static_int_cast< sal_uInt16 >(eTheLineStyle)) 524*cdf0e10cSrcweir { 525*cdf0e10cSrcweir } 526*cdf0e10cSrcweir 527*cdf0e10cSrcweir /************************************************************************* 528*cdf0e10cSrcweir |* 529*cdf0e10cSrcweir |* XLineStyleItem::XLineStyleItem(SvStream& rIn) 530*cdf0e10cSrcweir |* 531*cdf0e10cSrcweir |* Beschreibung 532*cdf0e10cSrcweir |* Ersterstellung 15.11.94 533*cdf0e10cSrcweir |* Letzte Aenderung 15.11.94 534*cdf0e10cSrcweir |* 535*cdf0e10cSrcweir *************************************************************************/ 536*cdf0e10cSrcweir 537*cdf0e10cSrcweir XLineStyleItem::XLineStyleItem(SvStream& rIn) : 538*cdf0e10cSrcweir SfxEnumItem(XATTR_LINESTYLE, rIn) 539*cdf0e10cSrcweir { 540*cdf0e10cSrcweir } 541*cdf0e10cSrcweir 542*cdf0e10cSrcweir /************************************************************************* 543*cdf0e10cSrcweir |* 544*cdf0e10cSrcweir |* XLineStyleItem::Clone(SfxItemPool* pPool) const 545*cdf0e10cSrcweir |* 546*cdf0e10cSrcweir |* Beschreibung 547*cdf0e10cSrcweir |* Ersterstellung 09.11.94 548*cdf0e10cSrcweir |* Letzte Aenderung 09.11.94 549*cdf0e10cSrcweir |* 550*cdf0e10cSrcweir *************************************************************************/ 551*cdf0e10cSrcweir 552*cdf0e10cSrcweir SfxPoolItem* XLineStyleItem::Clone(SfxItemPool* /*pPool*/) const 553*cdf0e10cSrcweir { 554*cdf0e10cSrcweir return new XLineStyleItem( *this ); 555*cdf0e10cSrcweir } 556*cdf0e10cSrcweir 557*cdf0e10cSrcweir /************************************************************************* 558*cdf0e10cSrcweir |* 559*cdf0e10cSrcweir |* SfxPoolItem* XLineStyleItem::Create(SvStream& rIn, sal_uInt16 nVer) const 560*cdf0e10cSrcweir |* 561*cdf0e10cSrcweir |* Beschreibung 562*cdf0e10cSrcweir |* Ersterstellung 15.11.94 563*cdf0e10cSrcweir |* Letzte Aenderung 15.11.94 564*cdf0e10cSrcweir |* 565*cdf0e10cSrcweir *************************************************************************/ 566*cdf0e10cSrcweir 567*cdf0e10cSrcweir SfxPoolItem* XLineStyleItem::Create(SvStream& rIn, sal_uInt16 /*nVer*/) const 568*cdf0e10cSrcweir { 569*cdf0e10cSrcweir return new XLineStyleItem(rIn); 570*cdf0e10cSrcweir } 571*cdf0e10cSrcweir 572*cdf0e10cSrcweir //------------------------------------------------------------------------ 573*cdf0e10cSrcweir 574*cdf0e10cSrcweir SfxItemPresentation XLineStyleItem::GetPresentation 575*cdf0e10cSrcweir ( 576*cdf0e10cSrcweir SfxItemPresentation ePres, 577*cdf0e10cSrcweir SfxMapUnit /*eCoreUnit*/, 578*cdf0e10cSrcweir SfxMapUnit /*ePresUnit*/, 579*cdf0e10cSrcweir XubString& rText, const IntlWrapper * 580*cdf0e10cSrcweir ) const 581*cdf0e10cSrcweir { 582*cdf0e10cSrcweir rText.Erase(); 583*cdf0e10cSrcweir 584*cdf0e10cSrcweir switch ( ePres ) 585*cdf0e10cSrcweir { 586*cdf0e10cSrcweir case SFX_ITEM_PRESENTATION_NONE: 587*cdf0e10cSrcweir return ePres; 588*cdf0e10cSrcweir case SFX_ITEM_PRESENTATION_COMPLETE: 589*cdf0e10cSrcweir case SFX_ITEM_PRESENTATION_NAMELESS: 590*cdf0e10cSrcweir { 591*cdf0e10cSrcweir sal_uInt16 nId = 0; 592*cdf0e10cSrcweir 593*cdf0e10cSrcweir switch( (sal_uInt16)GetValue() ) 594*cdf0e10cSrcweir { 595*cdf0e10cSrcweir case XLINE_NONE: 596*cdf0e10cSrcweir nId = RID_SVXSTR_INVISIBLE; 597*cdf0e10cSrcweir break; 598*cdf0e10cSrcweir case XLINE_SOLID: 599*cdf0e10cSrcweir nId = RID_SVXSTR_SOLID; 600*cdf0e10cSrcweir break; 601*cdf0e10cSrcweir } 602*cdf0e10cSrcweir 603*cdf0e10cSrcweir if ( nId ) 604*cdf0e10cSrcweir rText = SVX_RESSTR( nId ); 605*cdf0e10cSrcweir return ePres; 606*cdf0e10cSrcweir } 607*cdf0e10cSrcweir default: 608*cdf0e10cSrcweir return SFX_ITEM_PRESENTATION_NONE; 609*cdf0e10cSrcweir } 610*cdf0e10cSrcweir } 611*cdf0e10cSrcweir 612*cdf0e10cSrcweir sal_Bool XLineStyleItem::QueryValue( ::com::sun::star::uno::Any& rVal, sal_uInt8 /*nMemberId*/) const 613*cdf0e10cSrcweir { 614*cdf0e10cSrcweir ::com::sun::star::drawing::LineStyle eLS = (::com::sun::star::drawing::LineStyle)GetValue(); 615*cdf0e10cSrcweir rVal <<= eLS; 616*cdf0e10cSrcweir return sal_True; 617*cdf0e10cSrcweir } 618*cdf0e10cSrcweir 619*cdf0e10cSrcweir sal_Bool XLineStyleItem::PutValue( const ::com::sun::star::uno::Any& rVal, sal_uInt8 /*nMemberId*/) 620*cdf0e10cSrcweir { 621*cdf0e10cSrcweir ::com::sun::star::drawing::LineStyle eLS; 622*cdf0e10cSrcweir if(!(rVal >>= eLS )) 623*cdf0e10cSrcweir { 624*cdf0e10cSrcweir // also try an int (for Basic) 625*cdf0e10cSrcweir sal_Int32 nLS = 0; 626*cdf0e10cSrcweir if(!(rVal >>= nLS)) 627*cdf0e10cSrcweir return sal_False; 628*cdf0e10cSrcweir eLS = (::com::sun::star::drawing::LineStyle)nLS; 629*cdf0e10cSrcweir } 630*cdf0e10cSrcweir 631*cdf0e10cSrcweir SetValue( sal::static_int_cast< sal_uInt16 >( eLS ) ); 632*cdf0e10cSrcweir return sal_True; 633*cdf0e10cSrcweir } 634*cdf0e10cSrcweir 635*cdf0e10cSrcweir //------------------------------------------------------------------------ 636*cdf0e10cSrcweir 637*cdf0e10cSrcweir sal_uInt16 XLineStyleItem::GetValueCount() const 638*cdf0e10cSrcweir { 639*cdf0e10cSrcweir return 3; 640*cdf0e10cSrcweir } 641*cdf0e10cSrcweir 642*cdf0e10cSrcweir 643*cdf0e10cSrcweir // ------------ 644*cdf0e10cSrcweir // class XDash 645*cdf0e10cSrcweir // ------------ 646*cdf0e10cSrcweir /************************************************************************* 647*cdf0e10cSrcweir |* 648*cdf0e10cSrcweir |* XDash::XDash(XDashStyle, sal_uInt16, sal_uIntPtr, sal_uInt16, sal_uIntPtr, sal_uIntPtr) 649*cdf0e10cSrcweir |* 650*cdf0e10cSrcweir |* Beschreibung 651*cdf0e10cSrcweir |* Ersterstellung 21.11.94 652*cdf0e10cSrcweir |* Letzte Aenderung 21.11.94 653*cdf0e10cSrcweir |* 654*cdf0e10cSrcweir *************************************************************************/ 655*cdf0e10cSrcweir 656*cdf0e10cSrcweir XDash::XDash(XDashStyle eTheDash, sal_uInt16 nTheDots, sal_uIntPtr nTheDotLen, 657*cdf0e10cSrcweir sal_uInt16 nTheDashes, sal_uIntPtr nTheDashLen, sal_uIntPtr nTheDistance) : 658*cdf0e10cSrcweir eDash(eTheDash), 659*cdf0e10cSrcweir nDots(nTheDots), 660*cdf0e10cSrcweir nDotLen(nTheDotLen), 661*cdf0e10cSrcweir nDashes(nTheDashes), 662*cdf0e10cSrcweir nDashLen(nTheDashLen), 663*cdf0e10cSrcweir nDistance(nTheDistance) 664*cdf0e10cSrcweir { 665*cdf0e10cSrcweir } 666*cdf0e10cSrcweir 667*cdf0e10cSrcweir /************************************************************************* 668*cdf0e10cSrcweir |* 669*cdf0e10cSrcweir |* int XDash::operator==(const SfxPoolItem& rItem) const 670*cdf0e10cSrcweir |* 671*cdf0e10cSrcweir |* Beschreibung 672*cdf0e10cSrcweir |* Ersterstellung 29.11.94 673*cdf0e10cSrcweir |* Letzte Aenderung 29.11.94 674*cdf0e10cSrcweir |* 675*cdf0e10cSrcweir *************************************************************************/ 676*cdf0e10cSrcweir 677*cdf0e10cSrcweir bool XDash::operator==(const XDash& rDash) const 678*cdf0e10cSrcweir { 679*cdf0e10cSrcweir return ( eDash == rDash.eDash && 680*cdf0e10cSrcweir nDots == rDash.nDots && 681*cdf0e10cSrcweir nDotLen == rDash.nDotLen && 682*cdf0e10cSrcweir nDashes == rDash.nDashes && 683*cdf0e10cSrcweir nDashLen == rDash.nDashLen && 684*cdf0e10cSrcweir nDistance == rDash.nDistance ); 685*cdf0e10cSrcweir } 686*cdf0e10cSrcweir 687*cdf0e10cSrcweir // XDash is translated into an array of doubles which describe the lengths of the 688*cdf0e10cSrcweir // dashes, dots and empty passages. It returns the complete length of the full DashDot 689*cdf0e10cSrcweir // sequence and fills the given vetor of doubles accordingly (also resizing, so deleting it). 690*cdf0e10cSrcweir static double SMALLEST_DASH_WIDTH(26.95); 691*cdf0e10cSrcweir double XDash::CreateDotDashArray(::std::vector< double >& rDotDashArray, double fLineWidth) const 692*cdf0e10cSrcweir { 693*cdf0e10cSrcweir double fFullDotDashLen(0.0); 694*cdf0e10cSrcweir const sal_uInt16 nNumDotDashArray = (GetDots() + GetDashes()) * 2; 695*cdf0e10cSrcweir rDotDashArray.resize( nNumDotDashArray, 0.0 ); 696*cdf0e10cSrcweir sal_uInt16 a; 697*cdf0e10cSrcweir sal_uInt16 nIns(0); 698*cdf0e10cSrcweir double fDashDotDistance = (double)GetDistance(); 699*cdf0e10cSrcweir double fSingleDashLen = (double)GetDashLen(); 700*cdf0e10cSrcweir double fSingleDotLen = (double)GetDotLen(); 701*cdf0e10cSrcweir 702*cdf0e10cSrcweir if(GetDashStyle() == XDASH_RECTRELATIVE || GetDashStyle() == XDASH_ROUNDRELATIVE) 703*cdf0e10cSrcweir { 704*cdf0e10cSrcweir if(fLineWidth != 0.0) 705*cdf0e10cSrcweir { 706*cdf0e10cSrcweir double fFactor = fLineWidth / 100.0; 707*cdf0e10cSrcweir 708*cdf0e10cSrcweir if(GetDashes()) 709*cdf0e10cSrcweir { 710*cdf0e10cSrcweir if(GetDashLen()) 711*cdf0e10cSrcweir { 712*cdf0e10cSrcweir // is a dash 713*cdf0e10cSrcweir fSingleDashLen *= fFactor; 714*cdf0e10cSrcweir } 715*cdf0e10cSrcweir else 716*cdf0e10cSrcweir { 717*cdf0e10cSrcweir // is a dot 718*cdf0e10cSrcweir fSingleDashLen = fLineWidth; 719*cdf0e10cSrcweir } 720*cdf0e10cSrcweir } 721*cdf0e10cSrcweir 722*cdf0e10cSrcweir if(GetDots()) 723*cdf0e10cSrcweir { 724*cdf0e10cSrcweir if(GetDotLen()) 725*cdf0e10cSrcweir { 726*cdf0e10cSrcweir // is a dash 727*cdf0e10cSrcweir fSingleDotLen *= fFactor; 728*cdf0e10cSrcweir } 729*cdf0e10cSrcweir else 730*cdf0e10cSrcweir { 731*cdf0e10cSrcweir // is a dot 732*cdf0e10cSrcweir fSingleDotLen = fLineWidth; 733*cdf0e10cSrcweir } 734*cdf0e10cSrcweir } 735*cdf0e10cSrcweir 736*cdf0e10cSrcweir if(GetDashes() || GetDots()) 737*cdf0e10cSrcweir { 738*cdf0e10cSrcweir if(GetDistance()) 739*cdf0e10cSrcweir { 740*cdf0e10cSrcweir fDashDotDistance *= fFactor; 741*cdf0e10cSrcweir } 742*cdf0e10cSrcweir else 743*cdf0e10cSrcweir { 744*cdf0e10cSrcweir fDashDotDistance = fLineWidth; 745*cdf0e10cSrcweir } 746*cdf0e10cSrcweir } 747*cdf0e10cSrcweir } 748*cdf0e10cSrcweir else 749*cdf0e10cSrcweir { 750*cdf0e10cSrcweir if(GetDashes()) 751*cdf0e10cSrcweir { 752*cdf0e10cSrcweir if(GetDashLen()) 753*cdf0e10cSrcweir { 754*cdf0e10cSrcweir // is a dash 755*cdf0e10cSrcweir fSingleDashLen = (SMALLEST_DASH_WIDTH * fSingleDashLen) / 100.0; 756*cdf0e10cSrcweir } 757*cdf0e10cSrcweir else 758*cdf0e10cSrcweir { 759*cdf0e10cSrcweir // is a dot 760*cdf0e10cSrcweir fSingleDashLen = SMALLEST_DASH_WIDTH; 761*cdf0e10cSrcweir } 762*cdf0e10cSrcweir } 763*cdf0e10cSrcweir 764*cdf0e10cSrcweir if(GetDots()) 765*cdf0e10cSrcweir { 766*cdf0e10cSrcweir if(GetDotLen()) 767*cdf0e10cSrcweir { 768*cdf0e10cSrcweir // is a dash 769*cdf0e10cSrcweir fSingleDotLen = (SMALLEST_DASH_WIDTH * fSingleDotLen) / 100.0; 770*cdf0e10cSrcweir } 771*cdf0e10cSrcweir else 772*cdf0e10cSrcweir { 773*cdf0e10cSrcweir // is a dot 774*cdf0e10cSrcweir fSingleDotLen = SMALLEST_DASH_WIDTH; 775*cdf0e10cSrcweir } 776*cdf0e10cSrcweir } 777*cdf0e10cSrcweir 778*cdf0e10cSrcweir if(GetDashes() || GetDots()) 779*cdf0e10cSrcweir { 780*cdf0e10cSrcweir if(GetDistance()) 781*cdf0e10cSrcweir { 782*cdf0e10cSrcweir // dash as distance 783*cdf0e10cSrcweir fDashDotDistance = (SMALLEST_DASH_WIDTH * fDashDotDistance) / 100.0; 784*cdf0e10cSrcweir } 785*cdf0e10cSrcweir else 786*cdf0e10cSrcweir { 787*cdf0e10cSrcweir // dot as distance 788*cdf0e10cSrcweir fDashDotDistance = SMALLEST_DASH_WIDTH; 789*cdf0e10cSrcweir } 790*cdf0e10cSrcweir } 791*cdf0e10cSrcweir } 792*cdf0e10cSrcweir } 793*cdf0e10cSrcweir else 794*cdf0e10cSrcweir { 795*cdf0e10cSrcweir // smallest dot size compare value 796*cdf0e10cSrcweir double fDotCompVal(fLineWidth != 0.0 ? fLineWidth : SMALLEST_DASH_WIDTH); 797*cdf0e10cSrcweir 798*cdf0e10cSrcweir // absolute values 799*cdf0e10cSrcweir if(GetDashes()) 800*cdf0e10cSrcweir { 801*cdf0e10cSrcweir if(GetDashLen()) 802*cdf0e10cSrcweir { 803*cdf0e10cSrcweir // is a dash 804*cdf0e10cSrcweir if(fSingleDashLen < SMALLEST_DASH_WIDTH) 805*cdf0e10cSrcweir { 806*cdf0e10cSrcweir fSingleDashLen = SMALLEST_DASH_WIDTH; 807*cdf0e10cSrcweir } 808*cdf0e10cSrcweir } 809*cdf0e10cSrcweir else 810*cdf0e10cSrcweir { 811*cdf0e10cSrcweir // is a dot 812*cdf0e10cSrcweir if(fSingleDashLen < fDotCompVal) 813*cdf0e10cSrcweir { 814*cdf0e10cSrcweir fSingleDashLen = fDotCompVal; 815*cdf0e10cSrcweir } 816*cdf0e10cSrcweir } 817*cdf0e10cSrcweir } 818*cdf0e10cSrcweir 819*cdf0e10cSrcweir if(GetDots()) 820*cdf0e10cSrcweir { 821*cdf0e10cSrcweir if(GetDotLen()) 822*cdf0e10cSrcweir { 823*cdf0e10cSrcweir // is a dash 824*cdf0e10cSrcweir if(fSingleDotLen < SMALLEST_DASH_WIDTH) 825*cdf0e10cSrcweir { 826*cdf0e10cSrcweir fSingleDotLen = SMALLEST_DASH_WIDTH; 827*cdf0e10cSrcweir } 828*cdf0e10cSrcweir } 829*cdf0e10cSrcweir else 830*cdf0e10cSrcweir { 831*cdf0e10cSrcweir // is a dot 832*cdf0e10cSrcweir if(fSingleDotLen < fDotCompVal) 833*cdf0e10cSrcweir { 834*cdf0e10cSrcweir fSingleDotLen = fDotCompVal; 835*cdf0e10cSrcweir } 836*cdf0e10cSrcweir } 837*cdf0e10cSrcweir } 838*cdf0e10cSrcweir 839*cdf0e10cSrcweir if(GetDashes() || GetDots()) 840*cdf0e10cSrcweir { 841*cdf0e10cSrcweir if(GetDistance()) 842*cdf0e10cSrcweir { 843*cdf0e10cSrcweir // dash as distance 844*cdf0e10cSrcweir if(fDashDotDistance < SMALLEST_DASH_WIDTH) 845*cdf0e10cSrcweir { 846*cdf0e10cSrcweir fDashDotDistance = SMALLEST_DASH_WIDTH; 847*cdf0e10cSrcweir } 848*cdf0e10cSrcweir } 849*cdf0e10cSrcweir else 850*cdf0e10cSrcweir { 851*cdf0e10cSrcweir // dot as distance 852*cdf0e10cSrcweir if(fDashDotDistance < fDotCompVal) 853*cdf0e10cSrcweir { 854*cdf0e10cSrcweir fDashDotDistance = fDotCompVal; 855*cdf0e10cSrcweir } 856*cdf0e10cSrcweir } 857*cdf0e10cSrcweir } 858*cdf0e10cSrcweir } 859*cdf0e10cSrcweir 860*cdf0e10cSrcweir for(a=0;a<GetDots();a++) 861*cdf0e10cSrcweir { 862*cdf0e10cSrcweir rDotDashArray[nIns++] = fSingleDotLen; 863*cdf0e10cSrcweir fFullDotDashLen += fSingleDotLen; 864*cdf0e10cSrcweir rDotDashArray[nIns++] = fDashDotDistance; 865*cdf0e10cSrcweir fFullDotDashLen += fDashDotDistance; 866*cdf0e10cSrcweir } 867*cdf0e10cSrcweir 868*cdf0e10cSrcweir for(a=0;a<GetDashes();a++) 869*cdf0e10cSrcweir { 870*cdf0e10cSrcweir rDotDashArray[nIns++] = fSingleDashLen; 871*cdf0e10cSrcweir fFullDotDashLen += fSingleDashLen; 872*cdf0e10cSrcweir rDotDashArray[nIns++] = fDashDotDistance; 873*cdf0e10cSrcweir fFullDotDashLen += fDashDotDistance; 874*cdf0e10cSrcweir } 875*cdf0e10cSrcweir 876*cdf0e10cSrcweir return fFullDotDashLen; 877*cdf0e10cSrcweir } 878*cdf0e10cSrcweir 879*cdf0e10cSrcweir // ------------------- 880*cdf0e10cSrcweir // class XLineDashItem 881*cdf0e10cSrcweir // ------------------- 882*cdf0e10cSrcweir TYPEINIT1_AUTOFACTORY(XLineDashItem, NameOrIndex); 883*cdf0e10cSrcweir 884*cdf0e10cSrcweir /************************************************************************* 885*cdf0e10cSrcweir |* 886*cdf0e10cSrcweir |* XLineDashItem::XLineDashItem(sal_Int32 nIndex, const XDash& rTheDash) 887*cdf0e10cSrcweir |* 888*cdf0e10cSrcweir |* Beschreibung 889*cdf0e10cSrcweir |* Ersterstellung 15.11.94 890*cdf0e10cSrcweir |* Letzte Aenderung 15.11.94 891*cdf0e10cSrcweir |* 892*cdf0e10cSrcweir *************************************************************************/ 893*cdf0e10cSrcweir 894*cdf0e10cSrcweir XLineDashItem::XLineDashItem(sal_Int32 nIndex, const XDash& rTheDash) : 895*cdf0e10cSrcweir NameOrIndex(XATTR_LINEDASH, nIndex), 896*cdf0e10cSrcweir aDash(rTheDash) 897*cdf0e10cSrcweir { 898*cdf0e10cSrcweir } 899*cdf0e10cSrcweir 900*cdf0e10cSrcweir /************************************************************************* 901*cdf0e10cSrcweir |* 902*cdf0e10cSrcweir |* XLineDashItem::XLineDashItem(const String& rName, const XDash& rTheDash) 903*cdf0e10cSrcweir |* 904*cdf0e10cSrcweir |* Beschreibung 905*cdf0e10cSrcweir |* Ersterstellung 15.11.94 906*cdf0e10cSrcweir |* Letzte Aenderung 15.11.94 907*cdf0e10cSrcweir |* 908*cdf0e10cSrcweir *************************************************************************/ 909*cdf0e10cSrcweir 910*cdf0e10cSrcweir XLineDashItem::XLineDashItem(const XubString& rName, const XDash& rTheDash) : 911*cdf0e10cSrcweir NameOrIndex(XATTR_LINEDASH, rName), 912*cdf0e10cSrcweir aDash(rTheDash) 913*cdf0e10cSrcweir { 914*cdf0e10cSrcweir } 915*cdf0e10cSrcweir 916*cdf0e10cSrcweir /************************************************************************* 917*cdf0e10cSrcweir |* 918*cdf0e10cSrcweir |* XLineDashItem::XLineDashItem(const XLineDashItem& rItem) 919*cdf0e10cSrcweir |* 920*cdf0e10cSrcweir |* Beschreibung 921*cdf0e10cSrcweir |* Ersterstellung 15.11.94 922*cdf0e10cSrcweir |* Letzte Aenderung 15.11.94 923*cdf0e10cSrcweir |* 924*cdf0e10cSrcweir *************************************************************************/ 925*cdf0e10cSrcweir 926*cdf0e10cSrcweir XLineDashItem::XLineDashItem(const XLineDashItem& rItem) : 927*cdf0e10cSrcweir NameOrIndex(rItem), 928*cdf0e10cSrcweir aDash(rItem.aDash) 929*cdf0e10cSrcweir { 930*cdf0e10cSrcweir } 931*cdf0e10cSrcweir 932*cdf0e10cSrcweir /************************************************************************* 933*cdf0e10cSrcweir |* 934*cdf0e10cSrcweir |* XLineDashItem::XLineDashItem(SvStream& rIn) 935*cdf0e10cSrcweir |* 936*cdf0e10cSrcweir |* Beschreibung 937*cdf0e10cSrcweir |* Ersterstellung 15.11.94 938*cdf0e10cSrcweir |* Letzte Aenderung 15.11.94 939*cdf0e10cSrcweir |* 940*cdf0e10cSrcweir *************************************************************************/ 941*cdf0e10cSrcweir 942*cdf0e10cSrcweir XLineDashItem::XLineDashItem(SvStream& rIn) : 943*cdf0e10cSrcweir NameOrIndex(XATTR_LINEDASH, rIn) 944*cdf0e10cSrcweir { 945*cdf0e10cSrcweir if (!IsIndex()) 946*cdf0e10cSrcweir { 947*cdf0e10cSrcweir sal_uInt16 nSTemp; 948*cdf0e10cSrcweir sal_uInt32 nLTemp; 949*cdf0e10cSrcweir sal_Int32 nITemp; 950*cdf0e10cSrcweir 951*cdf0e10cSrcweir rIn >> nITemp; aDash.SetDashStyle((XDashStyle)nITemp); 952*cdf0e10cSrcweir rIn >> nSTemp; aDash.SetDots(nSTemp); 953*cdf0e10cSrcweir rIn >> nLTemp; aDash.SetDotLen(nLTemp); 954*cdf0e10cSrcweir rIn >> nSTemp; aDash.SetDashes(nSTemp); 955*cdf0e10cSrcweir rIn >> nLTemp; aDash.SetDashLen(nLTemp); 956*cdf0e10cSrcweir rIn >> nLTemp; aDash.SetDistance(nLTemp); 957*cdf0e10cSrcweir } 958*cdf0e10cSrcweir } 959*cdf0e10cSrcweir 960*cdf0e10cSrcweir //************************************************************************* 961*cdf0e10cSrcweir 962*cdf0e10cSrcweir XLineDashItem::XLineDashItem(SfxItemPool* /*pPool*/, const XDash& rTheDash) 963*cdf0e10cSrcweir : NameOrIndex( XATTR_LINEDASH, -1 ), 964*cdf0e10cSrcweir aDash(rTheDash) 965*cdf0e10cSrcweir { 966*cdf0e10cSrcweir } 967*cdf0e10cSrcweir 968*cdf0e10cSrcweir //************************************************************************* 969*cdf0e10cSrcweir 970*cdf0e10cSrcweir XLineDashItem::XLineDashItem(SfxItemPool* /*pPool*/) 971*cdf0e10cSrcweir : NameOrIndex(XATTR_LINEDASH, -1 ) 972*cdf0e10cSrcweir { 973*cdf0e10cSrcweir } 974*cdf0e10cSrcweir 975*cdf0e10cSrcweir /************************************************************************* 976*cdf0e10cSrcweir |* 977*cdf0e10cSrcweir |* XLineDashItem::Clone(SfxItemPool* pPool) const 978*cdf0e10cSrcweir |* 979*cdf0e10cSrcweir |* Beschreibung 980*cdf0e10cSrcweir |* Ersterstellung 15.11.94 981*cdf0e10cSrcweir |* Letzte Aenderung 15.11.94 982*cdf0e10cSrcweir |* 983*cdf0e10cSrcweir *************************************************************************/ 984*cdf0e10cSrcweir 985*cdf0e10cSrcweir SfxPoolItem* XLineDashItem::Clone(SfxItemPool* /*pPool*/) const 986*cdf0e10cSrcweir { 987*cdf0e10cSrcweir return new XLineDashItem(*this); 988*cdf0e10cSrcweir } 989*cdf0e10cSrcweir 990*cdf0e10cSrcweir /************************************************************************* 991*cdf0e10cSrcweir |* 992*cdf0e10cSrcweir |* int XLineDashItem::operator==(const SfxPoolItem& rItem) const 993*cdf0e10cSrcweir |* 994*cdf0e10cSrcweir |* Beschreibung 995*cdf0e10cSrcweir |* Ersterstellung 15.11.94 996*cdf0e10cSrcweir |* Letzte Aenderung 15.11.94 997*cdf0e10cSrcweir |* 998*cdf0e10cSrcweir *************************************************************************/ 999*cdf0e10cSrcweir 1000*cdf0e10cSrcweir int XLineDashItem::operator==(const SfxPoolItem& rItem) const 1001*cdf0e10cSrcweir { 1002*cdf0e10cSrcweir return ( NameOrIndex::operator==(rItem) && 1003*cdf0e10cSrcweir aDash == ((const XLineDashItem&) rItem).aDash ); 1004*cdf0e10cSrcweir } 1005*cdf0e10cSrcweir 1006*cdf0e10cSrcweir /************************************************************************* 1007*cdf0e10cSrcweir |* 1008*cdf0e10cSrcweir |* SfxPoolItem* XLineDashItem::Create(SvStream& rIn, sal_uInt16 nVer) const 1009*cdf0e10cSrcweir |* 1010*cdf0e10cSrcweir |* Beschreibung 1011*cdf0e10cSrcweir |* Ersterstellung 15.11.94 1012*cdf0e10cSrcweir |* Letzte Aenderung 15.11.94 1013*cdf0e10cSrcweir |* 1014*cdf0e10cSrcweir *************************************************************************/ 1015*cdf0e10cSrcweir 1016*cdf0e10cSrcweir SfxPoolItem* XLineDashItem::Create(SvStream& rIn, sal_uInt16 /*nVer*/) const 1017*cdf0e10cSrcweir { 1018*cdf0e10cSrcweir return new XLineDashItem(rIn); 1019*cdf0e10cSrcweir } 1020*cdf0e10cSrcweir 1021*cdf0e10cSrcweir /************************************************************************* 1022*cdf0e10cSrcweir |* 1023*cdf0e10cSrcweir |* SfxPoolItem* XLineDashItem::Store(SvStream& rOut) const 1024*cdf0e10cSrcweir |* 1025*cdf0e10cSrcweir |* Beschreibung 1026*cdf0e10cSrcweir |* Ersterstellung 15.11.94 1027*cdf0e10cSrcweir |* Letzte Aenderung 15.11.94 1028*cdf0e10cSrcweir |* 1029*cdf0e10cSrcweir *************************************************************************/ 1030*cdf0e10cSrcweir 1031*cdf0e10cSrcweir SvStream& XLineDashItem::Store( SvStream& rOut, sal_uInt16 nItemVersion ) const 1032*cdf0e10cSrcweir { 1033*cdf0e10cSrcweir NameOrIndex::Store( rOut, nItemVersion ); 1034*cdf0e10cSrcweir 1035*cdf0e10cSrcweir if (!IsIndex()) 1036*cdf0e10cSrcweir { 1037*cdf0e10cSrcweir rOut << (sal_Int32) aDash.GetDashStyle(); 1038*cdf0e10cSrcweir rOut << aDash.GetDots(); 1039*cdf0e10cSrcweir rOut << (sal_uInt32) aDash.GetDotLen(); 1040*cdf0e10cSrcweir rOut << aDash.GetDashes(); 1041*cdf0e10cSrcweir rOut << (sal_uInt32) aDash.GetDashLen(); 1042*cdf0e10cSrcweir rOut << (sal_uInt32) aDash.GetDistance(); 1043*cdf0e10cSrcweir } 1044*cdf0e10cSrcweir 1045*cdf0e10cSrcweir return rOut; 1046*cdf0e10cSrcweir } 1047*cdf0e10cSrcweir 1048*cdf0e10cSrcweir /************************************************************************* 1049*cdf0e10cSrcweir |* 1050*cdf0e10cSrcweir |* const XDash& XLineDashItem::GetValue(const XDashTable* pTable) const 1051*cdf0e10cSrcweir |* 1052*cdf0e10cSrcweir |* Beschreibung 1053*cdf0e10cSrcweir |* Ersterstellung 15.11.94 1054*cdf0e10cSrcweir |* Letzte Aenderung 18.11.94 1055*cdf0e10cSrcweir |* 1056*cdf0e10cSrcweir *************************************************************************/ 1057*cdf0e10cSrcweir 1058*cdf0e10cSrcweir const XDash& XLineDashItem::GetDashValue(const XDashTable* pTable) const // GetValue -> GetDashValue 1059*cdf0e10cSrcweir { 1060*cdf0e10cSrcweir if (!IsIndex()) 1061*cdf0e10cSrcweir return aDash; 1062*cdf0e10cSrcweir else 1063*cdf0e10cSrcweir return pTable->GetDash(GetIndex())->GetDash(); 1064*cdf0e10cSrcweir } 1065*cdf0e10cSrcweir 1066*cdf0e10cSrcweir //------------------------------------------------------------------------ 1067*cdf0e10cSrcweir 1068*cdf0e10cSrcweir SfxItemPresentation XLineDashItem::GetPresentation 1069*cdf0e10cSrcweir ( 1070*cdf0e10cSrcweir SfxItemPresentation ePres, 1071*cdf0e10cSrcweir SfxMapUnit /*eCoreUnit*/, 1072*cdf0e10cSrcweir SfxMapUnit /*ePresUnit*/, 1073*cdf0e10cSrcweir XubString& rText, const IntlWrapper * 1074*cdf0e10cSrcweir ) const 1075*cdf0e10cSrcweir { 1076*cdf0e10cSrcweir switch ( ePres ) 1077*cdf0e10cSrcweir { 1078*cdf0e10cSrcweir case SFX_ITEM_PRESENTATION_NONE: 1079*cdf0e10cSrcweir rText.Erase(); 1080*cdf0e10cSrcweir return ePres; 1081*cdf0e10cSrcweir case SFX_ITEM_PRESENTATION_NAMELESS: 1082*cdf0e10cSrcweir case SFX_ITEM_PRESENTATION_COMPLETE: 1083*cdf0e10cSrcweir rText = GetName(); 1084*cdf0e10cSrcweir return ePres; 1085*cdf0e10cSrcweir default: 1086*cdf0e10cSrcweir return SFX_ITEM_PRESENTATION_NONE; 1087*cdf0e10cSrcweir } 1088*cdf0e10cSrcweir } 1089*cdf0e10cSrcweir 1090*cdf0e10cSrcweir //------------------------------------------------------------------------ 1091*cdf0e10cSrcweir 1092*cdf0e10cSrcweir FASTBOOL XLineDashItem::HasMetrics() const 1093*cdf0e10cSrcweir { 1094*cdf0e10cSrcweir return sal_True; 1095*cdf0e10cSrcweir } 1096*cdf0e10cSrcweir 1097*cdf0e10cSrcweir //------------------------------------------------------------------------ 1098*cdf0e10cSrcweir 1099*cdf0e10cSrcweir FASTBOOL XLineDashItem::ScaleMetrics(long nMul, long nDiv) 1100*cdf0e10cSrcweir { 1101*cdf0e10cSrcweir aDash.SetDotLen( ScaleMetricValue( aDash.GetDotLen(), nMul, nDiv ) ); 1102*cdf0e10cSrcweir aDash.SetDashLen( ScaleMetricValue( aDash.GetDashLen(), nMul, nDiv ) ); 1103*cdf0e10cSrcweir aDash.SetDistance( ScaleMetricValue( aDash.GetDistance(), nMul, nDiv ) ); 1104*cdf0e10cSrcweir return sal_True; 1105*cdf0e10cSrcweir } 1106*cdf0e10cSrcweir 1107*cdf0e10cSrcweir sal_Bool XLineDashItem::QueryValue( ::com::sun::star::uno::Any& rVal, sal_uInt8 nMemberId ) const 1108*cdf0e10cSrcweir { 1109*cdf0e10cSrcweir // sal_Bool bConvert = 0!=(nMemberId&CONVERT_TWIPS); 1110*cdf0e10cSrcweir nMemberId &= ~CONVERT_TWIPS; 1111*cdf0e10cSrcweir 1112*cdf0e10cSrcweir switch ( nMemberId ) 1113*cdf0e10cSrcweir { 1114*cdf0e10cSrcweir case 0: 1115*cdf0e10cSrcweir { 1116*cdf0e10cSrcweir uno::Sequence< beans::PropertyValue > aPropSeq( 2 ); 1117*cdf0e10cSrcweir 1118*cdf0e10cSrcweir ::com::sun::star::drawing::LineDash aLineDash; 1119*cdf0e10cSrcweir 1120*cdf0e10cSrcweir const XDash& rXD = GetDashValue(); 1121*cdf0e10cSrcweir aLineDash.Style = (::com::sun::star::drawing::DashStyle)((sal_uInt16)rXD.GetDashStyle()); 1122*cdf0e10cSrcweir aLineDash.Dots = rXD.GetDots(); 1123*cdf0e10cSrcweir aLineDash.DotLen = rXD.GetDotLen(); 1124*cdf0e10cSrcweir aLineDash.Dashes = rXD.GetDashes(); 1125*cdf0e10cSrcweir aLineDash.DashLen = rXD.GetDashLen(); 1126*cdf0e10cSrcweir aLineDash.Distance = rXD.GetDistance(); 1127*cdf0e10cSrcweir 1128*cdf0e10cSrcweir rtl::OUString aApiName; 1129*cdf0e10cSrcweir SvxUnogetApiNameForItem( Which(), GetName(), aApiName ); 1130*cdf0e10cSrcweir aPropSeq[0].Name = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "Name" )); 1131*cdf0e10cSrcweir aPropSeq[0].Value = uno::makeAny( aApiName ); 1132*cdf0e10cSrcweir aPropSeq[1].Name = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "LineDash" )); 1133*cdf0e10cSrcweir aPropSeq[1].Value = uno::makeAny( aLineDash ); 1134*cdf0e10cSrcweir rVal = uno::makeAny( aPropSeq ); 1135*cdf0e10cSrcweir break; 1136*cdf0e10cSrcweir } 1137*cdf0e10cSrcweir 1138*cdf0e10cSrcweir case MID_NAME: 1139*cdf0e10cSrcweir { 1140*cdf0e10cSrcweir rtl::OUString aApiName; 1141*cdf0e10cSrcweir SvxUnogetApiNameForItem( Which(), GetName(), aApiName ); 1142*cdf0e10cSrcweir rVal <<= aApiName; 1143*cdf0e10cSrcweir break; 1144*cdf0e10cSrcweir } 1145*cdf0e10cSrcweir 1146*cdf0e10cSrcweir case MID_LINEDASH: 1147*cdf0e10cSrcweir { 1148*cdf0e10cSrcweir const XDash& rXD = GetDashValue(); 1149*cdf0e10cSrcweir 1150*cdf0e10cSrcweir ::com::sun::star::drawing::LineDash aLineDash; 1151*cdf0e10cSrcweir 1152*cdf0e10cSrcweir aLineDash.Style = (::com::sun::star::drawing::DashStyle)((sal_uInt16)rXD.GetDashStyle()); 1153*cdf0e10cSrcweir aLineDash.Dots = rXD.GetDots(); 1154*cdf0e10cSrcweir aLineDash.DotLen = rXD.GetDotLen(); 1155*cdf0e10cSrcweir aLineDash.Dashes = rXD.GetDashes(); 1156*cdf0e10cSrcweir aLineDash.DashLen = rXD.GetDashLen(); 1157*cdf0e10cSrcweir aLineDash.Distance = rXD.GetDistance(); 1158*cdf0e10cSrcweir 1159*cdf0e10cSrcweir rVal <<= aLineDash; 1160*cdf0e10cSrcweir break; 1161*cdf0e10cSrcweir } 1162*cdf0e10cSrcweir 1163*cdf0e10cSrcweir case MID_LINEDASH_STYLE: 1164*cdf0e10cSrcweir { 1165*cdf0e10cSrcweir const XDash& rXD = GetDashValue(); 1166*cdf0e10cSrcweir rVal <<= (::com::sun::star::drawing::DashStyle)((sal_Int16)rXD.GetDashStyle()); 1167*cdf0e10cSrcweir break; 1168*cdf0e10cSrcweir } 1169*cdf0e10cSrcweir 1170*cdf0e10cSrcweir case MID_LINEDASH_DOTS: 1171*cdf0e10cSrcweir { 1172*cdf0e10cSrcweir const XDash& rXD = GetDashValue(); 1173*cdf0e10cSrcweir rVal <<= rXD.GetDots(); 1174*cdf0e10cSrcweir break; 1175*cdf0e10cSrcweir } 1176*cdf0e10cSrcweir 1177*cdf0e10cSrcweir case MID_LINEDASH_DOTLEN: 1178*cdf0e10cSrcweir { 1179*cdf0e10cSrcweir const XDash& rXD = GetDashValue(); 1180*cdf0e10cSrcweir rVal <<= rXD.GetDotLen(); 1181*cdf0e10cSrcweir break; 1182*cdf0e10cSrcweir } 1183*cdf0e10cSrcweir 1184*cdf0e10cSrcweir case MID_LINEDASH_DASHES: 1185*cdf0e10cSrcweir { 1186*cdf0e10cSrcweir const XDash& rXD = GetDashValue(); 1187*cdf0e10cSrcweir rVal <<= rXD.GetDashes(); 1188*cdf0e10cSrcweir break; 1189*cdf0e10cSrcweir } 1190*cdf0e10cSrcweir 1191*cdf0e10cSrcweir case MID_LINEDASH_DASHLEN: 1192*cdf0e10cSrcweir { 1193*cdf0e10cSrcweir const XDash& rXD = GetDashValue(); 1194*cdf0e10cSrcweir rVal <<= rXD.GetDashLen(); 1195*cdf0e10cSrcweir break; 1196*cdf0e10cSrcweir } 1197*cdf0e10cSrcweir 1198*cdf0e10cSrcweir case MID_LINEDASH_DISTANCE: 1199*cdf0e10cSrcweir { 1200*cdf0e10cSrcweir const XDash& rXD = GetDashValue(); 1201*cdf0e10cSrcweir rVal <<= rXD.GetDistance(); 1202*cdf0e10cSrcweir break; 1203*cdf0e10cSrcweir } 1204*cdf0e10cSrcweir 1205*cdf0e10cSrcweir default: DBG_ERROR("Wrong MemberId!"); return sal_False; 1206*cdf0e10cSrcweir } 1207*cdf0e10cSrcweir 1208*cdf0e10cSrcweir return sal_True; 1209*cdf0e10cSrcweir } 1210*cdf0e10cSrcweir 1211*cdf0e10cSrcweir sal_Bool XLineDashItem::PutValue( const ::com::sun::star::uno::Any& rVal, sal_uInt8 nMemberId ) 1212*cdf0e10cSrcweir { 1213*cdf0e10cSrcweir // sal_Bool bConvert = 0!=(nMemberId&CONVERT_TWIPS); 1214*cdf0e10cSrcweir nMemberId &= ~CONVERT_TWIPS; 1215*cdf0e10cSrcweir 1216*cdf0e10cSrcweir switch ( nMemberId ) 1217*cdf0e10cSrcweir { 1218*cdf0e10cSrcweir case 0: 1219*cdf0e10cSrcweir { 1220*cdf0e10cSrcweir uno::Sequence< beans::PropertyValue > aPropSeq; 1221*cdf0e10cSrcweir ::com::sun::star::drawing::LineDash aLineDash; 1222*cdf0e10cSrcweir rtl::OUString aName; 1223*cdf0e10cSrcweir sal_Bool bLineDash( sal_False ); 1224*cdf0e10cSrcweir 1225*cdf0e10cSrcweir if ( rVal >>= aPropSeq ) 1226*cdf0e10cSrcweir { 1227*cdf0e10cSrcweir for ( sal_Int32 n = 0; n < aPropSeq.getLength(); n++ ) 1228*cdf0e10cSrcweir { 1229*cdf0e10cSrcweir if ( aPropSeq[n].Name.equalsAsciiL( "Name", 4 )) 1230*cdf0e10cSrcweir aPropSeq[n].Value >>= aName; 1231*cdf0e10cSrcweir else if ( aPropSeq[n].Name.equalsAsciiL( "LineDash", 8 )) 1232*cdf0e10cSrcweir { 1233*cdf0e10cSrcweir if ( aPropSeq[n].Value >>= aLineDash ) 1234*cdf0e10cSrcweir bLineDash = sal_True; 1235*cdf0e10cSrcweir } 1236*cdf0e10cSrcweir } 1237*cdf0e10cSrcweir 1238*cdf0e10cSrcweir SetName( aName ); 1239*cdf0e10cSrcweir if ( bLineDash ) 1240*cdf0e10cSrcweir { 1241*cdf0e10cSrcweir XDash aXDash; 1242*cdf0e10cSrcweir 1243*cdf0e10cSrcweir aXDash.SetDashStyle((XDashStyle)((sal_uInt16)(aLineDash.Style))); 1244*cdf0e10cSrcweir aXDash.SetDots(aLineDash.Dots); 1245*cdf0e10cSrcweir aXDash.SetDotLen(aLineDash.DotLen); 1246*cdf0e10cSrcweir aXDash.SetDashes(aLineDash.Dashes); 1247*cdf0e10cSrcweir aXDash.SetDashLen(aLineDash.DashLen); 1248*cdf0e10cSrcweir aXDash.SetDistance(aLineDash.Distance); 1249*cdf0e10cSrcweir 1250*cdf0e10cSrcweir if((0 == aXDash.GetDots()) && (0 == aXDash.GetDashes())) 1251*cdf0e10cSrcweir aXDash.SetDots(1); 1252*cdf0e10cSrcweir 1253*cdf0e10cSrcweir SetDashValue( aXDash ); 1254*cdf0e10cSrcweir } 1255*cdf0e10cSrcweir 1256*cdf0e10cSrcweir return sal_True; 1257*cdf0e10cSrcweir } 1258*cdf0e10cSrcweir 1259*cdf0e10cSrcweir return sal_False; 1260*cdf0e10cSrcweir } 1261*cdf0e10cSrcweir 1262*cdf0e10cSrcweir case MID_NAME: 1263*cdf0e10cSrcweir { 1264*cdf0e10cSrcweir rtl::OUString aName; 1265*cdf0e10cSrcweir if (!(rVal >>= aName)) 1266*cdf0e10cSrcweir return sal_False; 1267*cdf0e10cSrcweir SetName( aName ); 1268*cdf0e10cSrcweir break; 1269*cdf0e10cSrcweir } 1270*cdf0e10cSrcweir 1271*cdf0e10cSrcweir case MID_LINEDASH: 1272*cdf0e10cSrcweir { 1273*cdf0e10cSrcweir ::com::sun::star::drawing::LineDash aLineDash; 1274*cdf0e10cSrcweir if(!(rVal >>= aLineDash)) 1275*cdf0e10cSrcweir return sal_False; 1276*cdf0e10cSrcweir 1277*cdf0e10cSrcweir XDash aXDash; 1278*cdf0e10cSrcweir 1279*cdf0e10cSrcweir aXDash.SetDashStyle((XDashStyle)((sal_uInt16)(aLineDash.Style))); 1280*cdf0e10cSrcweir aXDash.SetDots(aLineDash.Dots); 1281*cdf0e10cSrcweir aXDash.SetDotLen(aLineDash.DotLen); 1282*cdf0e10cSrcweir aXDash.SetDashes(aLineDash.Dashes); 1283*cdf0e10cSrcweir aXDash.SetDashLen(aLineDash.DashLen); 1284*cdf0e10cSrcweir aXDash.SetDistance(aLineDash.Distance); 1285*cdf0e10cSrcweir 1286*cdf0e10cSrcweir if((0 == aXDash.GetDots()) && (0 == aXDash.GetDashes())) 1287*cdf0e10cSrcweir aXDash.SetDots(1); 1288*cdf0e10cSrcweir 1289*cdf0e10cSrcweir SetDashValue( aXDash ); 1290*cdf0e10cSrcweir break; 1291*cdf0e10cSrcweir } 1292*cdf0e10cSrcweir 1293*cdf0e10cSrcweir case MID_LINEDASH_STYLE: 1294*cdf0e10cSrcweir { 1295*cdf0e10cSrcweir sal_Int16 nVal = sal_Int16(); 1296*cdf0e10cSrcweir if(!(rVal >>= nVal)) 1297*cdf0e10cSrcweir return sal_False; 1298*cdf0e10cSrcweir 1299*cdf0e10cSrcweir XDash aXDash = GetDashValue(); 1300*cdf0e10cSrcweir aXDash.SetDashStyle((XDashStyle)((sal_uInt16)(nVal))); 1301*cdf0e10cSrcweir 1302*cdf0e10cSrcweir if((0 == aXDash.GetDots()) && (0 == aXDash.GetDashes())) 1303*cdf0e10cSrcweir aXDash.SetDots(1); 1304*cdf0e10cSrcweir 1305*cdf0e10cSrcweir SetDashValue( aXDash ); 1306*cdf0e10cSrcweir 1307*cdf0e10cSrcweir break; 1308*cdf0e10cSrcweir } 1309*cdf0e10cSrcweir 1310*cdf0e10cSrcweir case MID_LINEDASH_DOTS: 1311*cdf0e10cSrcweir case MID_LINEDASH_DASHES: 1312*cdf0e10cSrcweir { 1313*cdf0e10cSrcweir sal_Int16 nVal = sal_Int16(); 1314*cdf0e10cSrcweir if(!(rVal >>= nVal)) 1315*cdf0e10cSrcweir return sal_False; 1316*cdf0e10cSrcweir 1317*cdf0e10cSrcweir XDash aXDash = GetDashValue(); 1318*cdf0e10cSrcweir if ( nMemberId == MID_LINEDASH_DOTS ) 1319*cdf0e10cSrcweir aXDash.SetDots( nVal ); 1320*cdf0e10cSrcweir else 1321*cdf0e10cSrcweir aXDash.SetDashes( nVal ); 1322*cdf0e10cSrcweir 1323*cdf0e10cSrcweir if((0 == aXDash.GetDots()) && (0 == aXDash.GetDashes())) 1324*cdf0e10cSrcweir aXDash.SetDots(1); 1325*cdf0e10cSrcweir 1326*cdf0e10cSrcweir SetDashValue( aXDash ); 1327*cdf0e10cSrcweir break; 1328*cdf0e10cSrcweir } 1329*cdf0e10cSrcweir 1330*cdf0e10cSrcweir case MID_LINEDASH_DOTLEN: 1331*cdf0e10cSrcweir case MID_LINEDASH_DASHLEN: 1332*cdf0e10cSrcweir case MID_LINEDASH_DISTANCE: 1333*cdf0e10cSrcweir { 1334*cdf0e10cSrcweir sal_Int32 nVal = 0; 1335*cdf0e10cSrcweir if(!(rVal >>= nVal)) 1336*cdf0e10cSrcweir return sal_False; 1337*cdf0e10cSrcweir 1338*cdf0e10cSrcweir XDash aXDash = GetDashValue(); 1339*cdf0e10cSrcweir if ( nMemberId == MID_LINEDASH_DOTLEN ) 1340*cdf0e10cSrcweir aXDash.SetDotLen( nVal ); 1341*cdf0e10cSrcweir else if ( nMemberId == MID_LINEDASH_DASHLEN ) 1342*cdf0e10cSrcweir aXDash.SetDashLen( nVal ); 1343*cdf0e10cSrcweir else 1344*cdf0e10cSrcweir aXDash.SetDistance( nVal ); 1345*cdf0e10cSrcweir 1346*cdf0e10cSrcweir if((0 == aXDash.GetDots()) && (0 == aXDash.GetDashes())) 1347*cdf0e10cSrcweir aXDash.SetDots(1); 1348*cdf0e10cSrcweir 1349*cdf0e10cSrcweir SetDashValue( aXDash ); 1350*cdf0e10cSrcweir break; 1351*cdf0e10cSrcweir } 1352*cdf0e10cSrcweir } 1353*cdf0e10cSrcweir 1354*cdf0e10cSrcweir return sal_True; 1355*cdf0e10cSrcweir } 1356*cdf0e10cSrcweir 1357*cdf0e10cSrcweir sal_Bool XLineDashItem::CompareValueFunc( const NameOrIndex* p1, const NameOrIndex* p2 ) 1358*cdf0e10cSrcweir { 1359*cdf0e10cSrcweir return ((XLineDashItem*)p1)->GetDashValue() == ((XLineDashItem*)p2)->GetDashValue(); 1360*cdf0e10cSrcweir } 1361*cdf0e10cSrcweir 1362*cdf0e10cSrcweir XLineDashItem* XLineDashItem::checkForUniqueItem( SdrModel* pModel ) const 1363*cdf0e10cSrcweir { 1364*cdf0e10cSrcweir if( pModel ) 1365*cdf0e10cSrcweir { 1366*cdf0e10cSrcweir const String aUniqueName = NameOrIndex::CheckNamedItem( this, 1367*cdf0e10cSrcweir XATTR_LINEDASH, 1368*cdf0e10cSrcweir &pModel->GetItemPool(), 1369*cdf0e10cSrcweir pModel->GetStyleSheetPool() ? &pModel->GetStyleSheetPool()->GetPool() : NULL, 1370*cdf0e10cSrcweir XLineDashItem::CompareValueFunc, 1371*cdf0e10cSrcweir RID_SVXSTR_DASH11, 1372*cdf0e10cSrcweir pModel->GetDashList() ); 1373*cdf0e10cSrcweir 1374*cdf0e10cSrcweir // if the given name is not valid, replace it! 1375*cdf0e10cSrcweir if( aUniqueName != GetName() ) 1376*cdf0e10cSrcweir { 1377*cdf0e10cSrcweir return new XLineDashItem( aUniqueName, aDash ); 1378*cdf0e10cSrcweir } 1379*cdf0e10cSrcweir } 1380*cdf0e10cSrcweir 1381*cdf0e10cSrcweir return (XLineDashItem*)this; 1382*cdf0e10cSrcweir } 1383*cdf0e10cSrcweir 1384*cdf0e10cSrcweir // ------------------- 1385*cdf0e10cSrcweir // class XLineWidthItem 1386*cdf0e10cSrcweir // ------------------- 1387*cdf0e10cSrcweir TYPEINIT1_AUTOFACTORY(XLineWidthItem, SfxMetricItem); 1388*cdf0e10cSrcweir 1389*cdf0e10cSrcweir /************************************************************************* 1390*cdf0e10cSrcweir |* 1391*cdf0e10cSrcweir |* XLineWidthItem::XLineWidthItem(long nWidth) 1392*cdf0e10cSrcweir |* 1393*cdf0e10cSrcweir |* Beschreibung 1394*cdf0e10cSrcweir |* Ersterstellung 15.11.94 1395*cdf0e10cSrcweir |* Letzte Aenderung 18.11.94 1396*cdf0e10cSrcweir |* 1397*cdf0e10cSrcweir *************************************************************************/ 1398*cdf0e10cSrcweir 1399*cdf0e10cSrcweir XLineWidthItem::XLineWidthItem(long nWidth) : 1400*cdf0e10cSrcweir SfxMetricItem(XATTR_LINEWIDTH, nWidth) 1401*cdf0e10cSrcweir { 1402*cdf0e10cSrcweir } 1403*cdf0e10cSrcweir 1404*cdf0e10cSrcweir /************************************************************************* 1405*cdf0e10cSrcweir |* 1406*cdf0e10cSrcweir |* XLineWidthItem::XLineWidthItem(SvStream& rIn) 1407*cdf0e10cSrcweir |* 1408*cdf0e10cSrcweir |* Beschreibung 1409*cdf0e10cSrcweir |* Ersterstellung 15.11.94 1410*cdf0e10cSrcweir |* Letzte Aenderung 15.11.94 1411*cdf0e10cSrcweir |* 1412*cdf0e10cSrcweir *************************************************************************/ 1413*cdf0e10cSrcweir 1414*cdf0e10cSrcweir XLineWidthItem::XLineWidthItem(SvStream& rIn) : 1415*cdf0e10cSrcweir SfxMetricItem(XATTR_LINEWIDTH, rIn) 1416*cdf0e10cSrcweir { 1417*cdf0e10cSrcweir } 1418*cdf0e10cSrcweir 1419*cdf0e10cSrcweir /************************************************************************* 1420*cdf0e10cSrcweir |* 1421*cdf0e10cSrcweir |* XLineWidthItem::Clone(SfxItemPool* pPool) const 1422*cdf0e10cSrcweir |* 1423*cdf0e10cSrcweir |* Beschreibung 1424*cdf0e10cSrcweir |* Ersterstellung 15.11.94 1425*cdf0e10cSrcweir |* Letzte Aenderung 15.11.94 1426*cdf0e10cSrcweir |* 1427*cdf0e10cSrcweir *************************************************************************/ 1428*cdf0e10cSrcweir 1429*cdf0e10cSrcweir SfxPoolItem* XLineWidthItem::Clone(SfxItemPool* /*pPool*/) const 1430*cdf0e10cSrcweir { 1431*cdf0e10cSrcweir return new XLineWidthItem(*this); 1432*cdf0e10cSrcweir } 1433*cdf0e10cSrcweir 1434*cdf0e10cSrcweir /************************************************************************* 1435*cdf0e10cSrcweir |* 1436*cdf0e10cSrcweir |* SfxPoolItem* XLineWidthItem::Create(SvStream& rIn, sal_uInt16 nVer) const 1437*cdf0e10cSrcweir |* 1438*cdf0e10cSrcweir |* Beschreibung 1439*cdf0e10cSrcweir |* Ersterstellung 15.11.94 1440*cdf0e10cSrcweir |* Letzte Aenderung 15.11.94 1441*cdf0e10cSrcweir |* 1442*cdf0e10cSrcweir *************************************************************************/ 1443*cdf0e10cSrcweir 1444*cdf0e10cSrcweir SfxPoolItem* XLineWidthItem::Create(SvStream& rIn, sal_uInt16 /*nVer*/) const 1445*cdf0e10cSrcweir { 1446*cdf0e10cSrcweir return new XLineWidthItem(rIn); 1447*cdf0e10cSrcweir } 1448*cdf0e10cSrcweir 1449*cdf0e10cSrcweir //------------------------------------------------------------------------ 1450*cdf0e10cSrcweir 1451*cdf0e10cSrcweir SfxItemPresentation XLineWidthItem::GetPresentation 1452*cdf0e10cSrcweir ( 1453*cdf0e10cSrcweir SfxItemPresentation ePres, 1454*cdf0e10cSrcweir SfxMapUnit eCoreUnit, 1455*cdf0e10cSrcweir SfxMapUnit ePresUnit, 1456*cdf0e10cSrcweir XubString& rText, const IntlWrapper * pIntl 1457*cdf0e10cSrcweir ) const 1458*cdf0e10cSrcweir { 1459*cdf0e10cSrcweir switch ( ePres ) 1460*cdf0e10cSrcweir { 1461*cdf0e10cSrcweir case SFX_ITEM_PRESENTATION_NONE: 1462*cdf0e10cSrcweir rText.Erase(); 1463*cdf0e10cSrcweir return ePres; 1464*cdf0e10cSrcweir case SFX_ITEM_PRESENTATION_NAMELESS: 1465*cdf0e10cSrcweir case SFX_ITEM_PRESENTATION_COMPLETE: 1466*cdf0e10cSrcweir rText = GetMetricText( (long) GetValue(), 1467*cdf0e10cSrcweir eCoreUnit, ePresUnit, pIntl); 1468*cdf0e10cSrcweir rText += SVX_RESSTR( GetMetricId( ePresUnit) ); 1469*cdf0e10cSrcweir return ePres; 1470*cdf0e10cSrcweir default: 1471*cdf0e10cSrcweir return SFX_ITEM_PRESENTATION_NONE; 1472*cdf0e10cSrcweir } 1473*cdf0e10cSrcweir } 1474*cdf0e10cSrcweir 1475*cdf0e10cSrcweir sal_Bool XLineWidthItem::QueryValue( ::com::sun::star::uno::Any& rVal, sal_uInt8 nMemberId ) const 1476*cdf0e10cSrcweir { 1477*cdf0e10cSrcweir sal_Int32 nValue = GetValue(); 1478*cdf0e10cSrcweir if( 0 != (nMemberId&CONVERT_TWIPS) ) 1479*cdf0e10cSrcweir nValue = TWIP_TO_MM100(nValue); 1480*cdf0e10cSrcweir 1481*cdf0e10cSrcweir rVal <<= nValue; 1482*cdf0e10cSrcweir return sal_True; 1483*cdf0e10cSrcweir } 1484*cdf0e10cSrcweir 1485*cdf0e10cSrcweir sal_Bool XLineWidthItem::PutValue( const ::com::sun::star::uno::Any& rVal, sal_uInt8 nMemberId ) 1486*cdf0e10cSrcweir { 1487*cdf0e10cSrcweir sal_Int32 nValue = 0; 1488*cdf0e10cSrcweir rVal >>= nValue; 1489*cdf0e10cSrcweir if( 0 != (nMemberId&CONVERT_TWIPS) ) 1490*cdf0e10cSrcweir nValue = MM100_TO_TWIP(nValue); 1491*cdf0e10cSrcweir 1492*cdf0e10cSrcweir SetValue( nValue ); 1493*cdf0e10cSrcweir return sal_True; 1494*cdf0e10cSrcweir } 1495*cdf0e10cSrcweir 1496*cdf0e10cSrcweir // ------------------- 1497*cdf0e10cSrcweir // class XLineColorItem 1498*cdf0e10cSrcweir // ------------------- 1499*cdf0e10cSrcweir TYPEINIT1_AUTOFACTORY(XLineColorItem, XColorItem); 1500*cdf0e10cSrcweir 1501*cdf0e10cSrcweir /************************************************************************* 1502*cdf0e10cSrcweir |* 1503*cdf0e10cSrcweir |* XLineColorItem::XLineColorItem(sal_Int32 nIndex, const Color& rTheColor) 1504*cdf0e10cSrcweir |* 1505*cdf0e10cSrcweir |* Beschreibung 1506*cdf0e10cSrcweir |* Ersterstellung 15.11.94 1507*cdf0e10cSrcweir |* Letzte Aenderung 15.11.94 1508*cdf0e10cSrcweir |* 1509*cdf0e10cSrcweir *************************************************************************/ 1510*cdf0e10cSrcweir 1511*cdf0e10cSrcweir XLineColorItem::XLineColorItem(sal_Int32 nIndex, const Color& rTheColor) : 1512*cdf0e10cSrcweir XColorItem(XATTR_LINECOLOR, nIndex, rTheColor) 1513*cdf0e10cSrcweir { 1514*cdf0e10cSrcweir } 1515*cdf0e10cSrcweir 1516*cdf0e10cSrcweir /************************************************************************* 1517*cdf0e10cSrcweir |* 1518*cdf0e10cSrcweir |* XLineColorItem::XLineColorItem(const XubString& rName, const Color& rTheColor) 1519*cdf0e10cSrcweir |* 1520*cdf0e10cSrcweir |* Beschreibung 1521*cdf0e10cSrcweir |* Ersterstellung 15.11.94 1522*cdf0e10cSrcweir |* Letzte Aenderung 15.11.94 1523*cdf0e10cSrcweir |* 1524*cdf0e10cSrcweir *************************************************************************/ 1525*cdf0e10cSrcweir 1526*cdf0e10cSrcweir XLineColorItem::XLineColorItem(const XubString& rName, const Color& rTheColor) : 1527*cdf0e10cSrcweir XColorItem(XATTR_LINECOLOR, rName, rTheColor) 1528*cdf0e10cSrcweir { 1529*cdf0e10cSrcweir } 1530*cdf0e10cSrcweir 1531*cdf0e10cSrcweir /************************************************************************* 1532*cdf0e10cSrcweir |* 1533*cdf0e10cSrcweir |* XLineColorItem::XLineColorItem(SvStream& rIn) 1534*cdf0e10cSrcweir |* 1535*cdf0e10cSrcweir |* Beschreibung 1536*cdf0e10cSrcweir |* Ersterstellung 15.11.94 1537*cdf0e10cSrcweir |* Letzte Aenderung 15.11.94 1538*cdf0e10cSrcweir |* 1539*cdf0e10cSrcweir *************************************************************************/ 1540*cdf0e10cSrcweir 1541*cdf0e10cSrcweir XLineColorItem::XLineColorItem(SvStream& rIn) : 1542*cdf0e10cSrcweir XColorItem(XATTR_LINECOLOR, rIn) 1543*cdf0e10cSrcweir { 1544*cdf0e10cSrcweir } 1545*cdf0e10cSrcweir 1546*cdf0e10cSrcweir /************************************************************************* 1547*cdf0e10cSrcweir |* 1548*cdf0e10cSrcweir |* XLineColorItem::Clone(SfxItemPool* pPool) const 1549*cdf0e10cSrcweir |* 1550*cdf0e10cSrcweir |* Beschreibung 1551*cdf0e10cSrcweir |* Ersterstellung 15.11.94 1552*cdf0e10cSrcweir |* Letzte Aenderung 15.11.94 1553*cdf0e10cSrcweir |* 1554*cdf0e10cSrcweir *************************************************************************/ 1555*cdf0e10cSrcweir 1556*cdf0e10cSrcweir SfxPoolItem* XLineColorItem::Clone(SfxItemPool* /*pPool*/) const 1557*cdf0e10cSrcweir { 1558*cdf0e10cSrcweir return new XLineColorItem(*this); 1559*cdf0e10cSrcweir } 1560*cdf0e10cSrcweir 1561*cdf0e10cSrcweir /************************************************************************* 1562*cdf0e10cSrcweir |* 1563*cdf0e10cSrcweir |* SfxPoolItem* XLineColorItem::Create(SvStream& rIn, sal_uInt16 nVer) const 1564*cdf0e10cSrcweir |* 1565*cdf0e10cSrcweir |* Beschreibung 1566*cdf0e10cSrcweir |* Ersterstellung 15.11.94 1567*cdf0e10cSrcweir |* Letzte Aenderung 15.11.94 1568*cdf0e10cSrcweir |* 1569*cdf0e10cSrcweir *************************************************************************/ 1570*cdf0e10cSrcweir 1571*cdf0e10cSrcweir SfxPoolItem* XLineColorItem::Create(SvStream& rIn, sal_uInt16 /*nVer*/) const 1572*cdf0e10cSrcweir { 1573*cdf0e10cSrcweir return new XLineColorItem(rIn); 1574*cdf0e10cSrcweir } 1575*cdf0e10cSrcweir 1576*cdf0e10cSrcweir //------------------------------------------------------------------------ 1577*cdf0e10cSrcweir 1578*cdf0e10cSrcweir SfxItemPresentation XLineColorItem::GetPresentation 1579*cdf0e10cSrcweir ( 1580*cdf0e10cSrcweir SfxItemPresentation ePres, 1581*cdf0e10cSrcweir SfxMapUnit /*eCoreUnit*/, 1582*cdf0e10cSrcweir SfxMapUnit /*ePresUnit*/, 1583*cdf0e10cSrcweir XubString& rText, const IntlWrapper * 1584*cdf0e10cSrcweir ) const 1585*cdf0e10cSrcweir { 1586*cdf0e10cSrcweir switch ( ePres ) 1587*cdf0e10cSrcweir { 1588*cdf0e10cSrcweir case SFX_ITEM_PRESENTATION_NONE: 1589*cdf0e10cSrcweir rText.Erase(); 1590*cdf0e10cSrcweir return ePres; 1591*cdf0e10cSrcweir case SFX_ITEM_PRESENTATION_NAMELESS: 1592*cdf0e10cSrcweir case SFX_ITEM_PRESENTATION_COMPLETE: 1593*cdf0e10cSrcweir rText = GetName(); 1594*cdf0e10cSrcweir return ePres; 1595*cdf0e10cSrcweir default: 1596*cdf0e10cSrcweir return SFX_ITEM_PRESENTATION_NONE; 1597*cdf0e10cSrcweir } 1598*cdf0e10cSrcweir } 1599*cdf0e10cSrcweir 1600*cdf0e10cSrcweir sal_Bool XLineColorItem::QueryValue( ::com::sun::star::uno::Any& rVal, sal_uInt8 /*nMemberId*/) const 1601*cdf0e10cSrcweir { 1602*cdf0e10cSrcweir rVal <<= (sal_Int32)GetColorValue().GetRGBColor(); 1603*cdf0e10cSrcweir return sal_True; 1604*cdf0e10cSrcweir } 1605*cdf0e10cSrcweir 1606*cdf0e10cSrcweir sal_Bool XLineColorItem::PutValue( const ::com::sun::star::uno::Any& rVal, sal_uInt8 /*nMemberId*/) 1607*cdf0e10cSrcweir { 1608*cdf0e10cSrcweir sal_Int32 nValue = 0; 1609*cdf0e10cSrcweir if(!(rVal >>= nValue)) 1610*cdf0e10cSrcweir return sal_False; 1611*cdf0e10cSrcweir 1612*cdf0e10cSrcweir SetColorValue( nValue ); 1613*cdf0e10cSrcweir return sal_True; 1614*cdf0e10cSrcweir } 1615*cdf0e10cSrcweir 1616*cdf0e10cSrcweir ////////////////////////////////////////////////////////////////////////////// 1617*cdf0e10cSrcweir // tooling for simple spooling B2DPolygon to file and back 1618*cdf0e10cSrcweir 1619*cdf0e10cSrcweir namespace 1620*cdf0e10cSrcweir { 1621*cdf0e10cSrcweir void streamOutB2DPolyPolygon(const basegfx::B2DPolyPolygon& rPolyPolygon, SvStream& rOut) 1622*cdf0e10cSrcweir { 1623*cdf0e10cSrcweir const sal_uInt32 nPolygonCount(rPolyPolygon.count()); 1624*cdf0e10cSrcweir rOut << nPolygonCount; 1625*cdf0e10cSrcweir 1626*cdf0e10cSrcweir for(sal_uInt32 a(0L); a < nPolygonCount; a++) 1627*cdf0e10cSrcweir { 1628*cdf0e10cSrcweir const basegfx::B2DPolygon aCandidate(rPolyPolygon.getB2DPolygon(a)); 1629*cdf0e10cSrcweir const sal_uInt32 nPointCount(aCandidate.count()); 1630*cdf0e10cSrcweir const sal_uInt8 bClosed(aCandidate.isClosed() ? 1 : 0); 1631*cdf0e10cSrcweir const sal_uInt8 bControlPoints(aCandidate.areControlPointsUsed() ? 1 : 0); 1632*cdf0e10cSrcweir rOut << nPointCount; 1633*cdf0e10cSrcweir rOut << bClosed; 1634*cdf0e10cSrcweir rOut << bControlPoints; 1635*cdf0e10cSrcweir 1636*cdf0e10cSrcweir for(sal_uInt32 b(0L); b < nPointCount; b++) 1637*cdf0e10cSrcweir { 1638*cdf0e10cSrcweir const basegfx::B2DPoint aPoint(aCandidate.getB2DPoint(b)); 1639*cdf0e10cSrcweir rOut << aPoint.getX(); 1640*cdf0e10cSrcweir rOut << aPoint.getY(); 1641*cdf0e10cSrcweir 1642*cdf0e10cSrcweir if(bControlPoints) 1643*cdf0e10cSrcweir { 1644*cdf0e10cSrcweir const sal_uInt8 bEdgeIsCurve(aCandidate.isPrevControlPointUsed(b) || aCandidate.isNextControlPointUsed(b) ? 1 : 0); 1645*cdf0e10cSrcweir rOut << bEdgeIsCurve; 1646*cdf0e10cSrcweir 1647*cdf0e10cSrcweir if(bEdgeIsCurve) 1648*cdf0e10cSrcweir { 1649*cdf0e10cSrcweir const basegfx::B2DVector aControlVectorA(aCandidate.getPrevControlPoint(b)); 1650*cdf0e10cSrcweir rOut << aControlVectorA.getX(); 1651*cdf0e10cSrcweir rOut << aControlVectorA.getY(); 1652*cdf0e10cSrcweir 1653*cdf0e10cSrcweir const basegfx::B2DVector aControlVectorB(aCandidate.getNextControlPoint(b)); 1654*cdf0e10cSrcweir rOut << aControlVectorB.getX(); 1655*cdf0e10cSrcweir rOut << aControlVectorB.getY(); 1656*cdf0e10cSrcweir } 1657*cdf0e10cSrcweir } 1658*cdf0e10cSrcweir } 1659*cdf0e10cSrcweir } 1660*cdf0e10cSrcweir } 1661*cdf0e10cSrcweir 1662*cdf0e10cSrcweir basegfx::B2DPolyPolygon streamInB2DPolyPolygon(SvStream& rIn) 1663*cdf0e10cSrcweir { 1664*cdf0e10cSrcweir basegfx::B2DPolyPolygon aRetval; 1665*cdf0e10cSrcweir sal_uInt32 nPolygonCount; 1666*cdf0e10cSrcweir rIn >> nPolygonCount; 1667*cdf0e10cSrcweir 1668*cdf0e10cSrcweir for(sal_uInt32 a(0L); a < nPolygonCount; a++) 1669*cdf0e10cSrcweir { 1670*cdf0e10cSrcweir sal_uInt32 nPointCount; 1671*cdf0e10cSrcweir sal_uInt8 bClosed; 1672*cdf0e10cSrcweir sal_uInt8 bControlPoints; 1673*cdf0e10cSrcweir 1674*cdf0e10cSrcweir rIn >> nPointCount; 1675*cdf0e10cSrcweir rIn >> bClosed; 1676*cdf0e10cSrcweir rIn >> bControlPoints; 1677*cdf0e10cSrcweir 1678*cdf0e10cSrcweir basegfx::B2DPolygon aCandidate; 1679*cdf0e10cSrcweir aCandidate.setClosed(0 != bClosed); 1680*cdf0e10cSrcweir 1681*cdf0e10cSrcweir for(sal_uInt32 b(0L); b < nPointCount; b++) 1682*cdf0e10cSrcweir { 1683*cdf0e10cSrcweir double fX, fY; 1684*cdf0e10cSrcweir rIn >> fX; 1685*cdf0e10cSrcweir rIn >> fY; 1686*cdf0e10cSrcweir aCandidate.append(basegfx::B2DPoint(fX, fY)); 1687*cdf0e10cSrcweir 1688*cdf0e10cSrcweir if(0 != bControlPoints) 1689*cdf0e10cSrcweir { 1690*cdf0e10cSrcweir sal_uInt8 bEdgeIsCurve; 1691*cdf0e10cSrcweir rIn >> bEdgeIsCurve; 1692*cdf0e10cSrcweir 1693*cdf0e10cSrcweir if(0 != bEdgeIsCurve) 1694*cdf0e10cSrcweir { 1695*cdf0e10cSrcweir rIn >> fX; 1696*cdf0e10cSrcweir rIn >> fY; 1697*cdf0e10cSrcweir aCandidate.setPrevControlPoint(b, basegfx::B2DVector(fX, fY)); 1698*cdf0e10cSrcweir 1699*cdf0e10cSrcweir rIn >> fX; 1700*cdf0e10cSrcweir rIn >> fY; 1701*cdf0e10cSrcweir aCandidate.setNextControlPoint(b, basegfx::B2DVector(fX, fY)); 1702*cdf0e10cSrcweir } 1703*cdf0e10cSrcweir } 1704*cdf0e10cSrcweir } 1705*cdf0e10cSrcweir 1706*cdf0e10cSrcweir aRetval.append(aCandidate); 1707*cdf0e10cSrcweir } 1708*cdf0e10cSrcweir 1709*cdf0e10cSrcweir return aRetval; 1710*cdf0e10cSrcweir } 1711*cdf0e10cSrcweir } 1712*cdf0e10cSrcweir 1713*cdf0e10cSrcweir ////////////////////////////////////////////////////////////////////////////// 1714*cdf0e10cSrcweir 1715*cdf0e10cSrcweir // ----------------------- 1716*cdf0e10cSrcweir // class XLineStartItem 1717*cdf0e10cSrcweir // ----------------------- 1718*cdf0e10cSrcweir TYPEINIT1_AUTOFACTORY(XLineStartItem, NameOrIndex); 1719*cdf0e10cSrcweir 1720*cdf0e10cSrcweir /************************************************************************* 1721*cdf0e10cSrcweir |* 1722*cdf0e10cSrcweir |* XLineStartItem::XLineStartItem(sal_Int32 nIndex) 1723*cdf0e10cSrcweir |* 1724*cdf0e10cSrcweir |* Beschreibung 1725*cdf0e10cSrcweir |* Ersterstellung 15.11.94 1726*cdf0e10cSrcweir |* Letzte Aenderung 18.11.94 1727*cdf0e10cSrcweir |* 1728*cdf0e10cSrcweir *************************************************************************/ 1729*cdf0e10cSrcweir 1730*cdf0e10cSrcweir XLineStartItem::XLineStartItem(sal_Int32 nIndex) 1731*cdf0e10cSrcweir : NameOrIndex(XATTR_LINESTART, nIndex) 1732*cdf0e10cSrcweir { 1733*cdf0e10cSrcweir } 1734*cdf0e10cSrcweir 1735*cdf0e10cSrcweir /************************************************************************* 1736*cdf0e10cSrcweir |* 1737*cdf0e10cSrcweir |* XLineStartItem::XLineStartItem(const XubString& rName, 1738*cdf0e10cSrcweir |* const basegfx::B2DPolyPolygon& rXPolygon) 1739*cdf0e10cSrcweir |* 1740*cdf0e10cSrcweir |* Beschreibung 1741*cdf0e10cSrcweir |* Ersterstellung 15.11.94 1742*cdf0e10cSrcweir |* Letzte Aenderung 18.11.94 1743*cdf0e10cSrcweir |* 1744*cdf0e10cSrcweir *************************************************************************/ 1745*cdf0e10cSrcweir 1746*cdf0e10cSrcweir XLineStartItem::XLineStartItem(const XubString& rName, const basegfx::B2DPolyPolygon& rPolyPolygon) 1747*cdf0e10cSrcweir : NameOrIndex(XATTR_LINESTART, rName), 1748*cdf0e10cSrcweir maPolyPolygon(rPolyPolygon) 1749*cdf0e10cSrcweir { 1750*cdf0e10cSrcweir } 1751*cdf0e10cSrcweir 1752*cdf0e10cSrcweir /************************************************************************* 1753*cdf0e10cSrcweir |* 1754*cdf0e10cSrcweir |* XLineStartItem::XLineStartItem(const XLineStartItem& rItem) 1755*cdf0e10cSrcweir |* 1756*cdf0e10cSrcweir |* Beschreibung 1757*cdf0e10cSrcweir |* Ersterstellung 15.11.94 1758*cdf0e10cSrcweir |* Letzte Aenderung 17.11.94 1759*cdf0e10cSrcweir |* 1760*cdf0e10cSrcweir *************************************************************************/ 1761*cdf0e10cSrcweir 1762*cdf0e10cSrcweir XLineStartItem::XLineStartItem(const XLineStartItem& rItem) 1763*cdf0e10cSrcweir : NameOrIndex(rItem), 1764*cdf0e10cSrcweir maPolyPolygon(rItem.maPolyPolygon) 1765*cdf0e10cSrcweir { 1766*cdf0e10cSrcweir } 1767*cdf0e10cSrcweir 1768*cdf0e10cSrcweir /************************************************************************* 1769*cdf0e10cSrcweir |* 1770*cdf0e10cSrcweir |* XLineStartItem::XLineStartItem(SvStream& rIn) 1771*cdf0e10cSrcweir |* 1772*cdf0e10cSrcweir |* Beschreibung 1773*cdf0e10cSrcweir |* Ersterstellung 15.11.94 1774*cdf0e10cSrcweir |* Letzte Aenderung 17.11.94 1775*cdf0e10cSrcweir |* 1776*cdf0e10cSrcweir *************************************************************************/ 1777*cdf0e10cSrcweir 1778*cdf0e10cSrcweir XLineStartItem::XLineStartItem(SvStream& rIn) : 1779*cdf0e10cSrcweir NameOrIndex(XATTR_LINESTART, rIn) 1780*cdf0e10cSrcweir { 1781*cdf0e10cSrcweir if (!IsIndex()) 1782*cdf0e10cSrcweir { 1783*cdf0e10cSrcweir maPolyPolygon = streamInB2DPolyPolygon(rIn); 1784*cdf0e10cSrcweir } 1785*cdf0e10cSrcweir } 1786*cdf0e10cSrcweir 1787*cdf0e10cSrcweir //************************************************************************* 1788*cdf0e10cSrcweir 1789*cdf0e10cSrcweir XLineStartItem::XLineStartItem(SfxItemPool* /*pPool*/, const basegfx::B2DPolyPolygon& rPolyPolygon) 1790*cdf0e10cSrcweir : NameOrIndex( XATTR_LINESTART, -1 ), 1791*cdf0e10cSrcweir maPolyPolygon(rPolyPolygon) 1792*cdf0e10cSrcweir { 1793*cdf0e10cSrcweir } 1794*cdf0e10cSrcweir 1795*cdf0e10cSrcweir //************************************************************************* 1796*cdf0e10cSrcweir 1797*cdf0e10cSrcweir XLineStartItem::XLineStartItem(SfxItemPool* /*pPool*/) 1798*cdf0e10cSrcweir : NameOrIndex(XATTR_LINESTART, -1 ) 1799*cdf0e10cSrcweir { 1800*cdf0e10cSrcweir } 1801*cdf0e10cSrcweir 1802*cdf0e10cSrcweir /************************************************************************* 1803*cdf0e10cSrcweir |* 1804*cdf0e10cSrcweir |* XLineStartItem::Clone(SfxItemPool* pPool) const 1805*cdf0e10cSrcweir |* 1806*cdf0e10cSrcweir |* Beschreibung 1807*cdf0e10cSrcweir |* Ersterstellung 15.11.94 1808*cdf0e10cSrcweir |* Letzte Aenderung 15.11.94 1809*cdf0e10cSrcweir |* 1810*cdf0e10cSrcweir *************************************************************************/ 1811*cdf0e10cSrcweir 1812*cdf0e10cSrcweir SfxPoolItem* XLineStartItem::Clone(SfxItemPool* /*pPool*/) const 1813*cdf0e10cSrcweir { 1814*cdf0e10cSrcweir return new XLineStartItem(*this); 1815*cdf0e10cSrcweir } 1816*cdf0e10cSrcweir 1817*cdf0e10cSrcweir /************************************************************************* 1818*cdf0e10cSrcweir |* 1819*cdf0e10cSrcweir |* int XLineStartItem::operator==(const SfxPoolItem& rItem) const 1820*cdf0e10cSrcweir |* 1821*cdf0e10cSrcweir |* Beschreibung 1822*cdf0e10cSrcweir |* Ersterstellung 15.11.94 1823*cdf0e10cSrcweir |* Letzte Aenderung 18.11.94 1824*cdf0e10cSrcweir |* 1825*cdf0e10cSrcweir *************************************************************************/ 1826*cdf0e10cSrcweir 1827*cdf0e10cSrcweir int XLineStartItem::operator==(const SfxPoolItem& rItem) const 1828*cdf0e10cSrcweir { 1829*cdf0e10cSrcweir return ( NameOrIndex::operator==(rItem) && ((const XLineStartItem&) rItem).maPolyPolygon == maPolyPolygon ); 1830*cdf0e10cSrcweir } 1831*cdf0e10cSrcweir 1832*cdf0e10cSrcweir /************************************************************************* 1833*cdf0e10cSrcweir |* 1834*cdf0e10cSrcweir |* SfxPoolItem* XLineStartItem::Create(SvStream& rIn, sal_uInt16 nVer) const 1835*cdf0e10cSrcweir |* 1836*cdf0e10cSrcweir |* Beschreibung 1837*cdf0e10cSrcweir |* Ersterstellung 15.11.94 1838*cdf0e10cSrcweir |* Letzte Aenderung 15.11.94 1839*cdf0e10cSrcweir |* 1840*cdf0e10cSrcweir *************************************************************************/ 1841*cdf0e10cSrcweir 1842*cdf0e10cSrcweir SfxPoolItem* XLineStartItem::Create(SvStream& rIn, sal_uInt16 /*nVer*/) const 1843*cdf0e10cSrcweir { 1844*cdf0e10cSrcweir return new XLineStartItem(rIn); 1845*cdf0e10cSrcweir } 1846*cdf0e10cSrcweir 1847*cdf0e10cSrcweir /************************************************************************* 1848*cdf0e10cSrcweir |* 1849*cdf0e10cSrcweir |* SfxPoolItem* XLineStartItem::Store(SvStream& rOut) const 1850*cdf0e10cSrcweir |* 1851*cdf0e10cSrcweir |* Beschreibung 1852*cdf0e10cSrcweir |* Ersterstellung 15.11.94 1853*cdf0e10cSrcweir |* Letzte Aenderung 18.11.94 1854*cdf0e10cSrcweir |* 1855*cdf0e10cSrcweir *************************************************************************/ 1856*cdf0e10cSrcweir 1857*cdf0e10cSrcweir SvStream& XLineStartItem::Store( SvStream& rOut, sal_uInt16 nItemVersion ) const 1858*cdf0e10cSrcweir { 1859*cdf0e10cSrcweir NameOrIndex::Store( rOut, nItemVersion ); 1860*cdf0e10cSrcweir 1861*cdf0e10cSrcweir if (!IsIndex()) 1862*cdf0e10cSrcweir { 1863*cdf0e10cSrcweir streamOutB2DPolyPolygon(maPolyPolygon, rOut); 1864*cdf0e10cSrcweir } 1865*cdf0e10cSrcweir 1866*cdf0e10cSrcweir return rOut; 1867*cdf0e10cSrcweir } 1868*cdf0e10cSrcweir 1869*cdf0e10cSrcweir /************************************************************************* 1870*cdf0e10cSrcweir |* 1871*cdf0e10cSrcweir |* const basegfx::B2DPolyPolygon& XLineStartItem::GetValue(const XLineEndTable* pTable) 1872*cdf0e10cSrcweir |* const 1873*cdf0e10cSrcweir |* 1874*cdf0e10cSrcweir |* Beschreibung 1875*cdf0e10cSrcweir |* Ersterstellung 15.11.94 1876*cdf0e10cSrcweir |* Letzte Aenderung 18.11.94 1877*cdf0e10cSrcweir |* 1878*cdf0e10cSrcweir *************************************************************************/ 1879*cdf0e10cSrcweir 1880*cdf0e10cSrcweir basegfx::B2DPolyPolygon XLineStartItem::GetLineStartValue(const XLineEndTable* pTable) const 1881*cdf0e10cSrcweir { 1882*cdf0e10cSrcweir if (!IsIndex()) 1883*cdf0e10cSrcweir { 1884*cdf0e10cSrcweir return maPolyPolygon; 1885*cdf0e10cSrcweir } 1886*cdf0e10cSrcweir else 1887*cdf0e10cSrcweir { 1888*cdf0e10cSrcweir return pTable->GetLineEnd(GetIndex())->GetLineEnd(); 1889*cdf0e10cSrcweir } 1890*cdf0e10cSrcweir } 1891*cdf0e10cSrcweir 1892*cdf0e10cSrcweir //------------------------------------------------------------------------ 1893*cdf0e10cSrcweir 1894*cdf0e10cSrcweir SfxItemPresentation XLineStartItem::GetPresentation 1895*cdf0e10cSrcweir ( 1896*cdf0e10cSrcweir SfxItemPresentation ePres, 1897*cdf0e10cSrcweir SfxMapUnit /*eCoreUnit*/, 1898*cdf0e10cSrcweir SfxMapUnit /*ePresUnit*/, 1899*cdf0e10cSrcweir XubString& rText, const IntlWrapper * 1900*cdf0e10cSrcweir ) const 1901*cdf0e10cSrcweir { 1902*cdf0e10cSrcweir switch ( ePres ) 1903*cdf0e10cSrcweir { 1904*cdf0e10cSrcweir case SFX_ITEM_PRESENTATION_NONE: 1905*cdf0e10cSrcweir rText.Erase(); 1906*cdf0e10cSrcweir return ePres; 1907*cdf0e10cSrcweir case SFX_ITEM_PRESENTATION_NAMELESS: 1908*cdf0e10cSrcweir case SFX_ITEM_PRESENTATION_COMPLETE: 1909*cdf0e10cSrcweir rText = GetName(); 1910*cdf0e10cSrcweir return ePres; 1911*cdf0e10cSrcweir default: 1912*cdf0e10cSrcweir return SFX_ITEM_PRESENTATION_NONE; 1913*cdf0e10cSrcweir } 1914*cdf0e10cSrcweir } 1915*cdf0e10cSrcweir 1916*cdf0e10cSrcweir sal_Bool XLineStartItem::QueryValue( ::com::sun::star::uno::Any& rVal, sal_uInt8 nMemberId ) const 1917*cdf0e10cSrcweir { 1918*cdf0e10cSrcweir // sal_Bool bConvert = 0!=(nMemberId&CONVERT_TWIPS); 1919*cdf0e10cSrcweir nMemberId &= ~CONVERT_TWIPS; 1920*cdf0e10cSrcweir if( nMemberId == MID_NAME ) 1921*cdf0e10cSrcweir { 1922*cdf0e10cSrcweir rtl::OUString aApiName; 1923*cdf0e10cSrcweir SvxUnogetApiNameForItem( Which(), GetName(), aApiName ); 1924*cdf0e10cSrcweir rVal <<= aApiName; 1925*cdf0e10cSrcweir } 1926*cdf0e10cSrcweir else 1927*cdf0e10cSrcweir { 1928*cdf0e10cSrcweir com::sun::star::drawing::PolyPolygonBezierCoords aBezier; 1929*cdf0e10cSrcweir SvxConvertB2DPolyPolygonToPolyPolygonBezier( maPolyPolygon, aBezier ); 1930*cdf0e10cSrcweir rVal <<= aBezier; 1931*cdf0e10cSrcweir } 1932*cdf0e10cSrcweir 1933*cdf0e10cSrcweir return sal_True; 1934*cdf0e10cSrcweir } 1935*cdf0e10cSrcweir 1936*cdf0e10cSrcweir sal_Bool XLineStartItem::PutValue( const ::com::sun::star::uno::Any& rVal, sal_uInt8 nMemberId ) 1937*cdf0e10cSrcweir { 1938*cdf0e10cSrcweir // sal_Bool bConvert = 0!=(nMemberId&CONVERT_TWIPS); 1939*cdf0e10cSrcweir nMemberId &= ~CONVERT_TWIPS; 1940*cdf0e10cSrcweir if( nMemberId == MID_NAME ) 1941*cdf0e10cSrcweir { 1942*cdf0e10cSrcweir return sal_False; 1943*cdf0e10cSrcweir } 1944*cdf0e10cSrcweir else 1945*cdf0e10cSrcweir { 1946*cdf0e10cSrcweir maPolyPolygon.clear(); 1947*cdf0e10cSrcweir 1948*cdf0e10cSrcweir if( rVal.hasValue() && rVal.getValue() ) 1949*cdf0e10cSrcweir { 1950*cdf0e10cSrcweir if( rVal.getValueType() != ::getCppuType((const com::sun::star::drawing::PolyPolygonBezierCoords*)0) ) 1951*cdf0e10cSrcweir return sal_False; 1952*cdf0e10cSrcweir 1953*cdf0e10cSrcweir com::sun::star::drawing::PolyPolygonBezierCoords* pCoords = (com::sun::star::drawing::PolyPolygonBezierCoords*)rVal.getValue(); 1954*cdf0e10cSrcweir if( pCoords->Coordinates.getLength() > 0 ) 1955*cdf0e10cSrcweir { 1956*cdf0e10cSrcweir maPolyPolygon = SvxConvertPolyPolygonBezierToB2DPolyPolygon( pCoords ); 1957*cdf0e10cSrcweir // #i72807# close line start/end polygons hard 1958*cdf0e10cSrcweir // maPolyPolygon.setClosed(true); 1959*cdf0e10cSrcweir } 1960*cdf0e10cSrcweir } 1961*cdf0e10cSrcweir } 1962*cdf0e10cSrcweir 1963*cdf0e10cSrcweir return sal_True; 1964*cdf0e10cSrcweir } 1965*cdf0e10cSrcweir 1966*cdf0e10cSrcweir /** this function searches in both the models pool and the styles pool for XLineStartItem 1967*cdf0e10cSrcweir and XLineEndItem with the same value or name and returns an item with the value of 1968*cdf0e10cSrcweir this item and a unique name for an item with this value. */ 1969*cdf0e10cSrcweir XLineStartItem* XLineStartItem::checkForUniqueItem( SdrModel* pModel ) const 1970*cdf0e10cSrcweir { 1971*cdf0e10cSrcweir if( pModel ) 1972*cdf0e10cSrcweir { 1973*cdf0e10cSrcweir XLineStartItem* pTempItem = NULL; 1974*cdf0e10cSrcweir const XLineStartItem* pLineStartItem = this; 1975*cdf0e10cSrcweir 1976*cdf0e10cSrcweir String aUniqueName( GetName() ); 1977*cdf0e10cSrcweir 1978*cdf0e10cSrcweir if( !maPolyPolygon.count() ) 1979*cdf0e10cSrcweir { 1980*cdf0e10cSrcweir // if the polygon is empty, check if the name is empty 1981*cdf0e10cSrcweir if( aUniqueName.Len() == 0 ) 1982*cdf0e10cSrcweir return (XLineStartItem*)this; 1983*cdf0e10cSrcweir 1984*cdf0e10cSrcweir // force empty name for empty polygons 1985*cdf0e10cSrcweir return new XLineStartItem( String(), maPolyPolygon ); 1986*cdf0e10cSrcweir } 1987*cdf0e10cSrcweir 1988*cdf0e10cSrcweir if( maPolyPolygon.count() > 1L ) 1989*cdf0e10cSrcweir { 1990*cdf0e10cSrcweir // check if the polygon is closed 1991*cdf0e10cSrcweir if(!maPolyPolygon.isClosed()) 1992*cdf0e10cSrcweir { 1993*cdf0e10cSrcweir // force a closed polygon 1994*cdf0e10cSrcweir basegfx::B2DPolyPolygon aNew(maPolyPolygon); 1995*cdf0e10cSrcweir aNew.setClosed(true); 1996*cdf0e10cSrcweir pTempItem = new XLineStartItem( aUniqueName, aNew ); 1997*cdf0e10cSrcweir pLineStartItem = pTempItem; 1998*cdf0e10cSrcweir } 1999*cdf0e10cSrcweir } 2000*cdf0e10cSrcweir 2001*cdf0e10cSrcweir sal_Bool bForceNew = sal_False; 2002*cdf0e10cSrcweir 2003*cdf0e10cSrcweir // 2. if we have a name check if there is already an item with the 2004*cdf0e10cSrcweir // same name in the documents pool with a different line end or start 2005*cdf0e10cSrcweir 2006*cdf0e10cSrcweir sal_uInt32 nCount, nSurrogate; 2007*cdf0e10cSrcweir 2008*cdf0e10cSrcweir const SfxItemPool* pPool1 = &pModel->GetItemPool(); 2009*cdf0e10cSrcweir if( aUniqueName.Len() && pPool1 ) 2010*cdf0e10cSrcweir { 2011*cdf0e10cSrcweir nCount = pPool1->GetItemCount2( XATTR_LINESTART ); 2012*cdf0e10cSrcweir 2013*cdf0e10cSrcweir for( nSurrogate = 0; nSurrogate < nCount; nSurrogate++ ) 2014*cdf0e10cSrcweir { 2015*cdf0e10cSrcweir const XLineStartItem* pItem = (const XLineStartItem*)pPool1->GetItem2( XATTR_LINESTART, nSurrogate ); 2016*cdf0e10cSrcweir 2017*cdf0e10cSrcweir if( pItem && ( pItem->GetName() == pLineStartItem->GetName() ) ) 2018*cdf0e10cSrcweir { 2019*cdf0e10cSrcweir // if there is already an item with the same name and the same 2020*cdf0e10cSrcweir // value its ok to set it 2021*cdf0e10cSrcweir if( pItem->GetLineStartValue() != pLineStartItem->GetLineStartValue() ) 2022*cdf0e10cSrcweir { 2023*cdf0e10cSrcweir // same name but different value, we need a new name for this item 2024*cdf0e10cSrcweir aUniqueName = String(); 2025*cdf0e10cSrcweir bForceNew = sal_True; 2026*cdf0e10cSrcweir } 2027*cdf0e10cSrcweir break; 2028*cdf0e10cSrcweir } 2029*cdf0e10cSrcweir } 2030*cdf0e10cSrcweir 2031*cdf0e10cSrcweir if( !bForceNew ) 2032*cdf0e10cSrcweir { 2033*cdf0e10cSrcweir nCount = pPool1->GetItemCount2( XATTR_LINEEND ); 2034*cdf0e10cSrcweir 2035*cdf0e10cSrcweir for( nSurrogate = 0; nSurrogate < nCount; nSurrogate++ ) 2036*cdf0e10cSrcweir { 2037*cdf0e10cSrcweir const XLineEndItem* pItem = (const XLineEndItem*)pPool1->GetItem2( XATTR_LINEEND, nSurrogate ); 2038*cdf0e10cSrcweir 2039*cdf0e10cSrcweir if( pItem && ( pItem->GetName() == pLineStartItem->GetName() ) ) 2040*cdf0e10cSrcweir { 2041*cdf0e10cSrcweir // if there is already an item with the same name and the same 2042*cdf0e10cSrcweir // value its ok to set it 2043*cdf0e10cSrcweir if( pItem->GetLineEndValue() != pLineStartItem->GetLineStartValue() ) 2044*cdf0e10cSrcweir { 2045*cdf0e10cSrcweir // same name but different value, we need a new name for this item 2046*cdf0e10cSrcweir aUniqueName = String(); 2047*cdf0e10cSrcweir bForceNew = sal_True; 2048*cdf0e10cSrcweir } 2049*cdf0e10cSrcweir break; 2050*cdf0e10cSrcweir } 2051*cdf0e10cSrcweir } 2052*cdf0e10cSrcweir } 2053*cdf0e10cSrcweir } 2054*cdf0e10cSrcweir 2055*cdf0e10cSrcweir const SfxItemPool* pPool2 = pModel->GetStyleSheetPool() ? &pModel->GetStyleSheetPool()->GetPool() : NULL; 2056*cdf0e10cSrcweir if( aUniqueName.Len() && pPool2) 2057*cdf0e10cSrcweir { 2058*cdf0e10cSrcweir nCount = pPool2->GetItemCount2( XATTR_LINESTART ); 2059*cdf0e10cSrcweir for( nSurrogate = 0; nSurrogate < nCount; nSurrogate++ ) 2060*cdf0e10cSrcweir { 2061*cdf0e10cSrcweir const XLineStartItem* pItem = (const XLineStartItem*)pPool2->GetItem2( XATTR_LINESTART, nSurrogate ); 2062*cdf0e10cSrcweir 2063*cdf0e10cSrcweir if( pItem && ( pItem->GetName() == pLineStartItem->GetName() ) ) 2064*cdf0e10cSrcweir { 2065*cdf0e10cSrcweir // if there is already an item with the same name and the same 2066*cdf0e10cSrcweir // value its ok to set it 2067*cdf0e10cSrcweir if( pItem->GetLineStartValue() != pLineStartItem->GetLineStartValue() ) 2068*cdf0e10cSrcweir { 2069*cdf0e10cSrcweir // same name but different value, we need a new name for this item 2070*cdf0e10cSrcweir aUniqueName = String(); 2071*cdf0e10cSrcweir bForceNew = sal_True; 2072*cdf0e10cSrcweir } 2073*cdf0e10cSrcweir break; 2074*cdf0e10cSrcweir } 2075*cdf0e10cSrcweir } 2076*cdf0e10cSrcweir 2077*cdf0e10cSrcweir if( !bForceNew ) 2078*cdf0e10cSrcweir { 2079*cdf0e10cSrcweir nCount = pPool2->GetItemCount2( XATTR_LINEEND ); 2080*cdf0e10cSrcweir for( nSurrogate = 0; nSurrogate < nCount; nSurrogate++ ) 2081*cdf0e10cSrcweir { 2082*cdf0e10cSrcweir const XLineEndItem* pItem = (const XLineEndItem*)pPool2->GetItem2( XATTR_LINEEND, nSurrogate ); 2083*cdf0e10cSrcweir 2084*cdf0e10cSrcweir if( pItem && ( pItem->GetName() == pLineStartItem->GetName() ) ) 2085*cdf0e10cSrcweir { 2086*cdf0e10cSrcweir // if there is already an item with the same name and the same 2087*cdf0e10cSrcweir // value its ok to set it 2088*cdf0e10cSrcweir if( pItem->GetLineEndValue() != pLineStartItem->GetLineStartValue() ) 2089*cdf0e10cSrcweir { 2090*cdf0e10cSrcweir // same name but different value, we need a new name for this item 2091*cdf0e10cSrcweir aUniqueName = String(); 2092*cdf0e10cSrcweir bForceNew = sal_True; 2093*cdf0e10cSrcweir } 2094*cdf0e10cSrcweir break; 2095*cdf0e10cSrcweir } 2096*cdf0e10cSrcweir } 2097*cdf0e10cSrcweir } 2098*cdf0e10cSrcweir } 2099*cdf0e10cSrcweir 2100*cdf0e10cSrcweir // if we have no name yet, find existing item with same conent or 2101*cdf0e10cSrcweir // create a unique name 2102*cdf0e10cSrcweir if( aUniqueName.Len() == 0 ) 2103*cdf0e10cSrcweir { 2104*cdf0e10cSrcweir sal_Bool bFoundExisting = sal_False; 2105*cdf0e10cSrcweir 2106*cdf0e10cSrcweir sal_Int32 nUserIndex = 1; 2107*cdf0e10cSrcweir const ResId aRes(SVX_RES(RID_SVXSTR_LINEEND)); 2108*cdf0e10cSrcweir const String aUser( aRes ); 2109*cdf0e10cSrcweir 2110*cdf0e10cSrcweir if( pPool1 ) 2111*cdf0e10cSrcweir { 2112*cdf0e10cSrcweir nCount = pPool1->GetItemCount2( XATTR_LINESTART ); 2113*cdf0e10cSrcweir sal_uInt32 nSurrogate2; 2114*cdf0e10cSrcweir 2115*cdf0e10cSrcweir for( nSurrogate2 = 0; nSurrogate2 < nCount; nSurrogate2++ ) 2116*cdf0e10cSrcweir { 2117*cdf0e10cSrcweir const XLineStartItem* pItem = (const XLineStartItem*)pPool1->GetItem2( XATTR_LINESTART, nSurrogate2 ); 2118*cdf0e10cSrcweir 2119*cdf0e10cSrcweir if( pItem && pItem->GetName().Len() ) 2120*cdf0e10cSrcweir { 2121*cdf0e10cSrcweir if( !bForceNew && pItem->GetLineStartValue() == pLineStartItem->GetLineStartValue() ) 2122*cdf0e10cSrcweir { 2123*cdf0e10cSrcweir aUniqueName = pItem->GetName(); 2124*cdf0e10cSrcweir bFoundExisting = sal_True; 2125*cdf0e10cSrcweir break; 2126*cdf0e10cSrcweir } 2127*cdf0e10cSrcweir 2128*cdf0e10cSrcweir if( pItem->GetName().CompareTo( aUser, aUser.Len() ) == 0 ) 2129*cdf0e10cSrcweir { 2130*cdf0e10cSrcweir sal_Int32 nThisIndex = pItem->GetName().Copy( aUser.Len() ).ToInt32(); 2131*cdf0e10cSrcweir if( nThisIndex >= nUserIndex ) 2132*cdf0e10cSrcweir nUserIndex = nThisIndex + 1; 2133*cdf0e10cSrcweir } 2134*cdf0e10cSrcweir } 2135*cdf0e10cSrcweir } 2136*cdf0e10cSrcweir 2137*cdf0e10cSrcweir nCount = pPool1->GetItemCount2( XATTR_LINEEND ); 2138*cdf0e10cSrcweir for( nSurrogate2 = 0; nSurrogate2 < nCount; nSurrogate2++ ) 2139*cdf0e10cSrcweir { 2140*cdf0e10cSrcweir const XLineEndItem* pItem = (const XLineEndItem*)pPool1->GetItem2( XATTR_LINEEND, nSurrogate2 ); 2141*cdf0e10cSrcweir 2142*cdf0e10cSrcweir if( pItem && pItem->GetName().Len() ) 2143*cdf0e10cSrcweir { 2144*cdf0e10cSrcweir if( !bForceNew && pItem->GetLineEndValue() == pLineStartItem->GetLineStartValue() ) 2145*cdf0e10cSrcweir { 2146*cdf0e10cSrcweir aUniqueName = pItem->GetName(); 2147*cdf0e10cSrcweir bFoundExisting = sal_True; 2148*cdf0e10cSrcweir break; 2149*cdf0e10cSrcweir } 2150*cdf0e10cSrcweir 2151*cdf0e10cSrcweir if( pItem->GetName().CompareTo( aUser, aUser.Len() ) == 0 ) 2152*cdf0e10cSrcweir { 2153*cdf0e10cSrcweir sal_Int32 nThisIndex = pItem->GetName().Copy( aUser.Len() ).ToInt32(); 2154*cdf0e10cSrcweir if( nThisIndex >= nUserIndex ) 2155*cdf0e10cSrcweir nUserIndex = nThisIndex + 1; 2156*cdf0e10cSrcweir } 2157*cdf0e10cSrcweir } 2158*cdf0e10cSrcweir } 2159*cdf0e10cSrcweir } 2160*cdf0e10cSrcweir 2161*cdf0e10cSrcweir if( !bFoundExisting ) 2162*cdf0e10cSrcweir { 2163*cdf0e10cSrcweir aUniqueName = aUser; 2164*cdf0e10cSrcweir aUniqueName += sal_Unicode(' '); 2165*cdf0e10cSrcweir aUniqueName += String::CreateFromInt32( nUserIndex ); 2166*cdf0e10cSrcweir } 2167*cdf0e10cSrcweir } 2168*cdf0e10cSrcweir 2169*cdf0e10cSrcweir // if the given name is not valid, replace it! 2170*cdf0e10cSrcweir if( aUniqueName != GetName() || pTempItem ) 2171*cdf0e10cSrcweir { 2172*cdf0e10cSrcweir if( pTempItem ) 2173*cdf0e10cSrcweir { 2174*cdf0e10cSrcweir pTempItem->SetName( aUniqueName ); 2175*cdf0e10cSrcweir return pTempItem; 2176*cdf0e10cSrcweir } 2177*cdf0e10cSrcweir else 2178*cdf0e10cSrcweir { 2179*cdf0e10cSrcweir return new XLineStartItem( aUniqueName, maPolyPolygon ); 2180*cdf0e10cSrcweir } 2181*cdf0e10cSrcweir } 2182*cdf0e10cSrcweir } 2183*cdf0e10cSrcweir 2184*cdf0e10cSrcweir return (XLineStartItem*)this; 2185*cdf0e10cSrcweir } 2186*cdf0e10cSrcweir 2187*cdf0e10cSrcweir // --------------------- 2188*cdf0e10cSrcweir // class XLineEndItem 2189*cdf0e10cSrcweir // --------------------- 2190*cdf0e10cSrcweir TYPEINIT1_AUTOFACTORY(XLineEndItem, NameOrIndex); 2191*cdf0e10cSrcweir 2192*cdf0e10cSrcweir /************************************************************************* 2193*cdf0e10cSrcweir |* 2194*cdf0e10cSrcweir |* XLineEndItem::XLineEndItem(sal_Int32 nIndex) 2195*cdf0e10cSrcweir |* 2196*cdf0e10cSrcweir |* Beschreibung 2197*cdf0e10cSrcweir |* Ersterstellung 15.11.94 2198*cdf0e10cSrcweir |* Letzte Aenderung 18.11.94 2199*cdf0e10cSrcweir |* 2200*cdf0e10cSrcweir *************************************************************************/ 2201*cdf0e10cSrcweir 2202*cdf0e10cSrcweir XLineEndItem::XLineEndItem(sal_Int32 nIndex) 2203*cdf0e10cSrcweir : NameOrIndex(XATTR_LINEEND, nIndex) 2204*cdf0e10cSrcweir { 2205*cdf0e10cSrcweir } 2206*cdf0e10cSrcweir 2207*cdf0e10cSrcweir /************************************************************************* 2208*cdf0e10cSrcweir |* 2209*cdf0e10cSrcweir |* XLineEndItem::XLineEndItem(const XubString& rName, 2210*cdf0e10cSrcweir |* const basegfx::B2DPolyPolygon& rXPolygon) 2211*cdf0e10cSrcweir |* 2212*cdf0e10cSrcweir |* Beschreibung 2213*cdf0e10cSrcweir |* Ersterstellung 15.11.94 2214*cdf0e10cSrcweir |* Letzte Aenderung 18.11.94 2215*cdf0e10cSrcweir |* 2216*cdf0e10cSrcweir *************************************************************************/ 2217*cdf0e10cSrcweir 2218*cdf0e10cSrcweir XLineEndItem::XLineEndItem(const XubString& rName, const basegfx::B2DPolyPolygon& rPolyPolygon) 2219*cdf0e10cSrcweir : NameOrIndex(XATTR_LINEEND, rName), 2220*cdf0e10cSrcweir maPolyPolygon(rPolyPolygon) 2221*cdf0e10cSrcweir { 2222*cdf0e10cSrcweir } 2223*cdf0e10cSrcweir 2224*cdf0e10cSrcweir /************************************************************************* 2225*cdf0e10cSrcweir |* 2226*cdf0e10cSrcweir |* XLineEndItem::XLineEndItem(const XLineEndItem& rItem) 2227*cdf0e10cSrcweir |* 2228*cdf0e10cSrcweir |* Beschreibung 2229*cdf0e10cSrcweir |* Ersterstellung 15.11.94 2230*cdf0e10cSrcweir |* Letzte Aenderung 18.11.94 2231*cdf0e10cSrcweir |* 2232*cdf0e10cSrcweir *************************************************************************/ 2233*cdf0e10cSrcweir 2234*cdf0e10cSrcweir XLineEndItem::XLineEndItem(const XLineEndItem& rItem) 2235*cdf0e10cSrcweir : NameOrIndex(rItem), 2236*cdf0e10cSrcweir maPolyPolygon(rItem.maPolyPolygon) 2237*cdf0e10cSrcweir { 2238*cdf0e10cSrcweir } 2239*cdf0e10cSrcweir 2240*cdf0e10cSrcweir /************************************************************************* 2241*cdf0e10cSrcweir |* 2242*cdf0e10cSrcweir |* XLineEndItem::XLineEndItem(SvStream& rIn) 2243*cdf0e10cSrcweir |* 2244*cdf0e10cSrcweir |* Beschreibung 2245*cdf0e10cSrcweir |* Ersterstellung 15.11.94 2246*cdf0e10cSrcweir |* Letzte Aenderung 17.11.94 2247*cdf0e10cSrcweir |* 2248*cdf0e10cSrcweir *************************************************************************/ 2249*cdf0e10cSrcweir 2250*cdf0e10cSrcweir XLineEndItem::XLineEndItem(SvStream& rIn) : 2251*cdf0e10cSrcweir NameOrIndex(XATTR_LINEEND, rIn) 2252*cdf0e10cSrcweir { 2253*cdf0e10cSrcweir if (!IsIndex()) 2254*cdf0e10cSrcweir { 2255*cdf0e10cSrcweir maPolyPolygon = streamInB2DPolyPolygon(rIn); 2256*cdf0e10cSrcweir } 2257*cdf0e10cSrcweir } 2258*cdf0e10cSrcweir 2259*cdf0e10cSrcweir //************************************************************************* 2260*cdf0e10cSrcweir 2261*cdf0e10cSrcweir XLineEndItem::XLineEndItem(SfxItemPool* /*pPool*/, const basegfx::B2DPolyPolygon& rPolyPolygon) 2262*cdf0e10cSrcweir : NameOrIndex( XATTR_LINEEND, -1 ), 2263*cdf0e10cSrcweir maPolyPolygon(rPolyPolygon) 2264*cdf0e10cSrcweir { 2265*cdf0e10cSrcweir } 2266*cdf0e10cSrcweir 2267*cdf0e10cSrcweir //************************************************************************* 2268*cdf0e10cSrcweir 2269*cdf0e10cSrcweir XLineEndItem::XLineEndItem(SfxItemPool* /*pPool*/) 2270*cdf0e10cSrcweir : NameOrIndex(XATTR_LINEEND, -1 ) 2271*cdf0e10cSrcweir { 2272*cdf0e10cSrcweir } 2273*cdf0e10cSrcweir 2274*cdf0e10cSrcweir /************************************************************************* 2275*cdf0e10cSrcweir |* 2276*cdf0e10cSrcweir |* XLineEndItem::Clone(SfxItemPool* pPool) const 2277*cdf0e10cSrcweir |* 2278*cdf0e10cSrcweir |* Beschreibung 2279*cdf0e10cSrcweir |* Ersterstellung 15.11.94 2280*cdf0e10cSrcweir |* Letzte Aenderung 15.11.94 2281*cdf0e10cSrcweir |* 2282*cdf0e10cSrcweir *************************************************************************/ 2283*cdf0e10cSrcweir 2284*cdf0e10cSrcweir SfxPoolItem* XLineEndItem::Clone(SfxItemPool* /*pPool*/) const 2285*cdf0e10cSrcweir { 2286*cdf0e10cSrcweir return new XLineEndItem(*this); 2287*cdf0e10cSrcweir } 2288*cdf0e10cSrcweir 2289*cdf0e10cSrcweir /************************************************************************* 2290*cdf0e10cSrcweir |* 2291*cdf0e10cSrcweir |* int XLineEndItem::operator==(const SfxPoolItem& rItem) const 2292*cdf0e10cSrcweir |* 2293*cdf0e10cSrcweir |* Beschreibung 2294*cdf0e10cSrcweir |* Ersterstellung 15.11.94 2295*cdf0e10cSrcweir |* Letzte Aenderung 17.11.94 2296*cdf0e10cSrcweir |* 2297*cdf0e10cSrcweir *************************************************************************/ 2298*cdf0e10cSrcweir 2299*cdf0e10cSrcweir int XLineEndItem::operator==(const SfxPoolItem& rItem) const 2300*cdf0e10cSrcweir { 2301*cdf0e10cSrcweir return ( NameOrIndex::operator==(rItem) && ((const XLineEndItem&) rItem).maPolyPolygon == maPolyPolygon ); 2302*cdf0e10cSrcweir } 2303*cdf0e10cSrcweir 2304*cdf0e10cSrcweir /************************************************************************* 2305*cdf0e10cSrcweir |* 2306*cdf0e10cSrcweir |* SfxPoolItem* XLineEndItem::Create(SvStream& rIn, sal_uInt16 nVer) const 2307*cdf0e10cSrcweir |* 2308*cdf0e10cSrcweir |* Beschreibung 2309*cdf0e10cSrcweir |* Ersterstellung 15.11.94 2310*cdf0e10cSrcweir |* Letzte Aenderung 15.11.94 2311*cdf0e10cSrcweir |* 2312*cdf0e10cSrcweir *************************************************************************/ 2313*cdf0e10cSrcweir 2314*cdf0e10cSrcweir SfxPoolItem* XLineEndItem::Create(SvStream& rIn, sal_uInt16 /*nVer*/) const 2315*cdf0e10cSrcweir { 2316*cdf0e10cSrcweir return new XLineEndItem(rIn); 2317*cdf0e10cSrcweir } 2318*cdf0e10cSrcweir 2319*cdf0e10cSrcweir /************************************************************************* 2320*cdf0e10cSrcweir |* 2321*cdf0e10cSrcweir |* SfxPoolItem* XLineEndItem::Store(SvStream& rOut) const 2322*cdf0e10cSrcweir |* 2323*cdf0e10cSrcweir |* Beschreibung 2324*cdf0e10cSrcweir |* Ersterstellung 15.11.94 2325*cdf0e10cSrcweir |* Letzte Aenderung 17.11.94 2326*cdf0e10cSrcweir |* 2327*cdf0e10cSrcweir *************************************************************************/ 2328*cdf0e10cSrcweir 2329*cdf0e10cSrcweir SvStream& XLineEndItem::Store( SvStream& rOut, sal_uInt16 nItemVersion ) const 2330*cdf0e10cSrcweir { 2331*cdf0e10cSrcweir NameOrIndex::Store( rOut, nItemVersion ); 2332*cdf0e10cSrcweir 2333*cdf0e10cSrcweir if (!IsIndex()) 2334*cdf0e10cSrcweir { 2335*cdf0e10cSrcweir streamOutB2DPolyPolygon(maPolyPolygon, rOut); 2336*cdf0e10cSrcweir } 2337*cdf0e10cSrcweir 2338*cdf0e10cSrcweir return rOut; 2339*cdf0e10cSrcweir } 2340*cdf0e10cSrcweir 2341*cdf0e10cSrcweir /************************************************************************* 2342*cdf0e10cSrcweir |* 2343*cdf0e10cSrcweir |* const basegfx::B2DPolyPolygon& XLineEndItem::GetValue(const XLineEndTable* pTable) const 2344*cdf0e10cSrcweir |* 2345*cdf0e10cSrcweir |* Beschreibung 2346*cdf0e10cSrcweir |* Ersterstellung 15.11.94 2347*cdf0e10cSrcweir |* Letzte Aenderung 18.11.94 2348*cdf0e10cSrcweir |* 2349*cdf0e10cSrcweir *************************************************************************/ 2350*cdf0e10cSrcweir 2351*cdf0e10cSrcweir basegfx::B2DPolyPolygon XLineEndItem::GetLineEndValue(const XLineEndTable* pTable) const 2352*cdf0e10cSrcweir { 2353*cdf0e10cSrcweir if (!IsIndex()) 2354*cdf0e10cSrcweir { 2355*cdf0e10cSrcweir return maPolyPolygon; 2356*cdf0e10cSrcweir } 2357*cdf0e10cSrcweir else 2358*cdf0e10cSrcweir { 2359*cdf0e10cSrcweir return pTable->GetLineEnd(GetIndex())->GetLineEnd(); 2360*cdf0e10cSrcweir } 2361*cdf0e10cSrcweir } 2362*cdf0e10cSrcweir 2363*cdf0e10cSrcweir 2364*cdf0e10cSrcweir /** this function searches in both the models pool and the styles pool for XLineStartItem 2365*cdf0e10cSrcweir and XLineEndItem with the same value or name and returns an item with the value of 2366*cdf0e10cSrcweir this item and a unique name for an item with this value. */ 2367*cdf0e10cSrcweir XLineEndItem* XLineEndItem::checkForUniqueItem( SdrModel* pModel ) const 2368*cdf0e10cSrcweir { 2369*cdf0e10cSrcweir if( pModel ) 2370*cdf0e10cSrcweir { 2371*cdf0e10cSrcweir XLineEndItem* pTempItem = NULL; 2372*cdf0e10cSrcweir const XLineEndItem* pLineEndItem = this; 2373*cdf0e10cSrcweir 2374*cdf0e10cSrcweir String aUniqueName( GetName() ); 2375*cdf0e10cSrcweir 2376*cdf0e10cSrcweir if( !maPolyPolygon.count() ) 2377*cdf0e10cSrcweir { 2378*cdf0e10cSrcweir // if the polygon is empty, check if the name is empty 2379*cdf0e10cSrcweir if( aUniqueName.Len() == 0 ) 2380*cdf0e10cSrcweir return (XLineEndItem*)this; 2381*cdf0e10cSrcweir 2382*cdf0e10cSrcweir // force empty name for empty polygons 2383*cdf0e10cSrcweir return new XLineEndItem( String(), maPolyPolygon ); 2384*cdf0e10cSrcweir } 2385*cdf0e10cSrcweir 2386*cdf0e10cSrcweir if( maPolyPolygon.count() > 1L ) 2387*cdf0e10cSrcweir { 2388*cdf0e10cSrcweir // check if the polygon is closed 2389*cdf0e10cSrcweir if(!maPolyPolygon.isClosed()) 2390*cdf0e10cSrcweir { 2391*cdf0e10cSrcweir // force a closed polygon 2392*cdf0e10cSrcweir basegfx::B2DPolyPolygon aNew(maPolyPolygon); 2393*cdf0e10cSrcweir aNew.setClosed(true); 2394*cdf0e10cSrcweir pTempItem = new XLineEndItem( aUniqueName, aNew ); 2395*cdf0e10cSrcweir pLineEndItem = pTempItem; 2396*cdf0e10cSrcweir } 2397*cdf0e10cSrcweir } 2398*cdf0e10cSrcweir 2399*cdf0e10cSrcweir sal_Bool bForceNew = sal_False; 2400*cdf0e10cSrcweir 2401*cdf0e10cSrcweir // 2. if we have a name check if there is already an item with the 2402*cdf0e10cSrcweir // same name in the documents pool with a different line end or start 2403*cdf0e10cSrcweir 2404*cdf0e10cSrcweir sal_uInt16 nCount, nSurrogate; 2405*cdf0e10cSrcweir 2406*cdf0e10cSrcweir const SfxItemPool* pPool1 = &pModel->GetItemPool(); 2407*cdf0e10cSrcweir if( aUniqueName.Len() && pPool1 ) 2408*cdf0e10cSrcweir { 2409*cdf0e10cSrcweir nCount = pPool1->GetItemCount2( XATTR_LINESTART ); 2410*cdf0e10cSrcweir 2411*cdf0e10cSrcweir for( nSurrogate = 0; nSurrogate < nCount; nSurrogate++ ) 2412*cdf0e10cSrcweir { 2413*cdf0e10cSrcweir const XLineStartItem* pItem = (const XLineStartItem*)pPool1->GetItem2( XATTR_LINESTART, nSurrogate ); 2414*cdf0e10cSrcweir 2415*cdf0e10cSrcweir if( pItem && ( pItem->GetName() == pLineEndItem->GetName() ) ) 2416*cdf0e10cSrcweir { 2417*cdf0e10cSrcweir // if there is already an item with the same name and the same 2418*cdf0e10cSrcweir // value its ok to set it 2419*cdf0e10cSrcweir if( pItem->GetLineStartValue() != pLineEndItem->GetLineEndValue() ) 2420*cdf0e10cSrcweir { 2421*cdf0e10cSrcweir // same name but different value, we need a new name for this item 2422*cdf0e10cSrcweir aUniqueName = String(); 2423*cdf0e10cSrcweir bForceNew = sal_True; 2424*cdf0e10cSrcweir } 2425*cdf0e10cSrcweir break; 2426*cdf0e10cSrcweir } 2427*cdf0e10cSrcweir } 2428*cdf0e10cSrcweir 2429*cdf0e10cSrcweir if( !bForceNew ) 2430*cdf0e10cSrcweir { 2431*cdf0e10cSrcweir nCount = pPool1->GetItemCount2( XATTR_LINEEND ); 2432*cdf0e10cSrcweir 2433*cdf0e10cSrcweir for( nSurrogate = 0; nSurrogate < nCount; nSurrogate++ ) 2434*cdf0e10cSrcweir { 2435*cdf0e10cSrcweir const XLineEndItem* pItem = (const XLineEndItem*)pPool1->GetItem2( XATTR_LINEEND, nSurrogate ); 2436*cdf0e10cSrcweir 2437*cdf0e10cSrcweir if( pItem && ( pItem->GetName() == pLineEndItem->GetName() ) ) 2438*cdf0e10cSrcweir { 2439*cdf0e10cSrcweir // if there is already an item with the same name and the same 2440*cdf0e10cSrcweir // value its ok to set it 2441*cdf0e10cSrcweir if( pItem->GetLineEndValue() != pLineEndItem->GetLineEndValue() ) 2442*cdf0e10cSrcweir { 2443*cdf0e10cSrcweir // same name but different value, we need a new name for this item 2444*cdf0e10cSrcweir aUniqueName = String(); 2445*cdf0e10cSrcweir bForceNew = sal_True; 2446*cdf0e10cSrcweir } 2447*cdf0e10cSrcweir break; 2448*cdf0e10cSrcweir } 2449*cdf0e10cSrcweir } 2450*cdf0e10cSrcweir } 2451*cdf0e10cSrcweir } 2452*cdf0e10cSrcweir 2453*cdf0e10cSrcweir const SfxItemPool* pPool2 = pModel->GetStyleSheetPool() ? &pModel->GetStyleSheetPool()->GetPool() : NULL; 2454*cdf0e10cSrcweir if( aUniqueName.Len() && pPool2) 2455*cdf0e10cSrcweir { 2456*cdf0e10cSrcweir nCount = pPool2->GetItemCount2( XATTR_LINESTART ); 2457*cdf0e10cSrcweir for( nSurrogate = 0; nSurrogate < nCount; nSurrogate++ ) 2458*cdf0e10cSrcweir { 2459*cdf0e10cSrcweir const XLineStartItem* pItem = (const XLineStartItem*)pPool2->GetItem2( XATTR_LINESTART, nSurrogate ); 2460*cdf0e10cSrcweir 2461*cdf0e10cSrcweir if( pItem && ( pItem->GetName() == pLineEndItem->GetName() ) ) 2462*cdf0e10cSrcweir { 2463*cdf0e10cSrcweir // if there is already an item with the same name and the same 2464*cdf0e10cSrcweir // value its ok to set it 2465*cdf0e10cSrcweir if( pItem->GetLineStartValue() != pLineEndItem->GetLineEndValue() ) 2466*cdf0e10cSrcweir { 2467*cdf0e10cSrcweir // same name but different value, we need a new name for this item 2468*cdf0e10cSrcweir aUniqueName = String(); 2469*cdf0e10cSrcweir bForceNew = sal_True; 2470*cdf0e10cSrcweir } 2471*cdf0e10cSrcweir break; 2472*cdf0e10cSrcweir } 2473*cdf0e10cSrcweir } 2474*cdf0e10cSrcweir 2475*cdf0e10cSrcweir if( !bForceNew ) 2476*cdf0e10cSrcweir { 2477*cdf0e10cSrcweir nCount = pPool2->GetItemCount2( XATTR_LINEEND ); 2478*cdf0e10cSrcweir for( nSurrogate = 0; nSurrogate < nCount; nSurrogate++ ) 2479*cdf0e10cSrcweir { 2480*cdf0e10cSrcweir const XLineEndItem* pItem = (const XLineEndItem*)pPool2->GetItem2( XATTR_LINEEND, nSurrogate ); 2481*cdf0e10cSrcweir 2482*cdf0e10cSrcweir if( pItem && ( pItem->GetName() == pLineEndItem->GetName() ) ) 2483*cdf0e10cSrcweir { 2484*cdf0e10cSrcweir // if there is already an item with the same name and the same 2485*cdf0e10cSrcweir // value its ok to set it 2486*cdf0e10cSrcweir if( pItem->GetLineEndValue() != pLineEndItem->GetLineEndValue() ) 2487*cdf0e10cSrcweir { 2488*cdf0e10cSrcweir // same name but different value, we need a new name for this item 2489*cdf0e10cSrcweir aUniqueName = String(); 2490*cdf0e10cSrcweir bForceNew = sal_True; 2491*cdf0e10cSrcweir } 2492*cdf0e10cSrcweir break; 2493*cdf0e10cSrcweir } 2494*cdf0e10cSrcweir } 2495*cdf0e10cSrcweir } 2496*cdf0e10cSrcweir } 2497*cdf0e10cSrcweir 2498*cdf0e10cSrcweir // if we have no name yet, find existing item with same conent or 2499*cdf0e10cSrcweir // create a unique name 2500*cdf0e10cSrcweir if( aUniqueName.Len() == 0 ) 2501*cdf0e10cSrcweir { 2502*cdf0e10cSrcweir sal_Bool bFoundExisting = sal_False; 2503*cdf0e10cSrcweir 2504*cdf0e10cSrcweir sal_Int32 nUserIndex = 1; 2505*cdf0e10cSrcweir const ResId aRes(SVX_RES(RID_SVXSTR_LINEEND)); 2506*cdf0e10cSrcweir const String aUser( aRes ); 2507*cdf0e10cSrcweir 2508*cdf0e10cSrcweir if( pPool1 ) 2509*cdf0e10cSrcweir { 2510*cdf0e10cSrcweir nCount = pPool1->GetItemCount2( XATTR_LINESTART ); 2511*cdf0e10cSrcweir sal_uInt32 nSurrogate2; 2512*cdf0e10cSrcweir 2513*cdf0e10cSrcweir for( nSurrogate2 = 0; nSurrogate2 < nCount; nSurrogate2++ ) 2514*cdf0e10cSrcweir { 2515*cdf0e10cSrcweir const XLineStartItem* pItem = (const XLineStartItem*)pPool1->GetItem2( XATTR_LINESTART, nSurrogate2 ); 2516*cdf0e10cSrcweir 2517*cdf0e10cSrcweir if( pItem && pItem->GetName().Len() ) 2518*cdf0e10cSrcweir { 2519*cdf0e10cSrcweir if( !bForceNew && pItem->GetLineStartValue() == pLineEndItem->GetLineEndValue() ) 2520*cdf0e10cSrcweir { 2521*cdf0e10cSrcweir aUniqueName = pItem->GetName(); 2522*cdf0e10cSrcweir bFoundExisting = sal_True; 2523*cdf0e10cSrcweir break; 2524*cdf0e10cSrcweir } 2525*cdf0e10cSrcweir 2526*cdf0e10cSrcweir if( pItem->GetName().CompareTo( aUser, aUser.Len() ) == 0 ) 2527*cdf0e10cSrcweir { 2528*cdf0e10cSrcweir sal_Int32 nThisIndex = pItem->GetName().Copy( aUser.Len() ).ToInt32(); 2529*cdf0e10cSrcweir if( nThisIndex >= nUserIndex ) 2530*cdf0e10cSrcweir nUserIndex = nThisIndex + 1; 2531*cdf0e10cSrcweir } 2532*cdf0e10cSrcweir } 2533*cdf0e10cSrcweir } 2534*cdf0e10cSrcweir 2535*cdf0e10cSrcweir nCount = pPool1->GetItemCount2( XATTR_LINEEND ); 2536*cdf0e10cSrcweir for( nSurrogate2 = 0; nSurrogate2 < nCount; nSurrogate2++ ) 2537*cdf0e10cSrcweir { 2538*cdf0e10cSrcweir const XLineEndItem* pItem = (const XLineEndItem*)pPool1->GetItem2( XATTR_LINEEND, nSurrogate2 ); 2539*cdf0e10cSrcweir 2540*cdf0e10cSrcweir if( pItem && pItem->GetName().Len() ) 2541*cdf0e10cSrcweir { 2542*cdf0e10cSrcweir if( !bForceNew && pItem->GetLineEndValue() == pLineEndItem->GetLineEndValue() ) 2543*cdf0e10cSrcweir { 2544*cdf0e10cSrcweir aUniqueName = pItem->GetName(); 2545*cdf0e10cSrcweir bFoundExisting = sal_True; 2546*cdf0e10cSrcweir break; 2547*cdf0e10cSrcweir } 2548*cdf0e10cSrcweir 2549*cdf0e10cSrcweir if( pItem->GetName().CompareTo( aUser, aUser.Len() ) == 0 ) 2550*cdf0e10cSrcweir { 2551*cdf0e10cSrcweir sal_Int32 nThisIndex = pItem->GetName().Copy( aUser.Len() ).ToInt32(); 2552*cdf0e10cSrcweir if( nThisIndex >= nUserIndex ) 2553*cdf0e10cSrcweir nUserIndex = nThisIndex + 1; 2554*cdf0e10cSrcweir } 2555*cdf0e10cSrcweir } 2556*cdf0e10cSrcweir } 2557*cdf0e10cSrcweir } 2558*cdf0e10cSrcweir 2559*cdf0e10cSrcweir if( !bFoundExisting ) 2560*cdf0e10cSrcweir { 2561*cdf0e10cSrcweir aUniqueName = aUser; 2562*cdf0e10cSrcweir aUniqueName += sal_Unicode(' '); 2563*cdf0e10cSrcweir aUniqueName += String::CreateFromInt32( nUserIndex ); 2564*cdf0e10cSrcweir } 2565*cdf0e10cSrcweir } 2566*cdf0e10cSrcweir 2567*cdf0e10cSrcweir // if the given name is not valid, replace it! 2568*cdf0e10cSrcweir if( aUniqueName != GetName() || pTempItem ) 2569*cdf0e10cSrcweir { 2570*cdf0e10cSrcweir if( pTempItem ) 2571*cdf0e10cSrcweir { 2572*cdf0e10cSrcweir pTempItem->SetName( aUniqueName ); 2573*cdf0e10cSrcweir return pTempItem; 2574*cdf0e10cSrcweir } 2575*cdf0e10cSrcweir else 2576*cdf0e10cSrcweir { 2577*cdf0e10cSrcweir return new XLineEndItem( aUniqueName, maPolyPolygon ); 2578*cdf0e10cSrcweir } 2579*cdf0e10cSrcweir } 2580*cdf0e10cSrcweir } 2581*cdf0e10cSrcweir 2582*cdf0e10cSrcweir return (XLineEndItem*)this; 2583*cdf0e10cSrcweir } 2584*cdf0e10cSrcweir 2585*cdf0e10cSrcweir 2586*cdf0e10cSrcweir //------------------------------------------------------------------------ 2587*cdf0e10cSrcweir 2588*cdf0e10cSrcweir SfxItemPresentation XLineEndItem::GetPresentation 2589*cdf0e10cSrcweir ( 2590*cdf0e10cSrcweir SfxItemPresentation ePres, 2591*cdf0e10cSrcweir SfxMapUnit /*eCoreUnit*/, 2592*cdf0e10cSrcweir SfxMapUnit /*ePresUnit*/, 2593*cdf0e10cSrcweir XubString& rText, const IntlWrapper * 2594*cdf0e10cSrcweir ) const 2595*cdf0e10cSrcweir { 2596*cdf0e10cSrcweir switch ( ePres ) 2597*cdf0e10cSrcweir { 2598*cdf0e10cSrcweir case SFX_ITEM_PRESENTATION_NONE: 2599*cdf0e10cSrcweir rText.Erase(); 2600*cdf0e10cSrcweir return ePres; 2601*cdf0e10cSrcweir case SFX_ITEM_PRESENTATION_NAMELESS: 2602*cdf0e10cSrcweir case SFX_ITEM_PRESENTATION_COMPLETE: 2603*cdf0e10cSrcweir rText = GetName(); 2604*cdf0e10cSrcweir return ePres; 2605*cdf0e10cSrcweir default: 2606*cdf0e10cSrcweir return SFX_ITEM_PRESENTATION_NONE; 2607*cdf0e10cSrcweir } 2608*cdf0e10cSrcweir } 2609*cdf0e10cSrcweir 2610*cdf0e10cSrcweir sal_Bool XLineEndItem::QueryValue( ::com::sun::star::uno::Any& rVal, sal_uInt8 nMemberId ) const 2611*cdf0e10cSrcweir { 2612*cdf0e10cSrcweir // sal_Bool bConvert = 0!=(nMemberId&CONVERT_TWIPS); 2613*cdf0e10cSrcweir nMemberId &= ~CONVERT_TWIPS; 2614*cdf0e10cSrcweir if( nMemberId == MID_NAME ) 2615*cdf0e10cSrcweir { 2616*cdf0e10cSrcweir rtl::OUString aApiName; 2617*cdf0e10cSrcweir SvxUnogetApiNameForItem( Which(), GetName(), aApiName ); 2618*cdf0e10cSrcweir rVal <<= aApiName; 2619*cdf0e10cSrcweir } 2620*cdf0e10cSrcweir else 2621*cdf0e10cSrcweir { 2622*cdf0e10cSrcweir com::sun::star::drawing::PolyPolygonBezierCoords aBezier; 2623*cdf0e10cSrcweir SvxConvertB2DPolyPolygonToPolyPolygonBezier( maPolyPolygon, aBezier ); 2624*cdf0e10cSrcweir rVal <<= aBezier; 2625*cdf0e10cSrcweir } 2626*cdf0e10cSrcweir return sal_True; 2627*cdf0e10cSrcweir } 2628*cdf0e10cSrcweir 2629*cdf0e10cSrcweir sal_Bool XLineEndItem::PutValue( const ::com::sun::star::uno::Any& rVal, sal_uInt8 nMemberId ) 2630*cdf0e10cSrcweir { 2631*cdf0e10cSrcweir // sal_Bool bConvert = 0!=(nMemberId&CONVERT_TWIPS); 2632*cdf0e10cSrcweir nMemberId &= ~CONVERT_TWIPS; 2633*cdf0e10cSrcweir if( nMemberId == MID_NAME ) 2634*cdf0e10cSrcweir { 2635*cdf0e10cSrcweir return sal_False; 2636*cdf0e10cSrcweir } 2637*cdf0e10cSrcweir else 2638*cdf0e10cSrcweir { 2639*cdf0e10cSrcweir maPolyPolygon.clear(); 2640*cdf0e10cSrcweir 2641*cdf0e10cSrcweir if( rVal.hasValue() && rVal.getValue() ) 2642*cdf0e10cSrcweir { 2643*cdf0e10cSrcweir if( rVal.getValueType() != ::getCppuType((const com::sun::star::drawing::PolyPolygonBezierCoords*)0) ) 2644*cdf0e10cSrcweir return sal_False; 2645*cdf0e10cSrcweir 2646*cdf0e10cSrcweir com::sun::star::drawing::PolyPolygonBezierCoords* pCoords = (com::sun::star::drawing::PolyPolygonBezierCoords*)rVal.getValue(); 2647*cdf0e10cSrcweir if( pCoords->Coordinates.getLength() > 0 ) 2648*cdf0e10cSrcweir { 2649*cdf0e10cSrcweir maPolyPolygon = SvxConvertPolyPolygonBezierToB2DPolyPolygon( pCoords ); 2650*cdf0e10cSrcweir // #i72807# close line start/end polygons hard 2651*cdf0e10cSrcweir // maPolyPolygon.setClosed(true); 2652*cdf0e10cSrcweir } 2653*cdf0e10cSrcweir } 2654*cdf0e10cSrcweir } 2655*cdf0e10cSrcweir 2656*cdf0e10cSrcweir return sal_True; 2657*cdf0e10cSrcweir } 2658*cdf0e10cSrcweir 2659*cdf0e10cSrcweir // ---------------------------- 2660*cdf0e10cSrcweir // class XLineStartWidthItem 2661*cdf0e10cSrcweir // ---------------------------- 2662*cdf0e10cSrcweir TYPEINIT1_AUTOFACTORY(XLineStartWidthItem, SfxMetricItem); 2663*cdf0e10cSrcweir 2664*cdf0e10cSrcweir /************************************************************************* 2665*cdf0e10cSrcweir |* 2666*cdf0e10cSrcweir |* XLineStartWidthItem::XLineStartWidthItem(sal_Int32 nWidth) 2667*cdf0e10cSrcweir |* 2668*cdf0e10cSrcweir |* Beschreibung 2669*cdf0e10cSrcweir |* Ersterstellung 15.11.94 2670*cdf0e10cSrcweir |* Letzte Aenderung 18.11.94 2671*cdf0e10cSrcweir |* 2672*cdf0e10cSrcweir *************************************************************************/ 2673*cdf0e10cSrcweir 2674*cdf0e10cSrcweir XLineStartWidthItem::XLineStartWidthItem(long nWidth) : 2675*cdf0e10cSrcweir SfxMetricItem(XATTR_LINESTARTWIDTH, nWidth) 2676*cdf0e10cSrcweir { 2677*cdf0e10cSrcweir } 2678*cdf0e10cSrcweir 2679*cdf0e10cSrcweir /************************************************************************* 2680*cdf0e10cSrcweir |* 2681*cdf0e10cSrcweir |* XLineStartWidthItem::XLineStartWidthItem(SvStream& rIn) 2682*cdf0e10cSrcweir |* 2683*cdf0e10cSrcweir |* Beschreibung 2684*cdf0e10cSrcweir |* Ersterstellung 15.11.94 2685*cdf0e10cSrcweir |* Letzte Aenderung 15.11.94 2686*cdf0e10cSrcweir |* 2687*cdf0e10cSrcweir *************************************************************************/ 2688*cdf0e10cSrcweir 2689*cdf0e10cSrcweir XLineStartWidthItem::XLineStartWidthItem(SvStream& rIn) : 2690*cdf0e10cSrcweir SfxMetricItem(XATTR_LINESTARTWIDTH, rIn) 2691*cdf0e10cSrcweir { 2692*cdf0e10cSrcweir } 2693*cdf0e10cSrcweir 2694*cdf0e10cSrcweir /************************************************************************* 2695*cdf0e10cSrcweir |* 2696*cdf0e10cSrcweir |* XLineStartWidthItem::Clone(SfxItemPool* pPool) const 2697*cdf0e10cSrcweir |* 2698*cdf0e10cSrcweir |* Beschreibung 2699*cdf0e10cSrcweir |* Ersterstellung 15.11.94 2700*cdf0e10cSrcweir |* Letzte Aenderung 15.11.94 2701*cdf0e10cSrcweir |* 2702*cdf0e10cSrcweir *************************************************************************/ 2703*cdf0e10cSrcweir 2704*cdf0e10cSrcweir SfxPoolItem* XLineStartWidthItem::Clone(SfxItemPool* /*pPool*/) const 2705*cdf0e10cSrcweir { 2706*cdf0e10cSrcweir return new XLineStartWidthItem(*this); 2707*cdf0e10cSrcweir } 2708*cdf0e10cSrcweir 2709*cdf0e10cSrcweir /************************************************************************* 2710*cdf0e10cSrcweir |* 2711*cdf0e10cSrcweir |* SfxPoolItem* XLineStartWidthItem::Create(SvStream& rIn, sal_uInt16 nVer) 2712*cdf0e10cSrcweir |* const 2713*cdf0e10cSrcweir |* 2714*cdf0e10cSrcweir |* Beschreibung 2715*cdf0e10cSrcweir |* Ersterstellung 15.11.94 2716*cdf0e10cSrcweir |* Letzte Aenderung 15.11.94 2717*cdf0e10cSrcweir |* 2718*cdf0e10cSrcweir *************************************************************************/ 2719*cdf0e10cSrcweir 2720*cdf0e10cSrcweir SfxPoolItem* XLineStartWidthItem::Create(SvStream& rIn, sal_uInt16 /*nVer*/) const 2721*cdf0e10cSrcweir { 2722*cdf0e10cSrcweir return new XLineStartWidthItem(rIn); 2723*cdf0e10cSrcweir } 2724*cdf0e10cSrcweir 2725*cdf0e10cSrcweir //------------------------------------------------------------------------ 2726*cdf0e10cSrcweir 2727*cdf0e10cSrcweir SfxItemPresentation XLineStartWidthItem::GetPresentation 2728*cdf0e10cSrcweir ( 2729*cdf0e10cSrcweir SfxItemPresentation ePres, 2730*cdf0e10cSrcweir SfxMapUnit eCoreUnit, 2731*cdf0e10cSrcweir SfxMapUnit ePresUnit, 2732*cdf0e10cSrcweir XubString& rText, const IntlWrapper * pIntl 2733*cdf0e10cSrcweir ) const 2734*cdf0e10cSrcweir { 2735*cdf0e10cSrcweir switch ( ePres ) 2736*cdf0e10cSrcweir { 2737*cdf0e10cSrcweir case SFX_ITEM_PRESENTATION_NONE: 2738*cdf0e10cSrcweir rText.Erase(); 2739*cdf0e10cSrcweir return ePres; 2740*cdf0e10cSrcweir case SFX_ITEM_PRESENTATION_NAMELESS: 2741*cdf0e10cSrcweir case SFX_ITEM_PRESENTATION_COMPLETE: 2742*cdf0e10cSrcweir rText = GetMetricText( (long) GetValue(), 2743*cdf0e10cSrcweir eCoreUnit, ePresUnit, pIntl); 2744*cdf0e10cSrcweir rText += SVX_RESSTR( GetMetricId( ePresUnit) ); 2745*cdf0e10cSrcweir return ePres; 2746*cdf0e10cSrcweir default: 2747*cdf0e10cSrcweir return SFX_ITEM_PRESENTATION_NONE; 2748*cdf0e10cSrcweir } 2749*cdf0e10cSrcweir } 2750*cdf0e10cSrcweir 2751*cdf0e10cSrcweir sal_Bool XLineStartWidthItem::QueryValue( ::com::sun::star::uno::Any& rVal, sal_uInt8 /*nMemberId*/) const 2752*cdf0e10cSrcweir { 2753*cdf0e10cSrcweir rVal <<= (sal_Int32)GetValue(); 2754*cdf0e10cSrcweir return sal_True; 2755*cdf0e10cSrcweir } 2756*cdf0e10cSrcweir 2757*cdf0e10cSrcweir sal_Bool XLineStartWidthItem::PutValue( const ::com::sun::star::uno::Any& rVal, sal_uInt8 /*nMemberId*/) 2758*cdf0e10cSrcweir { 2759*cdf0e10cSrcweir sal_Int32 nValue = 0; 2760*cdf0e10cSrcweir rVal >>= nValue; 2761*cdf0e10cSrcweir SetValue( nValue ); 2762*cdf0e10cSrcweir return sal_True; 2763*cdf0e10cSrcweir } 2764*cdf0e10cSrcweir 2765*cdf0e10cSrcweir 2766*cdf0e10cSrcweir 2767*cdf0e10cSrcweir // -------------------------- 2768*cdf0e10cSrcweir // class XLineEndWidthItem 2769*cdf0e10cSrcweir // -------------------------- 2770*cdf0e10cSrcweir TYPEINIT1_AUTOFACTORY(XLineEndWidthItem, SfxMetricItem); 2771*cdf0e10cSrcweir 2772*cdf0e10cSrcweir /************************************************************************* 2773*cdf0e10cSrcweir |* 2774*cdf0e10cSrcweir |* XLineEndWidthItem::XLineEndWidthItem(long nWidth) 2775*cdf0e10cSrcweir |* 2776*cdf0e10cSrcweir |* Beschreibung 2777*cdf0e10cSrcweir |* Ersterstellung 15.11.94 2778*cdf0e10cSrcweir |* Letzte Aenderung 15.11.94 2779*cdf0e10cSrcweir |* 2780*cdf0e10cSrcweir *************************************************************************/ 2781*cdf0e10cSrcweir 2782*cdf0e10cSrcweir XLineEndWidthItem::XLineEndWidthItem(long nWidth) : 2783*cdf0e10cSrcweir SfxMetricItem(XATTR_LINEENDWIDTH, nWidth) 2784*cdf0e10cSrcweir { 2785*cdf0e10cSrcweir } 2786*cdf0e10cSrcweir 2787*cdf0e10cSrcweir /************************************************************************* 2788*cdf0e10cSrcweir |* 2789*cdf0e10cSrcweir |* XLineEndWidthItem::XLineEndWidthItem(SvStream& rIn) 2790*cdf0e10cSrcweir |* 2791*cdf0e10cSrcweir |* Beschreibung 2792*cdf0e10cSrcweir |* Ersterstellung 15.11.94 2793*cdf0e10cSrcweir |* Letzte Aenderung 15.11.94 2794*cdf0e10cSrcweir |* 2795*cdf0e10cSrcweir *************************************************************************/ 2796*cdf0e10cSrcweir 2797*cdf0e10cSrcweir XLineEndWidthItem::XLineEndWidthItem(SvStream& rIn) : 2798*cdf0e10cSrcweir SfxMetricItem(XATTR_LINEENDWIDTH, rIn) 2799*cdf0e10cSrcweir { 2800*cdf0e10cSrcweir } 2801*cdf0e10cSrcweir 2802*cdf0e10cSrcweir /************************************************************************* 2803*cdf0e10cSrcweir |* 2804*cdf0e10cSrcweir |* XLineEndWidthItem::Clone(SfxItemPool* pPool) const 2805*cdf0e10cSrcweir |* 2806*cdf0e10cSrcweir |* Beschreibung 2807*cdf0e10cSrcweir |* Ersterstellung 15.11.94 2808*cdf0e10cSrcweir |* Letzte Aenderung 15.11.94 2809*cdf0e10cSrcweir |* 2810*cdf0e10cSrcweir *************************************************************************/ 2811*cdf0e10cSrcweir 2812*cdf0e10cSrcweir SfxPoolItem* XLineEndWidthItem::Clone(SfxItemPool* /*pPool*/) const 2813*cdf0e10cSrcweir { 2814*cdf0e10cSrcweir return new XLineEndWidthItem(*this); 2815*cdf0e10cSrcweir } 2816*cdf0e10cSrcweir 2817*cdf0e10cSrcweir /************************************************************************* 2818*cdf0e10cSrcweir |* 2819*cdf0e10cSrcweir |* SfxPoolItem* XLineEndWidthItem::Create(SvStream& rIn, sal_uInt16 nVer) const 2820*cdf0e10cSrcweir |* 2821*cdf0e10cSrcweir |* Beschreibung 2822*cdf0e10cSrcweir |* Ersterstellung 15.11.94 2823*cdf0e10cSrcweir |* Letzte Aenderung 15.11.94 2824*cdf0e10cSrcweir |* 2825*cdf0e10cSrcweir *************************************************************************/ 2826*cdf0e10cSrcweir 2827*cdf0e10cSrcweir SfxPoolItem* XLineEndWidthItem::Create(SvStream& rIn, sal_uInt16 /*nVer*/) const 2828*cdf0e10cSrcweir { 2829*cdf0e10cSrcweir return new XLineEndWidthItem(rIn); 2830*cdf0e10cSrcweir } 2831*cdf0e10cSrcweir 2832*cdf0e10cSrcweir //------------------------------------------------------------------------ 2833*cdf0e10cSrcweir 2834*cdf0e10cSrcweir SfxItemPresentation XLineEndWidthItem::GetPresentation 2835*cdf0e10cSrcweir ( 2836*cdf0e10cSrcweir SfxItemPresentation ePres, 2837*cdf0e10cSrcweir SfxMapUnit eCoreUnit, 2838*cdf0e10cSrcweir SfxMapUnit ePresUnit, 2839*cdf0e10cSrcweir XubString& rText, const IntlWrapper *pIntl 2840*cdf0e10cSrcweir ) const 2841*cdf0e10cSrcweir { 2842*cdf0e10cSrcweir switch ( ePres ) 2843*cdf0e10cSrcweir { 2844*cdf0e10cSrcweir case SFX_ITEM_PRESENTATION_NONE: 2845*cdf0e10cSrcweir rText.Erase(); 2846*cdf0e10cSrcweir return ePres; 2847*cdf0e10cSrcweir case SFX_ITEM_PRESENTATION_NAMELESS: 2848*cdf0e10cSrcweir case SFX_ITEM_PRESENTATION_COMPLETE: 2849*cdf0e10cSrcweir rText = GetMetricText( (long) GetValue(), 2850*cdf0e10cSrcweir eCoreUnit, ePresUnit, pIntl); 2851*cdf0e10cSrcweir rText += SVX_RESSTR( GetMetricId( ePresUnit) ); 2852*cdf0e10cSrcweir return ePres; 2853*cdf0e10cSrcweir default: 2854*cdf0e10cSrcweir return SFX_ITEM_PRESENTATION_NONE; 2855*cdf0e10cSrcweir } 2856*cdf0e10cSrcweir } 2857*cdf0e10cSrcweir 2858*cdf0e10cSrcweir sal_Bool XLineEndWidthItem::QueryValue( ::com::sun::star::uno::Any& rVal, sal_uInt8 /*nMemberId*/) const 2859*cdf0e10cSrcweir { 2860*cdf0e10cSrcweir rVal <<= (sal_Int32)GetValue(); 2861*cdf0e10cSrcweir return sal_True; 2862*cdf0e10cSrcweir } 2863*cdf0e10cSrcweir 2864*cdf0e10cSrcweir sal_Bool XLineEndWidthItem::PutValue( const ::com::sun::star::uno::Any& rVal, sal_uInt8 /*nMemberId*/) 2865*cdf0e10cSrcweir { 2866*cdf0e10cSrcweir sal_Int32 nValue = 0; 2867*cdf0e10cSrcweir rVal >>= nValue; 2868*cdf0e10cSrcweir SetValue( nValue ); 2869*cdf0e10cSrcweir return sal_True; 2870*cdf0e10cSrcweir } 2871*cdf0e10cSrcweir 2872*cdf0e10cSrcweir 2873*cdf0e10cSrcweir // ----------------------------- 2874*cdf0e10cSrcweir // class XLineStartCenterItem 2875*cdf0e10cSrcweir // ----------------------------- 2876*cdf0e10cSrcweir TYPEINIT1_AUTOFACTORY(XLineStartCenterItem, SfxBoolItem); 2877*cdf0e10cSrcweir 2878*cdf0e10cSrcweir /************************************************************************* 2879*cdf0e10cSrcweir |* 2880*cdf0e10cSrcweir |* XLineStartCenterItem::XLineStartCenterItem(sal_Bool bStartCenter) 2881*cdf0e10cSrcweir |* 2882*cdf0e10cSrcweir |* Beschreibung 2883*cdf0e10cSrcweir |* Ersterstellung 15.11.94 2884*cdf0e10cSrcweir |* Letzte Aenderung 15.11.94 2885*cdf0e10cSrcweir |* 2886*cdf0e10cSrcweir *************************************************************************/ 2887*cdf0e10cSrcweir 2888*cdf0e10cSrcweir XLineStartCenterItem::XLineStartCenterItem(sal_Bool bStartCenter) : 2889*cdf0e10cSrcweir SfxBoolItem(XATTR_LINESTARTCENTER, bStartCenter) 2890*cdf0e10cSrcweir { 2891*cdf0e10cSrcweir } 2892*cdf0e10cSrcweir 2893*cdf0e10cSrcweir /************************************************************************* 2894*cdf0e10cSrcweir |* 2895*cdf0e10cSrcweir |* XLineStartCenterItem::XLineStartCenterItem(SvStream& rIn) 2896*cdf0e10cSrcweir |* 2897*cdf0e10cSrcweir |* Beschreibung 2898*cdf0e10cSrcweir |* Ersterstellung 15.11.94 2899*cdf0e10cSrcweir |* Letzte Aenderung 15.11.94 2900*cdf0e10cSrcweir |* 2901*cdf0e10cSrcweir *************************************************************************/ 2902*cdf0e10cSrcweir 2903*cdf0e10cSrcweir XLineStartCenterItem::XLineStartCenterItem(SvStream& rIn) : 2904*cdf0e10cSrcweir SfxBoolItem(XATTR_LINESTARTCENTER, rIn) 2905*cdf0e10cSrcweir { 2906*cdf0e10cSrcweir } 2907*cdf0e10cSrcweir 2908*cdf0e10cSrcweir /************************************************************************* 2909*cdf0e10cSrcweir |* 2910*cdf0e10cSrcweir |* XLineStartCenterItem::Clone(SfxItemPool* pPool) const 2911*cdf0e10cSrcweir |* 2912*cdf0e10cSrcweir |* Beschreibung 2913*cdf0e10cSrcweir |* Ersterstellung 15.11.94 2914*cdf0e10cSrcweir |* Letzte Aenderung 15.11.94 2915*cdf0e10cSrcweir |* 2916*cdf0e10cSrcweir *************************************************************************/ 2917*cdf0e10cSrcweir 2918*cdf0e10cSrcweir SfxPoolItem* XLineStartCenterItem::Clone(SfxItemPool* /*pPool*/) const 2919*cdf0e10cSrcweir { 2920*cdf0e10cSrcweir return new XLineStartCenterItem(*this); 2921*cdf0e10cSrcweir } 2922*cdf0e10cSrcweir 2923*cdf0e10cSrcweir /************************************************************************* 2924*cdf0e10cSrcweir |* 2925*cdf0e10cSrcweir |* SfxPoolItem* XLineStartCenterItem::Create(SvStream& rIn, sal_uInt16 nVer) 2926*cdf0e10cSrcweir |* const 2927*cdf0e10cSrcweir |* 2928*cdf0e10cSrcweir |* Beschreibung 2929*cdf0e10cSrcweir |* Ersterstellung 15.11.94 2930*cdf0e10cSrcweir |* Letzte Aenderung 15.11.94 2931*cdf0e10cSrcweir |* 2932*cdf0e10cSrcweir *************************************************************************/ 2933*cdf0e10cSrcweir 2934*cdf0e10cSrcweir SfxPoolItem* XLineStartCenterItem::Create(SvStream& rIn, sal_uInt16 /*nVer*/) const 2935*cdf0e10cSrcweir { 2936*cdf0e10cSrcweir return new XLineStartCenterItem(rIn); 2937*cdf0e10cSrcweir } 2938*cdf0e10cSrcweir 2939*cdf0e10cSrcweir //------------------------------------------------------------------------ 2940*cdf0e10cSrcweir 2941*cdf0e10cSrcweir SfxItemPresentation XLineStartCenterItem::GetPresentation 2942*cdf0e10cSrcweir ( 2943*cdf0e10cSrcweir SfxItemPresentation ePres, 2944*cdf0e10cSrcweir SfxMapUnit /*eCoreUnit*/, 2945*cdf0e10cSrcweir SfxMapUnit /*ePresUnit*/, 2946*cdf0e10cSrcweir XubString& rText, const IntlWrapper * 2947*cdf0e10cSrcweir ) const 2948*cdf0e10cSrcweir { 2949*cdf0e10cSrcweir switch ( ePres ) 2950*cdf0e10cSrcweir { 2951*cdf0e10cSrcweir case SFX_ITEM_PRESENTATION_NONE: 2952*cdf0e10cSrcweir rText.Erase(); 2953*cdf0e10cSrcweir return ePres; 2954*cdf0e10cSrcweir case SFX_ITEM_PRESENTATION_NAMELESS: 2955*cdf0e10cSrcweir case SFX_ITEM_PRESENTATION_COMPLETE: 2956*cdf0e10cSrcweir rText = XubString( ResId( GetValue() ? RID_SVXSTR_CENTERED : 2957*cdf0e10cSrcweir RID_SVXSTR_NOTCENTERED, DIALOG_MGR() ) ); 2958*cdf0e10cSrcweir return ePres; 2959*cdf0e10cSrcweir default: 2960*cdf0e10cSrcweir return SFX_ITEM_PRESENTATION_NONE; 2961*cdf0e10cSrcweir } 2962*cdf0e10cSrcweir } 2963*cdf0e10cSrcweir 2964*cdf0e10cSrcweir sal_Bool XLineStartCenterItem::QueryValue( ::com::sun::star::uno::Any& rVal, sal_uInt8 /*nMemberId*/) const 2965*cdf0e10cSrcweir { 2966*cdf0e10cSrcweir sal_Bool bValue = GetValue(); 2967*cdf0e10cSrcweir rVal.setValue( &bValue, ::getCppuBooleanType() ); 2968*cdf0e10cSrcweir return sal_True; 2969*cdf0e10cSrcweir } 2970*cdf0e10cSrcweir 2971*cdf0e10cSrcweir sal_Bool XLineStartCenterItem::PutValue( const ::com::sun::star::uno::Any& rVal, sal_uInt8 /*nMemberId*/) 2972*cdf0e10cSrcweir { 2973*cdf0e10cSrcweir if( !rVal.hasValue() || rVal.getValueType() != ::getCppuBooleanType() ) 2974*cdf0e10cSrcweir return sal_False; 2975*cdf0e10cSrcweir 2976*cdf0e10cSrcweir SetValue( *(sal_Bool*)rVal.getValue() ); 2977*cdf0e10cSrcweir return sal_True; 2978*cdf0e10cSrcweir } 2979*cdf0e10cSrcweir 2980*cdf0e10cSrcweir 2981*cdf0e10cSrcweir // --------------------------- 2982*cdf0e10cSrcweir // class XLineEndCenterItem 2983*cdf0e10cSrcweir // --------------------------- 2984*cdf0e10cSrcweir TYPEINIT1_AUTOFACTORY(XLineEndCenterItem, SfxBoolItem); 2985*cdf0e10cSrcweir 2986*cdf0e10cSrcweir /************************************************************************* 2987*cdf0e10cSrcweir |* 2988*cdf0e10cSrcweir |* XLineEndCenterItem::XLineEndCenterItem(sal_Bool bEndCenter) 2989*cdf0e10cSrcweir |* 2990*cdf0e10cSrcweir |* Beschreibung 2991*cdf0e10cSrcweir |* Ersterstellung 15.11.94 2992*cdf0e10cSrcweir |* Letzte Aenderung 15.11.94 2993*cdf0e10cSrcweir |* 2994*cdf0e10cSrcweir *************************************************************************/ 2995*cdf0e10cSrcweir 2996*cdf0e10cSrcweir XLineEndCenterItem::XLineEndCenterItem(sal_Bool bEndCenter) : 2997*cdf0e10cSrcweir SfxBoolItem(XATTR_LINEENDCENTER, bEndCenter) 2998*cdf0e10cSrcweir { 2999*cdf0e10cSrcweir } 3000*cdf0e10cSrcweir 3001*cdf0e10cSrcweir /************************************************************************* 3002*cdf0e10cSrcweir |* 3003*cdf0e10cSrcweir |* XLineEndCenterItem::XLineEndCenterItem(SvStream& rIn) 3004*cdf0e10cSrcweir |* 3005*cdf0e10cSrcweir |* Beschreibung 3006*cdf0e10cSrcweir |* Ersterstellung 15.11.94 3007*cdf0e10cSrcweir |* Letzte Aenderung 15.11.94 3008*cdf0e10cSrcweir |* 3009*cdf0e10cSrcweir *************************************************************************/ 3010*cdf0e10cSrcweir 3011*cdf0e10cSrcweir XLineEndCenterItem::XLineEndCenterItem(SvStream& rIn) : 3012*cdf0e10cSrcweir SfxBoolItem(XATTR_LINEENDCENTER, rIn) 3013*cdf0e10cSrcweir { 3014*cdf0e10cSrcweir } 3015*cdf0e10cSrcweir 3016*cdf0e10cSrcweir /************************************************************************* 3017*cdf0e10cSrcweir |* 3018*cdf0e10cSrcweir |* XLineEndCenterItem::Clone(SfxItemPool* pPool) const 3019*cdf0e10cSrcweir |* 3020*cdf0e10cSrcweir |* Beschreibung 3021*cdf0e10cSrcweir |* Ersterstellung 15.11.94 3022*cdf0e10cSrcweir |* Letzte Aenderung 15.11.94 3023*cdf0e10cSrcweir |* 3024*cdf0e10cSrcweir *************************************************************************/ 3025*cdf0e10cSrcweir 3026*cdf0e10cSrcweir SfxPoolItem* XLineEndCenterItem::Clone(SfxItemPool* /*pPool*/) const 3027*cdf0e10cSrcweir { 3028*cdf0e10cSrcweir return new XLineEndCenterItem(*this); 3029*cdf0e10cSrcweir } 3030*cdf0e10cSrcweir 3031*cdf0e10cSrcweir /************************************************************************* 3032*cdf0e10cSrcweir |* 3033*cdf0e10cSrcweir |* SfxPoolItem* XLineEndCenterItem::Create(SvStream& rIn, sal_uInt16 nVer) 3034*cdf0e10cSrcweir |* const 3035*cdf0e10cSrcweir |* 3036*cdf0e10cSrcweir |* Beschreibung 3037*cdf0e10cSrcweir |* Ersterstellung 15.11.94 3038*cdf0e10cSrcweir |* Letzte Aenderung 15.11.94 3039*cdf0e10cSrcweir |* 3040*cdf0e10cSrcweir *************************************************************************/ 3041*cdf0e10cSrcweir 3042*cdf0e10cSrcweir SfxPoolItem* XLineEndCenterItem::Create(SvStream& rIn, sal_uInt16 /*nVer*/) const 3043*cdf0e10cSrcweir { 3044*cdf0e10cSrcweir return new XLineEndCenterItem(rIn); 3045*cdf0e10cSrcweir } 3046*cdf0e10cSrcweir 3047*cdf0e10cSrcweir //------------------------------------------------------------------------ 3048*cdf0e10cSrcweir 3049*cdf0e10cSrcweir SfxItemPresentation XLineEndCenterItem::GetPresentation 3050*cdf0e10cSrcweir ( 3051*cdf0e10cSrcweir SfxItemPresentation ePres, 3052*cdf0e10cSrcweir SfxMapUnit /*eCoreUnit*/, 3053*cdf0e10cSrcweir SfxMapUnit /*ePresUnit*/, 3054*cdf0e10cSrcweir XubString& rText, const IntlWrapper * 3055*cdf0e10cSrcweir ) const 3056*cdf0e10cSrcweir { 3057*cdf0e10cSrcweir switch ( ePres ) 3058*cdf0e10cSrcweir { 3059*cdf0e10cSrcweir case SFX_ITEM_PRESENTATION_NONE: 3060*cdf0e10cSrcweir rText.Erase(); 3061*cdf0e10cSrcweir return ePres; 3062*cdf0e10cSrcweir case SFX_ITEM_PRESENTATION_NAMELESS: 3063*cdf0e10cSrcweir case SFX_ITEM_PRESENTATION_COMPLETE: 3064*cdf0e10cSrcweir rText = XubString( ResId( GetValue() ? RID_SVXSTR_CENTERED : 3065*cdf0e10cSrcweir RID_SVXSTR_NOTCENTERED, DIALOG_MGR() ) ); 3066*cdf0e10cSrcweir return ePres; 3067*cdf0e10cSrcweir default: 3068*cdf0e10cSrcweir return SFX_ITEM_PRESENTATION_NONE; 3069*cdf0e10cSrcweir } 3070*cdf0e10cSrcweir } 3071*cdf0e10cSrcweir 3072*cdf0e10cSrcweir sal_Bool XLineEndCenterItem::QueryValue( ::com::sun::star::uno::Any& rVal, sal_uInt8 /*nMemberId*/) const 3073*cdf0e10cSrcweir { 3074*cdf0e10cSrcweir sal_Bool bValue = GetValue(); 3075*cdf0e10cSrcweir rVal.setValue( &bValue, ::getCppuBooleanType() ); 3076*cdf0e10cSrcweir return sal_True; 3077*cdf0e10cSrcweir } 3078*cdf0e10cSrcweir 3079*cdf0e10cSrcweir sal_Bool XLineEndCenterItem::PutValue( const ::com::sun::star::uno::Any& rVal, sal_uInt8 /*nMemberId*/) 3080*cdf0e10cSrcweir { 3081*cdf0e10cSrcweir if( !rVal.hasValue() || rVal.getValueType() != ::getCppuBooleanType() ) 3082*cdf0e10cSrcweir return sal_False; 3083*cdf0e10cSrcweir 3084*cdf0e10cSrcweir SetValue( *(sal_Bool*)rVal.getValue() ); 3085*cdf0e10cSrcweir return sal_True; 3086*cdf0e10cSrcweir } 3087*cdf0e10cSrcweir 3088*cdf0e10cSrcweir 3089*cdf0e10cSrcweir //++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 3090*cdf0e10cSrcweir // Fuellattribute 3091*cdf0e10cSrcweir //++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 3092*cdf0e10cSrcweir 3093*cdf0e10cSrcweir // -------------------- 3094*cdf0e10cSrcweir // class XFillStyleItem 3095*cdf0e10cSrcweir // -------------------- 3096*cdf0e10cSrcweir TYPEINIT1_AUTOFACTORY(XFillStyleItem, SfxEnumItem); 3097*cdf0e10cSrcweir 3098*cdf0e10cSrcweir /************************************************************************* 3099*cdf0e10cSrcweir |* 3100*cdf0e10cSrcweir |* XFillStyleItem::XFillStyleItem(XFillStyle eFillStyle) 3101*cdf0e10cSrcweir |* 3102*cdf0e10cSrcweir |* Beschreibung 3103*cdf0e10cSrcweir |* Ersterstellung 15.11.94 3104*cdf0e10cSrcweir |* Letzte Aenderung 15.11.94 3105*cdf0e10cSrcweir |* 3106*cdf0e10cSrcweir *************************************************************************/ 3107*cdf0e10cSrcweir 3108*cdf0e10cSrcweir XFillStyleItem::XFillStyleItem(XFillStyle eFillStyle) : 3109*cdf0e10cSrcweir SfxEnumItem(XATTR_FILLSTYLE, sal::static_int_cast< sal_uInt16 >(eFillStyle)) 3110*cdf0e10cSrcweir { 3111*cdf0e10cSrcweir } 3112*cdf0e10cSrcweir 3113*cdf0e10cSrcweir /************************************************************************* 3114*cdf0e10cSrcweir |* 3115*cdf0e10cSrcweir |* XFillStyleItem::XFillStyleItem(SvStream& rIn) 3116*cdf0e10cSrcweir |* 3117*cdf0e10cSrcweir |* Beschreibung 3118*cdf0e10cSrcweir |* Ersterstellung 15.11.94 3119*cdf0e10cSrcweir |* Letzte Aenderung 15.11.94 3120*cdf0e10cSrcweir |* 3121*cdf0e10cSrcweir *************************************************************************/ 3122*cdf0e10cSrcweir 3123*cdf0e10cSrcweir XFillStyleItem::XFillStyleItem(SvStream& rIn) : 3124*cdf0e10cSrcweir SfxEnumItem(XATTR_FILLSTYLE, rIn) 3125*cdf0e10cSrcweir { 3126*cdf0e10cSrcweir } 3127*cdf0e10cSrcweir 3128*cdf0e10cSrcweir /************************************************************************* 3129*cdf0e10cSrcweir |* 3130*cdf0e10cSrcweir |* XFillStyleItem::Clone(SfxItemPool* pPool) const 3131*cdf0e10cSrcweir |* 3132*cdf0e10cSrcweir |* Beschreibung 3133*cdf0e10cSrcweir |* Ersterstellung 09.11.94 3134*cdf0e10cSrcweir |* Letzte Aenderung 09.11.94 3135*cdf0e10cSrcweir |* 3136*cdf0e10cSrcweir *************************************************************************/ 3137*cdf0e10cSrcweir 3138*cdf0e10cSrcweir SfxPoolItem* XFillStyleItem::Clone(SfxItemPool* /*pPool*/) const 3139*cdf0e10cSrcweir { 3140*cdf0e10cSrcweir return new XFillStyleItem( *this ); 3141*cdf0e10cSrcweir } 3142*cdf0e10cSrcweir 3143*cdf0e10cSrcweir /************************************************************************* 3144*cdf0e10cSrcweir |* 3145*cdf0e10cSrcweir |* SfxPoolItem* XFillStyleItem::Create(SvStream& rIn, sal_uInt16 nVer) const 3146*cdf0e10cSrcweir |* 3147*cdf0e10cSrcweir |* Beschreibung 3148*cdf0e10cSrcweir |* Ersterstellung 15.11.94 3149*cdf0e10cSrcweir |* Letzte Aenderung 15.11.94 3150*cdf0e10cSrcweir |* 3151*cdf0e10cSrcweir *************************************************************************/ 3152*cdf0e10cSrcweir 3153*cdf0e10cSrcweir SfxPoolItem* XFillStyleItem::Create(SvStream& rIn, sal_uInt16 /*nVer*/) const 3154*cdf0e10cSrcweir { 3155*cdf0e10cSrcweir return new XFillStyleItem(rIn); 3156*cdf0e10cSrcweir } 3157*cdf0e10cSrcweir 3158*cdf0e10cSrcweir //------------------------------------------------------------------------ 3159*cdf0e10cSrcweir 3160*cdf0e10cSrcweir SfxItemPresentation XFillStyleItem::GetPresentation 3161*cdf0e10cSrcweir ( 3162*cdf0e10cSrcweir SfxItemPresentation ePres, 3163*cdf0e10cSrcweir SfxMapUnit /*eCoreUnit*/, 3164*cdf0e10cSrcweir SfxMapUnit /*ePresUnit*/, 3165*cdf0e10cSrcweir XubString& rText, const IntlWrapper * 3166*cdf0e10cSrcweir ) const 3167*cdf0e10cSrcweir { 3168*cdf0e10cSrcweir rText.Erase(); 3169*cdf0e10cSrcweir 3170*cdf0e10cSrcweir switch ( ePres ) 3171*cdf0e10cSrcweir { 3172*cdf0e10cSrcweir case SFX_ITEM_PRESENTATION_NONE: 3173*cdf0e10cSrcweir return ePres; 3174*cdf0e10cSrcweir 3175*cdf0e10cSrcweir case SFX_ITEM_PRESENTATION_NAMELESS: 3176*cdf0e10cSrcweir case SFX_ITEM_PRESENTATION_COMPLETE: 3177*cdf0e10cSrcweir { 3178*cdf0e10cSrcweir sal_uInt16 nId = 0; 3179*cdf0e10cSrcweir 3180*cdf0e10cSrcweir switch( (sal_uInt16)GetValue() ) 3181*cdf0e10cSrcweir { 3182*cdf0e10cSrcweir case XFILL_NONE: 3183*cdf0e10cSrcweir nId = RID_SVXSTR_INVISIBLE; 3184*cdf0e10cSrcweir break; 3185*cdf0e10cSrcweir case XFILL_SOLID: 3186*cdf0e10cSrcweir nId = RID_SVXSTR_SOLID; 3187*cdf0e10cSrcweir break; 3188*cdf0e10cSrcweir case XFILL_GRADIENT: 3189*cdf0e10cSrcweir nId = RID_SVXSTR_GRADIENT; 3190*cdf0e10cSrcweir break; 3191*cdf0e10cSrcweir case XFILL_HATCH: 3192*cdf0e10cSrcweir nId = RID_SVXSTR_HATCH; 3193*cdf0e10cSrcweir break; 3194*cdf0e10cSrcweir case XFILL_BITMAP: 3195*cdf0e10cSrcweir nId = RID_SVXSTR_BITMAP; 3196*cdf0e10cSrcweir break; 3197*cdf0e10cSrcweir } 3198*cdf0e10cSrcweir 3199*cdf0e10cSrcweir if ( nId ) 3200*cdf0e10cSrcweir rText = SVX_RESSTR( nId ); 3201*cdf0e10cSrcweir return ePres; 3202*cdf0e10cSrcweir } 3203*cdf0e10cSrcweir default: 3204*cdf0e10cSrcweir return SFX_ITEM_PRESENTATION_NONE; 3205*cdf0e10cSrcweir } 3206*cdf0e10cSrcweir } 3207*cdf0e10cSrcweir 3208*cdf0e10cSrcweir //------------------------------------------------------------------------ 3209*cdf0e10cSrcweir 3210*cdf0e10cSrcweir sal_uInt16 XFillStyleItem::GetValueCount() const 3211*cdf0e10cSrcweir { 3212*cdf0e10cSrcweir return 5; 3213*cdf0e10cSrcweir } 3214*cdf0e10cSrcweir 3215*cdf0e10cSrcweir // ----------------------------------------------------------------------- 3216*cdf0e10cSrcweir sal_Bool XFillStyleItem::QueryValue( ::com::sun::star::uno::Any& rVal, sal_uInt8 /*nMemberId*/) const 3217*cdf0e10cSrcweir { 3218*cdf0e10cSrcweir ::com::sun::star::drawing::FillStyle eFS = (::com::sun::star::drawing::FillStyle)GetValue(); 3219*cdf0e10cSrcweir 3220*cdf0e10cSrcweir rVal <<= eFS; 3221*cdf0e10cSrcweir 3222*cdf0e10cSrcweir return sal_True; 3223*cdf0e10cSrcweir } 3224*cdf0e10cSrcweir 3225*cdf0e10cSrcweir // ----------------------------------------------------------------------- 3226*cdf0e10cSrcweir sal_Bool XFillStyleItem::PutValue( const ::com::sun::star::uno::Any& rVal, sal_uInt8 /*nMemberId*/) 3227*cdf0e10cSrcweir { 3228*cdf0e10cSrcweir ::com::sun::star::drawing::FillStyle eFS; 3229*cdf0e10cSrcweir if(!(rVal >>= eFS)) 3230*cdf0e10cSrcweir { 3231*cdf0e10cSrcweir // also try an int (for Basic) 3232*cdf0e10cSrcweir sal_Int32 nFS = 0; 3233*cdf0e10cSrcweir if(!(rVal >>= nFS)) 3234*cdf0e10cSrcweir return sal_False; 3235*cdf0e10cSrcweir eFS = (::com::sun::star::drawing::FillStyle)nFS; 3236*cdf0e10cSrcweir } 3237*cdf0e10cSrcweir 3238*cdf0e10cSrcweir SetValue( sal::static_int_cast< sal_uInt16 >( eFS ) ); 3239*cdf0e10cSrcweir 3240*cdf0e10cSrcweir return sal_True; 3241*cdf0e10cSrcweir } 3242*cdf0e10cSrcweir 3243*cdf0e10cSrcweir 3244*cdf0e10cSrcweir // ------------------- 3245*cdf0e10cSrcweir // class XFillColorItem 3246*cdf0e10cSrcweir // ------------------- 3247*cdf0e10cSrcweir TYPEINIT1_AUTOFACTORY(XFillColorItem, XColorItem); 3248*cdf0e10cSrcweir 3249*cdf0e10cSrcweir /************************************************************************* 3250*cdf0e10cSrcweir |* 3251*cdf0e10cSrcweir |* XFillColorItem::XFillColorItem(sal_Int32 nIndex, const Color& rTheColor) 3252*cdf0e10cSrcweir |* 3253*cdf0e10cSrcweir |* Beschreibung 3254*cdf0e10cSrcweir |* Ersterstellung 15.11.94 3255*cdf0e10cSrcweir |* Letzte Aenderung 15.11.94 3256*cdf0e10cSrcweir |* 3257*cdf0e10cSrcweir *************************************************************************/ 3258*cdf0e10cSrcweir 3259*cdf0e10cSrcweir XFillColorItem::XFillColorItem(sal_Int32 nIndex, const Color& rTheColor) : 3260*cdf0e10cSrcweir XColorItem(XATTR_FILLCOLOR, nIndex, rTheColor) 3261*cdf0e10cSrcweir { 3262*cdf0e10cSrcweir } 3263*cdf0e10cSrcweir 3264*cdf0e10cSrcweir /************************************************************************* 3265*cdf0e10cSrcweir |* 3266*cdf0e10cSrcweir |* XFillColorItem::XFillColorItem(const XubString& rName, const Color& rTheColor) 3267*cdf0e10cSrcweir |* 3268*cdf0e10cSrcweir |* Beschreibung 3269*cdf0e10cSrcweir |* Ersterstellung 15.11.94 3270*cdf0e10cSrcweir |* Letzte Aenderung 15.11.94 3271*cdf0e10cSrcweir |* 3272*cdf0e10cSrcweir *************************************************************************/ 3273*cdf0e10cSrcweir 3274*cdf0e10cSrcweir XFillColorItem::XFillColorItem(const XubString& rName, const Color& rTheColor) : 3275*cdf0e10cSrcweir XColorItem(XATTR_FILLCOLOR, rName, rTheColor) 3276*cdf0e10cSrcweir { 3277*cdf0e10cSrcweir } 3278*cdf0e10cSrcweir 3279*cdf0e10cSrcweir /************************************************************************* 3280*cdf0e10cSrcweir |* 3281*cdf0e10cSrcweir |* XFillColorItem::XFillColorItem(SvStream& rIn) 3282*cdf0e10cSrcweir |* 3283*cdf0e10cSrcweir |* Beschreibung 3284*cdf0e10cSrcweir |* Ersterstellung 15.11.94 3285*cdf0e10cSrcweir |* Letzte Aenderung 15.11.94 3286*cdf0e10cSrcweir |* 3287*cdf0e10cSrcweir *************************************************************************/ 3288*cdf0e10cSrcweir 3289*cdf0e10cSrcweir XFillColorItem::XFillColorItem(SvStream& rIn) : 3290*cdf0e10cSrcweir XColorItem(XATTR_FILLCOLOR, rIn) 3291*cdf0e10cSrcweir { 3292*cdf0e10cSrcweir } 3293*cdf0e10cSrcweir 3294*cdf0e10cSrcweir /************************************************************************* 3295*cdf0e10cSrcweir |* 3296*cdf0e10cSrcweir |* XFillColorItem::Clone(SfxItemPool* pPool) const 3297*cdf0e10cSrcweir |* 3298*cdf0e10cSrcweir |* Beschreibung 3299*cdf0e10cSrcweir |* Ersterstellung 15.11.94 3300*cdf0e10cSrcweir |* Letzte Aenderung 15.11.94 3301*cdf0e10cSrcweir |* 3302*cdf0e10cSrcweir *************************************************************************/ 3303*cdf0e10cSrcweir 3304*cdf0e10cSrcweir SfxPoolItem* XFillColorItem::Clone(SfxItemPool* /*pPool*/) const 3305*cdf0e10cSrcweir { 3306*cdf0e10cSrcweir return new XFillColorItem(*this); 3307*cdf0e10cSrcweir } 3308*cdf0e10cSrcweir 3309*cdf0e10cSrcweir /************************************************************************* 3310*cdf0e10cSrcweir |* 3311*cdf0e10cSrcweir |* SfxPoolItem* XFillColorItem::Create(SvStream& rIn, sal_uInt16 nVer) const 3312*cdf0e10cSrcweir |* 3313*cdf0e10cSrcweir |* Beschreibung 3314*cdf0e10cSrcweir |* Ersterstellung 15.11.94 3315*cdf0e10cSrcweir |* Letzte Aenderung 15.11.94 3316*cdf0e10cSrcweir |* 3317*cdf0e10cSrcweir *************************************************************************/ 3318*cdf0e10cSrcweir 3319*cdf0e10cSrcweir SfxPoolItem* XFillColorItem::Create(SvStream& rIn, sal_uInt16 /*nVer*/) const 3320*cdf0e10cSrcweir { 3321*cdf0e10cSrcweir return new XFillColorItem(rIn); 3322*cdf0e10cSrcweir } 3323*cdf0e10cSrcweir 3324*cdf0e10cSrcweir //------------------------------------------------------------------------ 3325*cdf0e10cSrcweir 3326*cdf0e10cSrcweir SfxItemPresentation XFillColorItem::GetPresentation 3327*cdf0e10cSrcweir ( 3328*cdf0e10cSrcweir SfxItemPresentation ePres, 3329*cdf0e10cSrcweir SfxMapUnit /*eCoreUnit*/, 3330*cdf0e10cSrcweir SfxMapUnit /*ePresUnit*/, 3331*cdf0e10cSrcweir XubString& rText, const IntlWrapper * 3332*cdf0e10cSrcweir ) const 3333*cdf0e10cSrcweir { 3334*cdf0e10cSrcweir switch ( ePres ) 3335*cdf0e10cSrcweir { 3336*cdf0e10cSrcweir case SFX_ITEM_PRESENTATION_NONE: 3337*cdf0e10cSrcweir rText.Erase(); 3338*cdf0e10cSrcweir return ePres; 3339*cdf0e10cSrcweir case SFX_ITEM_PRESENTATION_NAMELESS: 3340*cdf0e10cSrcweir case SFX_ITEM_PRESENTATION_COMPLETE: 3341*cdf0e10cSrcweir rText = GetName(); 3342*cdf0e10cSrcweir return ePres; 3343*cdf0e10cSrcweir default: 3344*cdf0e10cSrcweir return SFX_ITEM_PRESENTATION_NONE; 3345*cdf0e10cSrcweir } 3346*cdf0e10cSrcweir } 3347*cdf0e10cSrcweir 3348*cdf0e10cSrcweir // ----------------------------------------------------------------------- 3349*cdf0e10cSrcweir 3350*cdf0e10cSrcweir sal_Bool XFillColorItem::QueryValue( ::com::sun::star::uno::Any& rVal, sal_uInt8 /*nMemberId*/) const 3351*cdf0e10cSrcweir { 3352*cdf0e10cSrcweir rVal <<= (sal_Int32)GetColorValue().GetRGBColor(); 3353*cdf0e10cSrcweir 3354*cdf0e10cSrcweir return sal_True; 3355*cdf0e10cSrcweir } 3356*cdf0e10cSrcweir 3357*cdf0e10cSrcweir // ----------------------------------------------------------------------- 3358*cdf0e10cSrcweir 3359*cdf0e10cSrcweir sal_Bool XFillColorItem::PutValue( const ::com::sun::star::uno::Any& rVal, sal_uInt8 /*nMemberId*/) 3360*cdf0e10cSrcweir { 3361*cdf0e10cSrcweir sal_Int32 nValue = 0; 3362*cdf0e10cSrcweir if(!(rVal >>= nValue )) 3363*cdf0e10cSrcweir return sal_False; 3364*cdf0e10cSrcweir 3365*cdf0e10cSrcweir SetColorValue( nValue ); 3366*cdf0e10cSrcweir return sal_True; 3367*cdf0e10cSrcweir } 3368*cdf0e10cSrcweir 3369*cdf0e10cSrcweir // ----------------------------- 3370*cdf0e10cSrcweir // class XSecondaryFillColorItem 3371*cdf0e10cSrcweir // ----------------------------- 3372*cdf0e10cSrcweir TYPEINIT1_AUTOFACTORY(XSecondaryFillColorItem, XColorItem); 3373*cdf0e10cSrcweir 3374*cdf0e10cSrcweir XSecondaryFillColorItem::XSecondaryFillColorItem(sal_Int32 nIndex, const Color& rTheColor) : 3375*cdf0e10cSrcweir XColorItem(XATTR_SECONDARYFILLCOLOR, nIndex, rTheColor) 3376*cdf0e10cSrcweir { 3377*cdf0e10cSrcweir } 3378*cdf0e10cSrcweir 3379*cdf0e10cSrcweir XSecondaryFillColorItem::XSecondaryFillColorItem(const XubString& rName, const Color& rTheColor) : 3380*cdf0e10cSrcweir XColorItem(XATTR_SECONDARYFILLCOLOR, rName, rTheColor) 3381*cdf0e10cSrcweir { 3382*cdf0e10cSrcweir } 3383*cdf0e10cSrcweir 3384*cdf0e10cSrcweir XSecondaryFillColorItem::XSecondaryFillColorItem( SvStream& rIn ) : 3385*cdf0e10cSrcweir XColorItem(XATTR_SECONDARYFILLCOLOR, rIn) 3386*cdf0e10cSrcweir { 3387*cdf0e10cSrcweir } 3388*cdf0e10cSrcweir 3389*cdf0e10cSrcweir SfxPoolItem* XSecondaryFillColorItem::Clone(SfxItemPool* /*pPool*/) const 3390*cdf0e10cSrcweir { 3391*cdf0e10cSrcweir return new XSecondaryFillColorItem(*this); 3392*cdf0e10cSrcweir } 3393*cdf0e10cSrcweir 3394*cdf0e10cSrcweir SfxPoolItem* XSecondaryFillColorItem::Create( SvStream& rIn, sal_uInt16 nVer ) const 3395*cdf0e10cSrcweir { 3396*cdf0e10cSrcweir if ( nVer >= 2 ) 3397*cdf0e10cSrcweir return new XSecondaryFillColorItem( rIn ); 3398*cdf0e10cSrcweir else 3399*cdf0e10cSrcweir return new XSecondaryFillColorItem( String(), Color(0,184,255) ); 3400*cdf0e10cSrcweir } 3401*cdf0e10cSrcweir sal_uInt16 XSecondaryFillColorItem::GetVersion( sal_uInt16 /*nFileFormatVersion*/ ) const 3402*cdf0e10cSrcweir { 3403*cdf0e10cSrcweir return 2; 3404*cdf0e10cSrcweir } 3405*cdf0e10cSrcweir SfxItemPresentation XSecondaryFillColorItem::GetPresentation 3406*cdf0e10cSrcweir ( 3407*cdf0e10cSrcweir SfxItemPresentation ePres, 3408*cdf0e10cSrcweir SfxMapUnit /*eCoreUnit*/, 3409*cdf0e10cSrcweir SfxMapUnit /*ePresUnit*/, 3410*cdf0e10cSrcweir XubString& rText, const IntlWrapper * 3411*cdf0e10cSrcweir ) const 3412*cdf0e10cSrcweir { 3413*cdf0e10cSrcweir switch ( ePres ) 3414*cdf0e10cSrcweir { 3415*cdf0e10cSrcweir case SFX_ITEM_PRESENTATION_NONE: 3416*cdf0e10cSrcweir rText.Erase(); 3417*cdf0e10cSrcweir return ePres; 3418*cdf0e10cSrcweir case SFX_ITEM_PRESENTATION_NAMELESS: 3419*cdf0e10cSrcweir case SFX_ITEM_PRESENTATION_COMPLETE: 3420*cdf0e10cSrcweir rText = GetName(); 3421*cdf0e10cSrcweir return ePres; 3422*cdf0e10cSrcweir default: 3423*cdf0e10cSrcweir return SFX_ITEM_PRESENTATION_NONE; 3424*cdf0e10cSrcweir } 3425*cdf0e10cSrcweir } 3426*cdf0e10cSrcweir 3427*cdf0e10cSrcweir // ---------------- 3428*cdf0e10cSrcweir // class XGradient 3429*cdf0e10cSrcweir // ---------------- 3430*cdf0e10cSrcweir 3431*cdf0e10cSrcweir /************************************************************************* 3432*cdf0e10cSrcweir |* 3433*cdf0e10cSrcweir |* XGradient::XGradient() 3434*cdf0e10cSrcweir |* 3435*cdf0e10cSrcweir *************************************************************************/ 3436*cdf0e10cSrcweir 3437*cdf0e10cSrcweir XGradient::XGradient() : 3438*cdf0e10cSrcweir eStyle( XGRAD_LINEAR ), 3439*cdf0e10cSrcweir aStartColor( Color( COL_BLACK ) ), 3440*cdf0e10cSrcweir aEndColor( Color( COL_WHITE ) ), 3441*cdf0e10cSrcweir nAngle( 0 ), 3442*cdf0e10cSrcweir nBorder( 0 ), 3443*cdf0e10cSrcweir nOfsX( 50 ), 3444*cdf0e10cSrcweir nOfsY( 50 ), 3445*cdf0e10cSrcweir nIntensStart( 100 ), 3446*cdf0e10cSrcweir nIntensEnd( 100 ), 3447*cdf0e10cSrcweir nStepCount( 0 ) 3448*cdf0e10cSrcweir { 3449*cdf0e10cSrcweir } 3450*cdf0e10cSrcweir 3451*cdf0e10cSrcweir /************************************************************************* 3452*cdf0e10cSrcweir |* 3453*cdf0e10cSrcweir |* XGradient::XGradient(XGradientStyle, const Color&, const Color&, 3454*cdf0e10cSrcweir |* long, sal_uInt16, sal_uInt16, sal_uInt16) 3455*cdf0e10cSrcweir |* 3456*cdf0e10cSrcweir |* Beschreibung 3457*cdf0e10cSrcweir |* Ersterstellung 21.11.94 3458*cdf0e10cSrcweir |* Letzte Aenderung 21.11.94 3459*cdf0e10cSrcweir |* 3460*cdf0e10cSrcweir *************************************************************************/ 3461*cdf0e10cSrcweir 3462*cdf0e10cSrcweir XGradient::XGradient(const Color& rStart, const Color& rEnd, 3463*cdf0e10cSrcweir XGradientStyle eTheStyle, long nTheAngle, sal_uInt16 nXOfs, 3464*cdf0e10cSrcweir sal_uInt16 nYOfs, sal_uInt16 nTheBorder, 3465*cdf0e10cSrcweir sal_uInt16 nStartIntens, sal_uInt16 nEndIntens, 3466*cdf0e10cSrcweir sal_uInt16 nSteps) : 3467*cdf0e10cSrcweir eStyle(eTheStyle), 3468*cdf0e10cSrcweir aStartColor(rStart), 3469*cdf0e10cSrcweir aEndColor(rEnd), 3470*cdf0e10cSrcweir nAngle(nTheAngle), 3471*cdf0e10cSrcweir nBorder(nTheBorder), 3472*cdf0e10cSrcweir nOfsX(nXOfs), 3473*cdf0e10cSrcweir nOfsY(nYOfs), 3474*cdf0e10cSrcweir nIntensStart(nStartIntens), 3475*cdf0e10cSrcweir nIntensEnd(nEndIntens), 3476*cdf0e10cSrcweir nStepCount(nSteps) 3477*cdf0e10cSrcweir { 3478*cdf0e10cSrcweir } 3479*cdf0e10cSrcweir 3480*cdf0e10cSrcweir /************************************************************************* 3481*cdf0e10cSrcweir |* 3482*cdf0e10cSrcweir |* int XGradient::operator==(const SfxPoolItem& rItem) const 3483*cdf0e10cSrcweir |* 3484*cdf0e10cSrcweir |* Beschreibung 3485*cdf0e10cSrcweir |* Ersterstellung 29.11.94 3486*cdf0e10cSrcweir |* Letzte Aenderung 29.11.94 3487*cdf0e10cSrcweir |* 3488*cdf0e10cSrcweir *************************************************************************/ 3489*cdf0e10cSrcweir 3490*cdf0e10cSrcweir bool XGradient::operator==(const XGradient& rGradient) const 3491*cdf0e10cSrcweir { 3492*cdf0e10cSrcweir return ( eStyle == rGradient.eStyle && 3493*cdf0e10cSrcweir aStartColor == rGradient.aStartColor && 3494*cdf0e10cSrcweir aEndColor == rGradient.aEndColor && 3495*cdf0e10cSrcweir nAngle == rGradient.nAngle && 3496*cdf0e10cSrcweir nBorder == rGradient.nBorder && 3497*cdf0e10cSrcweir nOfsX == rGradient.nOfsX && 3498*cdf0e10cSrcweir nOfsY == rGradient.nOfsY && 3499*cdf0e10cSrcweir nIntensStart == rGradient.nIntensStart && 3500*cdf0e10cSrcweir nIntensEnd == rGradient.nIntensEnd && 3501*cdf0e10cSrcweir nStepCount == rGradient.nStepCount ); 3502*cdf0e10cSrcweir } 3503*cdf0e10cSrcweir 3504*cdf0e10cSrcweir 3505*cdf0e10cSrcweir // ----------------------- 3506*cdf0e10cSrcweir // class XFillGradientItem 3507*cdf0e10cSrcweir // ----------------------- 3508*cdf0e10cSrcweir TYPEINIT1_AUTOFACTORY(XFillGradientItem, NameOrIndex); 3509*cdf0e10cSrcweir 3510*cdf0e10cSrcweir /************************************************************************* 3511*cdf0e10cSrcweir |* 3512*cdf0e10cSrcweir |* XFillGradientItem::XFillGradientItem(sal_Int32 nIndex, 3513*cdf0e10cSrcweir |* const XGradient& rTheGradient) 3514*cdf0e10cSrcweir |* 3515*cdf0e10cSrcweir |* Beschreibung 3516*cdf0e10cSrcweir |* Ersterstellung 15.11.94 3517*cdf0e10cSrcweir |* Letzte Aenderung 15.11.94 3518*cdf0e10cSrcweir |* 3519*cdf0e10cSrcweir *************************************************************************/ 3520*cdf0e10cSrcweir 3521*cdf0e10cSrcweir XFillGradientItem::XFillGradientItem(sal_Int32 nIndex, 3522*cdf0e10cSrcweir const XGradient& rTheGradient) : 3523*cdf0e10cSrcweir NameOrIndex(XATTR_FILLGRADIENT, nIndex), 3524*cdf0e10cSrcweir aGradient(rTheGradient) 3525*cdf0e10cSrcweir { 3526*cdf0e10cSrcweir } 3527*cdf0e10cSrcweir 3528*cdf0e10cSrcweir /************************************************************************* 3529*cdf0e10cSrcweir |* 3530*cdf0e10cSrcweir |* XFillGradientItem::XFillGradientItem(const XubString& rName, 3531*cdf0e10cSrcweir |* const XGradient& rTheGradient) 3532*cdf0e10cSrcweir |* 3533*cdf0e10cSrcweir |* Beschreibung 3534*cdf0e10cSrcweir |* Ersterstellung 15.11.94 3535*cdf0e10cSrcweir |* Letzte Aenderung 15.11.94 3536*cdf0e10cSrcweir |* 3537*cdf0e10cSrcweir *************************************************************************/ 3538*cdf0e10cSrcweir 3539*cdf0e10cSrcweir XFillGradientItem::XFillGradientItem(const XubString& rName, 3540*cdf0e10cSrcweir const XGradient& rTheGradient) : 3541*cdf0e10cSrcweir NameOrIndex(XATTR_FILLGRADIENT, rName), 3542*cdf0e10cSrcweir aGradient(rTheGradient) 3543*cdf0e10cSrcweir { 3544*cdf0e10cSrcweir } 3545*cdf0e10cSrcweir 3546*cdf0e10cSrcweir /************************************************************************* 3547*cdf0e10cSrcweir |* 3548*cdf0e10cSrcweir |* XFillGradientItem::XFillGradientItem(const XFillGradientItem& rItem) 3549*cdf0e10cSrcweir |* 3550*cdf0e10cSrcweir |* Beschreibung 3551*cdf0e10cSrcweir |* Ersterstellung 15.11.94 3552*cdf0e10cSrcweir |* Letzte Aenderung 15.11.94 3553*cdf0e10cSrcweir |* 3554*cdf0e10cSrcweir *************************************************************************/ 3555*cdf0e10cSrcweir 3556*cdf0e10cSrcweir XFillGradientItem::XFillGradientItem(const XFillGradientItem& rItem) : 3557*cdf0e10cSrcweir NameOrIndex(rItem), 3558*cdf0e10cSrcweir aGradient(rItem.aGradient) 3559*cdf0e10cSrcweir { 3560*cdf0e10cSrcweir } 3561*cdf0e10cSrcweir 3562*cdf0e10cSrcweir /************************************************************************* 3563*cdf0e10cSrcweir |* 3564*cdf0e10cSrcweir |* XFillGradientItem::XFillGradientItem(SvStream& rIn) 3565*cdf0e10cSrcweir |* 3566*cdf0e10cSrcweir |* Beschreibung 3567*cdf0e10cSrcweir |* Ersterstellung 15.11.94 3568*cdf0e10cSrcweir |* Letzte Aenderung 15.11.94 3569*cdf0e10cSrcweir |* 3570*cdf0e10cSrcweir *************************************************************************/ 3571*cdf0e10cSrcweir 3572*cdf0e10cSrcweir XFillGradientItem::XFillGradientItem(SvStream& rIn, sal_uInt16 nVer) : 3573*cdf0e10cSrcweir NameOrIndex(XATTR_FILLGRADIENT, rIn), 3574*cdf0e10cSrcweir aGradient(COL_BLACK, COL_WHITE) 3575*cdf0e10cSrcweir { 3576*cdf0e10cSrcweir if (!IsIndex()) 3577*cdf0e10cSrcweir { 3578*cdf0e10cSrcweir sal_uInt16 nUSTemp; 3579*cdf0e10cSrcweir sal_uInt16 nRed; 3580*cdf0e10cSrcweir sal_uInt16 nGreen; 3581*cdf0e10cSrcweir sal_uInt16 nBlue; 3582*cdf0e10cSrcweir sal_Int16 nITemp; 3583*cdf0e10cSrcweir sal_Int32 nLTemp; 3584*cdf0e10cSrcweir 3585*cdf0e10cSrcweir rIn >> nITemp; aGradient.SetGradientStyle((XGradientStyle)nITemp); 3586*cdf0e10cSrcweir rIn >> nRed; 3587*cdf0e10cSrcweir rIn >> nGreen; 3588*cdf0e10cSrcweir rIn >> nBlue; 3589*cdf0e10cSrcweir Color aCol; 3590*cdf0e10cSrcweir aCol = Color( (sal_uInt8)( nRed >> 8 ), (sal_uInt8)( nGreen >> 8 ), (sal_uInt8)( nBlue >> 8 ) ); 3591*cdf0e10cSrcweir aGradient.SetStartColor( aCol ); 3592*cdf0e10cSrcweir 3593*cdf0e10cSrcweir rIn >> nRed; 3594*cdf0e10cSrcweir rIn >> nGreen; 3595*cdf0e10cSrcweir rIn >> nBlue; 3596*cdf0e10cSrcweir aCol = Color( (sal_uInt8)( nRed >> 8 ), (sal_uInt8)( nGreen >> 8 ), (sal_uInt8)( nBlue >> 8 ) ); 3597*cdf0e10cSrcweir aGradient.SetEndColor(aCol); 3598*cdf0e10cSrcweir rIn >> nLTemp; aGradient.SetAngle(nLTemp); 3599*cdf0e10cSrcweir rIn >> nUSTemp; aGradient.SetBorder(nUSTemp); 3600*cdf0e10cSrcweir rIn >> nUSTemp; aGradient.SetXOffset(nUSTemp); 3601*cdf0e10cSrcweir rIn >> nUSTemp; aGradient.SetYOffset(nUSTemp); 3602*cdf0e10cSrcweir rIn >> nUSTemp; aGradient.SetStartIntens(nUSTemp); 3603*cdf0e10cSrcweir rIn >> nUSTemp; aGradient.SetEndIntens(nUSTemp); 3604*cdf0e10cSrcweir 3605*cdf0e10cSrcweir // bei neueren Versionen wird zusaetzlich 3606*cdf0e10cSrcweir // die Schrittweite mit eingelesen 3607*cdf0e10cSrcweir if (nVer >= 1) 3608*cdf0e10cSrcweir { 3609*cdf0e10cSrcweir rIn >> nUSTemp; aGradient.SetSteps(nUSTemp); 3610*cdf0e10cSrcweir } 3611*cdf0e10cSrcweir } 3612*cdf0e10cSrcweir } 3613*cdf0e10cSrcweir 3614*cdf0e10cSrcweir //************************************************************************* 3615*cdf0e10cSrcweir 3616*cdf0e10cSrcweir XFillGradientItem::XFillGradientItem(SfxItemPool* /*pPool*/, const XGradient& rTheGradient) 3617*cdf0e10cSrcweir : NameOrIndex( XATTR_FILLGRADIENT, -1 ), 3618*cdf0e10cSrcweir aGradient(rTheGradient) 3619*cdf0e10cSrcweir { 3620*cdf0e10cSrcweir } 3621*cdf0e10cSrcweir 3622*cdf0e10cSrcweir //************************************************************************* 3623*cdf0e10cSrcweir 3624*cdf0e10cSrcweir XFillGradientItem::XFillGradientItem(SfxItemPool* /*pPool*/) 3625*cdf0e10cSrcweir : NameOrIndex(XATTR_FILLGRADIENT, -1 ) 3626*cdf0e10cSrcweir { 3627*cdf0e10cSrcweir } 3628*cdf0e10cSrcweir 3629*cdf0e10cSrcweir /************************************************************************* 3630*cdf0e10cSrcweir |* 3631*cdf0e10cSrcweir |* XFillGradientItem::Clone(SfxItemPool* pPool) const 3632*cdf0e10cSrcweir |* 3633*cdf0e10cSrcweir |* Beschreibung 3634*cdf0e10cSrcweir |* Ersterstellung 15.11.94 3635*cdf0e10cSrcweir |* Letzte Aenderung 15.11.94 3636*cdf0e10cSrcweir |* 3637*cdf0e10cSrcweir *************************************************************************/ 3638*cdf0e10cSrcweir 3639*cdf0e10cSrcweir SfxPoolItem* XFillGradientItem::Clone(SfxItemPool* /*pPool*/) const 3640*cdf0e10cSrcweir { 3641*cdf0e10cSrcweir return new XFillGradientItem(*this); 3642*cdf0e10cSrcweir } 3643*cdf0e10cSrcweir 3644*cdf0e10cSrcweir /************************************************************************* 3645*cdf0e10cSrcweir |* 3646*cdf0e10cSrcweir |* int XFillGradientItem::operator==(const SfxPoolItem& rItem) const 3647*cdf0e10cSrcweir |* 3648*cdf0e10cSrcweir |* Beschreibung 3649*cdf0e10cSrcweir |* Ersterstellung 15.11.94 3650*cdf0e10cSrcweir |* Letzte Aenderung 15.11.94 3651*cdf0e10cSrcweir |* 3652*cdf0e10cSrcweir *************************************************************************/ 3653*cdf0e10cSrcweir 3654*cdf0e10cSrcweir int XFillGradientItem::operator==(const SfxPoolItem& rItem) const 3655*cdf0e10cSrcweir { 3656*cdf0e10cSrcweir return ( NameOrIndex::operator==(rItem) && 3657*cdf0e10cSrcweir aGradient == ((const XFillGradientItem&) rItem).aGradient ); 3658*cdf0e10cSrcweir } 3659*cdf0e10cSrcweir 3660*cdf0e10cSrcweir /************************************************************************* 3661*cdf0e10cSrcweir |* 3662*cdf0e10cSrcweir |* SfxPoolItem* XFillGradientItem::Create(SvStream& rIn, sal_uInt16 nVer) const 3663*cdf0e10cSrcweir |* 3664*cdf0e10cSrcweir |* Beschreibung 3665*cdf0e10cSrcweir |* Ersterstellung 15.11.94 3666*cdf0e10cSrcweir |* Letzte Aenderung 15.11.94 3667*cdf0e10cSrcweir |* 3668*cdf0e10cSrcweir *************************************************************************/ 3669*cdf0e10cSrcweir 3670*cdf0e10cSrcweir SfxPoolItem* XFillGradientItem::Create(SvStream& rIn, sal_uInt16 nVer) const 3671*cdf0e10cSrcweir { 3672*cdf0e10cSrcweir return new XFillGradientItem(rIn, nVer); 3673*cdf0e10cSrcweir } 3674*cdf0e10cSrcweir 3675*cdf0e10cSrcweir /************************************************************************* 3676*cdf0e10cSrcweir |* 3677*cdf0e10cSrcweir |* SfxPoolItem* XFillGradientItem::Store(SvStream& rOut) const 3678*cdf0e10cSrcweir |* 3679*cdf0e10cSrcweir |* Beschreibung 3680*cdf0e10cSrcweir |* Ersterstellung 15.11.94 3681*cdf0e10cSrcweir |* Letzte Aenderung 15.11.94 3682*cdf0e10cSrcweir |* 3683*cdf0e10cSrcweir *************************************************************************/ 3684*cdf0e10cSrcweir 3685*cdf0e10cSrcweir SvStream& XFillGradientItem::Store( SvStream& rOut, sal_uInt16 nItemVersion ) const 3686*cdf0e10cSrcweir { 3687*cdf0e10cSrcweir NameOrIndex::Store( rOut, nItemVersion ); 3688*cdf0e10cSrcweir 3689*cdf0e10cSrcweir if (!IsIndex()) 3690*cdf0e10cSrcweir { 3691*cdf0e10cSrcweir rOut << (sal_Int16)aGradient.GetGradientStyle(); 3692*cdf0e10cSrcweir 3693*cdf0e10cSrcweir sal_uInt16 nTmp; 3694*cdf0e10cSrcweir 3695*cdf0e10cSrcweir nTmp = VCLTOSVCOL( aGradient.GetStartColor().GetRed() ); rOut << nTmp; 3696*cdf0e10cSrcweir nTmp = VCLTOSVCOL( aGradient.GetStartColor().GetGreen() ); rOut << nTmp; 3697*cdf0e10cSrcweir nTmp = VCLTOSVCOL( aGradient.GetStartColor().GetBlue() ); rOut << nTmp; 3698*cdf0e10cSrcweir nTmp = VCLTOSVCOL( aGradient.GetEndColor().GetRed() ); rOut << nTmp; 3699*cdf0e10cSrcweir nTmp = VCLTOSVCOL( aGradient.GetEndColor().GetGreen() ); rOut << nTmp; 3700*cdf0e10cSrcweir nTmp = VCLTOSVCOL( aGradient.GetEndColor().GetBlue() ); rOut << nTmp; 3701*cdf0e10cSrcweir 3702*cdf0e10cSrcweir rOut << (sal_Int32) aGradient.GetAngle(); 3703*cdf0e10cSrcweir rOut << aGradient.GetBorder(); 3704*cdf0e10cSrcweir rOut << aGradient.GetXOffset(); 3705*cdf0e10cSrcweir rOut << aGradient.GetYOffset(); 3706*cdf0e10cSrcweir rOut << aGradient.GetStartIntens(); 3707*cdf0e10cSrcweir rOut << aGradient.GetEndIntens(); 3708*cdf0e10cSrcweir rOut << aGradient.GetSteps(); 3709*cdf0e10cSrcweir } 3710*cdf0e10cSrcweir 3711*cdf0e10cSrcweir return rOut; 3712*cdf0e10cSrcweir } 3713*cdf0e10cSrcweir 3714*cdf0e10cSrcweir /************************************************************************* 3715*cdf0e10cSrcweir |* 3716*cdf0e10cSrcweir |* const XGradient& XFillGradientItem::GetValue(const XGradientTable* pTable) 3717*cdf0e10cSrcweir |* const 3718*cdf0e10cSrcweir |* 3719*cdf0e10cSrcweir |* Beschreibung 3720*cdf0e10cSrcweir |* Ersterstellung 15.11.94 3721*cdf0e10cSrcweir |* Letzte Aenderung 18.11.94 3722*cdf0e10cSrcweir |* 3723*cdf0e10cSrcweir *************************************************************************/ 3724*cdf0e10cSrcweir 3725*cdf0e10cSrcweir const XGradient& XFillGradientItem::GetGradientValue(const XGradientTable* pTable) const // GetValue -> GetGradientValue 3726*cdf0e10cSrcweir { 3727*cdf0e10cSrcweir if (!IsIndex()) 3728*cdf0e10cSrcweir return aGradient; 3729*cdf0e10cSrcweir else 3730*cdf0e10cSrcweir return pTable->GetGradient(GetIndex())->GetGradient(); 3731*cdf0e10cSrcweir } 3732*cdf0e10cSrcweir 3733*cdf0e10cSrcweir 3734*cdf0e10cSrcweir /************************************************************************* 3735*cdf0e10cSrcweir |* 3736*cdf0e10cSrcweir |* sal_uInt16 XFillGradientItem::GetVersion() const 3737*cdf0e10cSrcweir |* 3738*cdf0e10cSrcweir |* Beschreibung 3739*cdf0e10cSrcweir |* Ersterstellung 01.11.95 3740*cdf0e10cSrcweir |* Letzte Aenderung 01.11.95 3741*cdf0e10cSrcweir |* 3742*cdf0e10cSrcweir *************************************************************************/ 3743*cdf0e10cSrcweir 3744*cdf0e10cSrcweir sal_uInt16 XFillGradientItem::GetVersion( sal_uInt16 /*nFileFormatVersion*/) const 3745*cdf0e10cSrcweir { 3746*cdf0e10cSrcweir // !!! this version number also represents the version number of superclasses 3747*cdf0e10cSrcweir // !!! (e.g. XFillFloatTransparenceItem); if you make any changes here, 3748*cdf0e10cSrcweir // !!! the superclass is also affected 3749*cdf0e10cSrcweir return 1; 3750*cdf0e10cSrcweir } 3751*cdf0e10cSrcweir 3752*cdf0e10cSrcweir //------------------------------------------------------------------------ 3753*cdf0e10cSrcweir 3754*cdf0e10cSrcweir SfxItemPresentation XFillGradientItem::GetPresentation 3755*cdf0e10cSrcweir ( 3756*cdf0e10cSrcweir SfxItemPresentation ePres, 3757*cdf0e10cSrcweir SfxMapUnit /*eCoreUnit*/, 3758*cdf0e10cSrcweir SfxMapUnit /*ePresUnit*/, 3759*cdf0e10cSrcweir XubString& rText, const IntlWrapper * 3760*cdf0e10cSrcweir ) const 3761*cdf0e10cSrcweir { 3762*cdf0e10cSrcweir switch ( ePres ) 3763*cdf0e10cSrcweir { 3764*cdf0e10cSrcweir case SFX_ITEM_PRESENTATION_NONE: 3765*cdf0e10cSrcweir rText.Erase(); 3766*cdf0e10cSrcweir return ePres; 3767*cdf0e10cSrcweir case SFX_ITEM_PRESENTATION_NAMELESS: 3768*cdf0e10cSrcweir case SFX_ITEM_PRESENTATION_COMPLETE: 3769*cdf0e10cSrcweir rText = GetName(); 3770*cdf0e10cSrcweir return ePres; 3771*cdf0e10cSrcweir default: 3772*cdf0e10cSrcweir return SFX_ITEM_PRESENTATION_NONE; 3773*cdf0e10cSrcweir } 3774*cdf0e10cSrcweir } 3775*cdf0e10cSrcweir 3776*cdf0e10cSrcweir // ----------------------------------------------------------------------- 3777*cdf0e10cSrcweir sal_Bool XFillGradientItem::QueryValue( ::com::sun::star::uno::Any& rVal, sal_uInt8 nMemberId ) const 3778*cdf0e10cSrcweir { 3779*cdf0e10cSrcweir //sal_Bool bConvert = 0!=(nMemberId&CONVERT_TWIPS); 3780*cdf0e10cSrcweir nMemberId &= ~CONVERT_TWIPS; 3781*cdf0e10cSrcweir switch ( nMemberId ) 3782*cdf0e10cSrcweir { 3783*cdf0e10cSrcweir case 0: 3784*cdf0e10cSrcweir { 3785*cdf0e10cSrcweir uno::Sequence< beans::PropertyValue > aPropSeq( 2 ); 3786*cdf0e10cSrcweir 3787*cdf0e10cSrcweir ::com::sun::star::awt::Gradient aGradient2; 3788*cdf0e10cSrcweir 3789*cdf0e10cSrcweir const XGradient& aXGradient = GetGradientValue(); 3790*cdf0e10cSrcweir aGradient2.Style = (::com::sun::star::awt::GradientStyle) aXGradient.GetGradientStyle(); 3791*cdf0e10cSrcweir aGradient2.StartColor = (sal_Int32)aXGradient.GetStartColor().GetColor(); 3792*cdf0e10cSrcweir aGradient2.EndColor = (sal_Int32)aXGradient.GetEndColor().GetColor(); 3793*cdf0e10cSrcweir aGradient2.Angle = (short)aXGradient.GetAngle(); 3794*cdf0e10cSrcweir aGradient2.Border = aXGradient.GetBorder(); 3795*cdf0e10cSrcweir aGradient2.XOffset = aXGradient.GetXOffset(); 3796*cdf0e10cSrcweir aGradient2.YOffset = aXGradient.GetYOffset(); 3797*cdf0e10cSrcweir aGradient2.StartIntensity = aXGradient.GetStartIntens(); 3798*cdf0e10cSrcweir aGradient2.EndIntensity = aXGradient.GetEndIntens(); 3799*cdf0e10cSrcweir aGradient2.StepCount = aXGradient.GetSteps(); 3800*cdf0e10cSrcweir 3801*cdf0e10cSrcweir rtl::OUString aApiName; 3802*cdf0e10cSrcweir SvxUnogetApiNameForItem( Which(), GetName(), aApiName ); 3803*cdf0e10cSrcweir aPropSeq[0].Name = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "Name" )); 3804*cdf0e10cSrcweir aPropSeq[0].Value = uno::makeAny( aApiName ); 3805*cdf0e10cSrcweir aPropSeq[1].Name = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "FillGradient" )); 3806*cdf0e10cSrcweir aPropSeq[1].Value = uno::makeAny( aGradient2 ); 3807*cdf0e10cSrcweir rVal = uno::makeAny( aPropSeq ); 3808*cdf0e10cSrcweir break; 3809*cdf0e10cSrcweir } 3810*cdf0e10cSrcweir 3811*cdf0e10cSrcweir case MID_FILLGRADIENT: 3812*cdf0e10cSrcweir { 3813*cdf0e10cSrcweir const XGradient& aXGradient = GetGradientValue(); 3814*cdf0e10cSrcweir ::com::sun::star::awt::Gradient aGradient2; 3815*cdf0e10cSrcweir 3816*cdf0e10cSrcweir aGradient2.Style = (::com::sun::star::awt::GradientStyle) aXGradient.GetGradientStyle(); 3817*cdf0e10cSrcweir aGradient2.StartColor = (sal_Int32)aXGradient.GetStartColor().GetColor(); 3818*cdf0e10cSrcweir aGradient2.EndColor = (sal_Int32)aXGradient.GetEndColor().GetColor(); 3819*cdf0e10cSrcweir aGradient2.Angle = (short)aXGradient.GetAngle(); 3820*cdf0e10cSrcweir aGradient2.Border = aXGradient.GetBorder(); 3821*cdf0e10cSrcweir aGradient2.XOffset = aXGradient.GetXOffset(); 3822*cdf0e10cSrcweir aGradient2.YOffset = aXGradient.GetYOffset(); 3823*cdf0e10cSrcweir aGradient2.StartIntensity = aXGradient.GetStartIntens(); 3824*cdf0e10cSrcweir aGradient2.EndIntensity = aXGradient.GetEndIntens(); 3825*cdf0e10cSrcweir aGradient2.StepCount = aXGradient.GetSteps(); 3826*cdf0e10cSrcweir 3827*cdf0e10cSrcweir rVal <<= aGradient2; 3828*cdf0e10cSrcweir break; 3829*cdf0e10cSrcweir } 3830*cdf0e10cSrcweir 3831*cdf0e10cSrcweir case MID_NAME: 3832*cdf0e10cSrcweir { 3833*cdf0e10cSrcweir rtl::OUString aApiName; 3834*cdf0e10cSrcweir SvxUnogetApiNameForItem( Which(), GetName(), aApiName ); 3835*cdf0e10cSrcweir rVal <<= aApiName; 3836*cdf0e10cSrcweir break; 3837*cdf0e10cSrcweir } 3838*cdf0e10cSrcweir 3839*cdf0e10cSrcweir case MID_GRADIENT_STYLE: rVal <<= (sal_Int16)GetGradientValue().GetGradientStyle(); break; 3840*cdf0e10cSrcweir case MID_GRADIENT_STARTCOLOR: rVal <<= (sal_Int32)GetGradientValue().GetStartColor().GetColor(); break; 3841*cdf0e10cSrcweir case MID_GRADIENT_ENDCOLOR: rVal <<= (sal_Int32)GetGradientValue().GetEndColor().GetColor(); break; 3842*cdf0e10cSrcweir case MID_GRADIENT_ANGLE: rVal <<= (sal_Int16)GetGradientValue().GetAngle(); break; 3843*cdf0e10cSrcweir case MID_GRADIENT_BORDER: rVal <<= GetGradientValue().GetBorder(); break; 3844*cdf0e10cSrcweir case MID_GRADIENT_XOFFSET: rVal <<= GetGradientValue().GetXOffset(); break; 3845*cdf0e10cSrcweir case MID_GRADIENT_YOFFSET: rVal <<= GetGradientValue().GetYOffset(); break; 3846*cdf0e10cSrcweir case MID_GRADIENT_STARTINTENSITY: rVal <<= GetGradientValue().GetStartIntens(); break; 3847*cdf0e10cSrcweir case MID_GRADIENT_ENDINTENSITY: rVal <<= GetGradientValue().GetEndIntens(); break; 3848*cdf0e10cSrcweir case MID_GRADIENT_STEPCOUNT: rVal <<= GetGradientValue().GetSteps(); break; 3849*cdf0e10cSrcweir 3850*cdf0e10cSrcweir default: DBG_ERROR("Wrong MemberId!"); return sal_False; 3851*cdf0e10cSrcweir } 3852*cdf0e10cSrcweir 3853*cdf0e10cSrcweir return sal_True; 3854*cdf0e10cSrcweir } 3855*cdf0e10cSrcweir 3856*cdf0e10cSrcweir // ----------------------------------------------------------------------- 3857*cdf0e10cSrcweir sal_Bool XFillGradientItem::PutValue( const ::com::sun::star::uno::Any& rVal, sal_uInt8 nMemberId ) 3858*cdf0e10cSrcweir { 3859*cdf0e10cSrcweir // sal_Bool bConvert = 0!=(nMemberId&CONVERT_TWIPS); 3860*cdf0e10cSrcweir nMemberId &= ~CONVERT_TWIPS; 3861*cdf0e10cSrcweir 3862*cdf0e10cSrcweir switch ( nMemberId ) 3863*cdf0e10cSrcweir { 3864*cdf0e10cSrcweir case 0: 3865*cdf0e10cSrcweir { 3866*cdf0e10cSrcweir uno::Sequence< beans::PropertyValue > aPropSeq; 3867*cdf0e10cSrcweir ::com::sun::star::awt::Gradient aGradient2; 3868*cdf0e10cSrcweir rtl::OUString aName; 3869*cdf0e10cSrcweir bool bGradient( false ); 3870*cdf0e10cSrcweir 3871*cdf0e10cSrcweir if ( rVal >>= aPropSeq ) 3872*cdf0e10cSrcweir { 3873*cdf0e10cSrcweir for ( sal_Int32 n = 0; n < aPropSeq.getLength(); n++ ) 3874*cdf0e10cSrcweir { 3875*cdf0e10cSrcweir if ( aPropSeq[n].Name.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "Name" ))) 3876*cdf0e10cSrcweir aPropSeq[n].Value >>= aName; 3877*cdf0e10cSrcweir else if ( aPropSeq[n].Name.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "FillGradient" ))) 3878*cdf0e10cSrcweir { 3879*cdf0e10cSrcweir if ( aPropSeq[n].Value >>= aGradient2 ) 3880*cdf0e10cSrcweir bGradient = true; 3881*cdf0e10cSrcweir } 3882*cdf0e10cSrcweir } 3883*cdf0e10cSrcweir 3884*cdf0e10cSrcweir SetName( aName ); 3885*cdf0e10cSrcweir if ( bGradient ) 3886*cdf0e10cSrcweir { 3887*cdf0e10cSrcweir XGradient aXGradient; 3888*cdf0e10cSrcweir 3889*cdf0e10cSrcweir aXGradient.SetGradientStyle( (XGradientStyle) aGradient2.Style ); 3890*cdf0e10cSrcweir aXGradient.SetStartColor( aGradient2.StartColor ); 3891*cdf0e10cSrcweir aXGradient.SetEndColor( aGradient2.EndColor ); 3892*cdf0e10cSrcweir aXGradient.SetAngle( aGradient2.Angle ); 3893*cdf0e10cSrcweir aXGradient.SetBorder( aGradient2.Border ); 3894*cdf0e10cSrcweir aXGradient.SetXOffset( aGradient2.XOffset ); 3895*cdf0e10cSrcweir aXGradient.SetYOffset( aGradient2.YOffset ); 3896*cdf0e10cSrcweir aXGradient.SetStartIntens( aGradient2.StartIntensity ); 3897*cdf0e10cSrcweir aXGradient.SetEndIntens( aGradient2.EndIntensity ); 3898*cdf0e10cSrcweir aXGradient.SetSteps( aGradient2.StepCount ); 3899*cdf0e10cSrcweir 3900*cdf0e10cSrcweir SetGradientValue( aXGradient ); 3901*cdf0e10cSrcweir } 3902*cdf0e10cSrcweir 3903*cdf0e10cSrcweir return sal_True; 3904*cdf0e10cSrcweir } 3905*cdf0e10cSrcweir 3906*cdf0e10cSrcweir return sal_False; 3907*cdf0e10cSrcweir } 3908*cdf0e10cSrcweir 3909*cdf0e10cSrcweir case MID_NAME: 3910*cdf0e10cSrcweir { 3911*cdf0e10cSrcweir rtl::OUString aName; 3912*cdf0e10cSrcweir if (!(rVal >>= aName )) 3913*cdf0e10cSrcweir return sal_False; 3914*cdf0e10cSrcweir SetName( aName ); 3915*cdf0e10cSrcweir break; 3916*cdf0e10cSrcweir } 3917*cdf0e10cSrcweir 3918*cdf0e10cSrcweir case MID_FILLGRADIENT: 3919*cdf0e10cSrcweir { 3920*cdf0e10cSrcweir ::com::sun::star::awt::Gradient aGradient2; 3921*cdf0e10cSrcweir if(!(rVal >>= aGradient2)) 3922*cdf0e10cSrcweir return sal_False; 3923*cdf0e10cSrcweir 3924*cdf0e10cSrcweir XGradient aXGradient; 3925*cdf0e10cSrcweir 3926*cdf0e10cSrcweir aXGradient.SetGradientStyle( (XGradientStyle) aGradient2.Style ); 3927*cdf0e10cSrcweir aXGradient.SetStartColor( aGradient2.StartColor ); 3928*cdf0e10cSrcweir aXGradient.SetEndColor( aGradient2.EndColor ); 3929*cdf0e10cSrcweir aXGradient.SetAngle( aGradient2.Angle ); 3930*cdf0e10cSrcweir aXGradient.SetBorder( aGradient2.Border ); 3931*cdf0e10cSrcweir aXGradient.SetXOffset( aGradient2.XOffset ); 3932*cdf0e10cSrcweir aXGradient.SetYOffset( aGradient2.YOffset ); 3933*cdf0e10cSrcweir aXGradient.SetStartIntens( aGradient2.StartIntensity ); 3934*cdf0e10cSrcweir aXGradient.SetEndIntens( aGradient2.EndIntensity ); 3935*cdf0e10cSrcweir aXGradient.SetSteps( aGradient2.StepCount ); 3936*cdf0e10cSrcweir 3937*cdf0e10cSrcweir SetGradientValue( aXGradient ); 3938*cdf0e10cSrcweir break; 3939*cdf0e10cSrcweir } 3940*cdf0e10cSrcweir 3941*cdf0e10cSrcweir case MID_GRADIENT_STARTCOLOR: 3942*cdf0e10cSrcweir case MID_GRADIENT_ENDCOLOR: 3943*cdf0e10cSrcweir { 3944*cdf0e10cSrcweir sal_Int32 nVal = 0; 3945*cdf0e10cSrcweir if(!(rVal >>= nVal )) 3946*cdf0e10cSrcweir return sal_False; 3947*cdf0e10cSrcweir 3948*cdf0e10cSrcweir XGradient aXGradient = GetGradientValue(); 3949*cdf0e10cSrcweir 3950*cdf0e10cSrcweir if ( nMemberId == MID_GRADIENT_STARTCOLOR ) 3951*cdf0e10cSrcweir aXGradient.SetStartColor( nVal ); 3952*cdf0e10cSrcweir else 3953*cdf0e10cSrcweir aXGradient.SetEndColor( nVal ); 3954*cdf0e10cSrcweir SetGradientValue( aXGradient ); 3955*cdf0e10cSrcweir break; 3956*cdf0e10cSrcweir } 3957*cdf0e10cSrcweir 3958*cdf0e10cSrcweir case MID_GRADIENT_STYLE: 3959*cdf0e10cSrcweir case MID_GRADIENT_ANGLE: 3960*cdf0e10cSrcweir case MID_GRADIENT_BORDER: 3961*cdf0e10cSrcweir case MID_GRADIENT_STARTINTENSITY: 3962*cdf0e10cSrcweir case MID_GRADIENT_ENDINTENSITY: 3963*cdf0e10cSrcweir case MID_GRADIENT_STEPCOUNT: 3964*cdf0e10cSrcweir case MID_GRADIENT_XOFFSET: 3965*cdf0e10cSrcweir case MID_GRADIENT_YOFFSET: 3966*cdf0e10cSrcweir { 3967*cdf0e10cSrcweir sal_Int16 nVal = sal_Int16(); 3968*cdf0e10cSrcweir if(!(rVal >>= nVal )) 3969*cdf0e10cSrcweir return sal_False; 3970*cdf0e10cSrcweir 3971*cdf0e10cSrcweir XGradient aXGradient = GetGradientValue(); 3972*cdf0e10cSrcweir 3973*cdf0e10cSrcweir switch ( nMemberId ) 3974*cdf0e10cSrcweir { 3975*cdf0e10cSrcweir case MID_GRADIENT_STYLE: 3976*cdf0e10cSrcweir aXGradient.SetGradientStyle( (XGradientStyle)nVal ); break; 3977*cdf0e10cSrcweir case MID_GRADIENT_ANGLE: 3978*cdf0e10cSrcweir aXGradient.SetAngle( nVal ); break; 3979*cdf0e10cSrcweir case MID_GRADIENT_BORDER: 3980*cdf0e10cSrcweir aXGradient.SetBorder( nVal ); break; 3981*cdf0e10cSrcweir case MID_GRADIENT_STARTINTENSITY: 3982*cdf0e10cSrcweir aXGradient.SetStartIntens( nVal ); break; 3983*cdf0e10cSrcweir case MID_GRADIENT_ENDINTENSITY: 3984*cdf0e10cSrcweir aXGradient.SetEndIntens( nVal ); break; 3985*cdf0e10cSrcweir case MID_GRADIENT_STEPCOUNT: 3986*cdf0e10cSrcweir aXGradient.SetSteps( nVal ); break; 3987*cdf0e10cSrcweir case MID_GRADIENT_XOFFSET: 3988*cdf0e10cSrcweir aXGradient.SetXOffset( nVal ); break; 3989*cdf0e10cSrcweir case MID_GRADIENT_YOFFSET: 3990*cdf0e10cSrcweir aXGradient.SetYOffset( nVal ); break; 3991*cdf0e10cSrcweir } 3992*cdf0e10cSrcweir 3993*cdf0e10cSrcweir SetGradientValue( aXGradient ); 3994*cdf0e10cSrcweir break; 3995*cdf0e10cSrcweir } 3996*cdf0e10cSrcweir } 3997*cdf0e10cSrcweir 3998*cdf0e10cSrcweir return sal_True; 3999*cdf0e10cSrcweir } 4000*cdf0e10cSrcweir 4001*cdf0e10cSrcweir sal_Bool XFillGradientItem::CompareValueFunc( const NameOrIndex* p1, const NameOrIndex* p2 ) 4002*cdf0e10cSrcweir { 4003*cdf0e10cSrcweir return ((XFillGradientItem*)p1)->GetGradientValue() == ((XFillGradientItem*)p2)->GetGradientValue(); 4004*cdf0e10cSrcweir } 4005*cdf0e10cSrcweir 4006*cdf0e10cSrcweir XFillGradientItem* XFillGradientItem::checkForUniqueItem( SdrModel* pModel ) const 4007*cdf0e10cSrcweir { 4008*cdf0e10cSrcweir if( pModel ) 4009*cdf0e10cSrcweir { 4010*cdf0e10cSrcweir const String aUniqueName = NameOrIndex::CheckNamedItem( this, 4011*cdf0e10cSrcweir XATTR_FILLGRADIENT, 4012*cdf0e10cSrcweir &pModel->GetItemPool(), 4013*cdf0e10cSrcweir pModel->GetStyleSheetPool() ? &pModel->GetStyleSheetPool()->GetPool() : NULL, 4014*cdf0e10cSrcweir XFillGradientItem::CompareValueFunc, 4015*cdf0e10cSrcweir RID_SVXSTR_GRADIENT, 4016*cdf0e10cSrcweir pModel->GetGradientList() ); 4017*cdf0e10cSrcweir 4018*cdf0e10cSrcweir // if the given name is not valid, replace it! 4019*cdf0e10cSrcweir if( aUniqueName != GetName() ) 4020*cdf0e10cSrcweir { 4021*cdf0e10cSrcweir return new XFillGradientItem( aUniqueName, aGradient ); 4022*cdf0e10cSrcweir } 4023*cdf0e10cSrcweir } 4024*cdf0e10cSrcweir 4025*cdf0e10cSrcweir return (XFillGradientItem*)this; 4026*cdf0e10cSrcweir } 4027*cdf0e10cSrcweir 4028*cdf0e10cSrcweir // ---------------------------------- 4029*cdf0e10cSrcweir // class XFillFloatTransparenceItem - 4030*cdf0e10cSrcweir // ---------------------------------- 4031*cdf0e10cSrcweir 4032*cdf0e10cSrcweir TYPEINIT1_AUTOFACTORY( XFillFloatTransparenceItem, XFillGradientItem ); 4033*cdf0e10cSrcweir 4034*cdf0e10cSrcweir // ----------------------------------------------------------------------------- 4035*cdf0e10cSrcweir 4036*cdf0e10cSrcweir XFillFloatTransparenceItem::XFillFloatTransparenceItem() : 4037*cdf0e10cSrcweir bEnabled( sal_False ) 4038*cdf0e10cSrcweir { 4039*cdf0e10cSrcweir SetWhich( XATTR_FILLFLOATTRANSPARENCE ); 4040*cdf0e10cSrcweir } 4041*cdf0e10cSrcweir 4042*cdf0e10cSrcweir //------------------------------------------------------------------------ 4043*cdf0e10cSrcweir 4044*cdf0e10cSrcweir XFillFloatTransparenceItem::XFillFloatTransparenceItem( sal_Int32 nIndex, const XGradient& rGradient, sal_Bool bEnable ) : 4045*cdf0e10cSrcweir XFillGradientItem ( nIndex, rGradient ), 4046*cdf0e10cSrcweir bEnabled ( bEnable ) 4047*cdf0e10cSrcweir { 4048*cdf0e10cSrcweir SetWhich( XATTR_FILLFLOATTRANSPARENCE ); 4049*cdf0e10cSrcweir } 4050*cdf0e10cSrcweir 4051*cdf0e10cSrcweir //------------------------------------------------------------------------ 4052*cdf0e10cSrcweir 4053*cdf0e10cSrcweir XFillFloatTransparenceItem::XFillFloatTransparenceItem(const XubString& rName, const XGradient& rGradient, sal_Bool bEnable ) : 4054*cdf0e10cSrcweir XFillGradientItem ( rName, rGradient ), 4055*cdf0e10cSrcweir bEnabled ( bEnable ) 4056*cdf0e10cSrcweir { 4057*cdf0e10cSrcweir SetWhich( XATTR_FILLFLOATTRANSPARENCE ); 4058*cdf0e10cSrcweir } 4059*cdf0e10cSrcweir 4060*cdf0e10cSrcweir //------------------------------------------------------------------------ 4061*cdf0e10cSrcweir 4062*cdf0e10cSrcweir XFillFloatTransparenceItem::XFillFloatTransparenceItem( const XFillFloatTransparenceItem& rItem ) : 4063*cdf0e10cSrcweir XFillGradientItem ( rItem ), 4064*cdf0e10cSrcweir bEnabled ( rItem.bEnabled ) 4065*cdf0e10cSrcweir { 4066*cdf0e10cSrcweir SetWhich( XATTR_FILLFLOATTRANSPARENCE ); 4067*cdf0e10cSrcweir } 4068*cdf0e10cSrcweir 4069*cdf0e10cSrcweir //------------------------------------------------------------------------ 4070*cdf0e10cSrcweir 4071*cdf0e10cSrcweir //XFillFloatTransparenceItem::XFillFloatTransparenceItem( SvStream& rIn, sal_uInt16 nVer ) : 4072*cdf0e10cSrcweir // XFillGradientItem ( rIn, nVer ) 4073*cdf0e10cSrcweir //{ 4074*cdf0e10cSrcweir // SetWhich( XATTR_FILLFLOATTRANSPARENCE ); 4075*cdf0e10cSrcweir // rIn >> bEnabled; 4076*cdf0e10cSrcweir //} 4077*cdf0e10cSrcweir 4078*cdf0e10cSrcweir //************************************************************************* 4079*cdf0e10cSrcweir 4080*cdf0e10cSrcweir XFillFloatTransparenceItem::XFillFloatTransparenceItem(SfxItemPool* /*pPool*/, const XGradient& rTheGradient, sal_Bool bEnable ) 4081*cdf0e10cSrcweir : XFillGradientItem ( -1, rTheGradient ), 4082*cdf0e10cSrcweir bEnabled ( bEnable ) 4083*cdf0e10cSrcweir { 4084*cdf0e10cSrcweir SetWhich( XATTR_FILLFLOATTRANSPARENCE ); 4085*cdf0e10cSrcweir } 4086*cdf0e10cSrcweir 4087*cdf0e10cSrcweir //************************************************************************* 4088*cdf0e10cSrcweir 4089*cdf0e10cSrcweir XFillFloatTransparenceItem::XFillFloatTransparenceItem(SfxItemPool* /*pPool*/) 4090*cdf0e10cSrcweir { 4091*cdf0e10cSrcweir SetWhich( XATTR_FILLFLOATTRANSPARENCE ); 4092*cdf0e10cSrcweir } 4093*cdf0e10cSrcweir 4094*cdf0e10cSrcweir //------------------------------------------------------------------------ 4095*cdf0e10cSrcweir 4096*cdf0e10cSrcweir int XFillFloatTransparenceItem::operator==( const SfxPoolItem& rItem ) const 4097*cdf0e10cSrcweir { 4098*cdf0e10cSrcweir return ( NameOrIndex::operator==(rItem) ) && 4099*cdf0e10cSrcweir ( GetGradientValue() == ((const XFillGradientItem&)rItem).GetGradientValue() ) && 4100*cdf0e10cSrcweir ( bEnabled == ( (XFillFloatTransparenceItem&) rItem ).bEnabled ); 4101*cdf0e10cSrcweir } 4102*cdf0e10cSrcweir 4103*cdf0e10cSrcweir //------------------------------------------------------------------------ 4104*cdf0e10cSrcweir 4105*cdf0e10cSrcweir SfxPoolItem* XFillFloatTransparenceItem::Clone( SfxItemPool* /*pPool*/) const 4106*cdf0e10cSrcweir { 4107*cdf0e10cSrcweir return new XFillFloatTransparenceItem( *this ); 4108*cdf0e10cSrcweir } 4109*cdf0e10cSrcweir 4110*cdf0e10cSrcweir //------------------------------------------------------------------------ 4111*cdf0e10cSrcweir 4112*cdf0e10cSrcweir //SfxPoolItem* XFillFloatTransparenceItem::Create( SvStream& rIn, sal_uInt16 nVer ) const 4113*cdf0e10cSrcweir //{ 4114*cdf0e10cSrcweir // return( ( 0 == nVer ) ? Clone( NULL ) : new XFillFloatTransparenceItem( rIn, nVer ) ); 4115*cdf0e10cSrcweir //} 4116*cdf0e10cSrcweir 4117*cdf0e10cSrcweir //------------------------------------------------------------------------ 4118*cdf0e10cSrcweir 4119*cdf0e10cSrcweir //SvStream& XFillFloatTransparenceItem::Store( SvStream& rOut, sal_uInt16 nItemVersion ) const 4120*cdf0e10cSrcweir //{ 4121*cdf0e10cSrcweir // XFillGradientItem::Store( rOut, nItemVersion ); 4122*cdf0e10cSrcweir // rOut << bEnabled; 4123*cdf0e10cSrcweir // return rOut; 4124*cdf0e10cSrcweir //} 4125*cdf0e10cSrcweir 4126*cdf0e10cSrcweir //------------------------------------------------------------------------ 4127*cdf0e10cSrcweir 4128*cdf0e10cSrcweir sal_uInt16 XFillFloatTransparenceItem::GetVersion( sal_uInt16 nFileFormatVersion ) const 4129*cdf0e10cSrcweir { 4130*cdf0e10cSrcweir // !!! if version number of this object must be increased, please !!! 4131*cdf0e10cSrcweir // !!! increase version number of base class XFillGradientItem !!! 4132*cdf0e10cSrcweir return XFillGradientItem::GetVersion( nFileFormatVersion ); 4133*cdf0e10cSrcweir } 4134*cdf0e10cSrcweir 4135*cdf0e10cSrcweir //------------------------------------------------------------------------ 4136*cdf0e10cSrcweir 4137*cdf0e10cSrcweir sal_Bool XFillFloatTransparenceItem::QueryValue( ::com::sun::star::uno::Any& rVal, sal_uInt8 nMemberId ) const 4138*cdf0e10cSrcweir { 4139*cdf0e10cSrcweir return XFillGradientItem::QueryValue( rVal, nMemberId ); 4140*cdf0e10cSrcweir } 4141*cdf0e10cSrcweir 4142*cdf0e10cSrcweir //------------------------------------------------------------------------ 4143*cdf0e10cSrcweir 4144*cdf0e10cSrcweir sal_Bool XFillFloatTransparenceItem::PutValue( const ::com::sun::star::uno::Any& rVal, sal_uInt8 nMemberId ) 4145*cdf0e10cSrcweir { 4146*cdf0e10cSrcweir return XFillGradientItem::PutValue( rVal, nMemberId ); 4147*cdf0e10cSrcweir } 4148*cdf0e10cSrcweir 4149*cdf0e10cSrcweir //------------------------------------------------------------------------ 4150*cdf0e10cSrcweir 4151*cdf0e10cSrcweir SfxItemPresentation XFillFloatTransparenceItem::GetPresentation( SfxItemPresentation ePres, 4152*cdf0e10cSrcweir SfxMapUnit eCoreUnit, SfxMapUnit ePresUnit, 4153*cdf0e10cSrcweir XubString& rText, 4154*cdf0e10cSrcweir const IntlWrapper * pIntlWrapper ) const 4155*cdf0e10cSrcweir { 4156*cdf0e10cSrcweir return XFillGradientItem::GetPresentation( ePres, eCoreUnit, ePresUnit, rText, pIntlWrapper ); 4157*cdf0e10cSrcweir } 4158*cdf0e10cSrcweir 4159*cdf0e10cSrcweir sal_Bool XFillFloatTransparenceItem::CompareValueFunc( const NameOrIndex* p1, const NameOrIndex* p2 ) 4160*cdf0e10cSrcweir { 4161*cdf0e10cSrcweir return ((XFillFloatTransparenceItem*)p1)->IsEnabled() == ((XFillFloatTransparenceItem*)p2)->IsEnabled() && 4162*cdf0e10cSrcweir ((XFillFloatTransparenceItem*)p1)->GetGradientValue() == ((XFillFloatTransparenceItem*)p2)->GetGradientValue(); 4163*cdf0e10cSrcweir } 4164*cdf0e10cSrcweir 4165*cdf0e10cSrcweir XFillFloatTransparenceItem* XFillFloatTransparenceItem::checkForUniqueItem( SdrModel* pModel ) const 4166*cdf0e10cSrcweir { 4167*cdf0e10cSrcweir // #85953# unique name only necessary when enabled 4168*cdf0e10cSrcweir if(IsEnabled()) 4169*cdf0e10cSrcweir { 4170*cdf0e10cSrcweir if( pModel ) 4171*cdf0e10cSrcweir { 4172*cdf0e10cSrcweir const String aUniqueName = NameOrIndex::CheckNamedItem( this, 4173*cdf0e10cSrcweir XATTR_FILLFLOATTRANSPARENCE, 4174*cdf0e10cSrcweir &pModel->GetItemPool(), 4175*cdf0e10cSrcweir pModel->GetStyleSheetPool() ? &pModel->GetStyleSheetPool()->GetPool() : NULL, 4176*cdf0e10cSrcweir XFillFloatTransparenceItem::CompareValueFunc, 4177*cdf0e10cSrcweir RID_SVXSTR_TRASNGR0, 4178*cdf0e10cSrcweir NULL ); 4179*cdf0e10cSrcweir 4180*cdf0e10cSrcweir // if the given name is not valid, replace it! 4181*cdf0e10cSrcweir if( aUniqueName != GetName() ) 4182*cdf0e10cSrcweir { 4183*cdf0e10cSrcweir return new XFillFloatTransparenceItem( aUniqueName, GetGradientValue(), sal_True ); 4184*cdf0e10cSrcweir } 4185*cdf0e10cSrcweir } 4186*cdf0e10cSrcweir } 4187*cdf0e10cSrcweir else 4188*cdf0e10cSrcweir { 4189*cdf0e10cSrcweir // #85953# if disabled, force name to empty string 4190*cdf0e10cSrcweir if(GetName().Len()) 4191*cdf0e10cSrcweir { 4192*cdf0e10cSrcweir return new XFillFloatTransparenceItem(String(), GetGradientValue(), sal_False); 4193*cdf0e10cSrcweir } 4194*cdf0e10cSrcweir } 4195*cdf0e10cSrcweir 4196*cdf0e10cSrcweir return (XFillFloatTransparenceItem*)this; 4197*cdf0e10cSrcweir } 4198*cdf0e10cSrcweir 4199*cdf0e10cSrcweir // ------------- 4200*cdf0e10cSrcweir // class XHatch 4201*cdf0e10cSrcweir // ------------- 4202*cdf0e10cSrcweir 4203*cdf0e10cSrcweir /************************************************************************* 4204*cdf0e10cSrcweir |* 4205*cdf0e10cSrcweir |* XHatch::XHatch(XHatchStyle, const Color&, long, long) 4206*cdf0e10cSrcweir |* 4207*cdf0e10cSrcweir |* Beschreibung 4208*cdf0e10cSrcweir |* Ersterstellung 21.11.94 4209*cdf0e10cSrcweir |* Letzte Aenderung 21.11.94 4210*cdf0e10cSrcweir |* 4211*cdf0e10cSrcweir *************************************************************************/ 4212*cdf0e10cSrcweir 4213*cdf0e10cSrcweir XHatch::XHatch(const Color& rCol, XHatchStyle eTheStyle, long nTheDistance, 4214*cdf0e10cSrcweir long nTheAngle) : 4215*cdf0e10cSrcweir eStyle(eTheStyle), 4216*cdf0e10cSrcweir aColor(rCol), 4217*cdf0e10cSrcweir nDistance(nTheDistance), 4218*cdf0e10cSrcweir nAngle(nTheAngle) 4219*cdf0e10cSrcweir { 4220*cdf0e10cSrcweir } 4221*cdf0e10cSrcweir 4222*cdf0e10cSrcweir /************************************************************************* 4223*cdf0e10cSrcweir |* 4224*cdf0e10cSrcweir |* int XHatch::operator==(const SfxPoolItem& rItem) const 4225*cdf0e10cSrcweir |* 4226*cdf0e10cSrcweir |* Beschreibung 4227*cdf0e10cSrcweir |* Ersterstellung 29.11.94 4228*cdf0e10cSrcweir |* Letzte Aenderung 29.11.94 4229*cdf0e10cSrcweir |* 4230*cdf0e10cSrcweir *************************************************************************/ 4231*cdf0e10cSrcweir 4232*cdf0e10cSrcweir bool XHatch::operator==(const XHatch& rHatch) const 4233*cdf0e10cSrcweir { 4234*cdf0e10cSrcweir return ( eStyle == rHatch.eStyle && 4235*cdf0e10cSrcweir aColor == rHatch.aColor && 4236*cdf0e10cSrcweir nDistance == rHatch.nDistance && 4237*cdf0e10cSrcweir nAngle == rHatch.nAngle ); 4238*cdf0e10cSrcweir } 4239*cdf0e10cSrcweir 4240*cdf0e10cSrcweir 4241*cdf0e10cSrcweir // ----------------------- 4242*cdf0e10cSrcweir // class XFillHatchItem 4243*cdf0e10cSrcweir // ----------------------- 4244*cdf0e10cSrcweir TYPEINIT1_AUTOFACTORY(XFillHatchItem, NameOrIndex); 4245*cdf0e10cSrcweir 4246*cdf0e10cSrcweir /************************************************************************* 4247*cdf0e10cSrcweir |* 4248*cdf0e10cSrcweir |* XFillHatchItem::XFillHatchItem(sal_Int32 nIndex, 4249*cdf0e10cSrcweir |* const XHatch& rTheHatch) 4250*cdf0e10cSrcweir |* 4251*cdf0e10cSrcweir |* Beschreibung 4252*cdf0e10cSrcweir |* Ersterstellung 15.11.94 4253*cdf0e10cSrcweir |* Letzte Aenderung 15.11.94 4254*cdf0e10cSrcweir |* 4255*cdf0e10cSrcweir *************************************************************************/ 4256*cdf0e10cSrcweir 4257*cdf0e10cSrcweir XFillHatchItem::XFillHatchItem(sal_Int32 nIndex, 4258*cdf0e10cSrcweir const XHatch& rTheHatch) : 4259*cdf0e10cSrcweir NameOrIndex(XATTR_FILLHATCH, nIndex), 4260*cdf0e10cSrcweir aHatch(rTheHatch) 4261*cdf0e10cSrcweir { 4262*cdf0e10cSrcweir } 4263*cdf0e10cSrcweir 4264*cdf0e10cSrcweir /************************************************************************* 4265*cdf0e10cSrcweir |* 4266*cdf0e10cSrcweir |* XFillHatchItem::XFillHatchItem(const XubString& rName, 4267*cdf0e10cSrcweir |* const XHatch& rTheHatch) 4268*cdf0e10cSrcweir |* 4269*cdf0e10cSrcweir |* Beschreibung 4270*cdf0e10cSrcweir |* Ersterstellung 15.11.94 4271*cdf0e10cSrcweir |* Letzte Aenderung 15.11.94 4272*cdf0e10cSrcweir |* 4273*cdf0e10cSrcweir *************************************************************************/ 4274*cdf0e10cSrcweir 4275*cdf0e10cSrcweir XFillHatchItem::XFillHatchItem(const XubString& rName, 4276*cdf0e10cSrcweir const XHatch& rTheHatch) : 4277*cdf0e10cSrcweir NameOrIndex(XATTR_FILLHATCH, rName), 4278*cdf0e10cSrcweir aHatch(rTheHatch) 4279*cdf0e10cSrcweir { 4280*cdf0e10cSrcweir } 4281*cdf0e10cSrcweir 4282*cdf0e10cSrcweir /************************************************************************* 4283*cdf0e10cSrcweir |* 4284*cdf0e10cSrcweir |* XFillHatchItem::XFillHatchItem(const XFillHatchItem& rItem) 4285*cdf0e10cSrcweir |* 4286*cdf0e10cSrcweir |* Beschreibung 4287*cdf0e10cSrcweir |* Ersterstellung 15.11.94 4288*cdf0e10cSrcweir |* Letzte Aenderung 15.11.94 4289*cdf0e10cSrcweir |* 4290*cdf0e10cSrcweir *************************************************************************/ 4291*cdf0e10cSrcweir 4292*cdf0e10cSrcweir XFillHatchItem::XFillHatchItem(const XFillHatchItem& rItem) : 4293*cdf0e10cSrcweir NameOrIndex(rItem), 4294*cdf0e10cSrcweir aHatch(rItem.aHatch) 4295*cdf0e10cSrcweir { 4296*cdf0e10cSrcweir } 4297*cdf0e10cSrcweir 4298*cdf0e10cSrcweir /************************************************************************* 4299*cdf0e10cSrcweir |* 4300*cdf0e10cSrcweir |* XFillHatchItem::XFillHatchItem(SvStream& rIn) 4301*cdf0e10cSrcweir |* 4302*cdf0e10cSrcweir |* Beschreibung 4303*cdf0e10cSrcweir |* Ersterstellung 15.11.94 4304*cdf0e10cSrcweir |* Letzte Aenderung 15.11.94 4305*cdf0e10cSrcweir |* 4306*cdf0e10cSrcweir *************************************************************************/ 4307*cdf0e10cSrcweir 4308*cdf0e10cSrcweir XFillHatchItem::XFillHatchItem(SvStream& rIn) : 4309*cdf0e10cSrcweir NameOrIndex(XATTR_FILLHATCH, rIn), 4310*cdf0e10cSrcweir aHatch(COL_BLACK) 4311*cdf0e10cSrcweir { 4312*cdf0e10cSrcweir if (!IsIndex()) 4313*cdf0e10cSrcweir { 4314*cdf0e10cSrcweir sal_uInt16 nRed; 4315*cdf0e10cSrcweir sal_uInt16 nGreen; 4316*cdf0e10cSrcweir sal_uInt16 nBlue; 4317*cdf0e10cSrcweir sal_Int16 nITemp; 4318*cdf0e10cSrcweir sal_Int32 nLTemp; 4319*cdf0e10cSrcweir 4320*cdf0e10cSrcweir rIn >> nITemp; aHatch.SetHatchStyle((XHatchStyle)nITemp); 4321*cdf0e10cSrcweir rIn >> nRed; 4322*cdf0e10cSrcweir rIn >> nGreen; 4323*cdf0e10cSrcweir rIn >> nBlue; 4324*cdf0e10cSrcweir 4325*cdf0e10cSrcweir Color aCol; 4326*cdf0e10cSrcweir aCol = Color( (sal_uInt8)( nRed >> 8 ), (sal_uInt8)( nGreen >> 8 ), (sal_uInt8)( nBlue >> 8 ) ); 4327*cdf0e10cSrcweir aHatch.SetColor(aCol); 4328*cdf0e10cSrcweir rIn >> nLTemp; aHatch.SetDistance(nLTemp); 4329*cdf0e10cSrcweir rIn >> nLTemp; aHatch.SetAngle(nLTemp); 4330*cdf0e10cSrcweir } 4331*cdf0e10cSrcweir } 4332*cdf0e10cSrcweir 4333*cdf0e10cSrcweir //************************************************************************* 4334*cdf0e10cSrcweir 4335*cdf0e10cSrcweir XFillHatchItem::XFillHatchItem(SfxItemPool* /*pPool*/, const XHatch& rTheHatch) 4336*cdf0e10cSrcweir : NameOrIndex( XATTR_FILLHATCH, -1 ), 4337*cdf0e10cSrcweir aHatch(rTheHatch) 4338*cdf0e10cSrcweir { 4339*cdf0e10cSrcweir } 4340*cdf0e10cSrcweir 4341*cdf0e10cSrcweir //************************************************************************* 4342*cdf0e10cSrcweir 4343*cdf0e10cSrcweir XFillHatchItem::XFillHatchItem(SfxItemPool* /*pPool*/) 4344*cdf0e10cSrcweir : NameOrIndex(XATTR_FILLHATCH, -1 ) 4345*cdf0e10cSrcweir { 4346*cdf0e10cSrcweir } 4347*cdf0e10cSrcweir 4348*cdf0e10cSrcweir /************************************************************************* 4349*cdf0e10cSrcweir |* 4350*cdf0e10cSrcweir |* XFillHatchItem::Clone(SfxItemPool* pPool) const 4351*cdf0e10cSrcweir |* 4352*cdf0e10cSrcweir |* Beschreibung 4353*cdf0e10cSrcweir |* Ersterstellung 15.11.94 4354*cdf0e10cSrcweir |* Letzte Aenderung 15.11.94 4355*cdf0e10cSrcweir |* 4356*cdf0e10cSrcweir *************************************************************************/ 4357*cdf0e10cSrcweir 4358*cdf0e10cSrcweir SfxPoolItem* XFillHatchItem::Clone(SfxItemPool* /*pPool*/) const 4359*cdf0e10cSrcweir { 4360*cdf0e10cSrcweir return new XFillHatchItem(*this); 4361*cdf0e10cSrcweir } 4362*cdf0e10cSrcweir 4363*cdf0e10cSrcweir /************************************************************************* 4364*cdf0e10cSrcweir |* 4365*cdf0e10cSrcweir |* int XFillHatchItem::operator==(const SfxPoolItem& rItem) const 4366*cdf0e10cSrcweir |* 4367*cdf0e10cSrcweir |* Beschreibung 4368*cdf0e10cSrcweir |* Ersterstellung 15.11.94 4369*cdf0e10cSrcweir |* Letzte Aenderung 15.11.94 4370*cdf0e10cSrcweir |* 4371*cdf0e10cSrcweir *************************************************************************/ 4372*cdf0e10cSrcweir 4373*cdf0e10cSrcweir int XFillHatchItem::operator==(const SfxPoolItem& rItem) const 4374*cdf0e10cSrcweir { 4375*cdf0e10cSrcweir return ( NameOrIndex::operator==(rItem) && 4376*cdf0e10cSrcweir aHatch == ((const XFillHatchItem&) rItem).aHatch ); 4377*cdf0e10cSrcweir } 4378*cdf0e10cSrcweir 4379*cdf0e10cSrcweir /************************************************************************* 4380*cdf0e10cSrcweir |* 4381*cdf0e10cSrcweir |* SfxPoolItem* XFillHatchItem::Create(SvStream& rIn, sal_uInt16 nVer) const 4382*cdf0e10cSrcweir |* 4383*cdf0e10cSrcweir |* Beschreibung 4384*cdf0e10cSrcweir |* Ersterstellung 15.11.94 4385*cdf0e10cSrcweir |* Letzte Aenderung 15.11.94 4386*cdf0e10cSrcweir |* 4387*cdf0e10cSrcweir *************************************************************************/ 4388*cdf0e10cSrcweir 4389*cdf0e10cSrcweir SfxPoolItem* XFillHatchItem::Create(SvStream& rIn, sal_uInt16 /*nVer*/) const 4390*cdf0e10cSrcweir { 4391*cdf0e10cSrcweir return new XFillHatchItem(rIn); 4392*cdf0e10cSrcweir } 4393*cdf0e10cSrcweir 4394*cdf0e10cSrcweir /************************************************************************* 4395*cdf0e10cSrcweir |* 4396*cdf0e10cSrcweir |* SfxPoolItem* XFillHatchItem::Store(SvStream& rOut) const 4397*cdf0e10cSrcweir |* 4398*cdf0e10cSrcweir |* Beschreibung 4399*cdf0e10cSrcweir |* Ersterstellung 15.11.94 4400*cdf0e10cSrcweir |* Letzte Aenderung 15.11.94 4401*cdf0e10cSrcweir |* 4402*cdf0e10cSrcweir *************************************************************************/ 4403*cdf0e10cSrcweir 4404*cdf0e10cSrcweir SvStream& XFillHatchItem::Store( SvStream& rOut, sal_uInt16 nItemVersion ) const 4405*cdf0e10cSrcweir { 4406*cdf0e10cSrcweir NameOrIndex::Store( rOut, nItemVersion ); 4407*cdf0e10cSrcweir 4408*cdf0e10cSrcweir if (!IsIndex()) 4409*cdf0e10cSrcweir { 4410*cdf0e10cSrcweir rOut << (sal_Int16)aHatch.GetHatchStyle(); 4411*cdf0e10cSrcweir 4412*cdf0e10cSrcweir sal_uInt16 nTmp; 4413*cdf0e10cSrcweir nTmp = VCLTOSVCOL( aHatch.GetColor().GetRed() ); rOut << nTmp; 4414*cdf0e10cSrcweir nTmp = VCLTOSVCOL( aHatch.GetColor().GetGreen() ); rOut << nTmp; 4415*cdf0e10cSrcweir nTmp = VCLTOSVCOL( aHatch.GetColor().GetBlue() ); rOut << nTmp; 4416*cdf0e10cSrcweir 4417*cdf0e10cSrcweir rOut << (sal_Int32) aHatch.GetDistance(); 4418*cdf0e10cSrcweir rOut << (sal_Int32) aHatch.GetAngle(); 4419*cdf0e10cSrcweir } 4420*cdf0e10cSrcweir 4421*cdf0e10cSrcweir return rOut; 4422*cdf0e10cSrcweir } 4423*cdf0e10cSrcweir 4424*cdf0e10cSrcweir /************************************************************************* 4425*cdf0e10cSrcweir |* 4426*cdf0e10cSrcweir |* const XHatch& XFillHatchItem::GetValue(const XHatchTable* pTable) const 4427*cdf0e10cSrcweir |* 4428*cdf0e10cSrcweir |* Beschreibung 4429*cdf0e10cSrcweir |* Ersterstellung 15.11.94 4430*cdf0e10cSrcweir |* Letzte Aenderung 18.11.94 4431*cdf0e10cSrcweir |* 4432*cdf0e10cSrcweir *************************************************************************/ 4433*cdf0e10cSrcweir 4434*cdf0e10cSrcweir const XHatch& XFillHatchItem::GetHatchValue(const XHatchTable* pTable) const // GetValue -> GetHatchValue 4435*cdf0e10cSrcweir { 4436*cdf0e10cSrcweir if (!IsIndex()) 4437*cdf0e10cSrcweir return aHatch; 4438*cdf0e10cSrcweir else 4439*cdf0e10cSrcweir return pTable->GetHatch(GetIndex())->GetHatch(); 4440*cdf0e10cSrcweir } 4441*cdf0e10cSrcweir 4442*cdf0e10cSrcweir //------------------------------------------------------------------------ 4443*cdf0e10cSrcweir 4444*cdf0e10cSrcweir SfxItemPresentation XFillHatchItem::GetPresentation 4445*cdf0e10cSrcweir ( 4446*cdf0e10cSrcweir SfxItemPresentation ePres, 4447*cdf0e10cSrcweir SfxMapUnit /*eCoreUnit*/, 4448*cdf0e10cSrcweir SfxMapUnit /*ePresUnit*/, 4449*cdf0e10cSrcweir XubString& rText, const IntlWrapper * 4450*cdf0e10cSrcweir ) const 4451*cdf0e10cSrcweir { 4452*cdf0e10cSrcweir switch ( ePres ) 4453*cdf0e10cSrcweir { 4454*cdf0e10cSrcweir case SFX_ITEM_PRESENTATION_NONE: 4455*cdf0e10cSrcweir rText.Erase(); 4456*cdf0e10cSrcweir return ePres; 4457*cdf0e10cSrcweir case SFX_ITEM_PRESENTATION_NAMELESS: 4458*cdf0e10cSrcweir case SFX_ITEM_PRESENTATION_COMPLETE: 4459*cdf0e10cSrcweir rText = GetName(); 4460*cdf0e10cSrcweir return ePres; 4461*cdf0e10cSrcweir default: 4462*cdf0e10cSrcweir return SFX_ITEM_PRESENTATION_NONE; 4463*cdf0e10cSrcweir } 4464*cdf0e10cSrcweir } 4465*cdf0e10cSrcweir 4466*cdf0e10cSrcweir //------------------------------------------------------------------------ 4467*cdf0e10cSrcweir 4468*cdf0e10cSrcweir FASTBOOL XFillHatchItem::HasMetrics() const 4469*cdf0e10cSrcweir { 4470*cdf0e10cSrcweir return sal_True; 4471*cdf0e10cSrcweir } 4472*cdf0e10cSrcweir 4473*cdf0e10cSrcweir //------------------------------------------------------------------------ 4474*cdf0e10cSrcweir 4475*cdf0e10cSrcweir FASTBOOL XFillHatchItem::ScaleMetrics(long nMul, long nDiv) 4476*cdf0e10cSrcweir { 4477*cdf0e10cSrcweir aHatch.SetDistance( ScaleMetricValue( aHatch.GetDistance(), nMul, nDiv ) ); 4478*cdf0e10cSrcweir return sal_True; 4479*cdf0e10cSrcweir } 4480*cdf0e10cSrcweir 4481*cdf0e10cSrcweir // ----------------------------------------------------------------------- 4482*cdf0e10cSrcweir sal_Bool XFillHatchItem::QueryValue( ::com::sun::star::uno::Any& rVal, sal_uInt8 nMemberId ) const 4483*cdf0e10cSrcweir { 4484*cdf0e10cSrcweir // sal_Bool bConvert = 0!=(nMemberId&CONVERT_TWIPS); 4485*cdf0e10cSrcweir nMemberId &= ~CONVERT_TWIPS; 4486*cdf0e10cSrcweir 4487*cdf0e10cSrcweir switch ( nMemberId ) 4488*cdf0e10cSrcweir { 4489*cdf0e10cSrcweir case 0: 4490*cdf0e10cSrcweir { 4491*cdf0e10cSrcweir uno::Sequence< beans::PropertyValue > aPropSeq( 2 ); 4492*cdf0e10cSrcweir 4493*cdf0e10cSrcweir ::com::sun::star::drawing::Hatch aUnoHatch; 4494*cdf0e10cSrcweir 4495*cdf0e10cSrcweir aUnoHatch.Style = (::com::sun::star::drawing::HatchStyle)aHatch.GetHatchStyle(); 4496*cdf0e10cSrcweir aUnoHatch.Color = aHatch.GetColor().GetColor(); 4497*cdf0e10cSrcweir aUnoHatch.Distance = aHatch.GetDistance(); 4498*cdf0e10cSrcweir aUnoHatch.Angle = aHatch.GetAngle(); 4499*cdf0e10cSrcweir 4500*cdf0e10cSrcweir rtl::OUString aApiName; 4501*cdf0e10cSrcweir SvxUnogetApiNameForItem( Which(), GetName(), aApiName ); 4502*cdf0e10cSrcweir aPropSeq[0].Name = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "Name" )); 4503*cdf0e10cSrcweir aPropSeq[0].Value = uno::makeAny( aApiName ); 4504*cdf0e10cSrcweir aPropSeq[1].Name = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "FillHatch" )); 4505*cdf0e10cSrcweir aPropSeq[1].Value = uno::makeAny( aUnoHatch ); 4506*cdf0e10cSrcweir rVal = uno::makeAny( aPropSeq ); 4507*cdf0e10cSrcweir break; 4508*cdf0e10cSrcweir } 4509*cdf0e10cSrcweir 4510*cdf0e10cSrcweir case MID_FILLHATCH: 4511*cdf0e10cSrcweir { 4512*cdf0e10cSrcweir ::com::sun::star::drawing::Hatch aUnoHatch; 4513*cdf0e10cSrcweir 4514*cdf0e10cSrcweir aUnoHatch.Style = (::com::sun::star::drawing::HatchStyle)aHatch.GetHatchStyle(); 4515*cdf0e10cSrcweir aUnoHatch.Color = aHatch.GetColor().GetColor(); 4516*cdf0e10cSrcweir aUnoHatch.Distance = aHatch.GetDistance(); 4517*cdf0e10cSrcweir aUnoHatch.Angle = aHatch.GetAngle(); 4518*cdf0e10cSrcweir rVal <<= aUnoHatch; 4519*cdf0e10cSrcweir break; 4520*cdf0e10cSrcweir } 4521*cdf0e10cSrcweir 4522*cdf0e10cSrcweir case MID_NAME: 4523*cdf0e10cSrcweir { 4524*cdf0e10cSrcweir rtl::OUString aApiName; 4525*cdf0e10cSrcweir SvxUnogetApiNameForItem( Which(), GetName(), aApiName ); 4526*cdf0e10cSrcweir rVal <<= aApiName; 4527*cdf0e10cSrcweir break; 4528*cdf0e10cSrcweir } 4529*cdf0e10cSrcweir 4530*cdf0e10cSrcweir case MID_HATCH_STYLE: 4531*cdf0e10cSrcweir rVal <<= (::com::sun::star::drawing::HatchStyle)aHatch.GetHatchStyle(); break; 4532*cdf0e10cSrcweir case MID_HATCH_COLOR: 4533*cdf0e10cSrcweir rVal <<= (sal_Int32)aHatch.GetColor().GetColor(); break; 4534*cdf0e10cSrcweir case MID_HATCH_DISTANCE: 4535*cdf0e10cSrcweir rVal <<= aHatch.GetDistance(); break; 4536*cdf0e10cSrcweir case MID_HATCH_ANGLE: 4537*cdf0e10cSrcweir rVal <<= aHatch.GetAngle(); break; 4538*cdf0e10cSrcweir 4539*cdf0e10cSrcweir default: DBG_ERROR("Wrong MemberId!"); return sal_False; 4540*cdf0e10cSrcweir } 4541*cdf0e10cSrcweir 4542*cdf0e10cSrcweir return sal_True; 4543*cdf0e10cSrcweir } 4544*cdf0e10cSrcweir 4545*cdf0e10cSrcweir // ----------------------------------------------------------------------- 4546*cdf0e10cSrcweir sal_Bool XFillHatchItem::PutValue( const ::com::sun::star::uno::Any& rVal, sal_uInt8 nMemberId ) 4547*cdf0e10cSrcweir { 4548*cdf0e10cSrcweir // sal_Bool bConvert = 0!=(nMemberId&CONVERT_TWIPS); 4549*cdf0e10cSrcweir nMemberId &= ~CONVERT_TWIPS; 4550*cdf0e10cSrcweir 4551*cdf0e10cSrcweir switch ( nMemberId ) 4552*cdf0e10cSrcweir { 4553*cdf0e10cSrcweir case 0: 4554*cdf0e10cSrcweir { 4555*cdf0e10cSrcweir uno::Sequence< beans::PropertyValue > aPropSeq; 4556*cdf0e10cSrcweir ::com::sun::star::drawing::Hatch aUnoHatch; 4557*cdf0e10cSrcweir rtl::OUString aName; 4558*cdf0e10cSrcweir bool bHatch( false ); 4559*cdf0e10cSrcweir 4560*cdf0e10cSrcweir if ( rVal >>= aPropSeq ) 4561*cdf0e10cSrcweir { 4562*cdf0e10cSrcweir for ( sal_Int32 n = 0; n < aPropSeq.getLength(); n++ ) 4563*cdf0e10cSrcweir { 4564*cdf0e10cSrcweir if ( aPropSeq[n].Name.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "Name" ))) 4565*cdf0e10cSrcweir aPropSeq[n].Value >>= aName; 4566*cdf0e10cSrcweir else if ( aPropSeq[n].Name.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "FillHatch" ))) 4567*cdf0e10cSrcweir { 4568*cdf0e10cSrcweir if ( aPropSeq[n].Value >>= aUnoHatch ) 4569*cdf0e10cSrcweir bHatch = true; 4570*cdf0e10cSrcweir } 4571*cdf0e10cSrcweir } 4572*cdf0e10cSrcweir 4573*cdf0e10cSrcweir SetName( aName ); 4574*cdf0e10cSrcweir if ( bHatch ) 4575*cdf0e10cSrcweir { 4576*cdf0e10cSrcweir aHatch.SetHatchStyle( (XHatchStyle)aUnoHatch.Style ); 4577*cdf0e10cSrcweir aHatch.SetColor( aUnoHatch.Color ); 4578*cdf0e10cSrcweir aHatch.SetDistance( aUnoHatch.Distance ); 4579*cdf0e10cSrcweir aHatch.SetAngle( aUnoHatch.Angle ); 4580*cdf0e10cSrcweir } 4581*cdf0e10cSrcweir 4582*cdf0e10cSrcweir return sal_True; 4583*cdf0e10cSrcweir } 4584*cdf0e10cSrcweir 4585*cdf0e10cSrcweir return sal_False; 4586*cdf0e10cSrcweir } 4587*cdf0e10cSrcweir 4588*cdf0e10cSrcweir case MID_FILLHATCH: 4589*cdf0e10cSrcweir { 4590*cdf0e10cSrcweir ::com::sun::star::drawing::Hatch aUnoHatch; 4591*cdf0e10cSrcweir if(!(rVal >>= aUnoHatch)) 4592*cdf0e10cSrcweir return sal_False; 4593*cdf0e10cSrcweir 4594*cdf0e10cSrcweir aHatch.SetHatchStyle( (XHatchStyle)aUnoHatch.Style ); 4595*cdf0e10cSrcweir aHatch.SetColor( aUnoHatch.Color ); 4596*cdf0e10cSrcweir aHatch.SetDistance( aUnoHatch.Distance ); 4597*cdf0e10cSrcweir aHatch.SetAngle( aUnoHatch.Angle ); 4598*cdf0e10cSrcweir break; 4599*cdf0e10cSrcweir } 4600*cdf0e10cSrcweir 4601*cdf0e10cSrcweir case MID_NAME: 4602*cdf0e10cSrcweir { 4603*cdf0e10cSrcweir rtl::OUString aName; 4604*cdf0e10cSrcweir if (!(rVal >>= aName )) 4605*cdf0e10cSrcweir return sal_False; 4606*cdf0e10cSrcweir SetName( aName ); 4607*cdf0e10cSrcweir break; 4608*cdf0e10cSrcweir } 4609*cdf0e10cSrcweir 4610*cdf0e10cSrcweir case MID_HATCH_STYLE: 4611*cdf0e10cSrcweir { 4612*cdf0e10cSrcweir sal_Int16 nVal = sal_Int16(); 4613*cdf0e10cSrcweir if (!(rVal >>= nVal )) 4614*cdf0e10cSrcweir return sal_False; 4615*cdf0e10cSrcweir aHatch.SetHatchStyle( (XHatchStyle)nVal ); 4616*cdf0e10cSrcweir break; 4617*cdf0e10cSrcweir } 4618*cdf0e10cSrcweir 4619*cdf0e10cSrcweir case MID_HATCH_COLOR: 4620*cdf0e10cSrcweir case MID_HATCH_DISTANCE: 4621*cdf0e10cSrcweir case MID_HATCH_ANGLE: 4622*cdf0e10cSrcweir { 4623*cdf0e10cSrcweir sal_Int32 nVal = 0; 4624*cdf0e10cSrcweir if (!(rVal >>= nVal )) 4625*cdf0e10cSrcweir return sal_False; 4626*cdf0e10cSrcweir 4627*cdf0e10cSrcweir if ( nMemberId == MID_HATCH_COLOR ) 4628*cdf0e10cSrcweir aHatch.SetColor( nVal ); 4629*cdf0e10cSrcweir else if ( nMemberId == MID_HATCH_DISTANCE ) 4630*cdf0e10cSrcweir aHatch.SetDistance( nVal ); 4631*cdf0e10cSrcweir else 4632*cdf0e10cSrcweir aHatch.SetAngle( nVal ); 4633*cdf0e10cSrcweir break; 4634*cdf0e10cSrcweir } 4635*cdf0e10cSrcweir 4636*cdf0e10cSrcweir default: DBG_ERROR("Wrong MemberId!"); return sal_False; 4637*cdf0e10cSrcweir } 4638*cdf0e10cSrcweir 4639*cdf0e10cSrcweir return sal_True; 4640*cdf0e10cSrcweir } 4641*cdf0e10cSrcweir 4642*cdf0e10cSrcweir sal_Bool XFillHatchItem::CompareValueFunc( const NameOrIndex* p1, const NameOrIndex* p2 ) 4643*cdf0e10cSrcweir { 4644*cdf0e10cSrcweir return ((XFillHatchItem*)p1)->GetHatchValue() == ((XFillHatchItem*)p2)->GetHatchValue(); 4645*cdf0e10cSrcweir } 4646*cdf0e10cSrcweir 4647*cdf0e10cSrcweir XFillHatchItem* XFillHatchItem::checkForUniqueItem( SdrModel* pModel ) const 4648*cdf0e10cSrcweir { 4649*cdf0e10cSrcweir if( pModel ) 4650*cdf0e10cSrcweir { 4651*cdf0e10cSrcweir const String aUniqueName = NameOrIndex::CheckNamedItem( this, 4652*cdf0e10cSrcweir XATTR_FILLHATCH, 4653*cdf0e10cSrcweir &pModel->GetItemPool(), 4654*cdf0e10cSrcweir pModel->GetStyleSheetPool() ? &pModel->GetStyleSheetPool()->GetPool() : NULL, 4655*cdf0e10cSrcweir XFillHatchItem::CompareValueFunc, 4656*cdf0e10cSrcweir RID_SVXSTR_HATCH10, 4657*cdf0e10cSrcweir pModel->GetHatchList() ); 4658*cdf0e10cSrcweir 4659*cdf0e10cSrcweir // if the given name is not valid, replace it! 4660*cdf0e10cSrcweir if( aUniqueName != GetName() ) 4661*cdf0e10cSrcweir { 4662*cdf0e10cSrcweir return new XFillHatchItem( aUniqueName, aHatch ); 4663*cdf0e10cSrcweir } 4664*cdf0e10cSrcweir } 4665*cdf0e10cSrcweir 4666*cdf0e10cSrcweir return (XFillHatchItem*)this; 4667*cdf0e10cSrcweir } 4668*cdf0e10cSrcweir 4669*cdf0e10cSrcweir //++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 4670*cdf0e10cSrcweir // FormText-Attribute 4671*cdf0e10cSrcweir //++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 4672*cdf0e10cSrcweir 4673*cdf0e10cSrcweir //------------------------- 4674*cdf0e10cSrcweir // class XFormTextStyleItem 4675*cdf0e10cSrcweir //------------------------- 4676*cdf0e10cSrcweir TYPEINIT1_AUTOFACTORY(XFormTextStyleItem, SfxEnumItem); 4677*cdf0e10cSrcweir 4678*cdf0e10cSrcweir /************************************************************************* 4679*cdf0e10cSrcweir |* 4680*cdf0e10cSrcweir |* XFormTextStyleItem::XFormTextStyleItem() 4681*cdf0e10cSrcweir |* 4682*cdf0e10cSrcweir |* Beschreibung 4683*cdf0e10cSrcweir |* Ersterstellung 02.02.95 ESO 4684*cdf0e10cSrcweir |* Letzte Aenderung 02.02.95 ESO 4685*cdf0e10cSrcweir |* 4686*cdf0e10cSrcweir *************************************************************************/ 4687*cdf0e10cSrcweir 4688*cdf0e10cSrcweir XFormTextStyleItem::XFormTextStyleItem(XFormTextStyle eTheStyle) : 4689*cdf0e10cSrcweir SfxEnumItem(XATTR_FORMTXTSTYLE, sal::static_int_cast< sal_uInt16 >(eTheStyle)) 4690*cdf0e10cSrcweir { 4691*cdf0e10cSrcweir } 4692*cdf0e10cSrcweir 4693*cdf0e10cSrcweir /************************************************************************* 4694*cdf0e10cSrcweir |* 4695*cdf0e10cSrcweir |* XFormTextStyleItem::XFormTextStyleItem(SvStream& rIn) 4696*cdf0e10cSrcweir |* 4697*cdf0e10cSrcweir |* Beschreibung 4698*cdf0e10cSrcweir |* Ersterstellung 02.02.95 ESO 4699*cdf0e10cSrcweir |* Letzte Aenderung 02.02.95 ESO 4700*cdf0e10cSrcweir |* 4701*cdf0e10cSrcweir *************************************************************************/ 4702*cdf0e10cSrcweir 4703*cdf0e10cSrcweir XFormTextStyleItem::XFormTextStyleItem(SvStream& rIn) : 4704*cdf0e10cSrcweir SfxEnumItem(XATTR_FORMTXTSTYLE, rIn) 4705*cdf0e10cSrcweir { 4706*cdf0e10cSrcweir } 4707*cdf0e10cSrcweir 4708*cdf0e10cSrcweir /************************************************************************* 4709*cdf0e10cSrcweir |* 4710*cdf0e10cSrcweir |* XFormTextStyleItem::Clone(SfxItemPool* pPool) const 4711*cdf0e10cSrcweir |* 4712*cdf0e10cSrcweir |* Beschreibung 4713*cdf0e10cSrcweir |* Ersterstellung 02.02.95 ESO 4714*cdf0e10cSrcweir |* Letzte Aenderung 02.02.95 ESO 4715*cdf0e10cSrcweir |* 4716*cdf0e10cSrcweir *************************************************************************/ 4717*cdf0e10cSrcweir 4718*cdf0e10cSrcweir SfxPoolItem* XFormTextStyleItem::Clone(SfxItemPool* /*pPool*/) const 4719*cdf0e10cSrcweir { 4720*cdf0e10cSrcweir return new XFormTextStyleItem( *this ); 4721*cdf0e10cSrcweir } 4722*cdf0e10cSrcweir 4723*cdf0e10cSrcweir /************************************************************************* 4724*cdf0e10cSrcweir |* 4725*cdf0e10cSrcweir |* SfxPoolItem* XFormTextStyleItem::Create(SvStream& rIn, sal_uInt16 nVer) const 4726*cdf0e10cSrcweir |* 4727*cdf0e10cSrcweir |* Beschreibung 4728*cdf0e10cSrcweir |* Ersterstellung 02.02.95 ESO 4729*cdf0e10cSrcweir |* Letzte Aenderung 02.02.95 ESO 4730*cdf0e10cSrcweir |* 4731*cdf0e10cSrcweir *************************************************************************/ 4732*cdf0e10cSrcweir 4733*cdf0e10cSrcweir SfxPoolItem* XFormTextStyleItem::Create(SvStream& rIn, sal_uInt16 /*nVer*/) const 4734*cdf0e10cSrcweir { 4735*cdf0e10cSrcweir return new XFormTextStyleItem(rIn); 4736*cdf0e10cSrcweir } 4737*cdf0e10cSrcweir 4738*cdf0e10cSrcweir /************************************************************************* 4739*cdf0e10cSrcweir |* 4740*cdf0e10cSrcweir |* 4741*cdf0e10cSrcweir |* 4742*cdf0e10cSrcweir \*************************************************************************/ 4743*cdf0e10cSrcweir 4744*cdf0e10cSrcweir sal_uInt16 XFormTextStyleItem::GetValueCount() const 4745*cdf0e10cSrcweir { 4746*cdf0e10cSrcweir return 5; 4747*cdf0e10cSrcweir } 4748*cdf0e10cSrcweir 4749*cdf0e10cSrcweir /************************************************************************* 4750*cdf0e10cSrcweir |* 4751*cdf0e10cSrcweir |* 4752*cdf0e10cSrcweir |* 4753*cdf0e10cSrcweir \*************************************************************************/ 4754*cdf0e10cSrcweir 4755*cdf0e10cSrcweir // #FontWork# 4756*cdf0e10cSrcweir sal_Bool XFormTextStyleItem::QueryValue( uno::Any& rVal, sal_uInt8 /*nMemberId*/) const 4757*cdf0e10cSrcweir { 4758*cdf0e10cSrcweir rVal <<= (sal_Int32)GetValue(); 4759*cdf0e10cSrcweir return sal_True; 4760*cdf0e10cSrcweir } 4761*cdf0e10cSrcweir 4762*cdf0e10cSrcweir /************************************************************************* 4763*cdf0e10cSrcweir |* 4764*cdf0e10cSrcweir |* 4765*cdf0e10cSrcweir |* 4766*cdf0e10cSrcweir \*************************************************************************/ 4767*cdf0e10cSrcweir 4768*cdf0e10cSrcweir // #FontWork# 4769*cdf0e10cSrcweir sal_Bool XFormTextStyleItem::PutValue( const uno::Any& rVal, sal_uInt8 /*nMemberId*/) 4770*cdf0e10cSrcweir { 4771*cdf0e10cSrcweir sal_Int32 nValue = 0; 4772*cdf0e10cSrcweir rVal >>= nValue; 4773*cdf0e10cSrcweir SetValue(sal::static_int_cast< sal_uInt16 >(nValue)); 4774*cdf0e10cSrcweir 4775*cdf0e10cSrcweir return sal_True; 4776*cdf0e10cSrcweir } 4777*cdf0e10cSrcweir 4778*cdf0e10cSrcweir //------------------------- 4779*cdf0e10cSrcweir // class XFormTextAdjustItem 4780*cdf0e10cSrcweir //------------------------- 4781*cdf0e10cSrcweir TYPEINIT1_AUTOFACTORY(XFormTextAdjustItem, SfxEnumItem); 4782*cdf0e10cSrcweir 4783*cdf0e10cSrcweir /************************************************************************* 4784*cdf0e10cSrcweir |* 4785*cdf0e10cSrcweir |* XFormTextAdjustItem::XFormTextAdjustItem() 4786*cdf0e10cSrcweir |* 4787*cdf0e10cSrcweir |* Beschreibung 4788*cdf0e10cSrcweir |* Ersterstellung 02.02.95 ESO 4789*cdf0e10cSrcweir |* Letzte Aenderung 02.02.95 ESO 4790*cdf0e10cSrcweir |* 4791*cdf0e10cSrcweir *************************************************************************/ 4792*cdf0e10cSrcweir 4793*cdf0e10cSrcweir XFormTextAdjustItem::XFormTextAdjustItem(XFormTextAdjust eTheAdjust) : 4794*cdf0e10cSrcweir SfxEnumItem(XATTR_FORMTXTADJUST, sal::static_int_cast< sal_uInt16 >(eTheAdjust)) 4795*cdf0e10cSrcweir { 4796*cdf0e10cSrcweir } 4797*cdf0e10cSrcweir 4798*cdf0e10cSrcweir /************************************************************************* 4799*cdf0e10cSrcweir |* 4800*cdf0e10cSrcweir |* XFormTextAdjustItem::XFormTextAdjustItem(SvStream& rIn) 4801*cdf0e10cSrcweir |* 4802*cdf0e10cSrcweir |* Beschreibung 4803*cdf0e10cSrcweir |* Ersterstellung 02.02.95 ESO 4804*cdf0e10cSrcweir |* Letzte Aenderung 02.02.95 ESO 4805*cdf0e10cSrcweir |* 4806*cdf0e10cSrcweir *************************************************************************/ 4807*cdf0e10cSrcweir 4808*cdf0e10cSrcweir XFormTextAdjustItem::XFormTextAdjustItem(SvStream& rIn) : 4809*cdf0e10cSrcweir SfxEnumItem(XATTR_FORMTXTADJUST, rIn) 4810*cdf0e10cSrcweir { 4811*cdf0e10cSrcweir } 4812*cdf0e10cSrcweir 4813*cdf0e10cSrcweir /************************************************************************* 4814*cdf0e10cSrcweir |* 4815*cdf0e10cSrcweir |* XFormTextAdjustItem::Clone(SfxItemPool* pPool) const 4816*cdf0e10cSrcweir |* 4817*cdf0e10cSrcweir |* Beschreibung 4818*cdf0e10cSrcweir |* Ersterstellung 02.02.95 ESO 4819*cdf0e10cSrcweir |* Letzte Aenderung 02.02.95 ESO 4820*cdf0e10cSrcweir |* 4821*cdf0e10cSrcweir *************************************************************************/ 4822*cdf0e10cSrcweir 4823*cdf0e10cSrcweir SfxPoolItem* XFormTextAdjustItem::Clone(SfxItemPool* /*pPool*/) const 4824*cdf0e10cSrcweir { 4825*cdf0e10cSrcweir return new XFormTextAdjustItem( *this ); 4826*cdf0e10cSrcweir } 4827*cdf0e10cSrcweir 4828*cdf0e10cSrcweir /************************************************************************* 4829*cdf0e10cSrcweir |* 4830*cdf0e10cSrcweir |* SfxPoolItem* XFormTextAdjustItem::Create(SvStream& rIn, sal_uInt16 nVer) const 4831*cdf0e10cSrcweir |* 4832*cdf0e10cSrcweir |* Beschreibung 4833*cdf0e10cSrcweir |* Ersterstellung 02.02.95 ESO 4834*cdf0e10cSrcweir |* Letzte Aenderung 02.02.95 ESO 4835*cdf0e10cSrcweir |* 4836*cdf0e10cSrcweir *************************************************************************/ 4837*cdf0e10cSrcweir 4838*cdf0e10cSrcweir SfxPoolItem* XFormTextAdjustItem::Create(SvStream& rIn, sal_uInt16 /*nVer*/) const 4839*cdf0e10cSrcweir { 4840*cdf0e10cSrcweir return new XFormTextAdjustItem(rIn); 4841*cdf0e10cSrcweir } 4842*cdf0e10cSrcweir 4843*cdf0e10cSrcweir /************************************************************************* 4844*cdf0e10cSrcweir |* 4845*cdf0e10cSrcweir |* 4846*cdf0e10cSrcweir |* 4847*cdf0e10cSrcweir \*************************************************************************/ 4848*cdf0e10cSrcweir 4849*cdf0e10cSrcweir sal_uInt16 XFormTextAdjustItem::GetValueCount() const 4850*cdf0e10cSrcweir { 4851*cdf0e10cSrcweir return 4; 4852*cdf0e10cSrcweir } 4853*cdf0e10cSrcweir 4854*cdf0e10cSrcweir /************************************************************************* 4855*cdf0e10cSrcweir |* 4856*cdf0e10cSrcweir |* 4857*cdf0e10cSrcweir |* 4858*cdf0e10cSrcweir \*************************************************************************/ 4859*cdf0e10cSrcweir 4860*cdf0e10cSrcweir // #FontWork# 4861*cdf0e10cSrcweir sal_Bool XFormTextAdjustItem::QueryValue( uno::Any& rVal, sal_uInt8 /*nMemberId*/) const 4862*cdf0e10cSrcweir { 4863*cdf0e10cSrcweir rVal <<= (sal_Int32)GetValue(); 4864*cdf0e10cSrcweir return sal_True; 4865*cdf0e10cSrcweir } 4866*cdf0e10cSrcweir 4867*cdf0e10cSrcweir /************************************************************************* 4868*cdf0e10cSrcweir |* 4869*cdf0e10cSrcweir |* 4870*cdf0e10cSrcweir |* 4871*cdf0e10cSrcweir \*************************************************************************/ 4872*cdf0e10cSrcweir 4873*cdf0e10cSrcweir // #FontWork# 4874*cdf0e10cSrcweir sal_Bool XFormTextAdjustItem::PutValue( const uno::Any& rVal, sal_uInt8 /*nMemberId*/) 4875*cdf0e10cSrcweir { 4876*cdf0e10cSrcweir sal_Int32 nValue = 0; 4877*cdf0e10cSrcweir rVal >>= nValue; 4878*cdf0e10cSrcweir SetValue(sal::static_int_cast< sal_uInt16 >(nValue)); 4879*cdf0e10cSrcweir 4880*cdf0e10cSrcweir return sal_True; 4881*cdf0e10cSrcweir } 4882*cdf0e10cSrcweir 4883*cdf0e10cSrcweir //---------------------------- 4884*cdf0e10cSrcweir // class XFormTextDistanceItem 4885*cdf0e10cSrcweir //---------------------------- 4886*cdf0e10cSrcweir TYPEINIT1_AUTOFACTORY(XFormTextDistanceItem, SfxMetricItem); 4887*cdf0e10cSrcweir 4888*cdf0e10cSrcweir /************************************************************************* 4889*cdf0e10cSrcweir |* 4890*cdf0e10cSrcweir |* XFormTextDistanceItem::XFormTextDistanceItem() 4891*cdf0e10cSrcweir |* 4892*cdf0e10cSrcweir |* Beschreibung 4893*cdf0e10cSrcweir |* Ersterstellung 02.02.95 ESO 4894*cdf0e10cSrcweir |* Letzte Aenderung 02.02.95 ESO 4895*cdf0e10cSrcweir |* 4896*cdf0e10cSrcweir *************************************************************************/ 4897*cdf0e10cSrcweir 4898*cdf0e10cSrcweir XFormTextDistanceItem::XFormTextDistanceItem(long nDist) : 4899*cdf0e10cSrcweir SfxMetricItem(XATTR_FORMTXTDISTANCE, nDist) 4900*cdf0e10cSrcweir { 4901*cdf0e10cSrcweir } 4902*cdf0e10cSrcweir 4903*cdf0e10cSrcweir /************************************************************************* 4904*cdf0e10cSrcweir |* 4905*cdf0e10cSrcweir |* XFormTextDistanceItem::XFormTextDistanceItem(SvStream& rIn) 4906*cdf0e10cSrcweir |* 4907*cdf0e10cSrcweir |* Beschreibung 4908*cdf0e10cSrcweir |* Ersterstellung 02.02.95 ESO 4909*cdf0e10cSrcweir |* Letzte Aenderung 02.02.95 ESO 4910*cdf0e10cSrcweir |* 4911*cdf0e10cSrcweir *************************************************************************/ 4912*cdf0e10cSrcweir 4913*cdf0e10cSrcweir XFormTextDistanceItem::XFormTextDistanceItem(SvStream& rIn) : 4914*cdf0e10cSrcweir SfxMetricItem(XATTR_FORMTXTDISTANCE, rIn) 4915*cdf0e10cSrcweir { 4916*cdf0e10cSrcweir } 4917*cdf0e10cSrcweir 4918*cdf0e10cSrcweir /************************************************************************* 4919*cdf0e10cSrcweir |* 4920*cdf0e10cSrcweir |* XFormTextDistanceItem::Clone(SfxItemPool* pPool) const 4921*cdf0e10cSrcweir |* 4922*cdf0e10cSrcweir |* Beschreibung 4923*cdf0e10cSrcweir |* Ersterstellung 02.02.95 ESO 4924*cdf0e10cSrcweir |* Letzte Aenderung 02.02.95 ESO 4925*cdf0e10cSrcweir |* 4926*cdf0e10cSrcweir *************************************************************************/ 4927*cdf0e10cSrcweir 4928*cdf0e10cSrcweir SfxPoolItem* XFormTextDistanceItem::Clone(SfxItemPool* /*pPool*/) const 4929*cdf0e10cSrcweir { 4930*cdf0e10cSrcweir return new XFormTextDistanceItem(*this); 4931*cdf0e10cSrcweir } 4932*cdf0e10cSrcweir 4933*cdf0e10cSrcweir /************************************************************************* 4934*cdf0e10cSrcweir |* 4935*cdf0e10cSrcweir |* SfxPoolItem* XFormTextDistanceItem::Create(SvStream& rIn, sal_uInt16 nVer) const 4936*cdf0e10cSrcweir |* 4937*cdf0e10cSrcweir |* Beschreibung 4938*cdf0e10cSrcweir |* Ersterstellung 02.02.95 ESO 4939*cdf0e10cSrcweir |* Letzte Aenderung 02.02.95 ESO 4940*cdf0e10cSrcweir |* 4941*cdf0e10cSrcweir *************************************************************************/ 4942*cdf0e10cSrcweir 4943*cdf0e10cSrcweir SfxPoolItem* XFormTextDistanceItem::Create(SvStream& rIn, sal_uInt16 /*nVer*/) const 4944*cdf0e10cSrcweir { 4945*cdf0e10cSrcweir return new XFormTextDistanceItem(rIn); 4946*cdf0e10cSrcweir } 4947*cdf0e10cSrcweir 4948*cdf0e10cSrcweir //------------------------- 4949*cdf0e10cSrcweir // class XFormTextStartItem 4950*cdf0e10cSrcweir //------------------------- 4951*cdf0e10cSrcweir TYPEINIT1_AUTOFACTORY(XFormTextStartItem, SfxMetricItem); 4952*cdf0e10cSrcweir 4953*cdf0e10cSrcweir /************************************************************************* 4954*cdf0e10cSrcweir |* 4955*cdf0e10cSrcweir |* XFormTextStartItem::XFormTextStartItem(long nStart) 4956*cdf0e10cSrcweir |* 4957*cdf0e10cSrcweir |* Beschreibung 4958*cdf0e10cSrcweir |* Ersterstellung 02.02.95 ESO 4959*cdf0e10cSrcweir |* Letzte Aenderung 02.02.95 ESO 4960*cdf0e10cSrcweir |* 4961*cdf0e10cSrcweir *************************************************************************/ 4962*cdf0e10cSrcweir 4963*cdf0e10cSrcweir XFormTextStartItem::XFormTextStartItem(long nStart) : 4964*cdf0e10cSrcweir SfxMetricItem(XATTR_FORMTXTSTART, nStart) 4965*cdf0e10cSrcweir { 4966*cdf0e10cSrcweir } 4967*cdf0e10cSrcweir 4968*cdf0e10cSrcweir /************************************************************************* 4969*cdf0e10cSrcweir |* 4970*cdf0e10cSrcweir |* XFormTextStartItem::XFormTextStartItem(SvStream& rIn) 4971*cdf0e10cSrcweir |* 4972*cdf0e10cSrcweir |* Beschreibung 4973*cdf0e10cSrcweir |* Ersterstellung 02.02.95 ESO 4974*cdf0e10cSrcweir |* Letzte Aenderung 02.02.95 ESO 4975*cdf0e10cSrcweir |* 4976*cdf0e10cSrcweir *************************************************************************/ 4977*cdf0e10cSrcweir 4978*cdf0e10cSrcweir XFormTextStartItem::XFormTextStartItem(SvStream& rIn) : 4979*cdf0e10cSrcweir SfxMetricItem(XATTR_FORMTXTSTART, rIn) 4980*cdf0e10cSrcweir { 4981*cdf0e10cSrcweir } 4982*cdf0e10cSrcweir 4983*cdf0e10cSrcweir /************************************************************************* 4984*cdf0e10cSrcweir |* 4985*cdf0e10cSrcweir |* XFormTextStartItem::Clone(SfxItemPool* pPool) const 4986*cdf0e10cSrcweir |* 4987*cdf0e10cSrcweir |* Beschreibung 4988*cdf0e10cSrcweir |* Ersterstellung 02.02.95 ESO 4989*cdf0e10cSrcweir |* Letzte Aenderung 02.02.95 ESO 4990*cdf0e10cSrcweir |* 4991*cdf0e10cSrcweir *************************************************************************/ 4992*cdf0e10cSrcweir 4993*cdf0e10cSrcweir SfxPoolItem* XFormTextStartItem::Clone(SfxItemPool* /*pPool*/) const 4994*cdf0e10cSrcweir { 4995*cdf0e10cSrcweir return new XFormTextStartItem(*this); 4996*cdf0e10cSrcweir } 4997*cdf0e10cSrcweir 4998*cdf0e10cSrcweir /************************************************************************* 4999*cdf0e10cSrcweir |* 5000*cdf0e10cSrcweir |* SfxPoolItem* XFormTextStartItem::Create(SvStream& rIn, sal_uInt16 nVer) const 5001*cdf0e10cSrcweir |* 5002*cdf0e10cSrcweir |* Beschreibung 5003*cdf0e10cSrcweir |* Ersterstellung 02.02.95 ESO 5004*cdf0e10cSrcweir |* Letzte Aenderung 02.02.95 ESO 5005*cdf0e10cSrcweir |* 5006*cdf0e10cSrcweir *************************************************************************/ 5007*cdf0e10cSrcweir 5008*cdf0e10cSrcweir SfxPoolItem* XFormTextStartItem::Create(SvStream& rIn, sal_uInt16 /*nVer*/) const 5009*cdf0e10cSrcweir { 5010*cdf0e10cSrcweir return new XFormTextStartItem(rIn); 5011*cdf0e10cSrcweir } 5012*cdf0e10cSrcweir 5013*cdf0e10cSrcweir // ------------------------- 5014*cdf0e10cSrcweir // class XFormTextMirrorItem 5015*cdf0e10cSrcweir // ------------------------- 5016*cdf0e10cSrcweir TYPEINIT1_AUTOFACTORY(XFormTextMirrorItem, SfxBoolItem); 5017*cdf0e10cSrcweir 5018*cdf0e10cSrcweir /************************************************************************* 5019*cdf0e10cSrcweir |* 5020*cdf0e10cSrcweir |* XFormTextMirrorItem::XFormTextMirrorItem(sal_Bool bMirror) 5021*cdf0e10cSrcweir |* 5022*cdf0e10cSrcweir |* Ersterstellung 06.02.95 ESO 5023*cdf0e10cSrcweir |* Letzte Aenderung 06.02.95 ESO 5024*cdf0e10cSrcweir |* 5025*cdf0e10cSrcweir *************************************************************************/ 5026*cdf0e10cSrcweir 5027*cdf0e10cSrcweir XFormTextMirrorItem::XFormTextMirrorItem(sal_Bool bMirror) : 5028*cdf0e10cSrcweir SfxBoolItem(XATTR_FORMTXTMIRROR, bMirror) 5029*cdf0e10cSrcweir { 5030*cdf0e10cSrcweir } 5031*cdf0e10cSrcweir 5032*cdf0e10cSrcweir /************************************************************************* 5033*cdf0e10cSrcweir |* 5034*cdf0e10cSrcweir |* XFormTextMirrorItem::XFormTextMirrorItem(SvStream& rIn) 5035*cdf0e10cSrcweir |* 5036*cdf0e10cSrcweir |* Ersterstellung 06.02.95 ESO 5037*cdf0e10cSrcweir |* Letzte Aenderung 06.02.95 ESO 5038*cdf0e10cSrcweir |* 5039*cdf0e10cSrcweir *************************************************************************/ 5040*cdf0e10cSrcweir 5041*cdf0e10cSrcweir XFormTextMirrorItem::XFormTextMirrorItem(SvStream& rIn) : 5042*cdf0e10cSrcweir SfxBoolItem(XATTR_FORMTXTMIRROR, rIn) 5043*cdf0e10cSrcweir { 5044*cdf0e10cSrcweir } 5045*cdf0e10cSrcweir 5046*cdf0e10cSrcweir /************************************************************************* 5047*cdf0e10cSrcweir |* 5048*cdf0e10cSrcweir |* XFormTextMirrorItem::Clone(SfxItemPool* pPool) const 5049*cdf0e10cSrcweir |* 5050*cdf0e10cSrcweir |* Ersterstellung 06.02.95 ESO 5051*cdf0e10cSrcweir |* Letzte Aenderung 06.02.95 ESO 5052*cdf0e10cSrcweir |* 5053*cdf0e10cSrcweir *************************************************************************/ 5054*cdf0e10cSrcweir 5055*cdf0e10cSrcweir SfxPoolItem* XFormTextMirrorItem::Clone(SfxItemPool* /*pPool*/) const 5056*cdf0e10cSrcweir { 5057*cdf0e10cSrcweir return new XFormTextMirrorItem(*this); 5058*cdf0e10cSrcweir } 5059*cdf0e10cSrcweir 5060*cdf0e10cSrcweir /************************************************************************* 5061*cdf0e10cSrcweir |* 5062*cdf0e10cSrcweir |* SfxPoolItem* XFormTextMirrorItem::Create(SvStream& rIn, sal_uInt16 nVer) 5063*cdf0e10cSrcweir |* const 5064*cdf0e10cSrcweir |* 5065*cdf0e10cSrcweir |* Ersterstellung 06.02.95 ESO 5066*cdf0e10cSrcweir |* Letzte Aenderung 06.02.95 ESO 5067*cdf0e10cSrcweir |* 5068*cdf0e10cSrcweir *************************************************************************/ 5069*cdf0e10cSrcweir 5070*cdf0e10cSrcweir SfxPoolItem* XFormTextMirrorItem::Create(SvStream& rIn, sal_uInt16 /*nVer*/) const 5071*cdf0e10cSrcweir { 5072*cdf0e10cSrcweir return new XFormTextMirrorItem(rIn); 5073*cdf0e10cSrcweir } 5074*cdf0e10cSrcweir 5075*cdf0e10cSrcweir 5076*cdf0e10cSrcweir // -------------------------- 5077*cdf0e10cSrcweir // class XFormTextOutlineItem 5078*cdf0e10cSrcweir // -------------------------- 5079*cdf0e10cSrcweir TYPEINIT1_AUTOFACTORY(XFormTextOutlineItem, SfxBoolItem); 5080*cdf0e10cSrcweir 5081*cdf0e10cSrcweir /************************************************************************* 5082*cdf0e10cSrcweir |* 5083*cdf0e10cSrcweir |* XFormTextOutlineItem::XFormTextOutlineItem() 5084*cdf0e10cSrcweir |* 5085*cdf0e10cSrcweir |* Ersterstellung 27.06.95 ESO 5086*cdf0e10cSrcweir |* Letzte Aenderung 27.06.95 ESO 5087*cdf0e10cSrcweir |* 5088*cdf0e10cSrcweir *************************************************************************/ 5089*cdf0e10cSrcweir 5090*cdf0e10cSrcweir XFormTextOutlineItem::XFormTextOutlineItem(sal_Bool bOutline) : 5091*cdf0e10cSrcweir SfxBoolItem(XATTR_FORMTXTOUTLINE, bOutline) 5092*cdf0e10cSrcweir { 5093*cdf0e10cSrcweir } 5094*cdf0e10cSrcweir 5095*cdf0e10cSrcweir /************************************************************************* 5096*cdf0e10cSrcweir |* 5097*cdf0e10cSrcweir |* XFormTextOutlineItem::XFormTextOutlineItem(SvStream& rIn) 5098*cdf0e10cSrcweir |* 5099*cdf0e10cSrcweir |* Ersterstellung 27.06.95 ESO 5100*cdf0e10cSrcweir |* Letzte Aenderung 27.06.95 ESO 5101*cdf0e10cSrcweir |* 5102*cdf0e10cSrcweir *************************************************************************/ 5103*cdf0e10cSrcweir 5104*cdf0e10cSrcweir XFormTextOutlineItem::XFormTextOutlineItem(SvStream& rIn) : 5105*cdf0e10cSrcweir SfxBoolItem(XATTR_FORMTXTOUTLINE, rIn) 5106*cdf0e10cSrcweir { 5107*cdf0e10cSrcweir } 5108*cdf0e10cSrcweir 5109*cdf0e10cSrcweir /************************************************************************* 5110*cdf0e10cSrcweir |* 5111*cdf0e10cSrcweir |* XFormTextOutlineItem::Clone(SfxItemPool* pPool) const 5112*cdf0e10cSrcweir |* 5113*cdf0e10cSrcweir |* Ersterstellung 27.06.95 ESO 5114*cdf0e10cSrcweir |* Letzte Aenderung 27.06.95 ESO 5115*cdf0e10cSrcweir |* 5116*cdf0e10cSrcweir *************************************************************************/ 5117*cdf0e10cSrcweir 5118*cdf0e10cSrcweir SfxPoolItem* XFormTextOutlineItem::Clone(SfxItemPool* /*pPool*/) const 5119*cdf0e10cSrcweir { 5120*cdf0e10cSrcweir return new XFormTextOutlineItem(*this); 5121*cdf0e10cSrcweir } 5122*cdf0e10cSrcweir 5123*cdf0e10cSrcweir /************************************************************************* 5124*cdf0e10cSrcweir |* 5125*cdf0e10cSrcweir |* SfxPoolItem* XFormTextOutlineItem::Create(SvStream& rIn, sal_uInt16 nVer) 5126*cdf0e10cSrcweir |* const 5127*cdf0e10cSrcweir |* 5128*cdf0e10cSrcweir |* Ersterstellung 27.06.95 ESO 5129*cdf0e10cSrcweir |* Letzte Aenderung 27.06.95 ESO 5130*cdf0e10cSrcweir |* 5131*cdf0e10cSrcweir *************************************************************************/ 5132*cdf0e10cSrcweir 5133*cdf0e10cSrcweir SfxPoolItem* XFormTextOutlineItem::Create(SvStream& rIn, sal_uInt16 /*nVer*/) const 5134*cdf0e10cSrcweir { 5135*cdf0e10cSrcweir return new XFormTextOutlineItem(rIn); 5136*cdf0e10cSrcweir } 5137*cdf0e10cSrcweir 5138*cdf0e10cSrcweir //-------------------------- 5139*cdf0e10cSrcweir // class XFormTextShadowItem 5140*cdf0e10cSrcweir //-------------------------- 5141*cdf0e10cSrcweir TYPEINIT1_AUTOFACTORY(XFormTextShadowItem, SfxEnumItem); 5142*cdf0e10cSrcweir 5143*cdf0e10cSrcweir /************************************************************************* 5144*cdf0e10cSrcweir |* 5145*cdf0e10cSrcweir |* XFormTextShadowItem::XFormTextShadowItem() 5146*cdf0e10cSrcweir |* 5147*cdf0e10cSrcweir |* Beschreibung 5148*cdf0e10cSrcweir |* Ersterstellung 27.06.95 5149*cdf0e10cSrcweir |* Letzte Aenderung 27.06.95 5150*cdf0e10cSrcweir |* 5151*cdf0e10cSrcweir *************************************************************************/ 5152*cdf0e10cSrcweir 5153*cdf0e10cSrcweir XFormTextShadowItem::XFormTextShadowItem(XFormTextShadow eFormTextShadow) : 5154*cdf0e10cSrcweir SfxEnumItem( 5155*cdf0e10cSrcweir XATTR_FORMTXTSHADOW, sal::static_int_cast< sal_uInt16 >(eFormTextShadow)) 5156*cdf0e10cSrcweir { 5157*cdf0e10cSrcweir } 5158*cdf0e10cSrcweir 5159*cdf0e10cSrcweir /************************************************************************* 5160*cdf0e10cSrcweir |* 5161*cdf0e10cSrcweir |* XFormTextShadowItem::XFormTextShadowItem(SvStream& rIn) 5162*cdf0e10cSrcweir |* 5163*cdf0e10cSrcweir |* Beschreibung 5164*cdf0e10cSrcweir |* Ersterstellung 27.06.95 5165*cdf0e10cSrcweir |* Letzte Aenderung 27.06.95 5166*cdf0e10cSrcweir |* 5167*cdf0e10cSrcweir *************************************************************************/ 5168*cdf0e10cSrcweir 5169*cdf0e10cSrcweir XFormTextShadowItem::XFormTextShadowItem(SvStream& rIn) : 5170*cdf0e10cSrcweir SfxEnumItem(XATTR_FORMTXTSHADOW, rIn) 5171*cdf0e10cSrcweir { 5172*cdf0e10cSrcweir } 5173*cdf0e10cSrcweir 5174*cdf0e10cSrcweir /************************************************************************* 5175*cdf0e10cSrcweir |* 5176*cdf0e10cSrcweir |* XFormTextShadowItem::Clone(SfxItemPool* pPool) const 5177*cdf0e10cSrcweir |* 5178*cdf0e10cSrcweir |* Beschreibung 5179*cdf0e10cSrcweir |* Ersterstellung 27.06.95 5180*cdf0e10cSrcweir |* Letzte Aenderung 27.06.95 5181*cdf0e10cSrcweir |* 5182*cdf0e10cSrcweir *************************************************************************/ 5183*cdf0e10cSrcweir 5184*cdf0e10cSrcweir SfxPoolItem* XFormTextShadowItem::Clone(SfxItemPool* /*pPool*/) const 5185*cdf0e10cSrcweir { 5186*cdf0e10cSrcweir return new XFormTextShadowItem( *this ); 5187*cdf0e10cSrcweir } 5188*cdf0e10cSrcweir 5189*cdf0e10cSrcweir /************************************************************************* 5190*cdf0e10cSrcweir |* 5191*cdf0e10cSrcweir |* SfxPoolItem* XFormTextShadowItem::Create(SvStream& rIn, sal_uInt16 nVer) const 5192*cdf0e10cSrcweir |* 5193*cdf0e10cSrcweir |* Beschreibung 5194*cdf0e10cSrcweir |* Ersterstellung 27.06.95 5195*cdf0e10cSrcweir |* Letzte Aenderung 27.06.95 5196*cdf0e10cSrcweir |* 5197*cdf0e10cSrcweir *************************************************************************/ 5198*cdf0e10cSrcweir 5199*cdf0e10cSrcweir SfxPoolItem* XFormTextShadowItem::Create(SvStream& rIn, sal_uInt16 /*nVer*/) const 5200*cdf0e10cSrcweir { 5201*cdf0e10cSrcweir return new XFormTextShadowItem(rIn); 5202*cdf0e10cSrcweir } 5203*cdf0e10cSrcweir 5204*cdf0e10cSrcweir 5205*cdf0e10cSrcweir /************************************************************************* 5206*cdf0e10cSrcweir |* 5207*cdf0e10cSrcweir |* 5208*cdf0e10cSrcweir |* 5209*cdf0e10cSrcweir \*************************************************************************/ 5210*cdf0e10cSrcweir 5211*cdf0e10cSrcweir sal_uInt16 XFormTextShadowItem::GetValueCount() const 5212*cdf0e10cSrcweir { 5213*cdf0e10cSrcweir return 3; 5214*cdf0e10cSrcweir } 5215*cdf0e10cSrcweir 5216*cdf0e10cSrcweir /************************************************************************* 5217*cdf0e10cSrcweir |* 5218*cdf0e10cSrcweir |* 5219*cdf0e10cSrcweir |* 5220*cdf0e10cSrcweir \*************************************************************************/ 5221*cdf0e10cSrcweir 5222*cdf0e10cSrcweir // #FontWork# 5223*cdf0e10cSrcweir sal_Bool XFormTextShadowItem::QueryValue( uno::Any& rVal, sal_uInt8 /*nMemberId*/) const 5224*cdf0e10cSrcweir { 5225*cdf0e10cSrcweir rVal <<= (sal_Int32)GetValue(); 5226*cdf0e10cSrcweir return sal_True; 5227*cdf0e10cSrcweir } 5228*cdf0e10cSrcweir 5229*cdf0e10cSrcweir /************************************************************************* 5230*cdf0e10cSrcweir |* 5231*cdf0e10cSrcweir |* 5232*cdf0e10cSrcweir |* 5233*cdf0e10cSrcweir \*************************************************************************/ 5234*cdf0e10cSrcweir 5235*cdf0e10cSrcweir // #FontWork# 5236*cdf0e10cSrcweir sal_Bool XFormTextShadowItem::PutValue( const uno::Any& rVal, sal_uInt8 /*nMemberId*/) 5237*cdf0e10cSrcweir { 5238*cdf0e10cSrcweir sal_Int32 nValue = 0; 5239*cdf0e10cSrcweir rVal >>= nValue; 5240*cdf0e10cSrcweir SetValue(sal::static_int_cast< sal_uInt16 >(nValue)); 5241*cdf0e10cSrcweir 5242*cdf0e10cSrcweir return sal_True; 5243*cdf0e10cSrcweir } 5244*cdf0e10cSrcweir 5245*cdf0e10cSrcweir // ------------------------------- 5246*cdf0e10cSrcweir // class XFormTextShadowColorItem 5247*cdf0e10cSrcweir // ------------------------------- 5248*cdf0e10cSrcweir TYPEINIT1_AUTOFACTORY(XFormTextShadowColorItem, XColorItem); 5249*cdf0e10cSrcweir 5250*cdf0e10cSrcweir /************************************************************************* 5251*cdf0e10cSrcweir |* 5252*cdf0e10cSrcweir |* XFormTextShadowColorItem::XFormTextShadowColorItem() 5253*cdf0e10cSrcweir |* 5254*cdf0e10cSrcweir |* Beschreibung 5255*cdf0e10cSrcweir |* Ersterstellung 27.06.95 5256*cdf0e10cSrcweir |* Letzte Aenderung 27.06.95 5257*cdf0e10cSrcweir |* 5258*cdf0e10cSrcweir *************************************************************************/ 5259*cdf0e10cSrcweir 5260*cdf0e10cSrcweir XFormTextShadowColorItem::XFormTextShadowColorItem(sal_Int32 nIndex, 5261*cdf0e10cSrcweir const Color& rTheColor) : 5262*cdf0e10cSrcweir XColorItem(XATTR_FORMTXTSHDWCOLOR, nIndex, rTheColor) 5263*cdf0e10cSrcweir { 5264*cdf0e10cSrcweir } 5265*cdf0e10cSrcweir 5266*cdf0e10cSrcweir /************************************************************************* 5267*cdf0e10cSrcweir |* 5268*cdf0e10cSrcweir |* XFormTextShadowColorItem::XFormTextShadowColorItem(const XubString& rName, const Color& rTheColor) 5269*cdf0e10cSrcweir |* 5270*cdf0e10cSrcweir |* Beschreibung 5271*cdf0e10cSrcweir |* Ersterstellung 27.06.95 5272*cdf0e10cSrcweir |* Letzte Aenderung 27.06.95 5273*cdf0e10cSrcweir |* 5274*cdf0e10cSrcweir *************************************************************************/ 5275*cdf0e10cSrcweir 5276*cdf0e10cSrcweir XFormTextShadowColorItem::XFormTextShadowColorItem(const XubString& rName, 5277*cdf0e10cSrcweir const Color& rTheColor) : 5278*cdf0e10cSrcweir XColorItem(XATTR_FORMTXTSHDWCOLOR, rName, rTheColor) 5279*cdf0e10cSrcweir { 5280*cdf0e10cSrcweir } 5281*cdf0e10cSrcweir 5282*cdf0e10cSrcweir /************************************************************************* 5283*cdf0e10cSrcweir |* 5284*cdf0e10cSrcweir |* XFormTextShadowColorItem::XFormTextShadowColorItem(SvStream& rIn) 5285*cdf0e10cSrcweir |* 5286*cdf0e10cSrcweir |* Beschreibung 5287*cdf0e10cSrcweir |* Ersterstellung 27.06.95 5288*cdf0e10cSrcweir |* Letzte Aenderung 27.06.95 5289*cdf0e10cSrcweir |* 5290*cdf0e10cSrcweir *************************************************************************/ 5291*cdf0e10cSrcweir 5292*cdf0e10cSrcweir XFormTextShadowColorItem::XFormTextShadowColorItem(SvStream& rIn) : 5293*cdf0e10cSrcweir XColorItem(XATTR_FORMTXTSHDWCOLOR, rIn) 5294*cdf0e10cSrcweir { 5295*cdf0e10cSrcweir } 5296*cdf0e10cSrcweir 5297*cdf0e10cSrcweir /************************************************************************* 5298*cdf0e10cSrcweir |* 5299*cdf0e10cSrcweir |* XFormTextShadowColorItem::Clone(SfxItemPool* pPool) const 5300*cdf0e10cSrcweir |* 5301*cdf0e10cSrcweir |* Beschreibung 5302*cdf0e10cSrcweir |* Ersterstellung 27.06.95 5303*cdf0e10cSrcweir |* Letzte Aenderung 27.06.95 5304*cdf0e10cSrcweir |* 5305*cdf0e10cSrcweir *************************************************************************/ 5306*cdf0e10cSrcweir 5307*cdf0e10cSrcweir SfxPoolItem* XFormTextShadowColorItem::Clone(SfxItemPool* /*pPool*/) const 5308*cdf0e10cSrcweir { 5309*cdf0e10cSrcweir return new XFormTextShadowColorItem(*this); 5310*cdf0e10cSrcweir } 5311*cdf0e10cSrcweir 5312*cdf0e10cSrcweir /************************************************************************* 5313*cdf0e10cSrcweir |* 5314*cdf0e10cSrcweir |* SfxPoolItem* XFormTextShadowColorItem::Create(SvStream& rIn, sal_uInt16 nVer) const 5315*cdf0e10cSrcweir |* 5316*cdf0e10cSrcweir |* Beschreibung 5317*cdf0e10cSrcweir |* Ersterstellung 27.06.95 5318*cdf0e10cSrcweir |* Letzte Aenderung 27.06.95 5319*cdf0e10cSrcweir |* 5320*cdf0e10cSrcweir *************************************************************************/ 5321*cdf0e10cSrcweir 5322*cdf0e10cSrcweir SfxPoolItem* XFormTextShadowColorItem::Create(SvStream& rIn, sal_uInt16 /*nVer*/) const 5323*cdf0e10cSrcweir { 5324*cdf0e10cSrcweir return new XFormTextShadowColorItem(rIn); 5325*cdf0e10cSrcweir } 5326*cdf0e10cSrcweir 5327*cdf0e10cSrcweir //------------------------------ 5328*cdf0e10cSrcweir // class XFormTextShadowXValItem 5329*cdf0e10cSrcweir //------------------------------ 5330*cdf0e10cSrcweir TYPEINIT1_AUTOFACTORY(XFormTextShadowXValItem, SfxMetricItem); 5331*cdf0e10cSrcweir 5332*cdf0e10cSrcweir /************************************************************************* 5333*cdf0e10cSrcweir |* 5334*cdf0e10cSrcweir |* XFormTextShadowXValItem::XFormTextShadowXValItem(long) 5335*cdf0e10cSrcweir |* 5336*cdf0e10cSrcweir |* Beschreibung 5337*cdf0e10cSrcweir |* Ersterstellung 28.06.95 ESO 5338*cdf0e10cSrcweir |* Letzte Aenderung 28.06.95 ESO 5339*cdf0e10cSrcweir |* 5340*cdf0e10cSrcweir *************************************************************************/ 5341*cdf0e10cSrcweir 5342*cdf0e10cSrcweir XFormTextShadowXValItem::XFormTextShadowXValItem(long nVal) : 5343*cdf0e10cSrcweir SfxMetricItem(XATTR_FORMTXTSHDWXVAL, nVal) 5344*cdf0e10cSrcweir { 5345*cdf0e10cSrcweir } 5346*cdf0e10cSrcweir 5347*cdf0e10cSrcweir /************************************************************************* 5348*cdf0e10cSrcweir |* 5349*cdf0e10cSrcweir |* XFormTextShadowXValItem::XFormTextShadowXValItem(SvStream& rIn) 5350*cdf0e10cSrcweir |* 5351*cdf0e10cSrcweir |* Beschreibung 5352*cdf0e10cSrcweir |* Ersterstellung 28.06.95 ESO 5353*cdf0e10cSrcweir |* Letzte Aenderung 28.06.95 ESO 5354*cdf0e10cSrcweir |* 5355*cdf0e10cSrcweir *************************************************************************/ 5356*cdf0e10cSrcweir 5357*cdf0e10cSrcweir XFormTextShadowXValItem::XFormTextShadowXValItem(SvStream& rIn) : 5358*cdf0e10cSrcweir SfxMetricItem(XATTR_FORMTXTSHDWXVAL, rIn) 5359*cdf0e10cSrcweir { 5360*cdf0e10cSrcweir } 5361*cdf0e10cSrcweir 5362*cdf0e10cSrcweir /************************************************************************* 5363*cdf0e10cSrcweir |* 5364*cdf0e10cSrcweir |* XFormTextShadowXValItem::Clone(SfxItemPool* pPool) const 5365*cdf0e10cSrcweir |* 5366*cdf0e10cSrcweir |* Beschreibung 5367*cdf0e10cSrcweir |* Ersterstellung 28.06.95 ESO 5368*cdf0e10cSrcweir |* Letzte Aenderung 28.06.95 ESO 5369*cdf0e10cSrcweir |* 5370*cdf0e10cSrcweir *************************************************************************/ 5371*cdf0e10cSrcweir 5372*cdf0e10cSrcweir SfxPoolItem* XFormTextShadowXValItem::Clone(SfxItemPool* /*pPool*/) const 5373*cdf0e10cSrcweir { 5374*cdf0e10cSrcweir return new XFormTextShadowXValItem(*this); 5375*cdf0e10cSrcweir } 5376*cdf0e10cSrcweir 5377*cdf0e10cSrcweir /************************************************************************* 5378*cdf0e10cSrcweir |* 5379*cdf0e10cSrcweir |* SfxPoolItem* XFormTextShadowXValItem::Create(SvStream& rIn, sal_uInt16 nVer) const 5380*cdf0e10cSrcweir |* 5381*cdf0e10cSrcweir |* Beschreibung 5382*cdf0e10cSrcweir |* Ersterstellung 28.06.95 ESO 5383*cdf0e10cSrcweir |* Letzte Aenderung 28.06.95 ESO 5384*cdf0e10cSrcweir |* 5385*cdf0e10cSrcweir *************************************************************************/ 5386*cdf0e10cSrcweir 5387*cdf0e10cSrcweir SfxPoolItem* XFormTextShadowXValItem::Create(SvStream& rIn, sal_uInt16 /*nVer*/) const 5388*cdf0e10cSrcweir { 5389*cdf0e10cSrcweir return new XFormTextShadowXValItem(rIn); 5390*cdf0e10cSrcweir } 5391*cdf0e10cSrcweir 5392*cdf0e10cSrcweir //------------------------------ 5393*cdf0e10cSrcweir // class XFormTextShadowYValItem 5394*cdf0e10cSrcweir //------------------------------ 5395*cdf0e10cSrcweir TYPEINIT1_AUTOFACTORY(XFormTextShadowYValItem, SfxMetricItem); 5396*cdf0e10cSrcweir 5397*cdf0e10cSrcweir /************************************************************************* 5398*cdf0e10cSrcweir |* 5399*cdf0e10cSrcweir |* XFormTextShadowYValItem::XFormTextShadowYValItem(long) 5400*cdf0e10cSrcweir |* 5401*cdf0e10cSrcweir |* Beschreibung 5402*cdf0e10cSrcweir |* Ersterstellung 28.06.95 ESO 5403*cdf0e10cSrcweir |* Letzte Aenderung 28.06.95 ESO 5404*cdf0e10cSrcweir |* 5405*cdf0e10cSrcweir *************************************************************************/ 5406*cdf0e10cSrcweir 5407*cdf0e10cSrcweir XFormTextShadowYValItem::XFormTextShadowYValItem(long nVal) : 5408*cdf0e10cSrcweir SfxMetricItem(XATTR_FORMTXTSHDWYVAL, nVal) 5409*cdf0e10cSrcweir { 5410*cdf0e10cSrcweir } 5411*cdf0e10cSrcweir 5412*cdf0e10cSrcweir /************************************************************************* 5413*cdf0e10cSrcweir |* 5414*cdf0e10cSrcweir |* XFormTextShadowYValItem::XFormTextShadowYValItem(SvStream& rIn) 5415*cdf0e10cSrcweir |* 5416*cdf0e10cSrcweir |* Beschreibung 5417*cdf0e10cSrcweir |* Ersterstellung 28.06.95 ESO 5418*cdf0e10cSrcweir |* Letzte Aenderung 28.06.95 ESO 5419*cdf0e10cSrcweir |* 5420*cdf0e10cSrcweir *************************************************************************/ 5421*cdf0e10cSrcweir 5422*cdf0e10cSrcweir XFormTextShadowYValItem::XFormTextShadowYValItem(SvStream& rIn) : 5423*cdf0e10cSrcweir SfxMetricItem(XATTR_FORMTXTSHDWYVAL, rIn) 5424*cdf0e10cSrcweir { 5425*cdf0e10cSrcweir } 5426*cdf0e10cSrcweir 5427*cdf0e10cSrcweir /************************************************************************* 5428*cdf0e10cSrcweir |* 5429*cdf0e10cSrcweir |* XFormTextShadowYValItem::Clone(SfxItemPool* pPool) const 5430*cdf0e10cSrcweir |* 5431*cdf0e10cSrcweir |* Beschreibung 5432*cdf0e10cSrcweir |* Ersterstellung 28.06.95 ESO 5433*cdf0e10cSrcweir |* Letzte Aenderung 28.06.95 ESO 5434*cdf0e10cSrcweir |* 5435*cdf0e10cSrcweir *************************************************************************/ 5436*cdf0e10cSrcweir 5437*cdf0e10cSrcweir SfxPoolItem* XFormTextShadowYValItem::Clone(SfxItemPool* /*pPool*/) const 5438*cdf0e10cSrcweir { 5439*cdf0e10cSrcweir return new XFormTextShadowYValItem(*this); 5440*cdf0e10cSrcweir } 5441*cdf0e10cSrcweir 5442*cdf0e10cSrcweir /************************************************************************* 5443*cdf0e10cSrcweir |* 5444*cdf0e10cSrcweir |* SfxPoolItem* XFormTextShadowYValItem::Create(SvStream& rIn, sal_uInt16 nVer) const 5445*cdf0e10cSrcweir |* 5446*cdf0e10cSrcweir |* Beschreibung 5447*cdf0e10cSrcweir |* Ersterstellung 28.06.95 ESO 5448*cdf0e10cSrcweir |* Letzte Aenderung 28.06.95 ESO 5449*cdf0e10cSrcweir |* 5450*cdf0e10cSrcweir *************************************************************************/ 5451*cdf0e10cSrcweir 5452*cdf0e10cSrcweir SfxPoolItem* XFormTextShadowYValItem::Create(SvStream& rIn, sal_uInt16 /*nVer*/) const 5453*cdf0e10cSrcweir { 5454*cdf0e10cSrcweir return new XFormTextShadowYValItem(rIn); 5455*cdf0e10cSrcweir } 5456*cdf0e10cSrcweir 5457*cdf0e10cSrcweir //--------------------------- 5458*cdf0e10cSrcweir // class XFormTextStdFormItem 5459*cdf0e10cSrcweir //--------------------------- 5460*cdf0e10cSrcweir TYPEINIT1_AUTOFACTORY(XFormTextStdFormItem, SfxEnumItem); 5461*cdf0e10cSrcweir 5462*cdf0e10cSrcweir /************************************************************************* 5463*cdf0e10cSrcweir |* 5464*cdf0e10cSrcweir |* XFormTextStdFormItem::XFormTextStdFormItem() 5465*cdf0e10cSrcweir |* 5466*cdf0e10cSrcweir |* Beschreibung 5467*cdf0e10cSrcweir |* Ersterstellung 27.06.95 5468*cdf0e10cSrcweir |* Letzte Aenderung 27.06.95 5469*cdf0e10cSrcweir |* 5470*cdf0e10cSrcweir *************************************************************************/ 5471*cdf0e10cSrcweir 5472*cdf0e10cSrcweir XFormTextStdFormItem::XFormTextStdFormItem(XFormTextStdForm eFormTextStdForm) : 5473*cdf0e10cSrcweir SfxEnumItem( 5474*cdf0e10cSrcweir XATTR_FORMTXTSTDFORM, sal::static_int_cast< sal_uInt16 >(eFormTextStdForm)) 5475*cdf0e10cSrcweir { 5476*cdf0e10cSrcweir } 5477*cdf0e10cSrcweir 5478*cdf0e10cSrcweir /************************************************************************* 5479*cdf0e10cSrcweir |* 5480*cdf0e10cSrcweir |* XFormTextStdFormItem::XFormTextStdFormItem(SvStream& rIn) 5481*cdf0e10cSrcweir |* 5482*cdf0e10cSrcweir |* Beschreibung 5483*cdf0e10cSrcweir |* Ersterstellung 27.06.95 5484*cdf0e10cSrcweir |* Letzte Aenderung 27.06.95 5485*cdf0e10cSrcweir |* 5486*cdf0e10cSrcweir *************************************************************************/ 5487*cdf0e10cSrcweir 5488*cdf0e10cSrcweir XFormTextStdFormItem::XFormTextStdFormItem(SvStream& rIn) : 5489*cdf0e10cSrcweir SfxEnumItem(XATTR_FORMTXTSTDFORM, rIn) 5490*cdf0e10cSrcweir { 5491*cdf0e10cSrcweir } 5492*cdf0e10cSrcweir 5493*cdf0e10cSrcweir /************************************************************************* 5494*cdf0e10cSrcweir |* 5495*cdf0e10cSrcweir |* XFormTextStdFormItem::Clone(SfxItemPool* pPool) const 5496*cdf0e10cSrcweir |* 5497*cdf0e10cSrcweir |* Beschreibung 5498*cdf0e10cSrcweir |* Ersterstellung 27.06.95 5499*cdf0e10cSrcweir |* Letzte Aenderung 27.06.95 5500*cdf0e10cSrcweir |* 5501*cdf0e10cSrcweir *************************************************************************/ 5502*cdf0e10cSrcweir 5503*cdf0e10cSrcweir SfxPoolItem* XFormTextStdFormItem::Clone(SfxItemPool* /*pPool*/) const 5504*cdf0e10cSrcweir { 5505*cdf0e10cSrcweir return new XFormTextStdFormItem( *this ); 5506*cdf0e10cSrcweir } 5507*cdf0e10cSrcweir 5508*cdf0e10cSrcweir /************************************************************************* 5509*cdf0e10cSrcweir |* 5510*cdf0e10cSrcweir |* SfxPoolItem* XFormTextStdFormItem::Create(SvStream& rIn, sal_uInt16 nVer) const 5511*cdf0e10cSrcweir |* 5512*cdf0e10cSrcweir |* Beschreibung 5513*cdf0e10cSrcweir |* Ersterstellung 27.06.95 5514*cdf0e10cSrcweir |* Letzte Aenderung 27.06.95 5515*cdf0e10cSrcweir |* 5516*cdf0e10cSrcweir *************************************************************************/ 5517*cdf0e10cSrcweir 5518*cdf0e10cSrcweir SfxPoolItem* XFormTextStdFormItem::Create(SvStream& rIn, sal_uInt16 /*nVer*/) const 5519*cdf0e10cSrcweir { 5520*cdf0e10cSrcweir return new XFormTextStdFormItem(rIn); 5521*cdf0e10cSrcweir } 5522*cdf0e10cSrcweir 5523*cdf0e10cSrcweir 5524*cdf0e10cSrcweir /************************************************************************* 5525*cdf0e10cSrcweir |* 5526*cdf0e10cSrcweir |* 5527*cdf0e10cSrcweir |* 5528*cdf0e10cSrcweir \*************************************************************************/ 5529*cdf0e10cSrcweir 5530*cdf0e10cSrcweir sal_uInt16 XFormTextStdFormItem::GetValueCount() const 5531*cdf0e10cSrcweir { 5532*cdf0e10cSrcweir return 3; 5533*cdf0e10cSrcweir } 5534*cdf0e10cSrcweir 5535*cdf0e10cSrcweir /************************************************************************* 5536*cdf0e10cSrcweir |* 5537*cdf0e10cSrcweir |* 5538*cdf0e10cSrcweir |* 5539*cdf0e10cSrcweir \*************************************************************************/ 5540*cdf0e10cSrcweir 5541*cdf0e10cSrcweir // #FontWork# 5542*cdf0e10cSrcweir sal_Bool XFormTextStdFormItem::QueryValue( uno::Any& rVal, sal_uInt8 /*nMemberId*/) const 5543*cdf0e10cSrcweir { 5544*cdf0e10cSrcweir rVal <<= (sal_Int32)GetValue(); 5545*cdf0e10cSrcweir return sal_True; 5546*cdf0e10cSrcweir } 5547*cdf0e10cSrcweir 5548*cdf0e10cSrcweir /************************************************************************* 5549*cdf0e10cSrcweir |* 5550*cdf0e10cSrcweir |* 5551*cdf0e10cSrcweir |* 5552*cdf0e10cSrcweir \*************************************************************************/ 5553*cdf0e10cSrcweir 5554*cdf0e10cSrcweir // #FontWork# 5555*cdf0e10cSrcweir sal_Bool XFormTextStdFormItem::PutValue( const uno::Any& rVal, sal_uInt8 /*nMemberId*/) 5556*cdf0e10cSrcweir { 5557*cdf0e10cSrcweir sal_Int32 nValue = 0; 5558*cdf0e10cSrcweir rVal >>= nValue; 5559*cdf0e10cSrcweir SetValue(sal::static_int_cast< sal_uInt16 >(nValue)); 5560*cdf0e10cSrcweir 5561*cdf0e10cSrcweir return sal_True; 5562*cdf0e10cSrcweir } 5563*cdf0e10cSrcweir 5564*cdf0e10cSrcweir // -------------------------- 5565*cdf0e10cSrcweir // class XFormTextHideFormItem 5566*cdf0e10cSrcweir // -------------------------- 5567*cdf0e10cSrcweir TYPEINIT1_AUTOFACTORY(XFormTextHideFormItem, SfxBoolItem); 5568*cdf0e10cSrcweir 5569*cdf0e10cSrcweir /************************************************************************* 5570*cdf0e10cSrcweir |* 5571*cdf0e10cSrcweir |* XFormTextHideFormItem::XFormTextHideFormItem() 5572*cdf0e10cSrcweir |* 5573*cdf0e10cSrcweir |* Ersterstellung 27.06.95 ESO 5574*cdf0e10cSrcweir |* Letzte Aenderung 27.06.95 ESO 5575*cdf0e10cSrcweir |* 5576*cdf0e10cSrcweir *************************************************************************/ 5577*cdf0e10cSrcweir 5578*cdf0e10cSrcweir XFormTextHideFormItem::XFormTextHideFormItem(sal_Bool bHide) : 5579*cdf0e10cSrcweir SfxBoolItem(XATTR_FORMTXTHIDEFORM, bHide) 5580*cdf0e10cSrcweir { 5581*cdf0e10cSrcweir } 5582*cdf0e10cSrcweir 5583*cdf0e10cSrcweir /************************************************************************* 5584*cdf0e10cSrcweir |* 5585*cdf0e10cSrcweir |* XFormTextHideFormItem::XFormTextHideFormItem(SvStream& rIn) 5586*cdf0e10cSrcweir |* 5587*cdf0e10cSrcweir |* Ersterstellung 27.06.95 ESO 5588*cdf0e10cSrcweir |* Letzte Aenderung 27.06.95 ESO 5589*cdf0e10cSrcweir |* 5590*cdf0e10cSrcweir *************************************************************************/ 5591*cdf0e10cSrcweir 5592*cdf0e10cSrcweir XFormTextHideFormItem::XFormTextHideFormItem(SvStream& rIn) : 5593*cdf0e10cSrcweir SfxBoolItem(XATTR_FORMTXTHIDEFORM, rIn) 5594*cdf0e10cSrcweir { 5595*cdf0e10cSrcweir } 5596*cdf0e10cSrcweir 5597*cdf0e10cSrcweir /************************************************************************* 5598*cdf0e10cSrcweir |* 5599*cdf0e10cSrcweir |* XFormTextHideFormItem::Clone(SfxItemPool* pPool) const 5600*cdf0e10cSrcweir |* 5601*cdf0e10cSrcweir |* Ersterstellung 27.06.95 ESO 5602*cdf0e10cSrcweir |* Letzte Aenderung 27.06.95 ESO 5603*cdf0e10cSrcweir |* 5604*cdf0e10cSrcweir *************************************************************************/ 5605*cdf0e10cSrcweir 5606*cdf0e10cSrcweir SfxPoolItem* XFormTextHideFormItem::Clone(SfxItemPool* /*pPool*/) const 5607*cdf0e10cSrcweir { 5608*cdf0e10cSrcweir return new XFormTextHideFormItem(*this); 5609*cdf0e10cSrcweir } 5610*cdf0e10cSrcweir 5611*cdf0e10cSrcweir /************************************************************************* 5612*cdf0e10cSrcweir |* 5613*cdf0e10cSrcweir |* SfxPoolItem* XFormTextHideFormItem::Create(SvStream& rIn, sal_uInt16 nVer) 5614*cdf0e10cSrcweir |* const 5615*cdf0e10cSrcweir |* 5616*cdf0e10cSrcweir |* Ersterstellung 27.06.95 ESO 5617*cdf0e10cSrcweir |* Letzte Aenderung 27.06.95 ESO 5618*cdf0e10cSrcweir |* 5619*cdf0e10cSrcweir *************************************************************************/ 5620*cdf0e10cSrcweir 5621*cdf0e10cSrcweir SfxPoolItem* XFormTextHideFormItem::Create(SvStream& rIn, sal_uInt16 /*nVer*/) const 5622*cdf0e10cSrcweir { 5623*cdf0e10cSrcweir return new XFormTextHideFormItem(rIn); 5624*cdf0e10cSrcweir } 5625*cdf0e10cSrcweir 5626*cdf0e10cSrcweir 5627*cdf0e10cSrcweir 5628*cdf0e10cSrcweir //++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 5629*cdf0e10cSrcweir // SetItems 5630*cdf0e10cSrcweir //++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 5631*cdf0e10cSrcweir 5632*cdf0e10cSrcweir TYPEINIT1(XLineAttrSetItem, SfxSetItem); 5633*cdf0e10cSrcweir 5634*cdf0e10cSrcweir /************************************************************************* 5635*cdf0e10cSrcweir |* 5636*cdf0e10cSrcweir |* Konstruktoren fuer Linienattribute-SetItem 5637*cdf0e10cSrcweir |* 5638*cdf0e10cSrcweir \************************************************************************/ 5639*cdf0e10cSrcweir 5640*cdf0e10cSrcweir XLineAttrSetItem::XLineAttrSetItem( SfxItemSet* pItemSet ) : 5641*cdf0e10cSrcweir SfxSetItem( XATTRSET_LINE, pItemSet) 5642*cdf0e10cSrcweir { 5643*cdf0e10cSrcweir } 5644*cdf0e10cSrcweir 5645*cdf0e10cSrcweir /************************************************************************/ 5646*cdf0e10cSrcweir 5647*cdf0e10cSrcweir XLineAttrSetItem::XLineAttrSetItem( SfxItemPool* pItemPool ) : 5648*cdf0e10cSrcweir SfxSetItem( XATTRSET_LINE, 5649*cdf0e10cSrcweir new SfxItemSet( *pItemPool, XATTR_LINE_FIRST, XATTR_LINE_LAST)) 5650*cdf0e10cSrcweir { 5651*cdf0e10cSrcweir } 5652*cdf0e10cSrcweir 5653*cdf0e10cSrcweir /************************************************************************/ 5654*cdf0e10cSrcweir 5655*cdf0e10cSrcweir XLineAttrSetItem::XLineAttrSetItem( const XLineAttrSetItem& rLineAttr ) : 5656*cdf0e10cSrcweir SfxSetItem( rLineAttr ) 5657*cdf0e10cSrcweir { 5658*cdf0e10cSrcweir } 5659*cdf0e10cSrcweir 5660*cdf0e10cSrcweir /************************************************************************/ 5661*cdf0e10cSrcweir 5662*cdf0e10cSrcweir XLineAttrSetItem::XLineAttrSetItem( const XLineAttrSetItem& rLineAttr, 5663*cdf0e10cSrcweir SfxItemPool* pItemPool) : 5664*cdf0e10cSrcweir SfxSetItem( rLineAttr, pItemPool ) 5665*cdf0e10cSrcweir { 5666*cdf0e10cSrcweir } 5667*cdf0e10cSrcweir 5668*cdf0e10cSrcweir /************************************************************************* 5669*cdf0e10cSrcweir |* 5670*cdf0e10cSrcweir |* Clone-Funktion 5671*cdf0e10cSrcweir |* 5672*cdf0e10cSrcweir \************************************************************************/ 5673*cdf0e10cSrcweir 5674*cdf0e10cSrcweir SfxPoolItem* XLineAttrSetItem::Clone( SfxItemPool* pPool ) const 5675*cdf0e10cSrcweir { 5676*cdf0e10cSrcweir return new XLineAttrSetItem( *this, pPool ); 5677*cdf0e10cSrcweir } 5678*cdf0e10cSrcweir 5679*cdf0e10cSrcweir /************************************************************************* 5680*cdf0e10cSrcweir |* 5681*cdf0e10cSrcweir |* SetItem aus Stream erzeugen 5682*cdf0e10cSrcweir |* 5683*cdf0e10cSrcweir \************************************************************************/ 5684*cdf0e10cSrcweir 5685*cdf0e10cSrcweir SfxPoolItem* XLineAttrSetItem::Create( SvStream& rStream, sal_uInt16 /*nVersion*/) const 5686*cdf0e10cSrcweir { 5687*cdf0e10cSrcweir SfxItemSet *pSet2 = new SfxItemSet( *GetItemSet().GetPool(), 5688*cdf0e10cSrcweir XATTR_LINE_FIRST, XATTR_LINE_LAST); 5689*cdf0e10cSrcweir pSet2->Load( rStream ); 5690*cdf0e10cSrcweir return new XLineAttrSetItem( pSet2 ); 5691*cdf0e10cSrcweir } 5692*cdf0e10cSrcweir 5693*cdf0e10cSrcweir /************************************************************************* 5694*cdf0e10cSrcweir |* 5695*cdf0e10cSrcweir |* SetItem in Stream speichern 5696*cdf0e10cSrcweir |* 5697*cdf0e10cSrcweir \************************************************************************/ 5698*cdf0e10cSrcweir 5699*cdf0e10cSrcweir SvStream& XLineAttrSetItem::Store( SvStream& rStream, sal_uInt16 nItemVersion ) const 5700*cdf0e10cSrcweir { 5701*cdf0e10cSrcweir return SfxSetItem::Store( rStream, nItemVersion ); 5702*cdf0e10cSrcweir } 5703*cdf0e10cSrcweir 5704*cdf0e10cSrcweir 5705*cdf0e10cSrcweir TYPEINIT1(XFillAttrSetItem, SfxSetItem); 5706*cdf0e10cSrcweir 5707*cdf0e10cSrcweir /************************************************************************* 5708*cdf0e10cSrcweir |* 5709*cdf0e10cSrcweir |* Konstruktoren fuer Fuellattribute-SetItem 5710*cdf0e10cSrcweir |* 5711*cdf0e10cSrcweir \************************************************************************/ 5712*cdf0e10cSrcweir 5713*cdf0e10cSrcweir XFillAttrSetItem::XFillAttrSetItem( SfxItemSet* pItemSet ) : 5714*cdf0e10cSrcweir SfxSetItem( XATTRSET_FILL, pItemSet) 5715*cdf0e10cSrcweir { 5716*cdf0e10cSrcweir } 5717*cdf0e10cSrcweir 5718*cdf0e10cSrcweir /************************************************************************/ 5719*cdf0e10cSrcweir 5720*cdf0e10cSrcweir XFillAttrSetItem::XFillAttrSetItem( SfxItemPool* pItemPool ) : 5721*cdf0e10cSrcweir SfxSetItem( XATTRSET_FILL, 5722*cdf0e10cSrcweir new SfxItemSet( *pItemPool, XATTR_FILL_FIRST, XATTR_FILL_LAST)) 5723*cdf0e10cSrcweir { 5724*cdf0e10cSrcweir } 5725*cdf0e10cSrcweir 5726*cdf0e10cSrcweir /************************************************************************/ 5727*cdf0e10cSrcweir 5728*cdf0e10cSrcweir XFillAttrSetItem::XFillAttrSetItem( const XFillAttrSetItem& rFillAttr ) : 5729*cdf0e10cSrcweir SfxSetItem( rFillAttr ) 5730*cdf0e10cSrcweir { 5731*cdf0e10cSrcweir } 5732*cdf0e10cSrcweir 5733*cdf0e10cSrcweir /************************************************************************/ 5734*cdf0e10cSrcweir 5735*cdf0e10cSrcweir XFillAttrSetItem::XFillAttrSetItem( const XFillAttrSetItem& rFillAttr, 5736*cdf0e10cSrcweir SfxItemPool* pItemPool ) : 5737*cdf0e10cSrcweir SfxSetItem( rFillAttr, pItemPool ) 5738*cdf0e10cSrcweir { 5739*cdf0e10cSrcweir } 5740*cdf0e10cSrcweir 5741*cdf0e10cSrcweir /************************************************************************* 5742*cdf0e10cSrcweir |* 5743*cdf0e10cSrcweir |* Clone-Funktion 5744*cdf0e10cSrcweir |* 5745*cdf0e10cSrcweir \************************************************************************/ 5746*cdf0e10cSrcweir 5747*cdf0e10cSrcweir SfxPoolItem* XFillAttrSetItem::Clone( SfxItemPool* pPool ) const 5748*cdf0e10cSrcweir { 5749*cdf0e10cSrcweir return new XFillAttrSetItem( *this, pPool ); 5750*cdf0e10cSrcweir } 5751*cdf0e10cSrcweir 5752*cdf0e10cSrcweir /************************************************************************* 5753*cdf0e10cSrcweir |* 5754*cdf0e10cSrcweir |* SetItem aus Stream erzeugen 5755*cdf0e10cSrcweir |* 5756*cdf0e10cSrcweir \************************************************************************/ 5757*cdf0e10cSrcweir 5758*cdf0e10cSrcweir SfxPoolItem* XFillAttrSetItem::Create( SvStream& rStream, sal_uInt16 /*nVersion*/) const 5759*cdf0e10cSrcweir { 5760*cdf0e10cSrcweir SfxItemSet *pSet2 = new SfxItemSet( *GetItemSet().GetPool(), 5761*cdf0e10cSrcweir XATTR_FILL_FIRST, XATTR_FILL_LAST); 5762*cdf0e10cSrcweir pSet2->Load( rStream ); 5763*cdf0e10cSrcweir return new XFillAttrSetItem( pSet2 ); 5764*cdf0e10cSrcweir } 5765*cdf0e10cSrcweir 5766*cdf0e10cSrcweir /************************************************************************* 5767*cdf0e10cSrcweir |* 5768*cdf0e10cSrcweir |* SetItem in Stream speichern 5769*cdf0e10cSrcweir |* 5770*cdf0e10cSrcweir \************************************************************************/ 5771*cdf0e10cSrcweir 5772*cdf0e10cSrcweir SvStream& XFillAttrSetItem::Store( SvStream& rStream, sal_uInt16 nItemVersion ) const 5773*cdf0e10cSrcweir { 5774*cdf0e10cSrcweir return SfxSetItem::Store( rStream, nItemVersion ); 5775*cdf0e10cSrcweir } 5776*cdf0e10cSrcweir 5777*cdf0e10cSrcweir // eof 5778*cdf0e10cSrcweir 5779