Update ooo320-m1
[ooovba.git] / sc / source / ui / view / drawattr.cxx
blob4cffc5b48c628e1e347df21963f3c163b6455a01
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: drawattr.cxx,v $
10 * $Revision: 1.5 $
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_sc.hxx"
35 #include "drawattr.hxx"
36 #include "global.hxx"
38 //------------------------------------------------------------------------
40 String __EXPORT SvxDrawToolItem::GetValueText() const
42 return GetValueText(GetValue());
45 //------------------------------------------------------------------------
47 String __EXPORT SvxDrawToolItem::GetValueText( USHORT nVal ) const
49 const sal_Char* p;
51 switch (nVal)
53 case 0 : p = "SVX_SNAP_DRAW_SELECT" ; break;
55 case 1 : p = "SVX_SNAP_DRAW_LINE" ; break;
56 case 2 : p = "SVX_SNAP_DRAW_RECT" ; break;
57 case 3 : p = "SVX_SNAP_DRAW_ELLIPSE" ; break;
58 case 4 : p = "SVX_SNAP_DRAW_POLYGON" ; break;
59 case 5 : p = "SVX_SNAP_DRAW_ARC" ; break;
60 case 6 : p = "SVX_SNAP_DRAW_PIE" ; break;
61 case 7 : p = "SVX_SNAP_DRAW_CIRCLECUT" ; break;
62 case 8 : p = "SVX_SNAP_DRAW_TEXT" ; break;
63 default : return EMPTY_STRING;
65 return String::CreateFromAscii( p );
68 //------------------------------------------------------------------------
70 SfxPoolItem* __EXPORT SvxDrawToolItem::Clone( SfxItemPool * ) const
72 return new SvxDrawToolItem(*this);
75 //------------------------------------------------------------------------
77 SfxPoolItem* __EXPORT SvxDrawToolItem::Create( SvStream& rStream, USHORT nVer ) const
79 USHORT nVal;
80 rStream >> nVal;
81 return new SvxDrawToolItem(nVal);