LibreOffice Module sfx2 (master) 1
minfitem.cxx
Go to the documentation of this file.
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 <sfx2/minfitem.hxx>
21#include <sal/log.hxx>
22#include <utility>
23#include <config_features.h>
24
25#if HAVE_FEATURE_SCRIPTING
26
27SfxPoolItem* SfxMacroInfoItem::CreateDefault() { SAL_WARN( "sfx", "No SfxMacroInfItem factory available"); return nullptr; }
28
29
30SfxMacroInfoItem::SfxMacroInfoItem(
31 sal_uInt16 nWhichId, // Slot-ID
32 const BasicManager* pMgr,
33 OUString _aLibName,
34 OUString _aModuleName,
35 OUString _aMethodName,
36 OUString _aComment) :
37 SfxPoolItem(nWhichId),
38 pBasicManager(pMgr),
39 aLibName(std::move(_aLibName)),
40 aModuleName(std::move(_aModuleName)),
41 aMethodName(std::move(_aMethodName)),
42 aCommentText(std::move(_aComment))
43{
44}
45
46// op ==
47
48bool SfxMacroInfoItem::operator==( const SfxPoolItem& rCmp) const
49{
50 const SfxMacroInfoItem rItem = static_cast<const SfxMacroInfoItem&>(rCmp);
51 return SfxPoolItem::operator==(rCmp) &&
52 pBasicManager == rItem.pBasicManager &&
53 aLibName == rItem.aLibName &&
54 aModuleName == rItem.aModuleName &&
55 aMethodName == rItem.aMethodName &&
56 aCommentText == rItem.aCommentText;
57}
58
59SfxMacroInfoItem* SfxMacroInfoItem::Clone( SfxItemPool *) const
60{
61 return new SfxMacroInfoItem(*this);
62}
63
64OUString SfxMacroInfoItem::GetQualifiedName() const
65{
66 OUString aMacroName = aLibName +
67 "." +
68 aModuleName +
69 "." +
70 aMethodName;
71 return aMacroName;
72}
73
74#endif
75
76/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
virtual bool operator==(const SfxPoolItem &) const=0
#define SAL_WARN(area, stream)