LCOV - code coverage report
Current view: top level - libreoffice/framework/source/layoutmanager - uielement.cxx (source / functions) Hit Total Coverage
Test: libreoffice_filtered.info Lines: 42 60 70.0 %
Date: 2012-12-27 Functions: 2 2 100.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 <uielement/uielement.hxx>
      21             : 
      22             : #include <com/sun/star/ui/DockingArea.hpp>
      23             : 
      24             : using namespace ::com::sun::star;
      25             : 
      26             : namespace framework
      27             : {
      28             : 
      29        2420 :     bool UIElement::operator< ( const ::framework::UIElement& aUIElement ) const
      30             : {
      31        2420 :     if ( !m_xUIElement.is() && aUIElement.m_xUIElement.is() )
      32           0 :         return false;
      33        2420 :     else if ( m_xUIElement.is() && !aUIElement.m_xUIElement.is() )
      34           0 :         return true;
      35        2420 :     else if ( !m_bVisible && aUIElement.m_bVisible )
      36        1008 :         return false;
      37        1412 :     else if ( m_bVisible && !aUIElement.m_bVisible )
      38         495 :         return true;
      39         917 :     else if ( !m_bFloating && aUIElement.m_bFloating )
      40           0 :         return true;
      41         917 :     else if ( m_bFloating && !aUIElement.m_bFloating )
      42           0 :         return false;
      43             :     else
      44             :     {
      45         917 :         if ( m_bFloating )
      46             :         {
      47           0 :             bool bEqual = ( m_aFloatingData.m_aPos.Y == aUIElement.m_aFloatingData.m_aPos.Y );
      48           0 :             if ( bEqual )
      49           0 :                 return ( m_aFloatingData.m_aPos.X < aUIElement.m_aFloatingData.m_aPos.X );
      50             :             else
      51           0 :                 return ( m_aFloatingData.m_aPos.Y < aUIElement.m_aFloatingData.m_aPos.Y );
      52             :         }
      53             :         else
      54             :         {
      55         917 :             if ( m_aDockedData.m_nDockedArea < aUIElement.m_aDockedData.m_nDockedArea )
      56           7 :                 return true;
      57         910 :             else if ( m_aDockedData.m_nDockedArea > aUIElement.m_aDockedData.m_nDockedArea )
      58         108 :                 return false;
      59             :             else
      60             :             {
      61         802 :                 if ( m_aDockedData.m_nDockedArea == ui::DockingArea_DOCKINGAREA_TOP ||
      62             :                      m_aDockedData.m_nDockedArea == ui::DockingArea_DOCKINGAREA_BOTTOM )
      63             :                 {
      64         802 :                     if ( !( m_aDockedData.m_aPos.Y == aUIElement.m_aDockedData.m_aPos.Y ) )
      65         797 :                         return  ( m_aDockedData.m_aPos.Y < aUIElement.m_aDockedData.m_aPos.Y );
      66             :                     else
      67             :                     {
      68           5 :                         bool bEqual = ( m_aDockedData.m_aPos.X == aUIElement.m_aDockedData.m_aPos.X );
      69           5 :                         if ( bEqual )
      70             :                         {
      71           5 :                             if ( m_bUserActive && !aUIElement.m_bUserActive )
      72           0 :                                 return sal_True;
      73             :                             else
      74           5 :                                 return sal_False;
      75             :                         }
      76             :                         else
      77           0 :                             return ( m_aDockedData.m_aPos.X <= aUIElement.m_aDockedData.m_aPos.X );
      78             :                     }
      79             :                 }
      80             :                 else
      81             :                 {
      82           0 :                     if ( !( m_aDockedData.m_aPos.X == aUIElement.m_aDockedData.m_aPos.X ) )
      83           0 :                         return ( m_aDockedData.m_aPos.X < aUIElement.m_aDockedData.m_aPos.X );
      84             :                     else
      85             :                     {
      86           0 :                         bool bEqual = ( m_aDockedData.m_aPos.Y == aUIElement.m_aDockedData.m_aPos.Y );
      87           0 :                         if ( bEqual )
      88             :                         {
      89           0 :                             if ( m_bUserActive && !aUIElement.m_bUserActive )
      90           0 :                                 return sal_True;
      91             :                             else
      92           0 :                                 return sal_False;
      93             :                         }
      94             :                         else
      95           0 :                             return ( m_aDockedData.m_aPos.Y <= aUIElement.m_aDockedData.m_aPos.Y );
      96             :                     }
      97             :                 }
      98             :             }
      99             :         }
     100             :     }
     101             : }
     102             : 
     103        5621 : UIElement& UIElement::operator= ( const UIElement& rUIElement )
     104             : {
     105        5621 :     if (&rUIElement != this)
     106             :     {
     107        5621 :         m_aType             = rUIElement.m_aType;
     108        5621 :         m_aName             = rUIElement.m_aName;
     109        5621 :         m_aUIName           = rUIElement.m_aUIName;
     110        5621 :         m_xUIElement        = rUIElement.m_xUIElement;
     111        5621 :         m_bFloating         = rUIElement.m_bFloating;
     112        5621 :         m_bVisible          = rUIElement.m_bVisible;
     113        5621 :         m_bUserActive       = rUIElement.m_bUserActive;
     114        5621 :         m_bCreateNewRowCol0 = rUIElement.m_bCreateNewRowCol0;
     115        5621 :         m_bDeactiveHide     = rUIElement.m_bDeactiveHide;
     116        5621 :         m_bMasterHide       = rUIElement.m_bMasterHide;
     117        5621 :         m_bContextSensitive = rUIElement.m_bContextSensitive;
     118        5621 :         m_bContextActive    = rUIElement.m_bContextActive;
     119        5621 :         m_bNoClose          = rUIElement.m_bNoClose;
     120        5621 :         m_bSoftClose        = rUIElement.m_bSoftClose;
     121        5621 :         m_bStateRead        = rUIElement.m_bStateRead;
     122        5621 :         m_nStyle            = rUIElement.m_nStyle;
     123        5621 :         m_aDockedData       = rUIElement.m_aDockedData;
     124        5621 :         m_aFloatingData     = rUIElement.m_aFloatingData;
     125             :     }
     126        5621 :     return *this;
     127             : }
     128             : 
     129             : } // namespace framework
     130             : 
     131             : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */

Generated by: LCOV version 1.10