LCOV - code coverage report
Current view: top level - libreoffice/solver/unxlngi6.pro/inc/tools - svborder.hxx (source / functions) Hit Total Coverage
Test: libreoffice_filtered.info Lines: 16 28 57.1 %
Date: 2012-12-17 Functions: 10 14 71.4 %
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             : #ifndef _SVBORDER_HXX
      21             : #define _SVBORDER_HXX
      22             : 
      23             : #include "tools/toolsdllapi.h"
      24             : #include <tools/gen.hxx>
      25             : 
      26             : class TOOLS_DLLPUBLIC SvBorder
      27             : {
      28             :     long nTop, nRight, nBottom, nLeft;
      29             : 
      30             : public:
      31        7128 :     SvBorder()
      32        7128 :     { nTop = nRight = nBottom = nLeft = 0; }
      33             :     SvBorder( const Size & rSz )
      34             :     { nTop = nBottom = rSz.Height(); nRight = nLeft = rSz.Width(); }
      35           0 :     SvBorder( long nLeftP, long nTopP, long nRightP, long nBottomP )
      36           0 :     { nLeft = nLeftP; nTop = nTopP; nRight = nRightP; nBottom = nBottomP; }
      37           0 :     sal_Bool    operator == ( const SvBorder & rObj ) const
      38             :             {
      39             :                 return nTop == rObj.nTop && nRight == rObj.nRight &&
      40           0 :                        nBottom == rObj.nBottom && nLeft == rObj.nLeft;
      41             :             }
      42           0 :     sal_Bool    operator != ( const SvBorder & rObj ) const
      43           0 :             { return !(*this == rObj); }
      44        6787 :     SvBorder & operator = ( const SvBorder & rBorder )
      45             :             {
      46        6787 :                 Left()   = rBorder.Left();
      47        6787 :                 Top()    = rBorder.Top();
      48        6787 :                 Right()  = rBorder.Right();
      49        6787 :                 Bottom() = rBorder.Bottom();
      50        6787 :                 return *this;
      51             :             }
      52           0 :     SvBorder & operator += ( const SvBorder & rBorder )
      53             :             {
      54           0 :                 Left()   += rBorder.Left();
      55           0 :                 Top()    += rBorder.Top();
      56           0 :                 Right()  += rBorder.Right();
      57           0 :                 Bottom() += rBorder.Bottom();
      58           0 :                 return *this;
      59             :             }
      60             :     SvBorder & operator -= ( const SvBorder & rBorder )
      61             :             {
      62             :                 Left()   -= rBorder.Left();
      63             :                 Top()    -= rBorder.Top();
      64             :                 Right()  -= rBorder.Right();
      65             :                 Bottom() -= rBorder.Bottom();
      66             :                 return *this;
      67             :             }
      68             :     sal_Bool    IsInside( const SvBorder & rInside )
      69             :             {
      70             :                 return nTop >= rInside.nTop && nRight >= rInside.nRight &&
      71             :                        nBottom >= rInside.nBottom && nLeft >= rInside.nLeft;
      72             :             }
      73       14190 :     long &  Top()    { return nTop; }
      74       12282 :     long &  Right()  { return nRight; }
      75       12252 :     long &  Bottom() { return nBottom; }
      76       12284 :     long &  Left()   { return nLeft; }
      77       14866 :     long    Top()    const { return nTop; }
      78       11518 :     long    Right()  const { return nRight; }
      79       11518 :     long    Bottom() const { return nBottom; }
      80       14866 :     long    Left()   const { return nLeft; }
      81             : };
      82             : 
      83             : TOOLS_DLLPUBLIC Rectangle & operator += ( Rectangle & rRect, const SvBorder & rBorder );
      84             : TOOLS_DLLPUBLIC Rectangle & operator -= ( Rectangle & rRect, const SvBorder & rBorder );
      85             : 
      86             : #endif
      87             : 
      88             : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */

Generated by: LCOV version 1.10