LibreOffice Module sw (master) 1
edglbldc.hxx
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#ifndef INCLUDED_SW_INC_EDGLBLDC_HXX
20#define INCLUDED_SW_INC_EDGLBLDC_HXX
21
23
24#include "nodeoffset.hxx"
25
26class SwSection;
27class SwTOXBase;
29
34};
35
37{
40 union {
44
45public:
49
52 const SwSection* GetSection() const
53 { return GLBLDOC_SECTION == m_eType ? m_PTR.pSect : nullptr; }
54 const SwTOXBase* GetTOX() const
55 { return GLBLDOC_TOXBASE == m_eType ? m_PTR.pTOX : nullptr; }
56 SwNodeOffset GetDocPos() const { return m_nDocPos; }
57
59 bool operator==( const SwGlblDocContent& rCmp ) const
60 { return GetDocPos() == rCmp.GetDocPos(); }
61 bool operator<( const SwGlblDocContent& rCmp ) const
62 { return GetDocPos() < rCmp.GetDocPos(); }
63};
64
65class SwGlblDocContents : public o3tl::sorted_vector<std::unique_ptr<SwGlblDocContent>, o3tl::less_uniqueptr_to<SwGlblDocContent> > {};
66
67#endif
68
69/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
const SwSection * GetSection() const
Definition: edglbldc.hxx:52
const SwSection * pSect
Definition: edglbldc.hxx:42
const SwTOXBase * pTOX
Definition: edglbldc.hxx:41
GlobalDocContentType m_eType
Definition: edglbldc.hxx:38
SwGlblDocContent(SwNodeOffset nPos)
Definition: edglbldc.cxx:350
bool operator<(const SwGlblDocContent &rCmp) const
Definition: edglbldc.hxx:61
GlobalDocContentType GetType() const
Query contents.
Definition: edglbldc.hxx:51
union SwGlblDocContent::@22 m_PTR
bool operator==(const SwGlblDocContent &rCmp) const
For sorting.
Definition: edglbldc.hxx:59
SwNodeOffset m_nDocPos
Definition: edglbldc.hxx:39
const SwTOXBase * GetTOX() const
Definition: edglbldc.hxx:54
SwNodeOffset GetDocPos() const
Definition: edglbldc.hxx:56
GlobalDocContentType
Definition: edglbldc.hxx:30
@ GLBLDOC_SECTION
Definition: edglbldc.hxx:33
@ GLBLDOC_UNKNOWN
Definition: edglbldc.hxx:31
@ GLBLDOC_TOXBASE
Definition: edglbldc.hxx:32