LibreOffice Module starmath (master) 1
caret.cxx
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#include <caret.hxx>
10
12
14
17{
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;
26}
27
28/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
std::vector< std::unique_ptr< SmCaretPosGraphEntry > > mvEntries
Definition: caret.hxx:151
SmCaretPosGraphEntry * Add(SmCaretPos pos, SmCaretPosGraphEntry *left=nullptr)
Add a caret position.
Definition: caret.cxx:15
An entry in SmCaretPosGraph.
Definition: caret.hxx:111
SmCaretPosGraphEntry * Left
Entry to the left visually.
Definition: caret.hxx:121
SmCaretPosGraphEntry * Right
Entry to the right visually.
Definition: caret.hxx:123
Representation of caret position with an equation.
Definition: caret.hxx:17
sal_uInt64 left
size_t pos