1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
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/.
9 * This file incorporates work covered by the following license notice:
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 .
20 #include <svx/svdundo.hxx>
22 #include "undodraw.hxx"
24 #include "tabvwsh.hxx"
26 TYPEINIT1(ScUndoDraw
, SfxUndoAction
);
28 ScUndoDraw::ScUndoDraw( SfxUndoAction
* pUndo
, ScDocShell
* pDocSh
) :
34 ScUndoDraw::~ScUndoDraw()
39 void ScUndoDraw::ForgetDrawUndo()
41 pDrawUndo
= NULL
; // do not delete (DrawUndo has to be remembered from outside)
44 OUString
ScUndoDraw::GetComment() const
47 return pDrawUndo
->GetComment();
51 OUString
ScUndoDraw::GetRepeatComment(SfxRepeatTarget
& rTarget
) const
54 return pDrawUndo
->GetRepeatComment(rTarget
);
58 sal_uInt16
ScUndoDraw::GetId() const
61 return pDrawUndo
->GetId();
66 void ScUndoDraw::SetLinkToSfxLinkUndoAction(SfxLinkUndoAction
* pSfxLinkUndoAction
)
69 pDrawUndo
->SetLinkToSfxLinkUndoAction(pSfxLinkUndoAction
);
71 SetLinkToSfxLinkUndoAction(pSfxLinkUndoAction
);
74 bool ScUndoDraw::Merge( SfxUndoAction
* pNextAction
)
77 return pDrawUndo
->Merge(pNextAction
);
82 void ScUndoDraw::UpdateSubShell()
84 // #i26822# remove the draw shell if the selected object has been removed
85 ScTabViewShell
* pViewShell
= pDocShell
->GetBestViewShell();
87 pViewShell
->UpdateDrawShell();
90 void ScUndoDraw::Undo()
95 pDocShell
->SetDrawModified();
100 void ScUndoDraw::Redo()
105 pDocShell
->SetDrawModified();
110 void ScUndoDraw::Repeat(SfxRepeatTarget
& rTarget
)
113 pDrawUndo
->Repeat(rTarget
);
116 bool ScUndoDraw::CanRepeat(SfxRepeatTarget
& rTarget
) const
119 return pDrawUndo
->CanRepeat(rTarget
);
124 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */