[ooo-build-commit] Branch 'ooo/OOO320' - 2 commits - binfilter/bf_sfx2 binfilter/bf_sw binfilter/prj oox/inc oox/source

Jan Holesovsky kendy at kemper.freedesktop.org
Fri Oct 9 08:27:35 PDT 2009


 binfilter/bf_sfx2/source/doc/sfx2_objstor.cxx   |    1 
 binfilter/bf_sw/source/core/doc/makefile.mk     |    4 
 binfilter/bf_sw/source/core/doc/sw_gcc_outl.cxx |  347 ------------------------
 binfilter/prj/build.lst                         |    2 
 oox/inc/oox/helper/containerhelper.hxx          |   40 ++
 oox/inc/oox/xls/biffhelper.hxx                  |    2 
 oox/inc/oox/xls/biffinputstream.hxx             |    5 
 oox/inc/oox/xls/excelhandlers.hxx               |   15 +
 oox/inc/oox/xls/stylesbuffer.hxx                |  114 ++++---
 oox/inc/oox/xls/workbookhelper.hxx              |    8 
 oox/inc/oox/xls/worksheetbuffer.hxx             |    6 
 oox/source/dump/biffdumper.cxx                  |   18 +
 oox/source/dump/biffdumper.ini                  |   13 
 oox/source/dump/xlsbdumper.ini                  |    3 
 oox/source/helper/zipstorage.cxx                |   18 -
 oox/source/token/properties.txt                 |    1 
 oox/source/token/tokenmap.cxx                   |    1 
 oox/source/xls/excelhandlers.cxx                |  129 ++++----
 oox/source/xls/externallinkbuffer.cxx           |   22 -
 oox/source/xls/pivottablebuffer.cxx             |    2 
 oox/source/xls/stylesbuffer.cxx                 |  334 ++++++++++++++---------
 oox/source/xls/workbookfragment.cxx             |    2 
 oox/source/xls/workbookhelper.cxx               |    9 
 oox/source/xls/workbooksettings.cxx             |    2 
 oox/source/xls/worksheetbuffer.cxx              |   28 -
 25 files changed, 506 insertions(+), 620 deletions(-)

New commits:
commit 3545693c0889865f0e5b5d31d8044d05906bc8d9
Author: Ivo Hinkelmann <ihi at openoffice.org>
Date:   Tue Oct 6 14:49:48 2009 +0000

    CWS-TOOLING: integrate CWS calc32stopper2_OOO320
    2009-10-01 12:42:16 +0200 dr  r276592 : #i104992# and more typos...
    2009-10-01 12:42:13 +0200 nn  r276591 : #i105512# SetDocOptions: update number formatter if it already exists
    2009-09-30 19:03:58 +0200 dr  r276573 : #104992# oops, forgotten to skip a byte
    2009-09-30 16:07:17 +0200 dr  r276560 : #i103540# check valid vector size
    2009-09-29 14:20:45 +0200 dr  r276529 : dump some more BIFF records
    2009-09-29 13:00:22 +0200 dr  r276526 : dump some more BIFF records
    2009-09-28 14:34:14 +0200 dr  r276490 : #i104057# missing exception file
    2009-09-28 10:35:42 +0200 dr  r276483 : #i105325# set correct format while opening zip package
    2009-09-25 19:07:32 +0200 dr  r276475 : #i104992# handle cell styles built-in in Calc correctly
    2009-09-25 19:06:46 +0200 dr  r276474 : #i104992# handle cell styles built-in in Calc correctly
    2009-09-25 17:37:28 +0200 dr  r276472 : #i105219# missing include
    2009-09-25 12:32:24 +0200 dr  r276435 : #i10000# rebase error: renamed variable
    2009-09-25 11:34:53 +0200 dr  r276431 : CWS-TOOLING: rebase CWS calc32stopper2 to trunk at 276429 (milestone: DEV300:m60)
    2009-09-24 18:59:23 +0200 dr  r276427 : 160550# preserve write-protection password in roundtrip
    2009-09-24 18:54:43 +0200 dr  r276426 : 160550# preserve write-protection password in roundtrip
    2009-09-22 11:38:17 +0200 dr  r276353 : #160550# the property has to be integer of course
    2009-09-21 18:52:06 +0200 dr  r276342 : #160550# new internal property WriteProtectinPassword
    2009-09-21 18:22:40 +0200 dr  r276340 : #i104057# load sheets substreams according to offsets in SHEET records
    2009-09-21 18:11:00 +0200 dr  r276338 : #i104057# load sheets substreams according to offsets in SHEET records
    2009-09-17 20:07:33 +0200 dr  r276255 : #i104057# BIFF5/BIFF8: order of sheet substreams may be different to sheet order, use stream offset provided in SHEET records

diff --git a/oox/inc/oox/helper/containerhelper.hxx b/oox/inc/oox/helper/containerhelper.hxx
index 8186d53..b79d243 100644
--- a/oox/inc/oox/helper/containerhelper.hxx
+++ b/oox/inc/oox/helper/containerhelper.hxx
@@ -211,6 +211,38 @@ public:
                             forEach( ::boost::bind( pFunc, _1, aParam1, aParam2 ) );
                         }
 
+    /** Calls the passed functor for every contained object. Passes the key as
+        first argument and the object reference as second argument to rFunctor. */
+    template< typename FunctorType >
+    inline void         forEachWithKey( const FunctorType& rFunctor ) const
+                        {
+                            ::std::for_each( this->begin(), this->end(), ForEachFunctorWithKey< FunctorType >( rFunctor ) );
+                        }
+
+    /** Calls the passed member function of ObjType on every contained object.
+        Passes the object key as argument to the member function. */
+    template< typename FuncType >
+    inline void         forEachMemWithKey( FuncType pFunc ) const
+                        {
+                            forEachWithKey( ::boost::bind( pFunc, _2, _1 ) );
+                        }
+
+    /** Calls the passed member function of ObjType on every contained object.
+        Passes the object key as first argument to the member function. */
+    template< typename FuncType, typename ParamType >
+    inline void         forEachMemWithKey( FuncType pFunc, ParamType aParam ) const
+                        {
+                            forEachWithKey( ::boost::bind( pFunc, _2, _1, aParam ) );
+                        }
+
+    /** Calls the passed member function of ObjType on every contained object.
+        Passes the object key as first argument to the member function. */
+    template< typename FuncType, typename ParamType1, typename ParamType2 >
+    inline void         forEachMemWithKey( FuncType pFunc, ParamType1 aParam1, ParamType2 aParam2 ) const
+                        {
+                            forEachWithKey( ::boost::bind( pFunc, _2, _1, aParam1, aParam2 ) );
+                        }
+
 private:
     template< typename FunctorType >
     struct ForEachFunctor
@@ -220,6 +252,14 @@ private:
         inline void         operator()( const value_type& rValue ) const { if( rValue.second.get() ) mrFunctor( *rValue.second ); }
     };
 
+    template< typename FunctorType >
+    struct ForEachFunctorWithKey
+    {
+        const FunctorType&  mrFunctor;
+        inline explicit     ForEachFunctorWithKey( const FunctorType& rFunctor ) : mrFunctor( rFunctor ) {}
+        inline void         operator()( const value_type& rValue ) const { if( rValue.second.get() ) mrFunctor( rValue.first, *rValue.second ); }
+    };
+
     inline const mapped_type* getRef( key_type nKey ) const
                         {
                             typename container_type::const_iterator aIt = find( nKey );
diff --git a/oox/inc/oox/xls/biffhelper.hxx b/oox/inc/oox/xls/biffhelper.hxx
index d5be590..60efb9e 100644
--- a/oox/inc/oox/xls/biffhelper.hxx
+++ b/oox/inc/oox/xls/biffhelper.hxx
@@ -313,6 +313,7 @@ const sal_uInt16 BIFF_ID_CHPICFORMAT        = 0x103C;
 const sal_uInt16 BIFF_ID_CHPIE              = 0x1019;
 const sal_uInt16 BIFF_ID_CHPIEEXT           = 0x1061;
 const sal_uInt16 BIFF_ID_CHPIEFORMAT        = 0x100B;
+const sal_uInt16 BIFF_ID_CHPIVOTFLAGS       = 0x0859;
 const sal_uInt16 BIFF5_ID_CHPIVOTREF        = 0x1048;
 const sal_uInt16 BIFF8_ID_CHPIVOTREF        = 0x0858;
 const sal_uInt16 BIFF_ID_CHPLOTFRAME        = 0x1035;
@@ -481,6 +482,7 @@ const sal_uInt16 BIFF_ID_VERPAGEBREAKS      = 0x001A;
 const sal_uInt16 BIFF_ID_WINDOW1            = 0x003D;
 const sal_uInt16 BIFF2_ID_WINDOW2           = 0x003E;
 const sal_uInt16 BIFF3_ID_WINDOW2           = 0x023E;
+const sal_uInt16 BIFF_ID_WRITEACCESS        = 0x005C;
 const sal_uInt16 BIFF_ID_XCT                = 0x0059;
 const sal_uInt16 BIFF2_ID_XF                = 0x0043;
 const sal_uInt16 BIFF3_ID_XF                = 0x0243;
diff --git a/oox/inc/oox/xls/biffinputstream.hxx b/oox/inc/oox/xls/biffinputstream.hxx
index e3109a1..a829bce 100644
--- a/oox/inc/oox/xls/biffinputstream.hxx
+++ b/oox/inc/oox/xls/biffinputstream.hxx
@@ -182,7 +182,10 @@ public:
     /** Sets stream pointer to the start of the content of the specified record.
 
         The handle of the current record can be received and stored using the
-        function getRecHandle() for later usage with this function.
+        function getRecHandle() for later usage with this function. The record
+        handle is equivalent to the position of the underlying binary stream,
+        thus the function can be used to perform a hard seek to a specific
+        position, if it is sure that a record starts exactly at this position.
 
         @return  False = no record found (invalid handle passed).
      */
diff --git a/oox/inc/oox/xls/excelhandlers.hxx b/oox/inc/oox/xls/excelhandlers.hxx
index 76d0e59..a6619aa 100644
--- a/oox/inc/oox/xls/excelhandlers.hxx
+++ b/oox/inc/oox/xls/excelhandlers.hxx
@@ -304,6 +304,17 @@ protected:
      */
     BiffFragmentType    startFragment( BiffType eBiff );
 
+    /** Starts a new fragment at a specific position in the workbbok stream and
+        returns the fragment type.
+
+        The passed record handle must specify the stream position of the BOF
+        record of the fragment substream. The function will try to start the
+        next record and read the contents of the BOF record, if extant.
+
+        @return  Fragment type according to the imported BOF record.
+     */
+    BiffFragmentType    startFragment( BiffType eBiff, sal_Int64 nRecHandle );
+
     /** Skips the current fragment up to its trailing EOF record.
 
         Skips all records until next EOF record. When this function returns,
@@ -316,6 +327,10 @@ protected:
         @return  True = stream points to the EOF record of the current fragment.
      */
     bool                skipFragment();
+
+private:
+    /** Implementation helper for the startFragment() functions. */
+    BiffFragmentType    implStartFragment( BiffType eBiff );
 };
 
 // ============================================================================
diff --git a/oox/inc/oox/xls/stylesbuffer.hxx b/oox/inc/oox/xls/stylesbuffer.hxx
index 2b5b5bf..c79ef46 100644
--- a/oox/inc/oox/xls/stylesbuffer.hxx
+++ b/oox/inc/oox/xls/stylesbuffer.hxx
@@ -795,8 +795,10 @@ public:
     /** Final processing after import of all style settings. */
     void                finalizeImport();
 
-    /** Creates the style sheet described by the DXF. */
-    const ::rtl::OUString& createDxfStyle( sal_Int32 nDxfId );
+    /** Writes all formatting attributes to the passed property map. */
+    void                writeToPropertyMap( PropertyMap& rPropMap ) const;
+    /** Writes all formatting attributes to the passed property set. */
+    void                writeToPropertySet( PropertySet& rPropSet ) const;
 
 private:
     FontRef             mxFont;             /// Font data.
