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 728 : ScDrawObjFactory::ScDrawObjFactory()
25 : {
26 728 : SdrObjFactory::InsertMakeUserDataHdl( LINK ( this, ScDrawObjFactory, MakeUserData ) );
27 728 : }
28 :
29 726 : ScDrawObjFactory::~ScDrawObjFactory()
30 : {
31 726 : SdrObjFactory::RemoveMakeUserDataHdl( LINK ( this, ScDrawObjFactory, MakeUserData ) );
32 726 : }
33 :
34 0 : IMPL_LINK_INLINE_START( ScDrawObjFactory, MakeUserData, SdrObjFactory *, pObjFactory )
35 : {
36 0 : if ( pObjFactory->nInventor == SC_DRAWLAYER )
37 : {
38 0 : if ( pObjFactory->nIdentifier == SC_UD_OBJDATA )
39 0 : pObjFactory->pNewData = new ScDrawObjData;
40 0 : else if ( pObjFactory->nIdentifier == SC_UD_IMAPDATA )
41 0 : pObjFactory->pNewData = new ScIMapInfo;
42 0 : else if ( pObjFactory->nIdentifier == SC_UD_MACRODATA )
43 0 : pObjFactory->pNewData = new ScMacroInfo;
44 : else
45 : {
46 : OSL_FAIL("MakeUserData: wrong ID");
47 : }
48 : }
49 0 : return 0;
50 : }
51 0 : IMPL_LINK_INLINE_END( ScDrawObjFactory, MakeUserData, SdrObjFactory *, pObjFactory )
52 :
53 1850 : ScDrawObjData::ScDrawObjData() :
54 : SdrObjUserData( SC_DRAWLAYER, SC_UD_OBJDATA, 0 ),
55 : maStart( ScAddress::INITIALIZE_INVALID ),
56 : maEnd( ScAddress::INITIALIZE_INVALID ),
57 1850 : meType( DrawingObject )
58 : {
59 1850 : }
60 :
61 10 : ScDrawObjData* ScDrawObjData::Clone( SdrObject* ) const
62 : {
63 10 : return new ScDrawObjData( *this );
64 : }
65 :
66 0 : ScIMapInfo::ScIMapInfo() :
67 0 : SdrObjUserData( SC_DRAWLAYER, SC_UD_IMAPDATA, 0 )
68 : {
69 0 : }
70 :
71 0 : ScIMapInfo::ScIMapInfo( const ImageMap& rImageMap ) :
72 : SdrObjUserData( SC_DRAWLAYER, SC_UD_IMAPDATA, 0 ),
73 0 : aImageMap( rImageMap )
74 : {
75 0 : }
76 :
77 0 : ScIMapInfo::ScIMapInfo( const ScIMapInfo& rIMapInfo ) :
78 : SdrObjUserData( rIMapInfo ),
79 0 : aImageMap( rIMapInfo.aImageMap )
80 : {
81 0 : }
82 :
83 0 : ScIMapInfo::~ScIMapInfo()
84 : {
85 0 : }
86 :
87 0 : SdrObjUserData* ScIMapInfo::Clone( SdrObject* ) const
88 : {
89 0 : return new ScIMapInfo( *this );
90 : }
91 :
92 2 : ScMacroInfo::ScMacroInfo() :
93 2 : SdrObjUserData( SC_DRAWLAYER, SC_UD_MACRODATA, 0 )
94 : {
95 2 : }
96 :
97 4 : ScMacroInfo::~ScMacroInfo()
98 : {
99 4 : }
100 :
101 0 : SdrObjUserData* ScMacroInfo::Clone( SdrObject* /*pObj*/ ) const
102 : {
103 0 : return new ScMacroInfo( *this );
104 228 : }
105 :
106 : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|