LCOV - code coverage report
Current view: top level - sc/source/filter/inc - scflt.hxx (source / functions) Hit Total Coverage
Test: commit c8344322a7af75b84dd3ca8f78b05543a976dfd5 Lines: 0 89 0.0 %
Date: 2015-06-13 12:38:46 Functions: 0 50 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 INCLUDED_SC_SOURCE_FILTER_INC_SCFLT_HXX
      21             : #define INCLUDED_SC_SOURCE_FILTER_INC_SCFLT_HXX
      22             : 
      23             : #include "viewopti.hxx"
      24             : #include "collect.hxx"
      25             : #include <tools/solar.h>
      26             : 
      27             : // Error numbers
      28             : #define errUnknownFormat    1
      29             : #define errUnknownID        2
      30             : #define errOutOfMemory      3
      31             : 
      32             : // Identifiers in FileFormat
      33             : #define ColWidthID          1
      34             : #define ColAttrID           2
      35             : #define RowHeightID         3
      36             : #define RowAttrID           4
      37             : #define FontID              5
      38             : #define NameID              6
      39             : #define TableID             7
      40             : #define ObjectID            8
      41             : #define PatternID           9
      42             : #define DataBaseID          10
      43             : 
      44             : // Row/Column Flags
      45             : #define crfSoftBreak        1
      46             : #define crfHardBreak        2
      47             : #define crfHidden           4
      48             : 
      49             : // Cell types
      50             : #define ctValue             1
      51             : #define ctString            2
      52             : #define ctFormula           3
      53             : #define ctNote              4
      54             : 
      55             : // Font Styles
      56             : #define ffDontCare          0x00
      57             : #define ffRoman             0x10
      58             : #define ffSwiss             0x20
      59             : #define ffModern            0x30
      60             : #define ffScript            0x40
      61             : #define ffDecorative        0x50
      62             : 
      63             : // Font Weight
      64             : #define fwNormal            400
      65             : 
      66             : // Font attributes
      67             : #define atNone              0
      68             : #define atBold              1
      69             : #define atItalic            2
      70             : #define atUnderline         4
      71             : #define atStrikeOut         8
      72             : 
      73             : // Horizontal alignment
      74             : #define hjLeft              1
      75             : #define hjCenter            2
      76             : #define hjRight             3
      77             : 
      78             : // Vertical alignment
      79             : #define vjTop               1
      80             : #define vjCenter            2
      81             : #define vjBottom            3
      82             : 
      83             : // Allignment flags
      84             : #define ojWordBreak         0x01
      85             : #define ojBottomTop         0x02
      86             : #define ojTopBottom         0x04
      87             : 
      88             : // Cell grid
      89             : #define raNone              0
      90             : #define raGray12            1
      91             : #define raGray25            2
      92             : #define raGray50            3
      93             : #define raGray75            4
      94             : 
      95             : // Cell protection
      96             : #define paProtect           1
      97             : #define paHideFormula       2
      98             : #define paHideAll           4
      99             : #define paHidePrint         8
     100             : 
     101             : // Number format flags
     102             : #define vfStandard          0
     103             : #define vfMoney             1
     104             : #define vfThousend          2
     105             : #define vfPercent           3
     106             : #define vfExponent          4
     107             : #define vfZerro             5
     108             : #define vfDate              6
     109             : #define vfTime              7
     110             : #define vfBoolean           8
     111             : #define vfStandardRed       9
     112             : #define vfMoneyRed          10
     113             : #define vfThousendRed       11
     114             : #define vfPercentRed        12
     115             : #define vfExponentRed       13
     116             : #define vfFormula           14
     117             : #define vfString            15
     118             : 
     119             : // Date format flags
     120             : #define df_NDMY_Long        0
     121             : #define df_DMY_Long         1
     122             : #define df_MY_Long          2
     123             : #define df_NDM_Long         3
     124             : #define df_DM_Long          4
     125             : #define df_M_Long           5
     126             : #define df_NDMY_Short       6
     127             : #define df_DMY_Short        7
     128             : #define df_MY_Short         8
     129             : #define df_NDM_Short        9
     130             : #define df_DM_Short         10
     131             : #define df_M_Short          11
     132             : #define df_Q_Long           12
     133             : #define df_Q_Short          13
     134             : 
     135             : // Time format flags
     136             : #define tf_HMS_Long         0
     137             : #define tf_HM_Long          1
     138             : #define tf_HMS_Short        2
     139             : #define tf_HM_Short         3
     140             : 
     141             : // Attributes for format template
     142             : #define pfValue             0x01
     143             : #define pfFont              0x02
     144             : #define pfJustify           0x04
     145             : #define pfFrame             0x08
     146             : #define pfRaster            0x10
     147             : #define pfProtection        0x20
     148             : 
     149             : // Display flags for table
     150             : #define dfFormula           0x0001      // formula
     151             : #define dfZerro             0x0002      // zero values
     152             : #define dfGrid              0x0004      // grid
     153             : #define dfSyntax            0x0020      // Syntax Highlighting
     154             : #define dfObjectAll         0x0080      // show objects
     155             : #define dfObjectFrame       0x0100      // objects as place holder
     156             : #define dfObjectNone        0x0200      // do not show objects
     157             : #define dfNoteMark          0x0400      // NoteMark
     158             : 
     159             : // Object types
     160             : #define otOle               1
     161             : #define otImage             2
     162             : #define otChart             3
     163             : 
     164             : // Date/Time
     165             : struct Sc10DateTime
     166             : {
     167             :     sal_uInt16      Year;
     168             :     sal_uInt16      Month;
     169             :     sal_uInt16      Day;
     170             :     sal_uInt16      Hour;
     171             :     sal_uInt16      Min;
     172             :     sal_uInt16      Sec;
     173             : };
     174             : 
     175             : // Number formats
     176             : struct Sc10ValueFormat
     177             : {
     178             :     sal_uInt8       Format;         // number, currency, percentage,...
     179             :     sal_uInt8       Info;           // number of decimals, or positions, or Date/Time format
     180           0 :     Sc10ValueFormat()
     181             :         : Format(0)
     182           0 :         , Info(0)
     183             :     {
     184           0 :     }
     185             : };
     186             : 
     187             : // Font definition
     188             : struct Sc10LogFont
     189             : {
     190             :     sal_Int16       lfHeight;
     191             :     sal_Int16       lfWidth;
     192             :     sal_Int16       lfEscapement;
     193             :     sal_Int16       lfOrientation;
     194             :     sal_Int16       lfWeight;
     195             :     sal_uInt8       lfItalic;
     196             :     sal_uInt8       lfUnderline;
     197             :     sal_uInt8       lfStrikeOut;
     198             :     sal_uInt8       lfCharSet;
     199             :     sal_uInt8       lfOutPrecision;
     200             :     sal_uInt8       lfClipPrecision;
     201             :     sal_uInt8       lfQuality;
     202             :     sal_uInt8       lfPitchAndFamily;
     203             :     sal_Char    lfFaceName[32];
     204             : 
     205           0 :     Sc10LogFont()
     206             :         : lfHeight(0)
     207             :         , lfWidth(0)
     208             :         , lfEscapement(0)
     209             :         , lfOrientation(0)
     210             :         , lfWeight(0)
     211             :         , lfItalic(0)
     212             :         , lfUnderline(0)
     213             :         , lfStrikeOut(0)
     214             :         , lfCharSet(0)
     215             :         , lfOutPrecision(0)
     216             :         , lfClipPrecision(0)
     217             :         , lfQuality(0)
     218           0 :         , lfPitchAndFamily(0)
     219             :     {
     220           0 :         memset(lfFaceName, 0, sizeof(lfFaceName));
     221           0 :     }
     222             : 
     223             :     bool operator==( const Sc10LogFont& rData ) const;
     224             : };
     225             : 
     226             : // RGB-Color values
     227             : struct Sc10Color
     228             : {
     229             :     sal_uInt8       Dummy;
     230             :     sal_uInt8       Blue;
     231             :     sal_uInt8       Green;
     232             :     sal_uInt8       Red;
     233             :     bool operator==( const Sc10Color& rColor ) const;
     234           0 :     Sc10Color()
     235             :         : Dummy(0)
     236             :         , Blue(0)
     237             :         , Green(0)
     238           0 :         , Red(0)
     239             :     {
     240           0 :     }
     241             : };
     242             : 
     243             : // Block definition
     244             : struct Sc10BlockRect
     245             : {
     246             :     sal_Int16       x1;
     247             :     sal_Int16       y1;
     248             :     sal_Int16       x2;
     249             :     sal_Int16       y2;
     250           0 :     Sc10BlockRect()
     251             :         : x1(0)
     252             :         , y1(0)
     253             :         , x2(0)
     254           0 :         , y2(0)
     255             :     {
     256           0 :     }
     257             : };
     258             : 
     259             : // Data range
     260             : struct Sc10DataBaseRec
     261             : {
     262             :     sal_Char        Name[32];
     263             :     SCTAB           Tab;
     264             :     Sc10BlockRect   Block;
     265             :     sal_uInt8           RowHeader;
     266             :     sal_Int16           SortField0;
     267             :     sal_uInt8           SortUpOrder0;
     268             :     sal_Int16           SortField1;
     269             :     sal_uInt8           SortUpOrder1;
     270             :     sal_Int16           SortField2;
     271             :     sal_uInt8           SortUpOrder2;
     272             :     sal_uInt8           IncludeFormat;
     273             :     sal_Int16           QueryField0;
     274             :     sal_Int16           QueryOp0;
     275             :     sal_uInt8           QueryByString0;
     276             :     sal_Char        QueryString0[64];
     277             :     double          QueryValue0;
     278             :     sal_Int16           QueryConnect1;
     279             :     sal_Int16           QueryField1;
     280             :     sal_Int16           QueryOp1;
     281             :     sal_uInt8           QueryByString1;
     282             :     sal_Char        QueryString1[64];
     283             :     double          QueryValue1;
     284             :     sal_Int16           QueryConnect2;
     285             :     sal_Int16           QueryField2;
     286             :     sal_Int16           QueryOp2;
     287             :     sal_uInt8           QueryByString2;
     288             :     sal_Char        QueryString2[64];
     289             :     double          QueryValue2;
     290           0 :     Sc10DataBaseRec()
     291             :         : Tab(0)
     292             :         , RowHeader(0)
     293             :         , SortField0(0)
     294             :         , SortUpOrder0(0)
     295             :         , SortField1(0)
     296             :         , SortUpOrder1(0)
     297             :         , SortField2(0)
     298             :         , SortUpOrder2(0)
     299             :         , IncludeFormat(0)
     300             :         , QueryField0(0)
     301             :         , QueryOp0(0)
     302             :         , QueryByString0(0)
     303             :         , QueryValue0(0.0)
     304             :         , QueryConnect1(0)
     305             :         , QueryField1(0)
     306             :         , QueryOp1(0)
     307             :         , QueryByString1(0)
     308             :         , QueryValue1(0.0)
     309             :         , QueryConnect2(0)
     310             :         , QueryField2(0)
     311             :         , QueryOp2(0)
     312             :         , QueryByString2(0)
     313           0 :         , QueryValue2(0.0)
     314             :     {
     315           0 :         memset(Name, 0, sizeof(Name));
     316           0 :         memset(QueryString0, 0, sizeof(QueryString0));
     317           0 :         memset(QueryString1, 0, sizeof(QueryString1));
     318           0 :         memset(QueryString2, 0, sizeof(QueryString2));
     319           0 :     }
     320             : };
     321             : 
     322             : // Header/Footer
     323           0 : struct Sc10HeadFootLine
     324             : {
     325             :     sal_Char        Title[128];
     326             :     Sc10LogFont     LogFont;
     327             :     sal_uInt8           HorJustify;
     328             :     sal_uInt8           VerJustify;
     329             :     sal_uInt16          Raster;
     330             :     sal_uInt16          Frame;
     331             :     Sc10Color       TextColor;
     332             :     Sc10Color       BackColor;
     333             :     Sc10Color       RasterColor;
     334             :     sal_uInt16          FrameColor; // Nibble coded colors left-top right-bottom
     335             :     sal_uInt16          Reserved;
     336             : 
     337             :     bool operator==( const Sc10HeadFootLine& rData ) const;
     338             : };
     339             : 
     340             : // page format
     341           0 : struct Sc10PageFormat
     342             : {
     343             :     Sc10HeadFootLine    HeadLine;
     344             :     Sc10HeadFootLine    FootLine;
     345             :     sal_Int16               Orientation;
     346             :     sal_Int16               Width;
     347             :     sal_Int16               Height;
     348             :     sal_Int16               NonPrintableX;
     349             :     sal_Int16               NonPrintableY;
     350             :     sal_Int16               Left;
     351             :     sal_Int16               Top;
     352             :     sal_Int16               Right;
     353             :     sal_Int16               Bottom;
     354             :     sal_Int16               Head;
     355             :     sal_Int16               Foot;
     356             :     sal_uInt8               HorCenter;
     357             :     sal_uInt8               VerCenter;
     358             :     sal_uInt8               PrintGrid;
     359             :     sal_uInt8               PrintColRow;
     360             :     sal_uInt8               PrintNote;
     361             :     sal_uInt8               TopBottomDir;
     362             :     sal_Char            PrintAreaName[32];
     363             :     Sc10BlockRect       PrintArea;
     364             :     sal_Char            PrnZoom[6]; // Pascal 6 Byte RealNumber
     365             :     SCTAB               FirstPageNo;
     366             :     sal_Int16               RowRepeatStart;
     367             :     sal_Int16               RowRepeatEnd;
     368             :     sal_Int16               ColRepeatStart;
     369             :     sal_Int16               ColRepeatEnd;
     370             :     sal_Char            Reserved[26];
     371             : 
     372             :     bool operator==( const Sc10PageFormat& rData ) const;
     373             : };
     374             : 
     375             : // Table protection
     376             : struct Sc10TableProtect
     377             : {
     378             :     sal_Char    PassWord[16];
     379             :     sal_uInt16      Flags;
     380             :     sal_uInt8       Protect;
     381             : };
     382             : 
     383             : // Document protection
     384             : struct Sc10SheetProtect
     385             : {
     386             :     sal_Char    PassWord[16];
     387             :     sal_uInt16      Flags;
     388             :     sal_uInt8       Protect;
     389           0 :     Sc10SheetProtect()
     390             :         : Flags(0)
     391           0 :         , Protect(0)
     392             :     {
     393           0 :         memset(PassWord, 0, sizeof(PassWord));
     394           0 :     }
     395             : };
     396             : 
     397             : // FileHeader StarCalc 1.0 Datei
     398             : struct Sc10FileHeader
     399             : {
     400             :     sal_Char    CopyRight[30];
     401             :     sal_uInt16      Version;
     402             :     sal_Char    Reserved[32];
     403             : };
     404             : 
     405             : // User-Defined File Definition
     406             : struct Sc10FileInfo
     407             : {
     408             :     sal_Char        Title[64];
     409             :     sal_Char        Thema[64];
     410             :     sal_Char        Keys[64];
     411             :     sal_Char        Note[256];
     412             :     sal_Char        InfoLabel0[16];
     413             :     sal_Char        InfoLabel1[16];
     414             :     sal_Char        InfoLabel2[16];
     415             :     sal_Char        InfoLabel3[16];
     416             :     sal_Char        Info0[32];
     417             :     sal_Char        Info1[32];
     418             :     sal_Char        Info2[32];
     419             :     sal_Char        Info3[32];
     420             :     sal_Char        CreateAuthor[64];
     421             :     sal_Char        ChangeAuthor[64];
     422             :     sal_Char        PrintAuthor[64];
     423             :     Sc10DateTime    CreateDate;
     424             :     Sc10DateTime    ChangeDate;
     425             :     Sc10DateTime    PrintDate;
     426             :     sal_uInt32      PageCount;
     427             :     sal_uInt32      ChartCount;
     428             :     sal_uInt32      PictureCount;
     429             :     sal_uInt32      GraphCount;
     430             :     sal_uInt32      OleCount;
     431             :     sal_uInt32      NoteCount;
     432             :     sal_uInt32      TextCellCount;
     433             :     sal_uInt32      ValueCellCount;
     434             :     sal_uInt32      FormulaCellCount;
     435             :     sal_uInt32      CellCount;
     436             :     sal_Char        Reserved[52];
     437             : };
     438             : 
     439             : // Last Cursor position
     440             : struct Sc10EditStateInfo
     441             : {
     442             :     // Cursor Position
     443             :     sal_uInt16      CarretX;
     444             :     sal_uInt16      CarretY;
     445             :     sal_uInt16      CarretZ;
     446             :     // left-top corner of the table
     447             :     sal_uInt16      DeltaX;
     448             :     sal_uInt16      DeltaY;
     449             :     sal_uInt16      DeltaZ;
     450             :     // redundant in StarCalc 3.0
     451             :     sal_uInt8       DataBaseMode;
     452             :     sal_Char    Reserved[51];
     453             : };
     454             : 
     455             : // Attribut entry
     456             : struct Sc10ColData
     457             : {
     458             :     sal_uInt16      Row;
     459             :     sal_uInt16      Value;
     460             : };
     461             : 
     462             : // Cell-Attribute definition
     463             : struct Sc10ColAttr
     464             : {
     465             :     sal_uInt16          Count;
     466             :     Sc10ColData*    pData;
     467             : 
     468           0 :     Sc10ColAttr()
     469             :         : Count(0)
     470           0 :         , pData(NULL)
     471             :     {
     472           0 :     }
     473           0 :     ~Sc10ColAttr() { delete [] pData; }
     474             : };
     475             : 
     476             : // GraphHeader
     477           0 : struct Sc10GraphHeader
     478             : {
     479             :     sal_uInt8       Typ;            // Type of Grafik (Ole-Objekt, Image (Bitmap of MetaFile), Chart-Object)
     480             :     sal_Int16       CarretX;        // Cell Position of Grafik
     481             :     sal_Int16       CarretY;
     482             :     sal_Int16       CarretZ;
     483             :     sal_Int32       x;              // x,y distance to cell border in pixels (pixels, as Grafics are stored in window)
     484             :     sal_Int32       y;
     485             :     sal_Int32       w;              // w,h width and height in pixels
     486             :     sal_Int32       h;
     487             :     sal_uInt8       IsRelPos;       // position relativ to cell, or absolute in the table
     488             :     sal_uInt8       DoPrint;        // print Grafic?
     489             :     sal_uInt16      FrameType;      // Frame type around Grafic (none, simple, double, simple thick, double thick)
     490             :     sal_uInt8       IsTransparent;  // show background?
     491             :     Sc10Color   FrameColor;         // FrameColor as RGB value
     492             :     Sc10Color   BackColor;          // BackGroundColor as RGB value
     493             :     sal_Char    Reserved[32];       // Reserved
     494             : };
     495             : 
     496             : // ImageHeader
     497             : struct Sc10ImageHeader
     498             : {
     499             :     sal_Char    FileName[128];      // file name of the original inserted image
     500             :     sal_Int16   Typ;                // image type (Bitmap or Metafile)
     501             :     sal_uInt8   Linked;             // not possible
     502             :     sal_Int16   x1;                 // original image size (only for Metafiles)
     503             :     sal_Int16   y1;
     504             :     sal_Int16   x2;
     505             :     sal_Int16   y2;
     506             :     sal_uInt32 Size;                // image size in BYTES
     507             : };
     508             : 
     509             : // ChartHeader
     510             : struct Sc10ChartHeader
     511             : {
     512             :     sal_Int16   MM;                 // Meatfile structure MapMode, Width, Hight
     513             :     sal_Int16   xExt;
     514             :     sal_Int16   yExt;
     515             :     sal_uInt32 Size;                // image size in BYTES
     516             : };
     517             : 
     518             : // ChartSheetData
     519             : struct Sc10ChartSheetData
     520             : {
     521             :     sal_uInt8       HasTitle;       // has the Chart a title in the table
     522             :     sal_Int16       TitleX;         // cell position of title
     523             :     sal_Int16       TitleY;
     524             :     sal_uInt8       HasSubTitle;    // has the Chart a sub-title in the table
     525             :     sal_Int16       SubTitleX;      // cell position of sub-title
     526             :     sal_Int16       SubTitleY;
     527             :     sal_uInt8       HasLeftTitle;   // has the Chart a left-title in the table
     528             :     sal_Int16       LeftTitleX;     // cell position of left-title
     529             :     sal_Int16       LeftTitleY;
     530             :     sal_uInt8       HasLegend;      // has the Chart a legend in the table
     531             :     sal_Int16       LegendX1;       // cells for legend
     532             :     sal_Int16       LegendY1;
     533             :     sal_Int16       LegendX2;
     534             :     sal_Int16       LegendY2;
     535             :     sal_uInt8       HasLabel;       // has the Chart axis labels in the table
     536             :     sal_Int16       LabelX1;        // cells for axis labels
     537             :     sal_Int16       LabelY1;
     538             :     sal_Int16       LabelX2;
     539             :     sal_Int16       LabelY2;
     540             :     sal_Int16       DataX1;         // cells for Data
     541             :     sal_Int16       DataY1;
     542             :     sal_Int16       DataX2;
     543             :     sal_Int16       DataY2;
     544             :     sal_Char    Reserved[64];
     545             : };
     546             : 
     547             : typedef sal_Char Sc10ChartText[30];
     548             : 
     549             : struct Sc10ChartTypeData
     550             : {
     551             :     sal_Int16           NumSets;
     552             :     sal_Int16           NumPoints;
     553             :     sal_Int16           DrawMode;
     554             :     sal_Int16           GraphType;
     555             :     sal_Int16           GraphStyle;
     556             :     sal_Char        GraphTitle[80];
     557             :     sal_Char        BottomTitle[80];
     558             :     sal_Int16           SymbolData[256];
     559             :     sal_Int16           ColorData[256];
     560             :     sal_Int16           ThickLines[256];
     561             :     sal_Int16           PatternData[256];
     562             :     sal_Int16           LinePatternData[256];
     563             :     sal_Int16           NumGraphStyles[11];
     564             :     sal_Int16           ShowLegend;
     565             :     Sc10ChartText   LegendText[256];
     566             :     sal_Int16           ExplodePie;
     567             :     sal_Int16           FontUse;
     568             :     sal_Int16           FontFamily[5];
     569             :     sal_Int16           FontStyle[5];
     570             :     sal_Int16           FontSize[5];
     571             :     sal_Int16           GridStyle;
     572             :     sal_Int16           Labels;
     573             :     sal_Int16           LabelEvery;
     574             :     Sc10ChartText   LabelText[50];
     575             :     sal_Char        LeftTitle[80];
     576             :     sal_Char        Reserved[4646];
     577             : };
     578             : 
     579             : // FontAttribut
     580           0 : class Sc10FontData : public ScDataObject
     581             : {
     582             : public:
     583             :     sal_Int16               Height;
     584             :     sal_uInt8               CharSet;
     585             :     sal_uInt8               PitchAndFamily;
     586             :     sal_Char            FaceName[32];
     587             : 
     588           0 :     Sc10FontData( const Sc10FontData& rData )
     589             :         : ScDataObject( rData )
     590             :         , Height( rData.Height )
     591             :         , CharSet( rData.CharSet )
     592           0 :         , PitchAndFamily( rData.PitchAndFamily )
     593             :     {
     594           0 :         strncpy( FaceName, rData.FaceName, sizeof(FaceName) );
     595           0 :         FaceName[sizeof(FaceName)-1] = 0;
     596           0 :     }
     597             :     Sc10FontData( SvStream& rStream );
     598           0 :     virtual ScDataObject*   Clone() const SAL_OVERRIDE { return new Sc10FontData(*this); }
     599             : };
     600             : 
     601             : // Font-Collection
     602           0 : class Sc10FontCollection : public ScCollection
     603             : {
     604             : protected:
     605             :     sal_uLong nError;
     606             : public:
     607             :                         Sc10FontCollection( SvStream& rStream );
     608           0 :     sal_uLong           GetError() { return nError; }
     609           0 :     Sc10FontData*       At(sal_uInt16 nIndex) { return static_cast<Sc10FontData*>(ScCollection::At(nIndex)); }
     610             : private:
     611             :     using               ScCollection::At;
     612             : };
     613             : 
     614             : //Range-Data
     615           0 : class Sc10NameData : public ScDataObject
     616             : {
     617             : public :
     618             :     sal_Char            Name[32];
     619             :     sal_Char            Reference[64];
     620             :     sal_Char            Reserved[12];
     621             : 
     622           0 :                         Sc10NameData(const Sc10NameData& rData) :
     623           0 :                             ScDataObject( rData )
     624             :                         {
     625           0 :                             strncpy(Name, rData.Name, sizeof(Name));
     626           0 :                             Name[sizeof(Name)-1] = 0;
     627           0 :                             strncpy(Reference, rData.Reference, sizeof(Reference));
     628           0 :                             Reference[sizeof(Reference)-1] = 0;
     629           0 :                             memcpy(Reserved, rData.Reserved, sizeof(Reserved));
     630           0 :                         }
     631             :                         Sc10NameData(SvStream& rStream);
     632           0 :     virtual ScDataObject*   Clone() const SAL_OVERRIDE { return new Sc10NameData(*this); }
     633             : };
     634             : 
     635             : // Range-Collection
     636           0 : class Sc10NameCollection : public ScCollection
     637             : {
     638             : protected:
     639             :     sal_uLong           nError;
     640             : public:
     641             :                         Sc10NameCollection(SvStream& rStream);
     642           0 :     sal_uLong           GetError() { return nError; }
     643           0 :     Sc10NameData*       At(sal_uInt16 nIndex) { return static_cast<Sc10NameData*>(ScCollection::At(nIndex)); }
     644             : private:
     645             :     using               ScCollection::At;
     646             : };
     647             : 
     648             : // Template-Data
     649           0 : class Sc10PatternData : public ScDataObject
     650             : {
     651             : public:
     652             :     sal_Char            Name[32];
     653             :     Sc10ValueFormat     ValueFormat;
     654             :     Sc10LogFont         LogFont;
     655             :     sal_uInt16              Attr;
     656             :     sal_uInt16              Justify;
     657             :     sal_uInt16              Frame;
     658             :     sal_uInt16              Raster;
     659             :     sal_uInt16              nColor;
     660             :     sal_uInt16              FrameColor;
     661             :     sal_uInt16              Flags;
     662             :     sal_uInt16              FormatFlags;
     663             :     sal_Char            Reserved[8];
     664             : 
     665           0 :                         Sc10PatternData(const Sc10PatternData& rData) :
     666           0 :                             ScDataObject( rData )
     667             :                         {
     668           0 :                             strncpy(Name, rData.Name, sizeof(Name));
     669           0 :                             Name[sizeof(Name)-1] = 0;
     670           0 :                             memcpy(&ValueFormat, &rData.ValueFormat, sizeof(ValueFormat));
     671           0 :                             memcpy(&LogFont, &rData.LogFont, sizeof(LogFont));
     672           0 :                             Attr = rData.Attr;
     673           0 :                             Justify = rData.Justify;
     674           0 :                             Frame = rData.Frame;
     675           0 :                             Raster = rData.Raster;
     676           0 :                             nColor = rData.nColor;
     677           0 :                             FrameColor = rData.FrameColor;
     678           0 :                             Flags = rData.Flags;
     679           0 :                             FormatFlags = rData.FormatFlags;
     680           0 :                             memcpy(Reserved, rData.Reserved, sizeof(Reserved));
     681           0 :                         }
     682             :                         Sc10PatternData(SvStream& rStream);
     683           0 : virtual ScDataObject*       Clone() const SAL_OVERRIDE { return new Sc10PatternData(*this); }
     684             : };
     685             : 
     686             : // Template-Collection
     687           0 : class Sc10PatternCollection : public ScCollection
     688             : {
     689             : protected:
     690             :     sal_uLong           nError;
     691             : public:
     692             :                         Sc10PatternCollection(SvStream& rStream);
     693           0 :     sal_uLong           GetError() { return nError; }
     694           0 :     Sc10PatternData*    At(sal_uInt16 nIndex) { return static_cast<Sc10PatternData*>(ScCollection::At(nIndex)); }
     695             : private:
     696             :     using               ScCollection::At;
     697             : };
     698             : 
     699             : // DataBank-Data
     700           0 : class Sc10DataBaseData : public ScDataObject
     701             : {
     702             : public:
     703             :     Sc10DataBaseRec     DataBaseRec;
     704             : 
     705           0 :                         Sc10DataBaseData(const Sc10DataBaseData& rData) :
     706           0 :                             ScDataObject( rData )
     707             :                         {
     708           0 :                             memcpy(&DataBaseRec, &rData.DataBaseRec, sizeof(DataBaseRec));
     709           0 :                         }
     710             :                         Sc10DataBaseData(SvStream& rStream);
     711           0 : virtual ScDataObject*       Clone() const SAL_OVERRIDE { return new Sc10DataBaseData(*this); }
     712             : };
     713             : 
     714             : // DataBank-Collection
     715           0 : class Sc10DataBaseCollection : public ScCollection
     716             : {
     717             : protected:
     718             :     sal_uLong           nError;
     719             :     sal_Char            ActName[32];
     720             : public:
     721             :                         Sc10DataBaseCollection(SvStream& rStream);
     722           0 :     sal_uLong           GetError() { return nError; }
     723           0 :     Sc10DataBaseData*   At(sal_uInt16 nIndex) { return static_cast<Sc10DataBaseData*>(ScCollection::At(nIndex)); }
     724             : private:
     725             :     using               ScCollection::At;
     726             : };
     727             : 
     728           0 : class Sc10PageData : public ScDataObject
     729             : {
     730             : public:
     731             :     Sc10PageFormat      aPageFormat;
     732           0 :                         Sc10PageData( const Sc10PageFormat& rFormat ) : aPageFormat(rFormat) {}
     733             :     bool                operator==( const Sc10PageData& rData ) const
     734             :                             { return aPageFormat == rData.aPageFormat; }
     735             :     virtual ScDataObject*   Clone() const SAL_OVERRIDE;
     736             : };
     737             : 
     738             : // PageFormat-Collection
     739           0 : class Sc10PageCollection : public ScCollection
     740             : {
     741             : public:
     742           0 :                         Sc10PageCollection() : ScCollection(1,1) {};
     743           0 :     Sc10PageData*       At(sal_uInt16 nIndex) { return static_cast<Sc10PageData*>(ScCollection::At(nIndex)); }
     744             :     sal_uInt16              InsertFormat( const Sc10PageFormat& rData );
     745             :     void                PutToDoc( ScDocument* pDoc );
     746             : private:
     747             :     using               ScCollection::At;
     748             : };
     749             : 
     750             : class ScfStreamProgressBar;
     751             : 
     752             : // Import-Class
     753             : class Sc10Import
     754             : {
     755             :     SvStream&               rStream;
     756             :     ScDocument*             pDoc;
     757             :     Sc10Color               TextPalette[16];
     758             :     Sc10Color               BackPalette[16];
     759             :     Sc10Color               RasterPalette[16];
     760             :     Sc10Color               FramePalette[16];
     761             :     Sc10SheetProtect        SheetProtect;
     762             :     Sc10FontCollection*     pFontCollection;
     763             :     Sc10NameCollection*     pNameCollection;
     764             :     Sc10PatternCollection*  pPatternCollection;
     765             :     Sc10DataBaseCollection* pDataBaseCollection;
     766             :     sal_uLong                   nError;
     767             :     SCTAB                   nShowTab;
     768             :     ScViewOptions           aSc30ViewOpt;
     769             :     ScfStreamProgressBar*   pPrgrsBar;
     770             : 
     771             : public:
     772             :                               Sc10Import( SvStream& rStr, ScDocument* pDocument );
     773             :                               ~Sc10Import();
     774             : 
     775             :     sal_uLong                   Import();
     776             :     void                    LoadFileHeader();
     777             :     void                    LoadFileInfo();
     778             :     void                    LoadEditStateInfo();
     779             :     void                    LoadProtect();
     780             :     void                    LoadViewColRowBar();
     781             :     void                    LoadScrZoom();
     782             :     void                    LoadPalette();
     783             :     void                    LoadFontCollection();
     784             :     void                    LoadNameCollection();
     785             :     void                    ImportNameCollection();
     786             :     void                    LoadPatternCollection();
     787             :     void                    LoadDataBaseCollection();
     788             :     void                    LoadTables();
     789             :     void                    LoadCol(SCCOL Col, SCTAB Tab);
     790             :     void                    LoadColAttr(SCCOL Col, SCTAB Tab);
     791             :     void                    LoadAttr(Sc10ColAttr& rAttr);
     792             :     static void             ChangeFormat(sal_uInt16 nFormat, sal_uInt16 nInfo, sal_uLong& nKey);
     793             :     void                    LoadObjects();
     794             : };
     795             : 
     796             : #endif
     797             : 
     798             : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */

Generated by: LCOV version 1.11