LCOV - code coverage report
Current view: top level - sw/source/core/uibase/ribbar - conform.cxx (source / functions) Hit Total Coverage
Test: commit 0e63ca4fde4e446f346e35849c756a30ca294aab Lines: 0 48 0.0 %
Date: 2014-04-11 Functions: 0 4 0.0 %
Legend: Lines: hit not hit

          Line data    Source code
       1             : /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
       2             : /*
       3             :  * This file is part of the LibreOffice project.
       4             :  *
       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/.
       8             :  *
       9             :  * This file incorporates work covered by the following license notice:
      10             :  *
      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 .
      18             :  */
      19             : 
      20             : #include <svx/fmglob.hxx>
      21             : #include <svx/svdview.hxx>
      22             : #include <svx/fmshell.hxx>
      23             : 
      24             : #include "view.hxx"
      25             : #include "edtwin.hxx"
      26             : #include "wrtsh.hxx"
      27             : #include "drawbase.hxx"
      28             : #include "conform.hxx"
      29             : 
      30             : extern bool bNoInterrupt;       // in mainwn.cxx
      31             : 
      32           0 : ConstFormControl::ConstFormControl(SwWrtShell* pWrtShell, SwEditWin* pEditWin, SwView* pSwView) :
      33           0 :     SwDrawBase(pWrtShell, pEditWin, pSwView)
      34             : {
      35           0 :     m_bInsForm = true;
      36           0 : }
      37             : 
      38           0 : sal_Bool ConstFormControl::MouseButtonDown(const MouseEvent& rMEvt)
      39             : {
      40           0 :     sal_Bool bReturn = sal_False;
      41             : 
      42           0 :     SdrView *pSdrView = m_pSh->GetDrawView();
      43             : 
      44           0 :     pSdrView->SetOrtho(rMEvt.IsShift());
      45           0 :     pSdrView->SetAngleSnapEnabled(rMEvt.IsShift());
      46             : 
      47           0 :     if (rMEvt.IsMod2())
      48             :     {
      49           0 :         pSdrView->SetCreate1stPointAsCenter(true);
      50           0 :         pSdrView->SetResizeAtCenter(true);
      51             :     }
      52             :     else
      53             :     {
      54           0 :         pSdrView->SetCreate1stPointAsCenter(false);
      55           0 :         pSdrView->SetResizeAtCenter(false);
      56             :     }
      57             : 
      58           0 :     SdrViewEvent aVEvt;
      59           0 :     SdrHitKind eHit = pSdrView->PickAnything(rMEvt, SDRMOUSEBUTTONDOWN, aVEvt);
      60             : 
      61             :     // Only new object; if not in base mode (or pure selection mode)
      62           0 :     if (rMEvt.IsLeft() && !m_pWin->IsDrawAction() &&
      63           0 :         (eHit == SDRHIT_UNMARKEDOBJECT || eHit == SDRHIT_NONE || m_pSh->IsDrawCreate()))
      64             :     {
      65           0 :         bNoInterrupt = true;
      66           0 :         m_pWin->CaptureMouse();
      67             : 
      68           0 :         m_pWin->SetPointer(Pointer(POINTER_DRAW_RECT));
      69             : 
      70           0 :         m_aStartPos = m_pWin->PixelToLogic(rMEvt.GetPosPixel());
      71           0 :         bReturn = m_pSh->BeginCreate( static_cast< sal_uInt16 >(m_pWin->GetSdrDrawMode()), FmFormInventor, m_aStartPos);
      72             : 
      73           0 :         if (bReturn)
      74           0 :             m_pWin->SetDrawAction(sal_True);
      75             :     }
      76             :     else
      77           0 :         bReturn = SwDrawBase::MouseButtonDown(rMEvt);
      78             : 
      79           0 :     return (bReturn);
      80             : }
      81             : 
      82           0 : void ConstFormControl::Activate(const sal_uInt16 nSlotId)
      83             : {
      84           0 :     m_pWin->SetSdrDrawMode( static_cast<SdrObjKind>(nSlotId) );
      85           0 :     SwDrawBase::Activate(nSlotId);
      86           0 :     m_pSh->GetDrawView()->SetCurrentObj(nSlotId);
      87             : 
      88           0 :     m_pWin->SetPointer(Pointer(POINTER_DRAW_RECT));
      89           0 : }
      90             : 
      91           0 : void ConstFormControl::CreateDefaultObject()
      92             : {
      93           0 :     Point aStartPos(GetDefaultCenterPos());
      94           0 :     Point aEndPos(aStartPos);
      95           0 :     aStartPos.X() -= 2 * MM50;
      96           0 :     aStartPos.Y() -= MM50;
      97           0 :     aEndPos.X() += 2 * MM50;
      98           0 :     aEndPos.Y() += MM50;
      99             : 
     100           0 :     if(!m_pSh->HasDrawView())
     101           0 :         m_pSh->MakeDrawView();
     102             : 
     103           0 :     SdrView *pSdrView = m_pSh->GetDrawView();
     104           0 :     pSdrView->SetDesignMode(true);
     105           0 :     m_pSh->BeginCreate( static_cast< sal_uInt16 >(m_pWin->GetSdrDrawMode()), FmFormInventor, aStartPos);
     106           0 :     m_pSh->MoveCreate(aEndPos);
     107           0 :     m_pSh->EndCreate(SDRCREATE_FORCEEND);
     108           0 : }
     109             : 
     110             : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */

Generated by: LCOV version 1.10