@@ -805,7 +807,6 @@ private:
     ProtectionRef       mxProtection;       /// Protection data.
     BorderRef           mxBorder;           /// Border data.
     FillRef             mxFill;             /// Fill data.
-    ::rtl::OUString     maFinalName;        /// Final style name used in API.
 };
 
 typedef ::boost::shared_ptr< Dxf > DxfRef;
@@ -826,7 +827,7 @@ struct CellStyleModel
     explicit            CellStyleModel();
 
     /** Returns true, if this style is a builtin style. */
-    inline bool         isBuiltin() const { return mbBuiltin && (mnBuiltinId >= 0); }
+    bool                isBuiltin() const;
     /** Returns true, if this style represents the default document cell style. */
     bool                isDefaultStyle() const;
 };
@@ -844,24 +845,17 @@ public:
     void                importCellStyle( RecordInputStream& rStrm );
     /** Imports style settings from a STYLE record. */
     void                importStyle( BiffInputStream& rStrm );
-    /** Sets the final style name to be used in the document. */
-    inline void         setFinalStyleName( const ::rtl::OUString& rStyleName ) { maFinalName = rStyleName; }
-
-    /** Returns true, if this style is a builtin style. */
-    inline bool         isBuiltin() const { return maModel.isBuiltin(); }
-    /** Returns true, if this style represents the default document cell style. */
-    inline bool         isDefaultStyle() const { return maModel.isDefaultStyle(); }
-    /** Returns the XF identifier for this cell style. */
-    inline sal_Int32    getXfId() const { return maModel.mnXfId; }
-    /** Calculates a readable style name according to the settings. */
-    ::rtl::OUString     calcInitialStyleName() const;
-    /** Returns the final style name used in the document. */
-    inline const ::rtl::OUString& getFinalStyleName() const { return maFinalName; }
 
     /** Creates the style sheet in the document described by this cell style object. */
     void                createCellStyle();
-    /** Creates the cell style, if it is user-defined or modified built-in. */
-    void                finalizeImport();
+    /** Stores tha passed final style name and creates the cell style, if it is
+        user-defined or modified built-in. */
+    void                finalizeImport( const ::rtl::OUString& rFinalName );
+
+    /** Returns the cell style model structure. */
+    inline const CellStyleModel& getModel() const { return maModel; }
+    /** Returns the final style name used in the document. */
+    inline const ::rtl::OUString& getFinalStyleName() const { return maFinalName; }
 
 private:
     CellStyleModel      maModel;
@@ -873,6 +867,46 @@ typedef ::boost::shared_ptr< CellStyle > CellStyleRef;
 
 // ============================================================================
 
+class CellStyleBuffer : public WorkbookHelper
+{
+public:
+    explicit            CellStyleBuffer( const WorkbookHelper& rHelper );
+
+    /** Appends and returns a new named cell style object. */
+    CellStyleRef        importCellStyle( const AttributeList& rAttribs );
+    /** Imports the CELLSTYLE record from the passed stream. */
+    CellStyleRef        importCellStyle( RecordInputStream& rStrm );
+    /** Imports the STYLE record from the passed stream. */
+    CellStyleRef        importStyle( BiffInputStream& rStrm );
+
+    /** Final processing after import of all style settings. */
+    void                finalizeImport();
+
+    /** Returns the XF identifier associated to the default cell style. */
+    sal_Int32           getDefaultXfId() const;
+    /** Returns the default style sheet for unused cells. */
+    ::rtl::OUString     getDefaultStyleName() const;
+    /** Creates the style sheet described by the style XF with the passed identifier. */
+    ::rtl::OUString     createCellStyle( sal_Int32 nXfId ) const;
+
+private:
+    /** Inserts the passed cell style object into the internal maps. */
+    void                insertCellStyle( CellStyleRef xCellStyle );
+    /** Creates the style sheet described by the passed cell style object. */
+    ::rtl::OUString     createCellStyle( const CellStyleRef& rxCellStyle ) const;
+
+private:
+    typedef RefVector< CellStyle >          CellStyleVector;
+    typedef RefMap< sal_Int32, CellStyle >  CellStyleXfIdMap;
+
+    CellStyleVector     maBuiltinStyles;    /// All built-in cell styles.
+    CellStyleVector     maUserStyles;       /// All user defined cell styles.
+    CellStyleXfIdMap    maStylesByXf;       /// All cell styles, mapped by XF identifier.
+    CellStyleRef        mxDefStyle;         /// Default cell style.
+};
+
+// ============================================================================
+
 class StylesBuffer : public WorkbookHelper
 {
 public:
@@ -947,12 +981,12 @@ public:
     /** Returns the model of the default application font (used in the "Normal" cell style). */
     const FontModel&    getDefaultFontModel() const;
 
+    /** Returns the default style sheet for unused cells. */
+    ::rtl::OUString     getDefaultStyleName() const;
     /** Creates the style sheet described by the style XF with the passed identifier. */
-    const ::rtl::OUString& createCellStyle( sal_Int32 nXfId ) const;
+    ::rtl::OUString     createCellStyle( sal_Int32 nXfId ) const;
     /** Creates the style sheet described by the DXF with the passed identifier. */
-    const ::rtl::OUString& createDxfStyle( sal_Int32 nDxfId ) const;
-    /** Returns the default style sheet for unused cells. */
-    const ::rtl::OUString& getDefaultStyleName() const;
+    ::rtl::OUString     createDxfStyle( sal_Int32 nDxfId ) const;
 
     /** Writes the font attributes of the specified font data to the passed property map. */
     void                writeFontToPropertyMap( PropertyMap& rPropMap, sal_Int32 nFontId ) const;
@@ -973,29 +1007,23 @@ public:
     void                writeStyleXfToPropertySet( PropertySet& rPropSet, sal_Int32 nXfId ) const;
 
 private:
-    void                insertCellStyle( CellStyleRef xCellStyle );
-
-private:
-    typedef RefVector< Font >                       FontVec;
-    typedef RefVector< Border >                     BorderVec;
-    typedef RefVector< Fill >                       FillVec;
-    typedef RefVector< Xf >                         XfVec;
-    typedef RefVector< Dxf >                        DxfVec;
-    typedef RefMap< sal_Int32, CellStyle >          CellStyleIdMap;
-    typedef RefMap< ::rtl::OUString, CellStyle >    CellStyleNameMap;
+    typedef RefVector< Font >                           FontVector;
+    typedef RefVector< Border >                         BorderVector;
+    typedef RefVector< Fill >                           FillVector;
+    typedef RefVector< Xf >                             XfVector;
+    typedef RefVector< Dxf >                            DxfVector;
+    typedef ::std::map< sal_Int32, ::rtl::OUString >    DxfStyleMap;
 
     ColorPalette        maPalette;          /// Color palette.
-    FontVec             maFonts;            /// List of font objects.
+    FontVector          maFonts;            /// List of font objects.
     NumberFormatsBuffer maNumFmts;          /// List of all number format codes.
-    BorderVec           maBorders;          /// List of cell border objects.
-    FillVec             maFills;            /// List of cell area fill objects.
-    XfVec               maCellXfs;          /// List of cell formats.
-    XfVec               maStyleXfs;         /// List of cell styles.
-    DxfVec              maDxfs;             /// List of differential cell styles.
-    CellStyleIdMap      maCellStylesById;   /// List of named cell styles, mapped by XF identifier.
-    CellStyleNameMap    maCellStylesByName; /// List of named cell styles, mapped by name.
-    ::rtl::OUString     maDefStyleName;     /// API name of default cell style.
-    sal_Int32           mnDefStyleXf;       /// Style XF index of default cell style.
+    BorderVector        maBorders;          /// List of cell border objects.
+    FillVector          maFills;            /// List of cell area fill objects.
+    XfVector            maCellXfs;          /// List of cell formats.
+    XfVector            maStyleXfs;         /// List of cell styles.
+    CellStyleBuffer     maCellStyles;       /// All built-in and user defined cell styles.
+    DxfVector           maDxfs;             /// List of differential cell styles.
+    mutable DxfStyleMap maDxfStyles;        /// Maps DXF identifiers to Calc style sheet names.
 };
 
 // ============================================================================
diff --git a/oox/inc/oox/xls/workbookhelper.hxx b/oox/inc/oox/xls/workbookhelper.hxx
index 1c4210d..cd2d9cf 100644
--- a/oox/inc/oox/xls/workbookhelper.hxx
+++ b/oox/inc/oox/xls/workbookhelper.hxx
@@ -169,6 +169,14 @@ enum FilterType
 
 // ============================================================================
 
+/** Functor for case-insensitive string comparison, usable in maps etc. */
+struct IgnoreCaseCompare
+{
+    bool                operator()( const ::rtl::OUString& rName1, const ::rtl::OUString& rName2 ) const;
+};
+
+// ============================================================================
+
 class WorkbookData;
 class WorkbookSettings;
 class ViewSettings;
diff --git a/oox/inc/oox/xls/worksheetbuffer.hxx b/oox/inc/oox/xls/worksheetbuffer.hxx
index 327ff5c..c1f977f 100644
--- a/oox/inc/oox/xls/worksheetbuffer.hxx
+++ b/oox/inc/oox/xls/worksheetbuffer.hxx
@@ -49,6 +49,7 @@ struct SheetInfoModel
 {
     ::rtl::OUString     maRelId;        /// Relation identifier for the sheet substream.
     ::rtl::OUString     maName;         /// Original name of the sheet.
+    sal_Int64           mnBiffHandle;   /// BIFF record handle of the sheet substream.
     sal_Int32           mnSheetId;      /// Sheet identifier.
     sal_Int32           mnState;        /// Visibility state.
 
@@ -88,6 +89,8 @@ public:
     sal_Int32           getWorksheetCount() const;
     /** Returns the OOX relation identifier of the specified worksheet. */
     ::rtl::OUString     getWorksheetRelId( sal_Int32 nWorksheet ) const;
+    /** Returns the BIFF record handle of the associated sheet substream. */
+    sal_Int64           getBiffRecordHandle( sal_Int32 nWorksheet ) const;
 
     /** Returns the Calc index of the specified worksheet. */
     sal_Int16           getCalcSheetIndex( sal_Int32 nWorksheet ) const;
@@ -120,8 +123,7 @@ private:
     typedef RefVector< SheetInfo > SheetInfoVector;
     SheetInfoVector     maSheetInfos;
 
-    struct SheetNameCompare { bool operator()( const ::rtl::OUString& rName1, const ::rtl::OUString& rName2 ) const; };
-    typedef RefMap< ::rtl::OUString, SheetInfo, SheetNameCompare > SheetInfoMap;
+    typedef RefMap< ::rtl::OUString, SheetInfo, IgnoreCaseCompare > SheetInfoMap;
     SheetInfoMap        maSheetInfosByName;
 };
 
diff --git a/oox/source/dump/biffdumper.cxx b/oox/source/dump/biffdumper.cxx
index da21926..2e42d2d 100644
--- a/oox/source/dump/biffdumper.cxx
+++ b/oox/source/dump/biffdumper.cxx
@@ -1864,6 +1864,18 @@ void WorkbookStreamObject::implDumpRecordBody()
             if( eBiff >= BIFF8 ) dumpHex< sal_uInt16 >( "flags", "CHPIE-FLAGS" );
         break;
 
+        case BIFF_ID_CHPIVOTFLAGS:
+            dumpRepeatedRecId();
+            dumpUnused( 2 );
+            dumpHex< sal_uInt16 >( "flags", "CHPIVOTFLAGS-FLAGS" );
+        break;
+
+        case BIFF8_ID_CHPIVOTREF:
+            dumpRepeatedRecId();
+            dumpUnused( 4 );
+            dumpUniString( "ref", BIFF_STR_8BITLENGTH );
+        break;
+
         case BIFF_ID_CHPLOTGROWTH:
             dumpFix< sal_Int32 >( "horizontal-growth" );
             dumpFix< sal_Int32 >( "vertical-growth" );
@@ -2786,6 +2798,10 @@ void WorkbookStreamObject::implDumpRecordBody()
                 dumpColorABGR( "grid-color" );
         break;
 
