LCOV - code coverage report
Current view: top level - sc/source/ui/undo - undocell2.cxx (source / functions) Hit Total Coverage
Test: commit c8344322a7af75b84dd3ca8f78b05543a976dfd5 Lines: 1 29 3.4 %
Date: 2015-06-13 12:38:46 Functions: 2 11 18.2 %
Legend: Lines: hit not hit

          Line data    Source code
       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 <undocell.hxx>
      11             : #include <globstr.hrc>
      12             : #include <cellvalues.hxx>
      13             : 
      14             : namespace sc {
      15             : 
      16           0 : UndoSetCells::UndoSetCells( ScDocShell* pDocSh, const ScAddress& rTopPos ) :
      17           0 :     ScSimpleUndo(pDocSh), maTopPos(rTopPos) {}
      18             : 
      19           0 : UndoSetCells::~UndoSetCells() {}
      20             : 
      21           0 : void UndoSetCells::DoChange( const CellValues& rValues )
      22             : {
      23           0 :     ScDocument& rDoc = pDocShell->GetDocument();
      24           0 :     rDoc.CopyCellValuesFrom(maTopPos, rValues);
      25             : 
      26           0 :     ScRange aRange(maTopPos);
      27           0 :     aRange.aEnd.IncRow(rValues.size());
      28           0 :     BroadcastChanges(aRange);
      29           0 :     pDocShell->PostPaintGridAll();
      30           0 : }
      31             : 
      32           0 : void UndoSetCells::Undo()
      33             : {
      34           0 :     BeginUndo();
      35           0 :     DoChange(maOldValues);
      36           0 :     EndUndo();
      37           0 : }
      38             : 
      39           0 : void UndoSetCells::Redo()
      40             : {
      41           0 :     BeginRedo();
      42           0 :     DoChange(maNewValues);
      43           0 :     EndRedo();
      44           0 : }
      45             : 
      46           0 : bool UndoSetCells::CanRepeat( SfxRepeatTarget& ) const
      47             : {
      48           0 :     return false;
      49             : }
      50             : 
      51           0 : OUString UndoSetCells::GetComment() const
      52             : {
      53             :     // "Input"
      54           0 :     return ScGlobal::GetRscString(STR_UNDO_ENTERDATA);
      55             : }
      56             : 
      57           0 : void UndoSetCells::SetNewValues( const std::vector<double>& rVals )
      58             : {
      59           0 :     maNewValues.assign(rVals);
      60           0 : }
      61             : 
      62         156 : }
      63             : 
      64             : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */

Generated by: LCOV version 1.11