tdf#156769 - Escape the question mark in the storage name
[LibreOffice.git] / editeng / inc / ParagraphPortionList.hxx
blobaa7862afa8d7d3dc50870b8104c7fe764677a334
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/.
9 * This file incorporates work covered by the following license notice:
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 .
20 #pragma once
22 #include "ParagraphPortion.hxx"
24 #include <vector>
26 class EditDoc;
28 class ParaPortionList
30 mutable sal_Int32 nLastCache = 0;
31 typedef std::vector<std::unique_ptr<ParaPortion>> ParaPortionContainerType;
32 ParaPortionContainerType maPortions;
34 public:
35 ParaPortionList() = default;
37 void Reset();
38 tools::Long GetYOffset(const ParaPortion* pPPortion) const;
39 sal_Int32 FindParagraph(tools::Long nYOffset) const;
41 const ParaPortion* SafeGetObject(sal_Int32 nPos) const;
42 ParaPortion* SafeGetObject(sal_Int32 nPos);
44 sal_Int32 GetPos(const ParaPortion* p) const;
45 ParaPortion* operator[](sal_Int32 nPos);
46 const ParaPortion* operator[](sal_Int32 nPos) const;
48 std::unique_ptr<ParaPortion> Release(sal_Int32 nPos);
49 void Remove(sal_Int32 nPos);
50 void Insert(sal_Int32 nPos, std::unique_ptr<ParaPortion> p);
51 void Append(std::unique_ptr<ParaPortion> p);
52 sal_Int32 Count() const;
54 ParaPortionContainerType::iterator begin() { return maPortions.begin(); }
55 ParaPortionContainerType::iterator end() { return maPortions.end(); }
56 ParaPortionContainerType::const_iterator cbegin() const { return maPortions.cbegin(); }
57 ParaPortionContainerType::const_iterator cend() const { return maPortions.cend(); }
59 void MarkAllSelectionsInvalid(sal_Int32 nStart)
61 for (auto& pParaPortion : maPortions)
62 pParaPortion->MarkSelectionInvalid(nStart);
65 #if OSL_DEBUG_LEVEL > 0 && !defined NDEBUG
66 // temporary:
67 static void DbgCheck(ParaPortionList const&, EditDoc const& rDoc);
68 #endif
71 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */