1f6e50924SAndrew Rist /************************************************************** 2cdf0e10cSrcweir * 3f6e50924SAndrew Rist * Licensed to the Apache Software Foundation (ASF) under one 4f6e50924SAndrew Rist * or more contributor license agreements. See the NOTICE file 5f6e50924SAndrew Rist * distributed with this work for additional information 6f6e50924SAndrew Rist * regarding copyright ownership. The ASF licenses this file 7f6e50924SAndrew Rist * to you under the Apache License, Version 2.0 (the 8f6e50924SAndrew Rist * "License"); you may not use this file except in compliance 9f6e50924SAndrew Rist * with the License. You may obtain a copy of the License at 10cdf0e10cSrcweir * 11f6e50924SAndrew Rist * http://www.apache.org/licenses/LICENSE-2.0 12cdf0e10cSrcweir * 13f6e50924SAndrew Rist * Unless required by applicable law or agreed to in writing, 14f6e50924SAndrew Rist * software distributed under the License is distributed on an 15f6e50924SAndrew Rist * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 16f6e50924SAndrew Rist * KIND, either express or implied. See the License for the 17f6e50924SAndrew Rist * specific language governing permissions and limitations 18f6e50924SAndrew Rist * under the License. 19cdf0e10cSrcweir * 20f6e50924SAndrew Rist *************************************************************/ 21f6e50924SAndrew Rist 22f6e50924SAndrew Rist 23cdf0e10cSrcweir 24cdf0e10cSrcweir // MARKER(update_precomp.py): autogen include statement, do not remove 25cdf0e10cSrcweir #include "precompiled_svx.hxx" 26cdf0e10cSrcweir 27cdf0e10cSrcweir // include --------------------------------------------------------------- 28cdf0e10cSrcweir 29cdf0e10cSrcweir #include <svx/svxids.hrc> 30cdf0e10cSrcweir 31cdf0e10cSrcweir 32cdf0e10cSrcweir #include "svx/drawitem.hxx" 33cdf0e10cSrcweir #include <svx/xtable.hxx> 34cdf0e10cSrcweir 35cdf0e10cSrcweir using namespace ::com::sun::star; 36cdf0e10cSrcweir 37cdf0e10cSrcweir // ----------------------------------------------------------------------- 38cdf0e10cSrcweir 39cdf0e10cSrcweir TYPEINIT1_FACTORY( SvxColorTableItem, SfxPoolItem , new SvxColorTableItem); 40cdf0e10cSrcweir TYPEINIT1_FACTORY( SvxGradientListItem, SfxPoolItem , new SvxGradientListItem); 41cdf0e10cSrcweir TYPEINIT1_FACTORY( SvxHatchListItem, SfxPoolItem , new SvxHatchListItem); 42cdf0e10cSrcweir TYPEINIT1_FACTORY( SvxBitmapListItem, SfxPoolItem , new SvxBitmapListItem); 43cdf0e10cSrcweir TYPEINIT1_FACTORY( SvxDashListItem, SfxPoolItem , new SvxDashListItem); 44cdf0e10cSrcweir TYPEINIT1_FACTORY( SvxLineEndListItem, SfxPoolItem , new SvxLineEndListItem); 45cdf0e10cSrcweir 46cdf0e10cSrcweir //================================================================== 47cdf0e10cSrcweir // 48cdf0e10cSrcweir // SvxColorTableItem 49cdf0e10cSrcweir // 50cdf0e10cSrcweir //================================================================== 51cdf0e10cSrcweir 52cdf0e10cSrcweir SvxColorTableItem::SvxColorTableItem() 53cdf0e10cSrcweir { 54cdf0e10cSrcweir } 55cdf0e10cSrcweir 56cdf0e10cSrcweir // ----------------------------------------------------------------------- 57cdf0e10cSrcweir 58*c7be74b1SArmin Le Grand SvxColorTableItem::SvxColorTableItem( XColorListSharedPtr aTable, sal_uInt16 nW ) : 59cdf0e10cSrcweir SfxPoolItem( nW ), 60*c7be74b1SArmin Le Grand maColorTable( aTable ) 61cdf0e10cSrcweir { 62cdf0e10cSrcweir } 63cdf0e10cSrcweir 64cdf0e10cSrcweir // ----------------------------------------------------------------------- 65cdf0e10cSrcweir 66cdf0e10cSrcweir SvxColorTableItem::SvxColorTableItem( const SvxColorTableItem& rItem ) : 67cdf0e10cSrcweir SfxPoolItem( rItem ), 68*c7be74b1SArmin Le Grand maColorTable( rItem.maColorTable ) 69cdf0e10cSrcweir { 70cdf0e10cSrcweir } 71cdf0e10cSrcweir 72cdf0e10cSrcweir //------------------------------------------------------------------------ 73cdf0e10cSrcweir 74cdf0e10cSrcweir SfxItemPresentation SvxColorTableItem::GetPresentation 75cdf0e10cSrcweir ( 76cdf0e10cSrcweir SfxItemPresentation /*ePres*/, 77cdf0e10cSrcweir SfxMapUnit /*eCoreUnit*/, 78cdf0e10cSrcweir SfxMapUnit /*ePresUnit*/, 79cdf0e10cSrcweir XubString& rText, const IntlWrapper * 80cdf0e10cSrcweir ) const 81cdf0e10cSrcweir { 82cdf0e10cSrcweir rText.Erase(); 83cdf0e10cSrcweir return SFX_ITEM_PRESENTATION_NONE; 84cdf0e10cSrcweir } 85cdf0e10cSrcweir 86cdf0e10cSrcweir // ----------------------------------------------------------------------- 87cdf0e10cSrcweir 88cdf0e10cSrcweir int SvxColorTableItem::operator==( const SfxPoolItem& rItem ) const 89cdf0e10cSrcweir { 90cdf0e10cSrcweir DBG_ASSERT( SfxPoolItem::operator==( rItem ), "unequal type" ); 91*c7be74b1SArmin Le Grand return static_cast< const SvxColorTableItem& >(rItem).maColorTable == maColorTable; 92cdf0e10cSrcweir } 93cdf0e10cSrcweir 94cdf0e10cSrcweir // ----------------------------------------------------------------------- 95cdf0e10cSrcweir 96cdf0e10cSrcweir SfxPoolItem* SvxColorTableItem::Clone( SfxItemPool * ) const 97cdf0e10cSrcweir { 98cdf0e10cSrcweir return new SvxColorTableItem( *this ); 99cdf0e10cSrcweir } 100cdf0e10cSrcweir 101cdf0e10cSrcweir // ----------------------------------------------------------------------- 102cdf0e10cSrcweir 103cdf0e10cSrcweir sal_Bool SvxColorTableItem::QueryValue( com::sun::star::uno::Any& rVal, sal_uInt8 /*nMemberId*/ ) const 104cdf0e10cSrcweir { 105cdf0e10cSrcweir // This is only a quick helper to have UI support for these list items. Don't use 106cdf0e10cSrcweir // this method to query for a valid UNO representation. 107cdf0e10cSrcweir // Please ask CD if you want to change this. 108*c7be74b1SArmin Le Grand sal_Int64 aValue = sal_Int64((sal_uLong)&maColorTable); 109cdf0e10cSrcweir rVal = uno::makeAny( aValue ); 110cdf0e10cSrcweir return sal_True; 111cdf0e10cSrcweir } 112cdf0e10cSrcweir 113cdf0e10cSrcweir // ----------------------------------------------------------------------- 114cdf0e10cSrcweir 115cdf0e10cSrcweir sal_Bool SvxColorTableItem::PutValue( const com::sun::star::uno::Any& rVal, sal_uInt8 /*nMemberId*/ ) 116cdf0e10cSrcweir { 117cdf0e10cSrcweir // This is only a quick helper to have UI support for these list items. Don't use 118cdf0e10cSrcweir // this method to query for a valid UNO representation. 119cdf0e10cSrcweir // Please ask CD if you want to change this. 120cdf0e10cSrcweir sal_Int64 aValue = 0; 121cdf0e10cSrcweir if ( rVal >>= aValue ) 122cdf0e10cSrcweir { 123*c7be74b1SArmin Le Grand if(aValue) 124*c7be74b1SArmin Le Grand maColorTable = *((XColorListSharedPtr*)(sal_uLong)aValue); 125cdf0e10cSrcweir return sal_True; 126cdf0e10cSrcweir } 127cdf0e10cSrcweir 128cdf0e10cSrcweir return sal_False; 129cdf0e10cSrcweir } 130cdf0e10cSrcweir 131cdf0e10cSrcweir //================================================================== 132cdf0e10cSrcweir // 133cdf0e10cSrcweir // SvxGradientListItem 134cdf0e10cSrcweir // 135cdf0e10cSrcweir //================================================================== 136cdf0e10cSrcweir 137cdf0e10cSrcweir SvxGradientListItem::SvxGradientListItem() 138cdf0e10cSrcweir { 139cdf0e10cSrcweir } 140cdf0e10cSrcweir 141cdf0e10cSrcweir // ----------------------------------------------------------------------- 142cdf0e10cSrcweir 143*c7be74b1SArmin Le Grand SvxGradientListItem::SvxGradientListItem( XGradientListSharedPtr aList, sal_uInt16 nW ) : 144cdf0e10cSrcweir SfxPoolItem( nW ), 145*c7be74b1SArmin Le Grand maGradientList( aList ) 146cdf0e10cSrcweir { 147cdf0e10cSrcweir } 148cdf0e10cSrcweir 149cdf0e10cSrcweir // ----------------------------------------------------------------------- 150cdf0e10cSrcweir 151cdf0e10cSrcweir SvxGradientListItem::SvxGradientListItem( const SvxGradientListItem& rItem ) : 152cdf0e10cSrcweir SfxPoolItem( rItem ), 153*c7be74b1SArmin Le Grand maGradientList( rItem.maGradientList ) 154cdf0e10cSrcweir { 155cdf0e10cSrcweir } 156cdf0e10cSrcweir 157cdf0e10cSrcweir //------------------------------------------------------------------------ 158cdf0e10cSrcweir 159cdf0e10cSrcweir SfxItemPresentation SvxGradientListItem::GetPresentation 160cdf0e10cSrcweir ( 161cdf0e10cSrcweir SfxItemPresentation /*ePres*/, 162cdf0e10cSrcweir SfxMapUnit /*eCoreUnit*/, 163cdf0e10cSrcweir SfxMapUnit /*ePresUnit*/, 164cdf0e10cSrcweir XubString& rText, const IntlWrapper * 165cdf0e10cSrcweir ) const 166cdf0e10cSrcweir { 167cdf0e10cSrcweir rText.Erase(); 168cdf0e10cSrcweir return SFX_ITEM_PRESENTATION_NONE; 169cdf0e10cSrcweir } 170cdf0e10cSrcweir 171cdf0e10cSrcweir // ----------------------------------------------------------------------- 172cdf0e10cSrcweir 173cdf0e10cSrcweir int SvxGradientListItem::operator==( const SfxPoolItem& rItem ) const 174cdf0e10cSrcweir { 175cdf0e10cSrcweir DBG_ASSERT( SfxPoolItem::operator==( rItem ), "unequal type" ); 176*c7be74b1SArmin Le Grand return static_cast< const SvxGradientListItem& >(rItem).maGradientList == maGradientList; 177cdf0e10cSrcweir } 178cdf0e10cSrcweir 179cdf0e10cSrcweir // ----------------------------------------------------------------------- 180cdf0e10cSrcweir 181cdf0e10cSrcweir SfxPoolItem* SvxGradientListItem::Clone( SfxItemPool * ) const 182cdf0e10cSrcweir { 183cdf0e10cSrcweir return new SvxGradientListItem( *this ); 184cdf0e10cSrcweir } 185cdf0e10cSrcweir 186cdf0e10cSrcweir // ----------------------------------------------------------------------- 187cdf0e10cSrcweir 188cdf0e10cSrcweir sal_Bool SvxGradientListItem::QueryValue( com::sun::star::uno::Any& rVal, sal_uInt8 /*nMemberId*/ ) const 189cdf0e10cSrcweir { 190cdf0e10cSrcweir // This is only a quick helper to have UI support for these list items. Don't use 191cdf0e10cSrcweir // this method to query for a valid UNO representation. 192cdf0e10cSrcweir // Please ask CD if you want to change this. 193*c7be74b1SArmin Le Grand sal_Int64 aValue = sal_Int64((sal_uLong)&maGradientList); 194cdf0e10cSrcweir rVal = uno::makeAny( aValue ); 195cdf0e10cSrcweir return sal_True; 196cdf0e10cSrcweir } 197cdf0e10cSrcweir 198cdf0e10cSrcweir // ----------------------------------------------------------------------- 199cdf0e10cSrcweir 200cdf0e10cSrcweir sal_Bool SvxGradientListItem::PutValue( const com::sun::star::uno::Any& rVal, sal_uInt8 /*nMemberId*/ ) 201cdf0e10cSrcweir { 202cdf0e10cSrcweir // This is only a quick helper to have UI support for these list items. Don't use 203cdf0e10cSrcweir // this method to query for a valid UNO representation. 204cdf0e10cSrcweir // Please ask CD if you want to change this. 205cdf0e10cSrcweir sal_Int64 aValue = 0; 206cdf0e10cSrcweir if ( rVal >>= aValue ) 207cdf0e10cSrcweir { 208*c7be74b1SArmin Le Grand if(aValue) 209*c7be74b1SArmin Le Grand maGradientList = *((XGradientListSharedPtr*)(sal_uLong)aValue); 210cdf0e10cSrcweir return sal_True; 211cdf0e10cSrcweir } 212cdf0e10cSrcweir 213cdf0e10cSrcweir return sal_False; 214cdf0e10cSrcweir } 215cdf0e10cSrcweir 216cdf0e10cSrcweir //================================================================== 217cdf0e10cSrcweir // 218cdf0e10cSrcweir // SvxHatchListItem 219cdf0e10cSrcweir // 220cdf0e10cSrcweir //================================================================== 221cdf0e10cSrcweir 222cdf0e10cSrcweir SvxHatchListItem::SvxHatchListItem() 223cdf0e10cSrcweir { 224cdf0e10cSrcweir } 225cdf0e10cSrcweir 226cdf0e10cSrcweir // ----------------------------------------------------------------------- 227cdf0e10cSrcweir 228*c7be74b1SArmin Le Grand SvxHatchListItem::SvxHatchListItem( XHatchListSharedPtr aList, sal_uInt16 nW ) : 229cdf0e10cSrcweir SfxPoolItem( nW ), 230*c7be74b1SArmin Le Grand maHatchList( aList ) 231cdf0e10cSrcweir { 232cdf0e10cSrcweir } 233cdf0e10cSrcweir 234cdf0e10cSrcweir // ----------------------------------------------------------------------- 235cdf0e10cSrcweir 236cdf0e10cSrcweir SvxHatchListItem::SvxHatchListItem( const SvxHatchListItem& rItem ) : 237cdf0e10cSrcweir SfxPoolItem( rItem ), 238*c7be74b1SArmin Le Grand maHatchList( rItem.maHatchList ) 239cdf0e10cSrcweir { 240cdf0e10cSrcweir } 241cdf0e10cSrcweir 242cdf0e10cSrcweir //------------------------------------------------------------------------ 243cdf0e10cSrcweir 244cdf0e10cSrcweir SfxItemPresentation SvxHatchListItem::GetPresentation 245cdf0e10cSrcweir ( 246cdf0e10cSrcweir SfxItemPresentation /*ePres*/, 247cdf0e10cSrcweir SfxMapUnit /*eCoreUnit*/, 248cdf0e10cSrcweir SfxMapUnit /*ePresUnit*/, 249cdf0e10cSrcweir XubString& rText, const IntlWrapper * 250cdf0e10cSrcweir ) const 251cdf0e10cSrcweir { 252cdf0e10cSrcweir rText.Erase(); 253cdf0e10cSrcweir return SFX_ITEM_PRESENTATION_NONE; 254cdf0e10cSrcweir } 255cdf0e10cSrcweir 256cdf0e10cSrcweir // ----------------------------------------------------------------------- 257cdf0e10cSrcweir 258cdf0e10cSrcweir int SvxHatchListItem::operator==( const SfxPoolItem& rItem ) const 259cdf0e10cSrcweir { 260cdf0e10cSrcweir DBG_ASSERT( SfxPoolItem::operator==( rItem ), "unequal type" ); 261*c7be74b1SArmin Le Grand return static_cast< const SvxHatchListItem& >(rItem).maHatchList == maHatchList; 262cdf0e10cSrcweir } 263cdf0e10cSrcweir 264cdf0e10cSrcweir // ----------------------------------------------------------------------- 265cdf0e10cSrcweir 266cdf0e10cSrcweir SfxPoolItem* SvxHatchListItem::Clone( SfxItemPool * ) const 267cdf0e10cSrcweir { 268cdf0e10cSrcweir return new SvxHatchListItem( *this ); 269cdf0e10cSrcweir } 270cdf0e10cSrcweir 271cdf0e10cSrcweir // ----------------------------------------------------------------------- 272cdf0e10cSrcweir 273cdf0e10cSrcweir sal_Bool SvxHatchListItem::QueryValue( com::sun::star::uno::Any& rVal, sal_uInt8 /*nMemberId*/ ) const 274cdf0e10cSrcweir { 275cdf0e10cSrcweir // This is only a quick helper to have UI support for these list items. Don't use 276cdf0e10cSrcweir // this method to query for a valid UNO representation. 277cdf0e10cSrcweir // Please ask CD if you want to change this. 278*c7be74b1SArmin Le Grand sal_Int64 aValue = sal_Int64((sal_uLong)&maHatchList ); 279cdf0e10cSrcweir rVal = uno::makeAny( aValue ); 280cdf0e10cSrcweir return sal_True; 281cdf0e10cSrcweir } 282cdf0e10cSrcweir 283cdf0e10cSrcweir // ----------------------------------------------------------------------- 284cdf0e10cSrcweir 285cdf0e10cSrcweir sal_Bool SvxHatchListItem::PutValue( const com::sun::star::uno::Any& rVal, sal_uInt8 /*nMemberId*/ ) 286cdf0e10cSrcweir { 287cdf0e10cSrcweir // This is only a quick helper to have UI support for these list items. Don't use 288cdf0e10cSrcweir // this method to query for a valid UNO representation. 289cdf0e10cSrcweir // Please ask CD if you want to change this. 290cdf0e10cSrcweir sal_Int64 aValue = 0; 291cdf0e10cSrcweir if ( rVal >>= aValue ) 292cdf0e10cSrcweir { 293*c7be74b1SArmin Le Grand if(aValue) 294*c7be74b1SArmin Le Grand maHatchList = *((XHatchListSharedPtr*)(sal_uLong)aValue); 295cdf0e10cSrcweir return sal_True; 296cdf0e10cSrcweir } 297cdf0e10cSrcweir 298cdf0e10cSrcweir return sal_False; 299cdf0e10cSrcweir } 300cdf0e10cSrcweir 301cdf0e10cSrcweir //================================================================== 302cdf0e10cSrcweir // 303cdf0e10cSrcweir // SvxBitmapListItem 304cdf0e10cSrcweir // 305cdf0e10cSrcweir //================================================================== 306cdf0e10cSrcweir 307cdf0e10cSrcweir SvxBitmapListItem::SvxBitmapListItem() 308cdf0e10cSrcweir { 309cdf0e10cSrcweir } 310cdf0e10cSrcweir 311cdf0e10cSrcweir // ----------------------------------------------------------------------- 312cdf0e10cSrcweir 313*c7be74b1SArmin Le Grand SvxBitmapListItem::SvxBitmapListItem( XBitmapListSharedPtr aList, sal_uInt16 nW ) : 314cdf0e10cSrcweir SfxPoolItem( nW ), 315*c7be74b1SArmin Le Grand maBitmapList( aList ) 316cdf0e10cSrcweir { 317cdf0e10cSrcweir } 318cdf0e10cSrcweir 319cdf0e10cSrcweir // ----------------------------------------------------------------------- 320cdf0e10cSrcweir 321cdf0e10cSrcweir SvxBitmapListItem::SvxBitmapListItem( const SvxBitmapListItem& rItem ) : 322cdf0e10cSrcweir SfxPoolItem( rItem ), 323*c7be74b1SArmin Le Grand maBitmapList( rItem.maBitmapList ) 324cdf0e10cSrcweir { 325cdf0e10cSrcweir } 326cdf0e10cSrcweir 327cdf0e10cSrcweir //------------------------------------------------------------------------ 328cdf0e10cSrcweir 329cdf0e10cSrcweir SfxItemPresentation SvxBitmapListItem::GetPresentation 330cdf0e10cSrcweir ( 331cdf0e10cSrcweir SfxItemPresentation /*ePres*/, 332cdf0e10cSrcweir SfxMapUnit /*eCoreUnit*/, 333cdf0e10cSrcweir SfxMapUnit /*ePresUnit*/, 334cdf0e10cSrcweir XubString& rText, const IntlWrapper * 335cdf0e10cSrcweir ) const 336cdf0e10cSrcweir { 337cdf0e10cSrcweir rText.Erase(); 338cdf0e10cSrcweir return SFX_ITEM_PRESENTATION_NONE; 339cdf0e10cSrcweir } 340cdf0e10cSrcweir 341cdf0e10cSrcweir // ----------------------------------------------------------------------- 342cdf0e10cSrcweir 343cdf0e10cSrcweir int SvxBitmapListItem::operator==( const SfxPoolItem& rItem ) const 344cdf0e10cSrcweir { 345cdf0e10cSrcweir DBG_ASSERT( SfxPoolItem::operator==( rItem ), "unequal type" ); 346*c7be74b1SArmin Le Grand return static_cast< const SvxBitmapListItem& >(rItem).maBitmapList == maBitmapList; 347cdf0e10cSrcweir } 348cdf0e10cSrcweir 349cdf0e10cSrcweir // ----------------------------------------------------------------------- 350cdf0e10cSrcweir 351cdf0e10cSrcweir SfxPoolItem* SvxBitmapListItem::Clone( SfxItemPool * ) const 352cdf0e10cSrcweir { 353cdf0e10cSrcweir return new SvxBitmapListItem( *this ); 354cdf0e10cSrcweir } 355cdf0e10cSrcweir 356cdf0e10cSrcweir // ----------------------------------------------------------------------- 357cdf0e10cSrcweir 358cdf0e10cSrcweir sal_Bool SvxBitmapListItem::QueryValue( com::sun::star::uno::Any& rVal, sal_uInt8 /*nMemberId*/ ) const 359cdf0e10cSrcweir { 360cdf0e10cSrcweir // This is only a quick helper to have UI support for these list items. Don't use 361cdf0e10cSrcweir // this method to query for a valid UNO representation. 362cdf0e10cSrcweir // Please ask CD if you want to change this. 363*c7be74b1SArmin Le Grand sal_Int64 aValue = sal_Int64((sal_uLong)&maBitmapList ); 364cdf0e10cSrcweir rVal = uno::makeAny( aValue ); 365cdf0e10cSrcweir return sal_True; 366cdf0e10cSrcweir } 367cdf0e10cSrcweir 368cdf0e10cSrcweir // ----------------------------------------------------------------------- 369cdf0e10cSrcweir 370cdf0e10cSrcweir sal_Bool SvxBitmapListItem::PutValue( const com::sun::star::uno::Any& rVal, sal_uInt8 /*nMemberId*/ ) 371cdf0e10cSrcweir { 372cdf0e10cSrcweir // This is only a quick helper to have UI support for these list items. Don't use 373cdf0e10cSrcweir // this method to query for a valid UNO representation. 374cdf0e10cSrcweir // Please ask CD if you want to change this. 375cdf0e10cSrcweir sal_Int64 aValue = 0; 376cdf0e10cSrcweir if ( rVal >>= aValue ) 377cdf0e10cSrcweir { 378*c7be74b1SArmin Le Grand if(aValue) 379*c7be74b1SArmin Le Grand maBitmapList = *((XBitmapListSharedPtr*)(sal_uLong)aValue); 380cdf0e10cSrcweir return sal_True; 381cdf0e10cSrcweir } 382cdf0e10cSrcweir 383cdf0e10cSrcweir return sal_False; 384cdf0e10cSrcweir } 385cdf0e10cSrcweir 386cdf0e10cSrcweir 387cdf0e10cSrcweir //================================================================== 388cdf0e10cSrcweir // 389cdf0e10cSrcweir // SvxDashListItem 390cdf0e10cSrcweir // 391cdf0e10cSrcweir //================================================================== 392cdf0e10cSrcweir 393cdf0e10cSrcweir SvxDashListItem::SvxDashListItem() : 394*c7be74b1SArmin Le Grand maDashList() 395cdf0e10cSrcweir { 396cdf0e10cSrcweir } 397cdf0e10cSrcweir 398cdf0e10cSrcweir // ----------------------------------------------------------------------- 399cdf0e10cSrcweir 400*c7be74b1SArmin Le Grand SvxDashListItem::SvxDashListItem( XDashListSharedPtr aList, sal_uInt16 nW ) : 401cdf0e10cSrcweir SfxPoolItem( nW ), 402*c7be74b1SArmin Le Grand maDashList( aList ) 403cdf0e10cSrcweir { 404cdf0e10cSrcweir } 405cdf0e10cSrcweir 406cdf0e10cSrcweir // ----------------------------------------------------------------------- 407cdf0e10cSrcweir 408cdf0e10cSrcweir SvxDashListItem::SvxDashListItem( const SvxDashListItem& rItem ) : 409cdf0e10cSrcweir SfxPoolItem( rItem ), 410*c7be74b1SArmin Le Grand maDashList( rItem.maDashList ) 411cdf0e10cSrcweir { 412cdf0e10cSrcweir } 413cdf0e10cSrcweir 414cdf0e10cSrcweir //------------------------------------------------------------------------ 415cdf0e10cSrcweir 416cdf0e10cSrcweir SfxItemPresentation SvxDashListItem::GetPresentation 417cdf0e10cSrcweir ( 418cdf0e10cSrcweir SfxItemPresentation /*ePres*/, 419cdf0e10cSrcweir SfxMapUnit /*eCoreUnit*/, 420cdf0e10cSrcweir SfxMapUnit /*ePresUnit*/, 421cdf0e10cSrcweir XubString& rText, const IntlWrapper * 422cdf0e10cSrcweir ) const 423cdf0e10cSrcweir { 424cdf0e10cSrcweir rText.Erase(); 425cdf0e10cSrcweir return SFX_ITEM_PRESENTATION_NONE; 426cdf0e10cSrcweir } 427cdf0e10cSrcweir 428cdf0e10cSrcweir // ----------------------------------------------------------------------- 429cdf0e10cSrcweir 430cdf0e10cSrcweir int SvxDashListItem::operator==( const SfxPoolItem& rItem ) const 431cdf0e10cSrcweir { 432cdf0e10cSrcweir DBG_ASSERT( SfxPoolItem::operator==( rItem ), "unequal type" ); 433*c7be74b1SArmin Le Grand return static_cast< const SvxDashListItem& >(rItem).maDashList == maDashList; 434cdf0e10cSrcweir } 435cdf0e10cSrcweir 436cdf0e10cSrcweir // ----------------------------------------------------------------------- 437cdf0e10cSrcweir 438cdf0e10cSrcweir SfxPoolItem* SvxDashListItem::Clone( SfxItemPool * ) const 439cdf0e10cSrcweir { 440cdf0e10cSrcweir return new SvxDashListItem( *this ); 441cdf0e10cSrcweir } 442cdf0e10cSrcweir 443cdf0e10cSrcweir // ----------------------------------------------------------------------- 444cdf0e10cSrcweir 445cdf0e10cSrcweir sal_Bool SvxDashListItem::QueryValue( com::sun::star::uno::Any& rVal, sal_uInt8 /*nMemberId*/ ) const 446cdf0e10cSrcweir { 447cdf0e10cSrcweir // This is only a quick helper to have UI support for these list items. Don't use 448cdf0e10cSrcweir // this method to query for a valid UNO representation. 449*c7be74b1SArmin Le Grand sal_Int64 aValue = sal_Int64((sal_uLong)&maDashList ); 450cdf0e10cSrcweir rVal = uno::makeAny( aValue ); 451cdf0e10cSrcweir return sal_True; 452cdf0e10cSrcweir } 453cdf0e10cSrcweir 454cdf0e10cSrcweir // ----------------------------------------------------------------------- 455cdf0e10cSrcweir 456cdf0e10cSrcweir sal_Bool SvxDashListItem::PutValue( const com::sun::star::uno::Any& rVal, sal_uInt8 /*nMemberId*/ ) 457cdf0e10cSrcweir { 458cdf0e10cSrcweir // This is only a quick helper to have UI support for these list items. Don't use 459cdf0e10cSrcweir // this method to query for a valid UNO representation. 460cdf0e10cSrcweir sal_Int64 aValue = 0; 461cdf0e10cSrcweir if ( rVal >>= aValue ) 462cdf0e10cSrcweir { 463*c7be74b1SArmin Le Grand if(aValue) 464*c7be74b1SArmin Le Grand maDashList = *((XDashListSharedPtr*)(sal_uLong)aValue); 465cdf0e10cSrcweir return sal_True; 466cdf0e10cSrcweir } 467cdf0e10cSrcweir 468cdf0e10cSrcweir return sal_False; 469cdf0e10cSrcweir } 470cdf0e10cSrcweir 471cdf0e10cSrcweir //================================================================== 472cdf0e10cSrcweir // 473cdf0e10cSrcweir // SvxLineEndListItem 474cdf0e10cSrcweir // 475cdf0e10cSrcweir //================================================================== 476cdf0e10cSrcweir 477cdf0e10cSrcweir SvxLineEndListItem::SvxLineEndListItem() 478cdf0e10cSrcweir { 479cdf0e10cSrcweir } 480cdf0e10cSrcweir 481cdf0e10cSrcweir // ----------------------------------------------------------------------- 482cdf0e10cSrcweir 483*c7be74b1SArmin Le Grand SvxLineEndListItem::SvxLineEndListItem( XLineEndListSharedPtr aList, sal_uInt16 nW ) : 484cdf0e10cSrcweir SfxPoolItem( nW ), 485*c7be74b1SArmin Le Grand maLineEndList( aList ) 486cdf0e10cSrcweir { 487cdf0e10cSrcweir } 488cdf0e10cSrcweir 489cdf0e10cSrcweir // ----------------------------------------------------------------------- 490cdf0e10cSrcweir 491cdf0e10cSrcweir SvxLineEndListItem::SvxLineEndListItem( const SvxLineEndListItem& rItem ) : 492cdf0e10cSrcweir SfxPoolItem( rItem ), 493*c7be74b1SArmin Le Grand maLineEndList( rItem.maLineEndList ) 494cdf0e10cSrcweir { 495cdf0e10cSrcweir } 496cdf0e10cSrcweir 497cdf0e10cSrcweir //------------------------------------------------------------------------ 498cdf0e10cSrcweir 499cdf0e10cSrcweir SfxItemPresentation SvxLineEndListItem::GetPresentation 500cdf0e10cSrcweir ( 501cdf0e10cSrcweir SfxItemPresentation /*ePres*/, 502cdf0e10cSrcweir SfxMapUnit /*eCoreUnit*/, 503cdf0e10cSrcweir SfxMapUnit /*ePresUnit*/, 504cdf0e10cSrcweir XubString& rText, const IntlWrapper * 505cdf0e10cSrcweir ) const 506cdf0e10cSrcweir { 507cdf0e10cSrcweir rText.Erase(); 508cdf0e10cSrcweir return SFX_ITEM_PRESENTATION_NONE; 509cdf0e10cSrcweir } 510cdf0e10cSrcweir 511cdf0e10cSrcweir // ----------------------------------------------------------------------- 512cdf0e10cSrcweir 513cdf0e10cSrcweir int SvxLineEndListItem::operator==( const SfxPoolItem& rItem ) const 514cdf0e10cSrcweir { 515cdf0e10cSrcweir DBG_ASSERT( SfxPoolItem::operator==( rItem ), "unequal type" ); 516*c7be74b1SArmin Le Grand return static_cast< const SvxLineEndListItem& >(rItem).maLineEndList == maLineEndList; 517cdf0e10cSrcweir } 518cdf0e10cSrcweir 519cdf0e10cSrcweir // ----------------------------------------------------------------------- 520cdf0e10cSrcweir 521cdf0e10cSrcweir SfxPoolItem* SvxLineEndListItem::Clone( SfxItemPool * ) const 522cdf0e10cSrcweir { 523cdf0e10cSrcweir return new SvxLineEndListItem( *this ); 524cdf0e10cSrcweir } 525cdf0e10cSrcweir 526cdf0e10cSrcweir // ----------------------------------------------------------------------- 527cdf0e10cSrcweir 528cdf0e10cSrcweir sal_Bool SvxLineEndListItem::QueryValue( com::sun::star::uno::Any& rVal, sal_uInt8 /*nMemberId*/ ) const 529cdf0e10cSrcweir { 530cdf0e10cSrcweir // This is only a quick helper to have UI support for these list items. Don't use 531cdf0e10cSrcweir // this method to query for a valid UNO representation. 532*c7be74b1SArmin Le Grand sal_Int64 aValue = sal_Int64( (sal_uLong)&maLineEndList ); 533cdf0e10cSrcweir rVal = uno::makeAny( aValue ); 534cdf0e10cSrcweir return sal_True; 535cdf0e10cSrcweir } 536cdf0e10cSrcweir 537cdf0e10cSrcweir // ----------------------------------------------------------------------- 538cdf0e10cSrcweir 539cdf0e10cSrcweir sal_Bool SvxLineEndListItem::PutValue( const com::sun::star::uno::Any& rVal, sal_uInt8 /*nMemberId*/ ) 540cdf0e10cSrcweir { 541cdf0e10cSrcweir // This is only a quick helper to have UI support for these list items. Don't use 542cdf0e10cSrcweir // this method to query for a valid UNO representation. 543cdf0e10cSrcweir sal_Int64 aValue = 0; 544cdf0e10cSrcweir if ( rVal >>= aValue ) 545cdf0e10cSrcweir { 546*c7be74b1SArmin Le Grand if(aValue) 547*c7be74b1SArmin Le Grand maLineEndList = *((XLineEndListSharedPtr*)(sal_uLong)aValue); 548cdf0e10cSrcweir return sal_True; 549cdf0e10cSrcweir } 550cdf0e10cSrcweir 551cdf0e10cSrcweir return sal_False; 552cdf0e10cSrcweir } 553*c7be74b1SArmin Le Grand 554*c7be74b1SArmin Le Grand // eof 555