LCOV - code coverage report
Current view: top level - libreoffice/svx/source/svdraw - svdoutl.cxx (source / functions) Hit Total Coverage
Test: libreoffice_filtered.info Lines: 39 39 100.0 %
Date: 2012-12-17 Functions: 7 7 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 <svx/svdoutl.hxx>
      21             : #include <editeng/outliner.hxx>
      22             : #include <svx/svdotext.hxx>
      23             : #include <editeng/editstat.hxx>
      24             : #include <svx/svdmodel.hxx>
      25             : #include <editeng/eeitem.hxx>
      26             : #include <svl/itempool.hxx>
      27             : 
      28             : DBG_NAME(SdrOutliner)
      29             : 
      30        6522 : SdrOutliner::SdrOutliner( SfxItemPool* pItemPool, sal_uInt16 nMode )
      31             : :   Outliner( pItemPool, nMode ),
      32             :     //mpPaintInfoRec( NULL )
      33        6522 :     mpVisualizedPage(0)
      34             : {
      35             :     DBG_CTOR(SdrOutliner,NULL);
      36        6522 : }
      37             : 
      38             : 
      39       11210 : SdrOutliner::~SdrOutliner()
      40             : {
      41             :     DBG_DTOR(SdrOutliner,NULL);
      42       11210 : }
      43             : 
      44             : 
      45       53845 : void SdrOutliner::SetTextObj( const SdrTextObj* pObj )
      46             : {
      47       53845 :     if( pObj && pObj != mpTextObj.get() )
      48             :     {
      49       11316 :         SetUpdateMode(sal_False);
      50       11316 :         sal_uInt16 nOutlinerMode2 = OUTLINERMODE_OUTLINEOBJECT;
      51       11316 :         if ( !pObj->IsOutlText() )
      52       10992 :             nOutlinerMode2 = OUTLINERMODE_TEXTOBJECT;
      53       11316 :         Init( nOutlinerMode2 );
      54             : 
      55       11316 :         SetGlobalCharStretching(100,100);
      56             : 
      57       11316 :         sal_uIntPtr nStat = GetControlWord();
      58       11316 :         nStat &= ~( EE_CNTRL_STRETCHING | EE_CNTRL_AUTOPAGESIZE );
      59       11316 :         SetControlWord(nStat);
      60             : 
      61       11316 :         Size aNullSize;
      62       11316 :         Size aMaxSize( 100000,100000 );
      63       11316 :         SetMinAutoPaperSize( aNullSize );
      64       11316 :         SetMaxAutoPaperSize( aMaxSize );
      65       11316 :         SetPaperSize( aMaxSize );
      66       11316 :         ClearPolygon();
      67             :     }
      68             : 
      69       53845 :     mpTextObj.reset( const_cast< SdrTextObj* >(pObj) );
      70       53845 : }
      71             : 
      72        2262 : void SdrOutliner::SetTextObjNoInit( const SdrTextObj* pObj )
      73             : {
      74        2262 :     mpTextObj.reset( const_cast< SdrTextObj* >(pObj) );
      75        2262 : }
      76             : 
      77         776 : XubString SdrOutliner::CalcFieldValue(const SvxFieldItem& rField, sal_uInt16 nPara, sal_uInt16 nPos,
      78             :                                      Color*& rpTxtColor, Color*& rpFldColor)
      79             : {
      80         776 :     bool bOk = false;
      81         776 :     XubString aRet;
      82             : 
      83         776 :     if(mpTextObj.is())
      84         776 :         bOk = static_cast< SdrTextObj* >( mpTextObj.get())->CalcFieldValue(rField, nPara, nPos, sal_False, rpTxtColor, rpFldColor, aRet);
      85             : 
      86         776 :     if (!bOk)
      87         776 :         aRet = Outliner::CalcFieldValue(rField, nPara, nPos, rpTxtColor, rpFldColor);
      88             : 
      89         776 :     return aRet;
      90             : }
      91             : 
      92       30750 : const SdrTextObj* SdrOutliner::GetTextObj() const
      93             : {
      94       30750 :     if( mpTextObj.is() )
      95         776 :         return static_cast< SdrTextObj* >( mpTextObj.get() );
      96             :     else
      97       29974 :         return 0;
      98             : }
      99             : 
     100             : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */

Generated by: LCOV version 1.10