tdf#164420 Fix unselected Check/Radio buttons not following themes in GTK
[LibreOffice.git] / sw / source / filter / ww8 / docxfootnotes.hxx
blob614069f0dd5d604e5b73d1108b3b7ffb43275522
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*
3 * This file is part of the LibreOffice project.
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/.
9 * This file incorporates work covered by the following license notice:
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 .
20 #ifndef INCLUDED_SW_SOURCE_FILTER_WW8_DOCXFOOTNOTES_HXX
21 #define INCLUDED_SW_SOURCE_FILTER_WW8_DOCXFOOTNOTES_HXX
23 #include <sal/types.h>
25 #include <vector>
27 class SwFormatFootnote;
29 namespace docx {
31 typedef std::vector< const SwFormatFootnote* > FootnotesVector;
33 /** Remember footnotes/endnotes so that we can dump them in one go.
35 Also remember the last added footnote Id to be able to write it in the
36 DocxAttributeOutput::EndRunProperties() method.
38 class FootnotesList {
39 /// The current footnote, that was not written yet.
40 sal_Int32 m_nCurrent;
42 /// List of the footnotes.
43 FootnotesVector m_aFootnotes;
45 public:
46 FootnotesList() : m_nCurrent( -1 ) {}
48 void add( const SwFormatFootnote& rFootnote )
50 m_aFootnotes.push_back( &rFootnote );
51 m_nCurrent = m_aFootnotes.size() - 1;
54 /// Return the current footnote/endnote and clear the 'current' state.
55 const SwFormatFootnote* getCurrent( sal_Int32& rId )
57 // anything to write at all?
58 if ( m_nCurrent < 0 )
60 rId = -1;
61 return nullptr;
64 // skip ids 0 and 1 - they are reserved for separator and
65 // continuationSeparator
66 rId = m_nCurrent + 2;
68 const SwFormatFootnote *pFootnote = m_aFootnotes[m_nCurrent];
69 m_nCurrent = -1;
71 return pFootnote;
74 /// Return all the footnotes/endnotes.
75 const FootnotesVector& getVector() const
77 return m_aFootnotes;
80 /// Do we have any footnotes/endnotes at all?
81 bool isEmpty() const
83 return m_aFootnotes.empty();
87 } // namespace docx
89 #endif // INCLUDED_SW_SOURCE_FILTER_WW8_DOCXFOOTNOTES_HXX
91 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */