LCOV - code coverage report
Current view: top level - sw/source/core/access - accframe.cxx (source / functions) Hit Total Coverage
Test: libreoffice_filtered.info Lines: 140 206 68.0 %
Date: 2012-08-25 Functions: 18 19 94.7 %
Legend: Lines: hit not hit | Branches: + taken - not taken # not executed Branches: 167 416 40.1 %

           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 <hintids.hxx>
      30                 :            : #include <editeng/brshitem.hxx>
      31                 :            : #include <flyfrm.hxx>
      32                 :            : #include <rootfrm.hxx>
      33                 :            : #include <txtfrm.hxx>
      34                 :            : #include <sectfrm.hxx>
      35                 :            : #include <section.hxx>
      36                 :            : #include <viewsh.hxx>
      37                 :            : #include <viewopt.hxx>
      38                 :            : #include <doc.hxx>
      39                 :            : #include <frmatr.hxx>
      40                 :            : #include <pagefrm.hxx>
      41                 :            : #include <pagedesc.hxx>
      42                 :            : #include <fmtanchr.hxx>
      43                 :            : #include <fldbas.hxx>
      44                 :            : #include <dcontact.hxx>
      45                 :            : #include <accmap.hxx>
      46                 :            : #include <accfrmobjslist.hxx>
      47                 :            : #include <accfrmobjmap.hxx>
      48                 :            : #include <accframe.hxx>
      49                 :            : 
      50                 :            : using namespace sw::access;
      51                 :            : 
      52                 :            : // Regarding visibilily (or in terms of accessibility: regarding the showing
      53                 :            : // state): A frame is visible and therfor contained in the tree if its frame
      54                 :            : // size overlaps with the visible area. The bounding box however is the
      55                 :            : // frame's paint area.
      56                 :        436 : /* static */ sal_Int32 SwAccessibleFrame::GetChildCount( SwAccessibleMap& rAccMap,
      57                 :            :                                                          const SwRect& rVisArea,
      58                 :            :                                                          const SwFrm *pFrm,
      59                 :            :                                                          sal_Bool bInPagePreview )
      60                 :            : {
      61                 :        436 :     sal_Int32 nCount = 0;
      62                 :            : 
      63         [ +  - ]:        436 :     const SwAccessibleChildSList aVisList( rVisArea, *pFrm, rAccMap );
      64         [ +  - ]:        436 :     SwAccessibleChildSList::const_iterator aIter( aVisList.begin() );
      65 [ +  - ][ +  - ]:        952 :     while( aIter != aVisList.end() )
                 [ +  + ]
      66                 :            :     {
      67                 :        516 :         const SwAccessibleChild& rLower = *aIter;
      68 [ +  + ][ +  - ]:        516 :         if( rLower.IsAccessible( bInPagePreview ) )
      69                 :            :         {
      70                 :        268 :             nCount++;
      71                 :            :         }
      72 [ +  - ][ +  - ]:        248 :         else if( rLower.GetSwFrm() )
      73                 :            :         {
      74                 :            :             // There are no unaccessible SdrObjects that count
      75                 :            :             nCount += GetChildCount( rAccMap,
      76                 :            :                                      rVisArea, rLower.GetSwFrm(),
      77 [ +  - ][ +  - ]:        248 :                                      bInPagePreview );
      78                 :            :         }
      79         [ +  - ]:        516 :         ++aIter;
      80                 :            :     }
      81                 :            : 
      82                 :        436 :     return nCount;
      83                 :            : }
      84                 :            : 
      85                 :        214 : /* static */ SwAccessibleChild SwAccessibleFrame::GetChild(
      86                 :            :                                                 SwAccessibleMap& rAccMap,
      87                 :            :                                                 const SwRect& rVisArea,
      88                 :            :                                                 const SwFrm& rFrm,
      89                 :            :                                                 sal_Int32& rPos,
      90                 :            :                                                 sal_Bool bInPagePreview )
      91                 :            : {
      92                 :        214 :     SwAccessibleChild aRet;
      93                 :            : 
      94         [ +  + ]:        214 :     if( rPos >= 0 )
      95                 :            :     {
      96         [ +  + ]:        210 :         if( SwAccessibleChildMap::IsSortingRequired( rFrm ) )
      97                 :            :         {
      98                 :            :             // We need a sorted list here
      99         [ +  - ]:          4 :             const SwAccessibleChildMap aVisMap( rVisArea, rFrm, rAccMap );
     100                 :          4 :             SwAccessibleChildMap::const_iterator aIter( aVisMap.begin() );
     101 [ +  + ][ +  - ]:         10 :             while( aIter != aVisMap.end() && !aRet.IsValid() )
         [ +  + ][ +  - ]
           [ +  +  #  # ]
     102                 :            :             {
     103                 :          6 :                 const SwAccessibleChild& rLower = (*aIter).second;
     104 [ +  + ][ +  - ]:          6 :                 if( rLower.IsAccessible( bInPagePreview ) )
     105                 :            :                 {
     106         [ +  - ]:          2 :                     if( 0 == rPos )
     107         [ +  - ]:          2 :                         aRet = rLower;
     108                 :            :                     else
     109                 :          0 :                         rPos--;
     110                 :            :                 }
     111 [ +  - ][ +  - ]:          4 :                 else if( rLower.GetSwFrm() )
     112                 :            :                 {
     113                 :            :                     // There are no unaccessible SdrObjects that count
     114                 :            :                     aRet = GetChild( rAccMap,
     115         [ +  - ]:          4 :                                      rVisArea, *(rLower.GetSwFrm()), rPos,
     116 [ +  - ][ +  - ]:          4 :                                      bInPagePreview );
     117                 :            :                 }
     118                 :          6 :                 ++aIter;
     119                 :          4 :             }
     120                 :            :         }
     121                 :            :         else
     122                 :            :         {
     123                 :            :             // The unsorted list is sorted enough, because it return lower
     124                 :            :             // frames in the correct order.
     125         [ +  - ]:        206 :             const SwAccessibleChildSList aVisList( rVisArea, rFrm, rAccMap );
     126         [ +  - ]:        206 :             SwAccessibleChildSList::const_iterator aIter( aVisList.begin() );
     127 [ +  - ][ +  - ]:        450 :             while( aIter != aVisList.end() && !aRet.IsValid() )
         [ +  + ][ +  - ]
         [ +  + ][ +  - ]
         [ +  + ][ #  # ]
     128                 :            :             {
     129                 :        244 :                 const SwAccessibleChild& rLower = *aIter;
     130 [ +  + ][ +  - ]:        244 :                 if( rLower.IsAccessible( bInPagePreview ) )
     131                 :            :                 {
     132         [ +  + ]:        114 :                     if( 0 == rPos )
     133         [ +  - ]:         70 :                         aRet = rLower;
     134                 :            :                     else
     135                 :         44 :                         rPos--;
     136                 :            :                 }
     137 [ +  - ][ +  - ]:        130 :                 else if( rLower.GetSwFrm() )
     138                 :            :                 {
     139                 :            :                     // There are no unaccessible SdrObjects that count
     140                 :            :                     aRet = GetChild( rAccMap,
     141         [ +  - ]:        130 :                                      rVisArea, *(rLower.GetSwFrm()), rPos,
     142 [ +  - ][ +  - ]:        130 :                                      bInPagePreview );
     143                 :            :                 }
     144         [ +  - ]:        244 :                 ++aIter;
     145                 :            :             }
     146                 :            :         }
     147                 :            :     }
     148                 :            : 
     149                 :        214 :     return aRet;
     150                 :            : }
     151                 :            : 
     152                 :         30 : /* static */ sal_Bool SwAccessibleFrame::GetChildIndex(
     153                 :            :                                                 SwAccessibleMap& rAccMap,
     154                 :            :                                                 const SwRect& rVisArea,
     155                 :            :                                                 const SwFrm& rFrm,
     156                 :            :                                                 const SwAccessibleChild& rChild,
     157                 :            :                                                 sal_Int32& rPos,
     158                 :            :                                                 sal_Bool bInPagePreview )
     159                 :            : {
     160                 :         30 :     sal_Bool bFound = sal_False;
     161                 :            : 
     162         [ -  + ]:         30 :     if( SwAccessibleChildMap::IsSortingRequired( rFrm ) )
     163                 :            :     {
     164                 :            :         // We need a sorted list here
     165         [ #  # ]:          0 :         const SwAccessibleChildMap aVisMap( rVisArea, rFrm, rAccMap );
     166                 :          0 :         SwAccessibleChildMap::const_iterator aIter( aVisMap.begin() );
     167 [ #  # ][ #  # ]:          0 :         while( aIter != aVisMap.end() && !bFound )
         [ #  # ][ #  # ]
     168                 :            :         {
     169                 :          0 :             const SwAccessibleChild& rLower = (*aIter).second;
     170 [ #  # ][ #  # ]:          0 :             if( rLower.IsAccessible( bInPagePreview ) )
     171                 :            :             {
     172 [ #  # ][ #  # ]:          0 :                 if( rChild == rLower )
     173                 :          0 :                     bFound = sal_True;
     174                 :            :                 else
     175                 :          0 :                     rPos++;
     176                 :            :             }
     177 [ #  # ][ #  # ]:          0 :             else if( rLower.GetSwFrm() )
     178                 :            :             {
     179                 :            :                 // There are no unaccessible SdrObjects that count
     180                 :            :                 bFound = GetChildIndex( rAccMap,
     181         [ #  # ]:          0 :                                         rVisArea, *(rLower.GetSwFrm()), rChild,
     182         [ #  # ]:          0 :                                         rPos, bInPagePreview );
     183                 :            :             }
     184                 :          0 :             ++aIter;
     185                 :          0 :         }
     186                 :            :     }
     187                 :            :     else
     188                 :            :     {
     189                 :            :         // The unsorted list is sorted enough, because it return lower
     190                 :            :         // frames in the correct order.
     191         [ +  - ]:         30 :         const SwAccessibleChildSList aVisList( rVisArea, rFrm, rAccMap );
     192         [ +  - ]:         30 :         SwAccessibleChildSList::const_iterator aIter( aVisList.begin() );
     193 [ +  - ][ +  - ]:         62 :         while( aIter != aVisList.end() && !bFound )
         [ +  + ][ +  + ]
         [ +  - ][ +  + ]
                 [ #  # ]
     194                 :            :         {
     195                 :         32 :             const SwAccessibleChild& rLower = *aIter;
     196 [ +  + ][ +  - ]:         32 :             if( rLower.IsAccessible( bInPagePreview ) )
     197                 :            :             {
     198 [ +  - ][ +  + ]:         16 :                 if( rChild == rLower )
     199                 :         14 :                     bFound = sal_True;
     200                 :            :                 else
     201                 :          2 :                     rPos++;
     202                 :            :             }
     203 [ +  - ][ +  - ]:         16 :             else if( rLower.GetSwFrm() )
     204                 :            :             {
     205                 :            :                 // There are no unaccessible SdrObjects that count
     206                 :            :                 bFound = GetChildIndex( rAccMap,
     207         [ +  - ]:         16 :                                         rVisArea, *(rLower.GetSwFrm()), rChild,
     208         [ +  - ]:         16 :                                         rPos, bInPagePreview );
     209                 :            :             }
     210         [ +  - ]:         32 :             ++aIter;
     211                 :            :         }
     212                 :            :     }
     213                 :            : 
     214                 :         30 :     return bFound;
     215                 :            : }
     216                 :            : 
     217                 :          8 : SwAccessibleChild SwAccessibleFrame::GetChildAtPixel( const SwRect& rVisArea,
     218                 :            :                                           const SwFrm& rFrm,
     219                 :            :                                           const Point& rPixPos,
     220                 :            :                                           sal_Bool bInPagePreview,
     221                 :            :                                           SwAccessibleMap& rAccMap )
     222                 :            : {
     223                 :          8 :     SwAccessibleChild aRet;
     224                 :            : 
     225         [ -  + ]:          8 :     if( SwAccessibleChildMap::IsSortingRequired( rFrm ) )
     226                 :            :     {
     227                 :            :         // We need a sorted list here, and we have to reverse iterate,
     228                 :            :         // because objects in front should be returned.
     229         [ #  # ]:          0 :         const SwAccessibleChildMap aVisMap( rVisArea, rFrm, rAccMap );
     230                 :          0 :         SwAccessibleChildMap::const_reverse_iterator aRIter( aVisMap.rbegin() );
     231 [ #  # ][ #  # ]:          0 :         while( aRIter != aVisMap.rend() && !aRet.IsValid() )
         [ #  # ][ #  # ]
                 [ #  # ]
           [ #  #  #  # ]
     232                 :            :         {
     233         [ #  # ]:          0 :             const SwAccessibleChild& rLower = (*aRIter).second;
     234                 :            :             // A frame is returned if it's frame size is inside the visarea
     235                 :            :             // and the positiion is inside the frame's paint area.
     236 [ #  # ][ #  # ]:          0 :             if( rLower.IsAccessible( bInPagePreview ) )
     237                 :            :             {
     238         [ #  # ]:          0 :                 SwRect aLogBounds( rLower.GetBounds( rAccMap ) );
     239         [ #  # ]:          0 :                 if( !aLogBounds.IsEmpty() )
     240                 :            :                 {
     241 [ #  # ][ #  # ]:          0 :                     Rectangle aPixBounds( rAccMap.CoreToPixel( aLogBounds.SVRect() ) );
     242 [ #  # ][ #  # ]:          0 :                     if( aPixBounds.IsInside( rPixPos ) )
     243         [ #  # ]:          0 :                         aRet = rLower;
     244                 :            :                 }
     245                 :            :             }
     246 [ #  # ][ #  # ]:          0 :             else if( rLower.GetSwFrm() )
     247                 :            :             {
     248                 :            :                 // There are no unaccessible SdrObjects that count
     249         [ #  # ]:          0 :                 aRet = GetChildAtPixel( rVisArea, *(rLower.GetSwFrm()), rPixPos,
     250 [ #  # ][ #  # ]:          0 :                                         bInPagePreview, rAccMap );
     251                 :            :             }
     252         [ #  # ]:          0 :             ++aRIter;
     253                 :          0 :         }
     254                 :            :     }
     255                 :            :     else
     256                 :            :     {
     257                 :            :         // The unsorted list is sorted enough, because it returns lower
     258                 :            :         // frames in the correct order. Morover, we can iterate forward,
     259                 :            :         // because the lowers don't overlap!
     260         [ +  - ]:          8 :         const SwAccessibleChildSList aVisList( rVisArea, rFrm, rAccMap );
     261         [ +  - ]:          8 :         SwAccessibleChildSList::const_iterator aIter( aVisList.begin() );
     262 [ +  - ][ +  - ]:         16 :         while( aIter != aVisList.end() && !aRet.IsValid() )
         [ +  + ][ +  - ]
         [ +  - ][ +  - ]
         [ +  + ][ #  # ]
     263                 :            :         {
     264                 :          8 :             const SwAccessibleChild& rLower = *aIter;
     265                 :            :             // A frame is returned if it's frame size is inside the visarea
     266                 :            :             // and the positiion is inside the frame's paint area.
     267 [ +  - ][ +  - ]:          8 :             if( rLower.IsAccessible( bInPagePreview ) )
     268                 :            :             {
     269         [ +  - ]:          8 :                 SwRect aLogBounds( rLower.GetBounds( rAccMap ) );
     270         [ +  - ]:          8 :                 if( !aLogBounds.IsEmpty() )
     271                 :            :                 {
     272 [ +  - ][ +  - ]:          8 :                     Rectangle aPixBounds( rAccMap.CoreToPixel( aLogBounds.SVRect() ) );
     273 [ +  - ][ +  + ]:          8 :                     if( aPixBounds.IsInside( rPixPos ) )
     274         [ +  - ]:          8 :                         aRet = rLower;
     275                 :            :                 }
     276                 :            :             }
     277 [ #  # ][ #  # ]:          0 :             else if( rLower.GetSwFrm() )
     278                 :            :             {
     279                 :            :                 // There are no unaccessible SdrObjects that count
     280         [ #  # ]:          0 :                 aRet = GetChildAtPixel( rVisArea, *(rLower.GetSwFrm()), rPixPos,
     281 [ #  # ][ #  # ]:          0 :                                    bInPagePreview, rAccMap );
     282                 :            :             }
     283         [ +  - ]:          8 :             ++aIter;
     284                 :            :         }
     285                 :            :     }
     286                 :            : 
     287                 :          8 :     return aRet;
     288                 :            : }
     289                 :            : 
     290                 :          6 : /* static */ void SwAccessibleFrame::GetChildren( SwAccessibleMap& rAccMap,
     291                 :            :                                                   const SwRect& rVisArea,
     292                 :            :                                                   const SwFrm& rFrm,
     293                 :            :                                                   ::std::list< SwAccessibleChild >& rChildren,
     294                 :            :                                                   sal_Bool bInPagePreview )
     295                 :            : {
     296         [ -  + ]:          6 :     if( SwAccessibleChildMap::IsSortingRequired( rFrm ) )
     297                 :            :     {
     298                 :            :         // We need a sorted list here
     299         [ #  # ]:          0 :         const SwAccessibleChildMap aVisMap( rVisArea, rFrm, rAccMap );
     300                 :          0 :         SwAccessibleChildMap::const_iterator aIter( aVisMap.begin() );
     301         [ #  # ]:          0 :         while( aIter != aVisMap.end() )
     302                 :            :         {
     303                 :          0 :             const SwAccessibleChild& rLower = (*aIter).second;
     304 [ #  # ][ #  # ]:          0 :             if( rLower.IsAccessible( bInPagePreview ) )
     305                 :            :             {
     306         [ #  # ]:          0 :                 rChildren.push_back( rLower );
     307                 :            :             }
     308 [ #  # ][ #  # ]:          0 :             else if( rLower.GetSwFrm() )
     309                 :            :             {
     310                 :            :                 // There are no unaccessible SdrObjects that count
     311         [ #  # ]:          0 :                 GetChildren( rAccMap, rVisArea, *(rLower.GetSwFrm()),
     312         [ #  # ]:          0 :                              rChildren, bInPagePreview );
     313                 :            :             }
     314                 :          0 :             ++aIter;
     315                 :          0 :         }
     316                 :            :     }
     317                 :            :     else
     318                 :            :     {
     319                 :            :         // The unsorted list is sorted enough, because it return lower
     320                 :            :         // frames in the correct order.
     321         [ +  - ]:          6 :         const SwAccessibleChildSList aVisList( rVisArea, rFrm, rAccMap );
     322         [ +  - ]:          6 :         SwAccessibleChildSList::const_iterator aIter( aVisList.begin() );
     323 [ +  - ][ +  - ]:          6 :         while( aIter != aVisList.end() )
                 [ -  + ]
     324                 :            :         {
     325                 :          0 :             const SwAccessibleChild& rLower = *aIter;
     326 [ #  # ][ #  # ]:          0 :             if( rLower.IsAccessible( bInPagePreview ) )
     327                 :            :             {
     328         [ #  # ]:          0 :                 rChildren.push_back( rLower );
     329                 :            :             }
     330 [ #  # ][ #  # ]:          0 :             else if( rLower.GetSwFrm() )
     331                 :            :             {
     332                 :            :                 // There are no unaccessible SdrObjects that count
     333         [ #  # ]:          0 :                 GetChildren( rAccMap, rVisArea, *(rLower.GetSwFrm()),
     334         [ #  # ]:          0 :                              rChildren, bInPagePreview );
     335                 :            :             }
     336         [ #  # ]:          0 :             ++aIter;
     337                 :            :         }
     338                 :            :     }
     339                 :          6 : }
     340                 :            : 
     341                 :       5930 : SwRect SwAccessibleFrame::GetBounds( const SwAccessibleMap& rAccMap,
     342                 :            :                                      const SwFrm *pFrm )
     343                 :            : {
     344         [ -  + ]:       5930 :     if( !pFrm )
     345                 :          0 :         pFrm = GetFrm();
     346                 :            : 
     347         [ +  - ]:       5930 :     SwAccessibleChild aFrm( pFrm );
     348 [ +  - ][ +  - ]:       5930 :     SwRect aBounds( aFrm.GetBounds( rAccMap ).Intersection( maVisArea ) );
     349                 :       5930 :     return aBounds;
     350                 :            : }
     351                 :            : 
     352                 :         79 : sal_Bool SwAccessibleFrame::IsEditable( ViewShell *pVSh ) const
     353                 :            : {
     354                 :         79 :     const SwFrm *pFrm = GetFrm();
     355         [ -  + ]:         79 :     if( !pFrm )
     356                 :          0 :         return sal_False;
     357                 :            : 
     358                 :            :     OSL_ENSURE( pVSh, "no view shell" );
     359         [ +  - ]:        158 :     if( pVSh && (pVSh->GetViewOptions()->IsReadonly() ||
           [ +  -  -  + ]
                 [ -  + ]
     360                 :         79 :                  pVSh->IsPreView()) )
     361                 :          0 :         return sal_False;
     362                 :            : 
     363 [ +  + ][ -  + ]:         79 :     if( !pFrm->IsRootFrm() && pFrm->IsProtected() )
                 [ -  + ]
     364                 :          0 :         return sal_False;
     365                 :            : 
     366                 :         79 :     return sal_True;
     367                 :            : }
     368                 :            : 
     369                 :         79 : sal_Bool SwAccessibleFrame::IsOpaque( ViewShell *pVSh ) const
     370                 :            : {
     371         [ +  - ]:         79 :     SwAccessibleChild aFrm( GetFrm() );
     372 [ +  - ][ -  + ]:         79 :     if( !aFrm.GetSwFrm() )
     373                 :          0 :         return sal_False;
     374                 :            : 
     375                 :            :     OSL_ENSURE( pVSh, "no view shell" );
     376         [ -  + ]:         79 :     if( !pVSh )
     377                 :          0 :         return sal_False;
     378                 :            : 
     379                 :         79 :     const SwViewOption *pVOpt = pVSh->GetViewOptions();
     380 [ +  - ][ +  + ]:        278 :     do
                 [ +  + ]
     381                 :            :     {
     382         [ +  - ]:        163 :         const SwFrm *pFrm = aFrm.GetSwFrm();
     383         [ +  + ]:        163 :         if( pFrm->IsRootFrm() )
     384                 :         24 :             return sal_True;
     385                 :            : 
     386 [ +  + ][ -  + ]:        139 :         if( pFrm->IsPageFrm() && !pVOpt->IsPageBack() )
                 [ -  + ]
     387                 :          0 :             return sal_False;
     388                 :            : 
     389 [ +  - ][ +  - ]:        139 :         const SvxBrushItem &rBack = pFrm->GetAttrSet()->GetBackground();
     390   [ +  -  -  + ]:        278 :         if( !rBack.GetColor().GetTransparency() ||
                 [ -  + ]
     391                 :        139 :              rBack.GetGraphicPos() != GPOS_NONE )
     392                 :          0 :             return sal_True;
     393                 :            : 
     394                 :            :         // If a fly frame has a transparent background color, we have to consider the background.
     395                 :            :         // But a background color "no fill"/"auto fill" has *not* to be considered.
     396   [ +  +  +  -  :        282 :         if( pFrm->IsFlyFrm() &&
           -  + ][ -  + ]
     397                 :          2 :             (rBack.GetColor().GetTransparency() != 0) &&
     398         [ +  + ]:        141 :             (rBack.GetColor() != COL_TRANSPARENT)
     399                 :            :           )
     400                 :          0 :             return sal_True;
     401                 :            : 
     402         [ -  + ]:        139 :         if( pFrm->IsSctFrm() )
     403                 :            :         {
     404                 :          0 :             const SwSection* pSection = ((SwSectionFrm*)pFrm)->GetSection();
     405   [ #  #  #  #  :          0 :             if( pSection && ( TOX_HEADER_SECTION == pSection->GetType() ||
           #  # ][ #  # ]
         [ #  # ][ #  # ]
     406                 :          0 :                 TOX_CONTENT_SECTION == pSection->GetType() ) &&
     407                 :          0 :                 !pVOpt->IsReadonly() &&
     408         [ #  # ]:          0 :                 SwViewOption::IsIndexShadings() )
     409                 :          0 :                 return sal_True;
     410                 :            :         }
     411         [ +  + ]:        139 :         if( pFrm->IsFlyFrm() )
     412 [ +  - ][ +  - ]:          2 :             aFrm = static_cast<const SwFlyFrm*>(pFrm)->GetAnchorFrm();
     413                 :            :         else
     414         [ +  - ]:        137 :             aFrm = pFrm->GetUpper();
     415 [ +  - ][ +  - ]:        278 :     } while( aFrm.GetSwFrm() && !aFrm.IsAccessible( IsInPagePreview() ) );
     416                 :            : 
     417                 :         79 :     return sal_False;
     418                 :            : }
     419                 :            : 
     420                 :         79 : SwAccessibleFrame::SwAccessibleFrame( const SwRect& rVisArea,
     421                 :            :                                       const SwFrm *pF,
     422                 :            :                                       sal_Bool bIsPagePreview ) :
     423                 :            :     maVisArea( rVisArea ),
     424                 :            :     mpFrm( pF ),
     425                 :         79 :     mbIsInPagePreview( bIsPagePreview )
     426                 :            : {
     427                 :         79 : }
     428                 :            : 
     429                 :         79 : SwAccessibleFrame::~SwAccessibleFrame()
     430                 :            : {
     431         [ -  + ]:         79 : }
     432                 :            : 
     433                 :       4798 : /* static */ const SwFrm* SwAccessibleFrame::GetParent( const SwAccessibleChild& rFrmOrObj,
     434                 :            :                                                         sal_Bool bInPagePreview )
     435                 :            : {
     436                 :       4798 :     return rFrmOrObj.GetParent( bInPagePreview );
     437                 :            : }
     438                 :            : 
     439                 :          4 : String SwAccessibleFrame::GetFormattedPageNumber() const
     440                 :            : {
     441                 :          4 :     sal_uInt16 nPageNum = GetFrm()->GetVirtPageNum();
     442                 :            :     sal_uInt32 nFmt = GetFrm()->FindPageFrm()->GetPageDesc()
     443                 :          4 :                               ->GetNumType().GetNumberingType();
     444         [ -  + ]:          4 :     if( SVX_NUM_NUMBER_NONE == nFmt )
     445                 :          0 :         nFmt = SVX_NUM_ARABIC;
     446                 :            : 
     447                 :          4 :     String sRet( FormatNumber( nPageNum, nFmt ) );
     448                 :          4 :     return sRet;
     449                 :            : }
     450                 :            : 
     451                 :        188 : sal_Int32 SwAccessibleFrame::GetChildCount( SwAccessibleMap& rAccMap ) const
     452                 :            : {
     453                 :        188 :     return GetChildCount( rAccMap, maVisArea, mpFrm, IsInPagePreview() );
     454                 :            : }
     455                 :            : 
     456                 :         80 : sw::access::SwAccessibleChild SwAccessibleFrame::GetChild(
     457                 :            :                                                 SwAccessibleMap& rAccMap,
     458                 :            :                                                 sal_Int32 nPos ) const
     459                 :            : {
     460                 :         80 :     return SwAccessibleFrame::GetChild( rAccMap, maVisArea, *mpFrm, nPos, IsInPagePreview() );
     461                 :            : }
     462                 :            : 
     463                 :         14 : sal_Int32 SwAccessibleFrame::GetChildIndex( SwAccessibleMap& rAccMap,
     464                 :            :                                             const sw::access::SwAccessibleChild& rChild ) const
     465                 :            : {
     466                 :         14 :     sal_Int32 nPos = 0;
     467         [ +  - ]:         14 :     return GetChildIndex( rAccMap, maVisArea, *mpFrm, rChild, nPos, IsInPagePreview() )
     468                 :            :            ? nPos
     469         [ +  - ]:         14 :            : -1L;
     470                 :            : }
     471                 :            : 
     472                 :          8 : sw::access::SwAccessibleChild SwAccessibleFrame::GetChildAtPixel(
     473                 :            :                                                 const Point& rPos,
     474                 :            :                                                 SwAccessibleMap& rAccMap ) const
     475                 :            : {
     476                 :          8 :     return GetChildAtPixel( maVisArea, *mpFrm, rPos, IsInPagePreview(), rAccMap );
     477                 :            : }
     478                 :            : 
     479                 :          6 : void SwAccessibleFrame::GetChildren( SwAccessibleMap& rAccMap,
     480                 :            :                                      ::std::list< sw::access::SwAccessibleChild >& rChildren ) const
     481                 :            : {
     482                 :          6 :     GetChildren( rAccMap, maVisArea, *mpFrm, rChildren, IsInPagePreview() );
     483                 :          6 : }
     484                 :            : 
     485                 :        190 : sal_Bool SwAccessibleFrame::IsShowing( const SwAccessibleMap& rAccMap,
     486                 :            :                                        const sw::access::SwAccessibleChild& rFrmOrObj ) const
     487                 :            : {
     488         [ +  - ]:        190 :     return IsShowing( rFrmOrObj.GetBox( rAccMap ) );
     489                 :            : }
     490                 :            : 
     491                 :            : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */

Generated by: LCOV version 1.10