LCOV - code coverage report
Current view: top level - sc/source/ui/view - prevwsh2.cxx (source / functions) Hit Total Coverage
Test: libreoffice_filtered.info Lines: 18 22 81.8 %
Date: 2012-08-25 Functions: 1 1 100.0 %
Legend: Lines: hit not hit | Branches: + taken - not taken # not executed Branches: 14 19 73.7 %

           Branch data     Line data    Source code
       1                 :            : /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
       2                 :            : /*************************************************************************
       3                 :            :  *
       4                 :            :  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
       5                 :            :  *
       6                 :            :  * Copyright 2000, 2010 Oracle and/or its affiliates.
       7                 :            :  *
       8                 :            :  * OpenOffice.org - a multi-platform office productivity suite
       9                 :            :  *
      10                 :            :  * This file is part of OpenOffice.org.
      11                 :            :  *
      12                 :            :  * OpenOffice.org is free software: you can redistribute it and/or modify
      13                 :            :  * it under the terms of the GNU Lesser General Public License version 3
      14                 :            :  * only, as published by the Free Software Foundation.
      15                 :            :  *
      16                 :            :  * OpenOffice.org is distributed in the hope that it will be useful,
      17                 :            :  * but WITHOUT ANY WARRANTY; without even the implied warranty of
      18                 :            :  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
      19                 :            :  * GNU Lesser General Public License version 3 for more details
      20                 :            :  * (a copy is included in the LICENSE file that accompanied this code).
      21                 :            :  *
      22                 :            :  * You should have received a copy of the GNU Lesser General Public License
      23                 :            :  * version 3 along with OpenOffice.org.  If not, see
      24                 :            :  * <http://www.openoffice.org/license.html>
      25                 :            :  * for a copy of the LGPLv3 License.
      26                 :            :  *
      27                 :            :  ************************************************************************/
      28                 :            : 
      29                 :            : // TOOLS
      30                 :            : #define _BIGINT_HXX
      31                 :            : #define _CACHESTR_HXX
      32                 :            : #define _SVMEMPOOL_HXX
      33                 :            : #define _CACHESTR_HXX
      34                 :            : 
      35                 :            : //SV
      36                 :            : #define _CONFIG_HXX
      37                 :            : #define _CURSOR_HXX
      38                 :            : #define _HELP_HXX
      39                 :            : #define _SPIN_HXX
      40                 :            : #define _SOUND_HXX
      41                 :            : 
      42                 :            : //svtools
      43                 :            : #define _SCRWIN_HXX
      44                 :            : #define _RULER_HXX
      45                 :            : #define _STDMENU_HXX
      46                 :            : #define _CTRLTOOL_HXX
      47                 :            : 
      48                 :            : //SVTOOLS
      49                 :            : #define _FILTER_HXX
      50                 :            : #define _SVTABBX_HXX
      51                 :            : 
      52                 :            : //sfxcore.hxx
      53                 :            : #define _SFXGENLINK_HXX
      54                 :            : #define _SFXHINTPOST_HXX
      55                 :            : #define _SFXDOCINF_HXX
      56                 :            : 
      57                 :            : // SFX
      58                 :            : #define _SFXMSGPOOL_HXX
      59                 :            : #define _PASSWD_HXX
      60                 :            : #define _SFXTBXCTRL_HXX
      61                 :            : #define _SFXSTBITEM_HXX
      62                 :            : #define _SFXMNUITEM_HXX
      63                 :            : #define _SFXIMGMGR_HXX
      64                 :            : #define _SFX_MINFITEM_HXX
      65                 :            : #define _SFXEVENT_HXX
      66                 :            : 
      67                 :            : //sfxdlg.hxx
      68                 :            : #define _SFX_DINFDLG_HXX
      69                 :            : #define _SFX_MGETEMPL_HXX
      70                 :            : #define _SFX_TPLPITEM_HXX
      71                 :            : #define _NEWSTYLE_HXX
      72                 :            : #define _SFXDOCKWIN_HXX
      73                 :            : 
      74                 :            : //sfxitems.hxx
      75                 :            : #define _SFXFLAGITEM_HXX
      76                 :            : #define _SFXPTITEM_HXX
      77                 :            : #define _SFXRECTITEM_HXX
      78                 :            : #define _SFXITEMITER_HXX
      79                 :            : #define _SFX_WHITER_HXX
      80                 :            : #define _SFXPOOLCACH_HXX
      81                 :            : #define _SFXRNGITEM_HXX
      82                 :            : 
      83                 :            : #define _SVX_HYPHEN_HXX
      84                 :            : #define _SVX_OPTSAVE_HXX
      85                 :            : #define _SVX_OPTPATH_HXX
      86                 :            : #define _SVX_OPTLINGU_HXX
      87                 :            : #define _SVX_RULER_HXX
      88                 :            : #define _SVX_RULRITEM_HXX
      89                 :            : #define _SVX_SPLWRAP_HXX
      90                 :            : #define _SVX_THESDLG_HXX
      91                 :            : 
      92                 :            : #include <svx/svdmodel.hxx>
      93                 :            : #include <svl/smplhint.hxx>
      94                 :            : 
      95                 :            : #include "prevwsh.hxx"
      96                 :            : #include "docsh.hxx"
      97                 :            : #include "preview.hxx"
      98                 :            : #include "hints.hxx"
      99                 :            : #include "sc.hrc"
     100                 :            : 
     101                 :            : // STATIC DATA -----------------------------------------------------------
     102                 :            : 
     103                 :            : // -----------------------------------------------------------------------
     104                 :            : 
     105                 :        312 : void ScPreviewShell::Notify( SfxBroadcaster&, const SfxHint& rHint )
     106                 :            : {
     107                 :        312 :     sal_Bool bDataChanged = false;
     108                 :            : 
     109         [ +  + ]:        312 :     if (rHint.ISA(SfxSimpleHint))
     110                 :            :     {
     111                 :        101 :         sal_uLong nSlot = ((const SfxSimpleHint&)rHint).GetId();
     112      [ +  -  + ]:        101 :         switch ( nSlot )
     113                 :            :         {
     114                 :            :             case FID_DATACHANGED:
     115                 :            :             case SID_SCPRINTOPTIONS:
     116                 :          8 :                 bDataChanged = sal_True;
     117                 :          8 :                 break;
     118                 :            :             case SC_HINT_DRWLAYER_NEW:
     119                 :            :                 {
     120                 :          0 :                     SfxBroadcaster* pDrawBC = pDocShell->GetDocument()->GetDrawBroadcaster();
     121         [ #  # ]:          0 :                     if (pDrawBC)
     122                 :          0 :                         StartListening(*pDrawBC);
     123                 :            :                 }
     124                 :        101 :                 break;
     125                 :            :         }
     126                 :            :     }
     127         [ +  + ]:        211 :     else if (rHint.ISA(ScPaintHint))
     128                 :            :     {
     129         [ +  + ]:         15 :         if ( ((const ScPaintHint&)rHint).GetPrintFlag() )
     130                 :            :         {
     131                 :         10 :             sal_uInt16 nParts = ((const ScPaintHint&)rHint).GetParts();
     132         [ +  - ]:         10 :             if (nParts & ( PAINT_GRID | PAINT_LEFT | PAINT_TOP | PAINT_SIZE ))
     133                 :         10 :                 bDataChanged = sal_True;
     134                 :            :         }
     135                 :            :     }
     136         [ +  + ]:        196 :     else if (rHint.ISA(SdrHint))
     137                 :            :     {
     138                 :            :         // SdrHints are no longer used for invalidating, thus react on objectchange instead
     139         [ -  + ]:         16 :         if(HINT_OBJCHG == ((const SdrHint&)rHint).GetKind())
     140                 :          0 :             bDataChanged = sal_True;
     141                 :            :     }
     142                 :            : 
     143         [ +  + ]:        312 :     if (bDataChanged)
     144                 :         18 :         pPreview->DataChanged(sal_True);
     145                 :        312 : }
     146                 :            : 
     147                 :            : 
     148                 :            : 
     149                 :            : 
     150                 :            : 
     151                 :            : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */

Generated by: LCOV version 1.10