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 437 : ScDrawObjFactory::ScDrawObjFactory()
25 : {
26 437 : SdrObjFactory::InsertMakeUserDataHdl( LINK ( this, ScDrawObjFactory, MakeUserData ) );
27 437 : }
28 :
29 432 : ScDrawObjFactory::~ScDrawObjFactory()
30 : {
31 432 : SdrObjFactory::RemoveMakeUserDataHdl( LINK ( this, ScDrawObjFactory, MakeUserData ) );
32 432 : }
33 :
34 0 : IMPL_STATIC_LINK(
35 : ScDrawObjFactory, MakeUserData, SdrObjFactory *, pObjFactory )
36 : {
37 0 : if ( pObjFactory->nInventor == SC_DRAWLAYER )
38 : {
39 0 : if ( pObjFactory->nIdentifier == SC_UD_OBJDATA )
40 0 : pObjFactory->pNewData = new ScDrawObjData;
41 0 : else if ( pObjFactory->nIdentifier == SC_UD_IMAPDATA )
42 0 : pObjFactory->pNewData = new ScIMapInfo;
43 0 : else if ( pObjFactory->nIdentifier == SC_UD_MACRODATA )
44 0 : pObjFactory->pNewData = new ScMacroInfo;
45 : else
46 : {
47 : OSL_FAIL("MakeUserData: wrong ID");
48 : }
49 : }
50 0 : return 0;
51 : }
52 :
53 1289 : ScDrawObjData::ScDrawObjData() :
54 : SdrObjUserData( SC_DRAWLAYER, SC_UD_OBJDATA, 0 ),
55 : maStart( ScAddress::INITIALIZE_INVALID ),
56 : maEnd( ScAddress::INITIALIZE_INVALID ),
57 1289 : meType( DrawingObject )
58 : {
59 1289 : }
60 :
61 5 : ScDrawObjData* ScDrawObjData::Clone( SdrObject* ) const
62 : {
63 5 : 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 4 : ScMacroInfo::ScMacroInfo() :
93 4 : SdrObjUserData( SC_DRAWLAYER, SC_UD_MACRODATA, 0 )
94 : {
95 4 : }
96 :
97 8 : ScMacroInfo::~ScMacroInfo()
98 : {
99 8 : }
100 :
101 0 : SdrObjUserData* ScMacroInfo::Clone( SdrObject* /*pObj*/ ) const
102 : {
103 0 : return new ScMacroInfo( *this );
104 156 : }
105 :
106 : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|