LibreOffice Module sw (master) 1
UndoSort.hxx
Go to the documentation of this file.
1/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2/*
3 * This file is part of the LibreOffice project.
4 *
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/.
8 *
9 * This file incorporates work covered by the following license notice:
10 *
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 .
18 */
19
20#ifndef INCLUDED_SW_SOURCE_CORE_INC_UNDOSORT_HXX
21#define INCLUDED_SW_SOURCE_CORE_INC_UNDOSORT_HXX
22
23#include <undobj.hxx>
24
25#include <rtl/ustring.hxx>
26#include <tools/solar.h>
27
28#include <memory>
29#include <vector>
30
31struct SwSortOptions;
32class SwTableNode;
33class SwUndoAttrTable;
34
36{
41
42 SwSortUndoElement(const OUString& aSource, const OUString& aTarget)
43 : maSourceString(aSource)
44 , maTargetString(aTarget)
45 {}
46
48 : mnSourceNodeOffset(nSource)
49 , mnTargetNodeOffset(nTarget)
50 {}
51};
52
53class SwUndoSort final : public SwUndo, private SwUndRng
54{
55 std::unique_ptr<SwSortOptions> m_pSortOptions;
56 std::vector<std::unique_ptr<SwSortUndoElement>> m_SortList;
57 std::unique_ptr<SwUndoAttrTable> m_pUndoAttrTable;
59
60public: SwUndoSort( const SwPaM&, const SwSortOptions& );
62 const SwSortOptions&, bool bSaveTable );
63
64 virtual ~SwUndoSort() override;
65
66 virtual void UndoImpl( ::sw::UndoRedoContext & ) override;
67 virtual void RedoImpl( ::sw::UndoRedoContext & ) override;
68 virtual void RepeatImpl( ::sw::RepeatContext & ) override;
69
70 void Insert( const OUString& rOrgPos, const OUString& rNewPos );
71 void Insert( SwNodeOffset nOrgPos, SwNodeOffset nNewPos );
72};
73
74#endif // INCLUDED_SW_SOURCE_CORE_INC_UNDOSORT_HXX
75
76/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
PaM is Point and Mark: a selection of the document model.
Definition: pam.hxx:188
virtual void RepeatImpl(::sw::RepeatContext &) override
Definition: unsort.cxx:213
virtual ~SwUndoSort() override
Definition: unsort.cxx:54
std::unique_ptr< SwSortOptions > m_pSortOptions
Definition: UndoSort.hxx:55
virtual void RedoImpl(::sw::UndoRedoContext &) override
Definition: unsort.cxx:138
virtual void UndoImpl(::sw::UndoRedoContext &) override
Definition: unsort.cxx:60
SwNodeOffset m_nTableNode
Definition: UndoSort.hxx:58
SwUndoSort(const SwPaM &, const SwSortOptions &)
Definition: unsort.cxx:33
void Insert(const OUString &rOrgPos, const OUString &rNewPos)
Definition: unsort.cxx:226
std::vector< std::unique_ptr< SwSortUndoElement > > m_SortList
Definition: UndoSort.hxx:56
std::unique_ptr< SwUndoAttrTable > m_pUndoAttrTable
Definition: UndoSort.hxx:57
OUString maSourceString
Definition: UndoSort.hxx:37
SwSortUndoElement(const OUString &aSource, const OUString &aTarget)
Definition: UndoSort.hxx:42
OUString maTargetString
Definition: UndoSort.hxx:38
SwNodeOffset mnSourceNodeOffset
Definition: UndoSort.hxx:39
SwSortUndoElement(SwNodeOffset nSource, SwNodeOffset nTarget)
Definition: UndoSort.hxx:47
SwNodeOffset mnTargetNodeOffset
Definition: UndoSort.hxx:40