update credits
[LibreOffice.git] / sw / source / ui / ribbar / dselect.cxx
blob6d21a80b19ec523461e5577b140acb1fafaa237a
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*
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>
21 #include "view.hxx"
22 #include "edtwin.hxx"
23 #include "wrtsh.hxx"
24 #include "cmdid.h"
25 #include "drawbase.hxx"
26 #include "dselect.hxx"
28 DrawSelection::DrawSelection(SwWrtShell* pWrtShell, SwEditWin* pEditWin, SwView* pSwView) :
29 SwDrawBase(pWrtShell, pEditWin, pSwView)
31 m_bCreateObj = false;
34 // Process keyboard events
36 // If a KeyEvent is processed then the return value is sal_True, otherwise
37 // Sal_False.
39 sal_Bool DrawSelection::KeyInput(const KeyEvent& rKEvt)
41 sal_Bool bReturn = sal_False;
43 switch (rKEvt.GetKeyCode().GetCode())
45 case KEY_ESCAPE:
47 if (m_pWin->IsDrawAction())
49 m_pSh->BreakMark();
50 m_pWin->ReleaseMouse();
52 bReturn = sal_True;
54 break;
57 if (!bReturn)
58 bReturn = SwDrawBase::KeyInput(rKEvt);
60 return (bReturn);
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: */