LCOV - code coverage report
Current view: top level - sc/source/ui/undo - undocell.cxx (source / functions) Hit Total Coverage
Test: commit 0e63ca4fde4e446f346e35849c756a30ca294aab Lines: 82 541 15.2 %
Date: 2014-04-11 Functions: 36 162 22.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             :  * This file incorporates work covered by the following license notice:
      10             :  *
      11             :  *   Licensed to the Apache Software Foundation (ASF) under one or more
      12             :  *   contributor license agreements. See the NOTICE file distributed
      13             :  *   with this work for additional information regarding copyright
      14             :  *   ownership. The ASF licenses this file to you under the Apache
      15             :  *   License, Version 2.0 (the "License"); you may not use this file
      16             :  *   except in compliance with the License. You may obtain a copy of
      17             :  *   the License at http://www.apache.org/licenses/LICENSE-2.0 .
      18             :  */
      19             : 
      20             : #include "undocell.hxx"
      21             : 
      22             : #include "scitems.hxx"
      23             : #include <editeng/eeitem.hxx>
      24             : #include <editeng/editobj.hxx>
      25             : #include <svl/zforlist.hxx>
      26             : #include "svl/sharedstringpool.hxx"
      27             : #include <sfx2/app.hxx>
      28             : 
      29             : #include "document.hxx"
      30             : #include "docpool.hxx"
      31             : #include "patattr.hxx"
      32             : #include "docsh.hxx"
      33             : #include "tabvwsh.hxx"
      34             : #include "globstr.hrc"
      35             : #include "global.hxx"
      36             : #include "formulacell.hxx"
      37             : #include "target.hxx"
      38             : #include "undoolk.hxx"
      39             : #include "detdata.hxx"
      40             : #include "stlpool.hxx"
      41             : #include "printfun.hxx"
      42             : #include "rangenam.hxx"
      43             : #include "chgtrack.hxx"
      44             : #include "sc.hrc"
      45             : #include "docuno.hxx"
      46             : #include "stringutil.hxx"
      47             : 
      48             : using ::boost::shared_ptr;
      49             : 
      50             : namespace HelperNotifyChanges
      51             : {
      52           0 :     void NotifyIfChangesListeners(ScDocShell &rDocShell, const ScAddress &rPos,
      53             :         const ScUndoEnterData::ValuesType &rOldValues, const OUString &rType = OUString("cell-change"))
      54             :     {
      55           0 :         if (ScModelObj* pModelObj = getMustPropagateChangesModel(rDocShell))
      56             :         {
      57           0 :             ScRangeList aChangeRanges;
      58             : 
      59           0 :             for (size_t i = 0, n = rOldValues.size(); i < n; ++i)
      60             :             {
      61           0 :                 aChangeRanges.Append( ScRange(rPos.Col(), rPos.Row(), rOldValues[i].mnTab));
      62             :             }
      63             : 
      64           0 :             Notify(*pModelObj, aChangeRanges, rType);
      65             :         }
      66           0 :     }
      67             : }
      68             : 
      69           0 : TYPEINIT1(ScUndoCursorAttr, ScSimpleUndo);
      70           0 : TYPEINIT1(ScUndoEnterData, ScSimpleUndo);
      71           0 : TYPEINIT1(ScUndoEnterValue, ScSimpleUndo);
      72           0 : TYPEINIT1(ScUndoSetCell, ScSimpleUndo);
      73           0 : TYPEINIT1(ScUndoPageBreak, ScSimpleUndo);
      74           0 : TYPEINIT1(ScUndoPrintZoom, ScSimpleUndo);
      75           0 : TYPEINIT1(ScUndoThesaurus, ScSimpleUndo);
      76           0 : TYPEINIT1(ScUndoReplaceNote, ScSimpleUndo);
      77           0 : TYPEINIT1(ScUndoShowHideNote, ScSimpleUndo);
      78           0 : TYPEINIT1(ScUndoDetective, ScSimpleUndo);
      79           0 : TYPEINIT1(ScUndoRangeNames, ScSimpleUndo);
      80             : 
      81           0 : ScUndoCursorAttr::ScUndoCursorAttr( ScDocShell* pNewDocShell,
      82             :             SCCOL nNewCol, SCROW nNewRow, SCTAB nNewTab,
      83             :             const ScPatternAttr* pOldPat, const ScPatternAttr* pNewPat,
      84             :             const ScPatternAttr* pApplyPat, bool bAutomatic ) :
      85             :     ScSimpleUndo( pNewDocShell ),
      86             :     nCol( nNewCol ),
      87             :     nRow( nNewRow ),
      88             :     nTab( nNewTab ),
      89             :     pOldEditData( static_cast<EditTextObject*>(NULL) ),
      90             :     pNewEditData( static_cast<EditTextObject*>(NULL) ),
      91           0 :     bIsAutomatic( bAutomatic )
      92             : {
      93           0 :     ScDocumentPool* pPool = pDocShell->GetDocument()->GetPool();
      94           0 :     pNewPattern = (ScPatternAttr*) &pPool->Put( *pNewPat );
      95           0 :     pOldPattern = (ScPatternAttr*) &pPool->Put( *pOldPat );
      96           0 :     pApplyPattern = (ScPatternAttr*) &pPool->Put( *pApplyPat );
      97           0 : }
      98             : 
      99           0 : ScUndoCursorAttr::~ScUndoCursorAttr()
     100             : {
     101           0 :     ScDocumentPool* pPool = pDocShell->GetDocument()->GetPool();
     102           0 :     pPool->Remove(*pNewPattern);
     103           0 :     pPool->Remove(*pOldPattern);
     104           0 :     pPool->Remove(*pApplyPattern);
     105           0 : }
     106             : 
     107           0 : OUString ScUndoCursorAttr::GetComment() const
     108             : {
     109             :     //! own text for automatic attribution
     110             : 
     111           0 :     sal_uInt16 nId = STR_UNDO_CURSORATTR;        // "Attribute"
     112           0 :     return ScGlobal::GetRscString( nId );
     113             : }
     114             : 
     115           0 : void ScUndoCursorAttr::SetEditData( EditTextObject* pOld, EditTextObject* pNew )
     116             : {
     117           0 :     pOldEditData.reset(pOld);
     118           0 :     pNewEditData.reset(pNew);
     119           0 : }
     120             : 
     121           0 : void ScUndoCursorAttr::DoChange( const ScPatternAttr* pWhichPattern, const shared_ptr<EditTextObject>& pEditData ) const
     122             : {
     123           0 :     ScDocument* pDoc = pDocShell->GetDocument();
     124           0 :     ScAddress aPos(nCol, nRow, nTab);
     125           0 :     pDoc->SetPattern( nCol, nRow, nTab, *pWhichPattern, true );
     126             : 
     127           0 :     if (pDoc->GetCellType(aPos) == CELLTYPE_EDIT && pEditData)
     128           0 :         pDoc->SetEditText(aPos, *pEditData, NULL);
     129             : 
     130           0 :     ScTabViewShell* pViewShell = ScTabViewShell::GetActiveViewShell();
     131           0 :     if (pViewShell)
     132             :     {
     133           0 :         pViewShell->SetTabNo( nTab );
     134           0 :         pViewShell->MoveCursorAbs( nCol, nRow, SC_FOLLOW_JUMP, false, false );
     135           0 :         pViewShell->AdjustBlockHeight();
     136             :     }
     137             : 
     138           0 :     const SfxItemSet& rApplySet = pApplyPattern->GetItemSet();
     139           0 :     bool bPaintExt = ( rApplySet.GetItemState( ATTR_SHADOW, true ) != SFX_ITEM_DEFAULT ||
     140           0 :                        rApplySet.GetItemState( ATTR_CONDITIONAL, true ) != SFX_ITEM_DEFAULT );
     141           0 :     bool bPaintRows = ( rApplySet.GetItemState( ATTR_HOR_JUSTIFY, true ) != SFX_ITEM_DEFAULT );
     142             : 
     143           0 :     sal_uInt16 nFlags = SC_PF_TESTMERGE;
     144           0 :     if (bPaintExt)
     145           0 :         nFlags |= SC_PF_LINES;
     146           0 :     if (bPaintRows)
     147           0 :         nFlags |= SC_PF_WHOLEROWS;
     148           0 :     pDocShell->PostPaint( nCol,nRow,nTab, nCol,nRow,nTab, PAINT_GRID, nFlags );
     149           0 : }
     150             : 
     151           0 : void ScUndoCursorAttr::Undo()
     152             : {
     153           0 :     BeginUndo();
     154           0 :     DoChange(pOldPattern, pOldEditData);
     155             : 
     156           0 :     if ( bIsAutomatic )
     157             :     {
     158             :         // if automatic formatting is reversed, then
     159             :         // automatic formatting should also not continue to be done
     160             : 
     161           0 :         ScTabViewShell* pViewShell = ScTabViewShell::GetActiveViewShell();
     162           0 :         if (pViewShell)
     163           0 :             pViewShell->ForgetFormatArea();
     164             :     }
     165             : 
     166           0 :     EndUndo();
     167           0 : }
     168             : 
     169           0 : void ScUndoCursorAttr::Redo()
     170             : {
     171           0 :     BeginRedo();
     172           0 :     DoChange(pNewPattern, pNewEditData);
     173           0 :     EndRedo();
     174           0 : }
     175             : 
     176           0 : void ScUndoCursorAttr::Repeat(SfxRepeatTarget& rTarget)
     177             : {
     178           0 :     if (rTarget.ISA(ScTabViewTarget))
     179           0 :         ((ScTabViewTarget&)rTarget).GetViewShell()->ApplySelectionPattern( *pApplyPattern );
     180           0 : }
     181             : 
     182           0 : bool ScUndoCursorAttr::CanRepeat(SfxRepeatTarget& rTarget) const
     183             : {
     184           0 :     return rTarget.ISA(ScTabViewTarget);
     185             : }
     186             : 
     187        1165 : ScUndoEnterData::Value::Value() : mnTab(-1), mbHasFormat(false), mnFormat(0) {}
     188             : 
     189        1165 : ScUndoEnterData::ScUndoEnterData(
     190             :     ScDocShell* pNewDocShell, const ScAddress& rPos, ValuesType& rOldValues,
     191             :     const OUString& rNewStr, EditTextObject* pObj ) :
     192             :     ScSimpleUndo( pNewDocShell ),
     193             :     maNewString(rNewStr),
     194             :     mpNewEditData(pObj),
     195             :     mnEndChangeAction(0),
     196        1165 :     maPos(rPos)
     197             : {
     198        1165 :     maOldValues.swap(rOldValues);
     199             : 
     200        1165 :     SetChangeTrack();
     201        1165 : }
     202             : 
     203        2330 : ScUndoEnterData::~ScUndoEnterData() {}
     204             : 
     205        1169 : OUString ScUndoEnterData::GetComment() const
     206             : {
     207        1169 :     return ScGlobal::GetRscString( STR_UNDO_ENTERDATA ); // "Input"
     208             : }
     209             : 
     210           0 : void ScUndoEnterData::DoChange() const
     211             : {
     212             :     // only when needed (old or new Edit cell, or Attribute)?
     213           0 :     for (size_t i = 0, n = maOldValues.size(); i < n; ++i)
     214           0 :         pDocShell->AdjustRowHeight(maPos.Row(), maPos.Row(), maOldValues[i].mnTab);
     215             : 
     216           0 :     ScTabViewShell* pViewShell = ScTabViewShell::GetActiveViewShell();
     217           0 :     if (pViewShell)
     218             :     {
     219           0 :         pViewShell->SetTabNo(maPos.Tab());
     220           0 :         pViewShell->MoveCursorAbs(maPos.Col(), maPos.Row(), SC_FOLLOW_JUMP, false, false);
     221             :     }
     222             : 
     223           0 :     pDocShell->PostDataChanged();
     224           0 : }
     225             : 
     226        1165 : void ScUndoEnterData::SetChangeTrack()
     227             : {
     228        1165 :     ScChangeTrack* pChangeTrack = pDocShell->GetDocument()->GetChangeTrack();
     229        1165 :     if ( pChangeTrack )
     230             :     {
     231           0 :         mnEndChangeAction = pChangeTrack->GetActionMax() + 1;
     232           0 :         ScAddress aPos(maPos);
     233           0 :         for (size_t i = 0, n = maOldValues.size(); i < n; ++i)
     234             :         {
     235           0 :             aPos.SetTab(maOldValues[i].mnTab);
     236           0 :             sal_uLong nFormat = 0;
     237           0 :             if (maOldValues[i].mbHasFormat)
     238           0 :                 nFormat = maOldValues[i].mnFormat;
     239           0 :             pChangeTrack->AppendContent(aPos, maOldValues[i].maCell, nFormat);
     240             :         }
     241           0 :         if ( mnEndChangeAction > pChangeTrack->GetActionMax() )
     242           0 :             mnEndChangeAction = 0;       // nothing is appended
     243             :     }
     244             :     else
     245        1165 :         mnEndChangeAction = 0;
     246        1165 : }
     247             : 
     248           0 : void ScUndoEnterData::Undo()
     249             : {
     250           0 :     BeginUndo();
     251             : 
     252           0 :     ScDocument* pDoc = pDocShell->GetDocument();
     253           0 :     for (size_t i = 0, n = maOldValues.size(); i < n; ++i)
     254             :     {
     255           0 :         Value& rVal = maOldValues[i];
     256           0 :         ScCellValue aNewCell;
     257           0 :         aNewCell.assign(rVal.maCell, *pDoc, SC_CLONECELL_STARTLISTENING);
     258           0 :         ScAddress aPos = maPos;
     259           0 :         aPos.SetTab(rVal.mnTab);
     260           0 :         aNewCell.release(*pDoc, aPos);
     261             : 
     262           0 :         if (rVal.mbHasFormat)
     263           0 :             pDoc->ApplyAttr(maPos.Col(), maPos.Row(), rVal.mnTab,
     264           0 :                             SfxUInt32Item(ATTR_VALUE_FORMAT, rVal.mnFormat));
     265             :         else
     266             :         {
     267           0 :             ScPatternAttr aPattern(*pDoc->GetPattern(maPos.Col(), maPos.Row(), rVal.mnTab));
     268           0 :             aPattern.GetItemSet().ClearItem( ATTR_VALUE_FORMAT );
     269           0 :             pDoc->SetPattern(maPos.Col(), maPos.Row(), rVal.mnTab, aPattern, true);
     270             :         }
     271           0 :         pDocShell->PostPaintCell(maPos.Col(), maPos.Row(), rVal.mnTab);
     272           0 :     }
     273             : 
     274           0 :     ScChangeTrack* pChangeTrack = pDoc->GetChangeTrack();
     275           0 :     size_t nCount = maOldValues.size();
     276           0 :     if ( pChangeTrack && mnEndChangeAction >= sal::static_int_cast<sal_uLong>(nCount) )
     277           0 :         pChangeTrack->Undo( mnEndChangeAction - nCount + 1, mnEndChangeAction );
     278             : 
     279           0 :     DoChange();
     280           0 :     EndUndo();
     281             : 
     282           0 :     HelperNotifyChanges::NotifyIfChangesListeners(*pDocShell, maPos, maOldValues);
     283           0 : }
     284             : 
     285           0 : void ScUndoEnterData::Redo()
     286             : {
     287           0 :     BeginRedo();
     288             : 
     289           0 :     ScDocument* pDoc = pDocShell->GetDocument();
     290           0 :     for (size_t i = 0, n = maOldValues.size(); i < n; ++i)
     291             :     {
     292           0 :         SCTAB nTab = maOldValues[i].mnTab;
     293           0 :         if (mpNewEditData)
     294             :         {
     295           0 :             ScAddress aPos = maPos;
     296           0 :             aPos.SetTab(nTab);
     297             :             // edit text wil be cloned.
     298           0 :             pDoc->SetEditText(aPos, *mpNewEditData, NULL);
     299             :         }
     300             :         else
     301           0 :             pDoc->SetString(maPos.Col(), maPos.Row(), nTab, maNewString);
     302             : 
     303           0 :         pDocShell->PostPaintCell(maPos.Col(), maPos.Row(), nTab);
     304             :     }
     305             : 
     306           0 :     SetChangeTrack();
     307             : 
     308           0 :     DoChange();
     309           0 :     EndRedo();
     310             : 
     311           0 :     HelperNotifyChanges::NotifyIfChangesListeners(*pDocShell, maPos, maOldValues);
     312           0 : }
     313             : 
     314           0 : void ScUndoEnterData::Repeat(SfxRepeatTarget& rTarget)
     315             : {
     316           0 :     if (rTarget.ISA(ScTabViewTarget))
     317             :     {
     318           0 :         OUString aTemp = maNewString;
     319           0 :         ((ScTabViewTarget&)rTarget).GetViewShell()->EnterDataAtCursor( aTemp );
     320             :     }
     321           0 : }
     322             : 
     323           2 : bool ScUndoEnterData::CanRepeat(SfxRepeatTarget& rTarget) const
     324             : {
     325           2 :     return rTarget.ISA(ScTabViewTarget);
     326             : }
     327             : 
     328             : 
     329           0 : ScUndoEnterValue::ScUndoEnterValue(
     330             :     ScDocShell* pNewDocShell, const ScAddress& rNewPos,
     331             :     const ScCellValue& rUndoCell, double nVal ) :
     332             :     ScSimpleUndo( pNewDocShell ),
     333             :     aPos        ( rNewPos ),
     334             :     maOldCell(rUndoCell),
     335           0 :     nValue      ( nVal )
     336             : {
     337           0 :     SetChangeTrack();
     338           0 : }
     339             : 
     340           0 : ScUndoEnterValue::~ScUndoEnterValue()
     341             : {
     342           0 : }
     343             : 
     344           0 : OUString ScUndoEnterValue::GetComment() const
     345             : {
     346           0 :     return ScGlobal::GetRscString( STR_UNDO_ENTERDATA ); // "Input"
     347             : }
     348             : 
     349           0 : void ScUndoEnterValue::SetChangeTrack()
     350             : {
     351           0 :     ScDocument* pDoc = pDocShell->GetDocument();
     352           0 :     ScChangeTrack* pChangeTrack = pDoc->GetChangeTrack();
     353           0 :     if ( pChangeTrack )
     354             :     {
     355           0 :         nEndChangeAction = pChangeTrack->GetActionMax() + 1;
     356           0 :         pChangeTrack->AppendContent(aPos, maOldCell);
     357           0 :         if ( nEndChangeAction > pChangeTrack->GetActionMax() )
     358           0 :             nEndChangeAction = 0;       // nothing is appended
     359             :     }
     360             :     else
     361           0 :         nEndChangeAction = 0;
     362           0 : }
     363             : 
     364           0 : void ScUndoEnterValue::Undo()
     365             : {
     366           0 :     BeginUndo();
     367             : 
     368           0 :     ScDocument* pDoc = pDocShell->GetDocument();
     369           0 :     ScCellValue aNewCell;
     370           0 :     aNewCell.assign(maOldCell, *pDoc, SC_CLONECELL_STARTLISTENING);
     371           0 :     aNewCell.release(*pDoc, aPos);
     372             : 
     373           0 :     pDocShell->PostPaintCell( aPos );
     374             : 
     375           0 :     ScChangeTrack* pChangeTrack = pDoc->GetChangeTrack();
     376           0 :     if ( pChangeTrack )
     377           0 :         pChangeTrack->Undo( nEndChangeAction, nEndChangeAction );
     378             : 
     379           0 :     EndUndo();
     380           0 : }
     381             : 
     382           0 : void ScUndoEnterValue::Redo()
     383             : {
     384           0 :     BeginRedo();
     385             : 
     386           0 :     ScDocument* pDoc = pDocShell->GetDocument();
     387           0 :     pDoc->SetValue( aPos.Col(), aPos.Row(), aPos.Tab(), nValue );
     388           0 :     pDocShell->PostPaintCell( aPos );
     389             : 
     390           0 :     SetChangeTrack();
     391             : 
     392           0 :     EndRedo();
     393           0 : }
     394             : 
     395           0 : void ScUndoEnterValue::Repeat(SfxRepeatTarget& /* rTarget */)
     396             : {
     397             :     // makes no sense
     398           0 : }
     399             : 
     400           0 : bool ScUndoEnterValue::CanRepeat(SfxRepeatTarget& /* rTarget */) const
     401             : {
     402           0 :     return false;
     403             : }
     404             : 
     405        5040 : ScUndoSetCell::ScUndoSetCell( ScDocShell* pDocSh, const ScAddress& rPos, const ScCellValue& rOldVal, const ScCellValue& rNewVal ) :
     406        5040 :     ScSimpleUndo(pDocSh), maPos(rPos), maOldValue(rOldVal), maNewValue(rNewVal), mnEndChangeAction(0)
     407             : {
     408        5040 :     SetChangeTrack();
     409        5040 : }
     410             : 
     411       10080 : ScUndoSetCell::~ScUndoSetCell() {}
     412             : 
     413           0 : void ScUndoSetCell::Undo()
     414             : {
     415           0 :     BeginUndo();
     416           0 :     SetValue(maOldValue);
     417           0 :     pDocShell->PostPaintCell(maPos);
     418             : 
     419           0 :     ScDocument* pDoc = pDocShell->GetDocument();
     420           0 :     ScChangeTrack* pChangeTrack = pDoc->GetChangeTrack();
     421           0 :     if (pChangeTrack)
     422           0 :         pChangeTrack->Undo(mnEndChangeAction, mnEndChangeAction);
     423             : 
     424           0 :     EndUndo();
     425           0 : }
     426             : 
     427           0 : void ScUndoSetCell::Redo()
     428             : {
     429           0 :     BeginRedo();
     430           0 :     SetValue(maNewValue);
     431           0 :     pDocShell->PostPaintCell(maPos);
     432           0 :     SetChangeTrack();
     433           0 :     EndRedo();
     434           0 : }
     435             : 
     436           0 : void ScUndoSetCell::Repeat( SfxRepeatTarget& /*rTarget*/ )
     437             : {
     438             :     // Makes no sense.
     439           0 : }
     440             : 
     441          30 : bool ScUndoSetCell::CanRepeat( SfxRepeatTarget& /*rTarget*/ ) const
     442             : {
     443          30 :     return false;
     444             : }
     445             : 
     446        5070 : OUString ScUndoSetCell::GetComment() const
     447             : {
     448        5070 :     return ScGlobal::GetRscString(STR_UNDO_ENTERDATA); // "Input"
     449             : }
     450             : 
     451        5040 : void ScUndoSetCell::SetChangeTrack()
     452             : {
     453        5040 :     ScDocument* pDoc = pDocShell->GetDocument();
     454        5040 :     ScChangeTrack* pChangeTrack = pDoc->GetChangeTrack();
     455        5040 :     if (pChangeTrack)
     456             :     {
     457           0 :         mnEndChangeAction = pChangeTrack->GetActionMax() + 1;
     458             : 
     459           0 :         pChangeTrack->AppendContent(maPos, maOldValue);
     460             : 
     461           0 :         if (mnEndChangeAction > pChangeTrack->GetActionMax())
     462           0 :             mnEndChangeAction = 0;       // Nothing is appended
     463             :     }
     464             :     else
     465        5040 :         mnEndChangeAction = 0;
     466        5040 : }
     467             : 
     468           0 : void ScUndoSetCell::SetValue( const ScCellValue& rVal )
     469             : {
     470           0 :     ScDocument* pDoc = pDocShell->GetDocument();
     471             : 
     472           0 :     switch (rVal.meType)
     473             :     {
     474             :         case CELLTYPE_NONE:
     475             :             // empty cell
     476           0 :             pDoc->SetEmptyCell(maPos);
     477           0 :         break;
     478             :         case CELLTYPE_VALUE:
     479           0 :             pDoc->SetValue(maPos, rVal.mfValue);
     480           0 :         break;
     481             :         case CELLTYPE_STRING:
     482             :         {
     483           0 :             ScSetStringParam aParam;
     484           0 :             aParam.setTextInput();
     485           0 :             pDoc->SetString(maPos, rVal.mpString->getString());
     486             :         }
     487           0 :         break;
     488             :         case CELLTYPE_EDIT:
     489           0 :             pDoc->SetEditText(maPos, rVal.mpEditText->Clone());
     490           0 :         break;
     491             :         case CELLTYPE_FORMULA:
     492           0 :             pDoc->SetFormulaCell(maPos, rVal.mpFormula->Clone());
     493           0 :         break;
     494             :         default:
     495             :             ;
     496             :     }
     497           0 : }
     498             : 
     499           4 : ScUndoPageBreak::ScUndoPageBreak( ScDocShell* pNewDocShell,
     500             :             SCCOL nNewCol, SCROW nNewRow, SCTAB nNewTab,
     501             :             bool bNewColumn, bool bNewInsert ) :
     502             :     ScSimpleUndo( pNewDocShell ),
     503             :     nCol( nNewCol ),
     504             :     nRow( nNewRow ),
     505             :     nTab( nNewTab ),
     506             :     bColumn( bNewColumn ),
     507           4 :     bInsert( bNewInsert )
     508             : {
     509           4 : }
     510             : 
     511           8 : ScUndoPageBreak::~ScUndoPageBreak()
     512             : {
     513           8 : }
     514             : 
     515           4 : OUString ScUndoPageBreak::GetComment() const
     516             : {
     517             :     //"Column break" | "Row break"  "insert" | "delete"
     518             :     return OUString ( bColumn ?
     519             :         ( bInsert ?
     520             :             ScGlobal::GetRscString( STR_UNDO_INSCOLBREAK ) :
     521             :             ScGlobal::GetRscString( STR_UNDO_DELCOLBREAK )
     522             :         ) :
     523             :         ( bInsert ?
     524             :             ScGlobal::GetRscString( STR_UNDO_INSROWBREAK ) :
     525             :             ScGlobal::GetRscString( STR_UNDO_DELROWBREAK )
     526           4 :         ) );
     527             : }
     528             : 
     529           0 : void ScUndoPageBreak::DoChange( bool bInsertP ) const
     530             : {
     531           0 :     ScTabViewShell* pViewShell = ScTabViewShell::GetActiveViewShell();
     532             : 
     533           0 :     if (pViewShell)
     534             :     {
     535           0 :         pViewShell->SetTabNo( nTab );
     536           0 :         pViewShell->MoveCursorAbs( nCol, nRow, SC_FOLLOW_JUMP, false, false );
     537             : 
     538           0 :         if (bInsertP)
     539           0 :             pViewShell->InsertPageBreak(bColumn, false);
     540             :         else
     541           0 :             pViewShell->DeletePageBreak(bColumn, false);
     542             : 
     543           0 :         pDocShell->GetDocument()->InvalidatePageBreaks(nTab);
     544             :     }
     545           0 : }
     546             : 
     547           0 : void ScUndoPageBreak::Undo()
     548             : {
     549           0 :     BeginUndo();
     550           0 :     DoChange(!bInsert);
     551           0 :     EndUndo();
     552           0 : }
     553             : 
     554           0 : void ScUndoPageBreak::Redo()
     555             : {
     556           0 :     BeginRedo();
     557           0 :     DoChange(bInsert);
     558           0 :     EndRedo();
     559           0 : }
     560             : 
     561           0 : void ScUndoPageBreak::Repeat(SfxRepeatTarget& rTarget)
     562             : {
     563           0 :     if (rTarget.ISA(ScTabViewTarget))
     564             :     {
     565           0 :         ScTabViewShell& rViewShell = *((ScTabViewTarget&)rTarget).GetViewShell();
     566             : 
     567           0 :         if (bInsert)
     568           0 :             rViewShell.InsertPageBreak(bColumn, true);
     569             :         else
     570           0 :             rViewShell.DeletePageBreak(bColumn, true);
     571             :     }
     572           0 : }
     573             : 
     574           0 : bool ScUndoPageBreak::CanRepeat(SfxRepeatTarget& rTarget) const
     575             : {
     576           0 :     return rTarget.ISA(ScTabViewTarget);
     577             : }
     578             : 
     579           0 : ScUndoPrintZoom::ScUndoPrintZoom( ScDocShell* pNewDocShell,
     580             :             SCTAB nT, sal_uInt16 nOS, sal_uInt16 nOP, sal_uInt16 nNS, sal_uInt16 nNP ) :
     581             :     ScSimpleUndo( pNewDocShell ),
     582             :     nTab( nT ),
     583             :     nOldScale( nOS ),
     584             :     nOldPages( nOP ),
     585             :     nNewScale( nNS ),
     586           0 :     nNewPages( nNP )
     587             : {
     588           0 : }
     589             : 
     590           0 : ScUndoPrintZoom::~ScUndoPrintZoom()
     591             : {
     592           0 : }
     593             : 
     594           0 : OUString ScUndoPrintZoom::GetComment() const
     595             : {
     596           0 :     return ScGlobal::GetRscString( STR_UNDO_PRINTSCALE );
     597             : }
     598             : 
     599           0 : void ScUndoPrintZoom::DoChange( bool bUndo )
     600             : {
     601           0 :     sal_uInt16 nScale = bUndo ? nOldScale : nNewScale;
     602           0 :     sal_uInt16 nPages = bUndo ? nOldPages : nNewPages;
     603             : 
     604           0 :     ScDocument* pDoc = pDocShell->GetDocument();
     605           0 :     OUString aStyleName = pDoc->GetPageStyle( nTab );
     606           0 :     ScStyleSheetPool* pStylePool = pDoc->GetStyleSheetPool();
     607           0 :     SfxStyleSheetBase* pStyleSheet = pStylePool->Find( aStyleName, SFX_STYLE_FAMILY_PAGE );
     608             :     OSL_ENSURE( pStyleSheet, "PageStyle not found" );
     609           0 :     if ( pStyleSheet )
     610             :     {
     611           0 :         SfxItemSet& rSet = pStyleSheet->GetItemSet();
     612           0 :         rSet.Put( SfxUInt16Item( ATTR_PAGE_SCALE, nScale ) );
     613           0 :         rSet.Put( SfxUInt16Item( ATTR_PAGE_SCALETOPAGES, nPages ) );
     614             : 
     615           0 :         ScPrintFunc aPrintFunc( pDocShell, pDocShell->GetPrinter(), nTab );
     616           0 :         aPrintFunc.UpdatePages();
     617           0 :     }
     618           0 : }
     619             : 
     620           0 : void ScUndoPrintZoom::Undo()
     621             : {
     622           0 :     BeginUndo();
     623           0 :     DoChange(true);
     624           0 :     EndUndo();
     625           0 : }
     626             : 
     627           0 : void ScUndoPrintZoom::Redo()
     628             : {
     629           0 :     BeginRedo();
     630           0 :     DoChange(false);
     631           0 :     EndRedo();
     632           0 : }
     633             : 
     634           0 : void ScUndoPrintZoom::Repeat(SfxRepeatTarget& rTarget)
     635             : {
     636           0 :     if (rTarget.ISA(ScTabViewTarget))
     637             :     {
     638           0 :         ScTabViewShell& rViewShell = *((ScTabViewTarget&)rTarget).GetViewShell();
     639           0 :         ScViewData* pViewData = rViewShell.GetViewData();
     640           0 :         pViewData->GetDocShell()->SetPrintZoom( pViewData->GetTabNo(), nNewScale, nNewPages );
     641             :     }
     642           0 : }
     643             : 
     644           0 : bool ScUndoPrintZoom::CanRepeat(SfxRepeatTarget& rTarget) const
     645             : {
     646           0 :     return rTarget.ISA(ScTabViewTarget);
     647             : }
     648             : 
     649           0 : ScUndoThesaurus::ScUndoThesaurus(
     650             :     ScDocShell* pNewDocShell, SCCOL nNewCol, SCROW nNewRow, SCTAB nNewTab,
     651             :     const ScCellValue& rOldText, const ScCellValue& rNewText ) :
     652             :     ScSimpleUndo( pNewDocShell ),
     653             :     nCol( nNewCol ),
     654             :     nRow( nNewRow ),
     655             :     nTab( nNewTab ),
     656             :     maOldText(rOldText),
     657           0 :     maNewText(rNewText)
     658             : {
     659           0 :     SetChangeTrack(maOldText);
     660           0 : }
     661             : 
     662           0 : ScUndoThesaurus::~ScUndoThesaurus() {}
     663             : 
     664           0 : OUString ScUndoThesaurus::GetComment() const
     665             : {
     666           0 :     return ScGlobal::GetRscString( STR_UNDO_THESAURUS );    // "Thesaurus"
     667             : }
     668             : 
     669           0 : void ScUndoThesaurus::SetChangeTrack( const ScCellValue& rOldCell )
     670             : {
     671           0 :     ScChangeTrack* pChangeTrack = pDocShell->GetDocument()->GetChangeTrack();
     672           0 :     if ( pChangeTrack )
     673             :     {
     674           0 :         nEndChangeAction = pChangeTrack->GetActionMax() + 1;
     675           0 :         pChangeTrack->AppendContent(ScAddress(nCol, nRow, nTab), rOldCell);
     676           0 :         if ( nEndChangeAction > pChangeTrack->GetActionMax() )
     677           0 :             nEndChangeAction = 0;       // nothing is appended
     678             :     }
     679             :     else
     680           0 :         nEndChangeAction = 0;
     681           0 : }
     682             : 
     683           0 : void ScUndoThesaurus::DoChange( bool bUndo, const ScCellValue& rText )
     684             : {
     685           0 :     ScDocument* pDoc = pDocShell->GetDocument();
     686             : 
     687           0 :     ScTabViewShell* pViewShell = ScTabViewShell::GetActiveViewShell();
     688           0 :     if (pViewShell)
     689             :     {
     690           0 :         pViewShell->SetTabNo( nTab );
     691           0 :         pViewShell->MoveCursorAbs( nCol, nRow, SC_FOLLOW_JUMP, false, false );
     692             :     }
     693             : 
     694           0 :     ScAddress aPos(nCol, nRow, nTab);
     695           0 :     rText.commit(*pDoc, aPos);
     696           0 :     if (!bUndo)
     697           0 :         SetChangeTrack(maOldText);
     698             : 
     699           0 :     pDocShell->PostPaintCell( nCol, nRow, nTab );
     700           0 : }
     701             : 
     702           0 : void ScUndoThesaurus::Undo()
     703             : {
     704           0 :     BeginUndo();
     705           0 :     DoChange(true, maOldText);
     706           0 :     ScChangeTrack* pChangeTrack = pDocShell->GetDocument()->GetChangeTrack();
     707           0 :     if ( pChangeTrack )
     708           0 :         pChangeTrack->Undo( nEndChangeAction, nEndChangeAction );
     709           0 :     EndUndo();
     710           0 : }
     711             : 
     712           0 : void ScUndoThesaurus::Redo()
     713             : {
     714           0 :     BeginRedo();
     715           0 :     DoChange(false, maNewText);
     716           0 :     EndRedo();
     717           0 : }
     718             : 
     719           0 : void ScUndoThesaurus::Repeat(SfxRepeatTarget& rTarget)
     720             : {
     721           0 :     if (rTarget.ISA(ScTabViewTarget))
     722           0 :         ((ScTabViewTarget&)rTarget).GetViewShell()->DoThesaurus( true );
     723           0 : }
     724             : 
     725           0 : bool ScUndoThesaurus::CanRepeat(SfxRepeatTarget& rTarget) const
     726             : {
     727           0 :     return rTarget.ISA(ScTabViewTarget);
     728             : }
     729             : 
     730           0 : ScUndoReplaceNote::ScUndoReplaceNote( ScDocShell& rDocShell, const ScAddress& rPos,
     731             :         const ScNoteData& rNoteData, bool bInsert, SdrUndoAction* pDrawUndo ) :
     732             :     ScSimpleUndo( &rDocShell ),
     733             :     maPos( rPos ),
     734           0 :     mpDrawUndo( pDrawUndo )
     735             : {
     736             :     OSL_ENSURE( rNoteData.mpCaption, "ScUndoReplaceNote::ScUndoReplaceNote - missing note caption" );
     737           0 :     (bInsert ? maNewData : maOldData) = rNoteData;
     738           0 : }
     739             : 
     740           7 : ScUndoReplaceNote::ScUndoReplaceNote( ScDocShell& rDocShell, const ScAddress& rPos,
     741             :         const ScNoteData& rOldData, const ScNoteData& rNewData, SdrUndoAction* pDrawUndo ) :
     742             :     ScSimpleUndo( &rDocShell ),
     743             :     maPos( rPos ),
     744             :     maOldData( rOldData ),
     745             :     maNewData( rNewData ),
     746           7 :     mpDrawUndo( pDrawUndo )
     747             : {
     748             :     OSL_ENSURE( maOldData.mpCaption || maNewData.mpCaption, "ScUndoReplaceNote::ScUndoReplaceNote - missing note captions" );
     749             :     OSL_ENSURE( !maOldData.mxInitData.get() && !maNewData.mxInitData.get(), "ScUndoReplaceNote::ScUndoReplaceNote - unexpected unitialized note" );
     750           7 : }
     751             : 
     752          21 : ScUndoReplaceNote::~ScUndoReplaceNote()
     753             : {
     754           7 :     DeleteSdrUndoAction( mpDrawUndo );
     755          14 : }
     756             : 
     757           0 : void ScUndoReplaceNote::Undo()
     758             : {
     759           0 :     BeginUndo();
     760           0 :     DoSdrUndoAction( mpDrawUndo, pDocShell->GetDocument() );
     761             :     /*  Undo insert -> remove new note.
     762             :         Undo remove -> insert old note.
     763             :         Undo replace -> remove new note, insert old note. */
     764           0 :     DoRemoveNote( maNewData );
     765           0 :     DoInsertNote( maOldData );
     766           0 :     pDocShell->PostPaintCell( maPos );
     767           0 :     EndUndo();
     768           0 : }
     769             : 
     770           0 : void ScUndoReplaceNote::Redo()
     771             : {
     772           0 :     BeginRedo();
     773           0 :     RedoSdrUndoAction( mpDrawUndo );
     774             :     /*  Redo insert -> insert new note.
     775             :         Redo remove -> remove old note.
     776             :         Redo replace -> remove old note, insert new note. */
     777           0 :     DoRemoveNote( maOldData );
     778           0 :     DoInsertNote( maNewData );
     779           0 :     pDocShell->PostPaintCell( maPos );
     780           0 :     EndRedo();
     781           0 : }
     782             : 
     783           0 : void ScUndoReplaceNote::Repeat( SfxRepeatTarget& /*rTarget*/ )
     784             : {
     785           0 : }
     786             : 
     787           0 : bool ScUndoReplaceNote::CanRepeat( SfxRepeatTarget& /*rTarget*/ ) const
     788             : {
     789           0 :     return false;
     790             : }
     791             : 
     792           7 : OUString ScUndoReplaceNote::GetComment() const
     793             : {
     794             :     return ScGlobal::GetRscString( maNewData.mpCaption ?
     795           7 :         (maOldData.mpCaption ? STR_UNDO_EDITNOTE : STR_UNDO_INSERTNOTE) : STR_UNDO_DELETENOTE );
     796             : }
     797             : 
     798           0 : void ScUndoReplaceNote::DoInsertNote( const ScNoteData& rNoteData )
     799             : {
     800           0 :     if( rNoteData.mpCaption )
     801             :     {
     802           0 :         ScDocument& rDoc = *pDocShell->GetDocument();
     803             :         OSL_ENSURE( !rDoc.GetNote(maPos), "ScUndoReplaceNote::DoInsertNote - unexpected cell note" );
     804           0 :         ScPostIt* pNote = new ScPostIt( rDoc, maPos, rNoteData, false );
     805           0 :         rDoc.SetNote( maPos, pNote );
     806             :     }
     807           0 : }
     808             : 
     809           0 : void ScUndoReplaceNote::DoRemoveNote( const ScNoteData& rNoteData )
     810             : {
     811           0 :     if( rNoteData.mpCaption )
     812             :     {
     813           0 :         ScDocument& rDoc = *pDocShell->GetDocument();
     814             :         OSL_ENSURE( rDoc.GetNote(maPos), "ScUndoReplaceNote::DoRemoveNote - missing cell note" );
     815           0 :         if( ScPostIt* pNote = rDoc.ReleaseNote( maPos ) )
     816             :         {
     817             :             /*  Forget pointer to caption object to suppress removing the
     818             :                 caption object from the drawing layer while deleting pNote
     819             :                 (removing the caption is done by a drawing undo action). */
     820           0 :             pNote->ForgetCaption();
     821           0 :             delete pNote;
     822             :         }
     823             :     }
     824           0 : }
     825             : 
     826           1 : ScUndoShowHideNote::ScUndoShowHideNote( ScDocShell& rDocShell, const ScAddress& rPos, bool bShow ) :
     827             :     ScSimpleUndo( &rDocShell ),
     828             :     maPos( rPos ),
     829           1 :     mbShown( bShow )
     830             : {
     831           1 : }
     832             : 
     833           2 : ScUndoShowHideNote::~ScUndoShowHideNote()
     834             : {
     835           2 : }
     836             : 
     837           0 : void ScUndoShowHideNote::Undo()
     838             : {
     839           0 :     BeginUndo();
     840           0 :     if( ScPostIt* pNote = pDocShell->GetDocument()->GetNote(maPos) )
     841           0 :         pNote->ShowCaption( maPos, !mbShown );
     842           0 :     EndUndo();
     843           0 : }
     844             : 
     845           0 : void ScUndoShowHideNote::Redo()
     846             : {
     847           0 :     BeginRedo();
     848           0 :     if( ScPostIt* pNote = pDocShell->GetDocument()->GetNote(maPos) )
     849           0 :         pNote->ShowCaption( maPos, mbShown );
     850           0 :     EndRedo();
     851           0 : }
     852             : 
     853           0 : void ScUndoShowHideNote::Repeat( SfxRepeatTarget& /*rTarget*/ )
     854             : {
     855           0 : }
     856             : 
     857           0 : bool ScUndoShowHideNote::CanRepeat( SfxRepeatTarget& /*rTarget*/ ) const
     858             : {
     859           0 :     return false;
     860             : }
     861             : 
     862           1 : OUString ScUndoShowHideNote::GetComment() const
     863             : {
     864           1 :     return ScGlobal::GetRscString( mbShown ? STR_UNDO_SHOWNOTE : STR_UNDO_HIDENOTE );
     865             : }
     866             : 
     867           1 : ScUndoDetective::ScUndoDetective( ScDocShell* pNewDocShell,
     868             :                                     SdrUndoAction* pDraw, const ScDetOpData* pOperation,
     869             :                                     ScDetOpList* pUndoList ) :
     870             :     ScSimpleUndo( pNewDocShell ),
     871             :     pOldList    ( pUndoList ),
     872             :     nAction     ( 0 ),
     873           1 :     pDrawUndo   ( pDraw )
     874             : {
     875           1 :     bIsDelete = ( pOperation == NULL );
     876           1 :     if (!bIsDelete)
     877             :     {
     878           1 :         nAction = (sal_uInt16) pOperation->GetOperation();
     879           1 :         aPos = pOperation->GetPos();
     880             :     }
     881           1 : }
     882             : 
     883           3 : ScUndoDetective::~ScUndoDetective()
     884             : {
     885           1 :     DeleteSdrUndoAction( pDrawUndo );
     886           1 :     delete pOldList;
     887           2 : }
     888             : 
     889           1 : OUString ScUndoDetective::GetComment() const
     890             : {
     891           1 :     sal_uInt16 nId = STR_UNDO_DETDELALL;
     892           1 :     if ( !bIsDelete )
     893           1 :         switch ( (ScDetOpType) nAction )
     894             :         {
     895           0 :             case SCDETOP_ADDSUCC:   nId = STR_UNDO_DETADDSUCC;  break;
     896           0 :             case SCDETOP_DELSUCC:   nId = STR_UNDO_DETDELSUCC;  break;
     897           1 :             case SCDETOP_ADDPRED:   nId = STR_UNDO_DETADDPRED;  break;
     898           0 :             case SCDETOP_DELPRED:   nId = STR_UNDO_DETDELPRED;  break;
     899           0 :             case SCDETOP_ADDERROR:  nId = STR_UNDO_DETADDERROR; break;
     900             :         }
     901             : 
     902           1 :     return ScGlobal::GetRscString( nId );
     903             : }
     904             : 
     905           0 : void ScUndoDetective::Undo()
     906             : {
     907           0 :     BeginUndo();
     908             : 
     909           0 :     ScDocument* pDoc = pDocShell->GetDocument();
     910           0 :     DoSdrUndoAction(pDrawUndo, pDoc);
     911             : 
     912           0 :     if (bIsDelete)
     913             :     {
     914           0 :         if ( pOldList )
     915           0 :             pDoc->SetDetOpList( new ScDetOpList(*pOldList) );
     916             :     }
     917             :     else
     918             :     {
     919             :         // Remove entry from list
     920             : 
     921           0 :         ScDetOpList* pList = pDoc->GetDetOpList();
     922           0 :         if (pList && pList->Count())
     923             :         {
     924           0 :             ScDetOpDataVector& rVec = pList->GetDataVector();
     925           0 :             ScDetOpDataVector::iterator it = rVec.begin() + rVec.size() - 1;
     926           0 :             if ( it->GetOperation() == (ScDetOpType) nAction && it->GetPos() == aPos )
     927           0 :                 rVec.erase( it);
     928             :             else
     929             :             {
     930             :                 OSL_FAIL("Detective entry could not be found in list");
     931             :             }
     932             :         }
     933             :     }
     934             : 
     935           0 :     ScTabViewShell* pViewShell = ScTabViewShell::GetActiveViewShell();
     936           0 :     if (pViewShell)
     937           0 :         pViewShell->RecalcPPT();    //! use broadcast instead?
     938             : 
     939           0 :     EndUndo();
     940           0 : }
     941             : 
     942           0 : void ScUndoDetective::Redo()
     943             : {
     944           0 :     BeginRedo();
     945             : 
     946           0 :     RedoSdrUndoAction(pDrawUndo);
     947             : 
     948           0 :     ScDocument* pDoc = pDocShell->GetDocument();
     949             : 
     950           0 :     if (bIsDelete)
     951           0 :         pDoc->ClearDetectiveOperations();
     952             :     else
     953           0 :         pDoc->AddDetectiveOperation( ScDetOpData( aPos, (ScDetOpType) nAction ) );
     954             : 
     955           0 :     ScTabViewShell* pViewShell = ScTabViewShell::GetActiveViewShell();
     956           0 :     if (pViewShell)
     957           0 :         pViewShell->RecalcPPT();    //! use broadcast instead?
     958             : 
     959           0 :     EndRedo();
     960           0 : }
     961             : 
     962           0 : void ScUndoDetective::Repeat(SfxRepeatTarget& /* rTarget */)
     963             : {
     964             :     // makes no sense
     965           0 : }
     966             : 
     967           0 : bool ScUndoDetective::CanRepeat(SfxRepeatTarget& /* rTarget */) const
     968             : {
     969           0 :     return false;
     970             : }
     971             : 
     972          31 : ScUndoRangeNames::ScUndoRangeNames( ScDocShell* pNewDocShell,
     973             :                                     ScRangeName* pOld, ScRangeName* pNew, SCTAB nTab ) :
     974             :     ScSimpleUndo( pNewDocShell ),
     975             :     pOldRanges  ( pOld ),
     976             :     pNewRanges  ( pNew ),
     977          31 :     mnTab       ( nTab )
     978             : {
     979          31 : }
     980             : 
     981          93 : ScUndoRangeNames::~ScUndoRangeNames()
     982             : {
     983          31 :     delete pOldRanges;
     984          31 :     delete pNewRanges;
     985          62 : }
     986             : 
     987          33 : OUString ScUndoRangeNames::GetComment() const
     988             : {
     989          33 :     return ScGlobal::GetRscString( STR_UNDO_RANGENAMES );
     990             : }
     991             : 
     992           0 : void ScUndoRangeNames::DoChange( bool bUndo )
     993             : {
     994           0 :     ScDocument* pDoc = pDocShell->GetDocument();
     995           0 :     pDoc->PreprocessRangeNameUpdate();
     996             : 
     997           0 :     if ( bUndo )
     998             :     {
     999           0 :         if (mnTab >= 0)
    1000           0 :             pDoc->SetRangeName( mnTab, new ScRangeName( *pOldRanges ) );
    1001             :         else
    1002           0 :             pDoc->SetRangeName( new ScRangeName( *pOldRanges ) );
    1003             :     }
    1004             :     else
    1005             :     {
    1006           0 :         if (mnTab >= 0)
    1007           0 :             pDoc->SetRangeName( mnTab, new ScRangeName( *pNewRanges ) );
    1008             :         else
    1009           0 :             pDoc->SetRangeName( new ScRangeName( *pNewRanges ) );
    1010             :     }
    1011             : 
    1012           0 :     pDoc->PostprocessRangeNameUpdate();
    1013             : 
    1014           0 :     SFX_APP()->Broadcast( SfxSimpleHint( SC_HINT_AREAS_CHANGED ) );
    1015           0 : }
    1016             : 
    1017           0 : void ScUndoRangeNames::Undo()
    1018             : {
    1019           0 :     BeginUndo();
    1020           0 :     DoChange( true );
    1021           0 :     EndUndo();
    1022           0 : }
    1023             : 
    1024           0 : void ScUndoRangeNames::Redo()
    1025             : {
    1026           0 :     BeginRedo();
    1027           0 :     DoChange( false );
    1028           0 :     EndRedo();
    1029           0 : }
    1030             : 
    1031           0 : void ScUndoRangeNames::Repeat(SfxRepeatTarget& /* rTarget */)
    1032             : {
    1033             :     // makes no sense
    1034           0 : }
    1035             : 
    1036           2 : bool ScUndoRangeNames::CanRepeat(SfxRepeatTarget& /* rTarget */) const
    1037             : {
    1038           2 :     return false;
    1039         102 : }
    1040             : 
    1041             : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */

Generated by: LCOV version 1.10