LCOV - code coverage report
Current view: top level - sc/inc - cellsuno.hxx (source / functions) Hit Total Coverage
Test: commit 10e77ab3ff6f4314137acd6e2702a6e5c1ce1fae Lines: 4 6 66.7 %
Date: 2014-11-03 Functions: 4 6 66.7 %
Legend: Lines: hit not hit

          Line data    Source code
       1             : /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
       2             : /*
       3             :  * This file is part of the LibreOffice project.
       4             :  *
       5             :  * This Source Code Form is subject to the terms of the Mozilla Public
       6             :  * License, v. 2.0. If a copy of the MPL was not distributed with this
       7             :  * file, You can obtain one at http://mozilla.org/MPL/2.0/.
       8             :  *
       9             :  * This file incorporates work covered by the following license notice:
      10             :  *
      11             :  *   Licensed to the Apache Software Foundation (ASF) under one or more
      12             :  *   contributor license agreements. See the NOTICE file distributed
      13             :  *   with this work for additional information regarding copyright
      14             :  *   ownership. The ASF licenses this file to you under the Apache
      15             :  *   License, Version 2.0 (the "License"); you may not use this file
      16             :  *   except in compliance with the License. You may obtain a copy of
      17             :  *   the License at http://www.apache.org/licenses/LICENSE-2.0 .
      18             :  */
      19             : 
      20             : #ifndef INCLUDED_SC_INC_CELLSUNO_HXX
      21             : #define INCLUDED_SC_INC_CELLSUNO_HXX
      22             : 
      23             : #include "global.hxx"
      24             : #include "rangelst.hxx"
      25             : 
      26             : #include <editeng/unotext.hxx>
      27             : #include <formula/grammar.hxx>
      28             : #include <rtl/ref.hxx>
      29             : #include <tools/link.hxx>
      30             : #include <svl/lstner.hxx>
      31             : #include <svl/listener.hxx>
      32             : #include <svl/itemprop.hxx>
      33             : #include <com/sun/star/table/XTableChartsSupplier.hpp>
      34             : #include <com/sun/star/chart/XChartDataArray.hpp>
      35             : #include <com/sun/star/text/XTextFieldsSupplier.hpp>
      36             : #include <com/sun/star/drawing/XDrawPageSupplier.hpp>
      37             : #include <com/sun/star/sheet/XSheetCellRange.hpp>
      38             : #include <com/sun/star/sheet/XFormulaQuery.hpp>
      39             : #include <com/sun/star/sheet/XCellRangeAddressable.hpp>
      40             : #include <com/sun/star/sheet/XSheetOperation.hpp>
      41             : #include <com/sun/star/sheet/XSheetCellRangeContainer.hpp>
      42             : #include <com/sun/star/sheet/XCellFormatRangesSupplier.hpp>
      43             : #include <com/sun/star/sheet/XUniqueCellFormatRangesSupplier.hpp>
      44             : #include <com/sun/star/sheet/XCellRangesQuery.hpp>
      45             : #include <com/sun/star/sheet/XSheetFilterableEx.hpp>
      46             : #include <com/sun/star/sheet/XSpreadsheet.hpp>
      47             : #include <com/sun/star/sheet/XSheetPageBreak.hpp>
      48             : #include <com/sun/star/sheet/XCellRangeMovement.hpp>
      49             : #include <com/sun/star/text/XText.hpp>
      50             : #include <com/sun/star/sheet/XPrintAreas.hpp>
      51             : #include <com/sun/star/sheet/XSheetLinkable.hpp>
      52             : #include <com/sun/star/sheet/XSubTotalCalculatable.hpp>
      53             : #include <com/sun/star/sheet/XArrayFormulaRange.hpp>
      54             : #include <com/sun/star/sheet/XCellRangeData.hpp>
      55             : #include <com/sun/star/sheet/XCellRangeFormula.hpp>
      56             : #include <com/sun/star/sheet/XCellSeries.hpp>
      57             : #include <com/sun/star/sheet/XMultipleOperation.hpp>
      58             : #include <com/sun/star/sheet/XFormulaTokens.hpp>
      59             : #include <com/sun/star/sheet/XArrayFormulaTokens.hpp>
      60             : #include <com/sun/star/sheet/XCellAddressable.hpp>
      61             : #include <com/sun/star/util/XReplaceable.hpp>
      62             : #include <com/sun/star/util/XIndent.hpp>
      63             : #include <com/sun/star/lang/XServiceInfo.hpp>
      64             : #include <com/sun/star/container/XNameContainer.hpp>
      65             : #include <com/sun/star/util/XMergeable.hpp>
      66             : #include <com/sun/star/table/XAutoFormattable.hpp>
      67             : #include <com/sun/star/util/XSortable.hpp>
      68             : #include <com/sun/star/util/XImportable.hpp>
      69             : #include <com/sun/star/table/XColumnRowRange.hpp>
      70             : #include <com/sun/star/table/XCell2.hpp>
      71             : #include <com/sun/star/table/BorderLine2.hpp>
      72             : #include <com/sun/star/table/TableBorder.hpp>
      73             : #include <com/sun/star/table/TableBorder2.hpp>
      74             : #include <com/sun/star/sheet/XDataPilotTablesSupplier.hpp>
      75             : #include <com/sun/star/sheet/XSheetAnnotationAnchor.hpp>
      76             : #include <com/sun/star/sheet/XScenariosSupplier.hpp>
      77             : #include <com/sun/star/sheet/XSheetAnnotationsSupplier.hpp>
      78             : #include <com/sun/star/sheet/XSheetAuditing.hpp>
      79             : #include <com/sun/star/sheet/XSheetOutline.hpp>
      80             : #include <com/sun/star/util/XProtectable.hpp>
      81             : #include <com/sun/star/sheet/XScenario.hpp>
      82             : #include <com/sun/star/sheet/XScenarioEnhanced.hpp>
      83             : #include <com/sun/star/util/XModifyBroadcaster.hpp>
      84             : #include <com/sun/star/beans/XPropertyState.hpp>
      85             : #include <com/sun/star/beans/XMultiPropertySet.hpp>
      86             : #include <com/sun/star/lang/XUnoTunnel.hpp>
      87             : #include <com/sun/star/document/XActionLockable.hpp>
      88             : #include <com/sun/star/beans/XTolerantMultiPropertySet.hpp>
      89             : #include <com/sun/star/sheet/XExternalSheetName.hpp>
      90             : #include <com/sun/star/document/XEventsSupplier.hpp>
      91             : #include <cppuhelper/implbase2.hxx>
      92             : #include <cppuhelper/implbase3.hxx>
      93             : #include <boost/ptr_container/ptr_vector.hpp>
      94             : #include <boost/scoped_ptr.hpp>
      95             : 
      96             : #include <vector>
      97             : 
      98             : class ScDocShell;
      99             : class ScMarkData;
     100             : class ScMemChart;
     101             : class ScPrintRangeSaver;
     102             : class ScAttrRectIterator;
     103             : class ScCellRangeObj;
     104             : class ScLinkListener;
     105             : class ScPatternAttr;
     106             : class SvxBoxItem;
     107             : class SvxBoxInfoItem;
     108             : class SvxItemPropertySet;
     109             : 
     110             : namespace editeng { class SvxBorderLine; }
     111             : 
     112             : class ScLinkListener : public SvtListener
     113             : {
     114             :     Link    aLink;
     115             : public:
     116        7258 :                     ScLinkListener(const Link& rL) : aLink(rL) {}
     117             :     virtual         ~ScLinkListener();
     118             :     virtual void Notify( const SfxHint& rHint ) SAL_OVERRIDE;
     119             : };
     120             : 
     121             : typedef ::com::sun::star::uno::Reference<
     122             :             ::com::sun::star::util::XModifyListener > XModifyListenerRef;
     123             : typedef boost::ptr_vector<XModifyListenerRef> XModifyListenerArr_Impl;
     124             : 
     125             : //  ScCellRangesBase - base class for ScCellRangesObj (with access by index)
     126             : //                                and ScCellRangeObj  (without access by index)
     127             : 
     128             : //  XServiceInfo is implemented in derived classes
     129             : 
     130             : class ScHelperFunctions
     131             : {
     132             : public:
     133             :     static const ::editeng::SvxBorderLine* GetBorderLine( ::editeng::SvxBorderLine& rLine, const com::sun::star::table::BorderLine& rStruct );
     134             :     static const ::editeng::SvxBorderLine* GetBorderLine( ::editeng::SvxBorderLine& rLine, const com::sun::star::table::BorderLine2& rStruct );
     135             :     static void FillBoxItems( SvxBoxItem& rOuter, SvxBoxInfoItem& rInner, const com::sun::star::table::TableBorder& rBorder );
     136             :     static void FillBoxItems( SvxBoxItem& rOuter, SvxBoxInfoItem& rInner, const com::sun::star::table::TableBorder2& rBorder );
     137             :     static void FillBorderLine( com::sun::star::table::BorderLine& rStruct, const ::editeng::SvxBorderLine* pLine );
     138             :     static void FillBorderLine( com::sun::star::table::BorderLine2& rStruct, const ::editeng::SvxBorderLine* pLine );
     139             :     static void AssignTableBorderToAny( com::sun::star::uno::Any& rAny,
     140             :             const SvxBoxItem& rOuter, const SvxBoxInfoItem& rInner, bool bInvalidateHorVerDist = false );
     141             :     static void AssignTableBorder2ToAny( com::sun::star::uno::Any& rAny,
     142             :             const SvxBoxItem& rOuter, const SvxBoxInfoItem& rInner, bool bInvalidateHorVerDist = false );
     143             :     static void ApplyBorder( ScDocShell* pDocShell, const ScRangeList& rRanges,
     144             :                         const SvxBoxItem& rOuter, const SvxBoxInfoItem& rInner );
     145             : };
     146             : 
     147             : namespace ooo
     148             : {
     149             :     namespace vba {
     150             :         namespace excel {
     151             :     class ScVbaCellRangeAccess;  // Vba Helper class
     152             :     }
     153             :     }
     154             : }
     155             : 
     156             : class SC_DLLPUBLIC ScCellRangesBase : public com::sun::star::beans::XPropertySet,
     157             :                          public com::sun::star::beans::XMultiPropertySet,
     158             :                          public com::sun::star::beans::XPropertyState,
     159             :                          public com::sun::star::sheet::XSheetOperation,
     160             :                          public com::sun::star::chart::XChartDataArray,
     161             :                          public com::sun::star::util::XIndent,
     162             :                          public com::sun::star::sheet::XCellRangesQuery,
     163             :                          public com::sun::star::sheet::XFormulaQuery,
     164             :                          public com::sun::star::util::XReplaceable,
     165             :                          public com::sun::star::util::XModifyBroadcaster,
     166             :                          public com::sun::star::lang::XServiceInfo,
     167             :                          public com::sun::star::lang::XUnoTunnel,
     168             :                          public com::sun::star::lang::XTypeProvider,
     169             :                          public com::sun::star::beans::XTolerantMultiPropertySet,
     170             :                          public cppu::OWeakObject,
     171             :                          public SfxListener
     172             : {
     173             :     friend class ScTabViewObj;      // for select()
     174             :     friend class ScTableSheetObj;   // for createCursorByRange()
     175             :     friend class ooo::vba::excel::ScVbaCellRangeAccess;
     176             : 
     177             : private:
     178             :     css::uno::WeakReference<css::uno::XInterface> m_wThis;
     179             :     const SfxItemPropertySet* pPropSet;
     180             :     ScDocShell*             pDocShell;
     181             :     ScLinkListener*         pValueListener;
     182             :     ScPatternAttr*          pCurrentFlat;
     183             :     ScPatternAttr*          pCurrentDeep;
     184             :     SfxItemSet*             pCurrentDataSet;
     185             :     SfxItemSet*             pNoDfltCurrentDataSet;
     186             :     ScMarkData*             pMarkData;
     187             :     ScRangeList             aRanges;
     188             :     sal_Int64               nObjectId;
     189             :     bool                    bChartColAsHdr;
     190             :     bool                    bChartRowAsHdr;
     191             :     bool                    bCursorOnly;
     192             :     bool                    bGotDataChangedHint;
     193             :     XModifyListenerArr_Impl aValueListeners;
     194             : 
     195             :     DECL_LINK( ValueListenerHdl, SfxHint* );
     196             : 
     197             : private:
     198             :     void            PaintRanges_Impl( sal_uInt16 nPart );
     199             :     ScRangeListRef  GetLimitedChartRanges_Impl( long nDataColumns, long nDataRows ) const;
     200             :     void            ForceChartListener_Impl();
     201             :     ScMemChart*     CreateMemChart_Impl() const;
     202             : 
     203             :     const ScPatternAttr*    GetCurrentAttrsFlat();
     204             :     const ScPatternAttr*    GetCurrentAttrsDeep();
     205             :     SfxItemSet*             GetCurrentDataSet(bool bNoDflt = false);
     206             :     void                    ForgetMarkData();
     207             :     void                    ForgetCurrentAttrs();
     208             : 
     209             :     com::sun::star::uno::Reference<com::sun::star::sheet::XSheetCellRanges>
     210             :                             QueryDifferences_Impl(const com::sun::star::table::CellAddress& aCompare,
     211             :                                                     bool bColumnDiff);
     212             :     com::sun::star::uno::Reference<com::sun::star::uno::XInterface>
     213             :                             Find_Impl(const com::sun::star::uno::Reference<
     214             :                                         com::sun::star::util::XSearchDescriptor>& xDesc,
     215             :                                     const ScAddress* pLastPos);
     216             : 
     217             : protected:
     218             :     const ScMarkData*       GetMarkData();
     219             : 
     220             :     // GetItemPropertyMap for derived classes must contain all entries, including base class
     221             :     virtual const SfxItemPropertyMap& GetItemPropertyMap();
     222             :     virtual ::com::sun::star::beans::PropertyState GetOnePropertyState(
     223             :                                 sal_uInt16 nItemWhich, const SfxItemPropertySimpleEntry* pEntry );
     224             :     virtual void            GetOnePropertyValue( const SfxItemPropertySimpleEntry* pEntry,
     225             :                                 ::com::sun::star::uno::Any& )
     226             :                                 throw(::com::sun::star::uno::RuntimeException,
     227             :                                       std::exception);
     228             :     virtual void            SetOnePropertyValue( const SfxItemPropertySimpleEntry* pEntry,
     229             :                                                 const ::com::sun::star::uno::Any& aValue )
     230             :                                 throw(::com::sun::star::lang::IllegalArgumentException,
     231             :                                       ::com::sun::star::uno::RuntimeException,
     232             :                                       std::exception);
     233             : 
     234             : public:
     235             :                             ScCellRangesBase(ScDocShell* pDocSh, const ScRange& rR);
     236             :                             ScCellRangesBase(ScDocShell* pDocSh, const ScRangeList& rR);
     237             :     virtual                 ~ScCellRangesBase();
     238             : 
     239             :     virtual ::com::sun::star::uno::Any SAL_CALL queryInterface(
     240             :                                 const ::com::sun::star::uno::Type & rType )
     241             :                                     throw(::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
     242             :     virtual void SAL_CALL   acquire() throw() SAL_OVERRIDE;
     243             :     virtual void SAL_CALL   release() throw() SAL_OVERRIDE;
     244             : 
     245             :     virtual void            Notify( SfxBroadcaster& rBC, const SfxHint& rHint ) SAL_OVERRIDE;
     246             :     virtual void            RefChanged();
     247             : 
     248             :                             // from derived classes and by getImplementation
     249      114050 :     ScDocShell*             GetDocShell() const     { return pDocShell; }
     250             :     ScDocument*             GetDocument() const;
     251       29354 :     const ScRangeList&      GetRangeList() const    { return aRanges; }
     252             :     void                    AddRange(const ScRange& rRange, const bool bMergeRanges);
     253             : 
     254             :                             // arouse object created via service:
     255             :     void                    InitInsertRange(ScDocShell* pDocSh, const ScRange& rR);
     256             : 
     257             :     void                    SetNewRange(const ScRange& rNew);   // for cursor
     258             :     void                    SetNewRanges(const ScRangeList& rNew);
     259             : 
     260             :     void                    SetCursorOnly(bool bSet);
     261           0 :     bool                    IsCursorOnly() const            { return bCursorOnly; }
     262             : 
     263             :                             // XSheetOperation
     264             :     virtual double SAL_CALL computeFunction( ::com::sun::star::sheet::GeneralFunction nFunction )
     265             :                                 throw(::com::sun::star::uno::Exception,
     266             :                                       ::com::sun::star::uno::RuntimeException,
     267             :                                       std::exception) SAL_OVERRIDE;
     268             :     virtual void SAL_CALL   clearContents( sal_Int32 nContentFlags )
     269             :                                 throw(::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
     270             : 
     271             :                             // XPropertySet
     272             :     virtual ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySetInfo >
     273             :                             SAL_CALL getPropertySetInfo()
     274             :                                 throw(::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
     275             :     virtual void SAL_CALL   setPropertyValue( const OUString& aPropertyName,
     276             :                                     const ::com::sun::star::uno::Any& aValue )
     277             :                                 throw(::com::sun::star::beans::UnknownPropertyException,
     278             :                                     ::com::sun::star::beans::PropertyVetoException,
     279             :                                     ::com::sun::star::lang::IllegalArgumentException,
     280             :                                     ::com::sun::star::lang::WrappedTargetException,
     281             :                                     ::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
     282             :     virtual ::com::sun::star::uno::Any SAL_CALL getPropertyValue(
     283             :                                     const OUString& PropertyName )
     284             :                                 throw(::com::sun::star::beans::UnknownPropertyException,
     285             :                                     ::com::sun::star::lang::WrappedTargetException,
     286             :                                     ::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
     287             :     virtual void SAL_CALL   addPropertyChangeListener( const OUString& aPropertyName,
     288             :                                     const ::com::sun::star::uno::Reference<
     289             :                                         ::com::sun::star::beans::XPropertyChangeListener >& xListener )
     290             :                                 throw(::com::sun::star::beans::UnknownPropertyException,
     291             :                                     ::com::sun::star::lang::WrappedTargetException,
     292             :                                     ::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
     293             :     virtual void SAL_CALL   removePropertyChangeListener( const OUString& aPropertyName,
     294             :                                     const ::com::sun::star::uno::Reference<
     295             :                                         ::com::sun::star::beans::XPropertyChangeListener >& aListener )
     296             :                                 throw(::com::sun::star::beans::UnknownPropertyException,
     297             :                                     ::com::sun::star::lang::WrappedTargetException,
     298             :                                     ::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
     299             :     virtual void SAL_CALL   addVetoableChangeListener( const OUString& PropertyName,
     300             :                                     const ::com::sun::star::uno::Reference<
     301             :                                         ::com::sun::star::beans::XVetoableChangeListener >& aListener )
     302             :                                 throw(::com::sun::star::beans::UnknownPropertyException,
     303             :                                     ::com::sun::star::lang::WrappedTargetException,
     304             :                                     ::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
     305             :     virtual void SAL_CALL   removeVetoableChangeListener( const OUString& PropertyName,
     306             :                                     const ::com::sun::star::uno::Reference<
     307             :                                         ::com::sun::star::beans::XVetoableChangeListener >& aListener )
     308             :                                 throw(::com::sun::star::beans::UnknownPropertyException,
     309             :                                     ::com::sun::star::lang::WrappedTargetException,
     310             :                                     ::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
     311             : 
     312             :                             // XMultiPropertySet
     313             :     virtual void SAL_CALL   setPropertyValues( const ::com::sun::star::uno::Sequence< OUString >& aPropertyNames,
     314             :                                     const ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Any >& aValues )
     315             :                                 throw (::com::sun::star::beans::PropertyVetoException,
     316             :                                     ::com::sun::star::lang::IllegalArgumentException,
     317             :                                     ::com::sun::star::lang::WrappedTargetException,
     318             :                                     ::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
     319             :     virtual ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Any > SAL_CALL
     320             :                             getPropertyValues( const ::com::sun::star::uno::Sequence< OUString >& aPropertyNames )
     321             :                                 throw (::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
     322             :     virtual void SAL_CALL addPropertiesChangeListener( const ::com::sun::star::uno::Sequence< OUString >& aPropertyNames,
     323             :                                     const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertiesChangeListener >& xListener )
     324             :                                 throw (::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
     325             :     virtual void SAL_CALL removePropertiesChangeListener( const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertiesChangeListener >& xListener )
     326             :                                 throw (::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
     327             :     virtual void SAL_CALL firePropertiesChangeEvent( const ::com::sun::star::uno::Sequence< OUString >& aPropertyNames,
     328             :                                     const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertiesChangeListener >& xListener )
     329             :                                 throw (::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
     330             : 
     331             :                             // XTolerantMultiPropertySet
     332             :     virtual ::com::sun::star::uno::Sequence< ::com::sun::star::beans::SetPropertyTolerantFailed > SAL_CALL
     333             :         setPropertyValuesTolerant( const ::com::sun::star::uno::Sequence< OUString >& aPropertyNames,
     334             :                                     const ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Any >& aValues )
     335             :                                     throw (::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
     336             :     virtual ::com::sun::star::uno::Sequence< ::com::sun::star::beans::GetPropertyTolerantResult > SAL_CALL
     337             :         getPropertyValuesTolerant( const ::com::sun::star::uno::Sequence< OUString >& aPropertyNames )
     338             :                                     throw (::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
     339             :     virtual ::com::sun::star::uno::Sequence< ::com::sun::star::beans::GetDirectPropertyTolerantResult > SAL_CALL
     340             :         getDirectPropertyValuesTolerant( const ::com::sun::star::uno::Sequence< OUString >& aPropertyNames )
     341             :                                     throw (::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
     342             : 
     343             :                             // XPropertyState
     344             :     virtual ::com::sun::star::beans::PropertyState SAL_CALL getPropertyState(
     345             :                                     const OUString& PropertyName )
     346             :                                 throw(::com::sun::star::beans::UnknownPropertyException,
     347             :                                     ::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
     348             :     virtual ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyState > SAL_CALL
     349             :                             getPropertyStates( const ::com::sun::star::uno::Sequence<
     350             :                                         OUString >& aPropertyName )
     351             :                                 throw(::com::sun::star::beans::UnknownPropertyException,
     352             :                                     ::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
     353             :     virtual void SAL_CALL   setPropertyToDefault( const OUString& PropertyName )
     354             :                                 throw(::com::sun::star::beans::UnknownPropertyException,
     355             :                                     ::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
     356             :     virtual ::com::sun::star::uno::Any SAL_CALL getPropertyDefault(
     357             :                                     const OUString& aPropertyName )
     358             :                                 throw(::com::sun::star::beans::UnknownPropertyException,
     359             :                                     ::com::sun::star::lang::WrappedTargetException,
     360             :                                     ::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
     361             : 
     362             :                             // XIndent
     363             :     virtual void SAL_CALL   decrementIndent() throw(::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
     364             :     virtual void SAL_CALL   incrementIndent() throw(::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
     365             : 
     366             :                             // XChartData
     367             :     virtual void SAL_CALL   addChartDataChangeEventListener(
     368             :                                 const ::com::sun::star::uno::Reference<
     369             :                                     ::com::sun::star::chart::XChartDataChangeEventListener >& aListener )
     370             :                                 throw(::com::sun::star::uno::RuntimeException,
     371             :                                       std::exception) SAL_OVERRIDE;
     372             :     virtual void SAL_CALL   removeChartDataChangeEventListener( const ::com::sun::star::uno::Reference<
     373             :                                     ::com::sun::star::chart::XChartDataChangeEventListener >& aListener )
     374             :                                 throw (::com::sun::star::uno::RuntimeException,
     375             :                                        std::exception) SAL_OVERRIDE;
     376             :     virtual double SAL_CALL getNotANumber() throw(::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
     377             :     virtual sal_Bool SAL_CALL isNotANumber( double nNumber )
     378             :                                 throw(::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
     379             : 
     380             :                             // XChartDataArray
     381             :     virtual ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Sequence< double > > SAL_CALL
     382             :                             getData()
     383             :                                     throw(::com::sun::star::uno::RuntimeException,
     384             :                                           std::exception) SAL_OVERRIDE;
     385             :     virtual void SAL_CALL   setData( const ::com::sun::star::uno::Sequence<
     386             :                                 ::com::sun::star::uno::Sequence< double > >& aData )
     387             :                                     throw(::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
     388             :     virtual ::com::sun::star::uno::Sequence< OUString > SAL_CALL getRowDescriptions()
     389             :                                 throw(::com::sun::star::uno::RuntimeException,
     390             :                                       std::exception) SAL_OVERRIDE;
     391             :     virtual void SAL_CALL setRowDescriptions( const ::com::sun::star::uno::Sequence<
     392             :                                 OUString >& aRowDescriptions )
     393             :                                     throw(::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
     394             :     virtual ::com::sun::star::uno::Sequence< OUString > SAL_CALL getColumnDescriptions()
     395             :                                 throw(::com::sun::star::uno::RuntimeException,
     396             :                                       std::exception) SAL_OVERRIDE;
     397             :     virtual void SAL_CALL   setColumnDescriptions( const ::com::sun::star::uno::Sequence<
     398             :                                 OUString >& aColumnDescriptions )
     399             :                                     throw(::com::sun::star::uno::RuntimeException,
     400             :                                           std::exception) SAL_OVERRIDE;
     401             : 
     402             :                             // XCellRangesQuery
     403             :     virtual ::com::sun::star::uno::Reference< ::com::sun::star::sheet::XSheetCellRanges > SAL_CALL
     404             :                             queryVisibleCells()
     405             :                                 throw(::com::sun::star::uno::RuntimeException,
     406             :                                       std::exception) SAL_OVERRIDE;
     407             :     virtual ::com::sun::star::uno::Reference< ::com::sun::star::sheet::XSheetCellRanges > SAL_CALL
     408             :                             queryEmptyCells()
     409             :                                 throw(::com::sun::star::uno::RuntimeException,
     410             :                                       std::exception) SAL_OVERRIDE;
     411             :     virtual ::com::sun::star::uno::Reference< ::com::sun::star::sheet::XSheetCellRanges > SAL_CALL
     412             :                             queryContentCells( sal_Int16 nContentFlags )
     413             :                                 throw(::com::sun::star::uno::RuntimeException,
     414             :                                       std::exception) SAL_OVERRIDE;
     415             :     virtual ::com::sun::star::uno::Reference< ::com::sun::star::sheet::XSheetCellRanges > SAL_CALL
     416             :                             queryFormulaCells( sal_Int32 nResultFlags )
     417             :                                 throw(::com::sun::star::uno::RuntimeException,
     418             :                                       std::exception) SAL_OVERRIDE;
     419             :     virtual ::com::sun::star::uno::Reference< ::com::sun::star::sheet::XSheetCellRanges > SAL_CALL
     420             :                             queryColumnDifferences(
     421             :                                 const ::com::sun::star::table::CellAddress& aCompare )
     422             :                                     throw(::com::sun::star::uno::RuntimeException,
     423             :                                           std::exception) SAL_OVERRIDE;
     424             :     virtual ::com::sun::star::uno::Reference< ::com::sun::star::sheet::XSheetCellRanges > SAL_CALL
     425             :                             queryRowDifferences(
     426             :                                 const ::com::sun::star::table::CellAddress& aCompare )
     427             :                                     throw(::com::sun::star::uno::RuntimeException,
     428             :                                           std::exception) SAL_OVERRIDE;
     429             :     virtual ::com::sun::star::uno::Reference< ::com::sun::star::sheet::XSheetCellRanges > SAL_CALL
     430             :                             queryIntersection(
     431             :                                 const ::com::sun::star::table::CellRangeAddress& aRange )
     432             :                                     throw(::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
     433             : 
     434             :                             // XFormulaQuery
     435             :     virtual ::com::sun::star::uno::Reference< ::com::sun::star::sheet::XSheetCellRanges > SAL_CALL
     436             :                             queryDependents( sal_Bool bRecursive )
     437             :                                 throw(::com::sun::star::uno::RuntimeException,
     438             :                                       std::exception) SAL_OVERRIDE;
     439             :     virtual ::com::sun::star::uno::Reference< ::com::sun::star::sheet::XSheetCellRanges > SAL_CALL
     440             :                             queryPrecedents( sal_Bool bRecursive )
     441             :                                 throw(::com::sun::star::uno::RuntimeException,
     442             :                                       std::exception) SAL_OVERRIDE;
     443             : 
     444             :                             // XSearchable
     445             :     virtual ::com::sun::star::uno::Reference< ::com::sun::star::util::XSearchDescriptor > SAL_CALL
     446             :                             createSearchDescriptor()
     447             :                                 throw(::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
     448             :     virtual ::com::sun::star::uno::Reference< ::com::sun::star::container::XIndexAccess > SAL_CALL
     449             :                             findAll( const ::com::sun::star::uno::Reference<
     450             :                                 ::com::sun::star::util::XSearchDescriptor >& xDesc )
     451             :                                     throw(::com::sun::star::uno::RuntimeException,
     452             :                                           std::exception) SAL_OVERRIDE;
     453             :     virtual ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface > SAL_CALL
     454             :                             findFirst( const ::com::sun::star::uno::Reference<
     455             :                                 ::com::sun::star::util::XSearchDescriptor >& xDesc )
     456             :                                     throw(::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
     457             :     virtual ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface > SAL_CALL
     458             :                             findNext( const ::com::sun::star::uno::Reference<
     459             :                                         ::com::sun::star::uno::XInterface >& xStartAt,
     460             :                                       const ::com::sun::star::uno::Reference<
     461             :                                         ::com::sun::star::util::XSearchDescriptor >& xDesc )
     462             :                                     throw(::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
     463             : 
     464             :                             // XReplaceable
     465             :     virtual ::com::sun::star::uno::Reference< ::com::sun::star::util::XReplaceDescriptor > SAL_CALL
     466             :                             createReplaceDescriptor() throw(::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
     467             :     virtual sal_Int32 SAL_CALL replaceAll( const ::com::sun::star::uno::Reference<
     468             :                                 ::com::sun::star::util::XSearchDescriptor >& xDesc )
     469             :                                     throw(::com::sun::star::uno::RuntimeException,
     470             :                                           std::exception) SAL_OVERRIDE;
     471             : 
     472             :                             // XModifyBroadcaster
     473             :     virtual void SAL_CALL   addModifyListener( const ::com::sun::star::uno::Reference<
     474             :                                     ::com::sun::star::util::XModifyListener >& aListener )
     475             :                                 throw (::com::sun::star::uno::RuntimeException,
     476             :                                        std::exception) SAL_OVERRIDE;
     477             :     virtual void SAL_CALL   removeModifyListener( const ::com::sun::star::uno::Reference<
     478             :                                     ::com::sun::star::util::XModifyListener >& aListener )
     479             :                                 throw (::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
     480             : 
     481             :                             // XServiceInfo
     482             :     virtual OUString SAL_CALL getImplementationName()
     483             :                                 throw(::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
     484             :     virtual sal_Bool SAL_CALL supportsService( const OUString& ServiceName )
     485             :                                 throw(::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
     486             :     virtual ::com::sun::star::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames()
     487             :                                 throw(::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
     488             : 
     489             :                             // XUnoTunnel
     490             :     virtual sal_Int64 SAL_CALL getSomething( const ::com::sun::star::uno::Sequence<
     491             :                                     sal_Int8 >& aIdentifier )
     492             :                                 throw(::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
     493             : 
     494             :     static const com::sun::star::uno::Sequence<sal_Int8>& getUnoTunnelId();
     495             :     static ScCellRangesBase* getImplementation( const com::sun::star::uno::Reference<
     496             :                                     com::sun::star::uno::XInterface> xObj );
     497             : 
     498             :                             // XTypeProvider
     499             :     virtual ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Type > SAL_CALL getTypes()
     500             :                                 throw(::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
     501             :     virtual ::com::sun::star::uno::Sequence< sal_Int8 > SAL_CALL getImplementationId()
     502             :                                 throw(::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
     503             : };
     504             : 
     505             : class SC_DLLPUBLIC ScCellRangesObj : public ScCellRangesBase,
     506             :                         public com::sun::star::sheet::XSheetCellRangeContainer,
     507             :                         public com::sun::star::container::XNameContainer,
     508             :                         public com::sun::star::container::XEnumerationAccess
     509             : {
     510             : private:
     511             :     struct Impl;
     512             :     ::boost::scoped_ptr<Impl> m_pImpl;
     513             : 
     514             :     ScCellRangeObj*         GetObjectByIndex_Impl(sal_Int32 nIndex) const;
     515             : 
     516             : public:
     517             :                             ScCellRangesObj(ScDocShell* pDocSh, const ScRangeList& rR);
     518             :     virtual                 ~ScCellRangesObj();
     519             : 
     520             :     virtual ::com::sun::star::uno::Any SAL_CALL queryInterface(
     521             :                                 const ::com::sun::star::uno::Type & rType )
     522             :                                     throw(::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
     523             :     virtual void SAL_CALL   acquire() throw() SAL_OVERRIDE;
     524             :     virtual void SAL_CALL   release() throw() SAL_OVERRIDE;
     525             : 
     526             :     virtual void            RefChanged() SAL_OVERRIDE;
     527             : 
     528             :                             // XSheetCellRanges
     529             :     virtual ::com::sun::star::uno::Reference< ::com::sun::star::container::XEnumerationAccess > SAL_CALL
     530             :                             getCells() throw(::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
     531             :     virtual OUString SAL_CALL getRangeAddressesAsString()
     532             :                                 throw(::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
     533             :     virtual ::com::sun::star::uno::Sequence< ::com::sun::star::table::CellRangeAddress > SAL_CALL
     534             :                             getRangeAddresses() throw(::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
     535             : 
     536             :                             // XSheetCellRangeContainer
     537             :     virtual void SAL_CALL   addRangeAddress( const ::com::sun::star::table::CellRangeAddress& rRange,
     538             :                                         sal_Bool bMergeRanges )
     539             :                                     throw(::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
     540             :     virtual void SAL_CALL   removeRangeAddress( const ::com::sun::star::table::CellRangeAddress& rRange )
     541             :                                 throw(::com::sun::star::container::NoSuchElementException,
     542             :                                     ::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
     543             :     virtual void SAL_CALL   addRangeAddresses( const ::com::sun::star::uno::Sequence<
     544             :                                         ::com::sun::star::table::CellRangeAddress >& rRanges,
     545             :                                         sal_Bool bMergeRanges )
     546             :                                     throw(::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
     547             :     virtual void SAL_CALL   removeRangeAddresses( const ::com::sun::star::uno::Sequence<
     548             :                                         ::com::sun::star::table::CellRangeAddress >& rRanges )
     549             :                                 throw(::com::sun::star::container::NoSuchElementException,
     550             :                                     ::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
     551             : 
     552             :                             // XNameContainer
     553             :     virtual void SAL_CALL   insertByName( const OUString& aName,
     554             :                                 const ::com::sun::star::uno::Any& aElement )
     555             :                                     throw (::com::sun::star::lang::IllegalArgumentException,
     556             :                                            ::com::sun::star::container::ElementExistException,
     557             :                                            ::com::sun::star::lang::WrappedTargetException,
     558             :                                            ::com::sun::star::uno::RuntimeException,
     559             :                                            std::exception) SAL_OVERRIDE;
     560             :     virtual void SAL_CALL   removeByName( const OUString& Name )
     561             :                                 throw(::com::sun::star::container::NoSuchElementException,
     562             :                                     ::com::sun::star::lang::WrappedTargetException,
     563             :                                     ::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
     564             : 
     565             :                             // XNameReplace
     566             :     virtual void SAL_CALL   replaceByName( const OUString& aName,
     567             :                                 const ::com::sun::star::uno::Any& aElement )
     568             :                                     throw(::com::sun::star::lang::IllegalArgumentException,
     569             :                                         ::com::sun::star::container::NoSuchElementException,
     570             :                                         ::com::sun::star::lang::WrappedTargetException,
     571             :                                         ::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
     572             : 
     573             :                             // XNameAccess
     574             :     virtual ::com::sun::star::uno::Any SAL_CALL getByName( const OUString& aName )
     575             :                                 throw(::com::sun::star::container::NoSuchElementException,
     576             :                                     ::com::sun::star::lang::WrappedTargetException,
     577             :                                     ::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
     578             :     virtual ::com::sun::star::uno::Sequence< OUString > SAL_CALL getElementNames()
     579             :                                 throw(::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
     580             :     virtual sal_Bool SAL_CALL hasByName( const OUString& aName )
     581             :                                 throw(::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
     582             : 
     583             :                             // XIndexAccess
     584             :     virtual sal_Int32 SAL_CALL getCount() throw(::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
     585             :     virtual ::com::sun::star::uno::Any SAL_CALL getByIndex( sal_Int32 Index )
     586             :                                 throw(::com::sun::star::lang::IndexOutOfBoundsException,
     587             :                                     ::com::sun::star::lang::WrappedTargetException,
     588             :                                     ::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
     589             : 
     590             :                             // XElementAccess
     591             :     virtual ::com::sun::star::uno::Type SAL_CALL getElementType()
     592             :                                 throw(::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
     593             :     virtual sal_Bool SAL_CALL hasElements() throw(::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
     594             : 
     595             :                             // XEnumerationAccess
     596             :     virtual ::com::sun::star::uno::Reference< ::com::sun::star::container::XEnumeration > SAL_CALL
     597             :                             createEnumeration() throw(::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
     598             : 
     599             :                             // XServiceInfo
     600             :     virtual OUString SAL_CALL getImplementationName()
     601             :                                 throw(::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
     602             :     virtual sal_Bool SAL_CALL supportsService( const OUString& ServiceName )
     603             :                                 throw(::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
     604             :     virtual ::com::sun::star::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames()
     605             :                                 throw(::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
     606             : 
     607             :                             // XTypeProvider
     608             :     virtual ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Type > SAL_CALL getTypes()
     609             :                                 throw(::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
     610             :     virtual ::com::sun::star::uno::Sequence< sal_Int8 > SAL_CALL getImplementationId()
     611             :                                 throw(::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
     612             : };
     613             : 
     614             : class SC_DLLPUBLIC ScCellRangeObj : public ScCellRangesBase,
     615             :                        public com::sun::star::sheet::XCellRangeAddressable,
     616             :                        public com::sun::star::sheet::XSheetCellRange,
     617             :                        public com::sun::star::sheet::XArrayFormulaRange,
     618             :                        public com::sun::star::sheet::XArrayFormulaTokens,
     619             :                        public com::sun::star::sheet::XCellRangeData,
     620             :                        public com::sun::star::sheet::XCellRangeFormula,
     621             :                        public com::sun::star::sheet::XMultipleOperation,
     622             :                        public com::sun::star::util::XMergeable,
     623             :                        public com::sun::star::sheet::XCellSeries,
     624             :                        public com::sun::star::table::XAutoFormattable,
     625             :                        public com::sun::star::util::XSortable,
     626             :                        public com::sun::star::sheet::XSheetFilterableEx,
     627             :                        public com::sun::star::sheet::XSubTotalCalculatable,
     628             :                        public com::sun::star::util::XImportable,
     629             :                        public com::sun::star::sheet::XCellFormatRangesSupplier,
     630             :                        public com::sun::star::sheet::XUniqueCellFormatRangesSupplier,
     631             :                        public com::sun::star::table::XColumnRowRange
     632             : {
     633             : private:
     634             :     const SfxItemPropertySet*       pRangePropSet;
     635             :     ScRange                 aRange;
     636             : 
     637             : protected:
     638         594 :     const ScRange&          GetRange() const    { return aRange; }
     639             :     virtual const SfxItemPropertyMap& GetItemPropertyMap() SAL_OVERRIDE;
     640             :     virtual void GetOnePropertyValue( const SfxItemPropertySimpleEntry* pEntry,
     641             :                                 ::com::sun::star::uno::Any& )
     642             :                                 throw(::com::sun::star::uno::RuntimeException,
     643             :                                       std::exception) SAL_OVERRIDE;
     644             :     virtual void            SetOnePropertyValue( const SfxItemPropertySimpleEntry* pEntry,
     645             :                                                 const ::com::sun::star::uno::Any& aValue )
     646             :                                 throw(::com::sun::star::lang::IllegalArgumentException,
     647             :                                       ::com::sun::star::uno::RuntimeException,
     648             :                                       std::exception) SAL_OVERRIDE;
     649             : 
     650             :     ::com::sun::star::uno::Reference< ::com::sun::star::table::XCell >
     651             :                             GetCellByPosition_Impl( sal_Int32 nColumn, sal_Int32 nRow )
     652             :                                 throw(::com::sun::star::lang::IndexOutOfBoundsException,
     653             :                                     ::com::sun::star::uno::RuntimeException);
     654             : 
     655             :             void            SetArrayFormula_Impl( const OUString& rFormula,
     656             :                                 const OUString& rFormulaNmsp,
     657             :                                 const formula::FormulaGrammar::Grammar eGrammar )
     658             :                                     throw (css::uno::RuntimeException, std::exception);
     659             : 
     660             : public:
     661             :                             ScCellRangeObj(ScDocShell* pDocSh, const ScRange& rR);
     662             :     virtual                 ~ScCellRangeObj();
     663             : 
     664             :                             // uses ObjectShell from document, if set (returns NULL otherwise)
     665             :     static com::sun::star::uno::Reference<com::sun::star::table::XCellRange>
     666             :                             CreateRangeFromDoc( ScDocument* pDoc, const ScRange& rR );
     667             : 
     668             :     virtual ::com::sun::star::uno::Any SAL_CALL queryInterface(
     669             :                                 const ::com::sun::star::uno::Type & rType )
     670             :                                     throw(::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
     671             :     virtual void SAL_CALL   acquire() throw() SAL_OVERRIDE;
     672             :     virtual void SAL_CALL   release() throw() SAL_OVERRIDE;
     673             : 
     674             :     virtual void            RefChanged() SAL_OVERRIDE;
     675             : 
     676             :                             // via getImplementation()
     677             :     virtual void            SetArrayFormulaWithGrammar( const OUString& rFormula,
     678             :                                     const OUString& rFormulaNmsp,
     679             :                                     const formula::FormulaGrammar::Grammar )
     680             :                                 throw (css::uno::RuntimeException,
     681             :                                        std::exception);
     682             : 
     683             :                             // XCellRangeAddressable
     684             :     virtual ::com::sun::star::table::CellRangeAddress SAL_CALL getRangeAddress()
     685             :                                 throw(::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
     686             : 
     687             :                             // XSheetCellRange
     688             :     virtual ::com::sun::star::uno::Reference< ::com::sun::star::sheet::XSpreadsheet > SAL_CALL
     689             :                             getSpreadsheet() throw(::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
     690             : 
     691             :                             // XArrayFormulaRange
     692             :     virtual OUString SAL_CALL getArrayFormula() throw(::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
     693             :     virtual void SAL_CALL   setArrayFormula( const OUString& aFormula )
     694             :                                 throw(::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
     695             : 
     696             :                             // XArrayFormulaTokens
     697             :     virtual ::com::sun::star::uno::Sequence< ::com::sun::star::sheet::FormulaToken > SAL_CALL getArrayTokens()
     698             :                                 throw (::com::sun::star::uno::RuntimeException,
     699             :                                        std::exception) SAL_OVERRIDE;
     700             :     virtual void SAL_CALL   setArrayTokens( const ::com::sun::star::uno::Sequence<
     701             :                                     ::com::sun::star::sheet::FormulaToken >& aTokens )
     702             :                                 throw (::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
     703             : 
     704             :                             // XCellRangeData
     705             :     virtual ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Sequence<
     706             :                             ::com::sun::star::uno::Any > > SAL_CALL getDataArray()
     707             :                                 throw(::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
     708             :     virtual void SAL_CALL   setDataArray( const ::com::sun::star::uno::Sequence<
     709             :                                 ::com::sun::star::uno::Sequence<
     710             :                                     ::com::sun::star::uno::Any > >& aArray )
     711             :                                 throw(::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
     712             : 
     713             :                             // XCellRangeFormula
     714             :     virtual ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Sequence<
     715             :                             OUString > > SAL_CALL getFormulaArray()
     716             :                                 throw (::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
     717             :     virtual void SAL_CALL   setFormulaArray( const ::com::sun::star::uno::Sequence<
     718             :                                 ::com::sun::star::uno::Sequence< OUString > >& aArray )
     719             :                                 throw (::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
     720             : 
     721             :                             // XMultipleOperation
     722             :     virtual void SAL_CALL   setTableOperation(
     723             :                                 const ::com::sun::star::table::CellRangeAddress& aFormulaRange,
     724             :                                 ::com::sun::star::sheet::TableOperationMode nMode,
     725             :                                 const ::com::sun::star::table::CellAddress& aColumnCell,
     726             :                                 const ::com::sun::star::table::CellAddress& aRowCell )
     727             :                                     throw(::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
     728             : 
     729             :                             // XMergeable
     730             :     virtual void SAL_CALL   merge( sal_Bool bMerge ) throw(::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
     731             :     virtual sal_Bool SAL_CALL getIsMerged() throw(::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
     732             : 
     733             :                             // XCellSeries
     734             :     virtual void SAL_CALL   fillSeries( ::com::sun::star::sheet::FillDirection nFillDirection,
     735             :                                 ::com::sun::star::sheet::FillMode nFillMode,
     736             :                                 ::com::sun::star::sheet::FillDateMode nFillDateMode,
     737             :                                 double fStep, double fEndValue )
     738             :                                     throw(::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
     739             :     virtual void SAL_CALL   fillAuto( ::com::sun::star::sheet::FillDirection nFillDirection,
     740             :                                 sal_Int32 nSourceCount )
     741             :                                     throw(::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
     742             : 
     743             :                             // XAutoFormattable
     744             :     virtual void SAL_CALL   autoFormat( const OUString& aName )
     745             :                                 throw(::com::sun::star::lang::IllegalArgumentException,
     746             :                                     ::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
     747             : 
     748             :                             // XSortable
     749             :     virtual ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue > SAL_CALL
     750             :                             createSortDescriptor() throw(::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
     751             :     virtual void SAL_CALL   sort( const ::com::sun::star::uno::Sequence<
     752             :                                 ::com::sun::star::beans::PropertyValue >& xDescriptor )
     753             :                                     throw(::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
     754             : 
     755             :                             // XSheetFilterableEx
     756             :     virtual ::com::sun::star::uno::Reference< ::com::sun::star::sheet::XSheetFilterDescriptor > SAL_CALL
     757             :                             createFilterDescriptorByObject( const ::com::sun::star::uno::Reference<
     758             :                                 ::com::sun::star::sheet::XSheetFilterable >& xObject )
     759             :                                     throw(::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
     760             : 
     761             :                             // XSheetFilterable
     762             :     virtual ::com::sun::star::uno::Reference< ::com::sun::star::sheet::XSheetFilterDescriptor > SAL_CALL
     763             :                             createFilterDescriptor( sal_Bool bEmpty )
     764             :                                 throw(::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
     765             :     virtual void SAL_CALL   filter( const ::com::sun::star::uno::Reference<
     766             :                                 ::com::sun::star::sheet::XSheetFilterDescriptor >& xDescriptor )
     767             :                                     throw(::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
     768             : 
     769             :                             // XSubTotalCalculatable
     770             :     virtual ::com::sun::star::uno::Reference< ::com::sun::star::sheet::XSubTotalDescriptor > SAL_CALL
     771             :                             createSubTotalDescriptor( sal_Bool bEmpty )
     772             :                                 throw(::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
     773             :     virtual void SAL_CALL   applySubTotals(const ::com::sun::star::uno::Reference<
     774             :                                 ::com::sun::star::sheet::XSubTotalDescriptor >& xDescriptor,
     775             :                                 sal_Bool bReplace)
     776             :                                 throw (::com::sun::star::uno::RuntimeException,
     777             :                                        std::exception) SAL_OVERRIDE;
     778             :     virtual void SAL_CALL   removeSubTotals() throw(::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
     779             : 
     780             :                             // XImportable
     781             :     virtual ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue > SAL_CALL
     782             :                             createImportDescriptor( sal_Bool bEmpty )
     783             :                                 throw(::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
     784             :     virtual void SAL_CALL   doImport( const ::com::sun::star::uno::Sequence<
     785             :                                 ::com::sun::star::beans::PropertyValue >& aDescriptor )
     786             :                                     throw(::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
     787             : 
     788             :                             // XCellFormatRangesSupplier
     789             :     virtual ::com::sun::star::uno::Reference< ::com::sun::star::container::XIndexAccess > SAL_CALL
     790             :                             getCellFormatRanges() throw(::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
     791             : 
     792             :                             // XUniqueCellFormatRangesSupplier
     793             :     virtual ::com::sun::star::uno::Reference< ::com::sun::star::container::XIndexAccess > SAL_CALL
     794             :                             getUniqueCellFormatRanges() throw(::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
     795             : 
     796             :                             // XColumnRowRange
     797             :     virtual ::com::sun::star::uno::Reference< ::com::sun::star::table::XTableColumns > SAL_CALL
     798             :                             getColumns() throw(::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
     799             :     virtual ::com::sun::star::uno::Reference< ::com::sun::star::table::XTableRows > SAL_CALL
     800             :                             getRows() throw(::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
     801             : 
     802             :                             // XCellRange
     803             :     virtual ::com::sun::star::uno::Reference< ::com::sun::star::table::XCell > SAL_CALL
     804             :                             getCellByPosition( sal_Int32 nColumn, sal_Int32 nRow )
     805             :                                 throw(::com::sun::star::lang::IndexOutOfBoundsException,
     806             :                                     ::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
     807             :     virtual ::com::sun::star::uno::Reference< ::com::sun::star::table::XCellRange > SAL_CALL
     808             :                             getCellRangeByPosition( sal_Int32 nLeft, sal_Int32 nTop,
     809             :                                 sal_Int32 nRight, sal_Int32 nBottom )
     810             :                                     throw(::com::sun::star::lang::IndexOutOfBoundsException,
     811             :                                         ::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
     812             :     virtual ::com::sun::star::uno::Reference< ::com::sun::star::table::XCellRange > SAL_CALL
     813             :                             getCellRangeByName( const OUString& aRange )
     814             :                                 throw(::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
     815             :     ::com::sun::star::uno::Reference< ::com::sun::star::table::XCellRange >
     816             :                             getCellRangeByName( const OUString& aRange,  const ScAddress::Details& rDetails )
     817             :                                 throw(::com::sun::star::uno::RuntimeException);
     818             : 
     819             :                             // XPropertySet overloaded due to Range-Properties
     820             :     virtual ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySetInfo >
     821             :                             SAL_CALL getPropertySetInfo()
     822             :                                 throw(::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
     823             : 
     824             :                             // XServiceInfo
     825             :     virtual OUString SAL_CALL getImplementationName()
     826             :                                 throw(::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
     827             :     virtual sal_Bool SAL_CALL supportsService( const OUString& ServiceName )
     828             :                                 throw(::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
     829             :     virtual ::com::sun::star::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames()
     830             :                                 throw(::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
     831             : 
     832             :                             // XTypeProvider
     833             :     virtual ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Type > SAL_CALL getTypes()
     834             :                                 throw(::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
     835             :     virtual ::com::sun::star::uno::Sequence< sal_Int8 > SAL_CALL getImplementationId()
     836             :                                 throw(::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
     837             : };
     838             : 
     839             : //! really derive cell from range?
     840             : 
     841             : class SC_DLLPUBLIC ScCellObj : public ScCellRangeObj,
     842             :                   public com::sun::star::text::XText,
     843             :                   public com::sun::star::container::XEnumerationAccess,
     844             :                   public com::sun::star::table::XCell2,
     845             :                   public com::sun::star::sheet::XFormulaTokens,
     846             :                   public com::sun::star::sheet::XCellAddressable,
     847             :                   public com::sun::star::sheet::XSheetAnnotationAnchor,
     848             :                   public com::sun::star::text::XTextFieldsSupplier,
     849             :                     public com::sun::star::document::XActionLockable
     850             : {
     851             : private:
     852             :     rtl::Reference<SvxUnoText> mxUnoText;
     853             :     const SfxItemPropertySet*   pCellPropSet;
     854             :     ScAddress               aCellPos;
     855             :     sal_Int16               nActionLockCount;
     856             : 
     857             : private:
     858             :     OUString    GetInputString_Impl(bool bEnglish) const;
     859             :     OUString    GetOutputString_Impl() const;
     860             :     void        SetString_Impl(const OUString& rString, bool bInterpret, bool bEnglish);
     861             :     double      GetValue_Impl() const;
     862             :     void        SetValue_Impl(double fValue);
     863             :     com::sun::star::table::CellContentType GetResultType_Impl();
     864             : 
     865             : protected:
     866             :     virtual const SfxItemPropertyMap& GetItemPropertyMap() SAL_OVERRIDE;
     867             :     virtual void GetOnePropertyValue( const SfxItemPropertySimpleEntry* pEntry,
     868             :                                 ::com::sun::star::uno::Any& )
     869             :                                 throw(::com::sun::star::uno::RuntimeException,
     870             :                                       std::exception) SAL_OVERRIDE;
     871             :     virtual void            SetOnePropertyValue( const SfxItemPropertySimpleEntry* pEntry,
     872             :                                                 const ::com::sun::star::uno::Any& aValue )
     873             :                                 throw(::com::sun::star::lang::IllegalArgumentException,
     874             :                                         ::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
     875             : 
     876             : public:
     877             :     static const SvxItemPropertySet* GetEditPropertySet();
     878             :     static const SfxItemPropertyMap& GetCellPropertyMap();
     879             : 
     880             :                             ScCellObj(ScDocShell* pDocSh, const ScAddress& rP);
     881             :     virtual                 ~ScCellObj();
     882             : 
     883             :     virtual ::com::sun::star::uno::Any SAL_CALL queryInterface(
     884             :                                 const ::com::sun::star::uno::Type & rType )
     885             :                                     throw(::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
     886             :     virtual void SAL_CALL   acquire() throw() SAL_OVERRIDE;
     887             :     virtual void SAL_CALL   release() throw() SAL_OVERRIDE;
     888             : 
     889             :     virtual void            RefChanged() SAL_OVERRIDE;
     890             : 
     891             :     SvxUnoText&             GetUnoText();
     892             : 
     893             :                             // XML import needs to set results at formula cells,
     894             :                             // not meant for any other purpose.
     895           0 :     const ScAddress&        GetPosition() const { return aCellPos; }
     896             : 
     897             :     void                    InputEnglishString( const OUString& rText );
     898             : 
     899             :                             // XText
     900             :     virtual void SAL_CALL   insertTextContent( const ::com::sun::star::uno::Reference<
     901             :                                     ::com::sun::star::text::XTextRange >& xRange,
     902             :                                 const ::com::sun::star::uno::Reference<
     903             :                                     ::com::sun::star::text::XTextContent >& xContent,
     904             :                                 sal_Bool bAbsorb )
     905             :                                     throw(::com::sun::star::lang::IllegalArgumentException,
     906             :                                     ::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
     907             :     virtual void SAL_CALL   removeTextContent( const ::com::sun::star::uno::Reference<
     908             :                                 ::com::sun::star::text::XTextContent >& xContent )
     909             :                                     throw(::com::sun::star::container::NoSuchElementException,
     910             :                                             ::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
     911             : 
     912             :                             // XSimpleText
     913             :     virtual ::com::sun::star::uno::Reference< ::com::sun::star::text::XTextCursor > SAL_CALL
     914             :                             createTextCursor() throw(::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
     915             :     virtual ::com::sun::star::uno::Reference< ::com::sun::star::text::XTextCursor > SAL_CALL
     916             :                             createTextCursorByRange( const ::com::sun::star::uno::Reference<
     917             :                                         ::com::sun::star::text::XTextRange >& aTextPosition )
     918             :                                     throw(::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
     919             :     virtual void SAL_CALL   insertString( const ::com::sun::star::uno::Reference<
     920             :                                         ::com::sun::star::text::XTextRange >& xRange,
     921             :                                         const OUString& aString, sal_Bool bAbsorb )
     922             :                                     throw(::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
     923             :     virtual void SAL_CALL   insertControlCharacter( const ::com::sun::star::uno::Reference<
     924             :                                         ::com::sun::star::text::XTextRange >& xRange,
     925             :                                         sal_Int16 nControlCharacter, sal_Bool bAbsorb )
     926             :                                     throw(::com::sun::star::lang::IllegalArgumentException,
     927             :                                         ::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
     928             : 
     929             :                             // XTextRange
     930             :     virtual ::com::sun::star::uno::Reference< ::com::sun::star::text::XText > SAL_CALL
     931             :                             getText() throw(::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
     932             :     virtual ::com::sun::star::uno::Reference< ::com::sun::star::text::XTextRange > SAL_CALL
     933             :                             getStart() throw(::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
     934             :     virtual ::com::sun::star::uno::Reference< ::com::sun::star::text::XTextRange > SAL_CALL
     935             :                             getEnd() throw(::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
     936             :     virtual OUString SAL_CALL getString() throw(::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
     937             :     virtual void SAL_CALL   setString( const OUString& aString )
     938             :                                     throw(::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
     939             : 
     940             :                             // XEnumerationAccess
     941             :     virtual ::com::sun::star::uno::Reference< ::com::sun::star::container::XEnumeration > SAL_CALL
     942             :                             createEnumeration() throw(::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
     943             : 
     944             :                             // XElementAccess
     945             :     virtual ::com::sun::star::uno::Type SAL_CALL getElementType()
     946             :                                 throw(::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
     947             :     virtual sal_Bool SAL_CALL hasElements() throw(::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
     948             : 
     949             :                             // XCell
     950             :     virtual OUString SAL_CALL getFormula() throw(::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
     951             :     virtual void SAL_CALL   setFormula( const OUString& aFormula )
     952             :                                 throw(::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
     953             :     virtual void SAL_CALL   setFormulaResult( double nValue )
     954             :                                 throw(::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
     955             :     virtual void SAL_CALL   setFormulaString( const OUString& aFormula )
     956             :                                 throw(::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
     957             :     virtual double SAL_CALL getValue() throw(::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
     958             :     virtual void SAL_CALL   setValue( double nValue ) throw(::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
     959             :     virtual ::com::sun::star::table::CellContentType SAL_CALL getType()
     960             :                                 throw(::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
     961             :     virtual sal_Int32 SAL_CALL getError() throw(::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
     962             : 
     963             :                             // XFormulaTokens
     964             :     virtual ::com::sun::star::uno::Sequence< ::com::sun::star::sheet::FormulaToken > SAL_CALL getTokens()
     965             :                                 throw (::com::sun::star::uno::RuntimeException,
     966             :                                        std::exception) SAL_OVERRIDE;
     967             :     virtual void SAL_CALL   setTokens( const ::com::sun::star::uno::Sequence<
     968             :                                     ::com::sun::star::sheet::FormulaToken >& aTokens )
     969             :                                 throw (::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
     970             : 
     971             :                             // XCellAddressable
     972             :     virtual ::com::sun::star::table::CellAddress SAL_CALL getCellAddress()
     973             :                                 throw(::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
     974             : 
     975             :                             // XSheetAnnotationAnchor
     976             :     virtual ::com::sun::star::uno::Reference< ::com::sun::star::sheet::XSheetAnnotation > SAL_CALL
     977             :                             getAnnotation() throw(::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
     978             : 
     979             :                             // XTextFieldsSupplier
     980             :     virtual ::com::sun::star::uno::Reference< ::com::sun::star::container::XEnumerationAccess > SAL_CALL
     981             :                             getTextFields() throw(::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
     982             :     virtual ::com::sun::star::uno::Reference< ::com::sun::star::container::XNameAccess > SAL_CALL
     983             :                             getTextFieldMasters() throw(::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
     984             : 
     985             :                             // XPropertySet overloaded due to cell properties
     986             :     virtual ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySetInfo >
     987             :                             SAL_CALL getPropertySetInfo()
     988             :                                 throw(::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
     989             : 
     990             :                             // XServiceInfo
     991             :     virtual OUString SAL_CALL getImplementationName()
     992             :                                 throw(::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
     993             :     virtual sal_Bool SAL_CALL supportsService( const OUString& ServiceName )
     994             :                                 throw(::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
     995             :     virtual ::com::sun::star::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames()
     996             :                                 throw(::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
     997             : 
     998             :                             // XTypeProvider
     999             :     virtual ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Type > SAL_CALL getTypes()
    1000             :                                 throw(::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
    1001             :     virtual ::com::sun::star::uno::Sequence< sal_Int8 > SAL_CALL getImplementationId()
    1002             :                                 throw(::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
    1003             : 
    1004             :                             // XActionLockable
    1005             :     virtual sal_Bool SAL_CALL isActionLocked() throw(::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
    1006             :     virtual void SAL_CALL   addActionLock() throw(::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
    1007             :     virtual void SAL_CALL   removeActionLock() throw(::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
    1008             :     virtual void SAL_CALL   setActionLocks( sal_Int16 nLock )
    1009             :                                 throw(::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
    1010             :     virtual sal_Int16 SAL_CALL resetActionLocks() throw(::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
    1011             : };
    1012             : 
    1013             : class ScTableSheetObj : public ScCellRangeObj,
    1014             :                         public com::sun::star::sheet::XSpreadsheet,
    1015             :                         public com::sun::star::container::XNamed,
    1016             :                         public com::sun::star::sheet::XSheetPageBreak,
    1017             :                         public com::sun::star::sheet::XCellRangeMovement,
    1018             :                         public com::sun::star::table::XTableChartsSupplier,
    1019             :                         public com::sun::star::sheet::XDataPilotTablesSupplier,
    1020             :                         public com::sun::star::sheet::XScenariosSupplier,
    1021             :                         public com::sun::star::sheet::XSheetAnnotationsSupplier,
    1022             :                         public com::sun::star::drawing::XDrawPageSupplier,
    1023             :                         public com::sun::star::sheet::XPrintAreas,
    1024             :                         public com::sun::star::sheet::XSheetLinkable,
    1025             :                         public com::sun::star::sheet::XSheetAuditing,
    1026             :                         public com::sun::star::sheet::XSheetOutline,
    1027             :                         public com::sun::star::util::XProtectable,
    1028             :                         public com::sun::star::sheet::XScenario,
    1029             :                         public com::sun::star::sheet::XScenarioEnhanced,
    1030             :                         public com::sun::star::sheet::XExternalSheetName,
    1031             :                         public com::sun::star::document::XEventsSupplier
    1032             : {
    1033             :     friend class ScTableSheetsObj;      // for insertByName()
    1034             : 
    1035             : private:
    1036             :     const SfxItemPropertySet*       pSheetPropSet;
    1037             : 
    1038             :     SCTAB                   GetTab_Impl() const;
    1039             :     void                    PrintAreaUndo_Impl( ScPrintRangeSaver* pOldRanges );
    1040             : 
    1041             : protected:
    1042             :     virtual const SfxItemPropertyMap& GetItemPropertyMap() SAL_OVERRIDE;
    1043             :     virtual void GetOnePropertyValue( const SfxItemPropertySimpleEntry* pEntry,
    1044             :                                 ::com::sun::star::uno::Any& )
    1045             :                                 throw(::com::sun::star::uno::RuntimeException,
    1046             :                                       std::exception) SAL_OVERRIDE;
    1047             :     virtual void            SetOnePropertyValue( const SfxItemPropertySimpleEntry* pEntry,
    1048             :                                                 const ::com::sun::star::uno::Any& aValue )
    1049             :                                 throw(::com::sun::star::lang::IllegalArgumentException,
    1050             :                                       ::com::sun::star::uno::RuntimeException,
    1051             :                                       std::exception) SAL_OVERRIDE;
    1052             : 
    1053             : public:
    1054             :                             ScTableSheetObj(ScDocShell* pDocSh, SCTAB nTab);
    1055             :     virtual                 ~ScTableSheetObj();
    1056             : 
    1057             :     void                    InitInsertSheet(ScDocShell* pDocSh, SCTAB nTab);
    1058             : 
    1059             :     virtual ::com::sun::star::uno::Any SAL_CALL queryInterface(
    1060             :                                 const ::com::sun::star::uno::Type & rType )
    1061             :                                     throw(::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
    1062             :     virtual void SAL_CALL   acquire() throw() SAL_OVERRIDE;
    1063             :     virtual void SAL_CALL   release() throw() SAL_OVERRIDE;
    1064             : 
    1065             :                             // XSpreadsheet
    1066             :     virtual ::com::sun::star::uno::Reference< ::com::sun::star::sheet::XSheetCellCursor >
    1067             :                             SAL_CALL createCursor() throw(::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
    1068             :     virtual ::com::sun::star::uno::Reference< ::com::sun::star::sheet::XSheetCellCursor > SAL_CALL
    1069             :                             createCursorByRange( const ::com::sun::star::uno::Reference<
    1070             :                                 ::com::sun::star::sheet::XSheetCellRange >& aRange )
    1071             :                                     throw(::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
    1072             : 
    1073             :                             // XSheetCellRange
    1074             :     virtual ::com::sun::star::uno::Reference< ::com::sun::star::sheet::XSpreadsheet > SAL_CALL
    1075             :                             getSpreadsheet() throw(::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
    1076             : 
    1077             :                             // XCellRange
    1078             :     virtual ::com::sun::star::uno::Reference< ::com::sun::star::table::XCell > SAL_CALL
    1079             :                             getCellByPosition( sal_Int32 nColumn, sal_Int32 nRow )
    1080             :                                 throw(::com::sun::star::lang::IndexOutOfBoundsException,
    1081             :                                     ::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
    1082             :     virtual ::com::sun::star::uno::Reference< ::com::sun::star::table::XCellRange > SAL_CALL
    1083             :                             getCellRangeByPosition( sal_Int32 nLeft, sal_Int32 nTop,
    1084             :                                 sal_Int32 nRight, sal_Int32 nBottom )
    1085             :                                     throw(::com::sun::star::lang::IndexOutOfBoundsException,
    1086             :                                         ::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
    1087             :     using ScCellRangeObj::getCellRangeByName;
    1088             :     virtual ::com::sun::star::uno::Reference< ::com::sun::star::table::XCellRange > SAL_CALL
    1089             :                             getCellRangeByName( const OUString& aRange )
    1090             :                                 throw(::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
    1091             : 
    1092             :                             // XNamed
    1093             :     virtual OUString SAL_CALL getName() throw(::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
    1094             :     virtual void SAL_CALL   setName( const OUString& aName )
    1095             :                                 throw(::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
    1096             : 
    1097             :                             // XSheetPageBreak
    1098             :     virtual ::com::sun::star::uno::Sequence< ::com::sun::star::sheet::TablePageBreakData > SAL_CALL
    1099             :                             getColumnPageBreaks() throw(::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
    1100             :     virtual ::com::sun::star::uno::Sequence< ::com::sun::star::sheet::TablePageBreakData > SAL_CALL
    1101             :                             getRowPageBreaks() throw(::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
    1102             :     virtual void SAL_CALL   removeAllManualPageBreaks() throw(::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
    1103             : 
    1104             :                             // XCellRangeMovement
    1105             :     virtual void SAL_CALL   insertCells( const ::com::sun::star::table::CellRangeAddress& aRange,
    1106             :                                 ::com::sun::star::sheet::CellInsertMode nMode )
    1107             :                                     throw(::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
    1108             :     virtual void SAL_CALL   removeRange( const ::com::sun::star::table::CellRangeAddress& aRange,
    1109             :                                 ::com::sun::star::sheet::CellDeleteMode nMode )
    1110             :                                     throw(::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
    1111             :     virtual void SAL_CALL   moveRange( const ::com::sun::star::table::CellAddress& aDestination,
    1112             :                                 const ::com::sun::star::table::CellRangeAddress& aSource )
    1113             :                                     throw(::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
    1114             :     virtual void SAL_CALL   copyRange( const ::com::sun::star::table::CellAddress& aDestination,
    1115             :                                 const ::com::sun::star::table::CellRangeAddress& aSource )
    1116             :                                     throw(::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
    1117             : 
    1118             :                             // XTableChartsSupplier
    1119             :     virtual ::com::sun::star::uno::Reference< ::com::sun::star::table::XTableCharts > SAL_CALL
    1120             :                             getCharts() throw(::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
    1121             : 
    1122             :                             // XDataPilotTablesSupplier
    1123             :     virtual ::com::sun::star::uno::Reference< ::com::sun::star::sheet::XDataPilotTables > SAL_CALL
    1124             :                             getDataPilotTables() throw(::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
    1125             : 
    1126             :                             // XScenariosSupplier
    1127             :     virtual ::com::sun::star::uno::Reference< ::com::sun::star::sheet::XScenarios > SAL_CALL
    1128             :                             getScenarios() throw(::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
    1129             : 
    1130             :                             // XSheetAnnotationsSupplier
    1131             :     virtual ::com::sun::star::uno::Reference< ::com::sun::star::sheet::XSheetAnnotations > SAL_CALL
    1132             :                             getAnnotations() throw(::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
    1133             : 
    1134             :                             // XDrawPageSupplier
    1135             :     virtual ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XDrawPage > SAL_CALL
    1136             :                             getDrawPage() throw(::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
    1137             : 
    1138             :                             // XPrintAreas
    1139             :     virtual ::com::sun::star::uno::Sequence< ::com::sun::star::table::CellRangeAddress > SAL_CALL
    1140             :                             getPrintAreas() throw(::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
    1141             :     virtual void SAL_CALL setPrintAreas( const ::com::sun::star::uno::Sequence<
    1142             :                                 ::com::sun::star::table::CellRangeAddress >& aPrintAreas )
    1143             :                                     throw(::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
    1144             :     virtual sal_Bool SAL_CALL getPrintTitleColumns() throw(::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
    1145             :     virtual void SAL_CALL   setPrintTitleColumns( sal_Bool bPrintTitleColumns )
    1146             :                                 throw(::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
    1147             :     virtual ::com::sun::star::table::CellRangeAddress SAL_CALL getTitleColumns()
    1148             :                                 throw(::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
    1149             :     virtual void SAL_CALL   setTitleColumns(
    1150             :                                 const ::com::sun::star::table::CellRangeAddress& aTitleColumns )
    1151             :                                     throw(::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
    1152             :     virtual sal_Bool SAL_CALL getPrintTitleRows() throw(::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
    1153             :     virtual void SAL_CALL   setPrintTitleRows( sal_Bool bPrintTitleRows )
    1154             :                                 throw(::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
    1155             :     virtual ::com::sun::star::table::CellRangeAddress SAL_CALL getTitleRows()
    1156             :                                 throw(::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
    1157             :     virtual void SAL_CALL   setTitleRows(
    1158             :                                 const ::com::sun::star::table::CellRangeAddress& aTitleRows )
    1159             :                                     throw(::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
    1160             : 
    1161             :                             // XSheetLinkable
    1162             :     virtual ::com::sun::star::sheet::SheetLinkMode SAL_CALL getLinkMode()
    1163             :                                 throw(::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
    1164             :     virtual void SAL_CALL   setLinkMode( ::com::sun::star::sheet::SheetLinkMode nLinkMode )
    1165             :                                 throw(::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
    1166             :     virtual OUString SAL_CALL getLinkUrl() throw(::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
    1167             :     virtual void SAL_CALL   setLinkUrl( const OUString& aLinkUrl )
    1168             :                                 throw(::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
    1169             :     virtual OUString SAL_CALL getLinkSheetName() throw(::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
    1170             :     virtual void SAL_CALL   setLinkSheetName( const OUString& aLinkSheetName )
    1171             :                                 throw(::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
    1172             :     virtual void SAL_CALL   link( const OUString& aUrl,
    1173             :                                 const OUString& aSheetName,
    1174             :                                 const OUString& aFilterName,
    1175             :                                 const OUString& aFilterOptions,
    1176             :                                 ::com::sun::star::sheet::SheetLinkMode nMode )
    1177             :                                     throw(::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
    1178             : 
    1179             :                             // XSheetAuditing
    1180             :     virtual sal_Bool SAL_CALL hideDependents( const ::com::sun::star::table::CellAddress& aPosition )
    1181             :                                 throw(::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
    1182             :     virtual sal_Bool SAL_CALL hidePrecedents( const ::com::sun::star::table::CellAddress& aPosition )
    1183             :                                 throw(::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
    1184             :     virtual sal_Bool SAL_CALL showDependents( const ::com::sun::star::table::CellAddress& aPosition )
    1185             :                                 throw(::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
    1186             :     virtual sal_Bool SAL_CALL showPrecedents( const ::com::sun::star::table::CellAddress& aPosition )
    1187             :                                 throw(::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
    1188             :     virtual sal_Bool SAL_CALL showErrors( const ::com::sun::star::table::CellAddress& aPosition )
    1189             :                                 throw(::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
    1190             :     virtual sal_Bool SAL_CALL showInvalid() throw(::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
    1191             :     virtual void SAL_CALL   clearArrows() throw(::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
    1192             : 
    1193             :                             // XSheetOutline
    1194             :     virtual void SAL_CALL   group( const ::com::sun::star::table::CellRangeAddress& aRange,
    1195             :                                 ::com::sun::star::table::TableOrientation nOrientation )
    1196             :                                     throw (::com::sun::star::uno::RuntimeException,
    1197             :                                            std::exception) SAL_OVERRIDE;
    1198             :     virtual void SAL_CALL   ungroup( const ::com::sun::star::table::CellRangeAddress& aRange,
    1199             :                                 ::com::sun::star::table::TableOrientation nOrientation )
    1200             :                                     throw (::com::sun::star::uno::RuntimeException,
    1201             :                                            std::exception) SAL_OVERRIDE;
    1202             :     virtual void SAL_CALL   autoOutline( const ::com::sun::star::table::CellRangeAddress& aRange )
    1203             :                                 throw(::com::sun::star::uno::RuntimeException,
    1204             :                                       std::exception) SAL_OVERRIDE;
    1205             :     virtual void SAL_CALL   clearOutline()
    1206             :                                 throw(::com::sun::star::uno::RuntimeException,
    1207             :                                       std::exception) SAL_OVERRIDE;
    1208             :     virtual void SAL_CALL   hideDetail( const ::com::sun::star::table::CellRangeAddress& aRange )
    1209             :                                 throw(::com::sun::star::uno::RuntimeException,
    1210             :                                       std::exception) SAL_OVERRIDE;
    1211             :     virtual void SAL_CALL   showDetail( const ::com::sun::star::table::CellRangeAddress& aRange )
    1212             :                                 throw(::com::sun::star::uno::RuntimeException,
    1213             :                                       std::exception) SAL_OVERRIDE;
    1214             :     virtual void SAL_CALL   showLevel( sal_Int16 nLevel,
    1215             :                                 ::com::sun::star::table::TableOrientation nOrientation )
    1216             :                                     throw(::com::sun::star::uno::RuntimeException,
    1217             :                                           std::exception) SAL_OVERRIDE;
    1218             : 
    1219             :                             // XProtectable
    1220             :     virtual void SAL_CALL   protect( const OUString& aPassword )
    1221             :                                 throw(::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
    1222             :     virtual void SAL_CALL   unprotect( const OUString& aPassword )
    1223             :                                 throw(::com::sun::star::lang::IllegalArgumentException,
    1224             :                                     ::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
    1225             :     virtual sal_Bool SAL_CALL isProtected() throw(::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
    1226             : 
    1227             :                             // XScenario
    1228             :     virtual sal_Bool SAL_CALL getIsScenario() throw(::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
    1229             :     virtual OUString SAL_CALL getScenarioComment() throw(::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
    1230             :     virtual void SAL_CALL   setScenarioComment( const OUString& aScenarioComment )
    1231             :                                 throw(::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
    1232             :     virtual void SAL_CALL   addRanges( const ::com::sun::star::uno::Sequence<
    1233             :                                 ::com::sun::star::table::CellRangeAddress >& aRanges )
    1234             :                                     throw(::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
    1235             :     virtual void SAL_CALL   apply() throw(::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
    1236             :                             // XScenarioEnhanced
    1237             :     virtual ::com::sun::star::uno::Sequence< ::com::sun::star::table::CellRangeAddress > SAL_CALL
    1238             :                             getRanges(  )
    1239             :                                     throw(::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
    1240             : 
    1241             :                             // XExternalSheetName
    1242             :     virtual void SAL_CALL   setExternalName( const OUString& aUrl, const OUString& aSheetName )
    1243             :                                 throw (::com::sun::star::container::ElementExistException,
    1244             :                                        ::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
    1245             : 
    1246             :                             // XEventsSupplier
    1247             :     virtual ::com::sun::star::uno::Reference< ::com::sun::star::container::XNameReplace > SAL_CALL getEvents()
    1248             :                                 throw (::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
    1249             : 
    1250             :                             // XPropertySet overloaded due to sheet properties
    1251             :     virtual ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySetInfo >
    1252             :                             SAL_CALL getPropertySetInfo()
    1253             :                                 throw(::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
    1254             : 
    1255             :                             // XServiceInfo
    1256             :     virtual OUString SAL_CALL getImplementationName()
    1257             :                                 throw(::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
    1258             :     virtual sal_Bool SAL_CALL supportsService( const OUString& ServiceName )
    1259             :                                 throw(::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
    1260             :     virtual ::com::sun::star::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames()
    1261             :                                 throw(::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
    1262             : 
    1263             :                             // XUnoTunnel
    1264             :     virtual sal_Int64 SAL_CALL getSomething( const ::com::sun::star::uno::Sequence<
    1265             :                                     sal_Int8 >& aIdentifier )
    1266             :                                 throw(::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
    1267             : 
    1268             :     static const com::sun::star::uno::Sequence<sal_Int8>& getUnoTunnelId();
    1269             :     static ScTableSheetObj* getImplementation( const com::sun::star::uno::Reference<
    1270             :                                     com::sun::star::uno::XInterface> xObj );
    1271             : 
    1272             :                             // XTypeProvider
    1273             :     virtual ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Type > SAL_CALL getTypes()
    1274             :                                 throw(::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
    1275             :     virtual ::com::sun::star::uno::Sequence< sal_Int8 > SAL_CALL getImplementationId()
    1276             :                                 throw(::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
    1277             : };
    1278             : 
    1279             : class ScTableColumnObj : public ScCellRangeObj,
    1280             :                          public com::sun::star::container::XNamed
    1281             : {
    1282             : private:
    1283             :     const SfxItemPropertySet*       pColPropSet;
    1284             : 
    1285             : protected:
    1286             :     virtual const SfxItemPropertyMap& GetItemPropertyMap() SAL_OVERRIDE;
    1287             :     virtual void GetOnePropertyValue( const SfxItemPropertySimpleEntry* pEntry,
    1288             :                                 ::com::sun::star::uno::Any& )
    1289             :                                 throw(::com::sun::star::uno::RuntimeException,
    1290             :                                       std::exception) SAL_OVERRIDE;
    1291             :     virtual void            SetOnePropertyValue( const SfxItemPropertySimpleEntry* pEntry,
    1292             :                                                 const ::com::sun::star::uno::Any& aValue )
    1293             :                                 throw(::com::sun::star::lang::IllegalArgumentException,
    1294             :                                       ::com::sun::star::uno::RuntimeException,
    1295             :                                       std::exception) SAL_OVERRIDE;
    1296             : 
    1297             : public:
    1298             :                             ScTableColumnObj(ScDocShell* pDocSh, SCCOL nCol, SCTAB nTab);
    1299             :     virtual                 ~ScTableColumnObj();
    1300             : 
    1301             :     virtual ::com::sun::star::uno::Any SAL_CALL queryInterface(
    1302             :                                 const ::com::sun::star::uno::Type & rType )
    1303             :                                     throw(::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
    1304             :     virtual void SAL_CALL   acquire() throw() SAL_OVERRIDE;
    1305             :     virtual void SAL_CALL   release() throw() SAL_OVERRIDE;
    1306             : 
    1307             :                             // XNamed
    1308             :     virtual OUString SAL_CALL getName() throw(::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
    1309             :     virtual void SAL_CALL   setName( const OUString& aName )
    1310             :                                 throw(::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
    1311             : 
    1312             :                             // XPropertySet overloaded due to column properties
    1313             :     virtual ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySetInfo >
    1314             :                             SAL_CALL getPropertySetInfo()
    1315             :                                 throw(::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
    1316             : 
    1317             :                             // XServiceInfo
    1318             :     virtual OUString SAL_CALL getImplementationName()
    1319             :                                 throw(::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
    1320             :     virtual sal_Bool SAL_CALL supportsService( const OUString& ServiceName )
    1321             :                                 throw(::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
    1322             :     virtual ::com::sun::star::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames()
    1323             :                                 throw(::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
    1324             : 
    1325             :                             // XTypeProvider
    1326             :     virtual ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Type > SAL_CALL getTypes()
    1327             :                                 throw(::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
    1328             :     virtual ::com::sun::star::uno::Sequence< sal_Int8 > SAL_CALL getImplementationId()
    1329             :                                 throw(::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
    1330             : };
    1331             : 
    1332             : class ScTableRowObj : public ScCellRangeObj
    1333             : {
    1334             : private:
    1335             :     const SfxItemPropertySet*       pRowPropSet;
    1336             : 
    1337             : protected:
    1338             :     virtual const SfxItemPropertyMap& GetItemPropertyMap() SAL_OVERRIDE;
    1339             :     virtual void GetOnePropertyValue( const SfxItemPropertySimpleEntry* pEntry,
    1340             :                                 ::com::sun::star::uno::Any& )
    1341             :                                 throw(::com::sun::star::uno::RuntimeException,
    1342             :                                       std::exception) SAL_OVERRIDE;
    1343             :     virtual void            SetOnePropertyValue( const SfxItemPropertySimpleEntry* pEntry,
    1344             :                                                 const ::com::sun::star::uno::Any& aValue )
    1345             :                                 throw(::com::sun::star::lang::IllegalArgumentException,
    1346             :                                       ::com::sun::star::uno::RuntimeException,
    1347             :                                       std::exception) SAL_OVERRIDE;
    1348             : 
    1349             : public:
    1350             :                             ScTableRowObj(ScDocShell* pDocSh, SCROW nRow, SCTAB nTab);
    1351             :     virtual                 ~ScTableRowObj();
    1352             : 
    1353             :                             // XPropertySet overloaded due to row properties
    1354             :     virtual ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySetInfo >
    1355             :                             SAL_CALL getPropertySetInfo()
    1356             :                                 throw(::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
    1357             : 
    1358             :                             // XServiceInfo
    1359             :     virtual OUString SAL_CALL getImplementationName()
    1360             :                                 throw(::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
    1361             :     virtual sal_Bool SAL_CALL supportsService( const OUString& ServiceName )
    1362             :                                 throw(::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
    1363             :     virtual ::com::sun::star::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames()
    1364             :                                 throw(::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
    1365             : };
    1366             : 
    1367             : class ScCellsObj : public cppu::WeakImplHelper2<
    1368             :                             com::sun::star::container::XEnumerationAccess,
    1369             :                             com::sun::star::lang::XServiceInfo >,
    1370             :                         public SfxListener
    1371             : {
    1372             : private:
    1373             :     ScDocShell*             pDocShell;
    1374             :     ScRangeList             aRanges;
    1375             : 
    1376             : public:
    1377             :                             ScCellsObj(ScDocShell* pDocSh, const ScRangeList& rR);
    1378             :     virtual                 ~ScCellsObj();
    1379             : 
    1380             :     virtual void            Notify( SfxBroadcaster& rBC, const SfxHint& rHint ) SAL_OVERRIDE;
    1381             : 
    1382             :                             // XEnumerationAccess
    1383             :     virtual ::com::sun::star::uno::Reference< ::com::sun::star::container::XEnumeration > SAL_CALL
    1384             :                             createEnumeration() throw(::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
    1385             : 
    1386             :                             // XElementAccess
    1387             :     virtual ::com::sun::star::uno::Type SAL_CALL getElementType()
    1388             :                                 throw(::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
    1389             :     virtual sal_Bool SAL_CALL hasElements() throw(::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
    1390             : 
    1391             :                             // XServiceInfo
    1392             :     virtual OUString SAL_CALL getImplementationName()
    1393             :                                 throw(::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
    1394             :     virtual sal_Bool SAL_CALL supportsService( const OUString& ServiceName )
    1395             :                                 throw(::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
    1396             :     virtual ::com::sun::star::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames()
    1397             :                                 throw(::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
    1398             : };
    1399             : 
    1400             : class ScCellsEnumeration : public cppu::WeakImplHelper2<
    1401             :                                 com::sun::star::container::XEnumeration,
    1402             :                                 com::sun::star::lang::XServiceInfo >,
    1403             :                             public SfxListener
    1404             : {
    1405             : private:
    1406             :     ScDocShell*             pDocShell;
    1407             :     ScRangeList             aRanges;
    1408             :     ScAddress               aPos;
    1409             :     ScMarkData*             pMark;
    1410             :     bool                    bAtEnd;
    1411             : 
    1412             : private:
    1413             :     void                    Advance_Impl();
    1414             :     void                    CheckPos_Impl();
    1415             : 
    1416             : public:
    1417             :                             ScCellsEnumeration(ScDocShell* pDocSh, const ScRangeList& rR);
    1418             :     virtual                 ~ScCellsEnumeration();
    1419             : 
    1420             :     virtual void            Notify( SfxBroadcaster& rBC, const SfxHint& rHint ) SAL_OVERRIDE;
    1421             : 
    1422             :                             // XEnumeration
    1423             :     virtual sal_Bool SAL_CALL hasMoreElements() throw(::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
    1424             :     virtual ::com::sun::star::uno::Any SAL_CALL nextElement()
    1425             :                                 throw(::com::sun::star::container::NoSuchElementException,
    1426             :                                         ::com::sun::star::lang::WrappedTargetException,
    1427             :                                         ::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
    1428             : 
    1429             :                             // XServiceInfo
    1430             :     virtual OUString SAL_CALL getImplementationName()
    1431             :                                 throw(::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
    1432             :     virtual sal_Bool SAL_CALL supportsService( const OUString& ServiceName )
    1433             :                                 throw(::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
    1434             :     virtual ::com::sun::star::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames()
    1435             :                                 throw(::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
    1436             : };
    1437             : 
    1438             : class ScCellFormatsObj : public cppu::WeakImplHelper3<
    1439             :                             com::sun::star::container::XIndexAccess,
    1440             :                             com::sun::star::container::XEnumerationAccess,
    1441             :                             com::sun::star::lang::XServiceInfo >,
    1442             :                         public SfxListener
    1443             : {
    1444             : private:
    1445             :     ScDocShell*             pDocShell;
    1446             :     ScRange                 aTotalRange;
    1447             : 
    1448             : private:
    1449             :     ScCellRangeObj*         GetObjectByIndex_Impl(long nIndex) const;
    1450             : 
    1451             : public:
    1452             :                             ScCellFormatsObj(ScDocShell* pDocSh, const ScRange& rR);
    1453             :     virtual                 ~ScCellFormatsObj();
    1454             : 
    1455             :     virtual void            Notify( SfxBroadcaster& rBC, const SfxHint& rHint ) SAL_OVERRIDE;
    1456             : 
    1457             :                             // XIndexAccess
    1458             :     virtual sal_Int32 SAL_CALL getCount() throw(::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
    1459             :     virtual ::com::sun::star::uno::Any SAL_CALL getByIndex( sal_Int32 Index )
    1460             :                                 throw(::com::sun::star::lang::IndexOutOfBoundsException,
    1461             :                                     ::com::sun::star::lang::WrappedTargetException,
    1462             :                                     ::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
    1463             : 
    1464             :                             // XEnumerationAccess
    1465             :     virtual ::com::sun::star::uno::Reference< ::com::sun::star::container::XEnumeration > SAL_CALL
    1466             :                             createEnumeration() throw(::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
    1467             : 
    1468             :                             // XElementAccess
    1469             :     virtual ::com::sun::star::uno::Type SAL_CALL getElementType()
    1470             :                                 throw(::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
    1471             :     virtual sal_Bool SAL_CALL hasElements() throw(::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
    1472             : 
    1473             :                             // XServiceInfo
    1474             :     virtual OUString SAL_CALL getImplementationName()
    1475             :                                 throw(::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
    1476             :     virtual sal_Bool SAL_CALL supportsService( const OUString& ServiceName )
    1477             :                                 throw(::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
    1478             :     virtual ::com::sun::star::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames()
    1479             :                                 throw(::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
    1480             : };
    1481             : 
    1482             : class ScCellFormatsEnumeration : public cppu::WeakImplHelper2<
    1483             :                                     com::sun::star::container::XEnumeration,
    1484             :                                     com::sun::star::lang::XServiceInfo >,
    1485             :                                  public SfxListener
    1486             : {
    1487             : private:
    1488             :     ScDocShell*             pDocShell;
    1489             :     SCTAB                   nTab;
    1490             :     ScAttrRectIterator*     pIter;
    1491             :     ScRange                 aNext;
    1492             :     bool                    bAtEnd;
    1493             :     bool                    bDirty;
    1494             : 
    1495             : private:
    1496             :     void                    Advance_Impl();
    1497             :     ScCellRangeObj*         NextObject_Impl();
    1498             : 
    1499             : public:
    1500             :                             ScCellFormatsEnumeration(ScDocShell* pDocSh, const ScRange& rR);
    1501             :     virtual                 ~ScCellFormatsEnumeration();
    1502             : 
    1503             :     virtual void            Notify( SfxBroadcaster& rBC, const SfxHint& rHint ) SAL_OVERRIDE;
    1504             : 
    1505             :                             // XEnumeration
    1506             :     virtual sal_Bool SAL_CALL hasMoreElements() throw(::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
    1507             :     virtual ::com::sun::star::uno::Any SAL_CALL nextElement()
    1508             :                                 throw(::com::sun::star::container::NoSuchElementException,
    1509             :                                         ::com::sun::star::lang::WrappedTargetException,
    1510             :                                         ::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
    1511             : 
    1512             :                             // XServiceInfo
    1513             :     virtual OUString SAL_CALL getImplementationName()
    1514             :                                 throw(::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
    1515             :     virtual sal_Bool SAL_CALL supportsService( const OUString& ServiceName )
    1516             :                                 throw(::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
    1517             :     virtual ::com::sun::star::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames()
    1518             :                                 throw(::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
    1519             : };
    1520             : 
    1521             : typedef std::vector< ScRangeList > ScMyRangeLists;
    1522             : 
    1523             : class ScUniqueCellFormatsObj : public cppu::WeakImplHelper3<
    1524             :                             com::sun::star::container::XIndexAccess,
    1525             :                             com::sun::star::container::XEnumerationAccess,
    1526             :                             com::sun::star::lang::XServiceInfo >,
    1527             :                         public SfxListener
    1528             : {
    1529             : private:
    1530             :     ScDocShell*                     pDocShell;
    1531             :     ScRange                         aTotalRange;
    1532             :     ScMyRangeLists                  aRangeLists;
    1533             : 
    1534             : private:
    1535             :     void                            GetObjects_Impl();
    1536             : 
    1537             : public:
    1538             :                             ScUniqueCellFormatsObj(ScDocShell* pDocSh, const ScRange& rR);
    1539             :     virtual                 ~ScUniqueCellFormatsObj();
    1540             : 
    1541             :     virtual void            Notify( SfxBroadcaster& rBC, const SfxHint& rHint ) SAL_OVERRIDE;
    1542             : 
    1543             :                             // XIndexAccess
    1544             :     virtual sal_Int32 SAL_CALL getCount() throw(::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
    1545             :     virtual ::com::sun::star::uno::Any SAL_CALL getByIndex( sal_Int32 Index )
    1546             :                                 throw(::com::sun::star::lang::IndexOutOfBoundsException,
    1547             :                                     ::com::sun::star::lang::WrappedTargetException,
    1548             :                                     ::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
    1549             : 
    1550             :                             // XEnumerationAccess
    1551             :     virtual ::com::sun::star::uno::Reference< ::com::sun::star::container::XEnumeration > SAL_CALL
    1552             :                             createEnumeration() throw(::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
    1553             : 
    1554             :                             // XElementAccess
    1555             :     virtual ::com::sun::star::uno::Type SAL_CALL getElementType()
    1556             :                                 throw(::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
    1557             :     virtual sal_Bool SAL_CALL hasElements() throw(::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
    1558             : 
    1559             :                             // XServiceInfo
    1560             :     virtual OUString SAL_CALL getImplementationName()
    1561             :                                 throw(::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
    1562             :     virtual sal_Bool SAL_CALL supportsService( const OUString& ServiceName )
    1563             :                                 throw(::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
    1564             :     virtual ::com::sun::star::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames()
    1565             :                                 throw(::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
    1566             : };
    1567             : 
    1568             : class ScUniqueCellFormatsEnumeration : public cppu::WeakImplHelper2<
    1569             :                                     com::sun::star::container::XEnumeration,
    1570             :                                     com::sun::star::lang::XServiceInfo >,
    1571             :                                  public SfxListener
    1572             : {
    1573             : private:
    1574             :     ScMyRangeLists                  aRangeLists;
    1575             :     ScDocShell*                     pDocShell;
    1576             :     sal_Int32                       nCurrentPosition;
    1577             : 
    1578             : public:
    1579             :                             ScUniqueCellFormatsEnumeration(ScDocShell* pDocShell, const ScMyRangeLists& rRangeLists);
    1580             :     virtual                 ~ScUniqueCellFormatsEnumeration();
    1581             : 
    1582             :     virtual void            Notify( SfxBroadcaster& rBC, const SfxHint& rHint ) SAL_OVERRIDE;
    1583             : 
    1584             :                             // XEnumeration
    1585             :     virtual sal_Bool SAL_CALL hasMoreElements() throw(::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
    1586             :     virtual ::com::sun::star::uno::Any SAL_CALL nextElement()
    1587             :                                 throw(::com::sun::star::container::NoSuchElementException,
    1588             :                                         ::com::sun::star::lang::WrappedTargetException,
    1589             :                                         ::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
    1590             : 
    1591             :                             // XServiceInfo
    1592             :     virtual OUString SAL_CALL getImplementationName()
    1593             :                                 throw(::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
    1594             :     virtual sal_Bool SAL_CALL supportsService( const OUString& ServiceName )
    1595             :                                 throw(::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
    1596             :     virtual ::com::sun::star::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames()
    1597             :                                 throw(::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
    1598             : };
    1599             : 
    1600             : #endif
    1601             : 
    1602             : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */

Generated by: LCOV version 1.10