+        case BIFF_ID_WRITEACCESS:
+            dumpString( "user-name", BIFF_STR_8BITLENGTH );
+        break;
+
         case BIFF_ID_XCT:
             dumpDec< sal_uInt16 >( "crn-count" );
             if( eBiff == BIFF8 ) dumpDec< sal_Int16 >( "sheet-idx" );
@@ -2864,7 +2880,7 @@ OUString WorkbookStreamObject::dumpPivotString( const String& rName, sal_uInt16
     if( nStrLen != BIFF_PT_NOSTRING )
     {
         aString = (getBiff() == BIFF8) ?
-            getBiffStream().readUniString( nStrLen ) :
+            getBiffStream().readUniStringBody( nStrLen ) :
             getBiffStream().readCharArrayUC( nStrLen, getBiffData().getTextEncoding() );
         writeStringItem( rName, aString );
     }
diff --git a/oox/source/dump/biffdumper.ini b/oox/source/dump/biffdumper.ini
index e976686..cc9a5d1 100644
--- a/oox/source/dump/biffdumper.ini
+++ b/oox/source/dump/biffdumper.ini
@@ -308,8 +308,8 @@ multilist=RECORD-NAMES-BIFF5
   0x0098=,,,FILTERMODE,,AUTOFILTERINFO,AUTOFILTER,
   0x00A8=,,,,,,SCENARIOS,SCENARIO
   0x00B0=PTDEFINITION,PTFIELD,PTFITEM,,PTROWCOLFIELDS,PTROWCOLITEMS,PTPAGEFIELDS,
-  0x00B8=DOCROUTE,RECIPNAME,,,SHAREDFMLA,MULTRK,MULTBLANK,
-  0x00C0=,MMS,ADDMENU,DELMENU,,PTDATAFIELD,PCDEFINITION,PCDFIELD
+  0x00B8=DOCROUTE,RECIPNAME,,,SHAREDFMLA,MULTRK,MULTBLANK,TOOLBARHDR
+  0x00C0=TOOLBAREND,MMS,ADDMENU,DELMENU,,PTDATAFIELD,PCDEFINITION,PCDFIELD
   0x00C8=PCITEM_INDEXLIST,PCITEM_DOUBLE,PCITEM_BOOL,PCITEM_ERROR,PCITEM_INTEGER,PCITEM_STRING,PCITEM_DATE,PCITEM_MISSING
   0x00D0=SXTBL,SXTBRGITEM,SXTBPG,OBPROJ,,PIVOTCACHE,RSTRING,DBCELL
   0x00D8=PCDFRANGEPR,PCDFDISCRETEPR,BOOKBOOL,REVERT,SXEXT|PARAMQRY,SCENPROTECT,OLESIZE,UDDESC
@@ -342,9 +342,10 @@ multilist=RECORD-NAMES-BIFF8
   0x01A8=,USERBVIEW,USERSVIEWBEGIN,USERSVIEWEND,,QSI,EXTERNALBOOK,PROT4REV
   0x01B0=CFHEADER,CFRULE,DATAVALIDATIONS,,,DCONBINAME,TXO,REFRESHALL
   0x01B8=HYPERLINK,NLRDELNAME,CODENAME,PCDFSQLTYPE,PROT4REVPASS,,DATAVALIDATION,
+  0x01C0=XL9FILE,,,,,,,
   0x0800=SCREENTIP,,,WEBQRYSETTINGS,WEBQRYTABLES,,,
   0x0850=CHFRINFO,CHFRWRAPPER,CHFRBLOCKBEGIN,CHFRBLOCKEND,,,,CHFRUNITPROPS
-  0x0858=CHPIVOTREF,,,,,,,
+  0x0858=CHPIVOTREF,CHPIVOTFLAGS,,,,,,
   0x0860=,,SHEETLAYOUT,,,,,SHEETPROTECTION
   0x0868=,,,CHFRLABELPROPS,,,,
   0x0890=,,STYLEEXT,,,,,
@@ -817,6 +818,12 @@ flagslist=CHPIE-FLAGS
   0x0002=connectors
 end
 
+# CHPIVOTFLAGS ---------------------------------------------------------------
+
+flagslist=CHPIVOTFLAGS-FLAGS
+  0x0001=hide-field-captions
+end
+
 # CHRADAR, CHRADARAREA -------------------------------------------------------
 
 flagslist=CHRADAR-FLAGS
diff --git a/oox/source/dump/xlsbdumper.ini b/oox/source/dump/xlsbdumper.ini
index be6efd2..34c464c 100644
--- a/oox/source/dump/xlsbdumper.ini
+++ b/oox/source/dump/xlsbdumper.ini
@@ -208,7 +208,7 @@ multilist=RECORD-NAMES
   0x01C8=,,,AUTOSORTSCOPE,AUTOSORTSCOPE_END,CONDFORMATTING,CONDFORMATTING_END,CFRULE
   0x01D0=CFRULE_END,ICONSET,ICONSET_END,DATABAR,DATABAR_END,COLORSCALE,COLORSCALE_END,CFVO
   0x01D8=,COLORS,COLORS_END,RGBCOLOR,PAGEMARGINS,PRINTOPTIONS,PAGESETUP,HEADERFOOTER
-  0x01E0=HEADERFOOTER_END,,,,,SHEETFORMATPR,,
+  0x01E0=HEADERFOOTER_END,PTCHARTFORMAT,PTCHARTFORMAT_END,PTCHARTFORMATS,PTCHARTFORMATS_END,SHEETFORMATPR,,
   0x01E8=,,,,,,HYPERLINK,
   0x01F0=,,,,SCENARIOS,SCENARIOS_END,SCENARIO,SCENARIO_END
   0x01F8=INPUTCELLS,DXFS,DXFS_END,DXF,TABLESTYLES,TABLESTYLES_END,,
@@ -249,6 +249,7 @@ constlist=SIMPLE-RECORDS
   0x0159=int32,dec,count
   0x017E=int32,dec,item-index
   0x01DD=uint16,hex,flags,PRINTOPTIONS-FLAGS
+  0x01E3=int32,dec,count
   0x01F9=int32,dec,count
   0x0204=int32,dec,type,VOLTYPE-TYPE
   0x020D=uint8,dec,error-code,ERRORCODES
diff --git a/oox/source/helper/zipstorage.cxx b/oox/source/helper/zipstorage.cxx
index 1652c5b..5dd3aa6 100644
--- a/oox/source/helper/zipstorage.cxx
+++ b/oox/source/helper/zipstorage.cxx
@@ -1,7 +1,7 @@
 /*************************************************************************
  *
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- * 
+ *
  * Copyright 2008 by Sun Microsystems, Inc.
  *
  * OpenOffice.org - a multi-platform office productivity suite
@@ -63,7 +63,13 @@ ZipStorage::ZipStorage(
     // create base storage object
     try
     {
-        mxStorage = ::comphelper::OStorageHelper::GetStorageFromInputStream( rxInStream, rxFactory );
+        /*  #i105325# ::comphelper::OStorageHelper::GetStorageFromInputStream()
+            cannot be used here as it will open a storage with format type
+            'PackageFormat' that will not work with OOXML packages.
+            TODO: #i105410# switch to 'OFOPXMLFormat' and use its
+            implementation of relations handling. */
+        mxStorage = ::comphelper::OStorageHelper::GetStorageOfFormatFromInputStream(
+            ZIP_STORAGE_FORMAT_STRING, rxInStream, rxFactory );
     }
     catch( Exception& )
     {
@@ -79,11 +85,9 @@ ZipStorage::ZipStorage(
     // create base storage object
     try
     {
-        mxStorage = ::comphelper::OStorageHelper::GetStorageOfFormatFromStream( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "OFOPXMLFormat" ) ),
-                                                                                rxStream,
-                                                                                com::sun::star::embed::ElementModes::READWRITE
-                                                                                | com::sun::star::embed::ElementModes::TRUNCATE,
-                                                                                rxFactory );
+        using namespace ::com::sun::star::embed::ElementModes;
+        mxStorage = ::comphelper::OStorageHelper::GetStorageOfFormatFromStream(
+            OFOPXML_STORAGE_FORMAT_STRING, rxStream, READWRITE | TRUNCATE, rxFactory );
     }
     catch( Exception& )
     {
diff --git a/oox/source/token/properties.txt b/oox/source/token/properties.txt
index 958a9ac..0ecd40e 100644
--- a/oox/source/token/properties.txt
+++ b/oox/source/token/properties.txt
@@ -400,6 +400,7 @@ VisualEffect
 Weight
 WhiteDay
 Width
+WriteProtectionPassword
 WritingMode
 ZoomType
 ZoomValue
diff --git a/oox/source/token/tokenmap.cxx b/oox/source/token/tokenmap.cxx
index 733b18f..c01e366 100644
--- a/oox/source/token/tokenmap.cxx
+++ b/oox/source/token/tokenmap.cxx
@@ -29,6 +29,7 @@
  ************************************************************************/
 
 #include "oox/token/tokenmap.hxx"
+#include <string.h>
 #include <rtl/strbuf.hxx>
 #include <rtl/string.hxx>
 #include "tokens.hxx"
diff --git a/oox/source/xls/excelhandlers.cxx b/oox/source/xls/excelhandlers.cxx
index aa5a863..fa72d96 100644
--- a/oox/source/xls/excelhandlers.cxx
+++ b/oox/source/xls/excelhandlers.cxx
@@ -143,68 +143,12 @@ BiffFragmentHandler::BiffFragmentHandler( const BiffFragmentHandler& rHandler )
 
 BiffFragmentType BiffFragmentHandler::startFragment( BiffType eBiff )
 {
-    BiffFragmentType eFragment = BIFF_FRAGMENT_UNKNOWN;
-    if( mrStrm.startNextRecord() )
-    {
-        /*  #i23425# Don't rely on BOF record ID to read BOF contents, but on
-            the detected BIFF version. */
-        if( isBofRecord() )
-        {
-            // BOF is always written unencrypted
-            mrStrm.enableDecoder( false );
-            mrStrm.skip( 2 );
-            sal_uInt16 nType = mrStrm.readuInt16();
+    return mrStrm.startNextRecord() ? implStartFragment( eBiff ) : BIFF_FRAGMENT_UNKNOWN;
+}
 
-            // decide which fragment types are valid for current BIFF version
-            switch( eBiff )
-            {
-                case BIFF2: switch( nType )
-                {
-                    case BIFF_BOF_CHART:    eFragment = BIFF_FRAGMENT_EMPTYSHEET;   break;
-                    case BIFF_BOF_MACRO:    eFragment = BIFF_FRAGMENT_MACROSHEET;   break;
-                    // #i51490# Excel interprets invalid types as worksheet
-                    default:                eFragment = BIFF_FRAGMENT_WORKSHEET;
-                }
-                break;
-
-                case BIFF3: switch( nType )
-                {
-                    case BIFF_BOF_CHART:    eFragment = BIFF_FRAGMENT_EMPTYSHEET;   break;
-                    case BIFF_BOF_MACRO:    eFragment = BIFF_FRAGMENT_MACROSHEET;   break;
-                    case BIFF_BOF_WORKSPACE:eFragment = BIFF_FRAGMENT_UNKNOWN;      break;
-                    // #i51490# Excel interprets invalid types as worksheet
-                    default:                eFragment = BIFF_FRAGMENT_WORKSHEET;
-                };
-                break;
-
-                case BIFF4: switch( nType )
-                {
-                    case BIFF_BOF_CHART:    eFragment = BIFF_FRAGMENT_EMPTYSHEET;   break;
-                    case BIFF_BOF_MACRO:    eFragment = BIFF_FRAGMENT_MACROSHEET;   break;
-                    case BIFF_BOF_WORKSPACE:eFragment = BIFF_FRAGMENT_WORKSPACE;    break;
-                    // #i51490# Excel interprets invalid types as worksheet
-                    default:                eFragment = BIFF_FRAGMENT_WORKSHEET;
-                };
-                break;
-
-                case BIFF5:
-                case BIFF8: switch( nType )
-                {
-                    case BIFF_BOF_GLOBALS:  eFragment = BIFF_FRAGMENT_GLOBALS;      break;
-                    case BIFF_BOF_CHART:    eFragment = BIFF_FRAGMENT_CHARTSHEET;   break;
-                    case BIFF_BOF_MACRO:    eFragment = BIFF_FRAGMENT_MACROSHEET;   break;
-                    case BIFF_BOF_MODULE:   eFragment = BIFF_FRAGMENT_MODULESHEET;  break;
-                    case BIFF_BOF_WORKSPACE:eFragment = BIFF_FRAGMENT_UNKNOWN;      break;
-                    // #i51490# Excel interprets invalid types as worksheet
-                    default:                eFragment = BIFF_FRAGMENT_WORKSHEET;
-                };
-                break;
-
-                case BIFF_UNKNOWN: break;
-            }
-        }
-    }
-    return eFragment;
+BiffFragmentType BiffFragmentHandler::startFragment( BiffType eBiff, sal_Int64 nRecHandle )
+{
+    return mrStrm.startRecordByHandle( nRecHandle ) ? implStartFragment( eBiff ) : BIFF_FRAGMENT_UNKNOWN;
 }
 
 bool BiffFragmentHandler::skipFragment()
@@ -215,6 +159,69 @@ bool BiffFragmentHandler::skipFragment()
     return !mrStrm.isEof() && (mrStrm.getRecId() == BIFF_ID_EOF);
 }
 
