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 <undodraw.hxx>
22 #include <tabvwsh.hxx>
25 ScUndoDraw::ScUndoDraw( std::unique_ptr
<SfxUndoAction
> pUndo
, ScDocShell
* pDocSh
) :
26 pDrawUndo( std::move(pUndo
) ),
30 if (ScTabViewShell
* pViewShell
= ScTabViewShell::GetActiveViewShell())
31 mnViewShellId
= pViewShell
->GetViewShellId();
34 ScUndoDraw::~ScUndoDraw()
38 OUString
ScUndoDraw::GetComment() const
41 return pDrawUndo
->GetComment();
45 ViewShellId
ScUndoDraw::GetViewShellId() const
50 OUString
ScUndoDraw::GetRepeatComment(SfxRepeatTarget
& rTarget
) const
53 return pDrawUndo
->GetRepeatComment(rTarget
);
57 bool ScUndoDraw::Merge( SfxUndoAction
* pNextAction
)
60 return pDrawUndo
->Merge(pNextAction
);
65 void ScUndoDraw::UpdateSubShell()
67 // #i26822# remove the draw shell if the selected object has been removed
68 ScTabViewShell
* pViewShell
= pDocShell
->GetBestViewShell();
70 pViewShell
->UpdateDrawShell();
73 void ScUndoDraw::Undo()
78 pDocShell
->SetDrawModified();
83 void ScUndoDraw::Redo()
88 pDocShell
->SetDrawModified();
93 void ScUndoDraw::Repeat(SfxRepeatTarget
& rTarget
)
96 pDrawUndo
->Repeat(rTarget
);
99 bool ScUndoDraw::CanRepeat(SfxRepeatTarget
& rTarget
) const
102 return pDrawUndo
->CanRepeat(rTarget
);
107 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */