LCOV - code coverage report
Current view: top level - sw/source/core/text - portox.cxx (source / functions) Hit Total Coverage
Test: commit 10e77ab3ff6f4314137acd6e2702a6e5c1ce1fae Lines: 25 28 89.3 %
Date: 2014-11-03 Functions: 8 9 88.9 %
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 <SwPortionHandler.hxx>
      21             : #include "viewopt.hxx"
      22             : 
      23             : #include "portox.hxx"
      24             : #include "inftxt.hxx"
      25             : 
      26          48 : void SwToxPortion::Paint( const SwTxtPaintInfo &rInf ) const
      27             : {
      28          48 :     if( Width() )
      29             :     {
      30          48 :         rInf.DrawViewOpt( *this, POR_TOX );
      31          48 :         SwTxtPortion::Paint( rInf );
      32             :     }
      33          48 : }
      34             : 
      35         398 : SwLinePortion *SwIsoToxPortion::Compress() { return this; }
      36             : 
      37         398 : SwIsoToxPortion::SwIsoToxPortion() : nViewWidth(0)
      38             : {
      39         398 :     SetLen(1);
      40         398 :     SetWhichPor( POR_ISOTOX );
      41         398 : }
      42             : 
      43         168 : sal_uInt16 SwIsoToxPortion::GetViewWidth( const SwTxtSizeInfo &rInf ) const
      44             : {
      45             :     // Although we are const, nViewWidth should be calculated in the last
      46             :     // moment possible
      47         168 :     SwIsoToxPortion* pThis = (SwIsoToxPortion*)this;
      48             :     // nViewWidth need to be calculated
      49         672 :     if( !Width() && rInf.OnWin() &&
      50         336 :         !rInf.GetOpt().IsPagePreview() &&
      51         504 :             !rInf.GetOpt().IsReadonly() && SwViewOption::IsFieldShadings()   )
      52             :     {
      53         168 :         if( !nViewWidth )
      54         110 :             pThis->nViewWidth = rInf.GetTxtSize(OUString(' ')).Width();
      55             :     }
      56             :     else
      57           0 :         pThis->nViewWidth = 0;
      58         168 :     return nViewWidth;
      59             : }
      60             : 
      61         398 : bool SwIsoToxPortion::Format( SwTxtFormatInfo &rInf )
      62             : {
      63         398 :     return SwLinePortion::Format( rInf );
      64             : }
      65             : 
      66         280 : void SwIsoToxPortion::Paint( const SwTxtPaintInfo &rInf ) const
      67             : {
      68         280 :     if( Width() )
      69         168 :         rInf.DrawViewOpt( *this, POR_TOX );
      70         280 : }
      71             : 
      72           0 : void SwIsoToxPortion::HandlePortion( SwPortionHandler& rPH ) const
      73             : {
      74           0 :     rPH.Special( GetLen(), OUString(), GetWhichPor() );
      75         270 : }
      76             : 
      77             : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */

Generated by: LCOV version 1.10