Line data Source code
1 : /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 : /*
3 : * This file is part of the LibreOffice project.
4 : *
5 : * This Source Code Form is subject to the terms of the Mozilla Public
6 : * License, v. 2.0. If a copy of the MPL was not distributed with this
7 : * file, You can obtain one at http://mozilla.org/MPL/2.0/.
8 : *
9 : * This file incorporates work covered by the following license notice:
10 : *
11 : * Licensed to the Apache Software Foundation (ASF) under one or more
12 : * contributor license agreements. See the NOTICE file distributed
13 : * with this work for additional information regarding copyright
14 : * ownership. The ASF licenses this file to you under the Apache
15 : * License, Version 2.0 (the "License"); you may not use this file
16 : * except in compliance with the License. You may obtain a copy of
17 : * the License at http://www.apache.org/licenses/LICENSE-2.0 .
18 : */
19 :
20 : #include "userdat.hxx"
21 : #include "drwlayer.hxx"
22 : #include "rechead.hxx"
23 :
24 : // -----------------------------------------------------------------------
25 :
26 29 : ScDrawObjFactory::ScDrawObjFactory()
27 : {
28 29 : SdrObjFactory::InsertMakeUserDataHdl( LINK ( this, ScDrawObjFactory, MakeUserData ) );
29 29 : }
30 :
31 26 : ScDrawObjFactory::~ScDrawObjFactory()
32 : {
33 26 : SdrObjFactory::RemoveMakeUserDataHdl( LINK ( this, ScDrawObjFactory, MakeUserData ) );
34 26 : }
35 :
36 0 : IMPL_LINK_INLINE_START( ScDrawObjFactory, MakeUserData, SdrObjFactory *, pObjFactory )
37 : {
38 0 : if ( pObjFactory->nInventor == SC_DRAWLAYER )
39 : {
40 0 : if ( pObjFactory->nIdentifier == SC_UD_OBJDATA )
41 0 : pObjFactory->pNewData = new ScDrawObjData;
42 0 : else if ( pObjFactory->nIdentifier == SC_UD_IMAPDATA )
43 0 : pObjFactory->pNewData = new ScIMapInfo;
44 0 : else if ( pObjFactory->nIdentifier == SC_UD_MACRODATA )
45 0 : pObjFactory->pNewData = new ScMacroInfo;
46 : else
47 : {
48 : OSL_FAIL("MakeUserData: falsche ID");
49 : }
50 : }
51 0 : return 0;
52 : }
53 0 : IMPL_LINK_INLINE_END( ScDrawObjFactory, MakeUserData, SdrObjFactory *, pObjFactory )
54 :
55 : //------------------------------------------------------------------------
56 :
57 13 : ScDrawObjData::ScDrawObjData() :
58 : SdrObjUserData( SC_DRAWLAYER, SC_UD_OBJDATA, 0 ),
59 : maStart( ScAddress::INITIALIZE_INVALID ),
60 : maEnd( ScAddress::INITIALIZE_INVALID ),
61 13 : meType( DrawingObject )
62 : {
63 13 : }
64 :
65 1 : ScDrawObjData* ScDrawObjData::Clone( SdrObject* ) const
66 : {
67 1 : return new ScDrawObjData( *this );
68 : }
69 :
70 : //------------------------------------------------------------------------
71 :
72 0 : ScIMapInfo::ScIMapInfo() :
73 0 : SdrObjUserData( SC_DRAWLAYER, SC_UD_IMAPDATA, 0 )
74 : {
75 0 : }
76 :
77 0 : ScIMapInfo::ScIMapInfo( const ImageMap& rImageMap ) :
78 : SdrObjUserData( SC_DRAWLAYER, SC_UD_IMAPDATA, 0 ),
79 0 : aImageMap( rImageMap )
80 : {
81 0 : }
82 :
83 0 : ScIMapInfo::ScIMapInfo( const ScIMapInfo& rIMapInfo ) :
84 : SdrObjUserData( rIMapInfo ),
85 0 : aImageMap( rIMapInfo.aImageMap )
86 : {
87 0 : }
88 :
89 0 : ScIMapInfo::~ScIMapInfo()
90 : {
91 0 : }
92 :
93 0 : SdrObjUserData* ScIMapInfo::Clone( SdrObject* ) const
94 : {
95 0 : return new ScIMapInfo( *this );
96 : }
97 :
98 : //------------------------------------------------------------------------
99 :
100 0 : ScMacroInfo::ScMacroInfo() :
101 0 : SdrObjUserData( SC_DRAWLAYER, SC_UD_MACRODATA, 0 )
102 : {
103 0 : }
104 :
105 0 : ScMacroInfo::~ScMacroInfo()
106 : {
107 0 : }
108 :
109 0 : SdrObjUserData* ScMacroInfo::Clone( SdrObject* /*pObj*/ ) const
110 : {
111 0 : return new ScMacroInfo( *this );
112 : }
113 :
114 : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|