+BiffFragmentType BiffFragmentHandler::implStartFragment( BiffType eBiff )
+{
+    BiffFragmentType eFragment = BIFF_FRAGMENT_UNKNOWN;
+    /*  #i23425# Don't rely on BOF record ID to read BOF contents, but on
+        the detected BIFF version. */
+    if( isBofRecord() )
+    {
+        // BOF is always written unencrypted
+        mrStrm.enableDecoder( false );
+        mrStrm.skip( 2 );
+        sal_uInt16 nType = mrStrm.readuInt16();
+
+        // decide which fragment types are valid for current BIFF version
+        switch( eBiff )
+        {
+            case BIFF2: switch( nType )
+            {
+                case BIFF_BOF_CHART:    eFragment = BIFF_FRAGMENT_EMPTYSHEET;   break;
+                case BIFF_BOF_MACRO:    eFragment = BIFF_FRAGMENT_MACROSHEET;   break;
+                // #i51490# Excel interprets invalid types as worksheet
+                default:                eFragment = BIFF_FRAGMENT_WORKSHEET;
+            }
+            break;
+
+            case BIFF3: switch( nType )
+            {
+                case BIFF_BOF_CHART:    eFragment = BIFF_FRAGMENT_EMPTYSHEET;   break;
+                case BIFF_BOF_MACRO:    eFragment = BIFF_FRAGMENT_MACROSHEET;   break;
+                case BIFF_BOF_WORKSPACE:eFragment = BIFF_FRAGMENT_UNKNOWN;      break;
+                // #i51490# Excel interprets invalid types as worksheet
+                default:                eFragment = BIFF_FRAGMENT_WORKSHEET;
+            };
+            break;
+
+            case BIFF4: switch( nType )
+            {
+                case BIFF_BOF_CHART:    eFragment = BIFF_FRAGMENT_EMPTYSHEET;   break;
+                case BIFF_BOF_MACRO:    eFragment = BIFF_FRAGMENT_MACROSHEET;   break;
+                case BIFF_BOF_WORKSPACE:eFragment = BIFF_FRAGMENT_WORKSPACE;    break;
+                // #i51490# Excel interprets invalid types as worksheet
+                default:                eFragment = BIFF_FRAGMENT_WORKSHEET;
+            };
+            break;
+
+            case BIFF5:
+            case BIFF8: switch( nType )
+            {
+                case BIFF_BOF_GLOBALS:  eFragment = BIFF_FRAGMENT_GLOBALS;      break;
+                case BIFF_BOF_CHART:    eFragment = BIFF_FRAGMENT_CHARTSHEET;   break;
+                case BIFF_BOF_MACRO:    eFragment = BIFF_FRAGMENT_MACROSHEET;   break;
+                case BIFF_BOF_MODULE:   eFragment = BIFF_FRAGMENT_MODULESHEET;  break;
+                case BIFF_BOF_WORKSPACE:eFragment = BIFF_FRAGMENT_UNKNOWN;      break;
+                // #i51490# Excel interprets invalid types as worksheet
+                default:                eFragment = BIFF_FRAGMENT_WORKSHEET;
+            };
+            break;
+
+            case BIFF_UNKNOWN: break;
+        }
+    }
+    return eFragment;
+}
+
 // ============================================================================
 
 BiffWorkbookFragmentBase::BiffWorkbookFragmentBase( const WorkbookHelper& rHelper, const OUString& rStrmName, bool bCloneDecoder ) :
diff --git a/oox/source/xls/externallinkbuffer.cxx b/oox/source/xls/externallinkbuffer.cxx
index 26a1df0..c756252 100644
--- a/oox/source/xls/externallinkbuffer.cxx
+++ b/oox/source/xls/externallinkbuffer.cxx
@@ -1030,18 +1030,20 @@ void ExternalLinkBuffer::importExternalName( BiffInputStream& rStrm )
 
 void ExternalLinkBuffer::importExternSheet8( BiffInputStream& rStrm )
 {
-    OSL_ENSURE( getBiff() == BIFF8, "ExternalLinkBuffer::importExternSheet - wrong BIFF version" );
-    OSL_ENSURE( maRefSheets.empty(), "ExternalLinkBuffer::importExternSheet - multiple EXTERNSHEET records" );
-    maRefSheets.clear();
+    OSL_ENSURE( getBiff() == BIFF8, "ExternalLinkBuffer::importExternSheet8 - wrong BIFF version" );
+
     sal_uInt16 nRefCount;
     rStrm >> nRefCount;
-    maRefSheets.reserve( nRefCount );
-    for( sal_uInt16 nRefId = 0; !rStrm.isEof() && (nRefId < nRefCount); ++nRefId )
-    {
-        RefSheetsModel aRefSheets;
-        aRefSheets.readBiff8Data( rStrm );
-        maRefSheets.push_back( aRefSheets );
-    }
+    OSL_ENSURE( static_cast< sal_Int64 >( nRefCount * 6 ) == rStrm.getRemaining(), "ExternalLinkBuffer::importExternSheet8 - invalid count" );
+    nRefCount = static_cast< sal_uInt16 >( ::std::min< sal_Int64 >( nRefCount, rStrm.getRemaining() / 6 ) );
+
+    /*  #i104057# A weird external XLS generator writes multiple EXTERNSHEET
+        records instead of only one as expected. Surprisingly, Excel seems to
+        insert the entries of the second record before the entries of the first
+        record. */
+    maRefSheets.insert( maRefSheets.begin(), nRefCount, RefSheetsModel() );
+    for( RefSheetsModelVec::iterator aIt = maRefSheets.begin(); !rStrm.isEof() && (nRefCount > 0); --nRefCount )
+        aIt->readBiff8Data( rStrm );
 }
 
 Sequence< ExternalLinkInfo > ExternalLinkBuffer::getLinkInfos() const
diff --git a/oox/source/xls/pivottablebuffer.cxx b/oox/source/xls/pivottablebuffer.cxx
index 73404d2..361a3c0 100644
--- a/oox/source/xls/pivottablebuffer.cxx
+++ b/oox/source/xls/pivottablebuffer.cxx
@@ -221,7 +221,7 @@ OUString lclReadPivotString( const WorkbookHelper& rHelper, BiffInputStream& rSt
 {
     if( nLen == BIFF_PT_NOSTRING )
         return OUString();
-    return (rHelper.getBiff() == BIFF8) ? rStrm.readUniString( nLen ) : rStrm.readCharArrayUC( nLen, rHelper.getTextEncoding() );
+    return (rHelper.getBiff() == BIFF8) ? rStrm.readUniStringBody( nLen ) : rStrm.readCharArrayUC( nLen, rHelper.getTextEncoding() );
 }
 
 } // namespace
diff --git a/oox/source/xls/stylesbuffer.cxx b/oox/source/xls/stylesbuffer.cxx
index dc7456e..3e69266 100644
--- a/oox/source/xls/stylesbuffer.cxx
+++ b/oox/source/xls/stylesbuffer.cxx
@@ -1,3 +1,4 @@
+
 /*************************************************************************
  *
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -29,7 +30,7 @@
  ************************************************************************/
 
 #include "oox/xls/stylesbuffer.hxx"
-#include <com/sun/star/container/XEnumerationAccess.hpp>
+#include <com/sun/star/container/XIndexAccess.hpp>
 #include <com/sun/star/container/XNameAccess.hpp>
 #include <com/sun/star/awt/FontDescriptor.hpp>
 #include <com/sun/star/awt/FontFamily.hpp>
@@ -65,8 +66,7 @@ using ::com::sun::star::uno::Reference;
 using ::com::sun::star::uno::UNO_QUERY;
 using ::com::sun::star::uno::UNO_QUERY_THROW;
 using ::com::sun::star::uno::UNO_SET_THROW;
-using ::com::sun::star::container::XEnumerationAccess;
-using ::com::sun::star::container::XEnumeration;
+using ::com::sun::star::container::XIndexAccess;
 using ::com::sun::star::container::XNameAccess;
 using ::com::sun::star::container::XNamed;
 using ::com::sun::star::awt::FontDescriptor;
@@ -2526,30 +2526,27 @@ void Dxf::finalizeImport()
         mxFill->finalizeImport();
 }
 
-const OUString& Dxf::createDxfStyle( sal_Int32 nDxfId )
+void Dxf::writeToPropertyMap( PropertyMap& rPropMap ) const
 {
-    if( maFinalName.getLength() == 0 )
-    {
-        maFinalName = OUStringBuffer( CREATE_OUSTRING( "ConditionalStyle_" ) ).append( nDxfId + 1 ).makeStringAndClear();
-        Reference< XStyle > xStyle = createStyleObject( maFinalName, false );
-        // write style formatting properties
-        PropertyMap aPropMap;
-        if( mxFont.get() )
-            mxFont->writeToPropertyMap( aPropMap, FONT_PROPTYPE_CELL );
-        if( mxNumFmt.get() )
-            mxNumFmt->writeToPropertyMap( aPropMap );
-        if( mxAlignment.get() )
-            mxAlignment->writeToPropertyMap( aPropMap );
-        if( mxProtection.get() )
-            mxProtection->writeToPropertyMap( aPropMap );
-        if( mxBorder.get() )
-            mxBorder->writeToPropertyMap( aPropMap );
-        if( mxFill.get() )
-            mxFill->writeToPropertyMap( aPropMap );
-        PropertySet aPropSet( xStyle );
-        aPropSet.setProperties( aPropMap );
-    }
-    return maFinalName;
+    if( mxFont.get() )
+        mxFont->writeToPropertyMap( rPropMap, FONT_PROPTYPE_CELL );
+    if( mxNumFmt.get() )
+        mxNumFmt->writeToPropertyMap( rPropMap );
+    if( mxAlignment.get() )
+        mxAlignment->writeToPropertyMap( rPropMap );
+    if( mxProtection.get() )
+        mxProtection->writeToPropertyMap( rPropMap );
+    if( mxBorder.get() )
+        mxBorder->writeToPropertyMap( rPropMap );
+    if( mxFill.get() )
+        mxFill->writeToPropertyMap( rPropMap );
+}
+
+void Dxf::writeToPropertySet( PropertySet& rPropSet ) const
+{
+    PropertyMap aPropMap;
+    writeToPropertyMap( aPropMap );
+    rPropSet.setProperties( aPropMap );
 }
 
 // ============================================================================
@@ -2732,6 +2729,11 @@ CellStyleModel::CellStyleModel() :
 {
 }
 
+bool CellStyleModel::isBuiltin() const
+{
+    return mbBuiltin && (mnBuiltinId >= 0);
+}
+
 bool CellStyleModel::isDefaultStyle() const
 {
     return mbBuiltin && (mnBuiltinId == OOX_STYLE_NORMAL);
@@ -2801,11 +2803,6 @@ void CellStyle::importStyle( BiffInputStream& rStrm )
     }
 }
 
