1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
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/.
11 #include <o3tl/make_unique.hxx>
13 SmCaretPosGraph::SmCaretPosGraph() = default;
15 SmCaretPosGraph::~SmCaretPosGraph() = default;
17 SmCaretPosGraphEntry
* SmCaretPosGraph::Add(SmCaretPos pos
,
18 SmCaretPosGraphEntry
* left
)
20 assert(pos
.nIndex
>= 0);
21 auto entry
= o3tl::make_unique
<SmCaretPosGraphEntry
>(pos
, left
, nullptr);
22 SmCaretPosGraphEntry
* e
= entry
.get();
23 //Set Left and Right to point to the entry itself if they are NULL
24 entry
->Left
= entry
->Left
? entry
->Left
: e
;
25 entry
->Right
= entry
->Right
? entry
->Right
: e
;
26 mvEntries
.push_back(std::move(entry
));
30 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */