LCOV - code coverage report
Current view: top level - sw/source/core/text - txtpaint.hxx (source / functions) Hit Total Coverage
Test: commit e02a6cb2c3e2b23b203b422e4e0680877f232636 Lines: 0 11 0.0 %
Date: 2014-04-14 Functions: 0 5 0.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             : #ifndef INCLUDED_SW_SOURCE_CORE_TEXT_TXTPAINT_HXX
      20             : #define INCLUDED_SW_SOURCE_CORE_TEXT_TXTPAINT_HXX
      21             : #include <vcl/outdev.hxx>
      22             : 
      23             : class SwRect;               // SwSaveClip
      24             : #include <txtfrm.hxx>
      25             : 
      26             : /*************************************************************************
      27             :  *                      class SwSaveClip
      28             :  *************************************************************************/
      29             : 
      30             : class SwSaveClip
      31             : {
      32             :     Region   aClip;
      33             :     const bool     bOn;
      34             :           bool     bChg;
      35             : protected:
      36             :     OutputDevice* pOut;
      37             :     void _ChgClip( const SwRect &rRect, const SwTxtFrm* pFrm,
      38             :                    bool bEnlargeRect );
      39             : public:
      40             :     inline SwSaveClip( OutputDevice* pOut );
      41             :     inline ~SwSaveClip();
      42           0 :     inline void ChgClip( const SwRect &rRect, const SwTxtFrm* pFrm = 0,
      43             :                          bool bEnlargeRect = false)
      44           0 :              { if( pOut ) _ChgClip( rRect, pFrm, bEnlargeRect ); }
      45             :            void Reset();
      46           0 :     inline bool IsOn()  const { return bOn; }
      47           0 :     inline bool IsChg() const { return bChg; }
      48             :     inline OutputDevice *GetOut() { return pOut; }
      49             : };
      50             : 
      51           0 : inline SwSaveClip::SwSaveClip( OutputDevice* pOutDev ) :
      52           0 :     bOn( pOutDev && pOutDev->IsClipRegion() ),
      53             :     bChg( false ),
      54           0 :     pOut(pOutDev)
      55           0 : {}
      56             : 
      57           0 : inline SwSaveClip::~SwSaveClip()
      58             : {
      59           0 :     Reset();
      60           0 : }
      61             : 
      62             : #ifdef DBG_UTIL
      63             : 
      64             : /*************************************************************************
      65             :  *                          class SwDbgOut
      66             :  *************************************************************************/
      67             : 
      68             : class SwDbgOut
      69             : {
      70             : protected:
      71             :         OutputDevice* pOut;
      72             : public:
      73             :         inline SwDbgOut( OutputDevice* pOutDev, const bool bOn = true );
      74             : };
      75             : 
      76             : /*************************************************************************
      77             :  *                          class DbgBrush
      78             :  *************************************************************************/
      79             : 
      80             : class DbgBackColor : public SwDbgOut
      81             : {
      82             :         Color   aOldFillColor;
      83             : public:
      84             :         DbgBackColor( OutputDevice* pOut, const bool bOn = true,
      85             :                   ColorData nColor = COL_YELLOW );
      86             :        ~DbgBackColor();
      87             : };
      88             : 
      89             : /*************************************************************************
      90             :  *                          class DbgRect
      91             :  *************************************************************************/
      92             : 
      93             : class DbgRect : public SwDbgOut
      94             : {
      95             : public:
      96             :         DbgRect( OutputDevice* pOut, const Rectangle &rRect,
      97             :                  const bool bOn = true,
      98             :                  ColorData eColor = COL_LIGHTBLUE );
      99             : };
     100             : 
     101             : /*************************************************************************
     102             :  *                      Inline-Implementierung
     103             :  *************************************************************************/
     104             : 
     105             : inline SwDbgOut::SwDbgOut( OutputDevice* pOutDev, const bool bOn )
     106             :                :pOut( bOn ? pOutDev : 0 )
     107             : { }
     108             : 
     109             : inline DbgBackColor::DbgBackColor( OutputDevice* pOutDev, const bool bOn,
     110             :                            ColorData eColor )
     111             :     :SwDbgOut( pOutDev, bOn )
     112             : {
     113             :     if( pOut )
     114             :     {
     115             :         aOldFillColor = pOut->GetFillColor();
     116             :         pOut->SetFillColor( Color(eColor) );
     117             :     }
     118             : }
     119             : 
     120             : inline DbgBackColor::~DbgBackColor()
     121             : {
     122             :     if( pOut )
     123             :     {
     124             :         pOut->SetFillColor( aOldFillColor );
     125             :     }
     126             : }
     127             : 
     128             : inline DbgRect::DbgRect( OutputDevice* pOutDev, const Rectangle &rRect,
     129             :                          const bool bOn,
     130             :                          ColorData eColor )
     131             :     : SwDbgOut( pOutDev, bOn )
     132             : {
     133             :     if( pOut )
     134             :     {
     135             :         const Color aColor( eColor );
     136             :         Color aLineColor = pOut->GetLineColor();
     137             :         pOut->SetLineColor( aColor );
     138             :         Color aFillColor = pOut->GetFillColor();
     139             :         pOut->SetFillColor( Color(COL_TRANSPARENT) );
     140             :         pOut->DrawRect( rRect );
     141             :         pOut->SetLineColor( aLineColor );
     142             :         pOut->SetFillColor( aFillColor );
     143             :     }
     144             : }
     145             : 
     146             : #endif
     147             : 
     148             : #endif
     149             : 
     150             : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */

Generated by: LCOV version 1.10