fix baseline build (old cairo) - 'cairo_rectangle_int_t' does not name a type
[LibreOffice.git] / sc / source / ui / undo / undocell2.cxx
blob125b9a767f389208dbd159bf00dcc1588960df38
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 <undocell.hxx>
11 #include <globstr.hrc>
12 #include <cellvalues.hxx>
14 namespace sc {
16 UndoSetCells::UndoSetCells( ScDocShell* pDocSh, const ScAddress& rTopPos ) :
17 ScSimpleUndo(pDocSh), maTopPos(rTopPos) {}
19 UndoSetCells::~UndoSetCells() {}
21 void UndoSetCells::DoChange( const CellValues& rValues )
23 ScDocument& rDoc = pDocShell->GetDocument();
24 rDoc.CopyCellValuesFrom(maTopPos, rValues);
26 ScRange aRange(maTopPos);
27 aRange.aEnd.IncRow(rValues.size());
28 BroadcastChanges(aRange);
29 pDocShell->PostPaintGridAll();
32 void UndoSetCells::Undo()
34 BeginUndo();
35 DoChange(maOldValues);
36 EndUndo();
39 void UndoSetCells::Redo()
41 BeginRedo();
42 DoChange(maNewValues);
43 EndRedo();
46 bool UndoSetCells::CanRepeat( SfxRepeatTarget& ) const
48 return false;
51 OUString UndoSetCells::GetComment() const
53 // "Input"
54 return ScGlobal::GetRscString(STR_UNDO_ENTERDATA);
57 void UndoSetCells::SetNewValues( const std::vector<double>& rVals )
59 maNewValues.assign(rVals);
64 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */