LCOV - code coverage report
Current view: top level - svx/source/sdr/contact - viewcontactofgroup.cxx (source / functions) Hit Total Coverage
Test: libreoffice_filtered.info Lines: 23 23 100.0 %
Date: 2012-08-25 Functions: 5 5 100.0 %
Legend: Lines: hit not hit | Branches: + taken - not taken # not executed Branches: 17 30 56.7 %

           Branch data     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/sdr/contact/viewcontactofgroup.hxx>
      21                 :            : #include <svx/svdogrp.hxx>
      22                 :            : #include <svx/svdpage.hxx>
      23                 :            : #include <svx/sdr/contact/viewobjectcontact.hxx>
      24                 :            : #include <svx/sdr/contact/viewobjectcontactofgroup.hxx>
      25                 :            : #include <basegfx/polygon/b2dpolygon.hxx>
      26                 :            : #include <basegfx/polygon/b2dpolygontools.hxx>
      27                 :            : #include <basegfx/color/bcolor.hxx>
      28                 :            : #include <drawinglayer/primitive2d/polygonprimitive2d.hxx>
      29                 :            : #include <drawinglayer/primitive2d/sdrdecompositiontools2d.hxx>
      30                 :            : 
      31                 :            : //////////////////////////////////////////////////////////////////////////////
      32                 :            : 
      33                 :            : namespace sdr
      34                 :            : {
      35                 :            :     namespace contact
      36                 :            :     {
      37                 :            :         // Create a Object-Specific ViewObjectContact, set ViewContact and
      38                 :            :         // ObjectContact. Always needs to return something.
      39                 :      21565 :         ViewObjectContact& ViewContactOfGroup::CreateObjectSpecificViewObjectContact(ObjectContact& rObjectContact)
      40                 :            :         {
      41         [ +  - ]:      21565 :             ViewObjectContact* pRetval = new ViewObjectContactOfGroup(rObjectContact, *this);
      42                 :            :             DBG_ASSERT(pRetval, "ViewContactOfGroup::CreateObjectSpecificViewObjectContact() failed (!)");
      43                 :            : 
      44                 :      21565 :             return *pRetval;
      45                 :            :         }
      46                 :            : 
      47                 :      34814 :         ViewContactOfGroup::ViewContactOfGroup(SdrObjGroup& rGroup)
      48                 :      34814 :         :   ViewContactOfSdrObj(rGroup)
      49                 :            :         {
      50                 :      34814 :         }
      51                 :            : 
      52                 :      34814 :         ViewContactOfGroup::~ViewContactOfGroup()
      53                 :            :         {
      54         [ -  + ]:      69628 :         }
      55                 :            : 
      56                 :         85 :         drawinglayer::primitive2d::Primitive2DSequence ViewContactOfGroup::createViewIndependentPrimitive2DSequence() const
      57                 :            :         {
      58                 :         85 :             drawinglayer::primitive2d::Primitive2DSequence xRetval;
      59         [ +  - ]:         85 :             const sal_uInt32 nObjectCount(GetObjectCount());
      60                 :            : 
      61         [ +  + ]:         85 :             if(nObjectCount)
      62                 :            :             {
      63                 :            :                 // collect all sub-primitives
      64         [ +  + ]:         70 :                 for(sal_uInt32 a(0); a < nObjectCount; a++)
      65                 :            :                 {
      66         [ +  - ]:         53 :                     const ViewContact& rCandidate(GetViewContact(a));
      67         [ +  - ]:         53 :                     const drawinglayer::primitive2d::Primitive2DSequence aCandSeq(rCandidate.getViewIndependentPrimitive2DSequence());
      68                 :            : 
      69         [ +  - ]:         53 :                     drawinglayer::primitive2d::appendPrimitive2DSequenceToPrimitive2DSequence(xRetval, aCandSeq);
      70         [ +  - ]:         53 :                 }
      71                 :            :             }
      72                 :            :             else
      73                 :            :             {
      74                 :            :                 // append an invisible outline for the cases where no visible content exists
      75         [ +  - ]:         68 :                 const Rectangle aCurrentBoundRect(GetSdrObjGroup().GetLastBoundRect());
      76                 :            :                 const basegfx::B2DRange aCurrentRange(
      77                 :         68 :                     aCurrentBoundRect.Left(), aCurrentBoundRect.Top(),
      78         [ +  - ]:        136 :                     aCurrentBoundRect.Right(), aCurrentBoundRect.Bottom());
      79                 :            : 
      80                 :            :                 const drawinglayer::primitive2d::Primitive2DReference xReference(
      81                 :            :                     drawinglayer::primitive2d::createHiddenGeometryPrimitives2D(
      82         [ +  - ]:         68 :                         false, aCurrentRange));
      83                 :            : 
      84 [ +  - ][ +  - ]:         68 :                 xRetval = drawinglayer::primitive2d::Primitive2DSequence(&xReference, 1);
                 [ +  - ]
      85                 :            :             }
      86                 :            : 
      87                 :         85 :             return xRetval;
      88                 :            :         }
      89                 :            :     } // end of namespace contact
      90                 :            : } // end of namespace sdr
      91                 :            : 
      92                 :            : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */

Generated by: LCOV version 1.10