1 /************************************************************** 2 * 3 * Licensed to the Apache Software Foundation (ASF) under one 4 * or more contributor license agreements. See the NOTICE file 5 * distributed with this work for additional information 6 * regarding copyright ownership. The ASF licenses this file 7 * to you under the Apache License, Version 2.0 (the 8 * "License"); you may not use this file except in compliance 9 * with the License. You may obtain a copy of the License at 10 * 11 * http://www.apache.org/licenses/LICENSE-2.0 12 * 13 * Unless required by applicable law or agreed to in writing, 14 * software distributed under the License is distributed on an 15 * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 16 * KIND, either express or implied. See the License for the 17 * specific language governing permissions and limitations 18 * under the License. 19 * 20 *************************************************************/ 21 22 23 24 // MARKER(update_precomp.py): autogen include statement, do not remove 25 #include "precompiled_sfx2.hxx" 26 27 // INCLUDE --------------------------------------------------------------- 28 29 #include "sfx2/minfitem.hxx" 30 31 // STATIC DATA ----------------------------------------------------------- 32 33 TYPEINIT1(SfxMacroInfoItem, SfxPoolItem); 34 35 // ----------------------------------------------------------------------- 36 37 SfxMacroInfoItem::SfxMacroInfoItem( 38 sal_uInt16 nWhichId, // Slot-ID 39 const BasicManager* pMgr, 40 const String &rLibName, 41 const String &rModuleName, 42 const String &rMethodName, 43 const String &rComment) : 44 SfxPoolItem(nWhichId), 45 pBasicManager(pMgr), 46 aLibName(rLibName), 47 aModuleName(rModuleName), 48 aMethodName(rMethodName), 49 aCommentText(rComment) 50 { 51 } 52 53 // ----------------------------------------------------------------------- 54 55 // copy ctor 56 57 SfxMacroInfoItem::SfxMacroInfoItem(const SfxMacroInfoItem& rCopy): 58 SfxPoolItem(rCopy), 59 pBasicManager(rCopy.pBasicManager), 60 aLibName(rCopy.aLibName), 61 aModuleName(rCopy.aModuleName), 62 aMethodName(rCopy.aMethodName), 63 aCommentText(rCopy.aCommentText) 64 { 65 } 66 67 // ----------------------------------------------------------------------- 68 69 // op == 70 71 int SfxMacroInfoItem::operator==( const SfxPoolItem& rCmp) const 72 { 73 return SfxPoolItem::operator==(rCmp) && 74 pBasicManager == ((const SfxMacroInfoItem&)rCmp).pBasicManager && 75 aLibName == ((const SfxMacroInfoItem&)rCmp).aLibName && 76 aModuleName == ((const SfxMacroInfoItem&)rCmp).aModuleName && 77 aMethodName == ((const SfxMacroInfoItem&)rCmp).aMethodName && 78 aCommentText == ((const SfxMacroInfoItem&)rCmp).aCommentText; 79 } 80 81 // ----------------------------------------------------------------------- 82 83 SfxPoolItem *SfxMacroInfoItem::Clone( SfxItemPool *) const 84 { 85 return new SfxMacroInfoItem(*this); 86 } 87 88 // ----------------------------------------------------------------------- 89 90 String SfxMacroInfoItem::GetQualifiedName() const 91 { 92 String aMacroName = aLibName; 93 aMacroName += '.'; 94 aMacroName += aModuleName; 95 aMacroName += '.'; 96 aMacroName += aMethodName; 97 return aMacroName; 98 } 99 100 101