-OUString CellStyle::calcInitialStyleName() const
-{
-    return isBuiltin() ? lclGetBuiltinStyleName( maModel.mnBuiltinId, maModel.maName, maModel.mnLevel ) : maModel.maName;
-}
-
 void CellStyle::createCellStyle()
 {
     // #i1624# #i1768# ignore unnamed user styles
@@ -2832,7 +2829,7 @@ void CellStyle::createCellStyle()
         // write style formatting properties
         PropertySet aPropSet( xStyle );
         getStyles().writeStyleXfToPropertySet( aPropSet, maModel.mnXfId );
-        if( !isDefaultStyle() )
+        if( !maModel.isDefaultStyle() )
             xStyle->setParentStyle( getStyles().getDefaultStyleName() );
     }
     catch( Exception& )
@@ -2840,47 +2837,182 @@ void CellStyle::createCellStyle()
     }
 }
 
-void CellStyle::finalizeImport()
+void CellStyle::finalizeImport( const OUString& rFinalName )
 {
-    if( !isBuiltin() || maModel.mbCustom )
+    maFinalName = rFinalName;
+    if( !maModel.isBuiltin() || maModel.mbCustom )
         createCellStyle();
 }
 
 // ============================================================================
 
-StylesBuffer::StylesBuffer( const WorkbookHelper& rHelper ) :
-    WorkbookHelper( rHelper ),
-    maPalette( rHelper ),
-    maNumFmts( rHelper ),
-    maDefStyleName( lclGetBuiltinStyleName( OOX_STYLE_NORMAL, OUString() ) ),
-    mnDefStyleXf( -1 )
+CellStyleBuffer::CellStyleBuffer( const WorkbookHelper& rHelper ) :
+    WorkbookHelper( rHelper )
+{
+}
+
+CellStyleRef CellStyleBuffer::importCellStyle( const AttributeList& rAttribs )
+{
+    CellStyleRef xCellStyle( new CellStyle( *this ) );
+    xCellStyle->importCellStyle( rAttribs );
+    insertCellStyle( xCellStyle );
+    return xCellStyle;
+}
+
+CellStyleRef CellStyleBuffer::importCellStyle( RecordInputStream& rStrm )
+{
+    CellStyleRef xCellStyle( new CellStyle( *this ) );
+    xCellStyle->importCellStyle( rStrm );
+    insertCellStyle( xCellStyle );
+    return xCellStyle;
+}
+
+CellStyleRef CellStyleBuffer::importStyle( BiffInputStream& rStrm )
 {
-    /*  Reserve style names that are built-in in Calc. This causes that
+    CellStyleRef xCellStyle( new CellStyle( *this ) );
+    xCellStyle->importStyle( rStrm );
+    insertCellStyle( xCellStyle );
+    return xCellStyle;
+}
+
+void CellStyleBuffer::finalizeImport()
+{
+    // calculate final names of all styles
+    typedef RefMap< OUString, CellStyle, IgnoreCaseCompare > CellStyleNameMap;
+    CellStyleNameMap aCellStyles;
+    CellStyleVector aConflictNameStyles;
+
+    /*  First, reserve style names that are built-in in Calc. This causes that
         imported cell styles get different unused names and thus do not try to
         overwrite these built-in styles. For BIFF4 workbooks (which contain a
-        separate list of cell styles per sheet), reserve all existing names if
+        separate list of cell styles per sheet), reserve all existing styles if
         current sheet is not the first sheet (this styles buffer will be
         constructed again for every new sheet). This will create unique names
-        for styles in different sheets with the same name. */
+        for styles in different sheets with the same name. Assuming that the
+        BIFF4W import filter is never used to import from clipboard... */
     bool bReserveAll = (getFilterType() == FILTER_BIFF) && (getBiff() == BIFF4) && isWorkbookFile() && (getCurrentSheetIndex() > 0);
     try
     {
-        Reference< XEnumerationAccess > xCellStylesEA( getStyleFamily( false ), UNO_QUERY_THROW );
-        Reference< XEnumeration > xCellStylesEnum( xCellStylesEA->createEnumeration(), UNO_SET_THROW );
-        while( xCellStylesEnum->hasMoreElements() )
+        // unfortunately, com.sun.star.style.StyleFamily does not implement XEnumerationAccess...
+        Reference< XIndexAccess > xStyleFamilyIA( getStyleFamily( false ), UNO_QUERY_THROW );
+        for( sal_Int32 nIndex = 0, nCount = xStyleFamilyIA->getCount(); nIndex < nCount; ++nIndex )
         {
-            Reference< XStyle > xCellStyle( xCellStylesEnum->nextElement(), UNO_QUERY_THROW );
-            if( bReserveAll || !xCellStyle->isUserDefined() )
+            Reference< XStyle > xStyle( xStyleFamilyIA->getByIndex( nIndex ), UNO_QUERY_THROW );
+            if( bReserveAll || !xStyle->isUserDefined() )
             {
-                Reference< XNamed > xCellStyleName( xCellStyle, UNO_QUERY_THROW );
+                Reference< XNamed > xStyleName( xStyle, UNO_QUERY_THROW );
                 // create an empty entry by using ::std::map<>::operator[]
-                maCellStylesByName[ xCellStyleName->getName() ];
+                aCellStyles[ xStyleName->getName() ];
             }
         }
     }
     catch( Exception& )
     {
     }
+
+    /*  Calculate names of built-in styles. Store styles with reserved names
+        in the aConflictNameStyles list. */
+    for( CellStyleVector::iterator aIt = maBuiltinStyles.begin(), aEnd = maBuiltinStyles.end(); aIt != aEnd; ++aIt )
+    {
+        const CellStyleModel& rModel = (*aIt)->getModel();
+        OUString aStyleName = lclGetBuiltinStyleName( rModel.mnBuiltinId, rModel.maName, rModel.mnLevel );
+        OSL_ENSURE( bReserveAll || (aCellStyles.count( aStyleName ) == 0),
+            "CellStyleBuffer::finalizeImport - multiple styles with equal built-in identifier" );
+        if( aCellStyles.count( aStyleName ) > 0 )
+            aConflictNameStyles.push_back( *aIt );
+        else
+            aCellStyles[ aStyleName ] = *aIt;
+    }
+
+    /*  Calculate names of user defined styles. Store styles with reserved
+        names in the aConflictNameStyles list. */
+    for( CellStyleVector::iterator aIt = maUserStyles.begin(), aEnd = maUserStyles.end(); aIt != aEnd; ++aIt )
+    {
+        const CellStyleModel& rModel = (*aIt)->getModel();
+        // #i1624# #i1768# ignore unnamed user styles
+        if( rModel.maName.getLength() > 0 )
+        {
+            if( aCellStyles.count( rModel.maName ) > 0 )
+                aConflictNameStyles.push_back( *aIt );
+            else
+                aCellStyles[ rModel.maName ] = *aIt;
+        }
+    }
+
+    // find unused names for all styles with conflicting names
+    for( CellStyleVector::iterator aIt = aConflictNameStyles.begin(), aEnd = aConflictNameStyles.end(); aIt != aEnd; ++aIt )
+    {
+        const CellStyleModel& rModel = (*aIt)->getModel();
+        OUString aUnusedName;
+        sal_Int32 nIndex = 0;
+        do
+        {
+            aUnusedName = OUStringBuffer( rModel.maName ).append( sal_Unicode( ' ' ) ).append( ++nIndex ).makeStringAndClear();
+        }
+        while( aCellStyles.count( aUnusedName ) > 0 );
+        aCellStyles[ aUnusedName ] = *aIt;
+    }
+
+    // set final names and create user-defined and modified built-in cell styles
+    aCellStyles.forEachMemWithKey( &CellStyle::finalizeImport );
+}
+
+sal_Int32 CellStyleBuffer::getDefaultXfId() const
+{
+    return mxDefStyle.get() ? mxDefStyle->getModel().mnXfId : -1;
+}
+
+OUString CellStyleBuffer::getDefaultStyleName() const
+{
+    return createCellStyle( mxDefStyle );
+}
+
+OUString CellStyleBuffer::createCellStyle( sal_Int32 nXfId ) const
+{
+    return createCellStyle( maStylesByXf.get( nXfId ) );
+}
+
+// private --------------------------------------------------------------------
+
+void CellStyleBuffer::insertCellStyle( CellStyleRef xCellStyle )
+{
+    const CellStyleModel& rModel = xCellStyle->getModel();
+    if( rModel.mnXfId >= 0 )
+    {
+        // insert into the built-in map or user defined map
+        (rModel.isBuiltin() ? maBuiltinStyles : maUserStyles).push_back( xCellStyle );
+
+        // insert into the XF identifier map
+        OSL_ENSURE( maStylesByXf.count( rModel.mnXfId ) == 0, "CellStyleBuffer::insertCellStyle - multiple styles with equal XF identifier" );
+        maStylesByXf[ rModel.mnXfId ] = xCellStyle;
+
+        // remember default cell style
+        if( rModel.isDefaultStyle() )
+            mxDefStyle = xCellStyle;
+    }
+}
+
+OUString CellStyleBuffer::createCellStyle( const CellStyleRef& rxCellStyle ) const
+{
+    if( rxCellStyle.get() )
+    {
+        rxCellStyle->createCellStyle();
+        const OUString& rStyleName = rxCellStyle->getFinalStyleName();
+        if( rStyleName.getLength() > 0 )
+            return rStyleName;
+    }
+    // on error: fallback to default style
+    return lclGetBuiltinStyleName( OOX_STYLE_NORMAL, OUString() );
+}
+
+// ============================================================================
+
+StylesBuffer::StylesBuffer( const WorkbookHelper& rHelper ) :
+    WorkbookHelper( rHelper ),
+    maPalette( rHelper ),
+    maNumFmts( rHelper ),
+    maCellStyles( rHelper )
+{
 }
 
 FontRef StylesBuffer::createFont( sal_Int32* opnFontId )
@@ -2948,10 +3080,7 @@ NumberFormatRef StylesBuffer::importNumFmt( const AttributeList& rAttribs )
 
 CellStyleRef StylesBuffer::importCellStyle( const AttributeList& rAttribs )
 {
-    CellStyleRef xCellStyle( new CellStyle( *this ) );
-    xCellStyle->importCellStyle( rAttribs );
-    insertCellStyle( xCellStyle );
-    return xCellStyle;
+    return maCellStyles.importCellStyle( rAttribs );
 }
 
 void StylesBuffer::importPaletteColor( RecordInputStream& rStrm )
@@ -2966,9 +3095,7 @@ void StylesBuffer::importNumFmt( RecordInputStream& rStrm )
 
 void StylesBuffer::importCellStyle( RecordInputStream& rStrm )
 {
-    CellStyleRef xCellStyle( new CellStyle( *this ) );
-    xCellStyle->importCellStyle( rStrm );
-    insertCellStyle( xCellStyle );
+    maCellStyles.importCellStyle( rStrm );
 }
 
 void StylesBuffer::importPalette( BiffInputStream& rStrm )
@@ -3019,9 +3146,7 @@ void StylesBuffer::importXf( BiffInputStream& rStrm )
 
 void StylesBuffer::importStyle( BiffInputStream& rStrm )
 {
-    CellStyleRef xCellStyle( new CellStyle( *this ) );
-    xCellStyle->importStyle( rStrm );
-    insertCellStyle( xCellStyle );
+    maCellStyles.importStyle( rStrm );
 }
 
 void StylesBuffer::finalizeImport()
@@ -3046,14 +3171,11 @@ void StylesBuffer::finalizeImport()
         maStyleXfs.forEachMem( &Xf::finalizeImport );
     maCellXfs.forEachMem( &Xf::finalizeImport );
 
-    // conditional formatting
-    maDxfs.forEachMem( &Dxf::finalizeImport );
+    // built-in and user defined cell styles
+    maCellStyles.finalizeImport();
 
-    // create the default cell style first
-    if( CellStyle* pDefStyle = maCellStylesById.get( mnDefStyleXf ).get() )
-        pDefStyle->createCellStyle();
-    // create user-defined and modified built-in cell styles
-    maCellStylesById.forEachMem( &CellStyle::finalizeImport );
+    // differential formatting (for conditional formatting)
+    maDxfs.forEachMem( &Dxf::finalizeImport );
 }
 
 sal_Int32 StylesBuffer::getPaletteColor( sal_Int32 nPaletteIdx ) const
