LibreOffice Module sw (master)
1
sw
source
filter
ww8
docxfootnotes.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
20
#ifndef INCLUDED_SW_SOURCE_FILTER_WW8_DOCXFOOTNOTES_HXX
21
#define INCLUDED_SW_SOURCE_FILTER_WW8_DOCXFOOTNOTES_HXX
22
23
#include <
sal/types.h
>
24
25
#include <vector>
26
27
class
SwFormatFootnote
;
28
29
namespace
docx
{
30
31
typedef
std::vector< const SwFormatFootnote* >
FootnotesVector
;
32
38
class
FootnotesList
{
40
sal_Int32
m_nCurrent
;
41
43
FootnotesVector
m_aFootnotes
;
44
45
public
:
46
FootnotesList
() :
m_nCurrent
( -1 ) {}
47
48
void
add
(
const
SwFormatFootnote
& rFootnote )
49
{
50
m_aFootnotes
.push_back( &rFootnote );
51
m_nCurrent
=
m_aFootnotes
.size() - 1;
52
}
53
55
const
SwFormatFootnote
*
getCurrent
( sal_Int32& rId )
56
{
57
// anything to write at all?
58
if
(
m_nCurrent
< 0 )
59
{
60
rId = -1;
61
return
nullptr
;
62
}
63
64
// skip ids 0 and 1 - they are reserved for separator and
65
// continuationSeparator
66
rId =
m_nCurrent
+ 2;
67
68
const
SwFormatFootnote
*pFootnote =
m_aFootnotes
[
m_nCurrent
];
69
m_nCurrent
= -1;
70
71
return
pFootnote;
72
}
73
75
const
FootnotesVector
&
getVector
()
const
76
{
77
return
m_aFootnotes
;
78
}
79
81
bool
isEmpty
()
const
82
{
83
return
m_aFootnotes
.empty();
84
}
85
};
86
87
}
// namespace docx
88
89
#endif
// INCLUDED_SW_SOURCE_FILTER_WW8_DOCXFOOTNOTES_HXX
90
91
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
SwFormatFootnote
SfxPoolItem subclass for footnotes and endnotes, stored in the anchor text node.
Definition:
fmtftn.hxx:47
docx::FootnotesList
Remember footnotes/endnotes so that we can dump them in one go.
Definition:
docxfootnotes.hxx:38
docx::FootnotesList::getVector
const FootnotesVector & getVector() const
Return all the footnotes/endnotes.
Definition:
docxfootnotes.hxx:75
docx::FootnotesList::m_nCurrent
sal_Int32 m_nCurrent
The current footnote, that was not written yet.
Definition:
docxfootnotes.hxx:40
docx::FootnotesList::isEmpty
bool isEmpty() const
Do we have any footnotes/endnotes at all?
Definition:
docxfootnotes.hxx:81
docx::FootnotesList::getCurrent
const SwFormatFootnote * getCurrent(sal_Int32 &rId)
Return the current footnote/endnote and clear the 'current' state.
Definition:
docxfootnotes.hxx:55
docx::FootnotesList::FootnotesList
FootnotesList()
Definition:
docxfootnotes.hxx:46
docx::FootnotesList::add
void add(const SwFormatFootnote &rFootnote)
Definition:
docxfootnotes.hxx:48
docx::FootnotesList::m_aFootnotes
FootnotesVector m_aFootnotes
List of the footnotes.
Definition:
docxfootnotes.hxx:43
docx
Definition:
docxattributeoutput.cxx:9331
docx::FootnotesVector
std::vector< const SwFormatFootnote * > FootnotesVector
Definition:
docxfootnotes.hxx:31
types.h
Generated on Sun Jul 30 2023 04:29:20 for LibreOffice Module sw (master) by
1.9.3