LCOV - code coverage report
Current view: top level - sw/inc - tabcol.hxx (source / functions) Hit Total Coverage
Test: commit 0e63ca4fde4e446f346e35849c756a30ca294aab Lines: 17 18 94.4 %
Date: 2014-04-11 Functions: 17 18 94.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             : #ifndef INCLUDED_SW_INC_TABCOL_HXX
      20             : #define INCLUDED_SW_INC_TABCOL_HXX
      21             : 
      22             : #include <tools/solar.h>
      23             : 
      24             : #include <vector>
      25             : #include "swdllapi.h"
      26             : 
      27             : struct SwTabColsEntry
      28             : {
      29             :     long    nPos;
      30             :     long    nMin;
      31             :     long    nMax;
      32             :     sal_Bool    bHidden; // For each entry a flag, hidden or not.
      33             :                          // If the flag bHidden is sal_True column separator
      34             :                          // is not in current line. It must maintained
      35             :                          // but it may not be displayed.
      36             : };
      37             : 
      38             : typedef std::vector< SwTabColsEntry > SwTabColsEntries;
      39             : 
      40        4071 : class SW_DLLPUBLIC SwTabCols
      41             : {
      42             :     long nLeftMin,      // Leftmost border (reference point) for
      43             :                         // document coordinates.
      44             :                         // All other values are relative to this point!
      45             :             nLeft,      // Left border of table.
      46             :            nRight,      // Right border of table.
      47             :            nRightMax;   // Maximum right border of table.
      48             : 
      49             :     bool bLastRowAllowedToChange;       // If the last row of the table frame
      50             :                                         // is split across pages, it may not
      51             :                                         // change its size.
      52             : 
      53             :     SwTabColsEntries aData;
      54             : 
      55             :     //For the CopyCTor.
      56        1874 :     const SwTabColsEntries& GetData() const { return aData; }
      57             : 
      58             : public:
      59             :     SwTabCols( sal_uInt16 nSize = 0 );
      60             :     SwTabCols( const SwTabCols& );
      61             :     SwTabCols &operator=( const SwTabCols& );
      62             :     bool operator==( const SwTabCols& rCmp ) const;
      63       32279 :     long& operator[]( size_t nPos ) { return aData[nPos].nPos; }
      64        9020 :     long operator[]( size_t nPos ) const { return aData[nPos].nPos; }
      65       53515 :     size_t Count() const { return aData.size(); }
      66             : 
      67        4577 :     sal_Bool IsHidden( size_t nPos ) const         { return aData[nPos].bHidden; }
      68           0 :     void SetHidden( size_t nPos, sal_Bool bValue ) { aData[nPos].bHidden = bValue; }
      69             : 
      70             :     void Insert( long nValue, sal_Bool bValue, size_t nPos );
      71             :     void Insert( long nValue, long nMin, long nMax, sal_Bool bValue, size_t nPos );
      72             :     void Remove( size_t nPos, size_t nAnz = 1 );
      73             : 
      74             :     const SwTabColsEntry& GetEntry( size_t nPos ) const { return aData[nPos]; }
      75        4661 :           SwTabColsEntry& GetEntry( size_t nPos )  { return aData[nPos]; }
      76             : 
      77        1901 :     long GetLeftMin() const { return nLeftMin; }
      78       42647 :     long GetLeft()  const { return nLeft;    }
      79       19887 :     long GetRight() const { return nRight;   }
      80        1881 :     long GetRightMax()const { return nRightMax;}
      81             : 
      82        2197 :     void SetLeftMin ( long nNew )   { nLeftMin = nNew; }
      83        2197 :     void SetLeft    ( long nNew )   { nLeft = nNew;    }
      84        2197 :     void SetRight   ( long nNew )   { nRight = nNew;   }
      85        2197 :     void SetRightMax( long nNew )   { nRightMax = nNew;}
      86             : 
      87        1877 :     bool IsLastRowAllowedToChange() const { return bLastRowAllowedToChange; }
      88           1 :     void SetLastRowAllowedToChange( bool bNew ) { bLastRowAllowedToChange = bNew; }
      89             : };
      90             : 
      91             : #endif // INCLUDED_SW_INC_TABCOL_HXX
      92             : 
      93             : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */

Generated by: LCOV version 1.10