@@ -3092,7 +3214,7 @@ FontRef StylesBuffer::getFontFromCellXf( sal_Int32 nXfId ) const
 FontRef StylesBuffer::getDefaultFont() const
 {
     FontRef xDefFont;
-    if( const Xf* pXf = getStyleXf( mnDefStyleXf ).get() )
+    if( const Xf* pXf = getStyleXf( maCellStyles.getDefaultXfId() ).get() )
         xDefFont = pXf->getFont();
     // no font from styles - try first loaded font (e.g. BIFF2)
     if( !xDefFont )
@@ -3107,30 +3229,35 @@ const FontModel& StylesBuffer::getDefaultFontModel() const
     return xDefFont.get() ? xDefFont->getModel() : getTheme().getDefaultFontModel();
 }
 
-const OUString& StylesBuffer::createCellStyle( sal_Int32 nXfId ) const
+OUString StylesBuffer::getDefaultStyleName() const
 {
-    if( CellStyle* pCellStyle = maCellStylesById.get( nXfId ).get() )
-    {
-        pCellStyle->createCellStyle();
-        const OUString& rStyleName = pCellStyle->getFinalStyleName();
-        if( rStyleName.getLength() > 0 )
-            return rStyleName;
-    }
-    // on error: fallback to default style
-    return maDefStyleName;
+    return maCellStyles.getDefaultStyleName();
 }
 
-const OUString& StylesBuffer::createDxfStyle( sal_Int32 nDxfId ) const
+OUString StylesBuffer::createCellStyle( sal_Int32 nXfId ) const
 {
-    if( Dxf* pDxf = maDxfs.get( nDxfId ).get() )
-        return pDxf->createDxfStyle( nDxfId );
-    // on error: fallback to default style
-    return maDefStyleName;
+    return maCellStyles.createCellStyle( nXfId );
 }
 
-const OUString& StylesBuffer::getDefaultStyleName() const
+OUString StylesBuffer::createDxfStyle( sal_Int32 nDxfId ) const
 {
-    return createCellStyle( mnDefStyleXf );
+    OUString& rStyleName = maDxfStyles[ nDxfId ];
+    if( rStyleName.getLength() == 0 )
+    {
+        if( Dxf* pDxf = maDxfs.get( nDxfId ).get() )
+        {
+            rStyleName = OUStringBuffer( CREATE_OUSTRING( "ConditionalStyle_" ) ).append( nDxfId + 1 ).makeStringAndClear();
+            // create the style sheet (this may change rStyleName if such a style already exists)
+            Reference< XStyle > xStyle = createStyleObject( rStyleName, false );
+            // write style formatting properties
+            PropertySet aPropSet( xStyle );
+            pDxf->writeToPropertySet( aPropSet );
+        }
+        // on error: fallback to default style
+        if( rStyleName.getLength() == 0 )
+            rStyleName = maCellStyles.getDefaultStyleName();
+    }
+    return rStyleName;
 }
 
 void StylesBuffer::writeFontToPropertyMap( PropertyMap& rPropMap, sal_Int32 nFontId ) const
@@ -3180,43 +3307,6 @@ void StylesBuffer::writeStyleXfToPropertySet( PropertySet& rPropSet, sal_Int32 n
         pXf->writeToPropertySet( rPropSet );
 }
 
-void StylesBuffer::insertCellStyle( CellStyleRef xCellStyle )
-{
-    sal_Int32 nXfId = xCellStyle->getXfId();
-    OUString aStyleName = xCellStyle->calcInitialStyleName();
-    // #i1624# #i1768# ignore unnamed user styles
-    if( (nXfId >= 0) && (aStyleName.getLength() > 0) )
-    {
-        // insert into the XF identifier map
-        maCellStylesById[ nXfId ] = xCellStyle;
-
-        // find an unused name
-        OUString aUnusedName = aStyleName;
-        sal_Int32 nIndex = 0;
-        while( maCellStylesByName.count( aUnusedName ) > 0 )
-            aUnusedName = OUStringBuffer( aStyleName ).append( sal_Unicode( ' ' ) ).append( ++nIndex ).makeStringAndClear();
-
-        // move old existing style to new unused name, if new style is built-in
-        if( xCellStyle->isBuiltin() && (aStyleName != aUnusedName) )
-        {
-            CellStyleRef& rxCellStyle = maCellStylesByName[ aUnusedName ];
-            rxCellStyle = maCellStylesByName[ aStyleName ];
-            // the entry may be empty if the style name has been reserved in c'tor
-            if( rxCellStyle.get() )
-                rxCellStyle->setFinalStyleName( aUnusedName );
-            aUnusedName = aStyleName;
-        }
-
-        // insert new style
-        maCellStylesByName[ aUnusedName ] = xCellStyle;
-        xCellStyle->setFinalStyleName( aUnusedName );
-
-        // remember XF identifier of default cell style
-        if( xCellStyle->isDefaultStyle() )
-            mnDefStyleXf = nXfId;
-    }
-}
-
 // ============================================================================
 
 } // namespace xls
diff --git a/oox/source/xls/workbookfragment.cxx b/oox/source/xls/workbookfragment.cxx
index 6a78c83..a372ef7 100644
--- a/oox/source/xls/workbookfragment.cxx
+++ b/oox/source/xls/workbookfragment.cxx
@@ -371,7 +371,7 @@ bool BiffWorkbookFragment::importFragment()
                 // try to start a new sheet fragment
                 double fSegmentLength = getProgressBar().getFreeLength() / (nWorksheetCount - nWorksheet);
                 ISegmentProgressBarRef xSheetProgress = getProgressBar().createSegment( fSegmentLength );
-                BiffFragmentType eSheetFragment = startFragment( getBiff() );
+                BiffFragmentType eSheetFragment = startFragment( getBiff(), rWorksheets.getBiffRecordHandle( nWorksheet ) );
                 sal_Int16 nCalcSheet = rWorksheets.getCalcSheetIndex( nWorksheet );
                 bNextSheet = importSheetFragment( *xSheetProgress, eSheetFragment, nCalcSheet );
             }
diff --git a/oox/source/xls/workbookhelper.cxx b/oox/source/xls/workbookhelper.cxx
index 2b33705..39b292a 100644
--- a/oox/source/xls/workbookhelper.cxx
+++ b/oox/source/xls/workbookhelper.cxx
@@ -250,6 +250,15 @@ TimeCount& WorkbookHelper::getTimeCount( TimerType eType ) const
 
 // ============================================================================
 
+bool IgnoreCaseCompare::operator()( const OUString& rName1, const OUString& rName2 ) const
+{
+    // there is no wrapper in rtl::OUString, TODO: compare with collator
+    return ::rtl_ustr_compareIgnoreAsciiCase_WithLength(
+        rName1.getStr(), rName1.getLength(), rName2.getStr(), rName2.getLength() ) < 0;
+}
+
+// ============================================================================
+
 class WorkbookData
 #if OSL_DEBUG_LEVEL > 0
     : public dbg::WorkbookData
diff --git a/oox/source/xls/workbooksettings.cxx b/oox/source/xls/workbooksettings.cxx
index e4de0ff..3473dbc 100644
--- a/oox/source/xls/workbooksettings.cxx
+++ b/oox/source/xls/workbooksettings.cxx
@@ -298,6 +298,8 @@ void WorkbookSettings::finalizeImport()
     // write protection
     if( maFileSharing.mbRecommendReadOnly || (maFileSharing.mnPasswordHash != 0) )
         getBaseFilter().getMediaDescriptor()[ CREATE_OUSTRING( "ReadOnly" ) ] <<= true;
+    if( maFileSharing.mnPasswordHash != 0 )
+        aPropSet.setProperty( PROP_WriteProtectionPassword, static_cast< sal_Int32 >( maFileSharing.mnPasswordHash ) );
 
     // calculation settings
     Date aNullDate = getNullDate();
diff --git a/oox/source/xls/worksheetbuffer.cxx b/oox/source/xls/worksheetbuffer.cxx
index ee24918..5f19fd5 100644
--- a/oox/source/xls/worksheetbuffer.cxx
+++ b/oox/source/xls/worksheetbuffer.cxx
@@ -61,6 +61,7 @@ namespace xls {
 // ============================================================================
 
 SheetInfoModel::SheetInfoModel() :
+    mnBiffHandle( -1 ),
     mnSheetId( -1 ),
     mnState( XML_visible )
 {
@@ -111,19 +112,19 @@ void WorksheetBuffer::importSheet( RecordInputStream& rStrm )
 
 void WorksheetBuffer::importSheet( BiffInputStream& rStrm )
 {
-    sal_uInt16 nState = 0;
+    SheetInfoModel aModel;
     if( getBiff() >= BIFF5 )
     {
-        rStrm.skip( 4 );
-        rStrm >> nState;
+        rStrm.enableDecoder( false );
+        aModel.mnBiffHandle = rStrm.readuInt32();
+        rStrm.enableDecoder( true );
+        sal_uInt16 nState = rStrm.readuInt16();
+        static const sal_Int32 spnStates[] = { XML_visible, XML_hidden, XML_veryHidden };
+        aModel.mnState = STATIC_ARRAY_SELECT( spnStates, nState, XML_visible );
     }
-
-    SheetInfoModel aModel;
     aModel.maName = (getBiff() == BIFF8) ?
         rStrm.readUniStringBody( rStrm.readuInt8() ) :
         rStrm.readByteStringUC( false, getTextEncoding() );
-    static const sal_Int32 spnStates[] = { XML_visible, XML_hidden, XML_veryHidden };
-    aModel.mnState = STATIC_ARRAY_SELECT( spnStates, nState, XML_visible );
     insertSheet( aModel );
 }
 
@@ -143,6 +144,12 @@ OUString WorksheetBuffer::getWorksheetRelId( sal_Int32 nWorksheet ) const
     return pSheetInfo ? pSheetInfo->maRelId : OUString();
 }
 
+sal_Int64 WorksheetBuffer::getBiffRecordHandle( sal_Int32 nWorksheet ) const
+{
+    const SheetInfo* pSheetInfo = maSheetInfos.get( nWorksheet ).get();
+    return pSheetInfo ? pSheetInfo->mnBiffHandle : -1;
+}
+
 sal_Int16 WorksheetBuffer::getCalcSheetIndex( sal_Int32 nWorksheet ) const
 {
     const SheetInfo* pSheetInfo = maSheetInfos.get( nWorksheet ).get();
@@ -250,13 +257,6 @@ void WorksheetBuffer::insertSheet( const SheetInfoModel& rModel )
     maSheetInfosByName[ lclQuoteName( rModel.maName ) ] = xSheetInfo;
 }
 
-bool WorksheetBuffer::SheetNameCompare::operator()( const OUString& rName1, const OUString& rName2 ) const
-{
-    // there is no wrapper in rtl::OUString, TODO: compare with collator
-    return ::rtl_ustr_compareIgnoreAsciiCase_WithLength(
-        rName1.getStr(), rName1.getLength(), rName2.getStr(), rName2.getLength() ) < 0;
-}
-
 // ============================================================================
 
 } // namespace xls
