LCOV - code coverage report
Current view: top level - svx/source/accessibility - SvxShapeTypes.cxx (source / functions) Hit Total Coverage
Test: libreoffice_filtered.info Lines: 8 12 66.7 %
Date: 2012-08-25 Functions: 2 2 100.0 %
Legend: Lines: hit not hit | Branches: + taken - not taken # not executed Branches: 37 90 41.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                 :            : 
      30                 :            : #include <svx/SvxShapeTypes.hxx>
      31                 :            : #include <svx/AccessibleShape.hxx>
      32                 :            : #include <svx/AccessibleGraphicShape.hxx>
      33                 :            : #include <svx/AccessibleOLEShape.hxx>
      34                 :            : #include <svx/AccessibleControlShape.hxx>
      35                 :            : #include <svx/AccessibleTableShape.hxx>
      36                 :            : 
      37                 :            : namespace accessibility {
      38                 :            : 
      39                 :          8 : AccessibleShape* CreateSvxAccessibleShape (
      40                 :            :     const AccessibleShapeInfo& rShapeInfo,
      41                 :            :     const AccessibleShapeTreeInfo& rShapeTreeInfo,
      42                 :            :     ShapeTypeId nId)
      43                 :            : {
      44   [ +  -  -  -  :          8 :     switch (nId)
                   -  - ]
      45                 :            :     {
      46                 :            :         case DRAWING_3D_CUBE:
      47                 :            :         case DRAWING_3D_EXTRUDE:
      48                 :            :         case DRAWING_3D_LATHE:
      49                 :            :         case DRAWING_3D_SCENE:
      50                 :            :         case DRAWING_3D_SPHERE:
      51                 :            :         case DRAWING_CAPTION:
      52                 :            :         case DRAWING_CLOSED_BEZIER:
      53                 :            :         case DRAWING_CLOSED_FREEHAND:
      54                 :            :         case DRAWING_CONNECTOR:
      55                 :            :         case DRAWING_ELLIPSE:
      56                 :            :         case DRAWING_GROUP:
      57                 :            :         case DRAWING_LINE:
      58                 :            :         case DRAWING_MEASURE:
      59                 :            :         case DRAWING_OPEN_BEZIER:
      60                 :            :         case DRAWING_OPEN_FREEHAND:
      61                 :            :         case DRAWING_PAGE:
      62                 :            :         case DRAWING_POLY_POLYGON:
      63                 :            :         case DRAWING_POLY_LINE:
      64                 :            :         case DRAWING_POLY_POLYGON_PATH:
      65                 :            :         case DRAWING_POLY_LINE_PATH:
      66                 :            :         case DRAWING_RECTANGLE:
      67                 :            :         case DRAWING_TEXT:
      68                 :            :         // Default accessiblility shape for
      69                 :            :         // com::sun::star::drawing::CustomShape (#i37790#)
      70                 :            :         case DRAWING_CUSTOM:
      71                 :            :         // Default accessiblility shape for
      72                 :            :         // com::sun::star::drawing::MediaShape (#i85429#)
      73                 :            :         case DRAWING_MEDIA:
      74         [ +  - ]:          8 :             return new AccessibleShape (rShapeInfo, rShapeTreeInfo);
      75                 :            : 
      76                 :            :         case DRAWING_CONTROL:
      77         [ #  # ]:          0 :             return new AccessibleControlShape (rShapeInfo, rShapeTreeInfo);
      78                 :            : 
      79                 :            :         case DRAWING_GRAPHIC_OBJECT:
      80         [ #  # ]:          0 :             return new AccessibleGraphicShape (rShapeInfo, rShapeTreeInfo);
      81                 :            : 
      82                 :            :         case DRAWING_APPLET:
      83                 :            :         case DRAWING_FRAME:
      84                 :            :         case DRAWING_OLE:
      85                 :            :         case DRAWING_PLUGIN:
      86         [ #  # ]:          0 :             return new AccessibleOLEShape (rShapeInfo, rShapeTreeInfo);
      87                 :            : 
      88                 :            :         case DRAWING_TABLE:
      89         [ #  # ]:          0 :             return new AccessibleTableShape( rShapeInfo, rShapeTreeInfo );
      90                 :            : 
      91                 :            :         default:
      92                 :          8 :             return NULL;
      93                 :            :     }
      94                 :            : }
      95                 :            : 
      96                 :         22 : void RegisterDrawShapeTypes (void)
      97                 :            : {
      98                 :            :     /** List of shape type descriptors corresponding to the
      99                 :            :         <type>SvxShapeTypes</type> enum.
     100                 :            :     */
     101                 :            :     ShapeTypeDescriptor aSvxShapeTypeList[] = {
     102                 :            :         ShapeTypeDescriptor (DRAWING_TEXT,
     103                 :            :             ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.drawing.TextShape")),
     104                 :            :             CreateSvxAccessibleShape),
     105                 :            :         ShapeTypeDescriptor (DRAWING_RECTANGLE,
     106                 :            :             ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.drawing.RectangleShape")),
     107                 :            :             CreateSvxAccessibleShape),
     108                 :            :         ShapeTypeDescriptor (   DRAWING_ELLIPSE,
     109                 :            :             ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.drawing.EllipseShape")),
     110                 :            :             CreateSvxAccessibleShape ),
     111                 :            :         ShapeTypeDescriptor (   DRAWING_CONTROL,
     112                 :            :             ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.drawing.ControlShape")),
     113                 :            :             CreateSvxAccessibleShape ),
     114                 :            :         ShapeTypeDescriptor (   DRAWING_CONNECTOR,
     115                 :            :             ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.drawing.ConnectorShape")),
     116                 :            :             CreateSvxAccessibleShape ),
     117                 :            :         ShapeTypeDescriptor (   DRAWING_MEASURE,
     118                 :            :             ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.drawing.MeasureShape")),
     119                 :            :             CreateSvxAccessibleShape ),
     120                 :            :         ShapeTypeDescriptor (   DRAWING_LINE,
     121                 :            :             ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.drawing.LineShape")),
     122                 :            :             CreateSvxAccessibleShape ),
     123                 :            :         ShapeTypeDescriptor (   DRAWING_POLY_POLYGON,
     124                 :            :             ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.drawing.PolyPolygonShape")),
     125                 :            :             CreateSvxAccessibleShape ),
     126                 :            :         ShapeTypeDescriptor (   DRAWING_POLY_LINE,
     127                 :            :             ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.drawing.PolyLineShape")),
     128                 :            :             CreateSvxAccessibleShape ),
     129                 :            :         ShapeTypeDescriptor (   DRAWING_OPEN_BEZIER,
     130                 :            :             ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.drawing.OpenBezierShape")),
     131                 :            :             CreateSvxAccessibleShape ),
     132                 :            :         ShapeTypeDescriptor (   DRAWING_CLOSED_BEZIER,
     133                 :            :             ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.drawing.ClosedBezierShape")),
     134                 :            :             CreateSvxAccessibleShape ),
     135                 :            :         ShapeTypeDescriptor (   DRAWING_OPEN_FREEHAND,
     136                 :            :             ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.drawing.OpenFreeHandShape")),
     137                 :            :             CreateSvxAccessibleShape ),
     138                 :            :         ShapeTypeDescriptor (   DRAWING_CLOSED_FREEHAND,
     139                 :            :             ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.drawing.ClosedFreeHandShape")),
     140                 :            :             CreateSvxAccessibleShape ),
     141                 :            :         ShapeTypeDescriptor (   DRAWING_POLY_POLYGON_PATH,
     142                 :            :             ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.drawing.PolyPolygonPathShape")),
     143                 :            :             CreateSvxAccessibleShape ),
     144                 :            :         ShapeTypeDescriptor (   DRAWING_POLY_LINE_PATH,
     145                 :            :             ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.drawing.PolyLinePathShape")),
     146                 :            :             CreateSvxAccessibleShape ),
     147                 :            :         ShapeTypeDescriptor (   DRAWING_GRAPHIC_OBJECT,
     148                 :            :             ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.drawing.GraphicObjectShape")),
     149                 :            :             CreateSvxAccessibleShape ),
     150                 :            :         ShapeTypeDescriptor (   DRAWING_GROUP,
     151                 :            :             ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.drawing.GroupShape")),
     152                 :            :             CreateSvxAccessibleShape ),
     153                 :            :         ShapeTypeDescriptor (   DRAWING_OLE,
     154                 :            :             ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.drawing.OLE2Shape")),
     155                 :            :             CreateSvxAccessibleShape ),
     156                 :            :         ShapeTypeDescriptor (   DRAWING_PAGE,
     157                 :            :             ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.drawing.PageShape")),
     158                 :            :             CreateSvxAccessibleShape ),
     159                 :            :         ShapeTypeDescriptor (   DRAWING_CAPTION,
     160                 :            :             ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.drawing.CaptionShape")),
     161                 :            :             CreateSvxAccessibleShape ),
     162                 :            :         ShapeTypeDescriptor (   DRAWING_FRAME,
     163                 :            :             ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.drawing.FrameShape")),
     164                 :            :             CreateSvxAccessibleShape ),
     165                 :            :         ShapeTypeDescriptor (   DRAWING_PLUGIN,
     166                 :            :             ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.drawing.PluginShape")),
     167                 :            :             CreateSvxAccessibleShape ),
     168                 :            :         ShapeTypeDescriptor (   DRAWING_APPLET,
     169                 :            :             ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.drawing.AppletShape")),
     170                 :            :             CreateSvxAccessibleShape ),
     171                 :            :         ShapeTypeDescriptor (   DRAWING_3D_SCENE,
     172                 :            :             ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.drawing.Shape3DSceneObject")),
     173                 :            :             CreateSvxAccessibleShape ),
     174                 :            :         ShapeTypeDescriptor (   DRAWING_3D_CUBE,
     175                 :            :             ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.drawing.Shape3DCubeObject")),
     176                 :            :             CreateSvxAccessibleShape ),
     177                 :            :         ShapeTypeDescriptor (   DRAWING_3D_SPHERE,
     178                 :            :             ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.drawing.Shape3DSphereObject")),
     179                 :            :             CreateSvxAccessibleShape ),
     180                 :            :         ShapeTypeDescriptor (   DRAWING_3D_LATHE,
     181                 :            :             ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.drawing.Shape3DLatheObject")),
     182                 :            :             CreateSvxAccessibleShape ),
     183                 :            :         ShapeTypeDescriptor (   DRAWING_3D_EXTRUDE,
     184                 :            :             ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.drawing.Shape3DExtrudeObject")),
     185                 :            :             CreateSvxAccessibleShape ),
     186                 :            :         ShapeTypeDescriptor (   DRAWING_CUSTOM,
     187                 :            :             ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.drawing.CustomShape")),
     188                 :            :             CreateSvxAccessibleShape ),
     189                 :            :         ShapeTypeDescriptor (   DRAWING_TABLE,
     190                 :            :             rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.drawing.TableShape" ) ),
     191                 :            :             CreateSvxAccessibleShape ),
     192                 :            :         ShapeTypeDescriptor (   DRAWING_MEDIA,
     193                 :            :             rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.drawing.MediaShape" ) ),
     194                 :            :             CreateSvxAccessibleShape ),
     195                 :            : 
     196 [ +  - ][ +  - ]:        704 :     };
         [ +  - ][ +  - ]
         [ +  - ][ +  - ]
         [ +  - ][ +  - ]
         [ +  - ][ +  - ]
         [ +  - ][ +  - ]
         [ +  - ][ +  - ]
         [ +  - ][ +  - ]
         [ +  - ][ +  - ]
         [ +  - ][ +  - ]
         [ +  - ][ +  - ]
         [ +  - ][ +  - ]
         [ +  - ][ +  - ]
         [ +  - ][ +  - ]
         [ +  - ][ +  - ]
                 [ +  - ]
           [ #  #  #  # ]
     197                 :            : 
     198                 :            :     // Crash while inserting callout with activated accesibility (#i37790#)
     199         [ +  - ]:        704 :     ShapeTypeHandler::Instance().AddShapeTypeList ( DRAWING_END, aSvxShapeTypeList);
           [ +  +  #  # ]
                 [ +  - ]
     200                 :         22 : }
     201                 :            : 
     202                 :            : } // end of namespace accessibility
     203                 :            : 
     204                 :            : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */

Generated by: LCOV version 1.10