LCOV - code coverage report
Current view: top level - ucb/source/ucp/file - filinsreq.cxx (source / functions) Hit Total Coverage
Test: libreoffice_filtered.info Lines: 27 63 42.9 %
Date: 2012-08-25 Functions: 7 17 41.2 %
Legend: Lines: hit not hit | Branches: + taken - not taken # not executed Branches: 13 196 6.6 %

           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 "filinsreq.hxx"
      30                 :            : #include "shell.hxx"
      31                 :            : #include "filglob.hxx"
      32                 :            : #include <com/sun/star/ucb/IOErrorCode.hpp>
      33                 :            : #include <com/sun/star/ucb/InteractiveAugmentedIOException.hpp>
      34                 :            : #include <com/sun/star/ucb/NameClashException.hpp>
      35                 :            : #include <com/sun/star/beans/PropertyValue.hpp>
      36                 :            : 
      37                 :            : 
      38                 :            : 
      39                 :            : using namespace cppu;
      40                 :            : using namespace com::sun::star;
      41                 :            : using namespace com::sun::star::uno;
      42                 :            : using namespace com::sun::star::lang;
      43                 :            : using namespace com::sun::star::task;
      44                 :            : using namespace com::sun::star::ucb;
      45                 :            : using namespace com::sun::star::beans;
      46                 :            : using namespace fileaccess;
      47                 :            : 
      48                 :            : 
      49                 :            : 
      50                 :            : void SAL_CALL
      51                 :        150 : XInteractionSupplyNameImpl::acquire( void )
      52                 :            :     throw()
      53                 :            : {
      54                 :        150 :     OWeakObject::acquire();
      55                 :        150 : }
      56                 :            : 
      57                 :            : 
      58                 :            : 
      59                 :            : void SAL_CALL
      60                 :        150 : XInteractionSupplyNameImpl::release( void )
      61                 :            :     throw()
      62                 :            : {
      63                 :        150 :     OWeakObject::release();
      64                 :        150 : }
      65                 :            : 
      66                 :            : 
      67                 :            : 
      68                 :            : Any SAL_CALL
      69                 :          0 : XInteractionSupplyNameImpl::queryInterface( const Type& rType )
      70                 :            :     throw( RuntimeException )
      71                 :            : {
      72                 :            :     Any aRet = cppu::queryInterface( rType,
      73                 :            :                                      (static_cast< lang::XTypeProvider* >(this)),
      74         [ #  # ]:          0 :                                      (static_cast< XInteractionSupplyName* >(this)) );
      75 [ #  # ][ #  # ]:          0 :     return aRet.hasValue() ? aRet : OWeakObject::queryInterface( rType );
      76                 :            : }
      77                 :            : 
      78                 :            : 
      79                 :            : //////////////////////////////////////////////////////////////////////////////////////////
      80                 :            : //  XTypeProvider
      81                 :            : //////////////////////////////////////////////////////////////////////////////////////////
      82                 :            : 
      83 [ #  # ][ #  # ]:          0 : XTYPEPROVIDER_IMPL_2( XInteractionSupplyNameImpl,
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
      84                 :            :                       XTypeProvider,
      85                 :            :                       XInteractionSupplyName )
      86                 :            : 
      87                 :            : 
      88                 :            : 
      89                 :            : void SAL_CALL
      90                 :        150 : XInteractionAbortImpl::acquire( void )
      91                 :            :     throw()
      92                 :            : {
      93                 :        150 :     OWeakObject::acquire();
      94                 :        150 : }
      95                 :            : 
      96                 :            : 
      97                 :            : 
      98                 :            : void SAL_CALL
      99                 :        150 : XInteractionAbortImpl::release( void )
     100                 :            :     throw()
     101                 :            : {
     102                 :        150 :     OWeakObject::release();
     103                 :        150 : }
     104                 :            : 
     105                 :            : 
     106                 :            : 
     107                 :            : Any SAL_CALL
     108                 :          0 : XInteractionAbortImpl::queryInterface( const Type& rType )
     109                 :            :     throw( RuntimeException )
     110                 :            : {
     111                 :            :     Any aRet = cppu::queryInterface( rType,
     112                 :            :                                      (static_cast< lang::XTypeProvider* >(this)),
     113         [ #  # ]:          0 :                                      (static_cast< XInteractionAbort* >(this)) );
     114 [ #  # ][ #  # ]:          0 :     return aRet.hasValue() ? aRet : OWeakObject::queryInterface( rType );
     115                 :            : }
     116                 :            : 
     117                 :            : 
     118                 :            : //////////////////////////////////////////////////////////////////////////////////////////
     119                 :            : //  XTypeProvider
     120                 :            : //////////////////////////////////////////////////////////////////////////////////////////
     121                 :            : 
     122 [ #  # ][ #  # ]:          0 : XTYPEPROVIDER_IMPL_2( XInteractionAbortImpl,
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
     123                 :            :                       XTypeProvider,
     124                 :            :                       XInteractionAbort )
     125                 :            : 
     126                 :            : 
     127                 :            : 
     128                 :         75 : XInteractionRequestImpl::XInteractionRequestImpl(
     129                 :            :     const rtl::OUString& aClashingName,
     130                 :            :     const Reference<XInterface>& xOrigin,
     131                 :            :     shell *pShell,sal_Int32 CommandId)
     132         [ +  - ]:         75 :     : p1( new XInteractionSupplyNameImpl ),
     133         [ +  - ]:         75 :       p2( new XInteractionAbortImpl ),
     134                 :            :       m_nErrorCode(0),
     135                 :            :       m_nMinorError(0),
     136                 :            :       m_aSeq( 2 ),
     137                 :            :       m_aClashingName(aClashingName),
     138         [ +  - ]:        225 :       m_xOrigin(xOrigin)
     139                 :            : {
     140         [ +  - ]:         75 :     if( pShell )
     141         [ +  - ]:         75 :         pShell->retrieveError(CommandId,m_nErrorCode,m_nMinorError);
     142 [ +  - ][ +  - ]:         75 :     m_aSeq[0] = Reference<XInteractionContinuation>(p1);
         [ +  - ][ +  - ]
     143 [ +  - ][ +  - ]:         75 :     m_aSeq[1] = Reference<XInteractionContinuation>(p2);
         [ +  - ][ +  - ]
     144                 :         75 : }
     145                 :            : 
     146                 :            : 
     147                 :            : void SAL_CALL
     148                 :         75 : XInteractionRequestImpl::acquire( void )
     149                 :            :     throw()
     150                 :            : {
     151                 :         75 :     OWeakObject::acquire();
     152                 :         75 : }
     153                 :            : 
     154                 :            : 
     155                 :            : 
     156                 :            : void SAL_CALL
     157                 :         75 : XInteractionRequestImpl::release( void )
     158                 :            :     throw()
     159                 :            : {
     160                 :         75 :     OWeakObject::release();
     161                 :         75 : }
     162                 :            : 
     163                 :            : 
     164                 :            : 
     165                 :            : Any SAL_CALL
     166                 :          0 : XInteractionRequestImpl::queryInterface( const Type& rType )
     167                 :            :     throw( RuntimeException )
     168                 :            : {
     169                 :            :     Any aRet =
     170                 :            :         cppu::queryInterface(
     171                 :            :             rType,
     172                 :            :             (static_cast< lang::XTypeProvider* >(this)),
     173         [ #  # ]:          0 :             (static_cast< XInteractionRequest* >(this)) );
     174 [ #  # ][ #  # ]:          0 :     return aRet.hasValue() ? aRet : OWeakObject::queryInterface( rType );
     175                 :            : }
     176                 :            : 
     177                 :            : 
     178                 :            : //////////////////////////////////////////////////////////////////////////////////////////
     179                 :            : //  XTypeProvider
     180                 :            : //////////////////////////////////////////////////////////////////////////////////////////
     181                 :            : 
     182 [ #  # ][ #  # ]:          0 : XTYPEPROVIDER_IMPL_2( XInteractionRequestImpl,
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
     183                 :            :                       XTypeProvider,
     184                 :            :                       XInteractionRequest )
     185                 :            : 
     186                 :            : 
     187                 :            : Any SAL_CALL
     188                 :          0 : XInteractionRequestImpl::getRequest()
     189                 :            :     throw(RuntimeException)
     190                 :            : {
     191                 :          0 :     Any aAny;
     192         [ #  # ]:          0 :     if(m_nErrorCode == TASKHANDLING_FOLDER_EXISTS_MKDIR)
     193                 :            :     {
     194         [ #  # ]:          0 :         NameClashException excep;
     195                 :          0 :         excep.Name = m_aClashingName;
     196                 :          0 :         excep.Classification = InteractionClassification_ERROR;
     197         [ #  # ]:          0 :         excep.Context = m_xOrigin;
     198                 :          0 :         excep.Message = rtl::OUString( "folder exists and overwritte forbidden");
     199 [ #  # ][ #  # ]:          0 :         aAny <<= excep;
     200                 :            :     }
     201         [ #  # ]:          0 :     else if(m_nErrorCode == TASKHANDLING_INVALID_NAME_MKDIR)
     202                 :            :     {
     203         [ #  # ]:          0 :         InteractiveAugmentedIOException excep;
     204                 :          0 :         excep.Code = IOErrorCode_INVALID_CHARACTER;
     205                 :          0 :         PropertyValue prop;
     206                 :          0 :         prop.Name = rtl::OUString("ResourceName");
     207                 :          0 :         prop.Handle = -1;
     208         [ #  # ]:          0 :         prop.Value <<= m_aClashingName;
     209         [ #  # ]:          0 :         Sequence<Any> seq(1);
     210 [ #  # ][ #  # ]:          0 :         seq[0] <<= prop;
     211         [ #  # ]:          0 :         excep.Arguments = seq;
     212                 :          0 :         excep.Classification = InteractionClassification_ERROR;
     213         [ #  # ]:          0 :         excep.Context = m_xOrigin;
     214                 :          0 :         excep.Message = rtl::OUString( "the name contained invalid characters");
     215 [ #  # ][ #  # ]:          0 :         aAny <<= excep;
                 [ #  # ]
     216                 :            : 
     217                 :            :     }
     218                 :          0 :     return aAny;
     219                 :            : }
     220                 :            : 
     221                 :            : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */

Generated by: LCOV version 1.10