Update ooo320-m1
[ooovba.git] / dbaccess / source / ui / control / listviewitems.cxx
blob9541f87790cdf42fc1097a683fb46c837535e26f
1 /*************************************************************************
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 *
5 * Copyright 2008 by Sun Microsystems, Inc.
7 * OpenOffice.org - a multi-platform office productivity suite
9 * $RCSfile: listviewitems.cxx,v $
10 * $Revision: 1.6 $
12 * This file is part of OpenOffice.org.
14 * OpenOffice.org is free software: you can redistribute it and/or modify
15 * it under the terms of the GNU Lesser General Public License version 3
16 * only, as published by the Free Software Foundation.
18 * OpenOffice.org is distributed in the hope that it will be useful,
19 * but WITHOUT ANY WARRANTY; without even the implied warranty of
20 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21 * GNU Lesser General Public License version 3 for more details
22 * (a copy is included in the LICENSE file that accompanied this code).
24 * You should have received a copy of the GNU Lesser General Public License
25 * version 3 along with OpenOffice.org. If not, see
26 * <http://www.openoffice.org/license.html>
27 * for a copy of the LGPLv3 License.
29 ************************************************************************/
31 // MARKER(update_precomp.py): autogen include statement, do not remove
32 #include "precompiled_dbaccess.hxx"
34 #ifndef _DBAUI_LISTVIEWITEMS_HXX_
35 #include "listviewitems.hxx"
36 #endif
37 //........................................................................
38 namespace dbaui
40 //........................................................................
42 //========================================================================
43 // class OBoldListboxString
44 //========================================================================
45 //------------------------------------------------------------------------
46 void OBoldListboxString::InitViewData( SvLBox* pView,SvLBoxEntry* pEntry, SvViewDataItem* _pViewData)
48 SvLBoxString::InitViewData(pView,pEntry, _pViewData);
49 if (!_pViewData)
50 _pViewData = pView->GetViewDataItem( pEntry, this );
51 pView->Push(PUSH_ALL);
52 Font aFont( pView->GetFont());
53 aFont.SetWeight(WEIGHT_BOLD);
54 pView->SetFont( aFont );
55 _pViewData->aSize = Size(pView->GetTextWidth(GetText()), pView->GetTextHeight());
56 pView->Pop();
59 //------------------------------------------------------------------------
60 USHORT OBoldListboxString::IsA()
62 return SV_ITEM_ID_BOLDLBSTRING;
65 //------------------------------------------------------------------------
66 void OBoldListboxString::Paint(const Point& rPos, SvLBox& rDev, sal_uInt16 nFlags, SvLBoxEntry* pEntry )
68 if (m_bEmphasized)
70 rDev.Push(PUSH_ALL);
71 Font aFont( rDev.GetFont());
72 aFont.SetWeight(WEIGHT_BOLD);
73 rDev.SetFont( aFont );
74 Point aPos(rPos);
75 rDev.DrawText( aPos, GetText() );
76 rDev.Pop();
78 else
79 SvLBoxString::Paint(rPos, rDev, nFlags, pEntry);
82 //........................................................................
83 } // namespace dbaui
84 //........................................................................