/src/libreoffice/sc/source/ui/undo/undoconvert.cxx
Line | Count | Source |
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 | | |
10 | | #include <undoconvert.hxx> |
11 | | #include <globstr.hrc> |
12 | | #include <scresid.hxx> |
13 | | #include <undoutil.hxx> |
14 | | |
15 | | namespace sc { |
16 | | |
17 | | UndoFormulaToValue::UndoFormulaToValue( ScDocShell& rDocSh, TableValues& rUndoValues ) : |
18 | 0 | ScSimpleUndo(rDocSh) |
19 | 0 | { |
20 | 0 | maUndoValues.swap(rUndoValues); |
21 | 0 | } |
22 | | |
23 | | OUString UndoFormulaToValue::GetComment() const |
24 | 0 | { |
25 | 0 | return ScResId(STR_UNDO_FORMULA_TO_VALUE); |
26 | 0 | } |
27 | | |
28 | | void UndoFormulaToValue::Undo() |
29 | 0 | { |
30 | 0 | Execute(); |
31 | 0 | } |
32 | | |
33 | | void UndoFormulaToValue::Redo() |
34 | 0 | { |
35 | 0 | Execute(); |
36 | 0 | } |
37 | | |
38 | | void UndoFormulaToValue::Execute() |
39 | 0 | { |
40 | 0 | ScDocument& rDoc = rDocShell.GetDocument(); |
41 | 0 | rDoc.SwapNonEmpty(maUndoValues); |
42 | |
|
43 | 0 | ScUndoUtil::MarkSimpleBlock(rDocShell, maUndoValues.getRange()); |
44 | |
|
45 | 0 | rDocShell.PostPaint(maUndoValues.getRange(), PaintPartFlags::Grid); |
46 | 0 | rDocShell.PostDataChanged(); |
47 | 0 | rDoc.BroadcastCells(maUndoValues.getRange(), SfxHintId::ScDataChanged); |
48 | 0 | } |
49 | | |
50 | | } |
51 | | |
52 | | /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ |