LCOV - code coverage report
Current view: top level - libreoffice/framework/source/fwe/helper - configimporter.cxx (source / functions) Hit Total Coverage
Test: libreoffice_filtered.info Lines: 0 26 0.0 %
Date: 2012-12-17 Functions: 0 1 0.0 %
Legend: Lines: hit not hit

          Line data    Source code
       1             : /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
       2             : /*
       3             :  * This file is part of the LibreOffice project.
       4             :  *
       5             :  * This Source Code Form is subject to the terms of the Mozilla Public
       6             :  * License, v. 2.0. If a copy of the MPL was not distributed with this
       7             :  * file, You can obtain one at http://mozilla.org/MPL/2.0/.
       8             :  *
       9             :  * This file incorporates work covered by the following license notice:
      10             :  *
      11             :  *   Licensed to the Apache Software Foundation (ASF) under one or more
      12             :  *   contributor license agreements. See the NOTICE file distributed
      13             :  *   with this work for additional information regarding copyright
      14             :  *   ownership. The ASF licenses this file to you under the Apache
      15             :  *   License, Version 2.0 (the "License"); you may not use this file
      16             :  *   except in compliance with the License. You may obtain a copy of
      17             :  *   the License at http://www.apache.org/licenses/LICENSE-2.0 .
      18             :  */
      19             : 
      20             : 
      21             : #include <framework/configimporter.hxx>
      22             : #include <framework/toolboxconfiguration.hxx>
      23             : #include <com/sun/star/embed/ElementModes.hpp>
      24             : 
      25             : #include <rtl/ustrbuf.hxx>
      26             : 
      27             : using namespace ::com::sun::star;
      28             : 
      29             : namespace framework
      30             : {
      31             : 
      32           0 : sal_Bool UIConfigurationImporterOOo1x::ImportCustomToolbars(
      33             :     const uno::Reference< ui::XUIConfigurationManager >& rContainerFactory,
      34             :     uno::Sequence< uno::Reference< container::XIndexContainer > >& rSeqContainer,
      35             :     const uno::Reference< uno::XComponentContext >& rxContext,
      36             :     const uno::Reference< embed::XStorage >& rToolbarStorage )
      37             : {
      38           0 :     const char USERDEFTOOLBOX[] = "userdeftoolbox0.xml";
      39             : 
      40           0 :     sal_Bool bResult ( sal_False );
      41           0 :     if ( rToolbarStorage.is() && rContainerFactory.is() )
      42             :     {
      43             :         try
      44             :         {
      45           0 :             for ( sal_uInt16 i = 1; i <= 4; i++ )
      46             :             {
      47           0 :                 rtl::OUStringBuffer aCustomTbxName( 20 );
      48           0 :                 aCustomTbxName.appendAscii( USERDEFTOOLBOX );
      49           0 :                 aCustomTbxName[14] = aCustomTbxName[14] + i;
      50             : 
      51           0 :                 rtl::OUString aTbxStreamName( aCustomTbxName.makeStringAndClear() );
      52           0 :                 uno::Reference< io::XStream > xStream = rToolbarStorage->openStreamElement( aTbxStreamName, embed::ElementModes::READ );
      53           0 :                 if ( xStream.is() )
      54             :                 {
      55           0 :                     uno::Reference< io::XInputStream > xInputStream = xStream->getInputStream();
      56           0 :                     if ( xInputStream.is() )
      57             :                     {
      58           0 :                         uno::Reference< container::XIndexContainer > xContainer = rContainerFactory->createSettings();
      59           0 :                         if ( ToolBoxConfiguration::LoadToolBox( rxContext, xInputStream, xContainer ))
      60             :                         {
      61           0 :                             sal_uInt32 nIndex = rSeqContainer.getLength();
      62           0 :                             rSeqContainer.realloc( nIndex+1 );
      63           0 :                             rSeqContainer[nIndex] = xContainer;
      64           0 :                             bResult = sal_True;
      65           0 :                         }
      66           0 :                     }
      67             :                 }
      68           0 :             }
      69             :         }
      70           0 :         catch ( const uno::RuntimeException& )
      71             :         {
      72           0 :             throw;
      73             :         }
      74           0 :         catch ( const uno::Exception& )
      75             :         {
      76             :         }
      77             :     }
      78             : 
      79           0 :     return bResult;
      80             : }
      81             : 
      82             : } // namespace framework
      83             : 
      84             : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */

Generated by: LCOV version 1.10