bump product version to 4.1.6.2
[LibreOffice.git] / sw / source / filter / ww8 / docxfootnotes.hxx
blob58134e2eb015da9c70627389fd04b2b8dbd76937
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 _DOCXFOOTNOTES_HXX_
21 #define _DOCXFOOTNOTES_HXX_
23 #include <fmtftn.hxx>
25 #include <rtl/string.hxx>
26 #include <rtl/ustring.hxx>
27 #include <sax/fshelper.hxx>
29 #include <vector>
31 namespace docx {
33 typedef ::std::vector< const SwFmtFtn* > FootnotesVector;
35 /** Remember footnotes/endnotes so that we can dump them in one go.
37 Also rememeber the last added footnote Id to be able to write it in the
38 DocxAttributeOutput::EndRunProperties() method.
40 class FootnotesList {
41 /// The current footnote, that was not written yet.
42 sal_Int32 m_nCurrent;
44 /// List of the footnotes.
45 FootnotesVector m_aFootnotes;
47 public:
48 FootnotesList() : m_nCurrent( -1 ) {}
50 void add( const SwFmtFtn& rFootnote )
52 m_aFootnotes.push_back( &rFootnote );
53 m_nCurrent = m_aFootnotes.size() - 1;
56 /// Return the current footnote/endnote and clear the 'current' state.
57 const SwFmtFtn* getCurrent( sal_Int32& rId )
59 // skip ids 0 and 1 - they are reserved for separator and
60 // continuationSeparator
61 rId = m_nCurrent + 2;
63 // anything to write at all?
64 if ( m_nCurrent < 0 )
66 rId = -1;
67 return NULL;
70 const SwFmtFtn *pFootnote = m_aFootnotes[m_nCurrent];
71 m_nCurrent = -1;
73 return pFootnote;
76 /// Return all the footnotes/endnotes.
77 const FootnotesVector& getVector() const
79 return m_aFootnotes;
82 /// Do we have any footnotes/endnotes at all?
83 bool isEmpty() const
85 return m_aFootnotes.empty();
89 } // namespace docx
91 #endif // _DOCXFOOTNOTES_HXX_
93 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */