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 <sfx2/bindings.hxx>
25 #include "drawbase.hxx"
26 #include "dselect.hxx"
28 DrawSelection::DrawSelection(SwWrtShell
* pWrtShell
, SwEditWin
* pEditWin
, SwView
* pSwView
) :
29 SwDrawBase(pWrtShell
, pEditWin
, pSwView
)
34 // Process keyboard events
36 // If a KeyEvent is processed then the return value is sal_True, otherwise
39 sal_Bool
DrawSelection::KeyInput(const KeyEvent
& rKEvt
)
41 sal_Bool bReturn
= sal_False
;
43 switch (rKEvt
.GetKeyCode().GetCode())
47 if (m_pWin
->IsDrawAction())
50 m_pWin
->ReleaseMouse();
58 bReturn
= SwDrawBase::KeyInput(rKEvt
);
63 void DrawSelection::Activate(const sal_uInt16 nSlotId
)
65 m_pWin
->SetSdrDrawMode(OBJ_NONE
);
66 m_pWin
->SetObjectSelect( sal_True
);
67 SwDrawBase::Activate(nSlotId
);
69 m_pSh
->GetView().GetViewFrame()->GetBindings().Invalidate(SID_INSERT_DRAW
);
72 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */