From 4acb0979b10bf35cf929078e53ccccea249e1416 Mon Sep 17 00:00:00 2001 From: Tomaž Vajngerl Date: Sun, 24 Dec 2023 23:55:58 +0900 Subject: editeng: move EditLineList to its own header file MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Change-Id: Ic19aa0826050a768e9976d8d3db9eadb108607f0 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/161360 Tested-by: Jenkins Reviewed-by: Tomaž Vajngerl --- editeng/inc/EditLineList.hxx | 45 ++++++++++++++++++++++++++++++++++++++++++++ editeng/inc/editdoc.hxx | 23 +--------------------- 2 files changed, 46 insertions(+), 22 deletions(-) create mode 100644 editeng/inc/EditLineList.hxx (limited to 'editeng') diff --git a/editeng/inc/EditLineList.hxx b/editeng/inc/EditLineList.hxx new file mode 100644 index 000000000000..2b3874913cad --- /dev/null +++ b/editeng/inc/EditLineList.hxx @@ -0,0 +1,45 @@ +/* -*- 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 +#include + +class EditLineList +{ + typedef std::vector> LinesType; + LinesType maLines; + +public: + EditLineList(); + ~EditLineList(); + + void Reset(); + void DeleteFromLine(sal_Int32 nDelFrom); + sal_Int32 FindLine(sal_Int32 nChar, bool bInclEnd); + sal_Int32 Count() const; + const EditLine& operator[](sal_Int32 nPos) const; + EditLine& operator[](sal_Int32 nPos); + + void Append(EditLine* p); + void Insert(sal_Int32 nPos, EditLine* p); +}; + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/editeng/inc/editdoc.hxx b/editeng/inc/editdoc.hxx index c53abc62949c..3db8a8a64a63 100644 --- a/editeng/inc/editdoc.hxx +++ b/editeng/inc/editdoc.hxx @@ -34,6 +34,7 @@ #include "ItemList.hxx" #include "ContentNode.hxx" #include "EditLine.hxx" +#include "EditLineList.hxx" #include #include @@ -159,28 +160,6 @@ public: sal_Int32 GetPos(const TextPortion* p) const; }; -class EditLineList -{ - typedef std::vector > LinesType; - LinesType maLines; - -public: - EditLineList(); - ~EditLineList(); - - void Reset(); - void DeleteFromLine(sal_Int32 nDelFrom); - sal_Int32 FindLine(sal_Int32 nChar, bool bInclEnd); - sal_Int32 Count() const; - const EditLine& operator[](sal_Int32 nPos) const; - EditLine& operator[](sal_Int32 nPos); - - void Append(EditLine* p); - void Insert(sal_Int32 nPos, EditLine* p); -}; - - - class ParaPortion { friend class ImpEditEngine; // to adjust the height -- cgit