update dev300-m58
[ooovba.git] / sc / source / core / data / userdat.cxx
blob4046af115bcfc00c5ad2fbbe9ca40ec91b455cfb
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: userdat.cxx,v $
10 * $Revision: 1.12.128.1 $
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"
34 // -----------------------------------------------------------------------
36 #include "userdat.hxx"
37 #include <tools/debug.hxx>
38 #include "drwlayer.hxx"
39 #include "rechead.hxx"
41 // -----------------------------------------------------------------------
43 ScDrawObjFactory::ScDrawObjFactory()
45 SdrObjFactory::InsertMakeUserDataHdl( LINK ( this, ScDrawObjFactory, MakeUserData ) );
48 ScDrawObjFactory::~ScDrawObjFactory()
50 SdrObjFactory::RemoveMakeUserDataHdl( LINK ( this, ScDrawObjFactory, MakeUserData ) );
53 IMPL_LINK_INLINE_START( ScDrawObjFactory, MakeUserData, SdrObjFactory *, pObjFactory )
55 if ( pObjFactory->nInventor == SC_DRAWLAYER )
57 if ( pObjFactory->nIdentifier == SC_UD_OBJDATA )
58 pObjFactory->pNewData = new ScDrawObjData;
59 else if ( pObjFactory->nIdentifier == SC_UD_IMAPDATA )
60 pObjFactory->pNewData = new ScIMapInfo;
61 else if ( pObjFactory->nIdentifier == SC_UD_MACRODATA )
62 pObjFactory->pNewData = new ScMacroInfo;
63 else
65 DBG_ERROR("MakeUserData: falsche ID");
68 return 0;
70 IMPL_LINK_INLINE_END( ScDrawObjFactory, MakeUserData, SdrObjFactory *, pObjFactory )
72 //------------------------------------------------------------------------
74 ScDrawObjData::ScDrawObjData() :
75 SdrObjUserData( SC_DRAWLAYER, SC_UD_OBJDATA, 0 ),
76 maStart( ScAddress::INITIALIZE_INVALID ),
77 maEnd( ScAddress::INITIALIZE_INVALID ),
78 mbNote( false )
82 ScDrawObjData* ScDrawObjData::Clone( SdrObject* ) const
84 return new ScDrawObjData( *this );
87 //------------------------------------------------------------------------
89 ScIMapInfo::ScIMapInfo() :
90 SdrObjUserData( SC_DRAWLAYER, SC_UD_IMAPDATA, 0 )
94 ScIMapInfo::ScIMapInfo( const ImageMap& rImageMap ) :
95 SdrObjUserData( SC_DRAWLAYER, SC_UD_IMAPDATA, 0 ),
96 aImageMap( rImageMap )
100 ScIMapInfo::ScIMapInfo( const ScIMapInfo& rIMapInfo ) :
101 SdrObjUserData( rIMapInfo ),
102 aImageMap( rIMapInfo.aImageMap )
106 ScIMapInfo::~ScIMapInfo()
110 SdrObjUserData* ScIMapInfo::Clone( SdrObject* ) const
112 return new ScIMapInfo( *this );
115 //------------------------------------------------------------------------
117 ScMacroInfo::ScMacroInfo() :
118 SdrObjUserData( SC_DRAWLAYER, SC_UD_MACRODATA, 0 )
122 ScMacroInfo::~ScMacroInfo()
126 SdrObjUserData* ScMacroInfo::Clone( SdrObject* /*pObj*/ ) const
128 return new ScMacroInfo( *this );