diff options
author | Tomaž Vajngerl <tomaz.vajngerl@collabora.co.uk> | 2023-12-29 20:58:40 +0900 |
---|---|---|
committer | Tomaž Vajngerl <quikee@gmail.com> | 2024-01-01 04:34:28 +0100 |
commit | 275860e607c172825bc47f70eba5562e5a9208f4 (patch) | |
tree | 60e874644f48ff5c76742bb4a29dc70fb877bbc6 /editeng | |
parent | 916268c70a5673680c86eaac11c543fd45b90eb3 (diff) |
editeng: move ParaPortionList into its own header file
Change-Id: Ibb1c9feb989a7dc3127e21c5a4dcda41b64fc84b
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/161476
Tested-by: Jenkins
Reviewed-by: Tomaž Vajngerl <quikee@gmail.com>
Diffstat (limited to 'editeng')
-rw-r--r-- | editeng/inc/ParagraphPortionList.hxx | 60 | ||||
-rw-r--r-- | editeng/inc/editdoc.hxx | 33 |
2 files changed, 61 insertions, 32 deletions
diff --git a/editeng/inc/ParagraphPortionList.hxx b/editeng/inc/ParagraphPortionList.hxx new file mode 100644 index 000000000000..8964c9767ba7 --- /dev/null +++ b/editeng/inc/ParagraphPortionList.hxx @@ -0,0 +1,60 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ + +#pragma once + +#include "ParagraphPortion.hxx" + +#include <vector> + +class EditDoc; + +class ParaPortionList +{ + mutable sal_Int32 nLastCache; + std::vector<std::unique_ptr<ParaPortion>> maPortions; + +public: + ParaPortionList(); + ~ParaPortionList(); + + void Reset(); + tools::Long GetYOffset(const ParaPortion* pPPortion) const; + sal_Int32 FindParagraph(tools::Long nYOffset) const; + + const ParaPortion* SafeGetObject(sal_Int32 nPos) const; + ParaPortion* SafeGetObject(sal_Int32 nPos); + + sal_Int32 GetPos(const ParaPortion* p) const; + ParaPortion* operator[](sal_Int32 nPos); + const ParaPortion* operator[](sal_Int32 nPos) const; + + std::unique_ptr<ParaPortion> Release(sal_Int32 nPos); + void Remove(sal_Int32 nPos); + void Insert(sal_Int32 nPos, std::unique_ptr<ParaPortion> p); + void Append(std::unique_ptr<ParaPortion> p); + sal_Int32 Count() const; + +#if OSL_DEBUG_LEVEL > 0 && !defined NDEBUG + // temporary: + static void DbgCheck(ParaPortionList const&, EditDoc const& rDoc); +#endif +}; + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/editeng/inc/editdoc.hxx b/editeng/inc/editdoc.hxx index 1b93d52a6a88..738c0b2d5772 100644 --- a/editeng/inc/editdoc.hxx +++ b/editeng/inc/editdoc.hxx @@ -19,6 +19,7 @@ #pragma once +#include "ParagraphPortionList.hxx" #include "editattr.hxx" #include "edtspell.hxx" #include "eerdll2.hxx" @@ -37,7 +38,6 @@ #include "EditLineList.hxx" #include "EditPaM.hxx" #include "EditSelection.hxx" -#include "ParagraphPortion.hxx" #include <cstddef> #include <memory> @@ -82,37 +82,6 @@ enum class DeleteMode { Simple, RestOfWord, RestOfContent }; -class ParaPortionList -{ - mutable sal_Int32 nLastCache; - std::vector<std::unique_ptr<ParaPortion>> maPortions; -public: - ParaPortionList(); - ~ParaPortionList(); - - void Reset(); - tools::Long GetYOffset(const ParaPortion* pPPortion) const; - sal_Int32 FindParagraph(tools::Long nYOffset) const; - - const ParaPortion* SafeGetObject(sal_Int32 nPos) const; - ParaPortion* SafeGetObject(sal_Int32 nPos); - - sal_Int32 GetPos(const ParaPortion* p) const; - ParaPortion* operator[](sal_Int32 nPos); - const ParaPortion* operator[](sal_Int32 nPos) const; - - std::unique_ptr<ParaPortion> Release(sal_Int32 nPos); - void Remove(sal_Int32 nPos); - void Insert(sal_Int32 nPos, std::unique_ptr<ParaPortion> p); - void Append(std::unique_ptr<ParaPortion> p); - sal_Int32 Count() const; - -#if OSL_DEBUG_LEVEL > 0 && !defined NDEBUG - // temporary: - static void DbgCheck(ParaPortionList const&, EditDoc const& rDoc); -#endif -}; - class DeletedNodeInfo { private: |