| standardcontrol.cxx (97e8a929) | standardcontrol.cxx (c7be74b1) |
|---|---|
| 1/************************************************************** 2 * 3 * Licensed to the Apache Software Foundation (ASF) under one 4 * or more contributor license agreements. See the NOTICE file 5 * distributed with this work for additional information 6 * regarding copyright ownership. The ASF licenses this file 7 * to you under the Apache License, Version 2.0 (the 8 * "License"); you may not use this file except in compliance --- 668 unchanged lines hidden (view full) --- 677 return aStr; 678 } 679 680 //------------------------------------------------------------------ 681 OColorControl::OColorControl(Window* pParent, WinBits nWinStyle) 682 :OColorControl_Base( PropertyControlType::ColorListBox, pParent, nWinStyle ) 683 { 684 // initialize the color listbox | 1/************************************************************** 2 * 3 * Licensed to the Apache Software Foundation (ASF) under one 4 * or more contributor license agreements. See the NOTICE file 5 * distributed with this work for additional information 6 * regarding copyright ownership. The ASF licenses this file 7 * to you under the Apache License, Version 2.0 (the 8 * "License"); you may not use this file except in compliance --- 668 unchanged lines hidden (view full) --- 677 return aStr; 678 } 679 680 //------------------------------------------------------------------ 681 OColorControl::OColorControl(Window* pParent, WinBits nWinStyle) 682 :OColorControl_Base( PropertyControlType::ColorListBox, pParent, nWinStyle ) 683 { 684 // initialize the color listbox |
| 685 XColorList* pColorTable = NULL; | 685 XColorListSharedPtr aColorTable; |
| 686 SfxObjectShell* pDocSh = SfxObjectShell::Current(); 687 const SfxPoolItem* pItem = pDocSh ? pDocSh->GetItem( SID_COLOR_TABLE ) : NULL; 688 if ( pItem ) 689 { 690 DBG_ASSERT(pItem->ISA(SvxColorTableItem), "OColorControl::OColorControl: invalid color item!"); | 686 SfxObjectShell* pDocSh = SfxObjectShell::Current(); 687 const SfxPoolItem* pItem = pDocSh ? pDocSh->GetItem( SID_COLOR_TABLE ) : NULL; 688 if ( pItem ) 689 { 690 DBG_ASSERT(pItem->ISA(SvxColorTableItem), "OColorControl::OColorControl: invalid color item!"); |
| 691 pColorTable = ( (SvxColorTableItem*)pItem )->GetColorTable(); | 691 aColorTable = static_cast< const SvxColorTableItem* >(pItem)->GetColorTable(); |
| 692 } 693 | 692 } 693 |
| 694 if ( !pColorTable ) | 694 if ( !aColorTable.get() ) |
| 695 { | 695 { |
| 696 pColorTable = XColorList::GetStdColorList(); | 696 aColorTable = XColorList::GetStdColorList(); |
| 697 } | 697 } |
| 698 | |
| 699 | 698 |
| 700 DBG_ASSERT(pColorTable, "OColorControl::OColorControl: no color table!"); | 699 DBG_ASSERT(aColorTable.get(), "OColorControl::OColorControl: no color table!"); |
| 701 | 700 |
| 702 if (pColorTable) | 701 if (aColorTable.get()) |
| 703 { | 702 { |
| 704 for (sal_uInt16 i = 0; i < pColorTable->Count(); ++i) | 703 for (sal_uInt16 i = 0; i < aColorTable->Count(); ++i) |
| 705 { | 704 { |
| 706 XColorEntry* pEntry = pColorTable->GetColor( i ); | 705 XColorEntry* pEntry = aColorTable->GetColor( i ); |
| 707 getTypedControlWindow()->InsertEntry( pEntry->GetColor(), pEntry->GetName() ); 708 } 709 } 710 711 getTypedControlWindow()->SetDropDownLineCount( LB_DEFAULT_COUNT ); 712 if ( ( nWinStyle & WB_READONLY ) != 0 ) 713 { 714 getTypedControlWindow()->SetReadOnly( sal_True ); --- 724 unchanged lines hidden --- | 706 getTypedControlWindow()->InsertEntry( pEntry->GetColor(), pEntry->GetName() ); 707 } 708 } 709 710 getTypedControlWindow()->SetDropDownLineCount( LB_DEFAULT_COUNT ); 711 if ( ( nWinStyle & WB_READONLY ) != 0 ) 712 { 713 getTypedControlWindow()->SetReadOnly( sal_True ); --- 724 unchanged lines hidden --- |