diff options
author | Tomaž Vajngerl <tomaz.vajngerl@collabora.co.uk> | 2024-01-01 14:34:04 +0900 |
---|---|---|
committer | Tomaž Vajngerl <quikee@gmail.com> | 2024-01-02 04:12:51 +0100 |
commit | e7e7449729fe2b750506b4b165c4be993834fd16 (patch) | |
tree | 235667d1d08197d3744da2af25eaaa5fc208174a /editeng | |
parent | de385412949e2ca52c999546677744ed070d189c (diff) |
editeng: add begin, end, MarkAllSelectionsInvalid to ParaPortionList
begin, end to make iteration work with range for
Change-Id: Ia64d4f8102485b257e190fc702e4aa734a81d866
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/161530
Tested-by: Jenkins
Reviewed-by: Tomaž Vajngerl <quikee@gmail.com>
Diffstat (limited to 'editeng')
-rw-r--r-- | editeng/inc/ParagraphPortionList.hxx | 14 | ||||
-rw-r--r-- | editeng/source/editeng/impedit3.cxx | 3 |
2 files changed, 14 insertions, 3 deletions
diff --git a/editeng/inc/ParagraphPortionList.hxx b/editeng/inc/ParagraphPortionList.hxx index 23654adc5e43..aa7862afa8d7 100644 --- a/editeng/inc/ParagraphPortionList.hxx +++ b/editeng/inc/ParagraphPortionList.hxx @@ -28,7 +28,8 @@ class EditDoc; class ParaPortionList { mutable sal_Int32 nLastCache = 0; - std::vector<std::unique_ptr<ParaPortion>> maPortions; + typedef std::vector<std::unique_ptr<ParaPortion>> ParaPortionContainerType; + ParaPortionContainerType maPortions; public: ParaPortionList() = default; @@ -50,6 +51,17 @@ public: void Append(std::unique_ptr<ParaPortion> p); sal_Int32 Count() const; + ParaPortionContainerType::iterator begin() { return maPortions.begin(); } + ParaPortionContainerType::iterator end() { return maPortions.end(); } + ParaPortionContainerType::const_iterator cbegin() const { return maPortions.cbegin(); } + ParaPortionContainerType::const_iterator cend() const { return maPortions.cend(); } + + void MarkAllSelectionsInvalid(sal_Int32 nStart) + { + for (auto& pParaPortion : maPortions) + pParaPortion->MarkSelectionInvalid(nStart); + } + #if OSL_DEBUG_LEVEL > 0 && !defined NDEBUG // temporary: static void DbgCheck(ParaPortionList const&, EditDoc const& rDoc); diff --git a/editeng/source/editeng/impedit3.cxx b/editeng/source/editeng/impedit3.cxx index a4e0a54aaa0d..d50c2eb1338e 100644 --- a/editeng/source/editeng/impedit3.cxx +++ b/editeng/source/editeng/impedit3.cxx @@ -393,8 +393,7 @@ bool ImpEditEngine::IsPageOverflow( ) const void ImpEditEngine::FormatFullDoc() { - for ( sal_Int32 nPortion = 0; nPortion < GetParaPortions().Count(); nPortion++ ) - GetParaPortions()[nPortion]->MarkSelectionInvalid( 0 ); + GetParaPortions().MarkAllSelectionsInvalid(0); FormatDoc(); } |