1 /************************************************************************* 2 * 3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 4 * 5 * Copyright 2000, 2010 Oracle and/or its affiliates. 6 * 7 * OpenOffice.org - a multi-platform office productivity suite 8 * 9 * This file is part of OpenOffice.org. 10 * 11 * OpenOffice.org is free software: you can redistribute it and/or modify 12 * it under the terms of the GNU Lesser General Public License version 3 13 * only, as published by the Free Software Foundation. 14 * 15 * OpenOffice.org is distributed in the hope that it will be useful, 16 * but WITHOUT ANY WARRANTY; without even the implied warranty of 17 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 18 * GNU Lesser General Public License version 3 for more details 19 * (a copy is included in the LICENSE file that accompanied this code). 20 * 21 * You should have received a copy of the GNU Lesser General Public License 22 * version 3 along with OpenOffice.org. If not, see 23 * <http://www.openoffice.org/license.html> 24 * for a copy of the LGPLv3 License. 25 * 26 ************************************************************************/ 27 28 // MARKER(update_precomp.py): autogen include statement, do not remove 29 #include "precompiled_sc.hxx" 30 31 32 33 #include <editeng/editobj.hxx> 34 35 #include "userlist.hxx" 36 #include "uiitems.hxx" 37 #include "dpsave.hxx" 38 39 // STATIC DATA ----------------------------------------------------------- 40 41 TYPEINIT1(ScInputStatusItem, SfxPoolItem); 42 TYPEINIT1(ScSortItem, SfxPoolItem); 43 TYPEINIT1(ScQueryItem, SfxPoolItem); 44 TYPEINIT1(ScSubTotalItem, SfxPoolItem); 45 TYPEINIT1(ScUserListItem, SfxPoolItem); 46 TYPEINIT1(ScConsolidateItem, SfxPoolItem); 47 TYPEINIT1(ScPivotItem, SfxPoolItem); 48 TYPEINIT1(ScSolveItem, SfxPoolItem); 49 TYPEINIT1(ScTabOpItem, SfxPoolItem); 50 TYPEINIT1(ScCondFrmtItem, SfxPoolItem); 51 52 TYPEINIT1(ScTablesHint, SfxHint); 53 TYPEINIT1(ScEditViewHint, SfxHint); 54 TYPEINIT1(ScIndexHint, SfxHint); 55 56 // ----------------------------------------------------------------------- 57 // ScInputStatusItem - Status-Update fuer Eingabezeile 58 // ----------------------------------------------------------------------- 59 60 //UNUSED2008-05 ScInputStatusItem::ScInputStatusItem( sal_uInt16 nWhichP, 61 //UNUSED2008-05 SCTAB nTab, 62 //UNUSED2008-05 SCCOL nCol, SCROW nRow, 63 //UNUSED2008-05 SCCOL nStartCol, SCROW nStartRow, 64 //UNUSED2008-05 SCCOL nEndCol, SCROW nEndRow, 65 //UNUSED2008-05 const String& rString, const EditTextObject* pData ) 66 //UNUSED2008-05 67 //UNUSED2008-05 : SfxPoolItem ( nWhichP ), 68 //UNUSED2008-05 aCursorPos ( nCol, nRow, nTab ), 69 //UNUSED2008-05 aStartPos ( nStartCol, nStartRow, nTab ), 70 //UNUSED2008-05 aEndPos ( nEndCol, nEndRow, nTab ), 71 //UNUSED2008-05 aString ( rString ), 72 //UNUSED2008-05 pEditData ( pData ? pData->Clone() : NULL ) 73 //UNUSED2008-05 { 74 //UNUSED2008-05 } 75 76 ScInputStatusItem::ScInputStatusItem( sal_uInt16 nWhichP, 77 const ScAddress& rCurPos, 78 const ScAddress& rStartPos, 79 const ScAddress& rEndPos, 80 const String& rString, 81 const EditTextObject* pData ) 82 : SfxPoolItem ( nWhichP ), 83 aCursorPos ( rCurPos ), 84 aStartPos ( rStartPos ), 85 aEndPos ( rEndPos ), 86 aString ( rString ), 87 pEditData ( pData ? pData->Clone() : NULL ) 88 { 89 } 90 91 ScInputStatusItem::ScInputStatusItem( const ScInputStatusItem& rItem ) 92 : SfxPoolItem ( rItem ), 93 aCursorPos ( rItem.aCursorPos ), 94 aStartPos ( rItem.aStartPos ), 95 aEndPos ( rItem.aEndPos ), 96 aString ( rItem.aString ), 97 pEditData ( rItem.pEditData ? rItem.pEditData->Clone() : NULL ) 98 { 99 } 100 101 __EXPORT ScInputStatusItem::~ScInputStatusItem() 102 { 103 delete pEditData; 104 } 105 106 String __EXPORT ScInputStatusItem::GetValueText() const 107 { 108 return String::CreateFromAscii(RTL_CONSTASCII_STRINGPARAM("InputStatus")); 109 } 110 111 int __EXPORT ScInputStatusItem::operator==( const SfxPoolItem& rItem ) const 112 { 113 DBG_ASSERT( SfxPoolItem::operator==( rItem ), "unequal Which or Type" ); 114 115 return ( (aStartPos == ((ScInputStatusItem&)rItem).aStartPos) 116 && (aEndPos == ((ScInputStatusItem&)rItem).aEndPos) 117 && (aCursorPos == ((ScInputStatusItem&)rItem).aCursorPos) 118 && (aString == ((ScInputStatusItem&)rItem).aString) ); 119 //! Edit-Daten vergleichen! 120 } 121 122 SfxPoolItem* __EXPORT ScInputStatusItem::Clone( SfxItemPool * ) const 123 { 124 return new ScInputStatusItem( *this ); 125 } 126 127 // 128 // ScPaintHint ist nach schints.cxx verschoben 129 // 130 131 // ----------------------------------------------------------------------- 132 // ScTablesHint - Views anpassen, wenn Tabellen eingefuegt / geloescht 133 // ----------------------------------------------------------------------- 134 135 ScTablesHint::ScTablesHint(sal_uInt16 nNewId, SCTAB nTable1, SCTAB nTable2) : 136 nId( nNewId ), 137 nTab1( nTable1 ), 138 nTab2( nTable2 ) 139 { 140 } 141 142 ScTablesHint::~ScTablesHint() 143 { 144 } 145 146 147 // ----------------------------------------------------------------------- 148 // ScIndexHint 149 // ----------------------------------------------------------------------- 150 151 ScIndexHint::ScIndexHint(sal_uInt16 nNewId, sal_uInt16 nIdx) : 152 nId( nNewId ), 153 nIndex( nIdx ) 154 { 155 } 156 157 ScIndexHint::~ScIndexHint() 158 { 159 } 160 161 162 // ----------------------------------------------------------------------- 163 // ScEditViewHint - neue EditView fuer Cursorposition anlegen 164 // ----------------------------------------------------------------------- 165 166 ScEditViewHint::ScEditViewHint( ScEditEngineDefaulter* pEngine, const ScAddress& rCurPos ) : 167 pEditEngine( pEngine ), 168 aCursorPos( rCurPos ) 169 { 170 } 171 172 ScEditViewHint::~ScEditViewHint() 173 { 174 } 175 176 // ----------------------------------------------------------------------- 177 // ScSortItem - Daten fuer den Sortierdialog 178 // ----------------------------------------------------------------------- 179 180 ScSortItem::ScSortItem( sal_uInt16 nWhichP, 181 ScViewData* ptrViewData, 182 const ScSortParam* pSortData ) : 183 SfxPoolItem ( nWhichP ), 184 pViewData ( ptrViewData ) 185 { 186 if ( pSortData ) theSortData = *pSortData; 187 } 188 189 //------------------------------------------------------------------------ 190 191 ScSortItem::ScSortItem( sal_uInt16 nWhichP, 192 const ScSortParam* pSortData ) : 193 SfxPoolItem ( nWhichP ), 194 pViewData ( NULL ) 195 { 196 if ( pSortData ) theSortData = *pSortData; 197 } 198 199 //------------------------------------------------------------------------ 200 201 ScSortItem::ScSortItem( const ScSortItem& rItem ) : 202 SfxPoolItem ( rItem ), 203 pViewData ( rItem.pViewData ), 204 theSortData ( rItem.theSortData ) 205 { 206 } 207 208 __EXPORT ScSortItem::~ScSortItem() 209 { 210 } 211 212 //------------------------------------------------------------------------ 213 214 String __EXPORT ScSortItem::GetValueText() const 215 { 216 return String::CreateFromAscii(RTL_CONSTASCII_STRINGPARAM("SortItem")); 217 } 218 219 //------------------------------------------------------------------------ 220 221 int __EXPORT ScSortItem::operator==( const SfxPoolItem& rItem ) const 222 { 223 DBG_ASSERT( SfxPoolItem::operator==( rItem ), "unequal Which or Type" ); 224 225 const ScSortItem& rOther = (const ScSortItem&)rItem; 226 227 return ( (pViewData == rOther.pViewData) 228 && (theSortData == rOther.theSortData) ); 229 } 230 231 //------------------------------------------------------------------------ 232 233 SfxPoolItem* __EXPORT ScSortItem::Clone( SfxItemPool * ) const 234 { 235 return new ScSortItem( *this ); 236 } 237 238 //------------------------------------------------------------------------ 239 240 sal_Bool ScSortItem::QueryValue( com::sun::star::uno::Any& rVal, sal_uInt8 /* nMemberUd */ ) const 241 { 242 // Return empty value as there is no useful conversion 243 rVal = com::sun::star::uno::Any(); 244 return sal_True; 245 } 246 247 // ----------------------------------------------------------------------- 248 // ScQueryItem - Daten fuer den Filterdialog 249 // ----------------------------------------------------------------------- 250 251 ScQueryItem::ScQueryItem( sal_uInt16 nWhichP, 252 ScViewData* ptrViewData, 253 const ScQueryParam* pQueryData ) : 254 SfxPoolItem ( nWhichP ), 255 pViewData ( ptrViewData ), 256 bIsAdvanced ( sal_False ) 257 { 258 if ( pQueryData ) theQueryData = *pQueryData; 259 } 260 261 //------------------------------------------------------------------------ 262 263 ScQueryItem::ScQueryItem( sal_uInt16 nWhichP, 264 const ScQueryParam* pQueryData ) : 265 SfxPoolItem ( nWhichP ), 266 pViewData ( NULL ), 267 bIsAdvanced ( sal_False ) 268 { 269 if ( pQueryData ) theQueryData = *pQueryData; 270 } 271 272 //------------------------------------------------------------------------ 273 274 ScQueryItem::ScQueryItem( const ScQueryItem& rItem ) : 275 SfxPoolItem ( rItem ), 276 pViewData ( rItem.pViewData ), 277 theQueryData( rItem.theQueryData ), 278 bIsAdvanced ( rItem.bIsAdvanced ), 279 aAdvSource ( rItem.aAdvSource ) 280 { 281 } 282 283 __EXPORT ScQueryItem::~ScQueryItem() 284 { 285 } 286 287 //------------------------------------------------------------------------ 288 289 void ScQueryItem::SetAdvancedQuerySource(const ScRange* pSource) 290 { 291 if (pSource) 292 { 293 aAdvSource = *pSource; 294 bIsAdvanced = sal_True; 295 } 296 else 297 bIsAdvanced = sal_False; 298 } 299 300 sal_Bool ScQueryItem::GetAdvancedQuerySource(ScRange& rSource) const 301 { 302 rSource = aAdvSource; 303 return bIsAdvanced; 304 } 305 306 //------------------------------------------------------------------------ 307 308 String __EXPORT ScQueryItem::GetValueText() const 309 { 310 return String::CreateFromAscii(RTL_CONSTASCII_STRINGPARAM("QueryItem")); 311 } 312 313 //------------------------------------------------------------------------ 314 315 int __EXPORT ScQueryItem::operator==( const SfxPoolItem& rItem ) const 316 { 317 DBG_ASSERT( SfxPoolItem::operator==( rItem ), "unequal Which or Type" ); 318 319 const ScQueryItem& rQueryItem = (const ScQueryItem&)rItem; 320 321 return ( (pViewData == rQueryItem.pViewData) 322 && (bIsAdvanced == rQueryItem.bIsAdvanced) 323 && (aAdvSource == rQueryItem.aAdvSource) 324 && (theQueryData == rQueryItem.theQueryData) ); 325 } 326 327 //------------------------------------------------------------------------ 328 329 SfxPoolItem* __EXPORT ScQueryItem::Clone( SfxItemPool * ) const 330 { 331 return new ScQueryItem( *this ); 332 } 333 334 // ----------------------------------------------------------------------- 335 // ScSubTotalItem - Daten fuer den Zwischenergebnisdialog 336 // ----------------------------------------------------------------------- 337 338 ScSubTotalItem::ScSubTotalItem( sal_uInt16 nWhichP, 339 ScViewData* ptrViewData, 340 const ScSubTotalParam* pSubTotalData ) : 341 SfxPoolItem ( nWhichP ), 342 pViewData ( ptrViewData ) 343 { 344 if ( pSubTotalData ) theSubTotalData = *pSubTotalData; 345 } 346 347 //------------------------------------------------------------------------ 348 349 ScSubTotalItem::ScSubTotalItem( sal_uInt16 nWhichP, 350 const ScSubTotalParam* pSubTotalData ) : 351 SfxPoolItem ( nWhichP ), 352 pViewData ( NULL ) 353 { 354 if ( pSubTotalData ) theSubTotalData = *pSubTotalData; 355 } 356 357 //------------------------------------------------------------------------ 358 359 ScSubTotalItem::ScSubTotalItem( const ScSubTotalItem& rItem ) : 360 SfxPoolItem ( rItem ), 361 pViewData ( rItem.pViewData ), 362 theSubTotalData ( rItem.theSubTotalData ) 363 { 364 } 365 366 __EXPORT ScSubTotalItem::~ScSubTotalItem() 367 { 368 } 369 370 //------------------------------------------------------------------------ 371 372 String __EXPORT ScSubTotalItem::GetValueText() const 373 { 374 return String::CreateFromAscii(RTL_CONSTASCII_STRINGPARAM("SubTotalItem")); 375 } 376 377 //------------------------------------------------------------------------ 378 379 int __EXPORT ScSubTotalItem::operator==( const SfxPoolItem& rItem ) const 380 { 381 DBG_ASSERT( SfxPoolItem::operator==( rItem ), "unequal Which or Type" ); 382 383 const ScSubTotalItem& rSTItem = (const ScSubTotalItem&)rItem; 384 385 return ( (pViewData == rSTItem.pViewData) 386 && (theSubTotalData == rSTItem.theSubTotalData) ); 387 } 388 389 //------------------------------------------------------------------------ 390 391 SfxPoolItem* __EXPORT ScSubTotalItem::Clone( SfxItemPool * ) const 392 { 393 return new ScSubTotalItem( *this ); 394 } 395 396 //------------------------------------------------------------------------ 397 398 sal_Bool ScSubTotalItem::QueryValue( com::sun::star::uno::Any& rVal, sal_uInt8 /* nMemberUd */ ) const 399 { 400 // Return empty value as there is no useful conversion 401 rVal = com::sun::star::uno::Any(); 402 return sal_True; 403 } 404 405 // ----------------------------------------------------------------------- 406 // ScUserListItem - Transporter fuer den Benutzerlisten-TabPage 407 // ----------------------------------------------------------------------- 408 409 ScUserListItem::ScUserListItem( sal_uInt16 nWhichP ) 410 : SfxPoolItem ( nWhichP ), 411 pUserList ( NULL ) 412 { 413 } 414 415 //------------------------------------------------------------------------ 416 417 ScUserListItem::ScUserListItem( const ScUserListItem& rItem ) 418 : SfxPoolItem ( rItem ) 419 { 420 if ( rItem.pUserList ) 421 pUserList = new ScUserList( *(rItem.pUserList) ); 422 else 423 pUserList = NULL; 424 } 425 426 __EXPORT ScUserListItem::~ScUserListItem() 427 { 428 delete pUserList; 429 } 430 431 //------------------------------------------------------------------------ 432 433 String __EXPORT ScUserListItem::GetValueText() const 434 { 435 return String::CreateFromAscii(RTL_CONSTASCII_STRINGPARAM("ScUserListItem")); 436 } 437 438 //------------------------------------------------------------------------ 439 440 int __EXPORT ScUserListItem::operator==( const SfxPoolItem& rItem ) const 441 { 442 DBG_ASSERT( SfxPoolItem::operator==( rItem ), "unequal Which or Type" ); 443 444 const ScUserListItem& r = (const ScUserListItem&)rItem; 445 sal_Bool bEqual = sal_False; 446 447 if ( !pUserList || !(r.pUserList) ) 448 bEqual = ( !pUserList && !(r.pUserList) ); 449 else 450 bEqual = ( *pUserList == *(r.pUserList) ); 451 452 return bEqual; 453 } 454 455 456 //------------------------------------------------------------------------ 457 458 SfxPoolItem* __EXPORT ScUserListItem::Clone( SfxItemPool * ) const 459 { 460 return new ScUserListItem( *this ); 461 } 462 463 //------------------------------------------------------------------------ 464 465 void ScUserListItem::SetUserList( const ScUserList& rUserList ) 466 { 467 delete pUserList; 468 pUserList = new ScUserList( rUserList ); 469 } 470 471 // ----------------------------------------------------------------------- 472 // ScConsolidateItem - Daten fuer den Konsolidieren-Dialog 473 // ----------------------------------------------------------------------- 474 475 ScConsolidateItem::ScConsolidateItem( 476 sal_uInt16 nWhichP, 477 const ScConsolidateParam* pConsolidateData ) : 478 SfxPoolItem ( nWhichP ) 479 { 480 if ( pConsolidateData ) theConsData = *pConsolidateData; 481 } 482 483 //------------------------------------------------------------------------ 484 485 ScConsolidateItem::ScConsolidateItem( const ScConsolidateItem& rItem ) : 486 SfxPoolItem ( rItem ), 487 theConsData ( rItem.theConsData ) 488 { 489 } 490 491 //------------------------------------------------------------------------ 492 493 __EXPORT ScConsolidateItem::~ScConsolidateItem() 494 { 495 } 496 497 //------------------------------------------------------------------------ 498 499 String __EXPORT ScConsolidateItem::GetValueText() const 500 { 501 return String::CreateFromAscii(RTL_CONSTASCII_STRINGPARAM("ScConsolidateItem")); 502 } 503 504 //------------------------------------------------------------------------ 505 506 int __EXPORT ScConsolidateItem::operator==( const SfxPoolItem& rItem ) const 507 { 508 DBG_ASSERT( SfxPoolItem::operator==( rItem ), "unequal Which or Type" ); 509 510 const ScConsolidateItem& rCItem = (const ScConsolidateItem&)rItem; 511 512 return ( theConsData == rCItem.theConsData); 513 } 514 515 //------------------------------------------------------------------------ 516 517 SfxPoolItem* __EXPORT ScConsolidateItem::Clone( SfxItemPool * ) const 518 { 519 return new ScConsolidateItem( *this ); 520 } 521 522 523 // ----------------------------------------------------------------------- 524 // ScPivotItem - Daten fuer den Pivot-Dialog 525 // ----------------------------------------------------------------------- 526 527 ScPivotItem::ScPivotItem( sal_uInt16 nWhichP, const ScDPSaveData* pData, 528 const ScRange* pRange, sal_Bool bNew ) : 529 SfxPoolItem ( nWhichP ) 530 { 531 // pSaveData must always exist 532 if ( pData ) 533 pSaveData = new ScDPSaveData(*pData); 534 else 535 pSaveData = new ScDPSaveData; 536 if ( pRange ) aDestRange = *pRange; 537 bNewSheet = bNew; 538 } 539 540 //------------------------------------------------------------------------ 541 542 ScPivotItem::ScPivotItem( const ScPivotItem& rItem ) : 543 SfxPoolItem ( rItem ), 544 aDestRange ( rItem.aDestRange ), 545 bNewSheet ( rItem.bNewSheet ) 546 { 547 DBG_ASSERT(rItem.pSaveData, "pSaveData"); 548 pSaveData = new ScDPSaveData(*rItem.pSaveData); 549 } 550 551 //------------------------------------------------------------------------ 552 553 __EXPORT ScPivotItem::~ScPivotItem() 554 { 555 delete pSaveData; 556 } 557 558 //------------------------------------------------------------------------ 559 560 String __EXPORT ScPivotItem::GetValueText() const 561 { 562 return String::CreateFromAscii(RTL_CONSTASCII_STRINGPARAM("ScPivotItem")); 563 } 564 565 //------------------------------------------------------------------------ 566 567 int __EXPORT ScPivotItem::operator==( const SfxPoolItem& rItem ) const 568 { 569 DBG_ASSERT( SfxPoolItem::operator==( rItem ), "unequal Which or Type" ); 570 571 const ScPivotItem& rPItem = (const ScPivotItem&)rItem; 572 DBG_ASSERT( pSaveData && rPItem.pSaveData, "pSaveData" ); 573 return ( *pSaveData == *rPItem.pSaveData && 574 aDestRange == rPItem.aDestRange && 575 bNewSheet == rPItem.bNewSheet ); 576 } 577 578 //------------------------------------------------------------------------ 579 580 SfxPoolItem* __EXPORT ScPivotItem::Clone( SfxItemPool * ) const 581 { 582 return new ScPivotItem( *this ); 583 } 584 585 586 // ----------------------------------------------------------------------- 587 // ScSolveItem - Daten fuer den Solver-Dialog 588 // ----------------------------------------------------------------------- 589 590 ScSolveItem::ScSolveItem( sal_uInt16 nWhichP, 591 const ScSolveParam* pSolveData ) 592 : SfxPoolItem ( nWhichP ) 593 { 594 if ( pSolveData ) theSolveData = *pSolveData; 595 } 596 597 //------------------------------------------------------------------------ 598 599 ScSolveItem::ScSolveItem( const ScSolveItem& rItem ) 600 : SfxPoolItem ( rItem ), 601 theSolveData ( rItem.theSolveData ) 602 { 603 } 604 605 //------------------------------------------------------------------------ 606 607 __EXPORT ScSolveItem::~ScSolveItem() 608 { 609 } 610 611 //------------------------------------------------------------------------ 612 613 String __EXPORT ScSolveItem::GetValueText() const 614 { 615 return String::CreateFromAscii(RTL_CONSTASCII_STRINGPARAM("ScSolveItem")); 616 } 617 618 //------------------------------------------------------------------------ 619 620 int __EXPORT ScSolveItem::operator==( const SfxPoolItem& rItem ) const 621 { 622 DBG_ASSERT( SfxPoolItem::operator==( rItem ), "unequal Which or Type" ); 623 624 const ScSolveItem& rPItem = (const ScSolveItem&)rItem; 625 626 return ( theSolveData == rPItem.theSolveData ); 627 } 628 629 //------------------------------------------------------------------------ 630 631 SfxPoolItem* __EXPORT ScSolveItem::Clone( SfxItemPool * ) const 632 { 633 return new ScSolveItem( *this ); 634 } 635 636 // ----------------------------------------------------------------------- 637 // ScTabOpItem - Daten fuer den TabOp-Dialog 638 // ----------------------------------------------------------------------- 639 640 ScTabOpItem::ScTabOpItem( sal_uInt16 nWhichP, 641 const ScTabOpParam* pTabOpData ) 642 : SfxPoolItem ( nWhichP ) 643 { 644 if ( pTabOpData ) theTabOpData = *pTabOpData; 645 } 646 647 //------------------------------------------------------------------------ 648 649 ScTabOpItem::ScTabOpItem( const ScTabOpItem& rItem ) 650 : SfxPoolItem ( rItem ), 651 theTabOpData ( rItem.theTabOpData ) 652 { 653 } 654 655 //------------------------------------------------------------------------ 656 657 __EXPORT ScTabOpItem::~ScTabOpItem() 658 { 659 } 660 661 //------------------------------------------------------------------------ 662 663 String __EXPORT ScTabOpItem::GetValueText() const 664 { 665 return String::CreateFromAscii(RTL_CONSTASCII_STRINGPARAM("ScTabOpItem")); 666 } 667 668 //------------------------------------------------------------------------ 669 670 int __EXPORT ScTabOpItem::operator==( const SfxPoolItem& rItem ) const 671 { 672 DBG_ASSERT( SfxPoolItem::operator==( rItem ), "unequal Which or Type" ); 673 674 const ScTabOpItem& rPItem = (const ScTabOpItem&)rItem; 675 676 return ( theTabOpData == rPItem.theTabOpData ); 677 } 678 679 //------------------------------------------------------------------------ 680 681 SfxPoolItem* __EXPORT ScTabOpItem::Clone( SfxItemPool * ) const 682 { 683 return new ScTabOpItem( *this ); 684 } 685 686 687 // ----------------------------------------------------------------------- 688 // ScCondFrmtItem - Daten fuer den Dialog bedingte Formatierung 689 // ----------------------------------------------------------------------- 690 691 ScCondFrmtItem::ScCondFrmtItem( sal_uInt16 nWhichP, 692 //! const ScConditionalFormat* pCondFrmt ) 693 const ScConditionalFormat& rCondFrmt ) 694 : SfxPoolItem ( nWhichP ), 695 theCondFrmtData ( rCondFrmt ) //! 696 { 697 //! if ( pCondFrmt ) theCondFrmtData = *pCondFrmt; 698 } 699 700 //------------------------------------------------------------------------ 701 702 ScCondFrmtItem::ScCondFrmtItem( const ScCondFrmtItem& rItem ) 703 : SfxPoolItem ( rItem ), 704 theCondFrmtData ( rItem.theCondFrmtData ) 705 { 706 } 707 708 //------------------------------------------------------------------------ 709 710 __EXPORT ScCondFrmtItem::~ScCondFrmtItem() 711 { 712 } 713 714 //------------------------------------------------------------------------ 715 716 String __EXPORT ScCondFrmtItem::GetValueText() const 717 { 718 return String::CreateFromAscii(RTL_CONSTASCII_STRINGPARAM("ScCondFrmtItem")); 719 } 720 721 //------------------------------------------------------------------------ 722 723 int __EXPORT ScCondFrmtItem::operator==( const SfxPoolItem& rItem ) const 724 { 725 DBG_ASSERT( SfxPoolItem::operator==( rItem ), "unequal Which or Type" ); 726 727 const ScCondFrmtItem& rPItem = (const ScCondFrmtItem&)rItem; 728 729 return ( theCondFrmtData == rPItem.theCondFrmtData ); 730 } 731 732 //------------------------------------------------------------------------ 733 734 SfxPoolItem* __EXPORT ScCondFrmtItem::Clone( SfxItemPool * ) const 735 { 736 return new ScCondFrmtItem( *this ); 737 } 738