commit 3979f5349241995eede77f75ddaa7cc469198f8c
Author: Kurt Zenker <kz at openoffice.org>
Date:   Fri Oct 2 07:24:56 2009 +0000

    CWS-TOOLING: integrate CWS cmcfixes62_OOO320
    2009-09-22 21:19:24 +0200 cmc  r276365 : #i100000# that's the most plausible explanation, -D$(CVER) is needed by scp2 under windows
    2009-09-19 16:10:36 +0200 cmc  r276303 : #i100000# revert this for no partically good reason
    2009-09-18 14:16:47 +0200 cmc  r276279 : remove extra build depend
    2009-09-18 08:56:15 +0200 cmc  r276265 : #i100000# rerun autoconf
    2009-09-17 14:59:38 +0200 cmc  r276245 : CWS-TOOLING: rebase CWS cmcfixes62 to trunk at 276192 (milestone: DEV300:m59)
    2009-09-10 16:40:49 +0200 pl  r276041 : fix warning
    2009-09-10 11:34:55 +0200 pl  r276026 : disable warning from system header
    2009-09-09 19:30:45 +0200 pl  r276013 : use osl_getAsciiFunctionSymbol instead of strange cast
    2009-09-09 19:25:32 +0200 pl  r276012 : add some casting hacks to make compile on solaris cc
    2009-09-09 19:10:48 +0200 pl  r276009 : add missing Configure option for solaris sparce 32bit
    2009-09-09 18:37:05 +0200 pl  r276008 : merge fix for #i104525# into moved code
    2009-09-07 13:28:08 +0200 cmc  r275894 : CWS-TOOLING: rebase CWS cmcfixes62 to trunk at 275801 (milestone: DEV300:m57)
    2009-08-28 12:36:27 +0200 cmc  r275523 : CWS-TOOLING: rebase CWS cmcfixes62 to trunk at 275331 (milestone: DEV300:m56)
    2009-08-26 12:56:18 +0200 cmc  r275413 : #i104088# use the right headers in the right place
    2009-08-25 17:07:50 +0200 cmc  r275372 : #i104500# make openssl build on linux that isn't x86 or x86_64
    2009-08-25 13:08:48 +0200 cmc  r275347 : #i89237# pretty picswitch up
    2009-08-25 10:58:09 +0200 cmc  r275342 : #i104489# remove last unused code in starmath
    2009-08-25 10:23:33 +0200 cmc  r275338 : #i104088# clean up the define post-move
    2009-08-24 13:46:57 +0200 cmc  r275310 : #i104088# 64bit odbc api changes
    2009-08-24 13:42:52 +0200 cmc  r275309 : #i89237# unify linux platform mks under a generic parent
    2009-08-24 13:19:52 +0200 cmc  r275307 : #i104455# remove unused code
    2009-08-24 13:10:56 +0200 cmc  r275306 : #i104088# 64bit odbc api changes
    2009-08-24 10:07:50 +0200 cmc  r275293 : #i104306# move recent-used to vcl
    2009-08-24 09:32:08 +0200 cmc  r275291 : #i104306# move recent-used to vcl
    2009-08-23 22:01:07 +0200 cmc  r275286 : #i104306# move recently-used to vcl
    2009-08-22 15:25:25 +0200 cmc  r275285 : #i104088# 64bit odbc api changes
    2009-08-21 17:52:40 +0200 cmc  r275268 : #i104306# move recently-used to vcl
    2009-08-21 14:38:26 +0200 cmc  r275257 : #i104408 make these headers ready for c++0x
    2009-08-21 14:20:19 +0200 cmc  r275251 : #i104406# avoid overlapping strcpy to avoid bustage on recent toolchains
    2009-08-21 14:14:25 +0200 cmc  r275250 : #i104385# silence 64bit warnings

diff --git a/binfilter/bf_sfx2/source/doc/sfx2_objstor.cxx b/binfilter/bf_sfx2/source/doc/sfx2_objstor.cxx
index b15ded4..430007b 100644
--- a/binfilter/bf_sfx2/source/doc/sfx2_objstor.cxx
+++ b/binfilter/bf_sfx2/source/doc/sfx2_objstor.cxx
@@ -138,7 +138,6 @@
 #include <unotools/tempfile.hxx>
 #include <ucbhelper/content.hxx>
 #include <sot/storinfo.hxx>
-#include <shell/systemshell.hxx>
 
 #include "objsh.hxx"
 #include "request.hxx"
diff --git a/binfilter/bf_sw/source/core/doc/makefile.mk b/binfilter/bf_sw/source/core/doc/makefile.mk
index ab7e3f1..74ada30 100644
--- a/binfilter/bf_sw/source/core/doc/makefile.mk
+++ b/binfilter/bf_sw/source/core/doc/makefile.mk
@@ -89,10 +89,6 @@ SLOFILES =	\
         $(SLO)$/sw_visiturl.obj \
         $(SLO)$/sw_htmltbl.obj
 
-.IF "$(OS)$(CVER)"=="MACOSXC295"
-SLOFILES += $(SLO)$/sw_gcc_outl.obj
-.ENDIF
-
 # --- Tagets -------------------------------------------------------
 
 .INCLUDE :	target.mk
