1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
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
25 #include <rtl/ustring.hxx>
32 class SwUndoAttrTable
;
34 struct SwSortUndoElement
39 sal_uLong nSource
, nTarget
;
42 OUString
*pSource
, *pTarget
;
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;
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
;
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: */