LibreOffice Module svl (master) 1
visitem.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 <sal/config.h>
21
22#include <string_view>
23
24#include <svl/visitem.hxx>
25#include <com/sun/star/uno/Any.hxx>
26#include <osl/diagnose.h>
27
28
29// virtual
31{
32 assert(SfxPoolItem::operator==(rItem));
33 return m_nValue.bVisible == static_cast< const SfxVisibilityItem * >(&rItem)->
34 m_nValue.bVisible;
35}
36
37// virtual
40 OUString & rText,
41 const IntlWrapper&) const
42{
43 rText = m_nValue.bVisible ? std::u16string_view(u"TRUE") : std::u16string_view(u"FALSE");
44 return true;
45}
46
47
48// virtual
49bool SfxVisibilityItem::QueryValue(css::uno::Any& rVal, sal_uInt8) const
50{
51 rVal <<= m_nValue;
52 return true;
53}
54
55// virtual
56bool SfxVisibilityItem::PutValue(const css::uno::Any& rVal, sal_uInt8)
57{
58 if (rVal >>= m_nValue)
59 return true;
60
61 OSL_FAIL( "SfxInt16Item::PutValue - Wrong type!" );
62 return false;
63}
64
65// virtual
67{
68 return new SfxVisibilityItem(*this);
69}
70
71/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
Base class for providers of defaults of SfxPoolItems.
Definition: itempool.hxx:51
virtual bool QueryValue(css::uno::Any &rVal, sal_uInt8 nMemberId=0) const override
Definition: visitem.cxx:49
SfxVisibilityItem(sal_uInt16 which, bool bVisible)
Definition: visitem.hxx:33
virtual bool GetPresentation(SfxItemPresentation, MapUnit, MapUnit, OUString &rText, const IntlWrapper &) const override
This virtual method allows to get a textual representation of the value for the SfxPoolItem subclasse...
Definition: visitem.cxx:38
virtual SfxVisibilityItem * Clone(SfxItemPool *=nullptr) const override
Definition: visitem.cxx:66
virtual bool PutValue(const css::uno::Any &rVal, sal_uInt8 nMemberId) override
Definition: visitem.cxx:56
css::frame::status::Visibility m_nValue
Definition: visitem.hxx:29
virtual bool operator==(const SfxPoolItem &rItem) const override
Definition: visitem.cxx:30
float u
MapUnit
SfxItemPresentation
Definition: poolitem.hxx:72
unsigned char sal_uInt8