diff --git a/binfilter/bf_sw/source/core/doc/sw_gcc_outl.cxx b/binfilter/bf_sw/source/core/doc/sw_gcc_outl.cxx
deleted file mode 100644
index 9724757..0000000
--- a/binfilter/bf_sw/source/core/doc/sw_gcc_outl.cxx
+++ /dev/null
@@ -1,347 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- * 
- * Copyright 2008 by Sun Microsystems, Inc.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * $RCSfile: sw_gcc_outl.cxx,v $
- * $Revision: 1.4 $
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org.  If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#include <format.hxx>
-namespace binfilter {
-
-#if ( defined GCC && defined C272 )
-
-#if ( defined SINIX || defined HPUX || defined LINUX )
-const SwFmtCol &SwFmt::GetCol(BOOL bInP) const
-    { return aSet.GetCol(bInP); }
-const SwFmtAnchor &SwFmt::GetAnchor(BOOL bInP) const
-    { return aSet.GetAnchor(bInP); }
-const SwFmtHoriOrient &SwFmt::GetHoriOrient(BOOL bInP) const
-    { return aSet.GetHoriOrient(bInP); }
-const SwFmtSurround &SwFmt::GetSurround(BOOL bInP) const
-    { return aSet.GetSurround(bInP); }
-const SwFmtFooter &SwFmt::GetFooter(BOOL bInP) const
-    { return aSet.GetFooter(bInP); }
-const SwFmtHeader &SwFmt::GetHeader(BOOL bInP) const
-    { return aSet.GetHeader(bInP); }
-const SwFmtFillOrder &SwFmt::GetFillOrder(BOOL bInP) const
-    { return aSet.GetFillOrder(bInP); }
-const SwFmtFrmSize &SwFmt::GetFrmSize(BOOL bInP) const
-    { return aSet.GetFrmSize(bInP); }
-#endif
-#if ( defined HPUX )
-const SvxPaperBinItem &SwFmt::GetPaperBin(BOOL bInP) const
-    { return aSet.GetPaperBin(bInP); }
-const SvxLRSpaceItem &SwFmt::GetLRSpace(BOOL bInP) const
-    { return aSet.GetLRSpace(bInP); }
-const SvxULSpaceItem &SwFmt::GetULSpace(BOOL bInP) const
-    { return aSet.GetULSpace(bInP); }
-const SwFmtCntnt &SwFmt::GetCntnt(BOOL bInP) const
-    { return aSet.GetCntnt(bInP); }
-const SvxPrintItem &SwFmt::GetPrint(BOOL bInP) const
-    { return aSet.GetPrint(bInP); }
-const SvxOpaqueItem &SwFmt::GetOpaque(BOOL bInP) const
-    { return aSet.GetOpaque(bInP); }
-const SvxProtectItem &SwFmt::GetProtect(BOOL bInP) const
-    { return aSet.GetProtect(bInP); }
-const SwFmtVertOrient &SwFmt::GetVertOrient(BOOL bInP) const
-    { return aSet.GetVertOrient(bInP); }
-const SvxBoxItem &SwFmt::GetBox(BOOL bInP) const
-    { return aSet.GetBox(bInP); }
-const SvxFmtKeepItem &SwFmt::GetKeep(BOOL bInP) const
-    { return aSet.GetKeep(bInP); }
-const SvxBrushItem &SwFmt::GetBackground(BOOL bInP) const
-    { return aSet.GetBackground(bInP); }
-const SvxShadowItem &SwFmt::GetShadow(BOOL bInP) const
-    { return aSet.GetShadow(bInP); }
-const SwFmtPageDesc &SwFmt::GetPageDesc(BOOL bInP) const
-    { return aSet.GetPageDesc(bInP); }
-const SvxFmtBreakItem &SwFmt::GetBreak(BOOL bInP) const
-    { return aSet.GetBreak(bInP); }
-const SvxMacroItem &SwFmt::GetMacro(BOOL bInP) const
-    { return aSet.GetMacro(bInP); }
-#endif
-
-#endif
-
-
-#if defined(MACOSX) && ( __GNUC__ < 3 )
-// GrP revisit with gcc3
-
-// fmtfordr.hxx
- const SwFmtFillOrder &SwAttrSet::GetFillOrder(BOOL bInP) const
-    { return (const SwFmtFillOrder&)Get( RES_FILL_ORDER,bInP); }
- const SwFmtFillOrder &SwFmt::GetFillOrder(BOOL bInP) const
-    { return aSet.GetFillOrder(bInP); }
-
-// fmtfsize.hxx
- const SwFmtFrmSize &SwAttrSet::GetFrmSize(BOOL bInP) const
-    { return (const SwFmtFrmSize&)Get( RES_FRM_SIZE,bInP); }
- const SwFmtFrmSize &SwFmt::GetFrmSize(BOOL bInP) const
-    { return aSet.GetFrmSize(bInP); }
-
-// fmtatr.hxx
- const SvxPaperBinItem &SwAttrSet::GetPaperBin(BOOL bInP) const
-    { return (const SvxPaperBinItem&)Get( RES_PAPER_BIN,bInP); }
- const SvxPaperBinItem &SwFmt::GetPaperBin(BOOL bInP) const
-    { return aSet.GetPaperBin(bInP); }
- const SvxLRSpaceItem &SwAttrSet::GetLRSpace(BOOL bInP) const
-    { return (const SvxLRSpaceItem&)Get( RES_LR_SPACE,bInP); }
- const SvxLRSpaceItem &SwFmt::GetLRSpace(BOOL bInP) const
-    { return aSet.GetLRSpace(bInP); }
- const SvxULSpaceItem &SwAttrSet::GetULSpace(BOOL bInP) const
-    { return (const SvxULSpaceItem&)Get( RES_UL_SPACE,bInP); }
- const SvxULSpaceItem &SwFmt::GetULSpace(BOOL bInP) const
-    { return aSet.GetULSpace(bInP); }
-
-// fmtcntnt.hxx
- const SwFmtCntnt &SwAttrSet::GetCntnt(BOOL bInP) const
-    { return (const SwFmtCntnt&)Get( RES_CNTNT,bInP); }
- const SwFmtCntnt &SwFmt::GetCntnt(BOOL bInP) const
-    { return aSet.GetCntnt(bInP); }
-
-// fmthdft.hxx
- const SwFmtHeader &SwAttrSet::GetHeader(BOOL bInP) const
-    { return (const SwFmtHeader&)Get( RES_HEADER,bInP); }
- const SwFmtHeader &SwFmt::GetHeader(BOOL bInP) const
-    { return aSet.GetHeader(bInP); }
- const SwFmtFooter &SwAttrSet::GetFooter(BOOL bInP) const
-    { return (const SwFmtFooter&)Get( RES_FOOTER,bInP); }
- const SwFmtFooter &SwFmt::GetFooter(BOOL bInP) const
-    { return aSet.GetFooter(bInP); }
-
-// fmtatr.hxx
- const SvxPrintItem &SwAttrSet::GetPrint(BOOL bInP) const
-    { return (const SvxPrintItem&)Get( RES_PRINT,bInP); }
- const SvxPrintItem &SwFmt::GetPrint(BOOL bInP) const
-    { return aSet.GetPrint(bInP); }
- const SvxOpaqueItem &SwAttrSet::GetOpaque(BOOL bInP) const
-    { return (const SvxOpaqueItem&)Get( RES_OPAQUE,bInP); }
- const SvxOpaqueItem &SwFmt::GetOpaque(BOOL bInP) const
-    { return aSet.GetOpaque(bInP); }
- const SvxProtectItem &SwAttrSet::GetProtect(BOOL bInP) const
-    { return (const SvxProtectItem&)Get( RES_PROTECT,bInP); }
- const SvxProtectItem &SwFmt::GetProtect(BOOL bInP) const
-    { return aSet.GetProtect(bInP); }
-
-// fmtsrnd.hxx
- const SwFmtSurround &SwAttrSet::GetSurround(BOOL bInP) const
-    { return (const SwFmtSurround&)Get( RES_SURROUND,bInP); }
- const SwFmtSurround &SwFmt::GetSurround(BOOL bInP) const
-    { return aSet.GetSurround(bInP); }
-
-// fmtornt.hxx
- const SwFmtVertOrient &SwAttrSet::GetVertOrient(BOOL bInP) const
-    { return (const SwFmtVertOrient&)Get( RES_VERT_ORIENT,bInP); }
- const SwFmtVertOrient &SwFmt::GetVertOrient(BOOL bInP) const
-    { return aSet.GetVertOrient(bInP); }
- const SwFmtHoriOrient &SwAttrSet::GetHoriOrient(BOOL bInP) const
-    { return (const SwFmtHoriOrient&)Get( RES_HORI_ORIENT,bInP); }
- const SwFmtHoriOrient &SwFmt::GetHoriOrient(BOOL bInP) const
-    { return aSet.GetHoriOrient(bInP); }
-
-// fmtanchr.hxx
-const SwFmtAnchor &SwAttrSet::GetAnchor(BOOL bInP) const
-    { return (const SwFmtAnchor&)Get( RES_ANCHOR,bInP); }
-const SwFmtAnchor &SwFmt::GetAnchor(BOOL bInP) const
-     { return aSet.GetAnchor(bInP); }
-
-// fmtatr.hxx
- const SvxBoxItem &SwAttrSet::GetBox(BOOL bInP) const
-    { return (const SvxBoxItem&)Get( RES_BOX,bInP); }
- const SvxBoxItem &SwFmt::GetBox(BOOL bInP) const
-    { return aSet.GetBox(bInP); }
- const SvxFmtKeepItem &SwAttrSet::GetKeep(BOOL bInP) const
-    { return (const SvxFmtKeepItem&)Get( RES_KEEP,bInP); }
- const SvxFmtKeepItem &SwFmt::GetKeep(BOOL bInP) const
-    { return aSet.GetKeep(bInP); }
- const SvxBrushItem &SwAttrSet::GetBackground(BOOL bInP) const
-    { return (const SvxBrushItem&)Get( RES_BACKGROUND,bInP); }
- const SvxBrushItem &SwFmt::GetBackground(BOOL bInP) const
-    { return aSet.GetBackground(bInP); }
- const SvxShadowItem &SwAttrSet::GetShadow(BOOL bInP) const
-    { return (const SvxShadowItem&)Get( RES_SHADOW,bInP); }
- const SvxShadowItem &SwFmt::GetShadow(BOOL bInP) const
-    { return aSet.GetShadow(bInP); }
-
-// fmtpdsc.hxx
- const SwFmtPageDesc &SwAttrSet::GetPageDesc(BOOL bInP) const
-    { return (const SwFmtPageDesc&)Get( RES_PAGEDESC,bInP); }
- const SwFmtPageDesc &SwFmt::GetPageDesc(BOOL bInP) const
-    { return aSet.GetPageDesc(bInP); }
-
-// fmtatr.hxx
- const SvxFmtBreakItem &SwAttrSet::GetBreak(BOOL bInP) const
-    { return (const SvxFmtBreakItem&)Get( RES_BREAK,bInP); }
- const SvxFmtBreakItem &SwFmt::GetBreak(BOOL bInP) const
-    { return aSet.GetBreak(bInP); }
-
-// fmtclds.hxx
- const SwFmtCol &SwAttrSet::GetCol(BOOL bInP) const
-    { return (const SwFmtCol&)Get( RES_COL,bInP); }
- const SwFmtCol &SwFmt::GetCol(BOOL bInP) const
-    { return aSet.GetCol(bInP); }
-
-// fmtatr.hxx
- const SvxMacroItem &SwAttrSet::GetMacro(BOOL bInP) const
-    { return (const SvxMacroItem&)Get( RES_FRMMACRO,bInP); }
- const SvxMacroItem &SwFmt::GetMacro(BOOL bInP) const
-    { return aSet.GetMacro(bInP); }
-
-// fmturl.hxx
-const SwFmtURL &SwAttrSet::GetURL(BOOL bInP) const
-    { return (const SwFmtURL&)Get( RES_URL,bInP); }
-const SwFmtURL &SwFmt::GetURL(BOOL bInP) const
-    { return aSet.GetURL(bInP); }
-
-// fmteiro.hxx
- const SwFmtEditInReadonly &SwAttrSet::GetEditInReadonly(BOOL bInP) const
-    { return (const SwFmtEditInReadonly&)Get( RES_EDIT_IN_READONLY,bInP); }
- const SwFmtEditInReadonly &SwFmt::GetEditInReadonly(BOOL bInP) const
-    { return aSet.GetEditInReadonly(bInP); }
-
-// fmtlsplt.hxx
- const SwFmtLayoutSplit &SwAttrSet::GetLayoutSplit(BOOL bInP) const
-    { return (const SwFmtLayoutSplit&)Get( RES_LAYOUT_SPLIT,bInP); }
- const SwFmtLayoutSplit &SwFmt::GetLayoutSplit(BOOL bInP) const
-    { return aSet.GetLayoutSplit(bInP); }
-
-// fmtcnct.hxx
-const SwFmtChain &SwAttrSet::GetChain(BOOL bInP) const
-    { return (const SwFmtChain&)Get( RES_CHAIN,bInP); }
-const SwFmtChain &SwFmt::GetChain(BOOL bInP) const
-    { return aSet.GetChain(bInP); }
-
-// fmtline.hxx
- const SwFmtLineNumber &SwAttrSet::GetLineNumber(BOOL bInP) const
-    { return (const SwFmtLineNumber&)Get( RES_LINENUMBER,bInP); }
- const SwFmtLineNumber &SwFmt::GetLineNumber(BOOL bInP) const
-    { return aSet.GetLineNumber(bInP); }
-
-// fmtftntx.hxx
- const SwFmtFtnAtTxtEnd &SwAttrSet::GetFtnAtTxtEnd(BOOL bInP) const
-    { return (const SwFmtFtnAtTxtEnd&)Get( RES_FTN_AT_TXTEND, bInP); }
- const SwFmtFtnAtTxtEnd &SwFmt::GetFtnAtTxtEnd(BOOL bInP) const
-    { return aSet.GetFtnAtTxtEnd(bInP); }
- const SwFmtEndAtTxtEnd &SwAttrSet::GetEndAtTxtEnd(BOOL bInP) const
-    { return (const SwFmtEndAtTxtEnd&)Get( RES_END_AT_TXTEND, bInP); }
- const SwFmtEndAtTxtEnd &SwFmt::GetEndAtTxtEnd(BOOL bInP) const
-    { return aSet.GetEndAtTxtEnd(bInP); }
-
-// fmtclbl.hxx
- const SwFmtNoBalancedColumns &SwAttrSet::GetBalancedColumns(BOOL bInP) const
-    { return (const SwFmtNoBalancedColumns&)Get( RES_COLUMNBALANCE, bInP ); }
- const SwFmtNoBalancedColumns &SwFmt::GetBalancedColumns(BOOL bInP) const
-    { return aSet.GetBalancedColumns( bInP ); }
-
-// grfatr.hxx
- const SwMirrorGrf &SwAttrSet::GetMirrorGrf(BOOL bInP) const
-    { return (const SwMirrorGrf&)Get( RES_GRFATR_MIRRORGRF,bInP); }
- const SwMirrorGrf &SwFmt::GetMirrorGrf(BOOL bInP) const
-    { return aSet.GetMirrorGrf(bInP); }
-
-// cellatr.hxx
- const SwTblBoxNumFormat      &SwAttrSet::GetTblBoxNumFmt(BOOL bInP) const
-    {   return (const SwTblBoxNumFormat&)Get( RES_BOXATR_FORMAT,bInP); }
- const SwTblBoxFormula            &SwAttrSet::GetTblBoxFormula(BOOL bInP) const
-    {   return (const SwTblBoxFormula&)Get( RES_BOXATR_FORMULA,bInP); }
- const SwTblBoxValue                      &SwAttrSet::GetTblBoxValue(BOOL bInP) const
-    {   return (const SwTblBoxValue&)Get( RES_BOXATR_VALUE, bInP); }
- const SwTblBoxNumFormat		&SwFmt::GetTblBoxNumFmt(BOOL bInP) const
-    {   return aSet.GetTblBoxNumFmt(bInP); }
- const SwTblBoxFormula		&SwFmt::GetTblBoxFormula(BOOL bInP) const
-    {   return aSet.GetTblBoxFormula(bInP); }
- const SwTblBoxValue			&SwFmt::GetTblBoxValue(BOOL bInP) const
-    {   return aSet.GetTblBoxValue(bInP); }
-
-// charatr.hxx
- const SvxFontItem         &SwAttrSet::GetFont(BOOL bInP) const
-    {   return (const SvxFontItem&)Get( RES_CHRATR_FONT,bInP); }
- const SvxFontItem             &SwFmt::GetFont(BOOL bInP) const
-    {   return aSet.GetFont(bInP); }
-
-// frmatr.hxx
- const SvxFrameDirectionItem &SwAttrSet::GetFrmDir(BOOL bInP) const
-    { return (const SvxFrameDirectionItem&)Get( RES_FRAMEDIR,bInP); }
- const SvxFrameDirectionItem	&SwFmt::GetFrmDir(BOOL bInP) const
-    { return aSet.GetFrmDir(bInP); }
-        
-#include <node.hxx>
-#include <ndole.hxx>
-#include <ndtxt.hxx>
-#include <ndnotxt.hxx>
-#include <ndgrf.hxx>
-
-/* [ed] 4/27/02 I changed all of the static casts below to dynamic casts.  While
-   debugging swriter, I noticed these functions weren't properly offsetting the
-   pointers to this to upcast the objects.  Instead, they returned the straight
-   pointer to the SwNode instead of the ponter to the start of the record of the
-   appropriate node type. 
-   
-   All of these are essentially trying to just mimic RTTI anyway. */
-   
-// ndole.hxx
- SwOLENode *SwNode::GetOLENode()
-{
-     return ND_OLENODE == nNodeType ? dynamic_cast<SwOLENode *>(this) : 0;
-}
- const SwOLENode *SwNode::GetOLENode() const
-{
-     return ND_OLENODE == nNodeType ? dynamic_cast<const SwOLENode *>(this) : 0;
-}
-
-// ndtxt.hxx
-       SwTxtNode   *SwNode::GetTxtNode()
-{
-     return ND_TEXTNODE == nNodeType ? dynamic_cast<SwTxtNode *>(this) : 0;
-}
- const SwTxtNode   *SwNode::GetTxtNode() const
-{
-     return ND_TEXTNODE == nNodeType ? dynamic_cast<const SwTxtNode *>(this) : 0;
-}
-
-// ndnotxt.hxx
- SwNoTxtNode *SwNode::GetNoTxtNode()
-{
-    return ND_NOTXTNODE & nNodeType ? dynamic_cast<SwNoTxtNode *>(this) : 0;
-}
- const SwNoTxtNode *SwNode::GetNoTxtNode() const
-{
-    return ND_NOTXTNODE & nNodeType ? dynamic_cast<const SwNoTxtNode *>(this) : 0;
-}
-
-// ndgrf.hxx
-       SwGrfNode	 *SwNode::GetGrfNode()
-{
-     return ND_GRFNODE == nNodeType ? dynamic_cast<SwGrfNode *>(this) : 0;
-}
- const SwGrfNode   *SwNode::GetGrfNode() const
-{
-     return ND_GRFNODE == nNodeType ? dynamic_cast<const SwGrfNode *>(this) : 0;
-}
-
-// defined MACOSX
-#endif
-}
diff --git a/binfilter/prj/build.lst b/binfilter/prj/build.lst
index bd82ea9..3007d98 100644
--- a/binfilter/prj/build.lst
+++ b/binfilter/prj/build.lst
@@ -1,4 +1,4 @@
-bf      binfilter :     idl basic goodies xmlscript connectivity framework stoc uui offuh shell NULL
+bf      binfilter :     idl basic goodies xmlscript connectivity framework stoc uui offuh NULL
 bf	binfilter											usr1	-	all	bf_mkout NULL
 bf	binfilter\bf_svtools\source\inc						get		-	all	bf_svt_sinc NULL
 bf  binfilter\bf_svtools\source\config					nmake	-	all bf_svt_config NULL


More information about the ooo-build-commit mailing list