cid#1607171 Data race condition
[LibreOffice.git] / sc / source / ui / undo / undoconvert.cxx
blobea9facfc22eb7e8defeca0e1f274e5678d7c7b6f
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/.
8 */
10 #include <undoconvert.hxx>
11 #include <globstr.hrc>
12 #include <scresid.hxx>
13 #include <undoutil.hxx>
15 namespace sc {
17 UndoFormulaToValue::UndoFormulaToValue( ScDocShell* pDocSh, TableValues& rUndoValues ) :
18 ScSimpleUndo(pDocSh)
20 maUndoValues.swap(rUndoValues);
23 OUString UndoFormulaToValue::GetComment() const
25 return ScResId(STR_UNDO_FORMULA_TO_VALUE);
28 void UndoFormulaToValue::Undo()
30 Execute();
33 void UndoFormulaToValue::Redo()
35 Execute();
38 void UndoFormulaToValue::Execute()
40 ScDocument& rDoc = pDocShell->GetDocument();
41 rDoc.SwapNonEmpty(maUndoValues);
43 ScUndoUtil::MarkSimpleBlock(pDocShell, maUndoValues.getRange());
45 pDocShell->PostPaint(maUndoValues.getRange(), PaintPartFlags::Grid);
46 pDocShell->PostDataChanged();
47 rDoc.BroadcastCells(maUndoValues.getRange(), SfxHintId::ScDataChanged);
52 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */