diff options
author | Tomaž Vajngerl <tomaz.vajngerl@collabora.co.uk> | 2023-12-25 00:14:00 +0900 |
---|---|---|
committer | Tomaž Vajngerl <quikee@gmail.com> | 2023-12-31 02:34:52 +0100 |
commit | 291fe245284806538d74b40d45dfa20b3fbab172 (patch) | |
tree | 35736ec71ca0fa69ab2b52b688b3e0eabed14e15 /editeng | |
parent | 6fe0a54f5503cca07b3c0c75e2c4fbc7aece2901 (diff) |
editeng: move EditPaM into its own header file
Change-Id: I13c5d4f2ea0bd7ef942ac0cacb9dce4b58909b19
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/161362
Tested-by: Tomaž Vajngerl <quikee@gmail.com>
Reviewed-by: Tomaž Vajngerl <quikee@gmail.com>
Diffstat (limited to 'editeng')
-rw-r--r-- | editeng/inc/EditPaM.hxx | 50 | ||||
-rw-r--r-- | editeng/inc/editdoc.hxx | 25 |
2 files changed, 51 insertions, 24 deletions
diff --git a/editeng/inc/EditPaM.hxx b/editeng/inc/EditPaM.hxx new file mode 100644 index 000000000000..2aa733f5ea74 --- /dev/null +++ b/editeng/inc/EditPaM.hxx @@ -0,0 +1,50 @@ +/* -*- 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 "ContentNode.hxx" + +class EditDoc; + +class EditPaM +{ +private: + ContentNode* pNode; + sal_Int32 nIndex; + +public: + EditPaM(); + EditPaM(ContentNode* p, sal_Int32 n); + + const ContentNode* GetNode() const { return pNode; } + ContentNode* GetNode() { return pNode; } + void SetNode(ContentNode* p); + + sal_Int32 GetIndex() const { return nIndex; } + void SetIndex(sal_Int32 n) { nIndex = n; } + + bool DbgIsBuggy(EditDoc const& rDoc) const; + + friend bool operator==(const EditPaM& r1, const EditPaM& r2); + friend bool operator!=(const EditPaM& r1, const EditPaM& r2); + bool operator!() const { return !pNode && !nIndex; } +}; + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/editeng/inc/editdoc.hxx b/editeng/inc/editdoc.hxx index e400a3b42e4a..6bba498440f6 100644 --- a/editeng/inc/editdoc.hxx +++ b/editeng/inc/editdoc.hxx @@ -34,6 +34,7 @@ #include "ItemList.hxx" #include "ContentNode.hxx" #include "EditLineList.hxx" +#include "EditPaM.hxx" #include <cstddef> #include <memory> @@ -107,30 +108,6 @@ public: typedef std::vector<Color> SvxColorList; -class EditPaM -{ -private: - ContentNode* pNode; - sal_Int32 nIndex; - -public: - EditPaM(); - EditPaM(ContentNode* p, sal_Int32 n); - - const ContentNode* GetNode() const { return pNode;} - ContentNode* GetNode() { return pNode;} - void SetNode(ContentNode* p); - - sal_Int32 GetIndex() const { return nIndex; } - void SetIndex( sal_Int32 n ) { nIndex = n; } - - bool DbgIsBuggy( EditDoc const & rDoc ) const; - - friend bool operator == ( const EditPaM& r1, const EditPaM& r2 ); - friend bool operator != ( const EditPaM& r1, const EditPaM& r2 ); - bool operator !() const { return !pNode && !nIndex; } -}; - enum class DeleteMode { Simple, RestOfWord, RestOfContent }; |