LCOV - code coverage report
Current view: top level - svx/source/sdr/contact - viewcontactofpageobj.cxx (source / functions) Hit Total Coverage
Test: libreoffice_filtered.info Lines: 14 21 66.7 %
Date: 2012-08-25 Functions: 5 6 83.3 %
Legend: Lines: hit not hit | Branches: + taken - not taken # not executed Branches: 3 22 13.6 %

           Branch data     Line data    Source code
       1                 :            : /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
       2                 :            : /*************************************************************************
       3                 :            :  *
       4                 :            :  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
       5                 :            :  *
       6                 :            :  * Copyright 2000, 2010 Oracle and/or its affiliates.
       7                 :            :  *
       8                 :            :  * OpenOffice.org - a multi-platform office productivity suite
       9                 :            :  *
      10                 :            :  * This file is part of OpenOffice.org.
      11                 :            :  *
      12                 :            :  * OpenOffice.org is free software: you can redistribute it and/or modify
      13                 :            :  * it under the terms of the GNU Lesser General Public License version 3
      14                 :            :  * only, as published by the Free Software Foundation.
      15                 :            :  *
      16                 :            :  * OpenOffice.org is distributed in the hope that it will be useful,
      17                 :            :  * but WITHOUT ANY WARRANTY; without even the implied warranty of
      18                 :            :  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
      19                 :            :  * GNU Lesser General Public License version 3 for more details
      20                 :            :  * (a copy is included in the LICENSE file that accompanied this code).
      21                 :            :  *
      22                 :            :  * You should have received a copy of the GNU Lesser General Public License
      23                 :            :  * version 3 along with OpenOffice.org.  If not, see
      24                 :            :  * <http://www.openoffice.org/license.html>
      25                 :            :  * for a copy of the LGPLv3 License.
      26                 :            :  *
      27                 :            :  ************************************************************************/
      28                 :            : 
      29                 :            : #include <svx/sdr/contact/viewcontactofpageobj.hxx>
      30                 :            : #include <svx/svdopage.hxx>
      31                 :            : #include <svx/sdr/contact/displayinfo.hxx>
      32                 :            : #include <vcl/outdev.hxx>
      33                 :            : #include <svx/svdmodel.hxx>
      34                 :            : #include <svx/svdpage.hxx>
      35                 :            : #include <svx/sdr/contact/objectcontactofobjlistpainter.hxx>
      36                 :            : #include <svx/sdr/contact/viewobjectcontact.hxx>
      37                 :            : #include <svx/sdr/contact/viewobjectcontactofpageobj.hxx>
      38                 :            : #include <basegfx/polygon/b2dpolygontools.hxx>
      39                 :            : #include <drawinglayer/primitive2d/polygonprimitive2d.hxx>
      40                 :            : 
      41                 :            : //////////////////////////////////////////////////////////////////////////////
      42                 :            : 
      43                 :            : namespace sdr
      44                 :            : {
      45                 :            :     namespace contact
      46                 :            :     {
      47                 :         11 :         ViewObjectContact& ViewContactOfPageObj::CreateObjectSpecificViewObjectContact(ObjectContact& rObjectContact)
      48                 :            :         {
      49         [ +  - ]:         11 :             ViewObjectContact* pRetval = new ViewObjectContactOfPageObj(rObjectContact, *this);
      50                 :         11 :             return *pRetval;
      51                 :            :         }
      52                 :            : 
      53                 :        604 :         ViewContactOfPageObj::ViewContactOfPageObj(SdrPageObj& rPageObj)
      54                 :        604 :         :   ViewContactOfSdrObj(rPageObj)
      55                 :            :         {
      56                 :        604 :         }
      57                 :            : 
      58                 :        541 :         ViewContactOfPageObj::~ViewContactOfPageObj()
      59                 :            :         {
      60         [ -  + ]:       1082 :         }
      61                 :            : 
      62                 :            :         // #i35972# React on changes of the object of this ViewContact
      63                 :       1612 :         void ViewContactOfPageObj::ActionChanged()
      64                 :            :         {
      65                 :            :             static bool bIsInActionChange(false);
      66                 :            : 
      67         [ +  - ]:       1612 :             if(!bIsInActionChange)
      68                 :            :             {
      69                 :            :                 // set recursion flag, see description in *.hxx
      70                 :       1612 :                 bIsInActionChange = true;
      71                 :            : 
      72                 :            :                 // call parent
      73                 :       1612 :                 ViewContactOfSdrObj::ActionChanged();
      74                 :            : 
      75                 :            :                 // reset recursion flag, see description in *.hxx
      76                 :       1612 :                 bIsInActionChange = false;
      77                 :            :             }
      78                 :       1612 :         }
      79                 :            : 
      80                 :          0 :         drawinglayer::primitive2d::Primitive2DSequence ViewContactOfPageObj::createViewIndependentPrimitive2DSequence() const
      81                 :            :         {
      82                 :            :             // ceate graphical visualisation data. Since this is the view-independent version which should not be used,
      83                 :            :             // create a replacement graphic visualisation here. Use GetLastBoundRect to access the model data directly
      84                 :            :             // which is aOutRect for SdrPageObj.
      85         [ #  # ]:          0 :             const Rectangle aModelRectangle(GetPageObj().GetLastBoundRect());
      86         [ #  # ]:          0 :             const basegfx::B2DRange aModelRange(aModelRectangle.Left(), aModelRectangle.Top(), aModelRectangle.Right(), aModelRectangle.Bottom());
      87         [ #  # ]:          0 :             const basegfx::B2DPolygon aOutline(basegfx::tools::createPolygonFromRect(aModelRange));
      88                 :          0 :             const basegfx::BColor aYellow(1.0, 1.0, 0.0);
      89 [ #  # ][ #  # ]:          0 :             const drawinglayer::primitive2d::Primitive2DReference xReference(new drawinglayer::primitive2d::PolygonHairlinePrimitive2D(aOutline, aYellow));
                 [ #  # ]
      90                 :            : 
      91 [ #  # ][ #  # ]:          0 :             return drawinglayer::primitive2d::Primitive2DSequence(&xReference, 1);
      92                 :            :         }
      93                 :            : 
      94                 :            :     } // end of namespace contact
      95                 :            : } // end of namespace sdr
      96                 :            : 
      97                 :            : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */

Generated by: LCOV version 1.10