LCOV - code coverage report
Current view: top level - sc/source/ui/undo - undosort.cxx (source / functions) Hit Total Coverage
Test: commit 10e77ab3ff6f4314137acd6e2702a6e5c1ce1fae Lines: 26 26 100.0 %
Date: 2014-11-03 Functions: 7 7 100.0 %
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 <undosort.hxx>
      11             : #include <globstr.hrc>
      12             : #include <global.hxx>
      13             : #include <undoutil.hxx>
      14             : 
      15             : namespace sc {
      16             : 
      17          44 : UndoSort::UndoSort( ScDocShell* pDocSh, const ReorderParam& rParam ) :
      18          44 :     ScSimpleUndo(pDocSh), maParam(rParam) {}
      19             : 
      20          86 : OUString UndoSort::GetComment() const
      21             : {
      22          86 :     return ScGlobal::GetRscString(STR_UNDO_SORT);
      23             : }
      24             : 
      25          18 : void UndoSort::Undo()
      26             : {
      27          18 :     BeginUndo();
      28          18 :     Execute(true);
      29          18 :     EndUndo();
      30          18 : }
      31             : 
      32          16 : void UndoSort::Redo()
      33             : {
      34          16 :     BeginRedo();
      35          16 :     Execute(false);
      36          16 :     EndRedo();
      37          16 : }
      38             : 
      39          34 : void UndoSort::Execute( bool bUndo )
      40             : {
      41          34 :     ScDocument& rDoc = pDocShell->GetDocument();
      42          34 :     sc::ReorderParam aParam = maParam;
      43          34 :     if (bUndo)
      44          18 :         aParam.reverse();
      45          34 :     rDoc.Reorder(aParam, NULL);
      46             : 
      47          34 :     ScUndoUtil::MarkSimpleBlock(pDocShell, maParam.maSortRange);
      48             : 
      49          34 :     rDoc.SetDirty(maParam.maSortRange);
      50          34 :     if (!aParam.mbUpdateRefs)
      51           4 :         rDoc.BroadcastCells(aParam.maSortRange, SC_HINT_DATACHANGED);
      52          34 : }
      53             : 
      54         228 : }
      55             : 
      56             : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */

Generated by: LCOV version 1.10