xref: /aoo42x/main/svtools/source/contnr/svlbitm.cxx (revision 5900e8ec)
1*5900e8ecSAndrew Rist /**************************************************************
2cdf0e10cSrcweir  *
3*5900e8ecSAndrew Rist  * Licensed to the Apache Software Foundation (ASF) under one
4*5900e8ecSAndrew Rist  * or more contributor license agreements.  See the NOTICE file
5*5900e8ecSAndrew Rist  * distributed with this work for additional information
6*5900e8ecSAndrew Rist  * regarding copyright ownership.  The ASF licenses this file
7*5900e8ecSAndrew Rist  * to you under the Apache License, Version 2.0 (the
8*5900e8ecSAndrew Rist  * "License"); you may not use this file except in compliance
9*5900e8ecSAndrew Rist  * with the License.  You may obtain a copy of the License at
10*5900e8ecSAndrew Rist  *
11*5900e8ecSAndrew Rist  *   http://www.apache.org/licenses/LICENSE-2.0
12*5900e8ecSAndrew Rist  *
13*5900e8ecSAndrew Rist  * Unless required by applicable law or agreed to in writing,
14*5900e8ecSAndrew Rist  * software distributed under the License is distributed on an
15*5900e8ecSAndrew Rist  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16*5900e8ecSAndrew Rist  * KIND, either express or implied.  See the License for the
17*5900e8ecSAndrew Rist  * specific language governing permissions and limitations
18*5900e8ecSAndrew Rist  * under the License.
19*5900e8ecSAndrew Rist  *
20*5900e8ecSAndrew Rist  *************************************************************/
21*5900e8ecSAndrew Rist 
22*5900e8ecSAndrew Rist 
23cdf0e10cSrcweir 
24cdf0e10cSrcweir // MARKER(update_precomp.py): autogen include statement, do not remove
25cdf0e10cSrcweir #include "precompiled_svtools.hxx"
26cdf0e10cSrcweir 
27cdf0e10cSrcweir 
28cdf0e10cSrcweir #include <svtools/svlbox.hxx>
29cdf0e10cSrcweir #include <svtools/svlbitm.hxx>
30cdf0e10cSrcweir #include <vcl/svapp.hxx>
31cdf0e10cSrcweir #ifndef _SV_BUTTON_HXX
32cdf0e10cSrcweir #include <vcl/button.hxx>
33cdf0e10cSrcweir #endif
34cdf0e10cSrcweir #include <vcl/decoview.hxx>
35cdf0e10cSrcweir #include <vcl/sound.hxx>
36cdf0e10cSrcweir #include <vcl/salnativewidgets.hxx>
37cdf0e10cSrcweir 
38cdf0e10cSrcweir #define TABOFFS_NOT_VALID -2000000
39cdf0e10cSrcweir 
40cdf0e10cSrcweir struct SvLBoxButtonData_Impl
41cdf0e10cSrcweir {
42cdf0e10cSrcweir 	SvLBoxEntry*	pEntry;
43cdf0e10cSrcweir 	sal_Bool			bDefaultImages;
44cdf0e10cSrcweir 	sal_Bool			bShowRadioButton;
45cdf0e10cSrcweir 
SvLBoxButtonData_ImplSvLBoxButtonData_Impl46cdf0e10cSrcweir 	SvLBoxButtonData_Impl() : pEntry( NULL ), bDefaultImages( sal_False ), bShowRadioButton( sal_False ) {}
47cdf0e10cSrcweir };
48cdf0e10cSrcweir 
49cdf0e10cSrcweir 
DBG_NAME(SvLBoxButtonData)50cdf0e10cSrcweir DBG_NAME(SvLBoxButtonData)
51cdf0e10cSrcweir 
52cdf0e10cSrcweir void SvLBoxButtonData::InitData( sal_Bool bImagesFromDefault, bool _bRadioBtn, const Control* pCtrl )
53cdf0e10cSrcweir {
54cdf0e10cSrcweir 	pImpl = new SvLBoxButtonData_Impl;
55cdf0e10cSrcweir 
56cdf0e10cSrcweir 	bDataOk = sal_False;
57cdf0e10cSrcweir 	eState = SV_BUTTON_UNCHECKED;
58cdf0e10cSrcweir 	pImpl->bDefaultImages = bImagesFromDefault;
59cdf0e10cSrcweir 	pImpl->bShowRadioButton = ( _bRadioBtn != false );
60cdf0e10cSrcweir 
61cdf0e10cSrcweir 	if ( bImagesFromDefault )
62cdf0e10cSrcweir 		SetDefaultImages( pCtrl );
63cdf0e10cSrcweir }
64cdf0e10cSrcweir 
SvLBoxButtonData(const Control * pControlForSettings)65cdf0e10cSrcweir SvLBoxButtonData::SvLBoxButtonData( const Control* pControlForSettings )
66cdf0e10cSrcweir {
67cdf0e10cSrcweir 	DBG_CTOR(SvLBoxButtonData,0);
68cdf0e10cSrcweir 
69cdf0e10cSrcweir 	InitData( sal_True, false, pControlForSettings );
70cdf0e10cSrcweir }
71cdf0e10cSrcweir 
SvLBoxButtonData(const Control * pControlForSettings,bool _bRadioBtn)72cdf0e10cSrcweir SvLBoxButtonData::SvLBoxButtonData( const Control* pControlForSettings, bool _bRadioBtn )
73cdf0e10cSrcweir {
74cdf0e10cSrcweir 	DBG_CTOR(SvLBoxButtonData,0);
75cdf0e10cSrcweir 
76cdf0e10cSrcweir 	InitData( sal_True, _bRadioBtn, pControlForSettings );
77cdf0e10cSrcweir }
78cdf0e10cSrcweir 
SvLBoxButtonData()79cdf0e10cSrcweir SvLBoxButtonData::SvLBoxButtonData()
80cdf0e10cSrcweir {
81cdf0e10cSrcweir 	DBG_CTOR(SvLBoxButtonData,0);
82cdf0e10cSrcweir 
83cdf0e10cSrcweir 	InitData( sal_False, false );
84cdf0e10cSrcweir }
85cdf0e10cSrcweir 
~SvLBoxButtonData()86cdf0e10cSrcweir SvLBoxButtonData::~SvLBoxButtonData()
87cdf0e10cSrcweir {
88cdf0e10cSrcweir 	DBG_DTOR(SvLBoxButtonData,0);
89cdf0e10cSrcweir 
90cdf0e10cSrcweir 	delete pImpl;
91cdf0e10cSrcweir #ifdef DBG_UTIL
92cdf0e10cSrcweir 	pImpl = NULL;
93cdf0e10cSrcweir #endif
94cdf0e10cSrcweir }
95cdf0e10cSrcweir 
CallLink()96cdf0e10cSrcweir void SvLBoxButtonData::CallLink()
97cdf0e10cSrcweir {
98cdf0e10cSrcweir 	DBG_CHKTHIS(SvLBoxButtonData,0);
99cdf0e10cSrcweir 	aLink.Call( this );
100cdf0e10cSrcweir }
101cdf0e10cSrcweir 
GetIndex(sal_uInt16 nItemState)102cdf0e10cSrcweir sal_uInt16 SvLBoxButtonData::GetIndex( sal_uInt16 nItemState )
103cdf0e10cSrcweir {
104cdf0e10cSrcweir 	DBG_CHKTHIS(SvLBoxButtonData,0);
105cdf0e10cSrcweir 	nItemState &= 0x000F;
106cdf0e10cSrcweir 	sal_uInt16 nIdx;
107cdf0e10cSrcweir 	switch( nItemState )
108cdf0e10cSrcweir 	{
109cdf0e10cSrcweir 		case SV_ITEMSTATE_UNCHECKED:
110cdf0e10cSrcweir 				nIdx = SV_BMP_UNCHECKED; break;
111cdf0e10cSrcweir 		case SV_ITEMSTATE_CHECKED:
112cdf0e10cSrcweir 				nIdx = SV_BMP_CHECKED; break;
113cdf0e10cSrcweir 		case SV_ITEMSTATE_TRISTATE:
114cdf0e10cSrcweir 				nIdx = SV_BMP_TRISTATE; break;
115cdf0e10cSrcweir 		case SV_ITEMSTATE_UNCHECKED | SV_ITEMSTATE_HILIGHTED:
116cdf0e10cSrcweir 				nIdx = SV_BMP_HIUNCHECKED; break;
117cdf0e10cSrcweir 		case SV_ITEMSTATE_CHECKED | SV_ITEMSTATE_HILIGHTED:
118cdf0e10cSrcweir 				nIdx = SV_BMP_HICHECKED; break;
119cdf0e10cSrcweir 		case SV_ITEMSTATE_TRISTATE | SV_ITEMSTATE_HILIGHTED:
120cdf0e10cSrcweir 				nIdx = SV_BMP_HITRISTATE; break;
121cdf0e10cSrcweir 		default:
122cdf0e10cSrcweir 				nIdx = SV_BMP_UNCHECKED;
123cdf0e10cSrcweir 	}
124cdf0e10cSrcweir 	return nIdx;
125cdf0e10cSrcweir }
126cdf0e10cSrcweir 
SetWidthAndHeight()127cdf0e10cSrcweir void SvLBoxButtonData::SetWidthAndHeight()
128cdf0e10cSrcweir {
129cdf0e10cSrcweir 	DBG_CHKTHIS(SvLBoxButtonData,0);
130cdf0e10cSrcweir 	Size aSize = aBmps[0].GetSizePixel();
131cdf0e10cSrcweir 	nWidth = aSize.Width();
132cdf0e10cSrcweir 	nHeight = aSize.Height();
133cdf0e10cSrcweir 	bDataOk = sal_True;
134cdf0e10cSrcweir }
135cdf0e10cSrcweir 
136cdf0e10cSrcweir 
StoreButtonState(SvLBoxEntry * pActEntry,sal_uInt16 nItemFlags)137cdf0e10cSrcweir void SvLBoxButtonData::StoreButtonState( SvLBoxEntry* pActEntry, sal_uInt16 nItemFlags )
138cdf0e10cSrcweir {
139cdf0e10cSrcweir 	DBG_CHKTHIS(SvLBoxButtonData,0);
140cdf0e10cSrcweir 	pImpl->pEntry = pActEntry;
141cdf0e10cSrcweir 	eState = ConvertToButtonState( nItemFlags );
142cdf0e10cSrcweir }
143cdf0e10cSrcweir 
ConvertToButtonState(sal_uInt16 nItemFlags) const144cdf0e10cSrcweir SvButtonState SvLBoxButtonData::ConvertToButtonState( sal_uInt16 nItemFlags ) const
145cdf0e10cSrcweir {
146cdf0e10cSrcweir 	DBG_CHKTHIS(SvLBoxButtonData,0);
147cdf0e10cSrcweir 	nItemFlags &= (SV_ITEMSTATE_UNCHECKED |
148cdf0e10cSrcweir 				   SV_ITEMSTATE_CHECKED |
149cdf0e10cSrcweir 				   SV_ITEMSTATE_TRISTATE);
150cdf0e10cSrcweir 	switch( nItemFlags )
151cdf0e10cSrcweir 	{
152cdf0e10cSrcweir 		case SV_ITEMSTATE_UNCHECKED:
153cdf0e10cSrcweir 			return SV_BUTTON_UNCHECKED;
154cdf0e10cSrcweir 
155cdf0e10cSrcweir 		case SV_ITEMSTATE_CHECKED:
156cdf0e10cSrcweir 			return SV_BUTTON_CHECKED;
157cdf0e10cSrcweir 
158cdf0e10cSrcweir 		case SV_ITEMSTATE_TRISTATE:
159cdf0e10cSrcweir 			return SV_BUTTON_TRISTATE;
160cdf0e10cSrcweir 		default:
161cdf0e10cSrcweir 			return SV_BUTTON_UNCHECKED;
162cdf0e10cSrcweir 	}
163cdf0e10cSrcweir }
164cdf0e10cSrcweir 
GetActEntry() const165cdf0e10cSrcweir SvLBoxEntry* SvLBoxButtonData::GetActEntry() const
166cdf0e10cSrcweir {
167cdf0e10cSrcweir 	DBG_ASSERT( pImpl, "-SvLBoxButtonData::GetActEntry(): don't use me that way!" );
168cdf0e10cSrcweir 	return pImpl->pEntry;
169cdf0e10cSrcweir }
170cdf0e10cSrcweir 
SetDefaultImages(const Control * pCtrl)171cdf0e10cSrcweir void SvLBoxButtonData::SetDefaultImages( const Control* pCtrl )
172cdf0e10cSrcweir {
173cdf0e10cSrcweir 	const AllSettings& rSettings = pCtrl? pCtrl->GetSettings() : Application::GetSettings();
174cdf0e10cSrcweir 
175cdf0e10cSrcweir 	if ( pImpl->bShowRadioButton )
176cdf0e10cSrcweir 	{
177cdf0e10cSrcweir 		aBmps[ SV_BMP_UNCHECKED ]	= RadioButton::GetRadioImage( rSettings, BUTTON_DRAW_DEFAULT );
178cdf0e10cSrcweir 		aBmps[ SV_BMP_CHECKED ]		= RadioButton::GetRadioImage( rSettings, BUTTON_DRAW_CHECKED );
179cdf0e10cSrcweir 		aBmps[ SV_BMP_HICHECKED ]	= RadioButton::GetRadioImage( rSettings, BUTTON_DRAW_CHECKED | BUTTON_DRAW_PRESSED );
180cdf0e10cSrcweir 		aBmps[ SV_BMP_HIUNCHECKED ]	= RadioButton::GetRadioImage( rSettings, BUTTON_DRAW_DEFAULT | BUTTON_DRAW_PRESSED );
181cdf0e10cSrcweir 		aBmps[ SV_BMP_TRISTATE ]	= RadioButton::GetRadioImage( rSettings, BUTTON_DRAW_DONTKNOW );
182cdf0e10cSrcweir 		aBmps[ SV_BMP_HITRISTATE ]	= RadioButton::GetRadioImage( rSettings, BUTTON_DRAW_DONTKNOW | BUTTON_DRAW_PRESSED );
183cdf0e10cSrcweir 	}
184cdf0e10cSrcweir 	else
185cdf0e10cSrcweir 	{
186cdf0e10cSrcweir 		aBmps[ SV_BMP_UNCHECKED ]	= CheckBox::GetCheckImage( rSettings, BUTTON_DRAW_DEFAULT );
187cdf0e10cSrcweir 		aBmps[ SV_BMP_CHECKED ]		= CheckBox::GetCheckImage( rSettings, BUTTON_DRAW_CHECKED );
188cdf0e10cSrcweir 		aBmps[ SV_BMP_HICHECKED ]	= CheckBox::GetCheckImage( rSettings, BUTTON_DRAW_CHECKED | BUTTON_DRAW_PRESSED );
189cdf0e10cSrcweir 		aBmps[ SV_BMP_HIUNCHECKED ]	= CheckBox::GetCheckImage( rSettings, BUTTON_DRAW_DEFAULT | BUTTON_DRAW_PRESSED );
190cdf0e10cSrcweir 		aBmps[ SV_BMP_TRISTATE ]	= CheckBox::GetCheckImage( rSettings, BUTTON_DRAW_DONTKNOW );
191cdf0e10cSrcweir 		aBmps[ SV_BMP_HITRISTATE ]	= CheckBox::GetCheckImage( rSettings, BUTTON_DRAW_DONTKNOW | BUTTON_DRAW_PRESSED );
192cdf0e10cSrcweir 	}
193cdf0e10cSrcweir }
194cdf0e10cSrcweir 
HasDefaultImages(void) const195cdf0e10cSrcweir sal_Bool SvLBoxButtonData::HasDefaultImages( void ) const
196cdf0e10cSrcweir {
197cdf0e10cSrcweir 	return pImpl->bDefaultImages;
198cdf0e10cSrcweir }
199cdf0e10cSrcweir 
IsRadio()200cdf0e10cSrcweir sal_Bool SvLBoxButtonData::IsRadio() {
201cdf0e10cSrcweir 	return pImpl->bShowRadioButton;
202cdf0e10cSrcweir }
203cdf0e10cSrcweir 
204cdf0e10cSrcweir // ***************************************************************
205cdf0e10cSrcweir // class SvLBoxString
206cdf0e10cSrcweir // ***************************************************************
207cdf0e10cSrcweir 
208cdf0e10cSrcweir DBG_NAME(SvLBoxString);
209cdf0e10cSrcweir 
SvLBoxString(SvLBoxEntry * pEntry,sal_uInt16 nFlags,const XubString & rStr)210cdf0e10cSrcweir SvLBoxString::SvLBoxString( SvLBoxEntry* pEntry,sal_uInt16 nFlags,const XubString& rStr) :
211cdf0e10cSrcweir 		SvLBoxItem( pEntry, nFlags )
212cdf0e10cSrcweir {
213cdf0e10cSrcweir 	DBG_CTOR(SvLBoxString,0);
214cdf0e10cSrcweir 	SetText( pEntry, rStr );
215cdf0e10cSrcweir }
216cdf0e10cSrcweir 
SvLBoxString()217cdf0e10cSrcweir SvLBoxString::SvLBoxString() : SvLBoxItem()
218cdf0e10cSrcweir {
219cdf0e10cSrcweir 	DBG_CTOR(SvLBoxString,0);
220cdf0e10cSrcweir }
221cdf0e10cSrcweir 
~SvLBoxString()222cdf0e10cSrcweir SvLBoxString::~SvLBoxString()
223cdf0e10cSrcweir {
224cdf0e10cSrcweir 	DBG_DTOR(SvLBoxString,0);
225cdf0e10cSrcweir }
226cdf0e10cSrcweir 
IsA()227cdf0e10cSrcweir sal_uInt16 SvLBoxString::IsA()
228cdf0e10cSrcweir {
229cdf0e10cSrcweir 	DBG_CHKTHIS(SvLBoxString,0);
230cdf0e10cSrcweir 	return SV_ITEM_ID_LBOXSTRING;
231cdf0e10cSrcweir }
232cdf0e10cSrcweir 
Paint(const Point & rPos,SvLBox & rDev,sal_uInt16,SvLBoxEntry * _pEntry)233cdf0e10cSrcweir void SvLBoxString::Paint( const Point& rPos, SvLBox& rDev, sal_uInt16 /* nFlags */,
234cdf0e10cSrcweir 	SvLBoxEntry* _pEntry)
235cdf0e10cSrcweir {
236cdf0e10cSrcweir 	DBG_CHKTHIS(SvLBoxString,0);
237cdf0e10cSrcweir 	if ( _pEntry )
238cdf0e10cSrcweir 	{
239cdf0e10cSrcweir 		sal_uInt16 nStyle = rDev.IsEnabled() ? 0 : TEXT_DRAW_DISABLE;
240cdf0e10cSrcweir         if ( rDev.IsEntryMnemonicsEnabled() )
241cdf0e10cSrcweir             nStyle |= TEXT_DRAW_MNEMONIC;
242cdf0e10cSrcweir 		rDev.DrawText( Rectangle(rPos,GetSize(&rDev,_pEntry)),aStr,nStyle);
243cdf0e10cSrcweir 	}
244cdf0e10cSrcweir 	else
245cdf0e10cSrcweir 		rDev.DrawText( rPos, aStr);
246cdf0e10cSrcweir 
247cdf0e10cSrcweir }
248cdf0e10cSrcweir 
Create() const249cdf0e10cSrcweir SvLBoxItem* SvLBoxString::Create() const
250cdf0e10cSrcweir {
251cdf0e10cSrcweir 	DBG_CHKTHIS(SvLBoxString,0);
252cdf0e10cSrcweir 	return new SvLBoxString;
253cdf0e10cSrcweir }
254cdf0e10cSrcweir 
Clone(SvLBoxItem * pSource)255cdf0e10cSrcweir void SvLBoxString::Clone( SvLBoxItem* pSource )
256cdf0e10cSrcweir {
257cdf0e10cSrcweir 	DBG_CHKTHIS(SvLBoxString,0);
258cdf0e10cSrcweir 	aStr = ((SvLBoxString*)pSource)->aStr;
259cdf0e10cSrcweir }
260cdf0e10cSrcweir 
SetText(SvLBoxEntry *,const XubString & rStr)261cdf0e10cSrcweir void SvLBoxString::SetText( SvLBoxEntry*, const XubString& rStr )
262cdf0e10cSrcweir {
263cdf0e10cSrcweir 	DBG_CHKTHIS(SvLBoxString,0);
264cdf0e10cSrcweir 	aStr = rStr;
265cdf0e10cSrcweir }
266cdf0e10cSrcweir 
InitViewData(SvLBox * pView,SvLBoxEntry * pEntry,SvViewDataItem * pViewData)267cdf0e10cSrcweir void SvLBoxString::InitViewData( SvLBox* pView,SvLBoxEntry* pEntry,
268cdf0e10cSrcweir 	SvViewDataItem* pViewData)
269cdf0e10cSrcweir {
270cdf0e10cSrcweir 	DBG_CHKTHIS(SvLBoxString,0);
271cdf0e10cSrcweir 	if( !pViewData )
272cdf0e10cSrcweir 		pViewData = pView->GetViewDataItem( pEntry, this );
273cdf0e10cSrcweir 	pViewData->aSize = Size(pView->GetTextWidth( aStr ), pView->GetTextHeight());
274cdf0e10cSrcweir }
275cdf0e10cSrcweir 
276cdf0e10cSrcweir // ***************************************************************
277cdf0e10cSrcweir // class SvLBoxBmp
278cdf0e10cSrcweir // ***************************************************************
279cdf0e10cSrcweir 
280cdf0e10cSrcweir DBG_NAME(SvLBoxBmp);
281cdf0e10cSrcweir 
SvLBoxBmp(SvLBoxEntry * pEntry,sal_uInt16 nFlags,Image aBitmap)282cdf0e10cSrcweir SvLBoxBmp::SvLBoxBmp( SvLBoxEntry* pEntry, sal_uInt16 nFlags, Image aBitmap ) :
283cdf0e10cSrcweir 	SvLBoxItem( pEntry, nFlags )
284cdf0e10cSrcweir {
285cdf0e10cSrcweir 	DBG_CTOR(SvLBoxBmp,0);
286cdf0e10cSrcweir 	SetBitmap( pEntry, aBitmap);
287cdf0e10cSrcweir }
288cdf0e10cSrcweir 
SvLBoxBmp()289cdf0e10cSrcweir SvLBoxBmp::SvLBoxBmp() : SvLBoxItem()
290cdf0e10cSrcweir {
291cdf0e10cSrcweir 	DBG_CTOR(SvLBoxBmp,0);
292cdf0e10cSrcweir }
293cdf0e10cSrcweir 
~SvLBoxBmp()294cdf0e10cSrcweir SvLBoxBmp::~SvLBoxBmp()
295cdf0e10cSrcweir {
296cdf0e10cSrcweir 	DBG_DTOR(SvLBoxBmp,0);
297cdf0e10cSrcweir }
298cdf0e10cSrcweir 
IsA()299cdf0e10cSrcweir sal_uInt16 SvLBoxBmp::IsA()
300cdf0e10cSrcweir {
301cdf0e10cSrcweir 	DBG_CHKTHIS(SvLBoxBmp,0);
302cdf0e10cSrcweir 	return SV_ITEM_ID_LBOXBMP;
303cdf0e10cSrcweir }
304cdf0e10cSrcweir 
SetBitmap(SvLBoxEntry *,Image aBitmap)305cdf0e10cSrcweir void SvLBoxBmp::SetBitmap( SvLBoxEntry*, Image aBitmap)
306cdf0e10cSrcweir {
307cdf0e10cSrcweir 	DBG_CHKTHIS(SvLBoxBmp,0);
308cdf0e10cSrcweir 	aBmp = aBitmap;
309cdf0e10cSrcweir }
310cdf0e10cSrcweir 
InitViewData(SvLBox * pView,SvLBoxEntry * pEntry,SvViewDataItem * pViewData)311cdf0e10cSrcweir void SvLBoxBmp::InitViewData( SvLBox* pView,SvLBoxEntry* pEntry,
312cdf0e10cSrcweir 	SvViewDataItem* pViewData)
313cdf0e10cSrcweir {
314cdf0e10cSrcweir 	DBG_CHKTHIS(SvLBoxBmp,0);
315cdf0e10cSrcweir 	if( !pViewData )
316cdf0e10cSrcweir 		pViewData = pView->GetViewDataItem( pEntry, this );
317cdf0e10cSrcweir 	pViewData->aSize = aBmp.GetSizePixel();
318cdf0e10cSrcweir }
319cdf0e10cSrcweir 
Paint(const Point & rPos,SvLBox & rDev,sal_uInt16,SvLBoxEntry *)320cdf0e10cSrcweir void SvLBoxBmp::Paint( const Point& rPos, SvLBox& rDev, sal_uInt16 /* nFlags */,
321cdf0e10cSrcweir 						SvLBoxEntry* )
322cdf0e10cSrcweir {
323cdf0e10cSrcweir 	DBG_CHKTHIS(SvLBoxBmp,0);
324cdf0e10cSrcweir 	sal_uInt16 nStyle = rDev.IsEnabled() ? 0 : IMAGE_DRAW_DISABLE;
325cdf0e10cSrcweir 	rDev.DrawImage( rPos, aBmp ,nStyle);
326cdf0e10cSrcweir }
327cdf0e10cSrcweir 
Create() const328cdf0e10cSrcweir SvLBoxItem* SvLBoxBmp::Create() const
329cdf0e10cSrcweir {
330cdf0e10cSrcweir 	DBG_CHKTHIS(SvLBoxBmp,0);
331cdf0e10cSrcweir 	return new SvLBoxBmp;
332cdf0e10cSrcweir }
333cdf0e10cSrcweir 
Clone(SvLBoxItem * pSource)334cdf0e10cSrcweir void SvLBoxBmp::Clone( SvLBoxItem* pSource )
335cdf0e10cSrcweir {
336cdf0e10cSrcweir 	DBG_CHKTHIS(SvLBoxBmp,0);
337cdf0e10cSrcweir 	aBmp = ((SvLBoxBmp*)pSource)->aBmp;
338cdf0e10cSrcweir }
339cdf0e10cSrcweir 
340cdf0e10cSrcweir // ***************************************************************
341cdf0e10cSrcweir // class SvLBoxButton
342cdf0e10cSrcweir // ***************************************************************
343cdf0e10cSrcweir 
344cdf0e10cSrcweir DBG_NAME(SvLBoxButton);
345cdf0e10cSrcweir 
SvLBoxButton(SvLBoxEntry * pEntry,SvLBoxButtonKind eTheKind,sal_uInt16 nFlags,SvLBoxButtonData * pBData)346cdf0e10cSrcweir SvLBoxButton::SvLBoxButton( SvLBoxEntry* pEntry, SvLBoxButtonKind eTheKind,
347cdf0e10cSrcweir                             sal_uInt16 nFlags, SvLBoxButtonData* pBData )
348cdf0e10cSrcweir 	: SvLBoxItem( pEntry, nFlags )
349cdf0e10cSrcweir {
350cdf0e10cSrcweir 	DBG_CTOR(SvLBoxButton,0);
351cdf0e10cSrcweir     eKind = eTheKind;
352cdf0e10cSrcweir 	nBaseOffs = 0;
353cdf0e10cSrcweir 	nItemFlags = 0;
354cdf0e10cSrcweir 	SetStateUnchecked();
355cdf0e10cSrcweir 	pData = pBData;
356cdf0e10cSrcweir }
357cdf0e10cSrcweir 
SvLBoxButton()358cdf0e10cSrcweir SvLBoxButton::SvLBoxButton() : SvLBoxItem()
359cdf0e10cSrcweir {
360cdf0e10cSrcweir 	DBG_CTOR(SvLBoxButton,0);
361cdf0e10cSrcweir     eKind = SvLBoxButtonKind_enabledCheckbox;
362cdf0e10cSrcweir 	nItemFlags = 0;
363cdf0e10cSrcweir 	SetStateUnchecked();
364cdf0e10cSrcweir }
365cdf0e10cSrcweir 
~SvLBoxButton()366cdf0e10cSrcweir SvLBoxButton::~SvLBoxButton()
367cdf0e10cSrcweir {
368cdf0e10cSrcweir 	DBG_DTOR(SvLBoxButton,0);
369cdf0e10cSrcweir }
370cdf0e10cSrcweir 
IsA()371cdf0e10cSrcweir sal_uInt16 SvLBoxButton::IsA()
372cdf0e10cSrcweir {
373cdf0e10cSrcweir 	DBG_CHKTHIS(SvLBoxButton,0);
374cdf0e10cSrcweir 	return SV_ITEM_ID_LBOXBUTTON;
375cdf0e10cSrcweir }
376cdf0e10cSrcweir 
Check(SvLBox *,SvLBoxEntry *,sal_Bool bOn)377cdf0e10cSrcweir void SvLBoxButton::Check(SvLBox*, SvLBoxEntry*, sal_Bool bOn)
378cdf0e10cSrcweir {
379cdf0e10cSrcweir 	DBG_CHKTHIS(SvLBoxButton,0);
380cdf0e10cSrcweir 	if ( bOn != IsStateChecked() )
381cdf0e10cSrcweir 	{
382cdf0e10cSrcweir 		if ( bOn )
383cdf0e10cSrcweir 			SetStateChecked();
384cdf0e10cSrcweir 		else
385cdf0e10cSrcweir 			SetStateUnchecked();
386cdf0e10cSrcweir 	}
387cdf0e10cSrcweir }
388cdf0e10cSrcweir 
ClickHdl(SvLBox *,SvLBoxEntry * pEntry)389cdf0e10cSrcweir sal_Bool SvLBoxButton::ClickHdl( SvLBox*, SvLBoxEntry* pEntry )
390cdf0e10cSrcweir {
391cdf0e10cSrcweir 	DBG_CHKTHIS(SvLBoxButton,0);
392cdf0e10cSrcweir     if ( CheckModification() )
393cdf0e10cSrcweir     {
394cdf0e10cSrcweir         if ( IsStateChecked() )
395cdf0e10cSrcweir             SetStateUnchecked();
396cdf0e10cSrcweir         else
397cdf0e10cSrcweir             SetStateChecked();
398cdf0e10cSrcweir         pData->StoreButtonState( pEntry, nItemFlags );
399cdf0e10cSrcweir         pData->CallLink();
400cdf0e10cSrcweir     }
401cdf0e10cSrcweir 	return sal_False;
402cdf0e10cSrcweir }
403cdf0e10cSrcweir 
Paint(const Point & rPos,SvLBox & rDev,sal_uInt16,SvLBoxEntry *)404cdf0e10cSrcweir void SvLBoxButton::Paint( const Point& rPos, SvLBox& rDev, sal_uInt16 /* nFlags */,
405cdf0e10cSrcweir 							SvLBoxEntry* /*pEntry*/ )
406cdf0e10cSrcweir {
407cdf0e10cSrcweir 	DBG_CHKTHIS(SvLBoxButton,0);
408cdf0e10cSrcweir 	sal_uInt16 nIndex = eKind == SvLBoxButtonKind_staticImage
409cdf0e10cSrcweir         ? SV_BMP_STATICIMAGE : pData->GetIndex( nItemFlags );
410cdf0e10cSrcweir 	sal_uInt16 nStyle = eKind != SvLBoxButtonKind_disabledCheckbox &&
411cdf0e10cSrcweir         rDev.IsEnabled() ? 0 : IMAGE_DRAW_DISABLE;
412cdf0e10cSrcweir 
413cdf0e10cSrcweir ///
414cdf0e10cSrcweir //Native drawing
415cdf0e10cSrcweir ///
416cdf0e10cSrcweir     sal_Bool bNativeOK = sal_False;
417cdf0e10cSrcweir 	ControlType eCtrlType = (pData->IsRadio())? CTRL_RADIOBUTTON : CTRL_CHECKBOX;
418cdf0e10cSrcweir     if ( nIndex != SV_BMP_STATICIMAGE && rDev.IsNativeControlSupported( eCtrlType, PART_ENTIRE_CONTROL) )
419cdf0e10cSrcweir     {
420cdf0e10cSrcweir         Size aSize(pData->Width(), pData->Height());
421cdf0e10cSrcweir         ImplAdjustBoxSize( aSize, eCtrlType, &rDev );
422cdf0e10cSrcweir         ImplControlValue    aControlValue;
423cdf0e10cSrcweir         Rectangle           aCtrlRegion( rPos, aSize );
424cdf0e10cSrcweir         ControlState        nState = 0;
425cdf0e10cSrcweir 
426cdf0e10cSrcweir         //states CTRL_STATE_DEFAULT, CTRL_STATE_PRESSED and CTRL_STATE_ROLLOVER are not implemented
427cdf0e10cSrcweir         if ( IsStateHilighted() ) 					nState |= CTRL_STATE_FOCUSED;
428cdf0e10cSrcweir         if ( nStyle != IMAGE_DRAW_DISABLE )			nState |= CTRL_STATE_ENABLED;
429cdf0e10cSrcweir 
430cdf0e10cSrcweir         if ( IsStateChecked() )
431cdf0e10cSrcweir             aControlValue.setTristateVal( BUTTONVALUE_ON );
432cdf0e10cSrcweir         else if ( IsStateUnchecked() )
433cdf0e10cSrcweir             aControlValue.setTristateVal( BUTTONVALUE_OFF );
434cdf0e10cSrcweir         else if ( IsStateTristate() )
435cdf0e10cSrcweir             aControlValue.setTristateVal( BUTTONVALUE_MIXED );
436cdf0e10cSrcweir 
437cdf0e10cSrcweir         bNativeOK = rDev.DrawNativeControl( eCtrlType, PART_ENTIRE_CONTROL,
438cdf0e10cSrcweir                                 aCtrlRegion, nState, aControlValue, rtl::OUString() );
439cdf0e10cSrcweir     }
440cdf0e10cSrcweir 
441cdf0e10cSrcweir     if( !bNativeOK)
442cdf0e10cSrcweir         rDev.DrawImage( rPos, pData->aBmps[nIndex + nBaseOffs] ,nStyle);
443cdf0e10cSrcweir }
444cdf0e10cSrcweir 
Create() const445cdf0e10cSrcweir SvLBoxItem* SvLBoxButton::Create() const
446cdf0e10cSrcweir {
447cdf0e10cSrcweir 	DBG_CHKTHIS(SvLBoxButton,0);
448cdf0e10cSrcweir 	return new SvLBoxButton;
449cdf0e10cSrcweir }
450cdf0e10cSrcweir 
Clone(SvLBoxItem * pSource)451cdf0e10cSrcweir void SvLBoxButton::Clone( SvLBoxItem* pSource )
452cdf0e10cSrcweir {
453cdf0e10cSrcweir 	DBG_CHKTHIS(SvLBoxButton,0);
454cdf0e10cSrcweir 	pData = ((SvLBoxButton*)pSource)->pData;
455cdf0e10cSrcweir }
456cdf0e10cSrcweir 
ImplAdjustBoxSize(Size & io_rSize,ControlType i_eType,Window * i_pParent)457cdf0e10cSrcweir void SvLBoxButton::ImplAdjustBoxSize( Size& io_rSize, ControlType i_eType, Window* i_pParent )
458cdf0e10cSrcweir {
459cdf0e10cSrcweir     if ( i_pParent->IsNativeControlSupported( i_eType, PART_ENTIRE_CONTROL) )
460cdf0e10cSrcweir     {
461cdf0e10cSrcweir         ImplControlValue    aControlValue;
462cdf0e10cSrcweir         Rectangle           aCtrlRegion( Point( 0, 0 ), io_rSize );
463cdf0e10cSrcweir         ControlState        nState = CTRL_STATE_ENABLED;
464cdf0e10cSrcweir 
465cdf0e10cSrcweir         aControlValue.setTristateVal( BUTTONVALUE_ON );
466cdf0e10cSrcweir 
467cdf0e10cSrcweir         Rectangle aNativeBounds, aNativeContent;
468cdf0e10cSrcweir         bool bNativeOK = i_pParent->GetNativeControlRegion( i_eType,
469cdf0e10cSrcweir                                                             PART_ENTIRE_CONTROL,
470cdf0e10cSrcweir                                                             aCtrlRegion,
471cdf0e10cSrcweir                                                             nState,
472cdf0e10cSrcweir                                                             aControlValue,
473cdf0e10cSrcweir                                                             rtl::OUString(),
474cdf0e10cSrcweir                                                             aNativeBounds,
475cdf0e10cSrcweir                                                             aNativeContent );
476cdf0e10cSrcweir 		if( bNativeOK )
477cdf0e10cSrcweir 		{
478cdf0e10cSrcweir 		    Size aContentSize( aNativeContent.GetSize() );
479cdf0e10cSrcweir 		    // leave a little space around the box image (looks better
480cdf0e10cSrcweir 		    if( aContentSize.Height() + 2 > io_rSize.Height() )
481cdf0e10cSrcweir 		        io_rSize.Height() = aContentSize.Height() + 2;
482cdf0e10cSrcweir 		}
483cdf0e10cSrcweir     }
484cdf0e10cSrcweir }
485cdf0e10cSrcweir 
InitViewData(SvLBox * pView,SvLBoxEntry * pEntry,SvViewDataItem * pViewData)486cdf0e10cSrcweir void SvLBoxButton::InitViewData( SvLBox* pView,SvLBoxEntry* pEntry,
487cdf0e10cSrcweir 	SvViewDataItem* pViewData )
488cdf0e10cSrcweir {
489cdf0e10cSrcweir 	DBG_CHKTHIS(SvLBoxButton,0);
490cdf0e10cSrcweir 	if( !pViewData )
491cdf0e10cSrcweir 		pViewData = pView->GetViewDataItem( pEntry, this );
492cdf0e10cSrcweir 	Size aSize( pData->Width(), pData->Height() );
493cdf0e10cSrcweir 
494cdf0e10cSrcweir 	ControlType eCtrlType = (pData->IsRadio())? CTRL_RADIOBUTTON : CTRL_CHECKBOX;
495cdf0e10cSrcweir     if ( eKind != SvLBoxButtonKind_staticImage && pView )
496cdf0e10cSrcweir         ImplAdjustBoxSize( aSize, eCtrlType, pView );
497cdf0e10cSrcweir 	pViewData->aSize = aSize;
498cdf0e10cSrcweir }
499cdf0e10cSrcweir 
CheckModification() const500cdf0e10cSrcweir bool SvLBoxButton::CheckModification() const
501cdf0e10cSrcweir {
502cdf0e10cSrcweir     if( eKind == SvLBoxButtonKind_disabledCheckbox )
503cdf0e10cSrcweir         Sound::Beep();
504cdf0e10cSrcweir     return eKind == SvLBoxButtonKind_enabledCheckbox;
505cdf0e10cSrcweir }
506cdf0e10cSrcweir 
507cdf0e10cSrcweir // ***************************************************************
508cdf0e10cSrcweir // class SvLBoxContextBmp
509cdf0e10cSrcweir // ***************************************************************
510cdf0e10cSrcweir 
511cdf0e10cSrcweir struct SvLBoxContextBmp_Impl
512cdf0e10cSrcweir {
513cdf0e10cSrcweir 	Image		m_aImage1;
514cdf0e10cSrcweir 	Image		m_aImage2;
515cdf0e10cSrcweir 
516cdf0e10cSrcweir 	Image		m_aImage1_hc;
517cdf0e10cSrcweir 	Image		m_aImage2_hc;
518cdf0e10cSrcweir 
519cdf0e10cSrcweir 	sal_uInt16		m_nB2IndicatorFlags;
520cdf0e10cSrcweir };
521cdf0e10cSrcweir 
522cdf0e10cSrcweir // ***************************************************************
DBG_NAME(SvLBoxContextBmp)523cdf0e10cSrcweir DBG_NAME(SvLBoxContextBmp)
524cdf0e10cSrcweir 
525cdf0e10cSrcweir SvLBoxContextBmp::SvLBoxContextBmp( SvLBoxEntry* pEntry, sal_uInt16 nItemFlags,
526cdf0e10cSrcweir 	Image aBmp1, Image aBmp2, sal_uInt16 nEntryFlags )
527cdf0e10cSrcweir 	:SvLBoxItem( pEntry, nItemFlags )
528cdf0e10cSrcweir 	,m_pImpl( new SvLBoxContextBmp_Impl )
529cdf0e10cSrcweir {
530cdf0e10cSrcweir 	DBG_CTOR(SvLBoxContextBmp,0);
531cdf0e10cSrcweir 
532cdf0e10cSrcweir 	m_pImpl->m_nB2IndicatorFlags = nEntryFlags;
533cdf0e10cSrcweir 	SetModeImages( aBmp1, aBmp2 );
534cdf0e10cSrcweir }
535cdf0e10cSrcweir 
SvLBoxContextBmp()536cdf0e10cSrcweir SvLBoxContextBmp::SvLBoxContextBmp()
537cdf0e10cSrcweir 	:SvLBoxItem( )
538cdf0e10cSrcweir 	,m_pImpl( new SvLBoxContextBmp_Impl )
539cdf0e10cSrcweir {
540cdf0e10cSrcweir 	m_pImpl->m_nB2IndicatorFlags = 0;
541cdf0e10cSrcweir 	DBG_CTOR(SvLBoxContextBmp,0);
542cdf0e10cSrcweir }
543cdf0e10cSrcweir 
~SvLBoxContextBmp()544cdf0e10cSrcweir SvLBoxContextBmp::~SvLBoxContextBmp()
545cdf0e10cSrcweir {
546cdf0e10cSrcweir 	delete m_pImpl;
547cdf0e10cSrcweir 	DBG_DTOR(SvLBoxContextBmp,0);
548cdf0e10cSrcweir }
549cdf0e10cSrcweir 
IsA()550cdf0e10cSrcweir sal_uInt16 SvLBoxContextBmp::IsA()
551cdf0e10cSrcweir {
552cdf0e10cSrcweir 	DBG_CHKTHIS(SvLBoxContextBmp,0);
553cdf0e10cSrcweir 	return SV_ITEM_ID_LBOXCONTEXTBMP;
554cdf0e10cSrcweir }
555cdf0e10cSrcweir 
SetModeImages(const Image & _rBitmap1,const Image & _rBitmap2,BmpColorMode _eMode)556cdf0e10cSrcweir sal_Bool SvLBoxContextBmp::SetModeImages( const Image& _rBitmap1, const Image& _rBitmap2, BmpColorMode _eMode )
557cdf0e10cSrcweir {
558cdf0e10cSrcweir 	DBG_CHKTHIS(SvLBoxContextBmp,0);
559cdf0e10cSrcweir 
560cdf0e10cSrcweir 	sal_Bool bSuccess = sal_True;
561cdf0e10cSrcweir 	switch ( _eMode )
562cdf0e10cSrcweir 	{
563cdf0e10cSrcweir 		case BMP_COLOR_NORMAL:
564cdf0e10cSrcweir 			m_pImpl->m_aImage1 = _rBitmap1;
565cdf0e10cSrcweir 			m_pImpl->m_aImage2 = _rBitmap2;
566cdf0e10cSrcweir 			break;
567cdf0e10cSrcweir 
568cdf0e10cSrcweir 		case BMP_COLOR_HIGHCONTRAST:
569cdf0e10cSrcweir 			m_pImpl->m_aImage1_hc = _rBitmap1;
570cdf0e10cSrcweir 			m_pImpl->m_aImage2_hc = _rBitmap2;
571cdf0e10cSrcweir 			break;
572cdf0e10cSrcweir 
573cdf0e10cSrcweir 		default:
574cdf0e10cSrcweir 			DBG_ERROR( "SvLBoxContextBmp::SetModeImages: unexpected mode!");
575cdf0e10cSrcweir 			bSuccess = sal_False;
576cdf0e10cSrcweir 			break;
577cdf0e10cSrcweir 	}
578cdf0e10cSrcweir 	return bSuccess;
579cdf0e10cSrcweir }
580cdf0e10cSrcweir 
implGetImageStore(sal_Bool _bFirst,BmpColorMode _eMode)581cdf0e10cSrcweir Image& SvLBoxContextBmp::implGetImageStore( sal_Bool _bFirst, BmpColorMode _eMode )
582cdf0e10cSrcweir {
583cdf0e10cSrcweir 	DBG_CHKTHIS(SvLBoxContextBmp,0);
584cdf0e10cSrcweir 
585cdf0e10cSrcweir 	switch ( _eMode )
586cdf0e10cSrcweir 	{
587cdf0e10cSrcweir 		case BMP_COLOR_NORMAL:
588cdf0e10cSrcweir 			return _bFirst ? m_pImpl->m_aImage1 : m_pImpl->m_aImage2;
589cdf0e10cSrcweir 
590cdf0e10cSrcweir 		case BMP_COLOR_HIGHCONTRAST:
591cdf0e10cSrcweir 			return _bFirst ? m_pImpl->m_aImage1_hc : m_pImpl->m_aImage2_hc;
592cdf0e10cSrcweir 
593cdf0e10cSrcweir 		default:
594cdf0e10cSrcweir 			DBG_ERROR( "SvLBoxContextBmp::implGetImageStore: unexpected mode!");
595cdf0e10cSrcweir 	}
596cdf0e10cSrcweir 
597cdf0e10cSrcweir 	// OJ: #i27071# wrong mode so we just return the normal images
598cdf0e10cSrcweir     return _bFirst ? m_pImpl->m_aImage1 : m_pImpl->m_aImage2;
599cdf0e10cSrcweir }
600cdf0e10cSrcweir 
InitViewData(SvLBox * pView,SvLBoxEntry * pEntry,SvViewDataItem * pViewData)601cdf0e10cSrcweir void SvLBoxContextBmp::InitViewData( SvLBox* pView,SvLBoxEntry* pEntry,
602cdf0e10cSrcweir 	SvViewDataItem* pViewData)
603cdf0e10cSrcweir {
604cdf0e10cSrcweir 	DBG_CHKTHIS(SvLBoxContextBmp,0);
605cdf0e10cSrcweir 	if( !pViewData )
606cdf0e10cSrcweir 		pViewData = pView->GetViewDataItem( pEntry, this );
607cdf0e10cSrcweir 	pViewData->aSize = m_pImpl->m_aImage1.GetSizePixel();
608cdf0e10cSrcweir }
609cdf0e10cSrcweir 
Paint(const Point & _rPos,SvLBox & _rDev,sal_uInt16 _nViewDataEntryFlags,SvLBoxEntry * _pEntry)610cdf0e10cSrcweir void SvLBoxContextBmp::Paint( const Point& _rPos, SvLBox& _rDev,
611cdf0e10cSrcweir 	sal_uInt16 _nViewDataEntryFlags, SvLBoxEntry* _pEntry )
612cdf0e10cSrcweir {
613cdf0e10cSrcweir 	DBG_CHKTHIS(SvLBoxContextBmp,0);
614cdf0e10cSrcweir 
615cdf0e10cSrcweir 	// determine the image set
616cdf0e10cSrcweir 	BmpColorMode eMode( BMP_COLOR_NORMAL );
617cdf0e10cSrcweir 	if ( !!m_pImpl->m_aImage1_hc )
618cdf0e10cSrcweir 	{	// we really have HC images
619cdf0e10cSrcweir 		if ( _rDev.GetSettings().GetStyleSettings().GetHighContrastMode() )
620cdf0e10cSrcweir 			eMode = BMP_COLOR_HIGHCONTRAST;
621cdf0e10cSrcweir 	}
622cdf0e10cSrcweir 
623cdf0e10cSrcweir 	// get the image
624cdf0e10cSrcweir 	const Image& rImage = implGetImageStore( 0 == ( _nViewDataEntryFlags & m_pImpl->m_nB2IndicatorFlags ), eMode );
625cdf0e10cSrcweir 
626cdf0e10cSrcweir 	sal_Bool _bSemiTransparent = _pEntry && ( 0 != ( SV_ENTRYFLAG_SEMITRANSPARENT  & _pEntry->GetFlags( ) ) );
627cdf0e10cSrcweir 	// draw
628cdf0e10cSrcweir 	sal_uInt16 nStyle = _rDev.IsEnabled() ? 0 : IMAGE_DRAW_DISABLE;
629cdf0e10cSrcweir 	if ( _bSemiTransparent )
630cdf0e10cSrcweir 		nStyle |= IMAGE_DRAW_SEMITRANSPARENT;
631cdf0e10cSrcweir 	_rDev.DrawImage( _rPos, rImage, nStyle);
632cdf0e10cSrcweir }
633cdf0e10cSrcweir 
Create() const634cdf0e10cSrcweir SvLBoxItem* SvLBoxContextBmp::Create() const
635cdf0e10cSrcweir {
636cdf0e10cSrcweir 	DBG_CHKTHIS(SvLBoxContextBmp,0);
637cdf0e10cSrcweir 	return new SvLBoxContextBmp;
638cdf0e10cSrcweir }
639cdf0e10cSrcweir 
Clone(SvLBoxItem * pSource)640cdf0e10cSrcweir void SvLBoxContextBmp::Clone( SvLBoxItem* pSource )
641cdf0e10cSrcweir {
642cdf0e10cSrcweir 	DBG_CHKTHIS(SvLBoxContextBmp,0);
643cdf0e10cSrcweir 	m_pImpl->m_aImage1 = static_cast< SvLBoxContextBmp* >( pSource )->m_pImpl->m_aImage1;
644cdf0e10cSrcweir 	m_pImpl->m_aImage2 = static_cast< SvLBoxContextBmp* >( pSource )->m_pImpl->m_aImage2;
645cdf0e10cSrcweir 	m_pImpl->m_nB2IndicatorFlags = static_cast< SvLBoxContextBmp* >( pSource )->m_pImpl->m_nB2IndicatorFlags;
646cdf0e10cSrcweir }
647cdf0e10cSrcweir 
648