LCOV - code coverage report
Current view: top level - libreoffice/sc/source/filter/xml - XMLDetectiveContext.hxx (source / functions) Hit Total Coverage
Test: libreoffice_filtered.info Lines: 4 11 36.4 %
Date: 2012-12-27 Functions: 3 10 30.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 SC_XMLDETECTIVECONTEXT_HXX
      21             : #define SC_XMLDETECTIVECONTEXT_HXX
      22             : 
      23             : #include <xmloff/xmlimp.hxx>
      24             : #include <com/sun/star/table/CellRangeAddress.hpp>
      25             : #include "detfunc.hxx"
      26             : #include "detdata.hxx"
      27             : 
      28             : #include <list>
      29             : 
      30             : class ScXMLImport;
      31             : 
      32             : 
      33             : //___________________________________________________________________
      34             : 
      35           0 : struct ScMyImpDetectiveObj
      36             : {
      37             :     ScRange                     aSourceRange;
      38             :     ScDetectiveObjType          eObjType;
      39             :     bool                        bHasError;
      40             : 
      41             :                                 ScMyImpDetectiveObj();
      42             : };
      43             : 
      44             : typedef ::std::vector< ScMyImpDetectiveObj > ScMyImpDetectiveObjVec;
      45             : 
      46             : 
      47             : //___________________________________________________________________
      48             : 
      49           0 : struct ScMyImpDetectiveOp
      50             : {
      51             :     ScAddress                   aPosition;
      52             :     ScDetOpType                 eOpType;
      53             :     sal_Int32                   nIndex;
      54             : 
      55          22 :     inline                      ScMyImpDetectiveOp() : nIndex( -1 ) {}
      56             :     bool                        operator<(const ScMyImpDetectiveOp& rDetOp) const;
      57             : };
      58             : 
      59             : typedef ::std::list< ScMyImpDetectiveOp > ScMyImpDetectiveOpList;
      60             : 
      61          22 : class ScMyImpDetectiveOpArray
      62             : {
      63             : private:
      64             :     ScMyImpDetectiveOpList      aDetectiveOpList;
      65             : 
      66             : public:
      67          22 :     inline                      ScMyImpDetectiveOpArray() :
      68          22 :                                     aDetectiveOpList()  {}
      69             : 
      70           0 :     inline void                 AddDetectiveOp( const ScMyImpDetectiveOp& rDetOp )
      71           0 :                                     { aDetectiveOpList.push_back( rDetOp ); }
      72             : 
      73             :     void                        Sort();
      74             :     bool                        GetFirstOp( ScMyImpDetectiveOp& rDetOp );
      75             : };
      76             : 
      77             : 
      78             : //___________________________________________________________________
      79             : 
      80             : class ScXMLDetectiveContext : public SvXMLImportContext
      81             : {
      82             : private:
      83             :     ScMyImpDetectiveObjVec*     pDetectiveObjVec;
      84             : 
      85             :     const ScXMLImport&          GetScImport() const { return (const ScXMLImport&)GetImport(); }
      86           0 :     ScXMLImport&                GetScImport()       { return (ScXMLImport&)GetImport(); }
      87             : 
      88             : public:
      89             :                                 ScXMLDetectiveContext(
      90             :                                     ScXMLImport& rImport,
      91             :                                     sal_uInt16 nPrfx,
      92             :                                     const ::rtl::OUString& rLName,
      93             :                                     ScMyImpDetectiveObjVec* pNewDetectiveObjVec
      94             :                                     );
      95             :     virtual                     ~ScXMLDetectiveContext();
      96             : 
      97             :     virtual SvXMLImportContext* CreateChildContext(
      98             :                                     sal_uInt16 nPrefix,
      99             :                                     const ::rtl::OUString& rLocalName,
     100             :                                     const ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XAttributeList >& xAttrList
     101             :                                     );
     102             :     virtual void                EndElement();
     103             : };
     104             : 
     105             : 
     106             : //___________________________________________________________________
     107             : 
     108             : class ScXMLDetectiveHighlightedContext : public SvXMLImportContext
     109             : {
     110             : private:
     111             :     ScMyImpDetectiveObjVec*     pDetectiveObjVec;
     112             :     ScMyImpDetectiveObj         aDetectiveObj;
     113             :     bool                        bValid;
     114             : 
     115             :     const ScXMLImport&          GetScImport() const { return (const ScXMLImport&)GetImport(); }
     116           0 :     ScXMLImport&                GetScImport()       { return (ScXMLImport&)GetImport(); }
     117             : 
     118             : public:
     119             :                                 ScXMLDetectiveHighlightedContext(
     120             :                                     ScXMLImport& rImport,
     121             :                                     sal_uInt16 nPrfx,
     122             :                                     const ::rtl::OUString& rLName,
     123             :                                     const ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XAttributeList >& xAttrList,
     124             :                                     ScMyImpDetectiveObjVec* pNewDetectiveObjVec
     125             :                                     );
     126             :     virtual                     ~ScXMLDetectiveHighlightedContext();
     127             : 
     128             :     virtual SvXMLImportContext* CreateChildContext(
     129             :                                     sal_uInt16 nPrefix,
     130             :                                     const ::rtl::OUString& rLocalName,
     131             :                                     const ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XAttributeList >& xAttrList
     132             :                                     );
     133             :     virtual void                EndElement();
     134             : };
     135             : 
     136             : 
     137             : //___________________________________________________________________
     138             : 
     139             : class ScXMLDetectiveOperationContext : public SvXMLImportContext
     140             : {
     141             : private:
     142             :     ScMyImpDetectiveOp          aDetectiveOp;
     143             :     bool                        bHasType;
     144             : 
     145             :     const ScXMLImport&          GetScImport() const { return (const ScXMLImport&)GetImport(); }
     146           0 :     ScXMLImport&                GetScImport()       { return (ScXMLImport&)GetImport(); }
     147             : 
     148             : public:
     149             :                                 ScXMLDetectiveOperationContext(
     150             :                                     ScXMLImport& rImport,
     151             :                                     sal_uInt16 nPrfx,
     152             :                                     const ::rtl::OUString& rLName,
     153             :                                     const ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XAttributeList >& xAttrList
     154             :                                     );
     155             :     virtual                     ~ScXMLDetectiveOperationContext();
     156             : 
     157             :     virtual SvXMLImportContext* CreateChildContext(
     158             :                                     sal_uInt16 nPrefix,
     159             :                                     const ::rtl::OUString& rLocalName,
     160             :                                     const ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XAttributeList >& xAttrList
     161             :                                     );
     162             :     virtual void                EndElement();
     163             : };
     164             : 
     165             : 
     166             : #endif
     167             : 
     168             : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */

Generated by: LCOV version 1.10