1 /*************************************************************************
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
5 * Copyright 2008 by Sun Microsystems, Inc.
7 * OpenOffice.org - a multi-platform office productivity suite
12 * This file is part of OpenOffice.org.
14 * OpenOffice.org is free software: you can redistribute it and/or modify
15 * it under the terms of the GNU Lesser General Public License version 3
16 * only, as published by the Free Software Foundation.
18 * OpenOffice.org is distributed in the hope that it will be useful,
19 * but WITHOUT ANY WARRANTY; without even the implied warranty of
20 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21 * GNU Lesser General Public License version 3 for more details
22 * (a copy is included in the LICENSE file that accompanied this code).
24 * You should have received a copy of the GNU Lesser General Public License
25 * version 3 along with OpenOffice.org. If not, see
26 * <http://www.openoffice.org/license.html>
27 * for a copy of the LGPLv3 License.
29 ************************************************************************/
31 #ifndef _DOCXFOOTNOTES_HXX_
32 #define _DOCXFOOTNOTES_HXX_
36 #include <oox/core/tokens.hxx>
37 #include <rtl/string.hxx>
38 #include <rtl/ustring.hxx>
39 #include <sax/fshelper.hxx>
45 typedef ::std::vector
< const SwFmtFtn
* > FootnotesVector
;
47 /** Remember footnotes/endnotes so that we can dump them in one go.
49 Also rememeber the last added footnote Id to be able to write it in the
50 DocxAttributeOutput::EndRunProperties() method.
53 /// The current footnote, that was not written yet.
56 /// List of the footnotes.
57 FootnotesVector m_aFootnotes
;
60 FootnotesList() : m_nCurrent( -1 ) {}
62 void add( const SwFmtFtn
& rFootnote
)
64 m_aFootnotes
.push_back( &rFootnote
);
65 m_nCurrent
= m_aFootnotes
.size() - 1;
68 /// Return the current footnote/endnote and clear the 'current' state.
69 const SwFmtFtn
* getCurrent( sal_Int32
& rId
)
71 // skip ids 0 and 1 - they are reserved for separator and
72 // continuationSeparator
75 // anything to write at all?
82 const SwFmtFtn
*pFootnote
= m_aFootnotes
[m_nCurrent
];
88 /// Return all the footnotes/endnotes.
89 const FootnotesVector
& getVector() const
94 /// Do we have any footnotes/endnotes at all?
97 return m_aFootnotes
.empty();
103 #endif // _DOCXFOOTNOTES_HXX_