nss: upgrade to release 3.73
[LibreOffice.git] / sw / source / core / inc / UndoSort.hxx
blob798a5ea1894f2e56bce7787a2f76af529619844a
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*
3 * This file is part of the LibreOffice project.
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/.
9 * This file incorporates work covered by the following license notice:
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 .
20 #ifndef INCLUDED_SW_SOURCE_CORE_INC_UNDOSORT_HXX
21 #define INCLUDED_SW_SOURCE_CORE_INC_UNDOSORT_HXX
23 #include <undobj.hxx>
25 #include <rtl/ustring.hxx>
27 #include <memory>
28 #include <vector>
30 struct SwSortOptions;
31 class SwTableNode;
32 class SwUndoAttrTable;
34 struct SwSortUndoElement
36 union {
37 struct {
38 sal_uLong nID;
39 sal_uLong nSource, nTarget;
40 } TXT;
41 struct {
42 OUString *pSource, *pTarget;
43 } TBL;
44 } SORT_TXT_TBL;
46 SwSortUndoElement( const OUString& aS, const OUString& aT )
48 SORT_TXT_TBL.TBL.pSource = new OUString( aS );
49 SORT_TXT_TBL.TBL.pTarget = new OUString( aT );
51 SwSortUndoElement( sal_uLong nS, sal_uLong nT )
53 SORT_TXT_TBL.TXT.nSource = nS;
54 SORT_TXT_TBL.TXT.nTarget = nT;
55 SORT_TXT_TBL.TXT.nID = 0xffffffff;
57 ~SwSortUndoElement();
60 class SwUndoSort : public SwUndo, private SwUndRng
62 std::unique_ptr<SwSortOptions> m_pSortOptions;
63 std::vector<std::unique_ptr<SwSortUndoElement>> m_SortList;
64 std::unique_ptr<SwUndoAttrTable> m_pUndoAttrTable;
65 sal_uLong m_nTableNode;
67 public:
68 SwUndoSort( const SwPaM&, const SwSortOptions& );
69 SwUndoSort( sal_uLong nStt, sal_uLong nEnd, const SwTableNode&,
70 const SwSortOptions&, bool bSaveTable );
72 virtual ~SwUndoSort() override;
74 virtual void UndoImpl( ::sw::UndoRedoContext & ) override;
75 virtual void RedoImpl( ::sw::UndoRedoContext & ) override;
76 virtual void RepeatImpl( ::sw::RepeatContext & ) override;
78 void Insert( const OUString& rOrgPos, const OUString& rNewPos );
79 void Insert( sal_uLong nOrgPos, sal_uLong nNewPos );
82 #endif // INCLUDED_SW_SOURCE_CORE_INC_UNDOSORT_HXX
84 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */