xref: /aoo41x/main/sfx2/source/control/minfitem.cxx (revision cdf0e10c)
1 /*************************************************************************
2  *
3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4  *
5  * Copyright 2000, 2010 Oracle and/or its affiliates.
6  *
7  * OpenOffice.org - a multi-platform office productivity suite
8  *
9  * This file is part of OpenOffice.org.
10  *
11  * OpenOffice.org is free software: you can redistribute it and/or modify
12  * it under the terms of the GNU Lesser General Public License version 3
13  * only, as published by the Free Software Foundation.
14  *
15  * OpenOffice.org is distributed in the hope that it will be useful,
16  * but WITHOUT ANY WARRANTY; without even the implied warranty of
17  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
18  * GNU Lesser General Public License version 3 for more details
19  * (a copy is included in the LICENSE file that accompanied this code).
20  *
21  * You should have received a copy of the GNU Lesser General Public License
22  * version 3 along with OpenOffice.org.  If not, see
23  * <http://www.openoffice.org/license.html>
24  * for a copy of the LGPLv3 License.
25  *
26  ************************************************************************/
27 
28 // MARKER(update_precomp.py): autogen include statement, do not remove
29 #include "precompiled_sfx2.hxx"
30 
31 // INCLUDE ---------------------------------------------------------------
32 
33 #include "sfx2/minfitem.hxx"
34 
35 // STATIC DATA -----------------------------------------------------------
36 
37 TYPEINIT1(SfxMacroInfoItem, SfxPoolItem);
38 
39 // -----------------------------------------------------------------------
40 
41 SfxMacroInfoItem::SfxMacroInfoItem(
42     sal_uInt16 nWhichId,		// Slot-ID
43 	const BasicManager* pMgr,
44 	const String &rLibName,
45 	const String &rModuleName,
46 	const String &rMethodName,
47 	const String &rComment) :
48 	SfxPoolItem(nWhichId),
49 	pBasicManager(pMgr),
50 	aLibName(rLibName),
51 	aModuleName(rModuleName),
52 	aMethodName(rMethodName),
53 	aCommentText(rComment)
54 {
55 }
56 
57 // -----------------------------------------------------------------------
58 
59 // copy ctor
60 
61 SfxMacroInfoItem::SfxMacroInfoItem(const SfxMacroInfoItem& rCopy):
62 	SfxPoolItem(rCopy),
63 	pBasicManager(rCopy.pBasicManager),
64 	aLibName(rCopy.aLibName),
65 	aModuleName(rCopy.aModuleName),
66 	aMethodName(rCopy.aMethodName),
67 	aCommentText(rCopy.aCommentText)
68 {
69 }
70 
71 // -----------------------------------------------------------------------
72 
73 // op ==
74 
75 int SfxMacroInfoItem::operator==( const SfxPoolItem& rCmp) const
76 {
77 	return SfxPoolItem::operator==(rCmp) &&
78 			pBasicManager == ((const SfxMacroInfoItem&)rCmp).pBasicManager &&
79 			aLibName == ((const SfxMacroInfoItem&)rCmp).aLibName &&
80 			aModuleName == ((const SfxMacroInfoItem&)rCmp).aModuleName &&
81 			aMethodName == ((const SfxMacroInfoItem&)rCmp).aMethodName &&
82 			aCommentText == ((const SfxMacroInfoItem&)rCmp).aCommentText;
83 }
84 
85 // -----------------------------------------------------------------------
86 
87 SfxPoolItem *SfxMacroInfoItem::Clone( SfxItemPool *) const
88 {
89 	return new SfxMacroInfoItem(*this);
90 }
91 
92 // -----------------------------------------------------------------------
93 
94 String SfxMacroInfoItem::GetQualifiedName() const
95 {
96 	String aMacroName = aLibName;
97 	aMacroName += '.';
98 	aMacroName += aModuleName;
99 	aMacroName += '.';
100 	aMacroName += aMethodName;
101 	return aMacroName;
102 }
103 
104 
105