LCOV - code coverage report
Current view: top level - sc/source/filter/inc - xlescher.hxx (source / functions) Hit Total Coverage
Test: libreoffice_filtered.info Lines: 11 15 73.3 %
Date: 2012-08-25 Functions: 5 9 55.6 %
Legend: Lines: hit not hit | Branches: + taken - not taken # not executed Branches: 10 40 25.0 %

           Branch data     Line data    Source code
       1                 :            : /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
       2                 :            : /*************************************************************************
       3                 :            :  *
       4                 :            :  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
       5                 :            :  *
       6                 :            :  * Copyright 2000, 2010 Oracle and/or its affiliates.
       7                 :            :  *
       8                 :            :  * OpenOffice.org - a multi-platform office productivity suite
       9                 :            :  *
      10                 :            :  * This file is part of OpenOffice.org.
      11                 :            :  *
      12                 :            :  * OpenOffice.org is free software: you can redistribute it and/or modify
      13                 :            :  * it under the terms of the GNU Lesser General Public License version 3
      14                 :            :  * only, as published by the Free Software Foundation.
      15                 :            :  *
      16                 :            :  * OpenOffice.org is distributed in the hope that it will be useful,
      17                 :            :  * but WITHOUT ANY WARRANTY; without even the implied warranty of
      18                 :            :  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
      19                 :            :  * GNU Lesser General Public License version 3 for more details
      20                 :            :  * (a copy is included in the LICENSE file that accompanied this code).
      21                 :            :  *
      22                 :            :  * You should have received a copy of the GNU Lesser General Public License
      23                 :            :  * version 3 along with OpenOffice.org.  If not, see
      24                 :            :  * <http://www.openoffice.org/license.html>
      25                 :            :  * for a copy of the LGPLv3 License.
      26                 :            :  *
      27                 :            :  ************************************************************************/
      28                 :            : 
      29                 :            : #ifndef SC_XLESCHER_HXX
      30                 :            : #define SC_XLESCHER_HXX
      31                 :            : 
      32                 :            : #include <tools/gen.hxx>
      33                 :            : #include <tools/mapunit.hxx>
      34                 :            : #include "fapihelper.hxx"
      35                 :            : #include "xladdress.hxx"
      36                 :            : #include "xlstyle.hxx"
      37                 :            : 
      38                 :            : namespace com { namespace sun { namespace star {
      39                 :            :     namespace drawing { class XShape; }
      40                 :            :     namespace awt { class XControlModel; }
      41                 :            :     namespace script { struct ScriptEventDescriptor; }
      42                 :            : } } }
      43                 :            : 
      44                 :            : class Rectangle;
      45                 :            : class XclImpStream;
      46                 :            : 
      47                 :            : // Constants and Enumerations =================================================
      48                 :            : 
      49                 :            : // (0x001C) NOTE --------------------------------------------------------------
      50                 :            : 
      51                 :            : const sal_uInt16 EXC_ID_NOTE                = 0x001C;
      52                 :            : const sal_uInt16 EXC_NOTE_VISIBLE           = 0x0002;
      53                 :            : const sal_uInt16 EXC_NOTE5_MAXLEN           = 2048;
      54                 :            : 
      55                 :            : // (0x005D) OBJ ---------------------------------------------------------------
      56                 :            : 
      57                 :            : const sal_uInt16 EXC_ID_OBJ                 = 0x005D;
      58                 :            : 
      59                 :            : const sal_uInt16 EXC_OBJ_INVALID_ID         = 0;
      60                 :            : 
      61                 :            : // object types
      62                 :            : const sal_uInt16 EXC_OBJTYPE_GROUP          = 0;
      63                 :            : const sal_uInt16 EXC_OBJTYPE_LINE           = 1;
      64                 :            : const sal_uInt16 EXC_OBJTYPE_RECTANGLE      = 2;
      65                 :            : const sal_uInt16 EXC_OBJTYPE_OVAL           = 3;
      66                 :            : const sal_uInt16 EXC_OBJTYPE_ARC            = 4;
      67                 :            : const sal_uInt16 EXC_OBJTYPE_CHART          = 5;
      68                 :            : const sal_uInt16 EXC_OBJTYPE_TEXT           = 6;
      69                 :            : const sal_uInt16 EXC_OBJTYPE_BUTTON         = 7;
      70                 :            : const sal_uInt16 EXC_OBJTYPE_PICTURE        = 8;
      71                 :            : const sal_uInt16 EXC_OBJTYPE_POLYGON        = 9;        // new in BIFF4
      72                 :            : const sal_uInt16 EXC_OBJTYPE_CHECKBOX       = 11;       // new in BIFF5
      73                 :            : const sal_uInt16 EXC_OBJTYPE_OPTIONBUTTON   = 12;
      74                 :            : const sal_uInt16 EXC_OBJTYPE_EDIT           = 13;
      75                 :            : const sal_uInt16 EXC_OBJTYPE_LABEL          = 14;
      76                 :            : const sal_uInt16 EXC_OBJTYPE_DIALOG         = 15;
      77                 :            : const sal_uInt16 EXC_OBJTYPE_SPIN           = 16;
      78                 :            : const sal_uInt16 EXC_OBJTYPE_SCROLLBAR      = 17;
      79                 :            : const sal_uInt16 EXC_OBJTYPE_LISTBOX        = 18;
      80                 :            : const sal_uInt16 EXC_OBJTYPE_GROUPBOX       = 19;
      81                 :            : const sal_uInt16 EXC_OBJTYPE_DROPDOWN       = 20;
      82                 :            : const sal_uInt16 EXC_OBJTYPE_NOTE           = 25;       // new in BIFF8
      83                 :            : const sal_uInt16 EXC_OBJTYPE_DRAWING        = 30;
      84                 :            : const sal_uInt16 EXC_OBJTYPE_UNKNOWN        = 0xFFFF;   /// For internal use only.
      85                 :            : 
      86                 :            : // BIFF3-BIFF5 flags
      87                 :            : const sal_uInt16 EXC_OBJ_HIDDEN             = 0x0100;
      88                 :            : const sal_uInt16 EXC_OBJ_VISIBLE            = 0x0200;
      89                 :            : const sal_uInt16 EXC_OBJ_PRINTABLE          = 0x0400;
      90                 :            : 
      91                 :            : // BIFF5 line formatting
      92                 :            : const sal_uInt8 EXC_OBJ_LINE_AUTOCOLOR      = 64;
      93                 :            : 
      94                 :            : const sal_uInt8 EXC_OBJ_LINE_SOLID          = 0;
      95                 :            : const sal_uInt8 EXC_OBJ_LINE_DASH           = 1;
      96                 :            : const sal_uInt8 EXC_OBJ_LINE_DOT            = 2;
      97                 :            : const sal_uInt8 EXC_OBJ_LINE_DASHDOT        = 3;
      98                 :            : const sal_uInt8 EXC_OBJ_LINE_DASHDOTDOT     = 4;
      99                 :            : const sal_uInt8 EXC_OBJ_LINE_MEDTRANS       = 5;
     100                 :            : const sal_uInt8 EXC_OBJ_LINE_DARKTRANS      = 6;
     101                 :            : const sal_uInt8 EXC_OBJ_LINE_LIGHTTRANS     = 7;
     102                 :            : const sal_uInt8 EXC_OBJ_LINE_NONE           = 255;
     103                 :            : 
     104                 :            : const sal_uInt8 EXC_OBJ_LINE_HAIR           = 0;
     105                 :            : const sal_uInt8 EXC_OBJ_LINE_THIN           = 1;
     106                 :            : const sal_uInt8 EXC_OBJ_LINE_MEDIUM         = 2;
     107                 :            : const sal_uInt8 EXC_OBJ_LINE_THICK          = 3;
     108                 :            : 
     109                 :            : const sal_uInt8 EXC_OBJ_LINE_AUTO           = 0x01;
     110                 :            : 
     111                 :            : const sal_uInt8 EXC_OBJ_ARROW_NONE          = 0;
     112                 :            : const sal_uInt8 EXC_OBJ_ARROW_OPEN          = 1;
     113                 :            : const sal_uInt8 EXC_OBJ_ARROW_FILLED        = 2;
     114                 :            : const sal_uInt8 EXC_OBJ_ARROW_OPENBOTH      = 3;
     115                 :            : const sal_uInt8 EXC_OBJ_ARROW_FILLEDBOTH    = 4;
     116                 :            : 
     117                 :            : const sal_uInt8 EXC_OBJ_ARROW_NARROW        = 0;
     118                 :            : const sal_uInt8 EXC_OBJ_ARROW_MEDIUM        = 1;
     119                 :            : const sal_uInt8 EXC_OBJ_ARROW_WIDE          = 2;
     120                 :            : 
     121                 :            : const sal_uInt8 EXC_OBJ_LINE_TL             = 0;
     122                 :            : const sal_uInt8 EXC_OBJ_LINE_TR             = 1;
     123                 :            : const sal_uInt8 EXC_OBJ_LINE_BR             = 2;
     124                 :            : const sal_uInt8 EXC_OBJ_LINE_BL             = 3;
     125                 :            : 
     126                 :            : // BIFF5 fill formatting
     127                 :            : const sal_uInt8 EXC_OBJ_FILL_AUTOCOLOR      = 65;
     128                 :            : 
     129                 :            : const sal_uInt8 EXC_OBJ_FILL_AUTO           = 0x01;
     130                 :            : 
     131                 :            : // BIFF5 frame formatting
     132                 :            : const sal_uInt16 EXC_OBJ_FRAME_SHADOW       = 0x0002;
     133                 :            : 
     134                 :            : // BIFF5 text objects
     135                 :            : const sal_uInt8 EXC_OBJ_HOR_LEFT            = 1;
     136                 :            : const sal_uInt8 EXC_OBJ_HOR_CENTER          = 2;
     137                 :            : const sal_uInt8 EXC_OBJ_HOR_RIGHT           = 3;
     138                 :            : const sal_uInt8 EXC_OBJ_HOR_JUSTIFY         = 4;
     139                 :            : 
     140                 :            : const sal_uInt8 EXC_OBJ_VER_TOP             = 1;
     141                 :            : const sal_uInt8 EXC_OBJ_VER_CENTER          = 2;
     142                 :            : const sal_uInt8 EXC_OBJ_VER_BOTTOM          = 3;
     143                 :            : const sal_uInt8 EXC_OBJ_VER_JUSTIFY         = 4;
     144                 :            : 
     145                 :            : const sal_uInt16 EXC_OBJ_ORIENT_NONE        = 0;
     146                 :            : const sal_uInt16 EXC_OBJ_ORIENT_STACKED     = 1;        /// Stacked top to bottom.
     147                 :            : const sal_uInt16 EXC_OBJ_ORIENT_90CCW       = 2;        /// 90 degr. counterclockwise.
     148                 :            : const sal_uInt16 EXC_OBJ_ORIENT_90CW        = 3;        /// 90 degr. clockwise.
     149                 :            : 
     150                 :            : const sal_uInt16 EXC_OBJ_TEXT_AUTOSIZE      = 0x0080;
     151                 :            : const sal_uInt16 EXC_OBJ_TEXT_LOCKED        = 0x0200;
     152                 :            : 
     153                 :            : const sal_Int32 EXC_OBJ_TEXT_MARGIN         = 20000;    /// Automatic text margin (EMUs).
     154                 :            : 
     155                 :            : // BIFF5 arc objects
     156                 :            : const sal_uInt8 EXC_OBJ_ARC_TR              = 0;
     157                 :            : const sal_uInt8 EXC_OBJ_ARC_TL              = 1;
     158                 :            : const sal_uInt8 EXC_OBJ_ARC_BL              = 2;
     159                 :            : const sal_uInt8 EXC_OBJ_ARC_BR              = 3;
     160                 :            : 
     161                 :            : // BIFF5 polygon objects
     162                 :            : const sal_uInt16 EXC_OBJ_POLY_CLOSED        = 0x0100;
     163                 :            : 
     164                 :            : // BIFF5 pictures/OLE objects
     165                 :            : const sal_uInt16 EXC_OBJ_PIC_MANUALSIZE     = 0x0001;
     166                 :            : const sal_uInt16 EXC_OBJ_PIC_DDE            = 0x0002;
     167                 :            : const sal_uInt16 EXC_OBJ_PIC_SYMBOL         = 0x0008;
     168                 :            : const sal_uInt16 EXC_OBJ_PIC_CONTROL        = 0x0010;   /// Form control (BIFF8).
     169                 :            : const sal_uInt16 EXC_OBJ_PIC_CTLSSTREAM     = 0x0020;   /// Data in Ctls stream (BIFF8).
     170                 :            : const sal_uInt16 EXC_OBJ_PIC_AUTOLOAD       = 0x0200;   /// Auto-load form control (BIFF8).
     171                 :            : 
     172                 :            : // BIFF5 button objects
     173                 :            : const sal_uInt16 EXC_OBJ_BUTTON_DEFAULT     = 0x0001;
     174                 :            : const sal_uInt16 EXC_OBJ_BUTTON_HELP        = 0x0002;
     175                 :            : const sal_uInt16 EXC_OBJ_BUTTON_CANCEL      = 0x0004;
     176                 :            : const sal_uInt16 EXC_OBJ_BUTTON_CLOSE       = 0x0008;
     177                 :            : 
     178                 :            : // BIFF5 checkboxs, radio buttons
     179                 :            : const sal_uInt16 EXC_OBJ_CHECKBOX_UNCHECKED = 0;
     180                 :            : const sal_uInt16 EXC_OBJ_CHECKBOX_CHECKED   = 1;
     181                 :            : const sal_uInt16 EXC_OBJ_CHECKBOX_TRISTATE  = 2;
     182                 :            : const sal_uInt16 EXC_OBJ_CHECKBOX_FLAT      = 0x0001;
     183                 :            : 
     184                 :            : // BIFF5 editbox objects
     185                 :            : const sal_uInt16 EXC_OBJ_EDIT_TEXT          = 0;
     186                 :            : const sal_uInt16 EXC_OBJ_EDIT_INTEGER       = 1;
     187                 :            : const sal_uInt16 EXC_OBJ_EDIT_DOUBLE        = 2;
     188                 :            : const sal_uInt16 EXC_OBJ_EDIT_REFERENCE     = 3;
     189                 :            : const sal_uInt16 EXC_OBJ_EDIT_FORMULA       = 4;
     190                 :            : 
     191                 :            : // BIFF5 scrollbars/spinbuttons
     192                 :            : const sal_uInt16 EXC_OBJ_SCROLLBAR_MIN      = 0;
     193                 :            : const sal_uInt16 EXC_OBJ_SCROLLBAR_MAX      = 30000;
     194                 :            : 
     195                 :            : const sal_uInt16 EXC_OBJ_SCROLLBAR_HOR      = 0x0001;
     196                 :            : 
     197                 :            : const sal_uInt16 EXC_OBJ_SCROLLBAR_DEFFLAGS = 0x0001;
     198                 :            : const sal_uInt16 EXC_OBJ_SCROLLBAR_FLAT     = 0x0008;
     199                 :            : 
     200                 :            : // BIFF5 listboxes/dropdowns
     201                 :            : const sal_uInt8 EXC_OBJ_LISTBOX_SINGLE      = 0;        /// Single selection.
     202                 :            : const sal_uInt8 EXC_OBJ_LISTBOX_MULTI       = 1;        /// Multi selection.
     203                 :            : const sal_uInt8 EXC_OBJ_LISTBOX_RANGE       = 2;        /// Range selection.
     204                 :            : 
     205                 :            : const sal_uInt16 EXC_OBJ_LISTBOX_EDIT       = 0x0002;
     206                 :            : const sal_uInt16 EXC_OBJ_LISTBOX_FLAT       = 0x0008;
     207                 :            : 
     208                 :            : // BIFF5 dropdown listboxes
     209                 :            : const sal_uInt16 EXC_OBJ_DROPDOWN_LISTBOX   = 0;        /// Listbox, text not editable.
     210                 :            : const sal_uInt16 EXC_OBJ_DROPDOWN_COMBOBOX  = 1;        /// Dropdown listbox with editable text.
     211                 :            : const sal_uInt16 EXC_OBJ_DROPDOWN_SIMPLE    = 2;        /// Dropdown button only, no text area.
     212                 :            : const sal_uInt16 EXC_OBJ_DROPDOWN_MAX       = 3;
     213                 :            : const sal_uInt16 EXC_OBJ_DROPDOWN_FILTERED  = 0x0008;   /// Drowdown style: filtered.
     214                 :            : 
     215                 :            : // BIFF5 groupboxes
     216                 :            : const sal_uInt16 EXC_OBJ_GROUPBOX_FLAT      = 0x0001;
     217                 :            : 
     218                 :            : // BIFF8 sub records
     219                 :            : const sal_uInt16 EXC_ID_OBJEND              = 0x0000;   /// End of OBJ.
     220                 :            : const sal_uInt16 EXC_ID_OBJMACRO            = 0x0004;   /// Macro link.
     221                 :            : const sal_uInt16 EXC_ID_OBJBUTTON           = 0x0005;   /// Button data.
     222                 :            : const sal_uInt16 EXC_ID_OBJGMO              = 0x0006;   /// Group marker.
     223                 :            : const sal_uInt16 EXC_ID_OBJCF               = 0x0007;   /// Clipboard format.
     224                 :            : const sal_uInt16 EXC_ID_OBJFLAGS            = 0x0008;   /// Option flags.
     225                 :            : const sal_uInt16 EXC_ID_OBJPICTFMLA         = 0x0009;   /// OLE link formula.
     226                 :            : const sal_uInt16 EXC_ID_OBJCBLS             = 0x000A;   /// Check box/radio button data.
     227                 :            : const sal_uInt16 EXC_ID_OBJRBO              = 0x000B;   /// Radio button group data.
     228                 :            : const sal_uInt16 EXC_ID_OBJSBS              = 0x000C;   /// Scroll bar data.
     229                 :            : const sal_uInt16 EXC_ID_OBJNTS              = 0x000D;   /// Note data.
     230                 :            : const sal_uInt16 EXC_ID_OBJSBSFMLA          = 0x000E;   /// Scroll bar/list box/combo box cell link.
     231                 :            : const sal_uInt16 EXC_ID_OBJGBODATA          = 0x000F;   /// Group box data.
     232                 :            : const sal_uInt16 EXC_ID_OBJEDODATA          = 0x0010;   /// Edit box data.
     233                 :            : const sal_uInt16 EXC_ID_OBJRBODATA          = 0x0011;   /// Radio button group data.
     234                 :            : const sal_uInt16 EXC_ID_OBJCBLSDATA         = 0x0012;   /// Check box/radio button data.
     235                 :            : const sal_uInt16 EXC_ID_OBJLBSDATA          = 0x0013;   /// List box/combo box data.
     236                 :            : const sal_uInt16 EXC_ID_OBJCBLSFMLA         = 0x0014;   /// Check box/radio button cell link.
     237                 :            : const sal_uInt16 EXC_ID_OBJCMO              = 0x0015;   /// Common object settings.
     238                 :            : const sal_uInt16 EXC_ID_OBJUNKNOWN          = 0xFFFF;   /// For internal use only.
     239                 :            : 
     240                 :            : // BIFF8 OBJCMO: flags
     241                 :            : const sal_uInt16 EXC_OBJCMO_PRINTABLE       = 0x0010;   /// Object printable.
     242                 :            : const sal_uInt16 EXC_OBJCMO_AUTOLINE        = 0x2000;   /// Automatic line formatting.
     243                 :            : const sal_uInt16 EXC_OBJCMO_AUTOFILL        = 0x4000;   /// Automatic fill formatting.
     244                 :            : 
     245                 :            : /** Value binding mode for cells linked to form controls. */
     246                 :            : enum XclCtrlBindMode
     247                 :            : {
     248                 :            :     EXC_CTRL_BINDCONTENT,       /// Binds cell to content of control.
     249                 :            :     EXC_CTRL_BINDPOSITION       /// Binds cell to position in control (e.g. listbox selection index).
     250                 :            : };
     251                 :            : 
     252                 :            : // (0x007F) IMGDATA -----------------------------------------------------------
     253                 :            : 
     254                 :            : const sal_uInt16 EXC_ID3_IMGDATA            = 0x007F;
     255                 :            : const sal_uInt16 EXC_ID8_IMGDATA            = 0x00E9;
     256                 :            : 
     257                 :            : const sal_uInt16 EXC_IMGDATA_WMF            = 2;
     258                 :            : const sal_uInt16 EXC_IMGDATA_BMP            = 9;
     259                 :            : 
     260                 :            : const sal_uInt16 EXC_IMGDATA_WIN            = 1;
     261                 :            : const sal_uInt16 EXC_IMGDATA_MAC            = 2;
     262                 :            : 
     263                 :            : const sal_uInt32 EXC_IMGDATA_MAXREC8        = 0x201C;
     264                 :            : const sal_uInt32 EXC_IMGDATA_MAXCONT8       = 0x2014;
     265                 :            : 
     266                 :            : // (0x00A9) COORDLIST ---------------------------------------------------------
     267                 :            : 
     268                 :            : const sal_uInt16 EXC_ID_COORDLIST           = 0x00A9;
     269                 :            : 
     270                 :            : // (0x00EB) MSODRAWINGGROUP ---------------------------------------------------
     271                 :            : 
     272                 :            : const sal_uInt16 EXC_ID_MSODRAWINGGROUP     = 0x00EB;
     273                 :            : 
     274                 :            : // (0x00EC) MSODRAWING --------------------------------------------------------
     275                 :            : 
     276                 :            : const sal_uInt16 EXC_ID_MSODRAWING          = 0x00EC;
     277                 :            : 
     278                 :            : // additional flags not extant in svx headers
     279                 :            : const sal_uInt16 EXC_ESC_ANCHOR_POSLOCKED   = 0x0001;
     280                 :            : const sal_uInt16 EXC_ESC_ANCHOR_SIZELOCKED  = 0x0002;
     281                 :            : const sal_uInt16 EXC_ESC_ANCHOR_LOCKED      = EXC_ESC_ANCHOR_POSLOCKED|EXC_ESC_ANCHOR_SIZELOCKED;
     282                 :            : 
     283                 :            : // (0x00ED) MSODRAWINGSELECTION -----------------------------------------------
     284                 :            : 
     285                 :            : const sal_uInt16 EXC_ID_MSODRAWINGSEL       = 0x00ED;
     286                 :            : 
     287                 :            : // (0x01B6) TXO ---------------------------------------------------------------
     288                 :            : 
     289                 :            : const sal_uInt16 EXC_ID_TXO                 = 0x01B6;
     290                 :            : 
     291                 :            : // TXO constants are eqzal to BIFF5 OBJ text object flags
     292                 :            : 
     293                 :            : // Structs and classes ========================================================
     294                 :            : 
     295                 :            : /** Represents the position (anchor) of an object in a Calc document. */
     296                 :            : struct XclObjAnchor : public XclRange
     297                 :            : {
     298                 :            :     sal_uInt16          mnLX;       /// X offset in left column (1/1024 of column width).
     299                 :            :     sal_uInt32          mnTY;       /// Y offset in top row (1/256 of row height).
     300                 :            :     sal_uInt16          mnRX;       /// X offset in right column (1/1024 of column width).
     301                 :            :     sal_uInt32          mnBY;       /// Y offset in bottom row (1/256 of row height).
     302                 :            : 
     303                 :            :     explicit            XclObjAnchor();
     304                 :            : 
     305                 :            :     /** Calculates a rectangle from the contained coordinates. */
     306                 :            :     Rectangle           GetRect( const XclRoot& rRoot, SCTAB nScTab, MapUnit eMapUnit ) const;
     307                 :            :     /** Initializes the anchor coordinates for a sheet. */
     308                 :            :     void                SetRect( const XclRoot& rRoot, SCTAB nScTab, const Rectangle& rRect, MapUnit eMapUnit );
     309                 :            : 
     310                 :            :     /** Initializes the anchor coordinates for an embedded draw page. */
     311                 :            :     void                SetRect( const Size& rPageSize, sal_Int32 nScaleX, sal_Int32 nScaleY,
     312                 :            :                             const Rectangle& rRect, MapUnit eMapUnit, bool bDffAnchor );
     313                 :            : };
     314                 :            : 
     315                 :            : 
     316                 :            : template< typename StreamType >
     317                 :        101 : StreamType& operator>>( StreamType& rStrm, XclObjAnchor& rAnchor )
     318                 :            : {
     319                 :            :     sal_uInt16 tmpFirstRow, tmpTY, tmpLastRow, tmpBY;
     320                 :            : 
     321 [ +  - ][ +  - ]:        101 :     rStrm
         [ +  - ][ +  - ]
         [ +  - ][ +  - ]
         [ +  - ][ +  - ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
     322                 :            :         >> rAnchor.maFirst.mnCol >> rAnchor.mnLX
     323                 :            :         >> tmpFirstRow >> tmpTY
     324                 :            :         >> rAnchor.maLast.mnCol  >> rAnchor.mnRX
     325                 :            :         >> tmpLastRow  >> tmpBY;
     326                 :            : 
     327                 :        101 :     rAnchor.maFirst.mnRow = static_cast<sal_uInt32> (tmpFirstRow);
     328                 :        101 :     rAnchor.mnTY = static_cast<sal_uInt32> (tmpTY);
     329                 :        101 :     rAnchor.maLast.mnRow = static_cast<sal_uInt32> (tmpLastRow);
     330                 :        101 :     rAnchor.mnBY = static_cast<sal_uInt32> (tmpBY);
     331                 :            : 
     332                 :        101 :     return rStrm;
     333                 :            : }
     334                 :            : 
     335                 :            : template< typename StreamType >
     336                 :          0 : StreamType& operator<<( StreamType& rStrm, const XclObjAnchor& rAnchor )
     337                 :            : {
     338                 :            :     return rStrm
     339                 :            :         << rAnchor.maFirst.mnCol << rAnchor.mnLX
     340                 :            :         << static_cast<sal_uInt16>(rAnchor.maFirst.mnRow) << static_cast<sal_uInt16>(rAnchor.mnTY)
     341                 :            :         << rAnchor.maLast.mnCol  << rAnchor.mnRX
     342                 :          0 :         << static_cast<sal_uInt16>(rAnchor.maLast.mnRow)  << static_cast<sal_uInt16>(rAnchor.mnBY);
     343                 :            : }
     344                 :            : 
     345                 :            : // ----------------------------------------------------------------------------
     346                 :            : 
     347                 :            : struct XclObjLineData
     348                 :            : {
     349                 :            :     sal_uInt8           mnColorIdx;
     350                 :            :     sal_uInt8           mnStyle;
     351                 :            :     sal_uInt8           mnWidth;
     352                 :            :     sal_uInt8           mnAuto;
     353                 :            : 
     354                 :            :     explicit            XclObjLineData();
     355                 :            : 
     356                 :          0 :     inline bool         IsAuto() const { return ::get_flag( mnAuto, EXC_OBJ_LINE_AUTO ); }
     357 [ #  # ][ #  # ]:          0 :     inline bool         IsVisible() const { return IsAuto() || (mnStyle != EXC_OBJ_LINE_NONE); }
     358                 :            : };
     359                 :            : 
     360                 :            : XclImpStream& operator>>( XclImpStream& rStrm, XclObjLineData& rLineData );
     361                 :            : 
     362                 :            : // ----------------------------------------------------------------------------
     363                 :            : 
     364                 :            : struct XclObjFillData
     365                 :            : {
     366                 :            :     sal_uInt8           mnBackColorIdx;
     367                 :            :     sal_uInt8           mnPattColorIdx;
     368                 :            :     sal_uInt8           mnPattern;
     369                 :            :     sal_uInt8           mnAuto;
     370                 :            : 
     371                 :            :     explicit            XclObjFillData();
     372                 :            : 
     373                 :         12 :     inline bool         IsAuto() const { return ::get_flag( mnAuto, EXC_OBJ_FILL_AUTO ); }
     374 [ +  - ][ -  + ]:         12 :     inline bool         IsFilled() const { return IsAuto() || (mnPattern != EXC_PATT_NONE); }
     375                 :            : };
     376                 :            : 
     377                 :            : XclImpStream& operator>>( XclImpStream& rStrm, XclObjFillData& rFillData );
     378                 :            : 
     379                 :            : // ----------------------------------------------------------------------------
     380                 :            : 
     381                 :            : struct XclObjTextData
     382                 :            : {
     383                 :            :     sal_uInt16          mnTextLen;
     384                 :            :     sal_uInt16          mnFormatSize;
     385                 :            :     sal_uInt16          mnLinkSize;
     386                 :            :     sal_uInt16          mnDefFontIdx;
     387                 :            :     sal_uInt16          mnFlags;
     388                 :            :     sal_uInt16          mnOrient;
     389                 :            :     sal_uInt16          mnButtonFlags;
     390                 :            :     sal_uInt16          mnShortcut;
     391                 :            :     sal_uInt16          mnShortcutEA;
     392                 :            : 
     393                 :            :     explicit            XclObjTextData();
     394                 :            : 
     395                 :            :     /** Reads text data from a BIFF3/BIFF4 OBJ record. */
     396                 :            :     void                ReadObj3( XclImpStream& rStrm );
     397                 :            :     /** Reads text data from a BIFF5 OBJ record. */
     398                 :            :     void                ReadObj5( XclImpStream& rStrm );
     399                 :            :     /** Reads text data from a BIFF8 TXO record. */
     400                 :            :     void                ReadTxo8( XclImpStream& rStrm );
     401                 :            : 
     402                 :         33 :     inline sal_uInt8    GetHorAlign() const { return ::extract_value< sal_uInt8 >( mnFlags, 1, 3 ); }
     403                 :         33 :     inline sal_uInt8    GetVerAlign() const { return ::extract_value< sal_uInt8 >( mnFlags, 4, 3 ); }
     404                 :            : };
     405                 :            : 
     406                 :            : // ============================================================================
     407                 :            : 
     408                 :            : enum XclTbxEventType
     409                 :            : {
     410                 :            :     EXC_TBX_EVENT_ACTION,       /// XActionListener.actionPerformed
     411                 :            :     EXC_TBX_EVENT_MOUSE,        /// XMouseListener.mouseReleased
     412                 :            :     EXC_TBX_EVENT_TEXT,         /// XTextListener.textChanged
     413                 :            :     EXC_TBX_EVENT_VALUE,        /// XAdjustmentListener.adjustmentValueChanged
     414                 :            :     EXC_TBX_EVENT_CHANGE        /// XChangeListener.changed
     415                 :            : };
     416                 :            : 
     417                 :            : // ----------------------------------------------------------------------------
     418                 :            : 
     419                 :            : /** Provides static helper functions for form controls. */
     420                 :            : class XclControlHelper
     421                 :            : {
     422                 :            : public:
     423                 :            :     /** Returns the API control model from the passed API shape object. */
     424                 :            :     static ::com::sun::star::uno::Reference< ::com::sun::star::awt::XControlModel >
     425                 :            :                         GetControlModel( ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShape > xShape );
     426                 :            : 
     427                 :            :     /** Fills the macro descriptor according to the passed macro name. */
     428                 :            :     static bool         FillMacroDescriptor(
     429                 :            :                             ::com::sun::star::script::ScriptEventDescriptor& rDescriptor,
     430                 :            :                             XclTbxEventType eEventType,
     431                 :            :                             const String& rXclMacroName,
     432                 :            :                             SfxObjectShell* pDocShell = 0 );
     433                 :            :     /** Tries to extract an Excel macro name from the passed macro descriptor. */
     434                 :            :     static String       ExtractFromMacroDescriptor(
     435                 :            :                             const ::com::sun::star::script::ScriptEventDescriptor& rDescriptor,
     436                 :            :                             XclTbxEventType eEventType, SfxObjectShell* pShell = NULL );
     437                 :            : };
     438                 :            : 
     439                 :            : // ============================================================================
     440                 :            : 
     441                 :            : #endif
     442                 :            : 
     443                 :            : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */

Generated by: LCOV version 1.10