LCOV - code coverage report
Current view: top level - sc/inc - sheetdata.hxx (source / functions) Hit Total Coverage
Test: commit e02a6cb2c3e2b23b203b422e4e0680877f232636 Lines: 0 31 0.0 %
Date: 2014-04-14 Functions: 0 27 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             : #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           0 :                 ScStreamEntry() :
      40             :                     mnStartOffset(-1),
      41           0 :                     mnEndOffset(-1)
      42             :                 {
      43           0 :                 }
      44             : 
      45           0 :                 ScStreamEntry( sal_Int32 nStart, sal_Int32 nEnd ) :
      46             :                     mnStartOffset(nStart),
      47           0 :                     mnEndOffset(nEnd)
      48             :                 {
      49           0 :                 }
      50             : };
      51             : 
      52           0 : struct ScCellStyleEntry
      53             : {
      54             :     OUString   maName;
      55             :     ScAddress       maCellPos;
      56             : 
      57           0 :                 ScCellStyleEntry( const OUString& rName, const ScAddress& rPos ) :
      58             :                     maName(rName),
      59           0 :                     maCellPos(rPos)
      60             :                 {
      61           0 :                 }
      62             : };
      63             : 
      64           0 : struct ScNoteStyleEntry
      65             : {
      66             :     OUString   maStyleName;
      67             :     OUString   maTextStyle;
      68             :     ScAddress       maCellPos;
      69             : 
      70           0 :                 ScNoteStyleEntry( const OUString& rStyle, const OUString& rText, const ScAddress& rPos ) :
      71             :                     maStyleName(rStyle),
      72             :                     maTextStyle(rText),
      73           0 :                     maCellPos(rPos)
      74             :                 {
      75           0 :                 }
      76             : };
      77             : 
      78           0 : struct ScTextStyleEntry
      79             : {
      80             :     OUString   maName;
      81             :     ScAddress       maCellPos;
      82             :     ESelection      maSelection;
      83             : 
      84           0 :                 ScTextStyleEntry( const OUString& rName, const ScAddress& rPos, const ESelection& rSel ) :
      85             :                     maName(rName),
      86             :                     maCellPos(rPos),
      87           0 :                     maSelection(rSel)
      88             :                 {
      89           0 :                 }
      90             : };
      91             : 
      92           0 : struct ScLoadedNamespaceEntry
      93             : {
      94             :     OUString   maPrefix;
      95             :     OUString   maName;
      96             :     sal_uInt16      mnKey;
      97             : 
      98           0 :                 ScLoadedNamespaceEntry( const OUString& rPrefix, const OUString& rName, sal_uInt16 nKey ) :
      99             :                     maPrefix(rPrefix),
     100             :                     maName(rName),
     101           0 :                     mnKey(nKey)
     102             :                 {
     103           0 :                 }
     104             : };
     105             : 
     106             : class ScSheetSaveData
     107             : {
     108             :     boost::unordered_set<OUString, 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 OUString& rName, const ScAddress& rCellPos );
     134             :     void        AddColumnStyle( const OUString& rName, const ScAddress& rCellPos );
     135             :     void        AddRowStyle( const OUString& rName, const ScAddress& rCellPos );
     136             :     void        AddTableStyle( const OUString& rName, const ScAddress& rCellPos );
     137             : 
     138             :     void        HandleNoteStyles( const OUString& rStyleName, const OUString& rTextName, const ScAddress& rCellPos );
     139             :     void        AddNoteContentStyle( sal_uInt16 nFamily, const OUString& rName, const ScAddress& rCellPos, const ESelection& rSelection );
     140             : 
     141             :     void        AddTextStyle( const 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           0 :     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           0 :     const std::vector<ScCellStyleEntry>& GetCellStyles() const   { return maCellStyles; }
     164           0 :     const std::vector<ScCellStyleEntry>& GetColumnStyles() const { return maColumnStyles; }
     165           0 :     const std::vector<ScCellStyleEntry>& GetRowStyles() const    { return maRowStyles; }
     166           0 :     const std::vector<ScCellStyleEntry>& GetTableStyles() const  { return maTableStyles; }
     167           0 :     const std::vector<ScNoteStyleEntry>& GetNoteStyles() const   { return maNoteStyles; }
     168           0 :     const std::vector<ScTextStyleEntry>& GetNoteParaStyles() const { return maNoteParaStyles; }
     169           0 :     const std::vector<ScTextStyleEntry>& GetNoteTextStyles() const { return maNoteTextStyles; }
     170           0 :     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