LibreOffice Module sfx2 (master) 1
msg.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 <svl/itempool.hxx>
21#include <sfx2/msg.hxx>
22
23#include <climits>
24
26{
27 if( !nMasterSlotId && !nValue)
29 if ( nMasterSlotId && fnExec==nullptr && fnState==nullptr )
30 {
31 assert(false);
33 }
34 else
36}
37
38
39sal_uInt16 SfxSlot::GetWhich( const SfxItemPool &rPool ) const
40{
41 if ( !nMasterSlotId || nMasterSlotId == USHRT_MAX )
42 const_cast<SfxSlot*>(this) -> nMasterSlotId = rPool.GetWhich(nSlotId);
43 return nMasterSlotId;
44}
45
46OUString SfxSlot::GetCommand() const
47{
48 if("FocusToFindbar" == pUnoName)
49 return "vnd.sun.star.findbar:" + pUnoName;
50 else
51 return ".uno:" + pUnoName;
52}
53
54/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
sal_uInt16 GetWhich(sal_uInt16 nSlot, bool bDeep=true) const
Definition: msg.hxx:184
OUString pUnoName
Definition: msg.hxx:205
SfxExecFunc fnExec
Definition: msg.hxx:193
SFX2_DLLPUBLIC OUString GetCommand() const
Definition: msg.cxx:46
sal_uInt16 nSlotId
Definition: msg.hxx:186
sal_uInt16 nValue
Definition: msg.hxx:191
SfxStateFunc fnState
Definition: msg.hxx:194
SfxSlotKind GetKind() const
Definition: msg.cxx:25
sal_uInt16 GetWhich(const SfxItemPool &rPool) const
Definition: msg.cxx:39
sal_uInt16 nMasterSlotId
Definition: msg.hxx:190
SfxSlotKind
Definition: msg.hxx:87