LCOV - code coverage report
Current view: top level - libreoffice/sc/inc - sheetdata.hxx (source / functions) Hit Total Coverage
Test: libreoffice_filtered.info Lines: 31 31 100.0 %
Date: 2012-12-27 Functions: 24 24 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 SC_SHEETDATA_HXX
      21             : #define SC_SHEETDATA_HXX
      22             : 
      23             : #include <xmloff/maptype.hxx>
      24             : #include <editeng/editdata.hxx>
      25             : #include <vector>
      26             : #include <boost/unordered_set.hpp>
      27             : 
      28             : #include "address.hxx"
      29             : 
      30             : class ScAddress;
      31             : class SvXMLNamespaceMap;
      32             : 
      33             : 
      34             : struct ScStreamEntry
      35             : {
      36             :     sal_Int32   mnStartOffset;
      37             :     sal_Int32   mnEndOffset;
      38             : 
      39          50 :                 ScStreamEntry() :
      40             :                     mnStartOffset(-1),
      41          50 :                     mnEndOffset(-1)
      42             :                 {
      43          50 :                 }
      44             : 
      45          50 :                 ScStreamEntry( sal_Int32 nStart, sal_Int32 nEnd ) :
      46             :                     mnStartOffset(nStart),
      47          50 :                     mnEndOffset(nEnd)
      48             :                 {
      49          50 :                 }
      50             : };
      51             : 
      52        1357 : struct ScCellStyleEntry
      53             : {
      54             :     rtl::OUString   maName;
      55             :     ScAddress       maCellPos;
      56             : 
      57         279 :                 ScCellStyleEntry( const rtl::OUString& rName, const ScAddress& rPos ) :
      58             :                     maName(rName),
      59         279 :                     maCellPos(rPos)
      60             :                 {
      61         279 :                 }
      62             : };
      63             : 
      64          25 : struct ScNoteStyleEntry
      65             : {
      66             :     rtl::OUString   maStyleName;
      67             :     rtl::OUString   maTextStyle;
      68             :     ScAddress       maCellPos;
      69             : 
      70          25 :                 ScNoteStyleEntry( const rtl::OUString& rStyle, const rtl::OUString& rText, const ScAddress& rPos ) :
      71             :                     maStyleName(rStyle),
      72             :                     maTextStyle(rText),
      73          25 :                     maCellPos(rPos)
      74             :                 {
      75          25 :                 }
      76             : };
      77             : 
      78           6 : struct ScTextStyleEntry
      79             : {
      80             :     rtl::OUString   maName;
      81             :     ScAddress       maCellPos;
      82             :     ESelection      maSelection;
      83             : 
      84           2 :                 ScTextStyleEntry( const rtl::OUString& rName, const ScAddress& rPos, const ESelection& rSel ) :
      85             :                     maName(rName),
      86             :                     maCellPos(rPos),
      87           2 :                     maSelection(rSel)
      88             :                 {
      89           2 :                 }
      90             : };
      91             : 
      92        3531 : struct ScLoadedNamespaceEntry
      93             : {
      94             :     rtl::OUString   maPrefix;
      95             :     rtl::OUString   maName;
      96             :     sal_uInt16      mnKey;
      97             : 
      98         690 :                 ScLoadedNamespaceEntry( const rtl::OUString& rPrefix, const rtl::OUString& rName, sal_uInt16 nKey ) :
      99             :                     maPrefix(rPrefix),
     100             :                     maName(rName),
     101         690 :                     mnKey(nKey)
     102             :                 {
     103         690 :                 }
     104             : };
     105             : 
     106             : class ScSheetSaveData
     107             : {
     108             :     boost::unordered_set<rtl::OUString, rtl::OUStringHash>  maInitialPrefixes;
     109             :     std::vector<ScLoadedNamespaceEntry>              maLoadedNamespaces;
     110             : 
     111             :     std::vector<ScCellStyleEntry> maCellStyles;
     112             :     std::vector<ScCellStyleEntry> maColumnStyles;
     113             :     std::vector<ScCellStyleEntry> maRowStyles;
     114             :     std::vector<ScCellStyleEntry> maTableStyles;
     115             :     std::vector<ScNoteStyleEntry> maNoteStyles;
     116             :     std::vector<ScTextStyleEntry> maNoteParaStyles;
     117             :     std::vector<ScTextStyleEntry> maNoteTextStyles;
     118             :     std::vector<ScTextStyleEntry> maTextStyles;
     119             :     std::vector<bool>          maBlocked;
     120             :     std::vector<ScStreamEntry> maStreamEntries;
     121             :     std::vector<ScStreamEntry> maSaveEntries;
     122             :     SCTAB   mnStartTab;
     123             :     sal_Int32   mnStartOffset;
     124             : 
     125             :     ScNoteStyleEntry    maPreviousNote;
     126             : 
     127             :     bool                mbInSupportedSave;
     128             : 
     129             : public:
     130             :                 ScSheetSaveData();
     131             :                 ~ScSheetSaveData();
     132             : 
     133             :     void        AddCellStyle( const rtl::OUString& rName, const ScAddress& rCellPos );
     134             :     void        AddColumnStyle( const rtl::OUString& rName, const ScAddress& rCellPos );
     135             :     void        AddRowStyle( const rtl::OUString& rName, const ScAddress& rCellPos );
     136             :     void        AddTableStyle( const rtl::OUString& rName, const ScAddress& rCellPos );
     137             : 
     138             :     void        HandleNoteStyles( const rtl::OUString& rStyleName, const rtl::OUString& rTextName, const ScAddress& rCellPos );
     139             :     void        AddNoteContentStyle( sal_uInt16 nFamily, const rtl::OUString& rName, const ScAddress& rCellPos, const ESelection& rSelection );
     140             : 
     141             :     void        AddTextStyle( const rtl::OUString& rName, const ScAddress& rCellPos, const ESelection& rSelection );
     142             : 
     143             :     void        BlockSheet( SCTAB nTab );
     144             :     bool        IsSheetBlocked( SCTAB nTab ) const;
     145             : 
     146             :     void        AddStreamPos( SCTAB nTab, sal_Int32 nStartOffset, sal_Int32 nEndOffset );
     147             :     void        GetStreamPos( SCTAB nTab, sal_Int32& rStartOffset, sal_Int32& rEndOffset ) const;
     148             :     bool        HasStreamPos( SCTAB nTab ) const;
     149             : 
     150             :     void        StartStreamPos( SCTAB nTab, sal_Int32 nStartOffset );
     151             :     void        EndStreamPos( sal_Int32 nEndOffset );
     152             : 
     153          97 :     bool        HasStartPos() const { return mnStartTab >= 0; }
     154             : 
     155             :     void        ResetSaveEntries();
     156             :     void        AddSavePos( SCTAB nTab, sal_Int32 nStartOffset, sal_Int32 nEndOffset );
     157             :     void        UseSaveEntries();
     158             : 
     159             :     void        StoreInitialNamespaces( const SvXMLNamespaceMap& rNamespaces );
     160             :     void        StoreLoadedNamespaces( const SvXMLNamespaceMap& rNamespaces );
     161             :     bool        AddLoadedNamespaces( SvXMLNamespaceMap& rNamespaces ) const;
     162             : 
     163           2 :     const std::vector<ScCellStyleEntry>& GetCellStyles() const   { return maCellStyles; }
     164           2 :     const std::vector<ScCellStyleEntry>& GetColumnStyles() const { return maColumnStyles; }
     165           2 :     const std::vector<ScCellStyleEntry>& GetRowStyles() const    { return maRowStyles; }
     166           2 :     const std::vector<ScCellStyleEntry>& GetTableStyles() const  { return maTableStyles; }
     167           2 :     const std::vector<ScNoteStyleEntry>& GetNoteStyles() const   { return maNoteStyles; }
     168           2 :     const std::vector<ScTextStyleEntry>& GetNoteParaStyles() const { return maNoteParaStyles; }
     169           2 :     const std::vector<ScTextStyleEntry>& GetNoteTextStyles() const { return maNoteTextStyles; }
     170           2 :     const std::vector<ScTextStyleEntry>& GetTextStyles() const   { return maTextStyles; }
     171             : 
     172             :     bool        IsInSupportedSave() const;
     173             :     void        SetInSupportedSave( bool bSet );
     174             : };
     175             : 
     176             : #endif
     177             : 
     178             : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */

Generated by: LCOV version 1.10