LCOV - code coverage report
Current view: top level - sw/source/core/view - viewimp.cxx (source / functions) Hit Total Coverage
Test: libreoffice_filtered.info Lines: 136 216 63.0 %
Date: 2012-08-25 Functions: 17 26 65.4 %
Legend: Lines: hit not hit | Branches: + taken - not taken # not executed Branches: 108 228 47.4 %

           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                 :            : #include "crsrsh.hxx"
      30                 :            : #include "rootfrm.hxx"
      31                 :            : #include "pagefrm.hxx"
      32                 :            : #include "viewimp.hxx"
      33                 :            : #include "viewopt.hxx"
      34                 :            : #include "flyfrm.hxx"
      35                 :            : #include "frmfmt.hxx"
      36                 :            : #include "layact.hxx"
      37                 :            : #include "swregion.hxx"
      38                 :            : #include "dflyobj.hxx"
      39                 :            : #include "dview.hxx"
      40                 :            : #include <tools/shl.hxx>
      41                 :            : #include <swmodule.hxx>
      42                 :            : #include <svx/svdpage.hxx>
      43                 :            : #include <accmap.hxx>
      44                 :            : 
      45                 :            : // OD 12.12.2002 #103492#
      46                 :            : #include <pagepreviewlayout.hxx>
      47                 :            : 
      48                 :            : #include <comcore.hrc>
      49                 :            : #include <svx/svdundo.hxx>
      50                 :            : #include <IDocumentLayoutAccess.hxx>
      51                 :            : #include <IDocumentDrawModelAccess.hxx>
      52                 :            : #include <IDocumentDeviceAccess.hxx>
      53                 :            : #include <IDocumentSettingAccess.hxx>
      54                 :            : 
      55                 :            : /*************************************************************************
      56                 :            : |*
      57                 :            : |*  SwViewImp::Init()
      58                 :            : |*
      59                 :            : |*  Ersterstellung      MA 25. Jul. 94
      60                 :            : |*  Letzte Aenderung    MA 03. Nov. 95
      61                 :            : |*
      62                 :            : |*************************************************************************/
      63                 :       1337 : void SwViewImp::Init( const SwViewOption *pNewOpt )
      64                 :            : {
      65                 :            :     OSL_ENSURE( pDrawView, "SwViewImp::Init without DrawView" );
      66                 :            :     //Jetzt die PageView erzeugen wenn sie noch nicht existiert.
      67         [ +  - ]:       1337 :     SwRootFrm *pRoot = pSh->GetLayout();    //swmod 071108//swmod 071225
      68         [ +  - ]:       1337 :     if ( !pSdrPageView )
      69                 :            :     {
      70         [ +  - ]:       1337 :         IDocumentDrawModelAccess* pIDDMA = pSh->getIDocumentDrawModelAccess();
      71         [ -  + ]:       1337 :         if ( !pRoot->GetDrawPage() )
      72 [ #  # ][ #  # ]:          0 :             pRoot->SetDrawPage( pIDDMA->GetDrawModel()->GetPage( 0 ) );
      73                 :            : 
      74 [ +  - ][ +  + ]:       1337 :         if ( pRoot->GetDrawPage()->GetSize() != pRoot->Frm().SSize() )
      75         [ +  - ]:        572 :             pRoot->GetDrawPage()->SetSize( pRoot->Frm().SSize() );
      76                 :            : 
      77         [ +  - ]:       1337 :         pSdrPageView = pDrawView->ShowSdrPage( pRoot->GetDrawPage());
      78                 :            :         // OD 26.06.2003 #108784# - notify drawing page view about invisible
      79                 :            :         // layers.
      80         [ +  - ]:       1337 :         pIDDMA->NotifyInvisibleLayers( *pSdrPageView );
      81                 :            :     }
      82         [ +  - ]:       1337 :     pDrawView->SetDragStripes( pNewOpt->IsCrossHair() );
      83                 :       1337 :     pDrawView->SetGridSnap( pNewOpt->IsSnap() );
      84         [ +  - ]:       1337 :     pDrawView->SetGridVisible( pNewOpt->IsGridVisible() );
      85                 :       1337 :     const Size &rSz = pNewOpt->GetSnapSize();
      86                 :       1337 :     pDrawView->SetGridCoarse( rSz );
      87                 :            :     const Size aFSize
      88                 :       2674 :             ( rSz.Width() ? rSz.Width() /Max(short(1),pNewOpt->GetDivisionX()):0,
      89 [ +  - ][ +  - ]:       4011 :               rSz.Height()? rSz.Height()/Max(short(1),pNewOpt->GetDivisionY()):0);
      90         [ +  - ]:       1337 :      pDrawView->SetGridFine( aFSize );
      91         [ +  - ]:       1337 :     Fraction aSnGrWdtX(rSz.Width(), pNewOpt->GetDivisionX() + 1);
      92         [ +  - ]:       1337 :     Fraction aSnGrWdtY(rSz.Height(), pNewOpt->GetDivisionY() + 1);
      93         [ +  - ]:       1337 :     pDrawView->SetSnapGridWidth( aSnGrWdtX, aSnGrWdtY );
      94                 :            : 
      95 [ +  - ][ +  + ]:       1337 :     if ( pRoot->Frm().HasArea() )
      96         [ +  - ]:       1333 :         pDrawView->SetWorkArea( pRoot->Frm().SVRect() );
      97                 :            : 
      98         [ -  + ]:       1337 :     if ( GetShell()->IsPreView() )
      99         [ #  # ]:          0 :         pDrawView->SetAnimationEnabled( sal_False );
     100                 :            : 
     101                 :       1337 :     pDrawView->SetUseIncompatiblePathCreateInterface( sal_False );
     102                 :            : 
     103                 :            :     // set handle size to 9 pixels, always
     104         [ +  - ]:       1337 :     pDrawView->SetMarkHdlSizePixel(9);
     105                 :       1337 : }
     106                 :            : 
     107                 :            : /*************************************************************************
     108                 :            : |*
     109                 :            : |*  SwViewImp::SwViewImp()  CTor fuer die Core-Internas
     110                 :            : |*
     111                 :            : |*  Ersterstellung      MA 25. Jul. 94
     112                 :            : |*  Letzte Aenderung    MA 06. Sep. 96
     113                 :            : |*
     114                 :            : |*************************************************************************/
     115                 :            : 
     116                 :       1337 : SwViewImp::SwViewImp( ViewShell *pParent ) :
     117                 :            :     pSh( pParent ),
     118                 :            :     pDrawView( 0 ),
     119                 :            :     pSdrPageView( 0 ),
     120                 :            :     pFirstVisPage( 0 ),
     121                 :            :     pRegion( 0 ),
     122                 :            :     pLayAct( 0 ),
     123                 :            :     pIdleAct( 0 ),
     124                 :            :     pAccMap( 0 ),
     125                 :            :     pSdrObjCached(NULL),
     126                 :            :     nRestoreActions( 0 ),
     127                 :            :     // OD 12.12.2002 #103492#
     128                 :       1337 :     mpPgPrevwLayout( 0 )
     129                 :            : {
     130                 :            :     //bResetXorVisibility =
     131                 :            :     //HMHbShowHdlPaint =
     132                 :            :     bResetHdlHiddenPaint =
     133                 :       1337 :     bSmoothUpdate = bStopSmooth = bStopPrt = sal_False;
     134                 :       1337 :     bFirstPageInvalid = sal_True;
     135                 :       1337 : }
     136                 :            : 
     137                 :            : /******************************************************************************
     138                 :            : |*
     139                 :            : |*  SwViewImp::~SwViewImp()
     140                 :            : |*
     141                 :            : |*  Ersterstellung      MA 25. Jul. 94
     142                 :            : |*  Letzte Aenderung    MA 16. Dec. 94
     143                 :            : |*
     144                 :            : ******************************************************************************/
     145                 :            : 
     146                 :       1250 : SwViewImp::~SwViewImp()
     147                 :            : {
     148 [ +  + ][ +  - ]:       1250 :     delete pAccMap;
     149                 :            : 
     150                 :            :     // OD 12.12.2002 #103492#
     151 [ -  + ][ #  # ]:       1250 :     delete mpPgPrevwLayout;
     152                 :            : 
     153                 :            :     //JP 29.03.96: nach ShowSdrPage muss auch HideSdrPage gemacht werden!!!
     154         [ +  - ]:       1250 :     if( pDrawView )
     155         [ +  - ]:       1250 :          pDrawView->HideSdrPage();
     156                 :            : 
     157 [ +  - ][ +  - ]:       1250 :     delete pDrawView;
     158                 :            : 
     159                 :       1250 :     DelRegion();
     160                 :            : 
     161                 :            :     OSL_ENSURE( !pLayAct, "Have action for the rest of your life." );
     162                 :            :     OSL_ENSURE( !pIdleAct,"Be idle for the rest of your life." );
     163                 :       1250 : }
     164                 :            : 
     165                 :            : /******************************************************************************
     166                 :            : |*
     167                 :            : |*  SwViewImp::DelRegions()
     168                 :            : |*
     169                 :            : |*  Ersterstellung      MA 14. Apr. 94
     170                 :            : |*  Letzte Aenderung    MA 14. Apr. 94
     171                 :            : |*
     172                 :            : ******************************************************************************/
     173                 :            : 
     174                 :       8203 : void SwViewImp::DelRegion()
     175                 :            : {
     176         [ +  + ]:       8203 :     DELETEZ(pRegion);
     177                 :       8203 : }
     178                 :            : 
     179                 :            : /******************************************************************************
     180                 :            : |*
     181                 :            : |*  SwViewImp::AddPaintRect()
     182                 :            : |*
     183                 :            : |*  Ersterstellung      MA ??
     184                 :            : |*  Letzte Aenderung    MA 27. Jul. 94
     185                 :            : |*
     186                 :            : ******************************************************************************/
     187                 :            : 
     188                 :      27525 : sal_Bool SwViewImp::AddPaintRect( const SwRect &rRect )
     189                 :            : {
     190         [ +  + ]:      27525 :     if ( rRect.IsOver( pSh->VisArea() ) )
     191                 :            :     {
     192         [ +  + ]:      18793 :         if ( !pRegion )
     193         [ +  - ]:       6944 :             pRegion = new SwRegionRects( pSh->VisArea() );
     194                 :      18793 :         (*pRegion) -= rRect;
     195                 :      18793 :         return sal_True;
     196                 :            :     }
     197                 :      27525 :     return sal_False;
     198                 :            : }
     199                 :            : 
     200                 :            : /******************************************************************************
     201                 :            : |*
     202                 :            : |*  ViewImp::CheckWaitCrsr()
     203                 :            : |*
     204                 :            : |*  Ersterstellung      MA 10. Aug. 94
     205                 :            : |*  Letzte Aenderung    MA 10. Aug. 94
     206                 :            : |*
     207                 :            : ******************************************************************************/
     208                 :            : 
     209                 :        149 : void SwViewImp::CheckWaitCrsr()
     210                 :            : {
     211         [ +  + ]:        149 :     if ( pLayAct )
     212                 :         99 :         pLayAct->CheckWaitCrsr();
     213                 :        149 : }
     214                 :            : 
     215                 :            : /******************************************************************************
     216                 :            : |*
     217                 :            : |*  ViewImp::IsCalcLayoutProgress()
     218                 :            : |*
     219                 :            : |*  Ersterstellung      MA 12. Aug. 94
     220                 :            : |*  Letzte Aenderung    MA 12. Aug. 94
     221                 :            : |*
     222                 :            : ******************************************************************************/
     223                 :            : 
     224                 :       7499 : sal_Bool SwViewImp::IsCalcLayoutProgress() const
     225                 :            : {
     226         [ +  + ]:       7499 :     if ( pLayAct )
     227                 :       1181 :         return pLayAct->IsCalcLayout();
     228                 :       7499 :     return sal_False;
     229                 :            : }
     230                 :            : 
     231                 :            : /******************************************************************************
     232                 :            : |*
     233                 :            : |*  ViewImp::IsUpdateExpFlds()
     234                 :            : |*
     235                 :            : |*  Ersterstellung      MA 28. Mar. 96
     236                 :            : |*  Letzte Aenderung    MA 28. Mar. 96
     237                 :            : |*
     238                 :            : ******************************************************************************/
     239                 :            : 
     240                 :       1674 : sal_Bool SwViewImp::IsUpdateExpFlds()
     241                 :            : {
     242 [ +  + ][ -  + ]:       1674 :     if ( pLayAct && pLayAct->IsCalcLayout() )
                 [ -  + ]
     243                 :            :     {
     244                 :          0 :         pLayAct->SetUpdateExpFlds();
     245                 :          0 :         return sal_True;
     246                 :            :     }
     247                 :       1674 :      return sal_False;
     248                 :            : }
     249                 :            : 
     250                 :            : 
     251                 :            : /******************************************************************************
     252                 :            : |*
     253                 :            : |*  SwViewImp::SetFirstVisPage(), ImplGetFirstVisPage();
     254                 :            : |*
     255                 :            : |*  Ersterstellung      MA 21. Sep. 93
     256                 :            : |*  Letzte Aenderung    MA 08. Mar. 94
     257                 :            : |*
     258                 :            : ******************************************************************************/
     259                 :            : 
     260                 :       4126 : void SwViewImp::SetFirstVisPage()
     261                 :            : {
     262 [ +  + ][ +  + ]:       4126 :     if ( pSh->bDocSizeChgd && pSh->VisArea().Top() > pSh->GetLayout()->Frm().Height() )
                 [ +  + ]
     263                 :            :     {
     264                 :            :         //Wir stecken in einer Action und die VisArea sitzt wegen
     265                 :            :         //Loeschoperationen hinter der erste sichtbaren Seite.
     266                 :            :         //Damit nicht zu heftig Formatiert wird, liefern wir die letzte Seite
     267                 :            :         //zurueck.
     268                 :          6 :         pFirstVisPage = (SwPageFrm*)pSh->GetLayout()->Lower();
     269 [ +  - ][ +  + ]:         16 :         while ( pFirstVisPage && pFirstVisPage->GetNext() )
                 [ +  + ]
     270                 :         10 :             pFirstVisPage = (SwPageFrm*)pFirstVisPage->GetNext();
     271                 :            :     }
     272                 :            :     else
     273                 :            :     {
     274                 :       4120 :         const SwViewOption* pSwViewOption = GetShell()->GetViewOptions();
     275                 :       4120 :         const bool bBookMode = pSwViewOption->IsViewLayoutBookMode();
     276                 :            : 
     277         [ +  - ]:       4120 :         SwPageFrm *pPage = (SwPageFrm*)pSh->GetLayout()->Lower();
     278         [ +  - ]:       4120 :         SwRect aPageRect = pPage->GetBoundRect();
     279 [ +  + ][ +  - ]:       5798 :         while ( pPage && !aPageRect.IsOver( pSh->VisArea() ) )
         [ +  + ][ +  + ]
     280                 :            :         {
     281                 :       1678 :             pPage = (SwPageFrm*)pPage->GetNext();
     282         [ +  + ]:       1678 :             if ( pPage )
     283                 :            :             {
     284         [ +  - ]:        324 :                 aPageRect = pPage->GetBoundRect();
     285 [ #  # ][ -  + ]:        324 :                 if ( bBookMode && pPage->IsEmptyPage() )
                 [ -  + ]
     286                 :            :                 {
     287         [ #  # ]:          0 :                     const SwPageFrm& rFormatPage = pPage->GetFormatPage();
     288         [ #  # ]:          0 :                     aPageRect.SSize() = rFormatPage.GetBoundRect().SSize();
     289                 :            :                 }
     290                 :            :             }
     291                 :            :         }
     292 [ +  + ][ +  - ]:       4120 :         pFirstVisPage = pPage ? pPage : (SwPageFrm*)pSh->GetLayout()->Lower();
     293                 :            :     }
     294                 :       4126 :     bFirstPageInvalid = sal_False;
     295                 :       4126 : }
     296                 :            : 
     297                 :            : /******************************************************************************
     298                 :            : |*
     299                 :            : |*  SwViewImp::MakeDrawView();
     300                 :            : |*
     301                 :            : |*  Ersterstellung      AMA 01. Nov. 95
     302                 :            : |*  Letzte Aenderung    AMA 01. Nov. 95
     303                 :            : |*
     304                 :            : ******************************************************************************/
     305                 :            : 
     306                 :       2083 : void SwViewImp::MakeDrawView()
     307                 :            : {
     308                 :       2083 :     IDocumentDrawModelAccess* pIDDMA = GetShell()->getIDocumentDrawModelAccess();
     309                 :            : 
     310                 :            :     // the else here is not an error, _MakeDrawModel() calls this method again
     311                 :            :     // after the DrawModel is created to create DrawViews for all shells...
     312         [ +  + ]:       2083 :     if( !pIDDMA->GetDrawModel() )
     313                 :            :     {
     314                 :        746 :         pIDDMA->_MakeDrawModel();
     315                 :            :     }
     316                 :            :     else
     317                 :            :     {
     318         [ +  - ]:       1337 :         if ( !pDrawView )
     319                 :            :         {
     320                 :            :             // #i72809#
     321                 :            :             // Discussed with FME, he also thinks that the getPrinter is old and not correct. When i got
     322                 :            :             // him right, it anyways returns GetOut() when it's a printer, but NULL when not. He suggested
     323                 :            :             // to use GetOut() and check the existing cases.
     324                 :            :             // Check worked well. Took a look at viewing, printing, PDF export and print preview with a test
     325                 :            :             // document which has an empty 2nd page (right page, see bug)
     326                 :       1337 :             OutputDevice* pOutDevForDrawView = GetShell()->GetWin();
     327                 :            : 
     328         [ +  + ]:       1337 :             if(!pOutDevForDrawView)
     329                 :            :             {
     330                 :            :                 // pOutDevForDrawView = (OutputDevice*)GetShell()->getIDocumentDeviceAccess()->getPrinter( false );
     331                 :         19 :                 pOutDevForDrawView = GetShell()->GetOut();
     332                 :            :             }
     333                 :            : 
     334         [ +  - ]:       1337 :             pDrawView = new SwDrawView( *this, pIDDMA->GetDrawModel(), pOutDevForDrawView);
     335                 :            :         }
     336                 :            : 
     337 [ +  - ][ +  - ]:       1337 :         GetDrawView()->SetActiveLayer(rtl::OUString("Heaven"));
                 [ +  - ]
     338                 :       1337 :         const SwViewOption* pSwViewOption = GetShell()->GetViewOptions();
     339                 :       1337 :         Init(pSwViewOption);
     340                 :            : 
     341                 :            :         // #i68597# If document is read-only, we will not profit from overlay,
     342                 :            :         // so switch it off.
     343 [ +  - ][ +  - ]:       1337 :         if(pDrawView && pDrawView->IsBufferedOverlayAllowed())
                 [ +  - ]
     344                 :            :         {
     345         [ +  + ]:       1337 :             if(pSwViewOption->IsReadonly())
     346                 :            :             {
     347                 :          2 :                 pDrawView->SetBufferedOverlayAllowed(false);
     348                 :            :             }
     349                 :            :         }
     350                 :            :     }
     351                 :       2083 : }
     352                 :            : 
     353                 :            : /******************************************************************************
     354                 :            : |*
     355                 :            : |*  SwViewImp::GetRetoucheColor()
     356                 :            : |*
     357                 :            : |*  Ersterstellung      MA 24. Jun. 98
     358                 :            : |*  Letzte Aenderung    MA 24. Jun. 98
     359                 :            : |*
     360                 :            : ******************************************************************************/
     361                 :            : 
     362                 :      12436 : Color SwViewImp::GetRetoucheColor() const
     363                 :            : {
     364                 :      12436 :     Color aRet( COL_TRANSPARENT );
     365                 :      12436 :     const ViewShell &rSh = *GetShell();
     366         [ +  + ]:      12436 :     if ( rSh.GetWin() )
     367                 :            :     {
     368   [ +  +  -  + ]:      12491 :         if ( rSh.GetViewOptions()->getBrowseMode() &&
                 [ -  + ]
     369                 :         74 :              COL_TRANSPARENT != rSh.GetViewOptions()->GetRetoucheColor().GetColor() )
     370                 :          0 :             aRet = rSh.GetViewOptions()->GetRetoucheColor();
     371   [ -  +  #  # ]:      12417 :         else if(rSh.GetViewOptions()->IsPagePreview()  &&
                 [ -  + ]
     372                 :          0 :                     !SW_MOD()->GetAccessibilityOptions().GetIsForPagePreviews())
     373                 :          0 :             aRet.SetColor(COL_WHITE);
     374                 :            :         else
     375                 :      12417 :             aRet = SwViewOption::GetDocColor();
     376                 :            :     }
     377                 :      12436 :     return aRet;
     378                 :            : }
     379                 :            : 
     380                 :            : /** create page preview layout
     381                 :            : 
     382                 :            :     OD 12.12.2002 #103492#
     383                 :            : 
     384                 :            :     @author OD
     385                 :            : */
     386                 :          0 : void SwViewImp::InitPagePreviewLayout()
     387                 :            : {
     388                 :            :     OSL_ENSURE( pSh->GetLayout(), "no layout - page preview layout can not be created.");
     389         [ #  # ]:          0 :     if ( pSh->GetLayout() )
     390         [ #  # ]:          0 :         mpPgPrevwLayout = new SwPagePreviewLayout( *pSh, *(pSh->GetLayout()) );
     391                 :          0 : }
     392                 :            : 
     393                 :         38 : void SwViewImp::UpdateAccessible()
     394                 :            : {
     395                 :            :     // We require a layout and an XModel to be accessible.
     396                 :         38 :     IDocumentLayoutAccess* pIDLA = GetShell()->getIDocumentLayoutAccess();
     397                 :         38 :     Window *pWin = GetShell()->GetWin();
     398                 :            :     OSL_ENSURE( GetShell()->GetLayout(), "no layout, no access" );  //swmod 071108//swmod 071225
     399                 :            :     OSL_ENSURE( pWin, "no window, no access" );
     400                 :            : 
     401 [ +  - ][ +  - ]:         38 :     if( IsAccessible() && pIDLA->GetCurrentViewShell() && pWin )    //swmod 071108//swmod 071225
         [ +  - ][ +  - ]
     402                 :         38 :         GetAccessibleMap().GetDocumentView();
     403                 :         38 : }
     404                 :            : 
     405                 :          0 : void SwViewImp::DisposeAccessible( const SwFrm *pFrm,
     406                 :            :                                    const SdrObject *pObj,
     407                 :            :                                    sal_Bool bRecursive )
     408                 :            : {
     409                 :            :     OSL_ENSURE( !pFrm || pFrm->IsAccessibleFrm(), "frame is not accessible" );
     410                 :          0 :     ViewShell *pVSh = GetShell();
     411                 :          0 :     ViewShell *pTmp = pVSh;
     412         [ #  # ]:          0 :     do
     413                 :            :     {
     414         [ #  # ]:          0 :         if( pTmp->Imp()->IsAccessible() )
     415                 :          0 :             pTmp->Imp()->GetAccessibleMap().Dispose( pFrm, pObj, 0, bRecursive );
     416                 :          0 :         pTmp = (ViewShell *)pTmp->GetNext();
     417                 :            :     } while ( pTmp != pVSh );
     418                 :          0 : }
     419                 :            : 
     420                 :        117 : void SwViewImp::MoveAccessible( const SwFrm *pFrm, const SdrObject *pObj,
     421                 :            :                                 const SwRect& rOldFrm )
     422                 :            : {
     423                 :            :     OSL_ENSURE( !pFrm || pFrm->IsAccessibleFrm(), "frame is not accessible" );
     424                 :        117 :     ViewShell *pVSh = GetShell();
     425                 :        117 :     ViewShell *pTmp = pVSh;
     426         [ -  + ]:        117 :     do
     427                 :            :     {
     428         [ +  - ]:        117 :         if( pTmp->Imp()->IsAccessible() )
     429                 :        117 :             pTmp->Imp()->GetAccessibleMap().InvalidatePosOrSize( pFrm, pObj, 0,
     430                 :        117 :                                                                  rOldFrm );
     431                 :        117 :         pTmp = (ViewShell *)pTmp->GetNext();
     432                 :            :     } while ( pTmp != pVSh );
     433                 :        117 : }
     434                 :            : 
     435                 :          0 : void SwViewImp::InvalidateAccessibleFrmContent( const SwFrm *pFrm )
     436                 :            : {
     437                 :            :     OSL_ENSURE( pFrm->IsAccessibleFrm(), "frame is not accessible" );
     438                 :          0 :     ViewShell *pVSh = GetShell();
     439                 :          0 :     ViewShell *pTmp = pVSh;
     440         [ #  # ]:          0 :     do
     441                 :            :     {
     442         [ #  # ]:          0 :         if( pTmp->Imp()->IsAccessible() )
     443                 :          0 :             pTmp->Imp()->GetAccessibleMap().InvalidateContent( pFrm );
     444                 :          0 :         pTmp = (ViewShell *)pTmp->GetNext();
     445                 :            :     } while ( pTmp != pVSh );
     446                 :          0 : }
     447                 :            : 
     448                 :        142 : void SwViewImp::InvalidateAccessibleCursorPosition( const SwFrm *pFrm )
     449                 :            : {
     450         [ +  - ]:        142 :     if( IsAccessible() )
     451                 :        142 :         GetAccessibleMap().InvalidateCursorPosition( pFrm );
     452                 :        142 : }
     453                 :            : 
     454                 :          0 : void SwViewImp::InvalidateAccessibleEditableState( sal_Bool bAllShells,
     455                 :            :                                                       const SwFrm *pFrm )
     456                 :            : {
     457         [ #  # ]:          0 :     if( bAllShells )
     458                 :            :     {
     459                 :          0 :         ViewShell *pVSh = GetShell();
     460                 :          0 :         ViewShell *pTmp = pVSh;
     461         [ #  # ]:          0 :         do
     462                 :            :         {
     463         [ #  # ]:          0 :             if( pTmp->Imp()->IsAccessible() )
     464                 :          0 :                 pTmp->Imp()->GetAccessibleMap().InvalidateStates( ACC_STATE_EDITABLE, pFrm );
     465                 :          0 :             pTmp = (ViewShell *)pTmp->GetNext();
     466                 :            :         } while ( pTmp != pVSh );
     467                 :            :     }
     468         [ #  # ]:          0 :     else if( IsAccessible() )
     469                 :            :     {
     470                 :          0 :         GetAccessibleMap().InvalidateStates( ACC_STATE_EDITABLE, pFrm );
     471                 :            :     }
     472                 :          0 : }
     473                 :            : 
     474                 :          0 : void SwViewImp::InvalidateAccessibleRelationSet( const SwFlyFrm *pMaster,
     475                 :            :                                                  const SwFlyFrm *pFollow )
     476                 :            : {
     477                 :          0 :     ViewShell *pVSh = GetShell();
     478                 :          0 :     ViewShell *pTmp = pVSh;
     479         [ #  # ]:          0 :     do
     480                 :            :     {
     481         [ #  # ]:          0 :         if( pTmp->Imp()->IsAccessible() )
     482                 :          0 :             pTmp->Imp()->GetAccessibleMap().InvalidateRelationSet( pMaster,
     483                 :          0 :                                                                    pFollow );
     484                 :          0 :         pTmp = (ViewShell *)pTmp->GetNext();
     485                 :            :     } while ( pTmp != pVSh );
     486                 :          0 : }
     487                 :            : 
     488                 :            :  /** invalidate CONTENT_FLOWS_FROM/_TO relation for paragraphs
     489                 :            : 
     490                 :            :     OD 2005-12-01 #i27138#
     491                 :            : 
     492                 :            :     @author OD
     493                 :            : */
     494                 :          0 : void SwViewImp::_InvalidateAccessibleParaFlowRelation( const SwTxtFrm* _pFromTxtFrm,
     495                 :            :                                                        const SwTxtFrm* _pToTxtFrm )
     496                 :            : {
     497 [ #  # ][ #  # ]:          0 :     if ( !_pFromTxtFrm && !_pToTxtFrm )
     498                 :            :     {
     499                 :            :         // No text frame provided. Thus, nothing to do.
     500                 :          0 :         return;
     501                 :            :     }
     502                 :            : 
     503                 :          0 :     ViewShell* pVSh = GetShell();
     504                 :          0 :     ViewShell* pTmp = pVSh;
     505         [ #  # ]:          0 :     do
     506                 :            :     {
     507         [ #  # ]:          0 :         if ( pTmp->Imp()->IsAccessible() )
     508                 :            :         {
     509         [ #  # ]:          0 :             if ( _pFromTxtFrm )
     510                 :            :             {
     511                 :          0 :                 pTmp->Imp()->GetAccessibleMap().
     512                 :          0 :                             InvalidateParaFlowRelation( *_pFromTxtFrm, true );
     513                 :            :             }
     514         [ #  # ]:          0 :             if ( _pToTxtFrm )
     515                 :            :             {
     516                 :          0 :                 pTmp->Imp()->GetAccessibleMap().
     517                 :          0 :                             InvalidateParaFlowRelation( *_pToTxtFrm, false );
     518                 :            :             }
     519                 :            :         }
     520                 :          0 :         pTmp = (ViewShell *)pTmp->GetNext();
     521                 :            :     } while ( pTmp != pVSh );
     522                 :            : }
     523                 :            : 
     524                 :            : /** invalidate text selection for paragraphs
     525                 :            : 
     526                 :            :     OD 2005-12-12 #i27301#
     527                 :            : 
     528                 :            :     @author OD
     529                 :            : */
     530                 :        142 : void SwViewImp::_InvalidateAccessibleParaTextSelection()
     531                 :            : {
     532                 :        142 :     ViewShell* pVSh = GetShell();
     533                 :        142 :     ViewShell* pTmp = pVSh;
     534         [ -  + ]:        142 :     do
     535                 :            :     {
     536         [ +  - ]:        142 :         if ( pTmp->Imp()->IsAccessible() )
     537                 :            :         {
     538                 :        142 :             pTmp->Imp()->GetAccessibleMap().InvalidateTextSelectionOfAllParas();
     539                 :            :         }
     540                 :            : 
     541                 :        142 :         pTmp = (ViewShell *)pTmp->GetNext();
     542                 :            :     } while ( pTmp != pVSh );
     543                 :        142 : }
     544                 :            : 
     545                 :            : /** invalidate attributes for paragraphs
     546                 :            : 
     547                 :            :     OD 2009-01-06 #i88069#
     548                 :            : 
     549                 :            :     @author OD
     550                 :            : */
     551                 :          0 : void SwViewImp::_InvalidateAccessibleParaAttrs( const SwTxtFrm& rTxtFrm )
     552                 :            : {
     553                 :          0 :     ViewShell* pVSh = GetShell();
     554                 :          0 :     ViewShell* pTmp = pVSh;
     555         [ #  # ]:          0 :     do
     556                 :            :     {
     557         [ #  # ]:          0 :         if ( pTmp->Imp()->IsAccessible() )
     558                 :            :         {
     559                 :          0 :             pTmp->Imp()->GetAccessibleMap().InvalidateAttr( rTxtFrm );
     560                 :            :         }
     561                 :            : 
     562                 :          0 :         pTmp = (ViewShell *)pTmp->GetNext();
     563                 :            :     } while ( pTmp != pVSh );
     564                 :          0 : }
     565                 :            : 
     566                 :            : // OD 15.01.2003 #103492# - method signature change due to new page preview functionality
     567                 :          0 : void SwViewImp::UpdateAccessiblePreview( const std::vector<PrevwPage*>& _rPrevwPages,
     568                 :            :                                          const Fraction&  _rScale,
     569                 :            :                                          const SwPageFrm* _pSelectedPageFrm,
     570                 :            :                                          const Size&      _rPrevwWinSize )
     571                 :            : {
     572         [ #  # ]:          0 :     if( IsAccessible() )
     573                 :          0 :         GetAccessibleMap().UpdatePreview( _rPrevwPages, _rScale,
     574                 :          0 :                                           _pSelectedPageFrm, _rPrevwWinSize );
     575                 :          0 : }
     576                 :            : 
     577                 :          0 : void SwViewImp::InvalidateAccessiblePreViewSelection( sal_uInt16 nSelPage )
     578                 :            : {
     579         [ #  # ]:          0 :     if( IsAccessible() )
     580                 :          0 :         GetAccessibleMap().InvalidatePreViewSelection( nSelPage );
     581                 :          0 : }
     582                 :            : 
     583                 :         24 : SwAccessibleMap *SwViewImp::CreateAccessibleMap()
     584                 :            : {
     585                 :            :     OSL_ENSURE( !pAccMap, "accessible map exists" );
     586         [ +  - ]:         24 :     pAccMap = new SwAccessibleMap( GetShell() );
     587                 :         24 :     return pAccMap;
     588                 :            : }
     589                 :            : 
     590                 :        164 : void SwViewImp::FireAccessibleEvents()
     591                 :            : {
     592         [ +  - ]:        164 :     if( IsAccessible() )
     593                 :        164 :         GetAccessibleMap().FireEvents();
     594                 :        164 : }
     595                 :            : 
     596                 :            : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */

Generated by: LCOV version 1.10