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 sal_Bool
ScUndoDraw::IsLinked()
69 return pDrawUndo
->IsLinked();
74 void ScUndoDraw::SetLinked( sal_Bool bIsLinked
)
77 pDrawUndo
->SetLinked(bIsLinked
);
80 sal_Bool
ScUndoDraw::Merge( SfxUndoAction
* pNextAction
)
83 return pDrawUndo
->Merge(pNextAction
);
88 void ScUndoDraw::UpdateSubShell()
90 // #i26822# remove the draw shell if the selected object has been removed
91 ScTabViewShell
* pViewShell
= pDocShell
->GetBestViewShell();
93 pViewShell
->UpdateDrawShell();
96 void ScUndoDraw::Undo()
101 pDocShell
->SetDrawModified();
106 void ScUndoDraw::Redo()
111 pDocShell
->SetDrawModified();
116 void ScUndoDraw::Repeat(SfxRepeatTarget
& rTarget
)
119 pDrawUndo
->Repeat(rTarget
);
122 sal_Bool
ScUndoDraw::CanRepeat(SfxRepeatTarget
& rTarget
) const
125 return pDrawUndo
->CanRepeat(rTarget
);
130 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */