LibreOffice Module sw (master) 1
zorder.hxx
Go to the documentation of this file.
1/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4; fill-column: 100 -*- */
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
10#pragma once
11
13
14#include <o3tl/any.hxx>
15#include <o3tl/unreachable.hxx>
16
17#include <com/sun/star/beans/XPropertySet.hpp>
18#include <com/sun/star/beans/XPropertySetInfo.hpp>
19
20namespace sw
21{
23{
25 : m_nHeavenId(rIDDMA.GetHeavenId().get())
26 , m_nHellId(rIDDMA.GetHellId().get())
27 , m_nControlsId(rIDDMA.GetControlsId().get())
28 , m_nInvisibleHeavenId(rIDDMA.GetInvisibleHeavenId().get())
29 , m_nInvisibleHellId(rIDDMA.GetInvisibleHellId().get())
30 , m_nInvisibleControlsId(rIDDMA.GetInvisibleControlsId().get())
31 {
32 }
33
34 auto operator()(css::uno::Reference<css::beans::XPropertySet> const& xShape) -> unsigned int
35 {
36 sal_Int16 nLayerID(0);
37 if (xShape->getPropertySetInfo()->hasPropertyByName("LayerID"))
38 {
39 xShape->getPropertyValue("LayerID") >>= nLayerID;
40 if (nLayerID == m_nHellId || nLayerID == m_nInvisibleHellId)
41 {
42 return 0;
43 }
44 else if (nLayerID == m_nHeavenId || nLayerID == m_nInvisibleHeavenId)
45 {
46 return 1;
47 }
48 else if (nLayerID == m_nControlsId || nLayerID == m_nInvisibleControlsId)
49 {
50 return 2;
51 }
53 }
54 else // SwXFrame only has "Opaque"
55 {
56 if (*o3tl::doAccess<bool>(xShape->getPropertyValue("Opaque")))
57 {
58 return 1;
59 }
60 else
61 {
62 return 0;
63 }
64 }
65 }
66
67private:
68 sal_Int16 m_nHeavenId;
69 sal_Int16 m_nHellId;
70 sal_Int16 m_nControlsId;
74};
75
76} // namespace sw
77
78/* vim:set shiftwidth=4 softtabstop=4 expandtab cinoptions=b1,g0,N-s cinkeys+=0=break: */
css::uno::Reference< css::linguistic2::XProofreadingIterator > get(css::uno::Reference< css::uno::XComponentContext > const &context)
Dialog to specify the properties of date form field.
sal_Int16 m_nControlsId
Definition: zorder.hxx:70
GetZOrderLayer(IDocumentDrawModelAccess const &rIDDMA)
Definition: zorder.hxx:24
sal_Int16 m_nInvisibleHeavenId
Definition: zorder.hxx:71
sal_Int16 m_nHeavenId
Definition: zorder.hxx:68
sal_Int16 m_nHellId
Definition: zorder.hxx:69
sal_Int16 m_nInvisibleHellId
Definition: zorder.hxx:72
auto operator()(css::uno::Reference< css::beans::XPropertySet > const &xShape) -> unsigned int
Definition: zorder.hxx:34
sal_Int16 m_nInvisibleControlsId
Definition: zorder.hxx:73
#define O3TL_UNREACHABLE