LCOV - code coverage report
Current view: top level - sc/source/ui/vba - vbadialog.cxx (source / functions) Hit Total Coverage
Test: libreoffice_filtered.info Lines: 4 19 21.1 %
Date: 2012-08-25 Functions: 4 8 50.0 %
Legend: Lines: hit not hit | Branches: + taken - not taken # not executed Branches: 30 78 38.5 %

           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                 :            : #include "vbadialog.hxx"
      29                 :            : 
      30                 :            : #include <sal/macros.h>
      31                 :            : 
      32                 :            : using namespace ::ooo::vba;
      33                 :            : using namespace ::com::sun::star;
      34                 :            : 
      35                 :            : //solve the problem that "Application.Dialogs.Item(***).Show" and "Application.Dialogs.Count" cannot get the correct result
      36                 :         78 : struct DialogMatch
      37                 :            : {
      38                 :            :     sal_Int32       nVbaDlgIndex;
      39                 :            :     rtl::OUString   aOODlgName;
      40                 :            : };
      41                 :            : 
      42         [ +  + ]:         84 : static const DialogMatch aDialogMatchList[] =
      43                 :            : {
      44                 :            :     { 1,    rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( ".uno:Open" ) ) },                      // xlDialogOpen -> .uno:Open
      45                 :            :     { -1,   rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( ".uno:FormatCellDialog" ) ) },          // ??? -> .uno:FormatCellDialog
      46                 :            :     { 55,   rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( ".uno:InsertCell" ) ) },                // xlDialogInsert -> .uno:InsertCell
      47                 :            :     { 8,    rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( ".uno:Print" ) ) },                     // xlDialogPrint -> .uno:Print
      48                 :            :     { 9,    rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( ".uno:PrinterSetup" ) ) },              // xlDialogPrinterSetup -> .uno:PrinterSetup
      49                 :            :     { 53,   rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( ".uno:PasteSpecial" ) ) },              // xlDialogPasteSpecial -> .uno:PasteSpecial
      50                 :            :     { 28,   rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( ".uno:ToolProtectionDocument" ) ) },    // xlDialogProtectDocument -> uno:ToolProtectionDocument
      51                 :            :     { 47,   rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( ".uno:ColumnWidth" ) ) },               // xlDialogColumnWidth -> .uno:ColumnWidth
      52                 :            :     { 61,   rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( ".uno:DefineName" ) ) },                // xlDialogDefineName -> .uno:DefineName
      53                 :            :     { -1,   rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( ".uno:ConfigureDialog" ) ) },           // ??? -> .uno:ConfigureDialog
      54                 :            :     { 596,  rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( ".uno:HyperlinkDialog" ) ) },           // xlDialogInsertHyperlink -> .uno:HyperlinkDialog
      55                 :            :     { 342,  rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( ".uno:InsertGraphic" ) ) },             // xlDialogInsertPicture -> .uno:InsertGraphic
      56                 :            :     { 259,  rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( ".uno:InsertObject" ) ) },              // xlDialogInsertObject -> .uno:InsertObject
      57                 :            :     { 7,    rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( ".uno:PageFormatDialog" ) ) },          // xlDialogPageSetup -> .uno:PageFormatDialog
      58                 :            :     { 39,   rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( ".uno:DataSort" ) ) },                  // xlDialogSort -> .uno:DataSort
      59                 :            :     { 127,  rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( ".uno:RowHeight" ) ) },                 // xlDialogRowHeight -> .uno:RowHeight
      60                 :            :     { 485,  rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( ".uno:AutoCorrectDlg" ) ) },            // xlDialogAutoCorrect -> .uno:AutoCorrectDlg
      61                 :            :     { 583,  rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( ".uno:ConditionalFormatDialog" ) ) },   // xlDialogCondiationalFormatting -> .uno:ConditionalFormatDialog
      62                 :            :     { 191,  rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( ".uno:DataConsolidate" ) ) },           // xlDialogConsolidate -> .uno:DataConsolidate
      63                 :            :     { 62,   rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( ".uno:CreateNames" ) ) },               // xlDialogCreateNames -> .uno:CreateNames
      64                 :            :     { -1,   rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( ".uno:FillSeries" ) ) },                // ??? -> .uno:FillSeries
      65                 :            :     { -1,   rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( ".uno:Validation" ) ) },                // ??? -> .uno:Validation"
      66                 :            :     { -1,   rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( ".uno:DefineLabelRange" ) ) },          // ??? -> .uno:DefineLabelRange
      67                 :            :     { -1,   rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( ".uno:DataFilterAutoFilter" ) ) },      // ??? -> .uno:DataFilterAutoFilter
      68                 :            :     { -1,   rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( ".uno:DataFilterSpecialFilter" ) ) },   // ??? -> .uno:DataFilterSpecialFilter
      69                 :            :     { 269,  rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( ".uno:AutoFormat" ) ) }                 // xlDialogFormatAuto -> .uno:AutoFormat
      70 [ +  - ][ +  - ]:          3 : };
         [ +  - ][ +  - ]
         [ +  - ][ +  - ]
         [ +  - ][ +  - ]
         [ +  - ][ +  - ]
         [ +  - ][ +  - ]
         [ +  - ][ +  - ]
         [ +  - ][ +  - ]
         [ +  - ][ +  - ]
         [ +  - ][ +  - ]
         [ +  - ][ +  - ]
         [ +  - ][ +  - ]
         [ +  - ][ +  -  
             #  #  #  # ]
      71                 :            : 
      72                 :            : const sal_Int32 nDialogSize = sizeof (aDialogMatchList) / sizeof (aDialogMatchList[0]);
      73                 :            : 
      74                 :            : rtl::OUString
      75                 :          0 : ScVbaDialog::mapIndexToName( sal_Int32 nIndex )
      76                 :            : {
      77         [ #  # ]:          0 :     for (int i = 0; i < nDialogSize; i++)
      78                 :            :     {
      79         [ #  # ]:          0 :         if ( aDialogMatchList[i].nVbaDlgIndex == nIndex )
      80                 :            :         {
      81                 :          0 :             return aDialogMatchList[i].aOODlgName;
      82                 :            :         }
      83                 :            :     }
      84                 :            : 
      85                 :          0 :     return rtl::OUString();
      86                 :            : }
      87                 :            : 
      88                 :            : rtl::OUString
      89                 :          0 : ScVbaDialog::getServiceImplName()
      90                 :            : {
      91                 :          0 :     return rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("ScVbaDialog"));
      92                 :            : }
      93                 :            : 
      94                 :            : uno::Sequence< rtl::OUString >
      95                 :          0 : ScVbaDialog::getServiceNames()
      96                 :            : {
      97 [ #  # ][ #  # ]:          0 :     static uno::Sequence< rtl::OUString > aServiceNames;
         [ #  # ][ #  # ]
      98         [ #  # ]:          0 :     if ( aServiceNames.getLength() == 0 )
      99                 :            :     {
     100                 :          0 :         aServiceNames.realloc( 1 );
     101         [ #  # ]:          0 :         aServiceNames[ 0 ] = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("ooo.vba.excel.Dialog" ) );
     102                 :            :     }
     103                 :          0 :     return aServiceNames;
     104                 :            : }
     105                 :            : 
     106                 :          0 : sal_Int32 ScVbaDialog::GetSupportedDialogCount()
     107                 :            : {
     108                 :          0 :     return nDialogSize;
     109 [ +  - ][ +  - ]:          9 : }
     110                 :            : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */

Generated by: LCOV version 1.10