LCOV - code coverage report
Current view: top level - sc/source/filter/xml - XMLTrackedChangesContext.cxx (source / functions) Hit Total Coverage
Test: libreoffice_filtered.info Lines: 0 796 0.0 %
Date: 2012-08-25 Functions: 0 117 0.0 %
Legend: Lines: hit not hit | Branches: + taken - not taken # not executed Branches: 0 1234 0.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                 :            : 
      30                 :            : #include "XMLTrackedChangesContext.hxx"
      31                 :            : #include "xmlimprt.hxx"
      32                 :            : #include "xmlconti.hxx"
      33                 :            : #include "XMLConverter.hxx"
      34                 :            : #include "cell.hxx"
      35                 :            : #include "textuno.hxx"
      36                 :            : #include "editutil.hxx"
      37                 :            : #include <xmloff/xmltoken.hxx>
      38                 :            : #include <xmloff/xmlnmspe.hxx>
      39                 :            : #include <xmloff/nmspmap.hxx>
      40                 :            : #include <xmloff/xmluconv.hxx>
      41                 :            : #include <sax/tools/converter.hxx>
      42                 :            : #include <svl/zforlist.hxx>
      43                 :            : #include <com/sun/star/text/XTextCursor.hpp>
      44                 :            : #include <com/sun/star/text/ControlCharacter.hpp>
      45                 :            : 
      46                 :            : using rtl::OUString;
      47                 :            : using namespace com::sun::star;
      48                 :            : using namespace xmloff::token;
      49                 :            : 
      50                 :            : using rtl::OUString;
      51                 :            : 
      52                 :            : //-----------------------------------------------------------------------------
      53                 :            : 
      54                 :            : class ScXMLChangeInfoContext : public SvXMLImportContext
      55                 :            : {
      56                 :            :     ScMyActionInfo                      aInfo;
      57                 :            :     ::rtl::OUStringBuffer               sAuthorBuffer;
      58                 :            :     ::rtl::OUStringBuffer               sDateTimeBuffer;
      59                 :            :     ::rtl::OUStringBuffer               sCommentBuffer;
      60                 :            :     ScXMLChangeTrackingImportHelper*    pChangeTrackingImportHelper;
      61                 :            :     sal_uInt32                          nParagraphCount;
      62                 :            : 
      63                 :            :     const ScXMLImport& GetScImport() const { return (const ScXMLImport&)GetImport(); }
      64                 :          0 :     ScXMLImport& GetScImport() { return (ScXMLImport&)GetImport(); }
      65                 :            : 
      66                 :            : public:
      67                 :            :     ScXMLChangeInfoContext( ScXMLImport& rImport, sal_uInt16 nPrfx, const ::rtl::OUString& rLName,
      68                 :            :                                       const ::com::sun::star::uno::Reference<
      69                 :            :                                       ::com::sun::star::xml::sax::XAttributeList>& xAttrList,
      70                 :            :                                       ScXMLChangeTrackingImportHelper* pChangeTrackingImportHelper);
      71                 :            :     virtual ~ScXMLChangeInfoContext();
      72                 :            : 
      73                 :            :     virtual SvXMLImportContext *CreateChildContext( sal_uInt16 nPrefix,
      74                 :            :                                                     const ::rtl::OUString& rLocalName,
      75                 :            :                                                     const ::com::sun::star::uno::Reference<
      76                 :            :                                           ::com::sun::star::xml::sax::XAttributeList>& xAttrList );
      77                 :            : 
      78                 :            :     virtual void EndElement();
      79                 :            : };
      80                 :            : 
      81                 :            : //-----------------------------------------------------------------------------
      82                 :            : 
      83                 :            : class ScXMLBigRangeContext : public SvXMLImportContext
      84                 :            : {
      85                 :            :     ScBigRange&         rBigRange;
      86                 :            : 
      87                 :            :     const ScXMLImport& GetScImport() const { return (const ScXMLImport&)GetImport(); }
      88                 :          0 :     ScXMLImport& GetScImport() { return (ScXMLImport&)GetImport(); }
      89                 :            : 
      90                 :            : public:
      91                 :            :     ScXMLBigRangeContext( ScXMLImport& rImport, sal_uInt16 nPrfx, const ::rtl::OUString& rLName,
      92                 :            :                                       const ::com::sun::star::uno::Reference<
      93                 :            :                                       ::com::sun::star::xml::sax::XAttributeList>& xAttrList,
      94                 :            :                                       ScBigRange& rBigRange);
      95                 :            :     virtual ~ScXMLBigRangeContext();
      96                 :            : 
      97                 :            :     virtual SvXMLImportContext *CreateChildContext( sal_uInt16 nPrefix,
      98                 :            :                                                     const ::rtl::OUString& rLocalName,
      99                 :            :                                                     const ::com::sun::star::uno::Reference<
     100                 :            :                                           ::com::sun::star::xml::sax::XAttributeList>& xAttrList );
     101                 :            : 
     102                 :            :     virtual void EndElement();
     103                 :            : };
     104                 :            : 
     105                 :            : //-----------------------------------------------------------------------------
     106                 :            : 
     107                 :            : class ScXMLCellContentDeletionContext : public SvXMLImportContext
     108                 :            : {
     109                 :            :     rtl::OUString                       sFormulaAddress;
     110                 :            :     rtl::OUString                       sFormula;
     111                 :            :     rtl::OUString                       sFormulaNmsp;
     112                 :            :     rtl::OUString                       sInputString;
     113                 :            :     ScBigRange                          aBigRange;
     114                 :            :     double                              fValue;
     115                 :            :     ScXMLChangeTrackingImportHelper*    pChangeTrackingImportHelper;
     116                 :            :     ScBaseCell*                         pCell;
     117                 :            :     sal_uInt32                          nID;
     118                 :            :     sal_Int32                           nMatrixCols;
     119                 :            :     sal_Int32                           nMatrixRows;
     120                 :            :     formula::FormulaGrammar::Grammar                  eGrammar;
     121                 :            :     sal_uInt16                          nType;
     122                 :            :     sal_uInt8                           nMatrixFlag;
     123                 :            :     sal_Bool                            bBigRange;
     124                 :            :     sal_Bool                            bContainsCell;
     125                 :            : 
     126                 :            :     const ScXMLImport& GetScImport() const { return (const ScXMLImport&)GetImport(); }
     127                 :          0 :     ScXMLImport& GetScImport() { return (ScXMLImport&)GetImport(); }
     128                 :            : 
     129                 :            : public:
     130                 :            :     ScXMLCellContentDeletionContext( ScXMLImport& rImport, sal_uInt16 nPrfx, const ::rtl::OUString& rLName,
     131                 :            :                                       const ::com::sun::star::uno::Reference<
     132                 :            :                                       ::com::sun::star::xml::sax::XAttributeList>& xAttrList,
     133                 :            :                                       ScXMLChangeTrackingImportHelper* pChangeTrackingImportHelper);
     134                 :            :     virtual ~ScXMLCellContentDeletionContext();
     135                 :            : 
     136                 :            :     virtual SvXMLImportContext *CreateChildContext( sal_uInt16 nPrefix,
     137                 :            :                                                     const ::rtl::OUString& rLocalName,
     138                 :            :                                                     const ::com::sun::star::uno::Reference<
     139                 :            :                                           ::com::sun::star::xml::sax::XAttributeList>& xAttrList );
     140                 :            : 
     141                 :            :     virtual void EndElement();
     142                 :            : };
     143                 :            : 
     144                 :            : //-----------------------------------------------------------------------------
     145                 :            : 
     146                 :            : class ScXMLDependenceContext : public SvXMLImportContext
     147                 :            : {
     148                 :            :     ScXMLChangeTrackingImportHelper*    pChangeTrackingImportHelper;
     149                 :            : 
     150                 :            :     const ScXMLImport& GetScImport() const { return (const ScXMLImport&)GetImport(); }
     151                 :          0 :     ScXMLImport& GetScImport() { return (ScXMLImport&)GetImport(); }
     152                 :            : 
     153                 :            : public:
     154                 :            :     ScXMLDependenceContext( ScXMLImport& rImport, sal_uInt16 nPrfx, const ::rtl::OUString& rLName,
     155                 :            :                                       const ::com::sun::star::uno::Reference<
     156                 :            :                                       ::com::sun::star::xml::sax::XAttributeList>& xAttrList,
     157                 :            :                                       ScXMLChangeTrackingImportHelper* pChangeTrackingImportHelper);
     158                 :            :     virtual ~ScXMLDependenceContext();
     159                 :            : 
     160                 :            :     virtual SvXMLImportContext *CreateChildContext( sal_uInt16 nPrefix,
     161                 :            :                                                     const ::rtl::OUString& rLocalName,
     162                 :            :                                                     const ::com::sun::star::uno::Reference<
     163                 :            :                                           ::com::sun::star::xml::sax::XAttributeList>& xAttrList );
     164                 :            : 
     165                 :            :     virtual void EndElement();
     166                 :            : };
     167                 :            : 
     168                 :            : //-----------------------------------------------------------------------------
     169                 :            : 
     170                 :            : class ScXMLDependingsContext : public SvXMLImportContext
     171                 :            : {
     172                 :            :     ScXMLChangeTrackingImportHelper*    pChangeTrackingImportHelper;
     173                 :            : 
     174                 :            :     const ScXMLImport& GetScImport() const { return (const ScXMLImport&)GetImport(); }
     175                 :          0 :     ScXMLImport& GetScImport() { return (ScXMLImport&)GetImport(); }
     176                 :            : 
     177                 :            : public:
     178                 :            :     ScXMLDependingsContext( ScXMLImport& rImport, sal_uInt16 nPrfx, const ::rtl::OUString& rLName,
     179                 :            :                                       const ::com::sun::star::uno::Reference<
     180                 :            :                                       ::com::sun::star::xml::sax::XAttributeList>& xAttrList,
     181                 :            :                                       ScXMLChangeTrackingImportHelper* pChangeTrackingImportHelper);
     182                 :            :     virtual ~ScXMLDependingsContext();
     183                 :            : 
     184                 :            :     virtual SvXMLImportContext *CreateChildContext( sal_uInt16 nPrefix,
     185                 :            :                                                     const ::rtl::OUString& rLocalName,
     186                 :            :                                                     const ::com::sun::star::uno::Reference<
     187                 :            :                                           ::com::sun::star::xml::sax::XAttributeList>& xAttrList );
     188                 :            : 
     189                 :            :     virtual void EndElement();
     190                 :            : };
     191                 :            : 
     192                 :            : //-----------------------------------------------------------------------------
     193                 :            : 
     194                 :            : class ScXMLChangeDeletionContext : public SvXMLImportContext
     195                 :            : {
     196                 :            :     ScXMLChangeTrackingImportHelper*    pChangeTrackingImportHelper;
     197                 :            : 
     198                 :            :     const ScXMLImport& GetScImport() const { return (const ScXMLImport&)GetImport(); }
     199                 :          0 :     ScXMLImport& GetScImport() { return (ScXMLImport&)GetImport(); }
     200                 :            : 
     201                 :            : public:
     202                 :            :     ScXMLChangeDeletionContext( ScXMLImport& rImport, sal_uInt16 nPrfx, const ::rtl::OUString& rLName,
     203                 :            :                                       const ::com::sun::star::uno::Reference<
     204                 :            :                                       ::com::sun::star::xml::sax::XAttributeList>& xAttrList,
     205                 :            :                                       ScXMLChangeTrackingImportHelper* pChangeTrackingImportHelper);
     206                 :            :     virtual ~ScXMLChangeDeletionContext();
     207                 :            : 
     208                 :            :     virtual SvXMLImportContext *CreateChildContext( sal_uInt16 nPrefix,
     209                 :            :                                                     const ::rtl::OUString& rLocalName,
     210                 :            :                                                     const ::com::sun::star::uno::Reference<
     211                 :            :                                           ::com::sun::star::xml::sax::XAttributeList>& xAttrList );
     212                 :            : 
     213                 :            :     virtual void EndElement();
     214                 :            : };
     215                 :            : 
     216                 :            : //-----------------------------------------------------------------------------
     217                 :            : 
     218                 :            : class ScXMLDeletionsContext : public SvXMLImportContext
     219                 :            : {
     220                 :            :     ScXMLChangeTrackingImportHelper*    pChangeTrackingImportHelper;
     221                 :            : 
     222                 :            :     const ScXMLImport& GetScImport() const { return (const ScXMLImport&)GetImport(); }
     223                 :          0 :     ScXMLImport& GetScImport() { return (ScXMLImport&)GetImport(); }
     224                 :            : 
     225                 :            : public:
     226                 :            :     ScXMLDeletionsContext( ScXMLImport& rImport, sal_uInt16 nPrfx, const ::rtl::OUString& rLName,
     227                 :            :                                       const ::com::sun::star::uno::Reference<
     228                 :            :                                       ::com::sun::star::xml::sax::XAttributeList>& xAttrList,
     229                 :            :                                       ScXMLChangeTrackingImportHelper* pChangeTrackingImportHelper);
     230                 :            :     virtual ~ScXMLDeletionsContext();
     231                 :            : 
     232                 :            :     virtual SvXMLImportContext *CreateChildContext( sal_uInt16 nPrefix,
     233                 :            :                                                     const ::rtl::OUString& rLocalName,
     234                 :            :                                                     const ::com::sun::star::uno::Reference<
     235                 :            :                                           ::com::sun::star::xml::sax::XAttributeList>& xAttrList );
     236                 :            : 
     237                 :            :     virtual void EndElement();
     238                 :            : };
     239                 :            : 
     240                 :            : //-----------------------------------------------------------------------------
     241                 :            : 
     242                 :            : class ScXMLChangeCellContext;
     243                 :            : 
     244                 :            : class ScXMLChangeTextPContext : public SvXMLImportContext
     245                 :            : {
     246                 :            :     ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XAttributeList> xAttrList;
     247                 :            :     rtl::OUString               sLName;
     248                 :            :     rtl::OUStringBuffer         sText;
     249                 :            :     ScXMLChangeCellContext*     pChangeCellContext;
     250                 :            :     SvXMLImportContext*         pTextPContext;
     251                 :            :     sal_uInt16                      nPrefix;
     252                 :            : 
     253                 :            :     const ScXMLImport& GetScImport() const { return (const ScXMLImport&)GetImport(); }
     254                 :          0 :     ScXMLImport& GetScImport() { return (ScXMLImport&)GetImport(); }
     255                 :            : 
     256                 :            : public:
     257                 :            : 
     258                 :            :     ScXMLChangeTextPContext( ScXMLImport& rImport, sal_uInt16 nPrfx,
     259                 :            :                        const ::rtl::OUString& rLName,
     260                 :            :                        const ::com::sun::star::uno::Reference<
     261                 :            :                                         ::com::sun::star::xml::sax::XAttributeList>& xAttrList,
     262                 :            :                         ScXMLChangeCellContext* pChangeCellContext);
     263                 :            : 
     264                 :            :     virtual ~ScXMLChangeTextPContext();
     265                 :            : 
     266                 :            :     virtual SvXMLImportContext *CreateChildContext( sal_uInt16 nPrefix,
     267                 :            :                                      const ::rtl::OUString& rLocalName,
     268                 :            :                                      const ::com::sun::star::uno::Reference<
     269                 :            :                                           ::com::sun::star::xml::sax::XAttributeList>& xAttrList );
     270                 :            : 
     271                 :            :     virtual void Characters( const ::rtl::OUString& rChars );
     272                 :            : 
     273                 :            :     virtual void EndElement();
     274                 :            : };
     275                 :            : 
     276                 :            : //-----------------------------------------------------------------------------
     277                 :            : 
     278                 :            : class ScXMLChangeCellContext : public SvXMLImportContext
     279                 :            : {
     280                 :            :     rtl::OUString           sText;
     281                 :            :     rtl::OUString&          rInputString;
     282                 :            :     ScBaseCell*&            rOldCell;
     283                 :            :     ScEditEngineTextObj*    pEditTextObj;
     284                 :            :     double&                 rDateTimeValue;
     285                 :            :     double                  fValue;
     286                 :            :     sal_uInt16&             rType;
     287                 :            :     sal_Bool                bEmpty;
     288                 :            :     sal_Bool                bFirstParagraph;
     289                 :            :     sal_Bool                bString;
     290                 :            :     sal_Bool                bFormula;
     291                 :            : 
     292                 :            :     const ScXMLImport& GetScImport() const { return (const ScXMLImport&)GetImport(); }
     293                 :          0 :     ScXMLImport& GetScImport() { return (ScXMLImport&)GetImport(); }
     294                 :            : 
     295                 :            : public:
     296                 :            :     ScXMLChangeCellContext( ScXMLImport& rImport, sal_uInt16 nPrfx, const ::rtl::OUString& rLName,
     297                 :            :                                       const ::com::sun::star::uno::Reference<
     298                 :            :                                       ::com::sun::star::xml::sax::XAttributeList>& xAttrList,
     299                 :            :                                       ScBaseCell*& rOldCell, rtl::OUString& sAddress,
     300                 :            :                                       rtl::OUString& rFormula, rtl::OUString& rFormulaNmsp,
     301                 :            :                                       formula::FormulaGrammar::Grammar& rGrammar,
     302                 :            :                                       rtl::OUString& rInputString, double& fValue, sal_uInt16& nType,
     303                 :            :                                       sal_uInt8& nMatrixFlag, sal_Int32& nMatrixCols, sal_Int32& nMatrixRows);
     304                 :            :     virtual ~ScXMLChangeCellContext();
     305                 :            : 
     306                 :            :     virtual SvXMLImportContext *CreateChildContext( sal_uInt16 nPrefix,
     307                 :            :                                                     const ::rtl::OUString& rLocalName,
     308                 :            :                                                     const ::com::sun::star::uno::Reference<
     309                 :            :                                           ::com::sun::star::xml::sax::XAttributeList>& xAttrList );
     310                 :            : 
     311                 :            :     void CreateTextPContext(sal_Bool bIsNewParagraph);
     312                 :          0 :     sal_Bool IsEditCell() { return pEditTextObj != 0; }
     313                 :          0 :     void SetText(const rtl::OUString& sTempText) { sText = sTempText; }
     314                 :            : 
     315                 :            :     virtual void EndElement();
     316                 :            : };
     317                 :            : 
     318                 :            : //-----------------------------------------------------------------------------
     319                 :            : 
     320                 :            : class ScXMLPreviousContext : public SvXMLImportContext
     321                 :            : {
     322                 :            :     rtl::OUString                       sFormulaAddress;
     323                 :            :     rtl::OUString                       sFormula;
     324                 :            :     rtl::OUString                       sFormulaNmsp;
     325                 :            :     rtl::OUString                       sInputString;
     326                 :            :     double                              fValue;
     327                 :            :     ScXMLChangeTrackingImportHelper*    pChangeTrackingImportHelper;
     328                 :            :     ScBaseCell*                         pOldCell;
     329                 :            :     sal_uInt32                          nID;
     330                 :            :     sal_Int32                           nMatrixCols;
     331                 :            :     sal_Int32                           nMatrixRows;
     332                 :            :     formula::FormulaGrammar::Grammar    eGrammar;
     333                 :            :     sal_uInt16                          nType;
     334                 :            :     sal_uInt8                           nMatrixFlag;
     335                 :            : 
     336                 :            :     const ScXMLImport& GetScImport() const { return (const ScXMLImport&)GetImport(); }
     337                 :          0 :     ScXMLImport& GetScImport() { return (ScXMLImport&)GetImport(); }
     338                 :            : 
     339                 :            : public:
     340                 :            :     ScXMLPreviousContext( ScXMLImport& rImport, sal_uInt16 nPrfx, const ::rtl::OUString& rLName,
     341                 :            :                                       const ::com::sun::star::uno::Reference<
     342                 :            :                                       ::com::sun::star::xml::sax::XAttributeList>& xAttrList,
     343                 :            :                                       ScXMLChangeTrackingImportHelper* pChangeTrackingImportHelper);
     344                 :            :     virtual ~ScXMLPreviousContext();
     345                 :            : 
     346                 :            :     virtual SvXMLImportContext *CreateChildContext( sal_uInt16 nPrefix,
     347                 :            :                                                     const ::rtl::OUString& rLocalName,
     348                 :            :                                                     const ::com::sun::star::uno::Reference<
     349                 :            :                                           ::com::sun::star::xml::sax::XAttributeList>& xAttrList );
     350                 :            : 
     351                 :            :     virtual void EndElement();
     352                 :            : };
     353                 :            : 
     354                 :            : //-----------------------------------------------------------------------------
     355                 :            : 
     356                 :            : class ScXMLContentChangeContext : public SvXMLImportContext
     357                 :            : {
     358                 :            :     ScXMLChangeTrackingImportHelper*    pChangeTrackingImportHelper;
     359                 :            :     ScBigRange                          aBigRange;
     360                 :            : 
     361                 :            :     const ScXMLImport& GetScImport() const { return (const ScXMLImport&)GetImport(); }
     362                 :          0 :     ScXMLImport& GetScImport() { return (ScXMLImport&)GetImport(); }
     363                 :            : 
     364                 :            : public:
     365                 :            :     ScXMLContentChangeContext( ScXMLImport& rImport, sal_uInt16 nPrfx, const ::rtl::OUString& rLName,
     366                 :            :                                       const ::com::sun::star::uno::Reference<
     367                 :            :                                       ::com::sun::star::xml::sax::XAttributeList>& xAttrList,
     368                 :            :                                       ScXMLChangeTrackingImportHelper* pChangeTrackingImportHelper);
     369                 :            :     virtual ~ScXMLContentChangeContext();
     370                 :            : 
     371                 :            :     virtual SvXMLImportContext *CreateChildContext( sal_uInt16 nPrefix,
     372                 :            :                                                     const ::rtl::OUString& rLocalName,
     373                 :            :                                                     const ::com::sun::star::uno::Reference<
     374                 :            :                                           ::com::sun::star::xml::sax::XAttributeList>& xAttrList );
     375                 :            :     virtual void EndElement();
     376                 :            : };
     377                 :            : 
     378                 :            : //-----------------------------------------------------------------------------
     379                 :            : 
     380                 :            : class ScXMLInsertionContext : public SvXMLImportContext
     381                 :            : {
     382                 :            :     ScXMLChangeTrackingImportHelper*    pChangeTrackingImportHelper;
     383                 :            : 
     384                 :            :     const ScXMLImport& GetScImport() const { return (const ScXMLImport&)GetImport(); }
     385                 :          0 :     ScXMLImport& GetScImport() { return (ScXMLImport&)GetImport(); }
     386                 :            : 
     387                 :            : public:
     388                 :            :     ScXMLInsertionContext( ScXMLImport& rImport, sal_uInt16 nPrfx, const ::rtl::OUString& rLName,
     389                 :            :                                       const ::com::sun::star::uno::Reference<
     390                 :            :                                       ::com::sun::star::xml::sax::XAttributeList>& xAttrList,
     391                 :            :                                       ScXMLChangeTrackingImportHelper* pChangeTrackingImportHelper);
     392                 :            :     virtual ~ScXMLInsertionContext();
     393                 :            : 
     394                 :            :     virtual SvXMLImportContext *CreateChildContext( sal_uInt16 nPrefix,
     395                 :            :                                                     const ::rtl::OUString& rLocalName,
     396                 :            :                                                     const ::com::sun::star::uno::Reference<
     397                 :            :                                           ::com::sun::star::xml::sax::XAttributeList>& xAttrList );
     398                 :            :     virtual void EndElement();
     399                 :            : };
     400                 :            : 
     401                 :            : //-----------------------------------------------------------------------------
     402                 :            : 
     403                 :            : class ScXMLInsertionCutOffContext : public SvXMLImportContext
     404                 :            : {
     405                 :            :     ScXMLChangeTrackingImportHelper*    pChangeTrackingImportHelper;
     406                 :            : 
     407                 :            :     const ScXMLImport& GetScImport() const { return (const ScXMLImport&)GetImport(); }
     408                 :          0 :     ScXMLImport& GetScImport() { return (ScXMLImport&)GetImport(); }
     409                 :            : 
     410                 :            : public:
     411                 :            :     ScXMLInsertionCutOffContext( ScXMLImport& rImport, sal_uInt16 nPrfx, const ::rtl::OUString& rLName,
     412                 :            :                                       const ::com::sun::star::uno::Reference<
     413                 :            :                                       ::com::sun::star::xml::sax::XAttributeList>& xAttrList,
     414                 :            :                                       ScXMLChangeTrackingImportHelper* pChangeTrackingImportHelper);
     415                 :            :     virtual ~ScXMLInsertionCutOffContext();
     416                 :            : 
     417                 :            :     virtual SvXMLImportContext *CreateChildContext( sal_uInt16 nPrefix,
     418                 :            :                                                     const ::rtl::OUString& rLocalName,
     419                 :            :                                                     const ::com::sun::star::uno::Reference<
     420                 :            :                                           ::com::sun::star::xml::sax::XAttributeList>& xAttrList );
     421                 :            :     virtual void EndElement();
     422                 :            : };
     423                 :            : 
     424                 :            : //-----------------------------------------------------------------------------
     425                 :            : 
     426                 :            : class ScXMLMovementCutOffContext : public SvXMLImportContext
     427                 :            : {
     428                 :            :     ScXMLChangeTrackingImportHelper*    pChangeTrackingImportHelper;
     429                 :            : 
     430                 :            :     const ScXMLImport& GetScImport() const { return (const ScXMLImport&)GetImport(); }
     431                 :          0 :     ScXMLImport& GetScImport() { return (ScXMLImport&)GetImport(); }
     432                 :            : 
     433                 :            : public:
     434                 :            :     ScXMLMovementCutOffContext( ScXMLImport& rImport, sal_uInt16 nPrfx, const ::rtl::OUString& rLName,
     435                 :            :                                       const ::com::sun::star::uno::Reference<
     436                 :            :                                       ::com::sun::star::xml::sax::XAttributeList>& xAttrList,
     437                 :            :                                       ScXMLChangeTrackingImportHelper* pChangeTrackingImportHelper);
     438                 :            :     virtual ~ScXMLMovementCutOffContext();
     439                 :            : 
     440                 :            :     virtual SvXMLImportContext *CreateChildContext( sal_uInt16 nPrefix,
     441                 :            :                                                     const ::rtl::OUString& rLocalName,
     442                 :            :                                                     const ::com::sun::star::uno::Reference<
     443                 :            :                                           ::com::sun::star::xml::sax::XAttributeList>& xAttrList );
     444                 :            :     virtual void EndElement();
     445                 :            : };
     446                 :            : 
     447                 :            : //-----------------------------------------------------------------------------
     448                 :            : 
     449                 :            : class ScXMLCutOffsContext : public SvXMLImportContext
     450                 :            : {
     451                 :            :     ScXMLChangeTrackingImportHelper*    pChangeTrackingImportHelper;
     452                 :            : 
     453                 :            :     const ScXMLImport& GetScImport() const { return (const ScXMLImport&)GetImport(); }
     454                 :          0 :     ScXMLImport& GetScImport() { return (ScXMLImport&)GetImport(); }
     455                 :            : 
     456                 :            : public:
     457                 :            :     ScXMLCutOffsContext( ScXMLImport& rImport, sal_uInt16 nPrfx, const ::rtl::OUString& rLName,
     458                 :            :                                       const ::com::sun::star::uno::Reference<
     459                 :            :                                       ::com::sun::star::xml::sax::XAttributeList>& xAttrList,
     460                 :            :                                       ScXMLChangeTrackingImportHelper* pChangeTrackingImportHelper);
     461                 :            :     virtual ~ScXMLCutOffsContext();
     462                 :            : 
     463                 :            :     virtual SvXMLImportContext *CreateChildContext( sal_uInt16 nPrefix,
     464                 :            :                                                     const ::rtl::OUString& rLocalName,
     465                 :            :                                                     const ::com::sun::star::uno::Reference<
     466                 :            :                                           ::com::sun::star::xml::sax::XAttributeList>& xAttrList );
     467                 :            :     virtual void EndElement();
     468                 :            : };
     469                 :            : 
     470                 :            : //-----------------------------------------------------------------------------
     471                 :            : 
     472                 :            : class ScXMLDeletionContext : public SvXMLImportContext
     473                 :            : {
     474                 :            :     ScXMLChangeTrackingImportHelper*    pChangeTrackingImportHelper;
     475                 :            : 
     476                 :            :     const ScXMLImport& GetScImport() const { return (const ScXMLImport&)GetImport(); }
     477                 :          0 :     ScXMLImport& GetScImport() { return (ScXMLImport&)GetImport(); }
     478                 :            : 
     479                 :            : public:
     480                 :            :     ScXMLDeletionContext( ScXMLImport& rImport, sal_uInt16 nPrfx, const ::rtl::OUString& rLName,
     481                 :            :                                       const ::com::sun::star::uno::Reference<
     482                 :            :                                       ::com::sun::star::xml::sax::XAttributeList>& xAttrList,
     483                 :            :                                       ScXMLChangeTrackingImportHelper* pChangeTrackingImportHelper);
     484                 :            :     virtual ~ScXMLDeletionContext();
     485                 :            : 
     486                 :            :     virtual SvXMLImportContext *CreateChildContext( sal_uInt16 nPrefix,
     487                 :            :                                                     const ::rtl::OUString& rLocalName,
     488                 :            :                                                     const ::com::sun::star::uno::Reference<
     489                 :            :                                           ::com::sun::star::xml::sax::XAttributeList>& xAttrList );
     490                 :            :     virtual void EndElement();
     491                 :            : };
     492                 :            : 
     493                 :            : //-----------------------------------------------------------------------------
     494                 :            : 
     495                 :            : class ScXMLMovementContext : public SvXMLImportContext
     496                 :            : {
     497                 :            :     ScBigRange                          aSourceRange;
     498                 :            :     ScBigRange                          aTargetRange;
     499                 :            :     ScXMLChangeTrackingImportHelper*    pChangeTrackingImportHelper;
     500                 :            : 
     501                 :            :     const ScXMLImport& GetScImport() const { return (const ScXMLImport&)GetImport(); }
     502                 :          0 :     ScXMLImport& GetScImport() { return (ScXMLImport&)GetImport(); }
     503                 :            : 
     504                 :            : public:
     505                 :            :     ScXMLMovementContext( ScXMLImport& rImport, sal_uInt16 nPrfx, const ::rtl::OUString& rLName,
     506                 :            :                                       const ::com::sun::star::uno::Reference<
     507                 :            :                                       ::com::sun::star::xml::sax::XAttributeList>& xAttrList,
     508                 :            :                                       ScXMLChangeTrackingImportHelper* pChangeTrackingImportHelper);
     509                 :            :     virtual ~ScXMLMovementContext();
     510                 :            : 
     511                 :            :     virtual SvXMLImportContext *CreateChildContext( sal_uInt16 nPrefix,
     512                 :            :                                                     const ::rtl::OUString& rLocalName,
     513                 :            :                                                     const ::com::sun::star::uno::Reference<
     514                 :            :                                           ::com::sun::star::xml::sax::XAttributeList>& xAttrList );
     515                 :            :     virtual void EndElement();
     516                 :            : };
     517                 :            : 
     518                 :            : //-----------------------------------------------------------------------------
     519                 :            : 
     520                 :            : class ScXMLRejectionContext : public SvXMLImportContext
     521                 :            : {
     522                 :            :     ScXMLChangeTrackingImportHelper*    pChangeTrackingImportHelper;
     523                 :            : 
     524                 :            :     const ScXMLImport& GetScImport() const { return (const ScXMLImport&)GetImport(); }
     525                 :          0 :     ScXMLImport& GetScImport() { return (ScXMLImport&)GetImport(); }
     526                 :            : 
     527                 :            : public:
     528                 :            :     ScXMLRejectionContext( ScXMLImport& rImport, sal_uInt16 nPrfx, const ::rtl::OUString& rLName,
     529                 :            :                                       const ::com::sun::star::uno::Reference<
     530                 :            :                                       ::com::sun::star::xml::sax::XAttributeList>& xAttrList,
     531                 :            :                                       ScXMLChangeTrackingImportHelper* pChangeTrackingImportHelper);
     532                 :            :     virtual ~ScXMLRejectionContext();
     533                 :            : 
     534                 :            :     virtual SvXMLImportContext *CreateChildContext( sal_uInt16 nPrefix,
     535                 :            :                                                     const ::rtl::OUString& rLocalName,
     536                 :            :                                                     const ::com::sun::star::uno::Reference<
     537                 :            :                                           ::com::sun::star::xml::sax::XAttributeList>& xAttrList );
     538                 :            :     virtual void EndElement();
     539                 :            : };
     540                 :            : 
     541                 :            : //------------------------------------------------------------------
     542                 :            : 
     543                 :          0 : ScXMLTrackedChangesContext::ScXMLTrackedChangesContext( ScXMLImport& rImport,
     544                 :            :                                               sal_uInt16 nPrfx,
     545                 :            :                                                    const ::rtl::OUString& rLName,
     546                 :            :                                               const uno::Reference<xml::sax::XAttributeList>& xAttrList,
     547                 :            :                                               ScXMLChangeTrackingImportHelper* pTempChangeTrackingImportHelper ) :
     548                 :            :     SvXMLImportContext( rImport, nPrfx, rLName ),
     549                 :          0 :     pChangeTrackingImportHelper(pTempChangeTrackingImportHelper)
     550                 :            : {
     551         [ #  # ]:          0 :     rImport.LockSolarMutex();
     552                 :          0 :     pChangeTrackingImportHelper->SetChangeTrack(sal_True);
     553                 :            : 
     554 [ #  # ][ #  # ]:          0 :     sal_Int16 nAttrCount(xAttrList.is() ? xAttrList->getLength() : 0);
                 [ #  # ]
     555         [ #  # ]:          0 :     for( sal_Int16 i=0; i < nAttrCount; ++i )
     556                 :            :     {
     557 [ #  # ][ #  # ]:          0 :         const rtl::OUString& sAttrName(xAttrList->getNameByIndex( i ));
     558                 :          0 :         rtl::OUString aLocalName;
     559                 :          0 :         sal_uInt16 nPrefix(GetScImport().GetNamespaceMap().GetKeyByAttrName(
     560         [ #  # ]:          0 :                                             sAttrName, &aLocalName ));
     561 [ #  # ][ #  # ]:          0 :         const rtl::OUString& sValue(xAttrList->getValueByIndex( i ));
     562         [ #  # ]:          0 :         if (nPrefix == XML_NAMESPACE_TABLE)
     563                 :            :         {
     564 [ #  # ][ #  # ]:          0 :             if (IsXMLToken(aLocalName, XML_PROTECTION_KEY))
     565                 :            :             {
     566         [ #  # ]:          0 :                 if (!sValue.isEmpty())
     567                 :            :                 {
     568         [ #  # ]:          0 :                     uno::Sequence<sal_Int8> aPass;
     569         [ #  # ]:          0 :                     ::sax::Converter::decodeBase64(aPass, sValue);
     570 [ #  # ][ #  # ]:          0 :                     pChangeTrackingImportHelper->SetProtection(aPass);
     571                 :            :                 }
     572                 :            :             }
     573                 :            :         }
     574                 :          0 :     }
     575                 :          0 : }
     576                 :            : 
     577                 :          0 : ScXMLTrackedChangesContext::~ScXMLTrackedChangesContext()
     578                 :            : {
     579         [ #  # ]:          0 :     GetScImport().UnlockSolarMutex();
     580         [ #  # ]:          0 : }
     581                 :            : 
     582                 :          0 : SvXMLImportContext *ScXMLTrackedChangesContext::CreateChildContext( sal_uInt16 nPrefix,
     583                 :            :                                      const ::rtl::OUString& rLocalName,
     584                 :            :                                      const ::com::sun::star::uno::Reference<
     585                 :            :                                           ::com::sun::star::xml::sax::XAttributeList>& xAttrList )
     586                 :            : {
     587                 :          0 :     SvXMLImportContext *pContext(0);
     588                 :            : 
     589         [ #  # ]:          0 :     if (nPrefix == XML_NAMESPACE_TABLE)
     590                 :            :     {
     591         [ #  # ]:          0 :         if (IsXMLToken(rLocalName, XML_CELL_CONTENT_CHANGE))
     592                 :            :         {
     593         [ #  # ]:          0 :             pContext = new ScXMLContentChangeContext(GetScImport(), nPrefix, rLocalName, xAttrList, pChangeTrackingImportHelper);
     594                 :            :         }
     595         [ #  # ]:          0 :         else if (IsXMLToken(rLocalName, XML_INSERTION))
     596                 :            :         {
     597         [ #  # ]:          0 :             pContext = new ScXMLInsertionContext(GetScImport(), nPrefix, rLocalName, xAttrList, pChangeTrackingImportHelper);
     598                 :            :         }
     599         [ #  # ]:          0 :         else if (IsXMLToken(rLocalName, XML_DELETION))
     600                 :            :         {
     601         [ #  # ]:          0 :             pContext = new ScXMLDeletionContext(GetScImport(), nPrefix, rLocalName, xAttrList, pChangeTrackingImportHelper);
     602                 :            :         }
     603         [ #  # ]:          0 :         else if (IsXMLToken(rLocalName, XML_MOVEMENT))
     604                 :            :         {
     605         [ #  # ]:          0 :             pContext = new ScXMLMovementContext(GetScImport(), nPrefix, rLocalName, xAttrList, pChangeTrackingImportHelper);
     606                 :            :         }
     607         [ #  # ]:          0 :         else if (IsXMLToken(rLocalName, XML_REJECTION))
     608                 :            :         {
     609         [ #  # ]:          0 :             pContext = new ScXMLRejectionContext(GetScImport(), nPrefix, rLocalName, xAttrList, pChangeTrackingImportHelper);
     610                 :            :         }
     611                 :            :     }
     612                 :            : 
     613         [ #  # ]:          0 :     if( !pContext )
     614         [ #  # ]:          0 :         pContext = new SvXMLImportContext( GetImport(), nPrefix, rLocalName );
     615                 :            : 
     616                 :          0 :     return pContext;
     617                 :            : }
     618                 :            : 
     619                 :          0 : void ScXMLTrackedChangesContext::EndElement()
     620                 :            : {
     621                 :          0 : }
     622                 :            : 
     623                 :          0 : ScXMLChangeInfoContext::ScXMLChangeInfoContext(  ScXMLImport& rImport,
     624                 :            :                                               sal_uInt16 nPrfx,
     625                 :            :                                                    const ::rtl::OUString& rLName,
     626                 :            :                                               const uno::Reference<xml::sax::XAttributeList>& xAttrList,
     627                 :            :                                             ScXMLChangeTrackingImportHelper* pTempChangeTrackingImportHelper ) :
     628                 :            :     SvXMLImportContext( rImport, nPrfx, rLName ),
     629                 :            :     aInfo(),
     630                 :            :     pChangeTrackingImportHelper(pTempChangeTrackingImportHelper),
     631                 :          0 :     nParagraphCount(0)
     632                 :            : {
     633 [ #  # ][ #  # ]:          0 :     sal_Int16 nAttrCount(xAttrList.is() ? xAttrList->getLength() : 0);
                 [ #  # ]
     634         [ #  # ]:          0 :     for( sal_Int16 i=0; i < nAttrCount; ++i )
     635                 :            :     {
     636 [ #  # ][ #  # ]:          0 :         const rtl::OUString& sAttrName(xAttrList->getNameByIndex( i ));
     637                 :          0 :         rtl::OUString aLocalName;
     638                 :          0 :         sal_uInt16 nPrefix(GetScImport().GetNamespaceMap().GetKeyByAttrName(
     639         [ #  # ]:          0 :                                             sAttrName, &aLocalName ));
     640 [ #  # ][ #  # ]:          0 :         const rtl::OUString& sValue(xAttrList->getValueByIndex( i ));
     641                 :            : 
     642         [ #  # ]:          0 :         if (nPrefix == XML_NAMESPACE_OFFICE)
     643                 :            :         {
     644 [ #  # ][ #  # ]:          0 :             if (IsXMLToken(aLocalName, XML_CHG_AUTHOR))
     645                 :            :             {
     646 [ #  # ][ #  # ]:          0 :                 sAuthorBuffer = sValue;
     647                 :            :             }
     648 [ #  # ][ #  # ]:          0 :             else if (IsXMLToken(aLocalName, XML_CHG_DATE_TIME))
     649                 :            :             {
     650 [ #  # ][ #  # ]:          0 :                 sDateTimeBuffer = sValue;
     651                 :            :             }
     652                 :            :         }
     653                 :          0 :     }
     654                 :          0 : }
     655                 :            : 
     656                 :          0 : ScXMLChangeInfoContext::~ScXMLChangeInfoContext()
     657                 :            : {
     658         [ #  # ]:          0 : }
     659                 :            : 
     660                 :          0 : SvXMLImportContext *ScXMLChangeInfoContext::CreateChildContext( sal_uInt16 nPrefix,
     661                 :            :                                      const ::rtl::OUString& rLocalName,
     662                 :            :                                      const ::com::sun::star::uno::Reference<
     663                 :            :                                           ::com::sun::star::xml::sax::XAttributeList>& xAttrList )
     664                 :            : {
     665                 :          0 :     SvXMLImportContext *pContext(0);
     666                 :            : 
     667         [ #  # ]:          0 :     if( XML_NAMESPACE_DC == nPrefix )
     668                 :            :     {
     669         [ #  # ]:          0 :         if( IsXMLToken( rLocalName, XML_CREATOR ) )
     670                 :            :             pContext = new ScXMLContentContext(GetScImport(), nPrefix,
     671         [ #  # ]:          0 :                                             rLocalName, xAttrList, sAuthorBuffer);
     672         [ #  # ]:          0 :         else if( IsXMLToken( rLocalName, XML_DATE ) )
     673                 :            :             pContext = new ScXMLContentContext(GetScImport(), nPrefix,
     674         [ #  # ]:          0 :                                             rLocalName, xAttrList, sDateTimeBuffer);
     675                 :            :     }
     676 [ #  # ][ #  # ]:          0 :     else if ((nPrefix == XML_NAMESPACE_TEXT) && (IsXMLToken(rLocalName, XML_P)) )
                 [ #  # ]
     677                 :            :     {
     678         [ #  # ]:          0 :         if(nParagraphCount)
     679                 :          0 :             sCommentBuffer.append(static_cast<sal_Unicode>('\n'));
     680                 :          0 :         ++nParagraphCount;
     681         [ #  # ]:          0 :         pContext = new ScXMLContentContext( GetScImport(), nPrefix, rLocalName, xAttrList, sCommentBuffer);
     682                 :            :     }
     683                 :            : 
     684         [ #  # ]:          0 :     if( !pContext )
     685         [ #  # ]:          0 :         pContext = new SvXMLImportContext( GetImport(), nPrefix, rLocalName );
     686                 :            : 
     687                 :          0 :     return pContext;
     688                 :            : }
     689                 :            : 
     690                 :          0 : void ScXMLChangeInfoContext::EndElement()
     691                 :            : {
     692                 :          0 :     aInfo.sUser = sAuthorBuffer.makeStringAndClear();
     693                 :            :     ::sax::Converter::convertDateTime(aInfo.aDateTime,
     694         [ #  # ]:          0 :             sDateTimeBuffer.makeStringAndClear());
     695                 :          0 :     aInfo.sComment = sCommentBuffer.makeStringAndClear();
     696                 :          0 :     pChangeTrackingImportHelper->SetActionInfo(aInfo);
     697                 :          0 : }
     698                 :            : 
     699                 :          0 : ScXMLBigRangeContext::ScXMLBigRangeContext(  ScXMLImport& rImport,
     700                 :            :                                               sal_uInt16 nPrfx,
     701                 :            :                                                    const ::rtl::OUString& rLName,
     702                 :            :                                               const uno::Reference<xml::sax::XAttributeList>& xAttrList,
     703                 :            :                                             ScBigRange& rTempBigRange ) :
     704                 :            :     SvXMLImportContext( rImport, nPrfx, rLName ),
     705                 :          0 :     rBigRange(rTempBigRange)
     706                 :            : {
     707                 :          0 :     sal_Bool bColumn(false);
     708                 :          0 :     sal_Bool bRow(false);
     709                 :          0 :     sal_Bool bTable(false);
     710                 :          0 :     sal_Int32 nColumn(0);
     711                 :          0 :     sal_Int32 nRow(0);
     712                 :          0 :     sal_Int32 nTable(0);
     713                 :          0 :     sal_Int32 nStartColumn(0);
     714                 :          0 :     sal_Int32 nEndColumn(0);
     715                 :          0 :     sal_Int32 nStartRow(0);
     716                 :          0 :     sal_Int32 nEndRow(0);
     717                 :          0 :     sal_Int32 nStartTable(0);
     718                 :          0 :     sal_Int32 nEndTable(0);
     719 [ #  # ][ #  # ]:          0 :     sal_Int16 nAttrCount(xAttrList.is() ? xAttrList->getLength() : 0);
                 [ #  # ]
     720         [ #  # ]:          0 :     for( sal_Int16 i=0; i < nAttrCount; ++i )
     721                 :            :     {
     722 [ #  # ][ #  # ]:          0 :         const rtl::OUString& sAttrName(xAttrList->getNameByIndex( i ));
     723                 :          0 :         rtl::OUString aLocalName;
     724                 :          0 :         sal_uInt16 nPrefix(GetScImport().GetNamespaceMap().GetKeyByAttrName(
     725         [ #  # ]:          0 :                                             sAttrName, &aLocalName ));
     726 [ #  # ][ #  # ]:          0 :         const rtl::OUString& sValue(xAttrList->getValueByIndex( i ));
     727                 :            : 
     728         [ #  # ]:          0 :         if (nPrefix == XML_NAMESPACE_TABLE)
     729                 :            :         {
     730 [ #  # ][ #  # ]:          0 :             if (IsXMLToken(aLocalName, XML_COLUMN))
     731                 :            :             {
     732         [ #  # ]:          0 :                 ::sax::Converter::convertNumber(nColumn, sValue);
     733                 :          0 :                 bColumn = sal_True;
     734                 :            :             }
     735 [ #  # ][ #  # ]:          0 :             else if (IsXMLToken(aLocalName, XML_ROW))
     736                 :            :             {
     737         [ #  # ]:          0 :                 ::sax::Converter::convertNumber(nRow, sValue);
     738                 :          0 :                 bRow = sal_True;
     739                 :            :             }
     740 [ #  # ][ #  # ]:          0 :             else if (IsXMLToken(aLocalName, XML_TABLE))
     741                 :            :             {
     742         [ #  # ]:          0 :                 ::sax::Converter::convertNumber(nTable, sValue);
     743                 :          0 :                 bTable = sal_True;
     744                 :            :             }
     745 [ #  # ][ #  # ]:          0 :             else if (IsXMLToken(aLocalName, XML_START_COLUMN))
     746         [ #  # ]:          0 :                 ::sax::Converter::convertNumber(nStartColumn, sValue);
     747 [ #  # ][ #  # ]:          0 :             else if (IsXMLToken(aLocalName, XML_END_COLUMN))
     748         [ #  # ]:          0 :                 ::sax::Converter::convertNumber(nEndColumn, sValue);
     749 [ #  # ][ #  # ]:          0 :             else if (IsXMLToken(aLocalName, XML_START_ROW))
     750         [ #  # ]:          0 :                 ::sax::Converter::convertNumber(nStartRow, sValue);
     751 [ #  # ][ #  # ]:          0 :             else if (IsXMLToken(aLocalName, XML_END_ROW))
     752         [ #  # ]:          0 :                 ::sax::Converter::convertNumber(nEndRow, sValue);
     753 [ #  # ][ #  # ]:          0 :             else if (IsXMLToken(aLocalName, XML_START_TABLE))
     754         [ #  # ]:          0 :                 ::sax::Converter::convertNumber(nStartTable, sValue);
     755 [ #  # ][ #  # ]:          0 :             else if (IsXMLToken(aLocalName, XML_END_TABLE))
     756         [ #  # ]:          0 :                 ::sax::Converter::convertNumber(nEndTable, sValue);
     757                 :            :         }
     758                 :          0 :     }
     759         [ #  # ]:          0 :     if (bColumn)
     760                 :          0 :         nStartColumn = nEndColumn = nColumn;
     761         [ #  # ]:          0 :     if (bRow)
     762                 :          0 :         nStartRow = nEndRow = nRow;
     763         [ #  # ]:          0 :     if (bTable)
     764                 :          0 :         nStartTable = nEndTable = nTable;
     765                 :            :     rBigRange.Set(nStartColumn, nStartRow, nStartTable,
     766                 :          0 :         nEndColumn, nEndRow, nEndTable);
     767                 :          0 : }
     768                 :            : 
     769                 :          0 : ScXMLBigRangeContext::~ScXMLBigRangeContext()
     770                 :            : {
     771         [ #  # ]:          0 : }
     772                 :            : 
     773                 :          0 : SvXMLImportContext *ScXMLBigRangeContext::CreateChildContext( sal_uInt16 nPrefix,
     774                 :            :                                      const ::rtl::OUString& rLocalName,
     775                 :            :                                      const ::com::sun::star::uno::Reference<
     776                 :            :                                         ::com::sun::star::xml::sax::XAttributeList>& /* xAttrList */ )
     777                 :            : {
     778         [ #  # ]:          0 :     return new SvXMLImportContext( GetImport(), nPrefix, rLocalName );
     779                 :            : }
     780                 :            : 
     781                 :          0 : void ScXMLBigRangeContext::EndElement()
     782                 :            : {
     783                 :          0 : }
     784                 :            : 
     785                 :          0 : ScXMLCellContentDeletionContext::ScXMLCellContentDeletionContext(  ScXMLImport& rImport,
     786                 :            :                                               sal_uInt16 nPrfx,
     787                 :            :                                                    const ::rtl::OUString& rLName,
     788                 :            :                                               const uno::Reference<xml::sax::XAttributeList>& xAttrList,
     789                 :            :                                             ScXMLChangeTrackingImportHelper* pTempChangeTrackingImportHelper) :
     790                 :            :     SvXMLImportContext( rImport, nPrfx, rLName ),
     791                 :            :     pChangeTrackingImportHelper(pTempChangeTrackingImportHelper),
     792                 :            :     pCell(NULL),
     793                 :            :     nID(0),
     794                 :            :     nMatrixCols(0),
     795                 :            :     nMatrixRows(0),
     796                 :            :     nType(NUMBERFORMAT_ALL),
     797                 :            :     nMatrixFlag(MM_NONE),
     798                 :            :     bBigRange(false),
     799                 :          0 :     bContainsCell(false)
     800                 :            : {
     801 [ #  # ][ #  # ]:          0 :     sal_Int16 nAttrCount(xAttrList.is() ? xAttrList->getLength() : 0);
                 [ #  # ]
     802         [ #  # ]:          0 :     for( sal_Int16 i=0; i < nAttrCount; ++i )
     803                 :            :     {
     804 [ #  # ][ #  # ]:          0 :         const rtl::OUString& sAttrName(xAttrList->getNameByIndex( i ));
     805                 :          0 :         rtl::OUString aLocalName;
     806                 :          0 :         sal_uInt16 nPrefix(GetScImport().GetNamespaceMap().GetKeyByAttrName(
     807         [ #  # ]:          0 :                                             sAttrName, &aLocalName ));
     808 [ #  # ][ #  # ]:          0 :         const rtl::OUString& sValue(xAttrList->getValueByIndex( i ));
     809                 :            : 
     810         [ #  # ]:          0 :         if (nPrefix == XML_NAMESPACE_TABLE)
     811                 :            :         {
     812 [ #  # ][ #  # ]:          0 :             if (IsXMLToken(aLocalName, XML_ID))
     813         [ #  # ]:          0 :                 nID = pChangeTrackingImportHelper->GetIDFromString(sValue);
     814                 :            :         }
     815                 :          0 :     }
     816                 :          0 : }
     817                 :            : 
     818                 :          0 : ScXMLCellContentDeletionContext::~ScXMLCellContentDeletionContext()
     819                 :            : {
     820         [ #  # ]:          0 : }
     821                 :            : 
     822                 :          0 : SvXMLImportContext *ScXMLCellContentDeletionContext::CreateChildContext( sal_uInt16 nPrefix,
     823                 :            :                                      const ::rtl::OUString& rLocalName,
     824                 :            :                                      const ::com::sun::star::uno::Reference<
     825                 :            :                                           ::com::sun::star::xml::sax::XAttributeList>& xAttrList )
     826                 :            : {
     827                 :          0 :     SvXMLImportContext *pContext(0);
     828                 :            : 
     829         [ #  # ]:          0 :     if (nPrefix == XML_NAMESPACE_TABLE)
     830                 :            :     {
     831         [ #  # ]:          0 :         if (IsXMLToken(rLocalName, XML_CHANGE_TRACK_TABLE_CELL))
     832                 :            :         {
     833                 :          0 :             bContainsCell = sal_True;
     834                 :            :             pContext = new ScXMLChangeCellContext(GetScImport(), nPrefix, rLocalName, xAttrList,
     835         [ #  # ]:          0 :                 pCell, sFormulaAddress, sFormula, sFormulaNmsp, eGrammar, sInputString, fValue, nType, nMatrixFlag, nMatrixCols, nMatrixRows );
     836                 :            :         }
     837         [ #  # ]:          0 :         else if (IsXMLToken(rLocalName, XML_CELL_ADDRESS))
     838                 :            :         {
     839                 :            :             OSL_ENSURE(!nID, "a action with a ID should not contain a BigRange");
     840                 :          0 :             bBigRange = sal_True;
     841         [ #  # ]:          0 :             pContext = new ScXMLBigRangeContext(GetScImport(), nPrefix, rLocalName, xAttrList, aBigRange);
     842                 :            :         }
     843                 :            :     }
     844                 :            : 
     845         [ #  # ]:          0 :     if( !pContext )
     846         [ #  # ]:          0 :         pContext = new SvXMLImportContext( GetImport(), nPrefix, rLocalName );
     847                 :            : 
     848                 :          0 :     return pContext;
     849                 :            : }
     850                 :            : 
     851                 :          0 : void ScXMLCellContentDeletionContext::EndElement()
     852                 :            : {
     853                 :            :     ScMyCellInfo* pCellInfo(new ScMyCellInfo(pCell, sFormulaAddress, sFormula, eGrammar, sInputString, fValue, nType,
     854         [ #  # ]:          0 :             nMatrixFlag, nMatrixCols, nMatrixRows));
     855         [ #  # ]:          0 :     if (nID)
     856                 :          0 :         pChangeTrackingImportHelper->AddDeleted(nID, pCellInfo);
     857                 :            :     else
     858                 :          0 :         pChangeTrackingImportHelper->AddGenerated(pCellInfo, aBigRange);
     859                 :          0 : }
     860                 :            : 
     861                 :          0 : ScXMLDependenceContext::ScXMLDependenceContext(  ScXMLImport& rImport,
     862                 :            :                                               sal_uInt16 nPrfx,
     863                 :            :                                                    const ::rtl::OUString& rLName,
     864                 :            :                                               const uno::Reference<xml::sax::XAttributeList>& xAttrList,
     865                 :            :                                             ScXMLChangeTrackingImportHelper* pTempChangeTrackingImportHelper ) :
     866                 :            :     SvXMLImportContext( rImport, nPrfx, rLName ),
     867                 :          0 :     pChangeTrackingImportHelper(pTempChangeTrackingImportHelper)
     868                 :            : {
     869                 :          0 :     sal_uInt32 nID(0);
     870 [ #  # ][ #  # ]:          0 :     sal_Int16 nAttrCount(xAttrList.is() ? xAttrList->getLength() : 0);
                 [ #  # ]
     871         [ #  # ]:          0 :     for( sal_Int16 i=0; i < nAttrCount; ++i )
     872                 :            :     {
     873 [ #  # ][ #  # ]:          0 :         const rtl::OUString& sAttrName(xAttrList->getNameByIndex( i ));
     874                 :          0 :         rtl::OUString aLocalName;
     875                 :          0 :         sal_uInt16 nPrefix(GetScImport().GetNamespaceMap().GetKeyByAttrName(
     876         [ #  # ]:          0 :                                             sAttrName, &aLocalName ));
     877 [ #  # ][ #  # ]:          0 :         const rtl::OUString& sValue(xAttrList->getValueByIndex( i ));
     878                 :            : 
     879         [ #  # ]:          0 :         if (nPrefix == XML_NAMESPACE_TABLE)
     880                 :            :         {
     881 [ #  # ][ #  # ]:          0 :             if (IsXMLToken(aLocalName, XML_ID))
     882         [ #  # ]:          0 :                 nID = pChangeTrackingImportHelper->GetIDFromString(sValue);
     883                 :            :         }
     884                 :          0 :     }
     885         [ #  # ]:          0 :     pChangeTrackingImportHelper->AddDependence(nID);
     886                 :          0 : }
     887                 :            : 
     888                 :          0 : ScXMLDependenceContext::~ScXMLDependenceContext()
     889                 :            : {
     890         [ #  # ]:          0 : }
     891                 :            : 
     892                 :          0 : SvXMLImportContext *ScXMLDependenceContext::CreateChildContext( sal_uInt16 nPrefix,
     893                 :            :                                      const ::rtl::OUString& rLocalName,
     894                 :            :                                      const ::com::sun::star::uno::Reference<
     895                 :            :                                         ::com::sun::star::xml::sax::XAttributeList>& /* xAttrList */ )
     896                 :            : {
     897         [ #  # ]:          0 :     return new SvXMLImportContext( GetImport(), nPrefix, rLocalName );
     898                 :            : }
     899                 :            : 
     900                 :          0 : void ScXMLDependenceContext::EndElement()
     901                 :            : {
     902                 :          0 : }
     903                 :            : 
     904                 :          0 : ScXMLDependingsContext::ScXMLDependingsContext(  ScXMLImport& rImport,
     905                 :            :                                               sal_uInt16 nPrfx,
     906                 :            :                                                    const ::rtl::OUString& rLName,
     907                 :            :                                             const uno::Reference<xml::sax::XAttributeList>& /* xAttrList */,
     908                 :            :                                             ScXMLChangeTrackingImportHelper* pTempChangeTrackingImportHelper ) :
     909                 :            :     SvXMLImportContext( rImport, nPrfx, rLName ),
     910                 :          0 :     pChangeTrackingImportHelper(pTempChangeTrackingImportHelper)
     911                 :            : {
     912                 :            :     // here are no attributes
     913                 :          0 : }
     914                 :            : 
     915                 :          0 : ScXMLDependingsContext::~ScXMLDependingsContext()
     916                 :            : {
     917         [ #  # ]:          0 : }
     918                 :            : 
     919                 :          0 : SvXMLImportContext *ScXMLDependingsContext::CreateChildContext( sal_uInt16 nPrefix,
     920                 :            :                                      const ::rtl::OUString& rLocalName,
     921                 :            :                                      const ::com::sun::star::uno::Reference<
     922                 :            :                                           ::com::sun::star::xml::sax::XAttributeList>& xAttrList )
     923                 :            : {
     924                 :          0 :     SvXMLImportContext *pContext(0);
     925                 :            : 
     926         [ #  # ]:          0 :     if (nPrefix == XML_NAMESPACE_TABLE)
     927                 :            :     {
     928                 :            :         // #i80033# read both old (dependence) and new (dependency) elements
     929 [ #  # ][ #  # ]:          0 :         if (IsXMLToken(rLocalName, XML_DEPENDENCE) || IsXMLToken(rLocalName, XML_DEPENDENCY))
                 [ #  # ]
     930         [ #  # ]:          0 :             pContext = new ScXMLDependenceContext(GetScImport(), nPrefix, rLocalName, xAttrList, pChangeTrackingImportHelper);
     931                 :            :     }
     932                 :            : 
     933         [ #  # ]:          0 :     if( !pContext )
     934         [ #  # ]:          0 :         pContext = new SvXMLImportContext( GetImport(), nPrefix, rLocalName );
     935                 :            : 
     936                 :          0 :     return pContext;
     937                 :            : }
     938                 :            : 
     939                 :          0 : void ScXMLDependingsContext::EndElement()
     940                 :            : {
     941                 :          0 : }
     942                 :            : 
     943                 :          0 : ScXMLChangeDeletionContext::ScXMLChangeDeletionContext(  ScXMLImport& rImport,
     944                 :            :                                               sal_uInt16 nPrfx,
     945                 :            :                                                    const ::rtl::OUString& rLName,
     946                 :            :                                               const uno::Reference<xml::sax::XAttributeList>& xAttrList,
     947                 :            :                                             ScXMLChangeTrackingImportHelper* pTempChangeTrackingImportHelper ) :
     948                 :            :     SvXMLImportContext( rImport, nPrfx, rLName ),
     949                 :          0 :     pChangeTrackingImportHelper(pTempChangeTrackingImportHelper)
     950                 :            : {
     951                 :          0 :     sal_uInt32 nID(0);
     952 [ #  # ][ #  # ]:          0 :     sal_Int16 nAttrCount(xAttrList.is() ? xAttrList->getLength() : 0);
                 [ #  # ]
     953         [ #  # ]:          0 :     for( sal_Int16 i=0; i < nAttrCount; ++i )
     954                 :            :     {
     955 [ #  # ][ #  # ]:          0 :         const rtl::OUString& sAttrName(xAttrList->getNameByIndex( i ));
     956                 :          0 :         rtl::OUString aLocalName;
     957                 :          0 :         sal_uInt16 nPrefix(GetScImport().GetNamespaceMap().GetKeyByAttrName(
     958         [ #  # ]:          0 :                                             sAttrName, &aLocalName ));
     959 [ #  # ][ #  # ]:          0 :         const rtl::OUString& sValue(xAttrList->getValueByIndex( i ));
     960                 :            : 
     961         [ #  # ]:          0 :         if (nPrefix == XML_NAMESPACE_TABLE)
     962                 :            :         {
     963 [ #  # ][ #  # ]:          0 :             if (IsXMLToken(aLocalName, XML_ID))
     964         [ #  # ]:          0 :                 nID = pChangeTrackingImportHelper->GetIDFromString(sValue);
     965                 :            :         }
     966                 :          0 :     }
     967         [ #  # ]:          0 :     pChangeTrackingImportHelper->AddDeleted(nID);
     968                 :          0 : }
     969                 :            : 
     970                 :          0 : ScXMLChangeDeletionContext::~ScXMLChangeDeletionContext()
     971                 :            : {
     972         [ #  # ]:          0 : }
     973                 :            : 
     974                 :          0 : SvXMLImportContext *ScXMLChangeDeletionContext::CreateChildContext( sal_uInt16 nPrefix,
     975                 :            :                                      const ::rtl::OUString& rLocalName,
     976                 :            :                                      const ::com::sun::star::uno::Reference<
     977                 :            :                                         ::com::sun::star::xml::sax::XAttributeList>& /* xAttrList */ )
     978                 :            : {
     979         [ #  # ]:          0 :     return new SvXMLImportContext( GetImport(), nPrefix, rLocalName );
     980                 :            : }
     981                 :            : 
     982                 :          0 : void ScXMLChangeDeletionContext::EndElement()
     983                 :            : {
     984                 :          0 : }
     985                 :            : 
     986                 :          0 : ScXMLDeletionsContext::ScXMLDeletionsContext(  ScXMLImport& rImport,
     987                 :            :                                               sal_uInt16 nPrfx,
     988                 :            :                                                    const ::rtl::OUString& rLName,
     989                 :            :                                             const uno::Reference<xml::sax::XAttributeList>& /* xAttrList */,
     990                 :            :                                             ScXMLChangeTrackingImportHelper* pTempChangeTrackingImportHelper ) :
     991                 :            :     SvXMLImportContext( rImport, nPrfx, rLName ),
     992                 :          0 :     pChangeTrackingImportHelper(pTempChangeTrackingImportHelper)
     993                 :            : {
     994                 :            :     // here are no attributes
     995                 :          0 : }
     996                 :            : 
     997                 :          0 : ScXMLDeletionsContext::~ScXMLDeletionsContext()
     998                 :            : {
     999         [ #  # ]:          0 : }
    1000                 :            : 
    1001                 :          0 : SvXMLImportContext *ScXMLDeletionsContext::CreateChildContext( sal_uInt16 nPrefix,
    1002                 :            :                                      const ::rtl::OUString& rLocalName,
    1003                 :            :                                      const ::com::sun::star::uno::Reference<
    1004                 :            :                                           ::com::sun::star::xml::sax::XAttributeList>& xAttrList )
    1005                 :            : {
    1006                 :          0 :     SvXMLImportContext *pContext(0);
    1007                 :            : 
    1008         [ #  # ]:          0 :     if (nPrefix == XML_NAMESPACE_TABLE)
    1009                 :            :     {
    1010         [ #  # ]:          0 :         if (IsXMLToken(rLocalName, XML_CHANGE_DELETION))
    1011         [ #  # ]:          0 :             pContext = new ScXMLChangeDeletionContext(GetScImport(), nPrefix, rLocalName, xAttrList, pChangeTrackingImportHelper);
    1012         [ #  # ]:          0 :         else if (IsXMLToken(rLocalName, XML_CELL_CONTENT_DELETION))
    1013         [ #  # ]:          0 :             pContext = new ScXMLCellContentDeletionContext(GetScImport(), nPrefix, rLocalName, xAttrList, pChangeTrackingImportHelper);
    1014                 :            :     }
    1015                 :            : 
    1016         [ #  # ]:          0 :     if( !pContext )
    1017         [ #  # ]:          0 :         pContext = new SvXMLImportContext( GetImport(), nPrefix, rLocalName );
    1018                 :            : 
    1019                 :          0 :     return pContext;
    1020                 :            : }
    1021                 :            : 
    1022                 :          0 : void ScXMLDeletionsContext::EndElement()
    1023                 :            : {
    1024                 :          0 : }
    1025                 :            : 
    1026                 :          0 : ScXMLChangeTextPContext::ScXMLChangeTextPContext( ScXMLImport& rImport,
    1027                 :            :                                       sal_uInt16 nPrfx,
    1028                 :            :                                       const ::rtl::OUString& rLName,
    1029                 :            :                                       const ::com::sun::star::uno::Reference<
    1030                 :            :                                       ::com::sun::star::xml::sax::XAttributeList>& xTempAttrList,
    1031                 :            :                                       ScXMLChangeCellContext* pTempChangeCellContext) :
    1032                 :            :     SvXMLImportContext( rImport, nPrfx, rLName ),
    1033                 :            :     xAttrList(xTempAttrList),
    1034                 :            :     sLName(rLName),
    1035                 :            :     sText(),
    1036                 :            :     pChangeCellContext(pTempChangeCellContext),
    1037                 :            :     pTextPContext(NULL),
    1038                 :          0 :     nPrefix(nPrfx)
    1039                 :            : {
    1040                 :            :     // here are no attributes
    1041                 :          0 : }
    1042                 :            : 
    1043                 :          0 : ScXMLChangeTextPContext::~ScXMLChangeTextPContext()
    1044                 :            : {
    1045         [ #  # ]:          0 :     if (pTextPContext)
    1046 [ #  # ][ #  # ]:          0 :         delete pTextPContext;
    1047         [ #  # ]:          0 : }
    1048                 :            : 
    1049                 :          0 : SvXMLImportContext *ScXMLChangeTextPContext::CreateChildContext( sal_uInt16 nTempPrefix,
    1050                 :            :                                             const ::rtl::OUString& rLName,
    1051                 :            :                                             const ::com::sun::star::uno::Reference<
    1052                 :            :                                           ::com::sun::star::xml::sax::XAttributeList>& xTempAttrList )
    1053                 :            : {
    1054                 :          0 :     SvXMLImportContext *pContext(0);
    1055                 :            : 
    1056 [ #  # ][ #  # ]:          0 :     if ((nPrefix == XML_NAMESPACE_TEXT) && (IsXMLToken(rLName, XML_S)) && !pTextPContext)
         [ #  # ][ #  # ]
    1057                 :            :     {
    1058                 :          0 :         sal_Int32 nRepeat(0);
    1059         [ #  # ]:          0 :         sal_Int16 nAttrCount(xAttrList.is() ? xAttrList->getLength() : 0);
    1060         [ #  # ]:          0 :         for( sal_Int16 i=0; i < nAttrCount; ++i )
    1061                 :            :         {
    1062 [ #  # ][ #  # ]:          0 :             const rtl::OUString& sAttrName(xAttrList->getNameByIndex( i ));
    1063 [ #  # ][ #  # ]:          0 :             const rtl::OUString& sValue(xAttrList->getValueByIndex( i ));
    1064                 :          0 :             rtl::OUString aLocalName;
    1065                 :          0 :             sal_uInt16 nPrfx(GetScImport().GetNamespaceMap().GetKeyByAttrName(
    1066         [ #  # ]:          0 :                                                 sAttrName, &aLocalName ));
    1067 [ #  # ][ #  # ]:          0 :             if ((nPrfx == XML_NAMESPACE_TEXT) && (IsXMLToken(aLocalName, XML_C)))
         [ #  # ][ #  # ]
    1068                 :          0 :                 nRepeat = sValue.toInt32();
    1069                 :          0 :         }
    1070         [ #  # ]:          0 :         if (nRepeat)
    1071         [ #  # ]:          0 :             for (sal_Int32 j = 0; j < nRepeat; ++j)
    1072                 :          0 :                 sText.append(static_cast<sal_Unicode>(' '));
    1073                 :            :         else
    1074                 :          0 :             sText.append(static_cast<sal_Unicode>(' '));
    1075                 :            :     }
    1076                 :            :     else
    1077                 :            :     {
    1078         [ #  # ]:          0 :         if (!pChangeCellContext->IsEditCell())
    1079                 :          0 :             pChangeCellContext->CreateTextPContext(false);
    1080                 :          0 :         sal_Bool bWasContext (sal_True);
    1081         [ #  # ]:          0 :         if (!pTextPContext)
    1082                 :            :         {
    1083                 :          0 :             bWasContext = false;
    1084                 :          0 :             pTextPContext = GetScImport().GetTextImport()->CreateTextChildContext(
    1085 [ #  # ][ #  # ]:          0 :                                     GetScImport(), nPrefix, sLName, xAttrList);
    1086                 :            :         }
    1087         [ #  # ]:          0 :         if (pTextPContext)
    1088                 :            :         {
    1089         [ #  # ]:          0 :             if (!bWasContext)
    1090         [ #  # ]:          0 :                 pTextPContext->Characters(sText.makeStringAndClear());
    1091                 :          0 :             pContext = pTextPContext->CreateChildContext(nTempPrefix, rLName, xTempAttrList);
    1092                 :            :         }
    1093                 :            :     }
    1094                 :            : 
    1095         [ #  # ]:          0 :     if( !pContext )
    1096         [ #  # ]:          0 :         pContext = new SvXMLImportContext( GetImport(), nPrefix, rLName );
    1097                 :            : 
    1098                 :          0 :     return pContext;
    1099                 :            : }
    1100                 :            : 
    1101                 :          0 : void ScXMLChangeTextPContext::Characters( const ::rtl::OUString& rChars )
    1102                 :            : {
    1103         [ #  # ]:          0 :     if (!pTextPContext)
    1104                 :          0 :         sText.append(rChars);
    1105                 :            :     else
    1106                 :          0 :         pTextPContext->Characters(rChars);
    1107                 :          0 : }
    1108                 :            : 
    1109                 :          0 : void ScXMLChangeTextPContext::EndElement()
    1110                 :            : {
    1111         [ #  # ]:          0 :     if (!pTextPContext)
    1112                 :          0 :         pChangeCellContext->SetText(sText.makeStringAndClear());
    1113                 :          0 : }
    1114                 :            : 
    1115                 :          0 : ScXMLChangeCellContext::ScXMLChangeCellContext(  ScXMLImport& rImport,
    1116                 :            :                                               sal_uInt16 nPrfx,
    1117                 :            :                                                    const ::rtl::OUString& rLName,
    1118                 :            :                                               const uno::Reference<xml::sax::XAttributeList>& xAttrList,
    1119                 :            :                                             ScBaseCell*& rTempOldCell, rtl::OUString& rAddress,
    1120                 :            :                                             rtl::OUString& rFormula, rtl::OUString& rFormulaNmsp,
    1121                 :            :                                             formula::FormulaGrammar::Grammar& rGrammar,
    1122                 :            :                                             rtl::OUString& rTempInputString, double& fDateTimeValue, sal_uInt16& nType,
    1123                 :            :                                             sal_uInt8& nMatrixFlag, sal_Int32& nMatrixCols, sal_Int32& nMatrixRows ) :
    1124                 :            :     SvXMLImportContext( rImport, nPrfx, rLName ),
    1125                 :            :     rInputString(rTempInputString),
    1126                 :            :     rOldCell(rTempOldCell),
    1127                 :            :     pEditTextObj(NULL),
    1128                 :            :     rDateTimeValue(fDateTimeValue),
    1129                 :            :     rType(nType),
    1130                 :            :     bEmpty(sal_True),
    1131                 :            :     bFirstParagraph(sal_True),
    1132                 :            :     bString(sal_True),
    1133                 :          0 :     bFormula(false)
    1134                 :            : {
    1135                 :          0 :     sal_Bool bIsMatrix(false);
    1136                 :          0 :     sal_Bool bIsCoveredMatrix(false);
    1137 [ #  # ][ #  # ]:          0 :     sal_Int16 nAttrCount(xAttrList.is() ? xAttrList->getLength() : 0);
                 [ #  # ]
    1138         [ #  # ]:          0 :     for( sal_Int16 i=0; i < nAttrCount; ++i )
    1139                 :            :     {
    1140 [ #  # ][ #  # ]:          0 :         const rtl::OUString& sAttrName(xAttrList->getNameByIndex( i ));
    1141                 :          0 :         rtl::OUString aLocalName;
    1142                 :          0 :         sal_uInt16 nPrefix(GetScImport().GetNamespaceMap().GetKeyByAttrName(
    1143         [ #  # ]:          0 :                                             sAttrName, &aLocalName ));
    1144 [ #  # ][ #  # ]:          0 :         const rtl::OUString& sValue(xAttrList->getValueByIndex( i ));
    1145                 :            : 
    1146         [ #  # ]:          0 :         if (nPrefix == XML_NAMESPACE_TABLE)
    1147                 :            :         {
    1148 [ #  # ][ #  # ]:          0 :             if (IsXMLToken(aLocalName, XML_FORMULA))
    1149                 :            :             {
    1150                 :          0 :                 bEmpty = false;
    1151         [ #  # ]:          0 :                 GetScImport().ExtractFormulaNamespaceGrammar( rFormula, rFormulaNmsp, rGrammar, sValue );
    1152                 :          0 :                 bFormula = sal_True;
    1153                 :            :             }
    1154 [ #  # ][ #  # ]:          0 :             else if (IsXMLToken(aLocalName, XML_CELL_ADDRESS))
    1155                 :            :             {
    1156                 :          0 :                 rAddress = sValue;
    1157                 :            :             }
    1158 [ #  # ][ #  # ]:          0 :             else if (IsXMLToken(aLocalName, XML_MATRIX_COVERED))
    1159                 :            :             {
    1160         [ #  # ]:          0 :                 bIsCoveredMatrix = IsXMLToken(sValue, XML_TRUE);
    1161                 :            :             }
    1162 [ #  # ][ #  # ]:          0 :             else if (IsXMLToken(aLocalName, XML_NUMBER_MATRIX_COLUMNS_SPANNED))
    1163                 :            :             {
    1164                 :          0 :                 bIsMatrix = sal_True;
    1165         [ #  # ]:          0 :                 ::sax::Converter::convertNumber(nMatrixCols, sValue);
    1166                 :            :             }
    1167 [ #  # ][ #  # ]:          0 :             else if (IsXMLToken(aLocalName, XML_NUMBER_MATRIX_ROWS_SPANNED))
    1168                 :            :             {
    1169                 :          0 :                 bIsMatrix = sal_True;
    1170         [ #  # ]:          0 :                 ::sax::Converter::convertNumber(nMatrixRows, sValue);
    1171                 :            :             }
    1172                 :            :         }
    1173         [ #  # ]:          0 :         else if (nPrefix == XML_NAMESPACE_OFFICE)
    1174                 :            :         {
    1175 [ #  # ][ #  # ]:          0 :             if (IsXMLToken(aLocalName, XML_VALUE_TYPE))
    1176                 :            :             {
    1177 [ #  # ][ #  # ]:          0 :                 if (IsXMLToken(sValue, XML_FLOAT))
    1178                 :          0 :                     bString = false;
    1179 [ #  # ][ #  # ]:          0 :                 else if (IsXMLToken(sValue, XML_DATE))
    1180                 :            :                 {
    1181                 :          0 :                     rType = NUMBERFORMAT_DATE;
    1182                 :          0 :                     bString = false;
    1183                 :            :                 }
    1184 [ #  # ][ #  # ]:          0 :                 else if (IsXMLToken(sValue, XML_TIME))
    1185                 :            :                 {
    1186                 :          0 :                     rType = NUMBERFORMAT_TIME;
    1187                 :          0 :                     bString = false;
    1188                 :            :                 }
    1189                 :            :             }
    1190 [ #  # ][ #  # ]:          0 :             else if (IsXMLToken(aLocalName, XML_VALUE))
    1191                 :            :             {
    1192         [ #  # ]:          0 :                 ::sax::Converter::convertDouble(fValue, sValue);
    1193                 :          0 :                 bEmpty = false;
    1194                 :            :             }
    1195 [ #  # ][ #  # ]:          0 :             else if (IsXMLToken(aLocalName, XML_DATE_VALUE))
    1196                 :            :             {
    1197                 :          0 :                 bEmpty = false;
    1198 [ #  # ][ #  # ]:          0 :                 if (GetScImport().GetMM100UnitConverter().setNullDate(GetScImport().GetModel()))
    1199         [ #  # ]:          0 :                     GetScImport().GetMM100UnitConverter().convertDateTime(rDateTimeValue, sValue);
    1200                 :          0 :                 fValue = rDateTimeValue;
    1201                 :            :             }
    1202 [ #  # ][ #  # ]:          0 :             else if (IsXMLToken(aLocalName, XML_TIME_VALUE))
    1203                 :            :             {
    1204                 :          0 :                 bEmpty = false;
    1205         [ #  # ]:          0 :                 ::sax::Converter::convertDuration(rDateTimeValue, sValue);
    1206                 :          0 :                 fValue = rDateTimeValue;
    1207                 :            :             }
    1208                 :            :         }
    1209                 :          0 :     }
    1210         [ #  # ]:          0 :     if (bIsCoveredMatrix)
    1211                 :          0 :         nMatrixFlag = MM_REFERENCE;
    1212 [ #  # ][ #  # ]:          0 :     else if (bIsMatrix && nMatrixRows && nMatrixCols)
                 [ #  # ]
    1213                 :          0 :         nMatrixFlag = MM_FORMULA;
    1214                 :          0 : }
    1215                 :            : 
    1216                 :          0 : ScXMLChangeCellContext::~ScXMLChangeCellContext()
    1217                 :            : {
    1218         [ #  # ]:          0 : }
    1219                 :            : 
    1220                 :          0 : SvXMLImportContext *ScXMLChangeCellContext::CreateChildContext( sal_uInt16 nPrefix,
    1221                 :            :                                      const ::rtl::OUString& rLocalName,
    1222                 :            :                                      const ::com::sun::star::uno::Reference<
    1223                 :            :                                           ::com::sun::star::xml::sax::XAttributeList>& xAttrList )
    1224                 :            : {
    1225                 :          0 :     SvXMLImportContext *pContext(0);
    1226                 :            : 
    1227 [ #  # ][ #  # ]:          0 :     if ((nPrefix == XML_NAMESPACE_TEXT) && (IsXMLToken(rLocalName, XML_P)))
                 [ #  # ]
    1228                 :            :     {
    1229                 :          0 :         bEmpty = false;
    1230         [ #  # ]:          0 :         if (bFirstParagraph)
    1231                 :            :         {
    1232         [ #  # ]:          0 :             pContext = new ScXMLChangeTextPContext(GetScImport(), nPrefix, rLocalName, xAttrList, this);
    1233                 :          0 :             bFirstParagraph = false;
    1234                 :            :         }
    1235                 :            :         else
    1236                 :            :         {
    1237         [ #  # ]:          0 :             if (!pEditTextObj)
    1238                 :          0 :                 CreateTextPContext(sal_True);
    1239                 :          0 :             pContext = GetScImport().GetTextImport()->CreateTextChildContext(
    1240 [ #  # ][ #  # ]:          0 :                 GetScImport(), nPrefix, rLocalName, xAttrList);
    1241                 :            :         }
    1242                 :            :     }
    1243                 :            : 
    1244         [ #  # ]:          0 :     if( !pContext )
    1245         [ #  # ]:          0 :         pContext = new SvXMLImportContext( GetImport(), nPrefix, rLocalName );
    1246                 :            : 
    1247                 :          0 :     return pContext;
    1248                 :            : }
    1249                 :            : 
    1250                 :          0 : void ScXMLChangeCellContext::CreateTextPContext(sal_Bool bIsNewParagraph)
    1251                 :            : {
    1252         [ #  # ]:          0 :     if (GetScImport().GetDocument())
    1253                 :            :     {
    1254         [ #  # ]:          0 :         pEditTextObj = new ScEditEngineTextObj();
    1255                 :          0 :         pEditTextObj->acquire();
    1256 [ #  # ][ #  # ]:          0 :         pEditTextObj->GetEditEngine()->SetEditTextObjectPool(GetScImport().GetDocument()->GetEditPool());
    1257 [ #  # ][ #  # ]:          0 :         uno::Reference <text::XText> xText(pEditTextObj);
    1258         [ #  # ]:          0 :         if (xText.is())
    1259                 :            :         {
    1260 [ #  # ][ #  # ]:          0 :             uno::Reference<text::XTextCursor> xTextCursor(xText->createTextCursor());
    1261         [ #  # ]:          0 :             if (bIsNewParagraph)
    1262                 :            :             {
    1263 [ #  # ][ #  # ]:          0 :                 xText->setString(sText);
    1264 [ #  # ][ #  # ]:          0 :                 xTextCursor->gotoEnd(false);
    1265         [ #  # ]:          0 :                 uno::Reference < text::XTextRange > xTextRange (xTextCursor, uno::UNO_QUERY);
    1266         [ #  # ]:          0 :                 if (xTextRange.is())
    1267 [ #  # ][ #  # ]:          0 :                     xText->insertControlCharacter(xTextRange, text::ControlCharacter::PARAGRAPH_BREAK, false);
    1268                 :            :             }
    1269 [ #  # ][ #  # ]:          0 :             GetScImport().GetTextImport()->SetCursor(xTextCursor);
         [ #  # ][ #  # ]
    1270                 :          0 :         }
    1271                 :            :     }
    1272                 :          0 : }
    1273                 :            : 
    1274                 :          0 : void ScXMLChangeCellContext::EndElement()
    1275                 :            : {
    1276         [ #  # ]:          0 :     if (!bEmpty)
    1277                 :            :     {
    1278         [ #  # ]:          0 :         if (pEditTextObj)
    1279                 :            :         {
    1280 [ #  # ][ #  # ]:          0 :             if (GetImport().GetTextImport()->GetCursor().is())
                 [ #  # ]
    1281                 :            :             {
    1282                 :            :                 //GetImport().GetTextImport()->GetCursor()->gotoEnd(sal_False);
    1283 [ #  # ][ #  # ]:          0 :                 if( GetImport().GetTextImport()->GetCursor()->goLeft( 1, sal_True ) )
         [ #  # ][ #  # ]
                 [ #  # ]
    1284                 :            :                 {
    1285                 :          0 :                     OUString sEmpty;
    1286 [ #  # ][ #  # ]:          0 :                     GetImport().GetTextImport()->GetText()->insertString(
         [ #  # ][ #  # ]
                 [ #  # ]
    1287 [ #  # ][ #  # ]:          0 :                         GetImport().GetTextImport()->GetCursorAsRange(), sEmpty,
         [ #  # ][ #  # ]
    1288         [ #  # ]:          0 :                         sal_True );
    1289                 :            :                 }
    1290                 :            :             }
    1291         [ #  # ]:          0 :             if (GetScImport().GetDocument())
    1292         [ #  # ]:          0 :                 rOldCell = new ScEditCell(pEditTextObj->CreateTextObject(), GetScImport().GetDocument(), GetScImport().GetDocument()->GetEditPool());
    1293 [ #  # ][ #  # ]:          0 :             GetScImport().GetTextImport()->ResetCursor();
    1294                 :          0 :             pEditTextObj->release();
    1295                 :            :         }
    1296                 :            :         else
    1297                 :            :         {
    1298         [ #  # ]:          0 :             if (!bFormula)
    1299                 :            :             {
    1300 [ #  # ][ #  # ]:          0 :                 if (!sText.isEmpty() && bString)
                 [ #  # ]
    1301         [ #  # ]:          0 :                     rOldCell = new ScStringCell(sText);
    1302                 :            :                 else
    1303         [ #  # ]:          0 :                     rOldCell = new ScValueCell(fValue);
    1304 [ #  # ][ #  # ]:          0 :                 if (rType == NUMBERFORMAT_DATE || rType == NUMBERFORMAT_TIME)
    1305                 :          0 :                     rInputString = sText;
    1306                 :            :             }
    1307                 :            :         }
    1308                 :            :     }
    1309                 :            :     else
    1310                 :          0 :         rOldCell = NULL;
    1311                 :          0 : }
    1312                 :            : 
    1313                 :          0 : ScXMLPreviousContext::ScXMLPreviousContext(  ScXMLImport& rImport,
    1314                 :            :                                               sal_uInt16 nPrfx,
    1315                 :            :                                                    const ::rtl::OUString& rLName,
    1316                 :            :                                               const uno::Reference<xml::sax::XAttributeList>& xAttrList,
    1317                 :            :                                             ScXMLChangeTrackingImportHelper* pTempChangeTrackingImportHelper ) :
    1318                 :            :     SvXMLImportContext( rImport, nPrfx, rLName ),
    1319                 :            :     pChangeTrackingImportHelper(pTempChangeTrackingImportHelper),
    1320                 :            :     pOldCell(NULL),
    1321                 :            :     nID(0),
    1322                 :            :     nMatrixCols(0),
    1323                 :            :     nMatrixRows(0),
    1324                 :            :     eGrammar( formula::FormulaGrammar::GRAM_STORAGE_DEFAULT),
    1325                 :            :     nType(NUMBERFORMAT_ALL),
    1326                 :          0 :     nMatrixFlag(MM_NONE)
    1327                 :            : {
    1328 [ #  # ][ #  # ]:          0 :     sal_Int16 nAttrCount(xAttrList.is() ? xAttrList->getLength() : 0);
                 [ #  # ]
    1329         [ #  # ]:          0 :     for( sal_Int16 i=0; i < nAttrCount; ++i )
    1330                 :            :     {
    1331 [ #  # ][ #  # ]:          0 :         const rtl::OUString& sAttrName(xAttrList->getNameByIndex( i ));
    1332                 :          0 :         rtl::OUString aLocalName;
    1333                 :          0 :         sal_uInt16 nPrefix(GetScImport().GetNamespaceMap().GetKeyByAttrName(
    1334         [ #  # ]:          0 :                                             sAttrName, &aLocalName ));
    1335 [ #  # ][ #  # ]:          0 :         const rtl::OUString& sValue(xAttrList->getValueByIndex( i ));
    1336                 :            : 
    1337         [ #  # ]:          0 :         if (nPrefix == XML_NAMESPACE_TABLE)
    1338                 :            :         {
    1339 [ #  # ][ #  # ]:          0 :             if (IsXMLToken(aLocalName, XML_ID))
    1340         [ #  # ]:          0 :                 nID = pChangeTrackingImportHelper->GetIDFromString(sValue);
    1341                 :            :         }
    1342                 :          0 :     }
    1343                 :          0 : }
    1344                 :            : 
    1345                 :          0 : ScXMLPreviousContext::~ScXMLPreviousContext()
    1346                 :            : {
    1347         [ #  # ]:          0 : }
    1348                 :            : 
    1349                 :          0 : SvXMLImportContext *ScXMLPreviousContext::CreateChildContext( sal_uInt16 nPrefix,
    1350                 :            :                                      const ::rtl::OUString& rLocalName,
    1351                 :            :                                      const ::com::sun::star::uno::Reference<
    1352                 :            :                                           ::com::sun::star::xml::sax::XAttributeList>& xAttrList )
    1353                 :            : {
    1354                 :          0 :     SvXMLImportContext *pContext(0);
    1355                 :            : 
    1356 [ #  # ][ #  # ]:          0 :     if ((nPrefix == XML_NAMESPACE_TABLE) && (IsXMLToken(rLocalName, XML_CHANGE_TRACK_TABLE_CELL)))
                 [ #  # ]
    1357                 :            :         pContext = new ScXMLChangeCellContext(GetScImport(), nPrefix, rLocalName, xAttrList,
    1358         [ #  # ]:          0 :             pOldCell, sFormulaAddress, sFormula, sFormulaNmsp, eGrammar, sInputString, fValue, nType, nMatrixFlag, nMatrixCols, nMatrixRows);
    1359                 :            : 
    1360         [ #  # ]:          0 :     if( !pContext )
    1361         [ #  # ]:          0 :         pContext = new SvXMLImportContext( GetImport(), nPrefix, rLocalName );
    1362                 :            : 
    1363                 :          0 :     return pContext;
    1364                 :            : }
    1365                 :            : 
    1366                 :          0 : void ScXMLPreviousContext::EndElement()
    1367                 :            : {
    1368                 :            :     pChangeTrackingImportHelper->SetPreviousChange(nID, new ScMyCellInfo(pOldCell, sFormulaAddress, sFormula, eGrammar, sInputString,
    1369         [ #  # ]:          0 :         fValue, nType, nMatrixFlag, nMatrixCols, nMatrixRows));
    1370                 :          0 : }
    1371                 :            : 
    1372                 :          0 : ScXMLContentChangeContext::ScXMLContentChangeContext(  ScXMLImport& rImport,
    1373                 :            :                                               sal_uInt16 nPrfx,
    1374                 :            :                                                    const ::rtl::OUString& rLName,
    1375                 :            :                                               const uno::Reference<xml::sax::XAttributeList>& xAttrList,
    1376                 :            :                                             ScXMLChangeTrackingImportHelper* pTempChangeTrackingImportHelper ) :
    1377                 :            :     SvXMLImportContext( rImport, nPrfx, rLName ),
    1378                 :          0 :     pChangeTrackingImportHelper(pTempChangeTrackingImportHelper)
    1379                 :            : {
    1380                 :          0 :     sal_uInt32 nActionNumber(0);
    1381                 :          0 :     sal_uInt32 nRejectingNumber(0);
    1382                 :          0 :     ScChangeActionState nActionState(SC_CAS_VIRGIN);
    1383                 :            : 
    1384 [ #  # ][ #  # ]:          0 :     sal_Int16 nAttrCount(xAttrList.is() ? xAttrList->getLength() : 0);
                 [ #  # ]
    1385         [ #  # ]:          0 :     for( sal_Int16 i=0; i < nAttrCount; ++i )
    1386                 :            :     {
    1387 [ #  # ][ #  # ]:          0 :         const rtl::OUString& sAttrName(xAttrList->getNameByIndex( i ));
    1388                 :          0 :         rtl::OUString aLocalName;
    1389                 :          0 :         sal_uInt16 nPrefix(GetScImport().GetNamespaceMap().GetKeyByAttrName(
    1390         [ #  # ]:          0 :                                             sAttrName, &aLocalName ));
    1391 [ #  # ][ #  # ]:          0 :         const rtl::OUString& sValue(xAttrList->getValueByIndex( i ));
    1392                 :            : 
    1393         [ #  # ]:          0 :         if (nPrefix == XML_NAMESPACE_TABLE)
    1394                 :            :         {
    1395 [ #  # ][ #  # ]:          0 :             if (IsXMLToken(aLocalName, XML_ID))
    1396                 :            :             {
    1397         [ #  # ]:          0 :                 nActionNumber = pChangeTrackingImportHelper->GetIDFromString(sValue);
    1398                 :            :             }
    1399 [ #  # ][ #  # ]:          0 :             else if (IsXMLToken(aLocalName, XML_ACCEPTANCE_STATE))
    1400                 :            :             {
    1401 [ #  # ][ #  # ]:          0 :                 if (IsXMLToken(sValue, XML_ACCEPTED))
    1402                 :          0 :                     nActionState = SC_CAS_ACCEPTED;
    1403 [ #  # ][ #  # ]:          0 :                 else if (IsXMLToken(sValue, XML_REJECTED))
    1404                 :          0 :                     nActionState = SC_CAS_REJECTED;
    1405                 :            :             }
    1406 [ #  # ][ #  # ]:          0 :             else if (IsXMLToken(aLocalName, XML_REJECTING_CHANGE_ID))
    1407                 :            :             {
    1408         [ #  # ]:          0 :                 nRejectingNumber = pChangeTrackingImportHelper->GetIDFromString(sValue);
    1409                 :            :             }
    1410                 :            :         }
    1411                 :          0 :     }
    1412                 :            : 
    1413         [ #  # ]:          0 :     pChangeTrackingImportHelper->StartChangeAction(SC_CAT_CONTENT);
    1414                 :          0 :     pChangeTrackingImportHelper->SetActionNumber(nActionNumber);
    1415                 :          0 :     pChangeTrackingImportHelper->SetActionState(nActionState);
    1416                 :          0 :     pChangeTrackingImportHelper->SetRejectingNumber(nRejectingNumber);
    1417                 :          0 : }
    1418                 :            : 
    1419                 :          0 : ScXMLContentChangeContext::~ScXMLContentChangeContext()
    1420                 :            : {
    1421         [ #  # ]:          0 : }
    1422                 :            : 
    1423                 :          0 : SvXMLImportContext *ScXMLContentChangeContext::CreateChildContext( sal_uInt16 nPrefix,
    1424                 :            :                                      const ::rtl::OUString& rLocalName,
    1425                 :            :                                      const ::com::sun::star::uno::Reference<
    1426                 :            :                                           ::com::sun::star::xml::sax::XAttributeList>& xAttrList )
    1427                 :            : {
    1428                 :          0 :     SvXMLImportContext *pContext(0);
    1429                 :            : 
    1430 [ #  # ][ #  # ]:          0 :     if ((nPrefix == XML_NAMESPACE_OFFICE) && (IsXMLToken(rLocalName, XML_CHANGE_INFO)))
                 [ #  # ]
    1431                 :            :     {
    1432         [ #  # ]:          0 :         pContext = new ScXMLChangeInfoContext(GetScImport(), nPrefix, rLocalName, xAttrList, pChangeTrackingImportHelper);
    1433                 :            :     }
    1434         [ #  # ]:          0 :     else if (nPrefix == XML_NAMESPACE_TABLE)
    1435                 :            :     {
    1436         [ #  # ]:          0 :         if (IsXMLToken(rLocalName, XML_CELL_ADDRESS))
    1437                 :            :         {
    1438         [ #  # ]:          0 :             pContext = new ScXMLBigRangeContext(GetScImport(), nPrefix, rLocalName, xAttrList, aBigRange);
    1439                 :            :         }
    1440         [ #  # ]:          0 :         else if (IsXMLToken(rLocalName, XML_DEPENDENCIES))
    1441                 :            :         {
    1442         [ #  # ]:          0 :             pContext = new ScXMLDependingsContext(GetScImport(), nPrefix, rLocalName, xAttrList, pChangeTrackingImportHelper);
    1443                 :            :         }
    1444         [ #  # ]:          0 :         else if (IsXMLToken(rLocalName, XML_DELETIONS))
    1445         [ #  # ]:          0 :             pContext = new ScXMLDeletionsContext(GetScImport(), nPrefix, rLocalName, xAttrList, pChangeTrackingImportHelper);
    1446         [ #  # ]:          0 :         else if (IsXMLToken(rLocalName, XML_PREVIOUS))
    1447                 :            :         {
    1448         [ #  # ]:          0 :             pContext = new ScXMLPreviousContext(GetScImport(), nPrefix, rLocalName, xAttrList, pChangeTrackingImportHelper);
    1449                 :            :         }
    1450                 :            :     }
    1451                 :            : 
    1452         [ #  # ]:          0 :     if( !pContext )
    1453         [ #  # ]:          0 :         pContext = new SvXMLImportContext( GetImport(), nPrefix, rLocalName );
    1454                 :            : 
    1455                 :          0 :     return pContext;
    1456                 :            : }
    1457                 :            : 
    1458                 :          0 : void ScXMLContentChangeContext::EndElement()
    1459                 :            : {
    1460                 :          0 :     pChangeTrackingImportHelper->SetBigRange(aBigRange);
    1461                 :          0 :     pChangeTrackingImportHelper->EndChangeAction();
    1462                 :          0 : }
    1463                 :            : 
    1464                 :          0 : ScXMLInsertionContext::ScXMLInsertionContext( ScXMLImport& rImport,
    1465                 :            :                                               sal_uInt16 nPrfx,
    1466                 :            :                                                    const ::rtl::OUString& rLName,
    1467                 :            :                                               const uno::Reference<xml::sax::XAttributeList>& xAttrList,
    1468                 :            :                                             ScXMLChangeTrackingImportHelper* pTempChangeTrackingImportHelper ) :
    1469                 :            :     SvXMLImportContext( rImport, nPrfx, rLName ),
    1470                 :          0 :     pChangeTrackingImportHelper(pTempChangeTrackingImportHelper)
    1471                 :            : {
    1472                 :          0 :     sal_uInt32 nActionNumber(0);
    1473                 :          0 :     sal_uInt32 nRejectingNumber(0);
    1474                 :          0 :     sal_Int32 nPosition(0);
    1475                 :          0 :     sal_Int32 nCount(1);
    1476                 :          0 :     sal_Int32 nTable(0);
    1477                 :          0 :     ScChangeActionState nActionState(SC_CAS_VIRGIN);
    1478                 :          0 :     ScChangeActionType nActionType(SC_CAT_INSERT_COLS);
    1479                 :            : 
    1480 [ #  # ][ #  # ]:          0 :     sal_Int16 nAttrCount(xAttrList.is() ? xAttrList->getLength() : 0);
                 [ #  # ]
    1481         [ #  # ]:          0 :     for( sal_Int16 i=0; i < nAttrCount; ++i )
    1482                 :            :     {
    1483 [ #  # ][ #  # ]:          0 :         const rtl::OUString& sAttrName(xAttrList->getNameByIndex( i ));
    1484                 :          0 :         rtl::OUString aLocalName;
    1485                 :          0 :         sal_uInt16 nPrefix(GetScImport().GetNamespaceMap().GetKeyByAttrName(
    1486         [ #  # ]:          0 :                                             sAttrName, &aLocalName ));
    1487 [ #  # ][ #  # ]:          0 :         const rtl::OUString& sValue(xAttrList->getValueByIndex( i ));
    1488                 :            : 
    1489         [ #  # ]:          0 :         if (nPrefix == XML_NAMESPACE_TABLE)
    1490                 :            :         {
    1491 [ #  # ][ #  # ]:          0 :             if (IsXMLToken(aLocalName, XML_ID))
    1492                 :            :             {
    1493         [ #  # ]:          0 :                 nActionNumber = pChangeTrackingImportHelper->GetIDFromString(sValue);
    1494                 :            :             }
    1495 [ #  # ][ #  # ]:          0 :             else if (IsXMLToken(aLocalName, XML_ACCEPTANCE_STATE))
    1496                 :            :             {
    1497 [ #  # ][ #  # ]:          0 :                 if (IsXMLToken(sValue, XML_ACCEPTED))
    1498                 :          0 :                     nActionState = SC_CAS_ACCEPTED;
    1499 [ #  # ][ #  # ]:          0 :                 else if (IsXMLToken(sValue, XML_REJECTED))
    1500                 :          0 :                     nActionState = SC_CAS_REJECTED;
    1501                 :            :             }
    1502 [ #  # ][ #  # ]:          0 :             else if (IsXMLToken(aLocalName, XML_REJECTING_CHANGE_ID))
    1503                 :            :             {
    1504         [ #  # ]:          0 :                 nRejectingNumber = pChangeTrackingImportHelper->GetIDFromString(sValue);
    1505                 :            :             }
    1506 [ #  # ][ #  # ]:          0 :             else if (IsXMLToken(aLocalName, XML_TYPE))
    1507                 :            :             {
    1508 [ #  # ][ #  # ]:          0 :                 if (IsXMLToken(sValue, XML_ROW))
    1509                 :          0 :                     nActionType = SC_CAT_INSERT_ROWS;
    1510 [ #  # ][ #  # ]:          0 :                 else if (IsXMLToken(sValue, XML_TABLE))
    1511                 :          0 :                     nActionType = SC_CAT_INSERT_TABS;
    1512                 :            :             }
    1513 [ #  # ][ #  # ]:          0 :             else if (IsXMLToken(aLocalName, XML_POSITION))
    1514                 :            :             {
    1515         [ #  # ]:          0 :                 ::sax::Converter::convertNumber(nPosition, sValue);
    1516                 :            :             }
    1517 [ #  # ][ #  # ]:          0 :             else if (IsXMLToken(aLocalName, XML_TABLE))
    1518                 :            :             {
    1519         [ #  # ]:          0 :                 ::sax::Converter::convertNumber(nTable, sValue);
    1520                 :            :             }
    1521 [ #  # ][ #  # ]:          0 :             else if (IsXMLToken(aLocalName, XML_COUNT))
    1522                 :            :             {
    1523         [ #  # ]:          0 :                 ::sax::Converter::convertNumber(nCount, sValue);
    1524                 :            :             }
    1525                 :            :         }
    1526                 :          0 :     }
    1527                 :            : 
    1528         [ #  # ]:          0 :     pChangeTrackingImportHelper->StartChangeAction(nActionType);
    1529                 :          0 :     pChangeTrackingImportHelper->SetActionNumber(nActionNumber);
    1530                 :          0 :     pChangeTrackingImportHelper->SetActionState(nActionState);
    1531                 :          0 :     pChangeTrackingImportHelper->SetRejectingNumber(nRejectingNumber);
    1532         [ #  # ]:          0 :     pChangeTrackingImportHelper->SetPosition(nPosition, nCount, nTable);
    1533                 :          0 : }
    1534                 :            : 
    1535                 :          0 : ScXMLInsertionContext::~ScXMLInsertionContext()
    1536                 :            : {
    1537         [ #  # ]:          0 : }
    1538                 :            : 
    1539                 :          0 : SvXMLImportContext *ScXMLInsertionContext::CreateChildContext( sal_uInt16 nPrefix,
    1540                 :            :                                      const ::rtl::OUString& rLocalName,
    1541                 :            :                                      const ::com::sun::star::uno::Reference<
    1542                 :            :                                           ::com::sun::star::xml::sax::XAttributeList>& xAttrList )
    1543                 :            : {
    1544                 :          0 :     SvXMLImportContext *pContext(0);
    1545                 :            : 
    1546 [ #  # ][ #  # ]:          0 :     if ((nPrefix == XML_NAMESPACE_OFFICE) && (IsXMLToken(rLocalName, XML_CHANGE_INFO)))
                 [ #  # ]
    1547                 :            :     {
    1548         [ #  # ]:          0 :         pContext = new ScXMLChangeInfoContext(GetScImport(), nPrefix, rLocalName, xAttrList, pChangeTrackingImportHelper);
    1549                 :            :     }
    1550         [ #  # ]:          0 :     else if (nPrefix == XML_NAMESPACE_TABLE)
    1551                 :            :     {
    1552         [ #  # ]:          0 :         if (IsXMLToken(rLocalName, XML_DEPENDENCIES))
    1553         [ #  # ]:          0 :             pContext = new ScXMLDependingsContext(GetScImport(), nPrefix, rLocalName, xAttrList, pChangeTrackingImportHelper);
    1554         [ #  # ]:          0 :         else if (IsXMLToken(rLocalName, XML_DELETIONS))
    1555         [ #  # ]:          0 :             pContext = new ScXMLDeletionsContext(GetScImport(), nPrefix, rLocalName, xAttrList, pChangeTrackingImportHelper);
    1556                 :            :     }
    1557                 :            : 
    1558         [ #  # ]:          0 :     if( !pContext )
    1559         [ #  # ]:          0 :         pContext = new SvXMLImportContext( GetImport(), nPrefix, rLocalName );
    1560                 :            : 
    1561                 :          0 :     return pContext;
    1562                 :            : }
    1563                 :            : 
    1564                 :          0 : void ScXMLInsertionContext::EndElement()
    1565                 :            : {
    1566                 :          0 :     pChangeTrackingImportHelper->EndChangeAction();
    1567                 :          0 : }
    1568                 :            : 
    1569                 :          0 : ScXMLInsertionCutOffContext::ScXMLInsertionCutOffContext( ScXMLImport& rImport,
    1570                 :            :                                               sal_uInt16 nPrfx,
    1571                 :            :                                                    const ::rtl::OUString& rLName,
    1572                 :            :                                               const uno::Reference<xml::sax::XAttributeList>& xAttrList,
    1573                 :            :                                             ScXMLChangeTrackingImportHelper* pTempChangeTrackingImportHelper ) :
    1574                 :            :     SvXMLImportContext( rImport, nPrfx, rLName ),
    1575                 :          0 :     pChangeTrackingImportHelper(pTempChangeTrackingImportHelper)
    1576                 :            : {
    1577                 :          0 :     sal_uInt32 nID(0);
    1578                 :          0 :     sal_Int32 nPosition(0);
    1579 [ #  # ][ #  # ]:          0 :     sal_Int16 nAttrCount(xAttrList.is() ? xAttrList->getLength() : 0);
                 [ #  # ]
    1580         [ #  # ]:          0 :     for( sal_Int16 i=0; i < nAttrCount; ++i )
    1581                 :            :     {
    1582 [ #  # ][ #  # ]:          0 :         const rtl::OUString& sAttrName(xAttrList->getNameByIndex( i ));
    1583                 :          0 :         rtl::OUString aLocalName;
    1584                 :          0 :         sal_uInt16 nPrefix(GetScImport().GetNamespaceMap().GetKeyByAttrName(
    1585         [ #  # ]:          0 :                                             sAttrName, &aLocalName ));
    1586 [ #  # ][ #  # ]:          0 :         const rtl::OUString& sValue(xAttrList->getValueByIndex( i ));
    1587                 :            : 
    1588         [ #  # ]:          0 :         if (nPrefix == XML_NAMESPACE_TABLE)
    1589                 :            :         {
    1590 [ #  # ][ #  # ]:          0 :             if (IsXMLToken(aLocalName, XML_ID))
    1591                 :            :             {
    1592         [ #  # ]:          0 :                 nID = pChangeTrackingImportHelper->GetIDFromString(sValue);
    1593                 :            :             }
    1594 [ #  # ][ #  # ]:          0 :             else if (IsXMLToken(aLocalName, XML_POSITION))
    1595                 :            :             {
    1596         [ #  # ]:          0 :                 ::sax::Converter::convertNumber(nPosition, sValue);
    1597                 :            :             }
    1598                 :            :         }
    1599                 :          0 :     }
    1600         [ #  # ]:          0 :     pChangeTrackingImportHelper->SetInsertionCutOff(nID, nPosition);
    1601                 :          0 : }
    1602                 :            : 
    1603                 :          0 : ScXMLInsertionCutOffContext::~ScXMLInsertionCutOffContext()
    1604                 :            : {
    1605         [ #  # ]:          0 : }
    1606                 :            : 
    1607                 :          0 : SvXMLImportContext *ScXMLInsertionCutOffContext::CreateChildContext( sal_uInt16 nPrefix,
    1608                 :            :                                      const ::rtl::OUString& rLocalName,
    1609                 :            :                                      const ::com::sun::star::uno::Reference<
    1610                 :            :                                         ::com::sun::star::xml::sax::XAttributeList>& /* xAttrList */ )
    1611                 :            : {
    1612         [ #  # ]:          0 :     return new SvXMLImportContext( GetImport(), nPrefix, rLocalName );
    1613                 :            : }
    1614                 :            : 
    1615                 :          0 : void ScXMLInsertionCutOffContext::EndElement()
    1616                 :            : {
    1617                 :          0 : }
    1618                 :            : 
    1619                 :          0 : ScXMLMovementCutOffContext::ScXMLMovementCutOffContext( ScXMLImport& rImport,
    1620                 :            :                                               sal_uInt16 nPrfx,
    1621                 :            :                                                    const ::rtl::OUString& rLName,
    1622                 :            :                                               const uno::Reference<xml::sax::XAttributeList>& xAttrList,
    1623                 :            :                                             ScXMLChangeTrackingImportHelper* pTempChangeTrackingImportHelper ) :
    1624                 :            :     SvXMLImportContext( rImport, nPrfx, rLName ),
    1625                 :          0 :     pChangeTrackingImportHelper(pTempChangeTrackingImportHelper)
    1626                 :            : {
    1627                 :          0 :     sal_uInt32 nID(0);
    1628                 :          0 :     sal_Int32 nPosition(0);
    1629                 :          0 :     sal_Int32 nStartPosition(0);
    1630                 :          0 :     sal_Int32 nEndPosition(0);
    1631                 :          0 :     sal_Bool bPosition(false);
    1632 [ #  # ][ #  # ]:          0 :     sal_Int16 nAttrCount(xAttrList.is() ? xAttrList->getLength() : 0);
                 [ #  # ]
    1633         [ #  # ]:          0 :     for( sal_Int16 i=0; i < nAttrCount; ++i )
    1634                 :            :     {
    1635 [ #  # ][ #  # ]:          0 :         const rtl::OUString& sAttrName(xAttrList->getNameByIndex( i ));
    1636                 :          0 :         rtl::OUString aLocalName;
    1637                 :          0 :         sal_uInt16 nPrefix(GetScImport().GetNamespaceMap().GetKeyByAttrName(
    1638         [ #  # ]:          0 :                                             sAttrName, &aLocalName ));
    1639 [ #  # ][ #  # ]:          0 :         const rtl::OUString& sValue(xAttrList->getValueByIndex( i ));
    1640                 :            : 
    1641         [ #  # ]:          0 :         if (nPrefix == XML_NAMESPACE_TABLE)
    1642                 :            :         {
    1643 [ #  # ][ #  # ]:          0 :             if (IsXMLToken(aLocalName, XML_ID))
    1644                 :            :             {
    1645         [ #  # ]:          0 :                 nID = pChangeTrackingImportHelper->GetIDFromString(sValue);
    1646                 :            :             }
    1647 [ #  # ][ #  # ]:          0 :             else if (IsXMLToken(aLocalName, XML_POSITION))
    1648                 :            :             {
    1649                 :          0 :                 bPosition = sal_True;
    1650         [ #  # ]:          0 :                 ::sax::Converter::convertNumber(nPosition, sValue);
    1651                 :            :             }
    1652 [ #  # ][ #  # ]:          0 :             else if (IsXMLToken(aLocalName, XML_START_POSITION))
    1653                 :            :             {
    1654         [ #  # ]:          0 :                 ::sax::Converter::convertNumber(nStartPosition, sValue);
    1655                 :            :             }
    1656 [ #  # ][ #  # ]:          0 :             else if (IsXMLToken(aLocalName, XML_END_POSITION))
    1657                 :            :             {
    1658         [ #  # ]:          0 :                 ::sax::Converter::convertNumber(nEndPosition, sValue);
    1659                 :            :             }
    1660                 :            :         }
    1661                 :          0 :     }
    1662         [ #  # ]:          0 :     if (bPosition)
    1663                 :          0 :         nStartPosition = nEndPosition = nPosition;
    1664         [ #  # ]:          0 :     pChangeTrackingImportHelper->AddMoveCutOff(nID, nStartPosition, nEndPosition);
    1665                 :          0 : }
    1666                 :            : 
    1667                 :          0 : ScXMLMovementCutOffContext::~ScXMLMovementCutOffContext()
    1668                 :            : {
    1669         [ #  # ]:          0 : }
    1670                 :            : 
    1671                 :          0 : SvXMLImportContext *ScXMLMovementCutOffContext::CreateChildContext( sal_uInt16 nPrefix,
    1672                 :            :                                      const ::rtl::OUString& rLocalName,
    1673                 :            :                                      const ::com::sun::star::uno::Reference<
    1674                 :            :                                         ::com::sun::star::xml::sax::XAttributeList>& /* xAttrList */ )
    1675                 :            : {
    1676         [ #  # ]:          0 :     return new SvXMLImportContext( GetImport(), nPrefix, rLocalName );
    1677                 :            : }
    1678                 :            : 
    1679                 :          0 : void ScXMLMovementCutOffContext::EndElement()
    1680                 :            : {
    1681                 :          0 : }
    1682                 :            : 
    1683                 :          0 : ScXMLCutOffsContext::ScXMLCutOffsContext( ScXMLImport& rImport,
    1684                 :            :                                               sal_uInt16 nPrfx,
    1685                 :            :                                                    const ::rtl::OUString& rLName,
    1686                 :            :                                             const uno::Reference<xml::sax::XAttributeList>& /* xAttrList */,
    1687                 :            :                                             ScXMLChangeTrackingImportHelper* pTempChangeTrackingImportHelper ) :
    1688                 :            :     SvXMLImportContext( rImport, nPrfx, rLName ),
    1689                 :          0 :     pChangeTrackingImportHelper(pTempChangeTrackingImportHelper)
    1690                 :            : {
    1691                 :            :     // here are no attributes
    1692                 :          0 : }
    1693                 :            : 
    1694                 :          0 : ScXMLCutOffsContext::~ScXMLCutOffsContext()
    1695                 :            : {
    1696         [ #  # ]:          0 : }
    1697                 :            : 
    1698                 :          0 : SvXMLImportContext *ScXMLCutOffsContext::CreateChildContext( sal_uInt16 nPrefix,
    1699                 :            :                                      const ::rtl::OUString& rLocalName,
    1700                 :            :                                      const ::com::sun::star::uno::Reference<
    1701                 :            :                                           ::com::sun::star::xml::sax::XAttributeList>& xAttrList )
    1702                 :            : {
    1703                 :          0 :     SvXMLImportContext *pContext(0);
    1704                 :            : 
    1705         [ #  # ]:          0 :     if (nPrefix == XML_NAMESPACE_TABLE)
    1706                 :            :     {
    1707         [ #  # ]:          0 :         if (IsXMLToken(rLocalName, XML_INSERTION_CUT_OFF))
    1708         [ #  # ]:          0 :             pContext = new ScXMLInsertionCutOffContext(GetScImport(), nPrefix, rLocalName, xAttrList, pChangeTrackingImportHelper);
    1709         [ #  # ]:          0 :         else if (IsXMLToken(rLocalName, XML_MOVEMENT_CUT_OFF))
    1710         [ #  # ]:          0 :             pContext = new ScXMLMovementCutOffContext(GetScImport(), nPrefix, rLocalName, xAttrList, pChangeTrackingImportHelper);
    1711                 :            :     }
    1712                 :            : 
    1713         [ #  # ]:          0 :     if( !pContext )
    1714         [ #  # ]:          0 :         pContext = new SvXMLImportContext( GetImport(), nPrefix, rLocalName );
    1715                 :            : 
    1716                 :          0 :     return pContext;
    1717                 :            : }
    1718                 :            : 
    1719                 :          0 : void ScXMLCutOffsContext::EndElement()
    1720                 :            : {
    1721                 :          0 : }
    1722                 :            : 
    1723                 :          0 : ScXMLDeletionContext::ScXMLDeletionContext( ScXMLImport& rImport,
    1724                 :            :                                               sal_uInt16 nPrfx,
    1725                 :            :                                                    const ::rtl::OUString& rLName,
    1726                 :            :                                               const uno::Reference<xml::sax::XAttributeList>& xAttrList,
    1727                 :            :                                             ScXMLChangeTrackingImportHelper* pTempChangeTrackingImportHelper ) :
    1728                 :            :     SvXMLImportContext( rImport, nPrfx, rLName ),
    1729                 :          0 :     pChangeTrackingImportHelper(pTempChangeTrackingImportHelper)
    1730                 :            : {
    1731                 :          0 :     sal_uInt32 nActionNumber(0);
    1732                 :          0 :     sal_uInt32 nRejectingNumber(0);
    1733                 :          0 :     sal_Int32 nPosition(0);
    1734                 :          0 :     sal_Int32 nMultiSpanned(0);
    1735                 :          0 :     sal_Int32 nTable(0);
    1736                 :          0 :     ScChangeActionState nActionState(SC_CAS_VIRGIN);
    1737                 :          0 :     ScChangeActionType nActionType(SC_CAT_DELETE_COLS);
    1738                 :            : 
    1739 [ #  # ][ #  # ]:          0 :     sal_Int16 nAttrCount(xAttrList.is() ? xAttrList->getLength() : 0);
                 [ #  # ]
    1740         [ #  # ]:          0 :     for( sal_Int16 i=0; i < nAttrCount; i++ )
    1741                 :            :     {
    1742 [ #  # ][ #  # ]:          0 :         const rtl::OUString& sAttrName(xAttrList->getNameByIndex( i ));
    1743                 :          0 :         rtl::OUString aLocalName;
    1744                 :          0 :         sal_uInt16 nPrefix(GetScImport().GetNamespaceMap().GetKeyByAttrName(
    1745         [ #  # ]:          0 :                                             sAttrName, &aLocalName ));
    1746 [ #  # ][ #  # ]:          0 :         const rtl::OUString& sValue(xAttrList->getValueByIndex( i ));
    1747                 :            : 
    1748         [ #  # ]:          0 :         if (nPrefix == XML_NAMESPACE_TABLE)
    1749                 :            :         {
    1750 [ #  # ][ #  # ]:          0 :             if (IsXMLToken(aLocalName, XML_ID))
    1751                 :            :             {
    1752         [ #  # ]:          0 :                 nActionNumber = pChangeTrackingImportHelper->GetIDFromString(sValue);
    1753                 :            :             }
    1754 [ #  # ][ #  # ]:          0 :             else if (IsXMLToken(aLocalName, XML_ACCEPTANCE_STATE))
    1755                 :            :             {
    1756 [ #  # ][ #  # ]:          0 :                 if (IsXMLToken(sValue, XML_ACCEPTED))
    1757                 :          0 :                     nActionState = SC_CAS_ACCEPTED;
    1758 [ #  # ][ #  # ]:          0 :                 else if (IsXMLToken(sValue, XML_REJECTED))
    1759                 :          0 :                     nActionState = SC_CAS_REJECTED;
    1760                 :            :             }
    1761 [ #  # ][ #  # ]:          0 :             else if (IsXMLToken(aLocalName, XML_REJECTING_CHANGE_ID))
    1762                 :            :             {
    1763         [ #  # ]:          0 :                 nRejectingNumber = pChangeTrackingImportHelper->GetIDFromString(sValue);
    1764                 :            :             }
    1765 [ #  # ][ #  # ]:          0 :             else if (IsXMLToken(aLocalName, XML_TYPE))
    1766                 :            :             {
    1767 [ #  # ][ #  # ]:          0 :                 if (IsXMLToken(sValue, XML_ROW))
    1768                 :            :                 {
    1769                 :          0 :                     nActionType = SC_CAT_DELETE_ROWS;
    1770                 :            :                 }
    1771 [ #  # ][ #  # ]:          0 :                 else if (IsXMLToken(aLocalName, XML_TABLE))
    1772                 :            :                 {
    1773                 :          0 :                     nActionType = SC_CAT_DELETE_TABS;
    1774                 :            :                 }
    1775                 :            :             }
    1776 [ #  # ][ #  # ]:          0 :             else if (IsXMLToken(aLocalName, XML_POSITION))
    1777                 :            :             {
    1778         [ #  # ]:          0 :                 ::sax::Converter::convertNumber(nPosition, sValue);
    1779                 :            :             }
    1780 [ #  # ][ #  # ]:          0 :             else if (IsXMLToken(aLocalName, XML_TABLE))
    1781                 :            :             {
    1782         [ #  # ]:          0 :                 ::sax::Converter::convertNumber(nTable, sValue);
    1783                 :            :             }
    1784 [ #  # ][ #  # ]:          0 :             else if (IsXMLToken(aLocalName, XML_MULTI_DELETION_SPANNED))
    1785                 :            :             {
    1786         [ #  # ]:          0 :                 ::sax::Converter::convertNumber(nMultiSpanned, sValue);
    1787                 :            :             }
    1788                 :            :         }
    1789                 :          0 :     }
    1790                 :            : 
    1791         [ #  # ]:          0 :     pChangeTrackingImportHelper->StartChangeAction(nActionType);
    1792                 :          0 :     pChangeTrackingImportHelper->SetActionNumber(nActionNumber);
    1793                 :          0 :     pChangeTrackingImportHelper->SetActionState(nActionState);
    1794                 :          0 :     pChangeTrackingImportHelper->SetRejectingNumber(nRejectingNumber);
    1795         [ #  # ]:          0 :     pChangeTrackingImportHelper->SetPosition(nPosition, 1, nTable);
    1796         [ #  # ]:          0 :     pChangeTrackingImportHelper->SetMultiSpanned(static_cast<sal_Int16>(nMultiSpanned));
    1797                 :          0 : }
    1798                 :            : 
    1799                 :          0 : ScXMLDeletionContext::~ScXMLDeletionContext()
    1800                 :            : {
    1801         [ #  # ]:          0 : }
    1802                 :            : 
    1803                 :          0 : SvXMLImportContext *ScXMLDeletionContext::CreateChildContext( sal_uInt16 nPrefix,
    1804                 :            :                                      const ::rtl::OUString& rLocalName,
    1805                 :            :                                      const ::com::sun::star::uno::Reference<
    1806                 :            :                                           ::com::sun::star::xml::sax::XAttributeList>& xAttrList )
    1807                 :            : {
    1808                 :          0 :     SvXMLImportContext *pContext(0);
    1809                 :            : 
    1810 [ #  # ][ #  # ]:          0 :     if ((nPrefix == XML_NAMESPACE_OFFICE) && (IsXMLToken(rLocalName, XML_CHANGE_INFO)))
                 [ #  # ]
    1811                 :            :     {
    1812         [ #  # ]:          0 :         pContext = new ScXMLChangeInfoContext(GetScImport(), nPrefix, rLocalName, xAttrList, pChangeTrackingImportHelper);
    1813                 :            :     }
    1814         [ #  # ]:          0 :     else if (nPrefix == XML_NAMESPACE_TABLE)
    1815                 :            :     {
    1816         [ #  # ]:          0 :         if (IsXMLToken(rLocalName, XML_DEPENDENCIES))
    1817         [ #  # ]:          0 :             pContext = new ScXMLDependingsContext(GetScImport(), nPrefix, rLocalName, xAttrList, pChangeTrackingImportHelper);
    1818         [ #  # ]:          0 :         else if (IsXMLToken(rLocalName, XML_DELETIONS))
    1819         [ #  # ]:          0 :             pContext = new ScXMLDeletionsContext(GetScImport(), nPrefix, rLocalName, xAttrList, pChangeTrackingImportHelper);
    1820 [ #  # ][ #  # ]:          0 :         else if (IsXMLToken(rLocalName, XML_CUT_OFFS) || rLocalName.equalsAsciiL("cut_offs", 8))
                 [ #  # ]
    1821         [ #  # ]:          0 :             pContext = new ScXMLCutOffsContext(GetScImport(), nPrefix, rLocalName, xAttrList, pChangeTrackingImportHelper);
    1822                 :            :         else
    1823                 :            :         {
    1824                 :            :             OSL_FAIL("don't know this");
    1825                 :            :         }
    1826                 :            :     }
    1827                 :            : 
    1828         [ #  # ]:          0 :     if( !pContext )
    1829         [ #  # ]:          0 :         pContext = new SvXMLImportContext( GetImport(), nPrefix, rLocalName );
    1830                 :            : 
    1831                 :          0 :     return pContext;
    1832                 :            : }
    1833                 :            : 
    1834                 :          0 : void ScXMLDeletionContext::EndElement()
    1835                 :            : {
    1836                 :          0 :     pChangeTrackingImportHelper->EndChangeAction();
    1837                 :          0 : }
    1838                 :            : 
    1839                 :          0 : ScXMLMovementContext::ScXMLMovementContext( ScXMLImport& rImport,
    1840                 :            :                                               sal_uInt16 nPrfx,
    1841                 :            :                                                    const ::rtl::OUString& rLName,
    1842                 :            :                                               const uno::Reference<xml::sax::XAttributeList>& xAttrList,
    1843                 :            :                                             ScXMLChangeTrackingImportHelper* pTempChangeTrackingImportHelper ) :
    1844                 :            :     SvXMLImportContext( rImport, nPrfx, rLName ),
    1845                 :          0 :     pChangeTrackingImportHelper(pTempChangeTrackingImportHelper)
    1846                 :            : {
    1847                 :          0 :     sal_uInt32 nActionNumber(0);
    1848                 :          0 :     sal_uInt32 nRejectingNumber(0);
    1849                 :          0 :     ScChangeActionState nActionState(SC_CAS_VIRGIN);
    1850                 :            : 
    1851 [ #  # ][ #  # ]:          0 :     sal_Int16 nAttrCount(xAttrList.is() ? xAttrList->getLength() : 0);
                 [ #  # ]
    1852         [ #  # ]:          0 :     for( sal_Int16 i=0; i < nAttrCount; ++i )
    1853                 :            :     {
    1854 [ #  # ][ #  # ]:          0 :         const rtl::OUString& sAttrName(xAttrList->getNameByIndex( i ));
    1855                 :          0 :         rtl::OUString aLocalName;
    1856                 :          0 :         sal_uInt16 nPrefix(GetScImport().GetNamespaceMap().GetKeyByAttrName(
    1857         [ #  # ]:          0 :                                             sAttrName, &aLocalName ));
    1858 [ #  # ][ #  # ]:          0 :         const rtl::OUString& sValue(xAttrList->getValueByIndex( i ));
    1859                 :            : 
    1860         [ #  # ]:          0 :         if (nPrefix == XML_NAMESPACE_TABLE)
    1861                 :            :         {
    1862 [ #  # ][ #  # ]:          0 :             if (IsXMLToken(aLocalName, XML_ID))
    1863                 :            :             {
    1864         [ #  # ]:          0 :                 nActionNumber = pChangeTrackingImportHelper->GetIDFromString(sValue);
    1865                 :            :             }
    1866 [ #  # ][ #  # ]:          0 :             else if (IsXMLToken(aLocalName, XML_ACCEPTANCE_STATE))
    1867                 :            :             {
    1868 [ #  # ][ #  # ]:          0 :                 if (IsXMLToken(sValue, XML_ACCEPTED))
    1869                 :          0 :                     nActionState = SC_CAS_ACCEPTED;
    1870 [ #  # ][ #  # ]:          0 :                 else if (IsXMLToken(sValue, XML_REJECTED))
    1871                 :          0 :                     nActionState = SC_CAS_REJECTED;
    1872                 :            :             }
    1873 [ #  # ][ #  # ]:          0 :             else if (IsXMLToken(aLocalName, XML_REJECTING_CHANGE_ID))
    1874                 :            :             {
    1875         [ #  # ]:          0 :                 nRejectingNumber = pChangeTrackingImportHelper->GetIDFromString(sValue);
    1876                 :            :             }
    1877                 :            :         }
    1878                 :          0 :     }
    1879                 :            : 
    1880         [ #  # ]:          0 :     pChangeTrackingImportHelper->StartChangeAction(SC_CAT_MOVE);
    1881                 :          0 :     pChangeTrackingImportHelper->SetActionNumber(nActionNumber);
    1882                 :          0 :     pChangeTrackingImportHelper->SetActionState(nActionState);
    1883                 :          0 :     pChangeTrackingImportHelper->SetRejectingNumber(nRejectingNumber);
    1884                 :          0 : }
    1885                 :            : 
    1886                 :          0 : ScXMLMovementContext::~ScXMLMovementContext()
    1887                 :            : {
    1888         [ #  # ]:          0 : }
    1889                 :            : 
    1890                 :          0 : SvXMLImportContext *ScXMLMovementContext::CreateChildContext( sal_uInt16 nPrefix,
    1891                 :            :                                      const ::rtl::OUString& rLocalName,
    1892                 :            :                                      const ::com::sun::star::uno::Reference<
    1893                 :            :                                           ::com::sun::star::xml::sax::XAttributeList>& xAttrList )
    1894                 :            : {
    1895                 :          0 :     SvXMLImportContext *pContext(0);
    1896                 :            : 
    1897 [ #  # ][ #  # ]:          0 :     if ((nPrefix == XML_NAMESPACE_OFFICE) && (IsXMLToken(rLocalName, XML_CHANGE_INFO)))
                 [ #  # ]
    1898                 :            :     {
    1899         [ #  # ]:          0 :         pContext = new ScXMLChangeInfoContext(GetScImport(), nPrefix, rLocalName, xAttrList, pChangeTrackingImportHelper);
    1900                 :            :     }
    1901         [ #  # ]:          0 :     else if (nPrefix == XML_NAMESPACE_TABLE)
    1902                 :            :     {
    1903         [ #  # ]:          0 :         if (IsXMLToken(rLocalName, XML_DEPENDENCIES))
    1904         [ #  # ]:          0 :             pContext = new ScXMLDependingsContext(GetScImport(), nPrefix, rLocalName, xAttrList, pChangeTrackingImportHelper);
    1905         [ #  # ]:          0 :         else if (IsXMLToken(rLocalName, XML_DELETIONS))
    1906         [ #  # ]:          0 :             pContext = new ScXMLDeletionsContext(GetScImport(), nPrefix, rLocalName, xAttrList, pChangeTrackingImportHelper);
    1907         [ #  # ]:          0 :         else if (IsXMLToken(rLocalName, XML_SOURCE_RANGE_ADDRESS))
    1908         [ #  # ]:          0 :             pContext = new ScXMLBigRangeContext(GetScImport(), nPrefix, rLocalName, xAttrList, aSourceRange);
    1909         [ #  # ]:          0 :         else if (IsXMLToken(rLocalName, XML_TARGET_RANGE_ADDRESS))
    1910         [ #  # ]:          0 :             pContext = new ScXMLBigRangeContext(GetScImport(), nPrefix, rLocalName, xAttrList, aTargetRange);
    1911                 :            :     }
    1912                 :            : 
    1913         [ #  # ]:          0 :     if( !pContext )
    1914         [ #  # ]:          0 :         pContext = new SvXMLImportContext( GetImport(), nPrefix, rLocalName );
    1915                 :            : 
    1916                 :          0 :     return pContext;
    1917                 :            : }
    1918                 :            : 
    1919                 :          0 : void ScXMLMovementContext::EndElement()
    1920                 :            : {
    1921                 :          0 :     pChangeTrackingImportHelper->SetMoveRanges(aSourceRange, aTargetRange);
    1922                 :          0 :     pChangeTrackingImportHelper->EndChangeAction();
    1923                 :          0 : }
    1924                 :            : 
    1925                 :          0 : ScXMLRejectionContext::ScXMLRejectionContext( ScXMLImport& rImport,
    1926                 :            :                                               sal_uInt16 nPrfx,
    1927                 :            :                                                    const ::rtl::OUString& rLName,
    1928                 :            :                                               const uno::Reference<xml::sax::XAttributeList>& xAttrList,
    1929                 :            :                                             ScXMLChangeTrackingImportHelper* pTempChangeTrackingImportHelper ) :
    1930                 :            :     SvXMLImportContext( rImport, nPrfx, rLName ),
    1931                 :          0 :     pChangeTrackingImportHelper(pTempChangeTrackingImportHelper)
    1932                 :            : {
    1933                 :          0 :     sal_uInt32 nActionNumber(0);
    1934                 :          0 :     sal_uInt32 nRejectingNumber(0);
    1935                 :          0 :     ScChangeActionState nActionState(SC_CAS_VIRGIN);
    1936                 :            : 
    1937 [ #  # ][ #  # ]:          0 :     sal_Int16 nAttrCount(xAttrList.is() ? xAttrList->getLength() : 0);
                 [ #  # ]
    1938         [ #  # ]:          0 :     for( sal_Int16 i=0; i < nAttrCount; ++i )
    1939                 :            :     {
    1940 [ #  # ][ #  # ]:          0 :         const rtl::OUString& sAttrName(xAttrList->getNameByIndex( i ));
    1941                 :          0 :         rtl::OUString aLocalName;
    1942                 :          0 :         sal_uInt16 nPrefix(GetScImport().GetNamespaceMap().GetKeyByAttrName(
    1943         [ #  # ]:          0 :                                             sAttrName, &aLocalName ));
    1944 [ #  # ][ #  # ]:          0 :         const rtl::OUString& sValue(xAttrList->getValueByIndex( i ));
    1945                 :            : 
    1946         [ #  # ]:          0 :         if (nPrefix == XML_NAMESPACE_TABLE)
    1947                 :            :         {
    1948 [ #  # ][ #  # ]:          0 :             if (IsXMLToken(aLocalName, XML_ID))
    1949                 :            :             {
    1950         [ #  # ]:          0 :                 nActionNumber = pChangeTrackingImportHelper->GetIDFromString(sValue);
    1951                 :            :             }
    1952 [ #  # ][ #  # ]:          0 :             else if (IsXMLToken(aLocalName, XML_ACCEPTANCE_STATE))
    1953                 :            :             {
    1954 [ #  # ][ #  # ]:          0 :                 if (IsXMLToken(sValue, XML_ACCEPTED))
    1955                 :          0 :                     nActionState = SC_CAS_ACCEPTED;
    1956 [ #  # ][ #  # ]:          0 :                 else if (IsXMLToken(sValue, XML_REJECTED))
    1957                 :          0 :                     nActionState = SC_CAS_REJECTED;
    1958                 :            :             }
    1959 [ #  # ][ #  # ]:          0 :             else if (IsXMLToken(aLocalName, XML_REJECTING_CHANGE_ID))
    1960                 :            :             {
    1961         [ #  # ]:          0 :                 nRejectingNumber = pChangeTrackingImportHelper->GetIDFromString(sValue);
    1962                 :            :             }
    1963                 :            :         }
    1964                 :          0 :     }
    1965                 :            : 
    1966         [ #  # ]:          0 :     pChangeTrackingImportHelper->StartChangeAction(SC_CAT_MOVE);
    1967                 :          0 :     pChangeTrackingImportHelper->SetActionNumber(nActionNumber);
    1968                 :          0 :     pChangeTrackingImportHelper->SetActionState(nActionState);
    1969                 :          0 :     pChangeTrackingImportHelper->SetRejectingNumber(nRejectingNumber);
    1970                 :          0 : }
    1971                 :            : 
    1972                 :          0 : ScXMLRejectionContext::~ScXMLRejectionContext()
    1973                 :            : {
    1974         [ #  # ]:          0 : }
    1975                 :            : 
    1976                 :          0 : SvXMLImportContext *ScXMLRejectionContext::CreateChildContext( sal_uInt16 nPrefix,
    1977                 :            :                                      const ::rtl::OUString& rLocalName,
    1978                 :            :                                      const ::com::sun::star::uno::Reference<
    1979                 :            :                                           ::com::sun::star::xml::sax::XAttributeList>& xAttrList )
    1980                 :            : {
    1981                 :          0 :     SvXMLImportContext *pContext(0);
    1982                 :            : 
    1983 [ #  # ][ #  # ]:          0 :     if ((nPrefix == XML_NAMESPACE_OFFICE) && (IsXMLToken(rLocalName, XML_CHANGE_INFO)))
                 [ #  # ]
    1984                 :            :     {
    1985         [ #  # ]:          0 :         pContext = new ScXMLChangeInfoContext(GetScImport(), nPrefix, rLocalName, xAttrList, pChangeTrackingImportHelper);
    1986                 :            :     }
    1987         [ #  # ]:          0 :     else if (nPrefix == XML_NAMESPACE_TABLE)
    1988                 :            :     {
    1989         [ #  # ]:          0 :         if (IsXMLToken(rLocalName, XML_DEPENDENCIES))
    1990         [ #  # ]:          0 :             pContext = new ScXMLDependingsContext(GetScImport(), nPrefix, rLocalName, xAttrList, pChangeTrackingImportHelper);
    1991         [ #  # ]:          0 :         else if (IsXMLToken(rLocalName, XML_DELETIONS))
    1992         [ #  # ]:          0 :             pContext = new ScXMLDeletionsContext(GetScImport(), nPrefix, rLocalName, xAttrList, pChangeTrackingImportHelper);
    1993                 :            :     }
    1994                 :            : 
    1995         [ #  # ]:          0 :     if( !pContext )
    1996         [ #  # ]:          0 :         pContext = new SvXMLImportContext( GetImport(), nPrefix, rLocalName );
    1997                 :            : 
    1998                 :          0 :     return pContext;
    1999                 :            : }
    2000                 :            : 
    2001                 :          0 : void ScXMLRejectionContext::EndElement()
    2002                 :            : {
    2003                 :          0 :     pChangeTrackingImportHelper->EndChangeAction();
    2004                 :          0 : }
    2005                 :            : 
    2006                 :            : 
    2007                 :            : 
    2008                 :            : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */

Generated by: LCOV version 1.10