Bump version to 21.06.18.1
[LibreOffice.git] / starmath / source / caret.cxx
blob4e2effaa23794f521ec9c9c0117e83d78e6ef560
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/.
8 */
9 #include <caret.hxx>
11 SmCaretPosGraph::SmCaretPosGraph() = default;
13 SmCaretPosGraph::~SmCaretPosGraph() = default;
15 SmCaretPosGraphEntry* SmCaretPosGraph::Add(SmCaretPos pos,
16 SmCaretPosGraphEntry* left)
18 assert(pos.nIndex >= 0);
19 auto entry = std::make_unique<SmCaretPosGraphEntry>(pos, left, nullptr);
20 SmCaretPosGraphEntry* e = entry.get();
21 //Set Left and Right to point to the entry itself if they are NULL
22 entry->Left = entry->Left ? entry->Left : e;
23 entry->Right = entry->Right ? entry->Right : e;
24 mvEntries.push_back(std::move(entry));
25 return e;
28 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */