LCOV - code coverage report
Current view: top level - sc/source/filter/inc - externallinkfragment.hxx (source / functions) Hit Total Coverage
Test: commit c8344322a7af75b84dd3ca8f78b05543a976dfd5 Lines: 2 2 100.0 %
Date: 2015-06-13 12:38:46 Functions: 4 4 100.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             : #ifndef INCLUDED_SC_SOURCE_FILTER_INC_EXTERNALLINKFRAGMENT_HXX
      21             : #define INCLUDED_SC_SOURCE_FILTER_INC_EXTERNALLINKFRAGMENT_HXX
      22             : 
      23             : #include "excelhandlers.hxx"
      24             : #include "externallinkbuffer.hxx"
      25             : 
      26             : namespace oox {
      27             : namespace xls {
      28             : 
      29             : class ExternalLink;
      30             : 
      31             : /** This class implements importing the sheetData element in external sheets.
      32             : 
      33             :     The sheetData element embedded in the externalBook element contains cached
      34             :     cells from externally linked sheets.
      35             :  */
      36           6 : class ExternalSheetDataContext : public WorkbookContextBase
      37             : {
      38             : public:
      39             :     explicit            ExternalSheetDataContext(
      40             :                             WorkbookFragmentBase& rFragment,
      41             :                             const ::com::sun::star::uno::Reference< ::com::sun::star::sheet::XExternalSheetCache >& rxSheetCache );
      42             : 
      43             : protected:
      44             :     virtual ::oox::core::ContextHandlerRef onCreateContext( sal_Int32 nElement, const AttributeList& rAttribs ) SAL_OVERRIDE;
      45             :     virtual void        onCharacters( const OUString& rChars ) SAL_OVERRIDE;
      46             : 
      47             :     virtual ::oox::core::ContextHandlerRef onCreateRecordContext( sal_Int32 nRecId, SequenceInputStream& rStrm ) SAL_OVERRIDE;
      48             : 
      49             : private:
      50             :     /** Imports cell settings from a c element. */
      51             :     void                importCell( const AttributeList& rAttribs );
      52             : 
      53             :     /** Imports the EXTCELL_BLANK from the passed stream. */
      54             :     void                importExtCellBlank( SequenceInputStream& rStrm );
      55             :     /** Imports the EXTCELL_BOOL from the passed stream. */
      56             :     void                importExtCellBool( SequenceInputStream& rStrm );
      57             :     /** Imports the EXTCELL_DOUBLE from the passed stream. */
      58             :     void                importExtCellDouble( SequenceInputStream& rStrm );
      59             :     /** Imports the EXTCELL_ERROR from the passed stream. */
      60             :     void                importExtCellError( SequenceInputStream& rStrm );
      61             :     /** Imports the EXTCELL_STRING from the passed stream. */
      62             :     void                importExtCellString( SequenceInputStream& rStrm );
      63             : 
      64             :     /** Sets the passed cell value to the current position in the sheet cache. */
      65             :     void                setCellValue( const ::com::sun::star::uno::Any& rValue );
      66             : 
      67             : private:
      68             :     ::com::sun::star::uno::Reference< ::com::sun::star::sheet::XExternalSheetCache >
      69             :                         mxSheetCache;               /// The sheet cache used to store external cell values.
      70             :     ::com::sun::star::table::CellAddress maCurrPos; /// Position of current cell.
      71             :     sal_Int32           mnCurrType;                 /// Data type of current cell.
      72             : };
      73             : 
      74           2 : class ExternalLinkFragment : public WorkbookFragmentBase
      75             : {
      76             : public:
      77             :     explicit            ExternalLinkFragment(
      78             :                             const WorkbookHelper& rHelper,
      79             :                             const OUString& rFragmentPath,
      80             :                             ExternalLink& rExtLink );
      81             : 
      82             : protected:
      83             :     virtual ::oox::core::ContextHandlerRef onCreateContext( sal_Int32 nElement, const AttributeList& rAttribs ) SAL_OVERRIDE;
      84             :     virtual void        onCharacters( const OUString& rChars ) SAL_OVERRIDE;
      85             :     virtual void        onEndElement() SAL_OVERRIDE;
      86             : 
      87             :     virtual ::oox::core::ContextHandlerRef onCreateRecordContext( sal_Int32 nRecId, SequenceInputStream& rStrm ) SAL_OVERRIDE;
      88             : 
      89             :     virtual const ::oox::core::RecordInfo* getRecordInfos() const SAL_OVERRIDE;
      90             : 
      91             : private:
      92             :     ::oox::core::ContextHandlerRef createSheetDataContext( sal_Int32 nSheetId );
      93             : 
      94             : private:
      95             :     ExternalLink&       mrExtLink;
      96             :     ExternalNameRef     mxExtName;
      97             :     OUString     maResultValue;
      98             :     sal_Int32           mnResultType;
      99             : };
     100             : 
     101             : } // namespace xls
     102             : } // namespace oox
     103             : 
     104             : #endif
     105             : 
     106             : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */

Generated by: LCOV version 1.11