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 
22 #include <o3tl/sorted_vector.hxx>
23 
24 #include "nodeoffset.hxx"
25 
26 class SwSection;
27 class SwTOXBase;
28 class SwTOXBaseSection;
29 
34 };
35 
37 {
40  union {
41  const SwTOXBase* pTOX;
42  const SwSection* pSect;
43  } m_PTR;
44 
45 public:
49 
51  GlobalDocContentType GetType() const { return m_eType; }
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 
65 class 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: */
SwNodeOffset m_nDocPos
Definition: edglbldc.hxx:39
const SwSection * pSect
Definition: edglbldc.hxx:42
bool operator<(const SwGlblDocContent &rCmp) const
Definition: edglbldc.hxx:61
GlobalDocContentType m_eType
Definition: edglbldc.hxx:38
SwGlblDocContent(SwNodeOffset nPos)
Definition: edglbldc.cxx:358
const SwTOXBase * pTOX
Definition: edglbldc.hxx:41
GlobalDocContentType
Definition: edglbldc.hxx:30
const SwTOXBase * GetTOX() const
Definition: edglbldc.hxx:54
GlobalDocContentType GetType() const
Query contents.
Definition: edglbldc.hxx:51
const SwSection * GetSection() const
Definition: edglbldc.hxx:52
SwNodeOffset GetDocPos() const
Definition: edglbldc.hxx:56
bool operator==(const SwGlblDocContent &rCmp) const
For sorting.
Definition: edglbldc.hxx:59
union SwGlblDocContent::@25 m_PTR