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 SC_CELLSUNO_HXX
21 : #define SC_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 0 : 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 :
126 : // ScCellRangesBase - base class for ScCellRangesObj (with access by index)
127 : // and ScCellRangeObj (without access by index)
128 :
129 : // XServiceInfo is implemented in derived classes
130 :
131 : class ScHelperFunctions
132 : {
133 : public:
134 : static const ::editeng::SvxBorderLine* GetBorderLine( ::editeng::SvxBorderLine& rLine, const com::sun::star::table::BorderLine& rStruct );
135 : static const ::editeng::SvxBorderLine* GetBorderLine( ::editeng::SvxBorderLine& rLine, const com::sun::star::table::BorderLine2& rStruct );
136 : static void FillBoxItems( SvxBoxItem& rOuter, SvxBoxInfoItem& rInner, const com::sun::star::table::TableBorder& rBorder );
137 : static void FillBoxItems( SvxBoxItem& rOuter, SvxBoxInfoItem& rInner, const com::sun::star::table::TableBorder2& rBorder );
138 : static void FillBorderLine( com::sun::star::table::BorderLine& rStruct, const ::editeng::SvxBorderLine* pLine );
139 : static void FillBorderLine( com::sun::star::table::BorderLine2& rStruct, const ::editeng::SvxBorderLine* pLine );
140 : static void AssignTableBorderToAny( com::sun::star::uno::Any& rAny,
141 : const SvxBoxItem& rOuter, const SvxBoxInfoItem& rInner, bool bInvalidateHorVerDist = false );
142 : static void AssignTableBorder2ToAny( com::sun::star::uno::Any& rAny,
143 : const SvxBoxItem& rOuter, const SvxBoxInfoItem& rInner, bool bInvalidateHorVerDist = false );
144 : static void ApplyBorder( ScDocShell* pDocShell, const ScRangeList& rRanges,
145 : const SvxBoxItem& rOuter, const SvxBoxInfoItem& rInner );
146 : };
147 :
148 : namespace ooo
149 : {
150 : namespace vba {
151 : namespace excel {
152 : class ScVbaCellRangeAccess; // Vba Helper class
153 : }
154 : }
155 : }
156 :
157 : class SC_DLLPUBLIC ScCellRangesBase : public com::sun::star::beans::XPropertySet,
158 : public com::sun::star::beans::XMultiPropertySet,
159 : public com::sun::star::beans::XPropertyState,
160 : public com::sun::star::sheet::XSheetOperation,
161 : public com::sun::star::chart::XChartDataArray,
162 : public com::sun::star::util::XIndent,
163 : public com::sun::star::sheet::XCellRangesQuery,
164 : public com::sun::star::sheet::XFormulaQuery,
165 : public com::sun::star::util::XReplaceable,
166 : public com::sun::star::util::XModifyBroadcaster,
167 : public com::sun::star::lang::XServiceInfo,
168 : public com::sun::star::lang::XUnoTunnel,
169 : public com::sun::star::lang::XTypeProvider,
170 : public com::sun::star::beans::XTolerantMultiPropertySet,
171 : public cppu::OWeakObject,
172 : public SfxListener
173 : {
174 : friend class ScTabViewObj; // for select()
175 : friend class ScTableSheetObj; // for createCursorByRange()
176 : friend class ooo::vba::excel::ScVbaCellRangeAccess;
177 :
178 : private:
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 : sal_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 0 : ScDocShell* GetDocShell() const { return pDocShell; }
250 : ScDocument* GetDocument() const;
251 0 : 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 :
506 : class SC_DLLPUBLIC ScCellRangesObj : public ScCellRangesBase,
507 : public com::sun::star::sheet::XSheetCellRangeContainer,
508 : public com::sun::star::container::XNameContainer,
509 : public com::sun::star::container::XEnumerationAccess
510 : {
511 : private:
512 : struct Impl;
513 : ::boost::scoped_ptr<Impl> m_pImpl;
514 :
515 : ScCellRangeObj* GetObjectByIndex_Impl(sal_Int32 nIndex) const;
516 :
517 : public:
518 : ScCellRangesObj(ScDocShell* pDocSh, const ScRangeList& rR);
519 : virtual ~ScCellRangesObj();
520 :
521 : virtual ::com::sun::star::uno::Any SAL_CALL queryInterface(
522 : const ::com::sun::star::uno::Type & rType )
523 : throw(::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
524 : virtual void SAL_CALL acquire() throw() SAL_OVERRIDE;
525 : virtual void SAL_CALL release() throw() SAL_OVERRIDE;
526 :
527 : virtual void RefChanged() SAL_OVERRIDE;
528 :
529 : // XSheetCellRanges
530 : virtual ::com::sun::star::uno::Reference< ::com::sun::star::container::XEnumerationAccess > SAL_CALL
531 : getCells() throw(::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
532 : virtual OUString SAL_CALL getRangeAddressesAsString()
533 : throw(::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
534 : virtual ::com::sun::star::uno::Sequence< ::com::sun::star::table::CellRangeAddress > SAL_CALL
535 : getRangeAddresses() throw(::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
536 :
537 : // XSheetCellRangeContainer
538 : virtual void SAL_CALL addRangeAddress( const ::com::sun::star::table::CellRangeAddress& rRange,
539 : sal_Bool bMergeRanges )
540 : throw(::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
541 : virtual void SAL_CALL removeRangeAddress( const ::com::sun::star::table::CellRangeAddress& rRange )
542 : throw(::com::sun::star::container::NoSuchElementException,
543 : ::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
544 : virtual void SAL_CALL addRangeAddresses( const ::com::sun::star::uno::Sequence<
545 : ::com::sun::star::table::CellRangeAddress >& rRanges,
546 : sal_Bool bMergeRanges )
547 : throw(::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
548 : virtual void SAL_CALL removeRangeAddresses( const ::com::sun::star::uno::Sequence<
549 : ::com::sun::star::table::CellRangeAddress >& rRanges )
550 : throw(::com::sun::star::container::NoSuchElementException,
551 : ::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
552 :
553 : // XNameContainer
554 : virtual void SAL_CALL insertByName( const OUString& aName,
555 : const ::com::sun::star::uno::Any& aElement )
556 : throw (::com::sun::star::lang::IllegalArgumentException,
557 : ::com::sun::star::container::ElementExistException,
558 : ::com::sun::star::lang::WrappedTargetException,
559 : ::com::sun::star::uno::RuntimeException,
560 : std::exception) SAL_OVERRIDE;
561 : virtual void SAL_CALL removeByName( const OUString& Name )
562 : throw(::com::sun::star::container::NoSuchElementException,
563 : ::com::sun::star::lang::WrappedTargetException,
564 : ::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
565 :
566 : // XNameReplace
567 : virtual void SAL_CALL replaceByName( const OUString& aName,
568 : const ::com::sun::star::uno::Any& aElement )
569 : throw(::com::sun::star::lang::IllegalArgumentException,
570 : ::com::sun::star::container::NoSuchElementException,
571 : ::com::sun::star::lang::WrappedTargetException,
572 : ::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
573 :
574 : // XNameAccess
575 : virtual ::com::sun::star::uno::Any SAL_CALL getByName( const OUString& aName )
576 : throw(::com::sun::star::container::NoSuchElementException,
577 : ::com::sun::star::lang::WrappedTargetException,
578 : ::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
579 : virtual ::com::sun::star::uno::Sequence< OUString > SAL_CALL getElementNames()
580 : throw(::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
581 : virtual sal_Bool SAL_CALL hasByName( const OUString& aName )
582 : throw(::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
583 :
584 : // XIndexAccess
585 : virtual sal_Int32 SAL_CALL getCount() throw(::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
586 : virtual ::com::sun::star::uno::Any SAL_CALL getByIndex( sal_Int32 Index )
587 : throw(::com::sun::star::lang::IndexOutOfBoundsException,
588 : ::com::sun::star::lang::WrappedTargetException,
589 : ::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
590 :
591 : // XElementAccess
592 : virtual ::com::sun::star::uno::Type SAL_CALL getElementType()
593 : throw(::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
594 : virtual sal_Bool SAL_CALL hasElements() throw(::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
595 :
596 : // XEnumerationAccess
597 : virtual ::com::sun::star::uno::Reference< ::com::sun::star::container::XEnumeration > SAL_CALL
598 : createEnumeration() throw(::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
599 :
600 : // XServiceInfo
601 : virtual OUString SAL_CALL getImplementationName()
602 : throw(::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
603 : virtual sal_Bool SAL_CALL supportsService( const OUString& ServiceName )
604 : throw(::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
605 : virtual ::com::sun::star::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames()
606 : throw(::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
607 :
608 : // XTypeProvider
609 : virtual ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Type > SAL_CALL getTypes()
610 : throw(::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
611 : virtual ::com::sun::star::uno::Sequence< sal_Int8 > SAL_CALL getImplementationId()
612 : throw(::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
613 : };
614 :
615 :
616 : class SC_DLLPUBLIC ScCellRangeObj : public ScCellRangesBase,
617 : public com::sun::star::sheet::XCellRangeAddressable,
618 : public com::sun::star::sheet::XSheetCellRange,
619 : public com::sun::star::sheet::XArrayFormulaRange,
620 : public com::sun::star::sheet::XArrayFormulaTokens,
621 : public com::sun::star::sheet::XCellRangeData,
622 : public com::sun::star::sheet::XCellRangeFormula,
623 : public com::sun::star::sheet::XMultipleOperation,
624 : public com::sun::star::util::XMergeable,
625 : public com::sun::star::sheet::XCellSeries,
626 : public com::sun::star::table::XAutoFormattable,
627 : public com::sun::star::util::XSortable,
628 : public com::sun::star::sheet::XSheetFilterableEx,
629 : public com::sun::star::sheet::XSubTotalCalculatable,
630 : public com::sun::star::util::XImportable,
631 : public com::sun::star::sheet::XCellFormatRangesSupplier,
632 : public com::sun::star::sheet::XUniqueCellFormatRangesSupplier,
633 : public com::sun::star::table::XColumnRowRange
634 : {
635 : private:
636 : const SfxItemPropertySet* pRangePropSet;
637 : ScRange aRange;
638 :
639 : protected:
640 0 : const ScRange& GetRange() const { return aRange; }
641 : virtual const SfxItemPropertyMap& GetItemPropertyMap() SAL_OVERRIDE;
642 : virtual void GetOnePropertyValue( const SfxItemPropertySimpleEntry* pEntry,
643 : ::com::sun::star::uno::Any& )
644 : throw(::com::sun::star::uno::RuntimeException,
645 : std::exception) SAL_OVERRIDE;
646 : virtual void SetOnePropertyValue( const SfxItemPropertySimpleEntry* pEntry,
647 : const ::com::sun::star::uno::Any& aValue )
648 : throw(::com::sun::star::lang::IllegalArgumentException,
649 : ::com::sun::star::uno::RuntimeException,
650 : std::exception) SAL_OVERRIDE;
651 :
652 : ::com::sun::star::uno::Reference< ::com::sun::star::table::XCell >
653 : GetCellByPosition_Impl( sal_Int32 nColumn, sal_Int32 nRow )
654 : throw(::com::sun::star::lang::IndexOutOfBoundsException,
655 : ::com::sun::star::uno::RuntimeException);
656 :
657 : void SetArrayFormula_Impl( const OUString& rFormula,
658 : const OUString& rFormulaNmsp,
659 : const formula::FormulaGrammar::Grammar eGrammar )
660 : throw(::com::sun::star::uno::RuntimeException);
661 :
662 : public:
663 : ScCellRangeObj(ScDocShell* pDocSh, const ScRange& rR);
664 : virtual ~ScCellRangeObj();
665 :
666 : // uses ObjectShell from document, if set (returns NULL otherwise)
667 : static com::sun::star::uno::Reference<com::sun::star::table::XCellRange>
668 : CreateRangeFromDoc( ScDocument* pDoc, const ScRange& rR );
669 :
670 : virtual ::com::sun::star::uno::Any SAL_CALL queryInterface(
671 : const ::com::sun::star::uno::Type & rType )
672 : throw(::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
673 : virtual void SAL_CALL acquire() throw() SAL_OVERRIDE;
674 : virtual void SAL_CALL release() throw() SAL_OVERRIDE;
675 :
676 : virtual void RefChanged() SAL_OVERRIDE;
677 :
678 : // via getImplementation()
679 : virtual void SetArrayFormulaWithGrammar( const OUString& rFormula,
680 : const OUString& rFormulaNmsp,
681 : const formula::FormulaGrammar::Grammar )
682 : throw(::com::sun::star::uno::RuntimeException);
683 :
684 : // XCellRangeAddressable
685 : virtual ::com::sun::star::table::CellRangeAddress SAL_CALL getRangeAddress()
686 : throw(::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
687 :
688 : // XSheetCellRange
689 : virtual ::com::sun::star::uno::Reference< ::com::sun::star::sheet::XSpreadsheet > SAL_CALL
690 : getSpreadsheet() throw(::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
691 :
692 : // XArrayFormulaRange
693 : virtual OUString SAL_CALL getArrayFormula() throw(::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
694 : virtual void SAL_CALL setArrayFormula( const OUString& aFormula )
695 : throw(::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
696 :
697 : // XArrayFormulaTokens
698 : virtual ::com::sun::star::uno::Sequence< ::com::sun::star::sheet::FormulaToken > SAL_CALL getArrayTokens()
699 : throw (::com::sun::star::uno::RuntimeException,
700 : std::exception) SAL_OVERRIDE;
701 : virtual void SAL_CALL setArrayTokens( const ::com::sun::star::uno::Sequence<
702 : ::com::sun::star::sheet::FormulaToken >& aTokens )
703 : throw (::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
704 :
705 : // XCellRangeData
706 : virtual ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Sequence<
707 : ::com::sun::star::uno::Any > > SAL_CALL getDataArray()
708 : throw(::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
709 : virtual void SAL_CALL setDataArray( const ::com::sun::star::uno::Sequence<
710 : ::com::sun::star::uno::Sequence<
711 : ::com::sun::star::uno::Any > >& aArray )
712 : throw(::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
713 :
714 : // XCellRangeFormula
715 : virtual ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Sequence<
716 : OUString > > SAL_CALL getFormulaArray()
717 : throw (::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
718 : virtual void SAL_CALL setFormulaArray( const ::com::sun::star::uno::Sequence<
719 : ::com::sun::star::uno::Sequence< OUString > >& aArray )
720 : throw (::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
721 :
722 : // XMultipleOperation
723 : virtual void SAL_CALL setTableOperation(
724 : const ::com::sun::star::table::CellRangeAddress& aFormulaRange,
725 : ::com::sun::star::sheet::TableOperationMode nMode,
726 : const ::com::sun::star::table::CellAddress& aColumnCell,
727 : const ::com::sun::star::table::CellAddress& aRowCell )
728 : throw(::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
729 :
730 : // XMergeable
731 : virtual void SAL_CALL merge( sal_Bool bMerge ) throw(::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
732 : virtual sal_Bool SAL_CALL getIsMerged() throw(::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
733 :
734 : // XCellSeries
735 : virtual void SAL_CALL fillSeries( ::com::sun::star::sheet::FillDirection nFillDirection,
736 : ::com::sun::star::sheet::FillMode nFillMode,
737 : ::com::sun::star::sheet::FillDateMode nFillDateMode,
738 : double fStep, double fEndValue )
739 : throw(::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
740 : virtual void SAL_CALL fillAuto( ::com::sun::star::sheet::FillDirection nFillDirection,
741 : sal_Int32 nSourceCount )
742 : throw(::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
743 :
744 : // XAutoFormattable
745 : virtual void SAL_CALL autoFormat( const OUString& aName )
746 : throw(::com::sun::star::lang::IllegalArgumentException,
747 : ::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
748 :
749 : // XSortable
750 : virtual ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue > SAL_CALL
751 : createSortDescriptor() throw(::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
752 : virtual void SAL_CALL sort( const ::com::sun::star::uno::Sequence<
753 : ::com::sun::star::beans::PropertyValue >& xDescriptor )
754 : throw(::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
755 :
756 : // XSheetFilterableEx
757 : virtual ::com::sun::star::uno::Reference< ::com::sun::star::sheet::XSheetFilterDescriptor > SAL_CALL
758 : createFilterDescriptorByObject( const ::com::sun::star::uno::Reference<
759 : ::com::sun::star::sheet::XSheetFilterable >& xObject )
760 : throw(::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
761 :
762 : // XSheetFilterable
763 : virtual ::com::sun::star::uno::Reference< ::com::sun::star::sheet::XSheetFilterDescriptor > SAL_CALL
764 : createFilterDescriptor( sal_Bool bEmpty )
765 : throw(::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
766 : virtual void SAL_CALL filter( const ::com::sun::star::uno::Reference<
767 : ::com::sun::star::sheet::XSheetFilterDescriptor >& xDescriptor )
768 : throw(::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
769 :
770 : // XSubTotalCalculatable
771 : virtual ::com::sun::star::uno::Reference< ::com::sun::star::sheet::XSubTotalDescriptor > SAL_CALL
772 : createSubTotalDescriptor( sal_Bool bEmpty )
773 : throw(::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
774 : virtual void SAL_CALL applySubTotals(const ::com::sun::star::uno::Reference<
775 : ::com::sun::star::sheet::XSubTotalDescriptor >& xDescriptor,
776 : sal_Bool bReplace)
777 : throw (::com::sun::star::uno::RuntimeException,
778 : std::exception) SAL_OVERRIDE;
779 : virtual void SAL_CALL removeSubTotals() throw(::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
780 :
781 : // XImportable
782 : virtual ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue > SAL_CALL
783 : createImportDescriptor( sal_Bool bEmpty )
784 : throw(::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
785 : virtual void SAL_CALL doImport( const ::com::sun::star::uno::Sequence<
786 : ::com::sun::star::beans::PropertyValue >& aDescriptor )
787 : throw(::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
788 :
789 : // XCellFormatRangesSupplier
790 : virtual ::com::sun::star::uno::Reference< ::com::sun::star::container::XIndexAccess > SAL_CALL
791 : getCellFormatRanges() throw(::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
792 :
793 : // XUniqueCellFormatRangesSupplier
794 : virtual ::com::sun::star::uno::Reference< ::com::sun::star::container::XIndexAccess > SAL_CALL
795 : getUniqueCellFormatRanges() throw(::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
796 :
797 : // XColumnRowRange
798 : virtual ::com::sun::star::uno::Reference< ::com::sun::star::table::XTableColumns > SAL_CALL
799 : getColumns() throw(::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
800 : virtual ::com::sun::star::uno::Reference< ::com::sun::star::table::XTableRows > SAL_CALL
801 : getRows() throw(::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
802 :
803 : // XCellRange
804 : virtual ::com::sun::star::uno::Reference< ::com::sun::star::table::XCell > SAL_CALL
805 : getCellByPosition( sal_Int32 nColumn, sal_Int32 nRow )
806 : throw(::com::sun::star::lang::IndexOutOfBoundsException,
807 : ::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
808 : virtual ::com::sun::star::uno::Reference< ::com::sun::star::table::XCellRange > SAL_CALL
809 : getCellRangeByPosition( sal_Int32 nLeft, sal_Int32 nTop,
810 : sal_Int32 nRight, sal_Int32 nBottom )
811 : throw(::com::sun::star::lang::IndexOutOfBoundsException,
812 : ::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
813 : virtual ::com::sun::star::uno::Reference< ::com::sun::star::table::XCellRange > SAL_CALL
814 : getCellRangeByName( const OUString& aRange )
815 : throw(::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
816 : ::com::sun::star::uno::Reference< ::com::sun::star::table::XCellRange >
817 : getCellRangeByName( const OUString& aRange, const ScAddress::Details& rDetails )
818 : throw(::com::sun::star::uno::RuntimeException);
819 :
820 : // XPropertySet overloaded due to Range-Properties
821 : virtual ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySetInfo >
822 : SAL_CALL getPropertySetInfo()
823 : throw(::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
824 :
825 : // XServiceInfo
826 : virtual OUString SAL_CALL getImplementationName()
827 : throw(::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
828 : virtual sal_Bool SAL_CALL supportsService( const OUString& ServiceName )
829 : throw(::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
830 : virtual ::com::sun::star::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames()
831 : throw(::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
832 :
833 : // XTypeProvider
834 : virtual ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Type > SAL_CALL getTypes()
835 : throw(::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
836 : virtual ::com::sun::star::uno::Sequence< sal_Int8 > SAL_CALL getImplementationId()
837 : throw(::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
838 : };
839 :
840 :
841 : //! really derive cell from range?
842 :
843 : class SC_DLLPUBLIC ScCellObj : public ScCellRangeObj,
844 : public com::sun::star::text::XText,
845 : public com::sun::star::container::XEnumerationAccess,
846 : public com::sun::star::table::XCell2,
847 : public com::sun::star::sheet::XFormulaTokens,
848 : public com::sun::star::sheet::XCellAddressable,
849 : public com::sun::star::sheet::XSheetAnnotationAnchor,
850 : public com::sun::star::text::XTextFieldsSupplier,
851 : public com::sun::star::document::XActionLockable
852 : {
853 : private:
854 : rtl::Reference<SvxUnoText> mxUnoText;
855 : const SfxItemPropertySet* pCellPropSet;
856 : ScAddress aCellPos;
857 : sal_Int16 nActionLockCount;
858 :
859 : private:
860 : OUString GetInputString_Impl(bool bEnglish) const;
861 : OUString GetOutputString_Impl() const;
862 : void SetString_Impl(const OUString& rString, bool bInterpret, bool bEnglish);
863 : double GetValue_Impl() const;
864 : void SetValue_Impl(double fValue);
865 : com::sun::star::table::CellContentType GetResultType_Impl();
866 :
867 : protected:
868 : virtual const SfxItemPropertyMap& GetItemPropertyMap() SAL_OVERRIDE;
869 : virtual void GetOnePropertyValue( const SfxItemPropertySimpleEntry* pEntry,
870 : ::com::sun::star::uno::Any& )
871 : throw(::com::sun::star::uno::RuntimeException,
872 : std::exception) SAL_OVERRIDE;
873 : virtual void SetOnePropertyValue( const SfxItemPropertySimpleEntry* pEntry,
874 : const ::com::sun::star::uno::Any& aValue )
875 : throw(::com::sun::star::lang::IllegalArgumentException,
876 : ::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
877 :
878 : public:
879 : static const SvxItemPropertySet* GetEditPropertySet();
880 : static const SfxItemPropertyMap& GetCellPropertyMap();
881 :
882 : ScCellObj(ScDocShell* pDocSh, const ScAddress& rP);
883 : virtual ~ScCellObj();
884 :
885 : virtual ::com::sun::star::uno::Any SAL_CALL queryInterface(
886 : const ::com::sun::star::uno::Type & rType )
887 : throw(::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
888 : virtual void SAL_CALL acquire() throw() SAL_OVERRIDE;
889 : virtual void SAL_CALL release() throw() SAL_OVERRIDE;
890 :
891 : virtual void RefChanged() SAL_OVERRIDE;
892 :
893 : SvxUnoText& GetUnoText();
894 :
895 : // XML import needs to set results at formula cells,
896 : // not meant for any other purpose.
897 0 : const ScAddress& GetPosition() const { return aCellPos; }
898 :
899 : void InputEnglishString( const OUString& rText );
900 :
901 : // XText
902 : virtual void SAL_CALL insertTextContent( const ::com::sun::star::uno::Reference<
903 : ::com::sun::star::text::XTextRange >& xRange,
904 : const ::com::sun::star::uno::Reference<
905 : ::com::sun::star::text::XTextContent >& xContent,
906 : sal_Bool bAbsorb )
907 : throw(::com::sun::star::lang::IllegalArgumentException,
908 : ::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
909 : virtual void SAL_CALL removeTextContent( const ::com::sun::star::uno::Reference<
910 : ::com::sun::star::text::XTextContent >& xContent )
911 : throw(::com::sun::star::container::NoSuchElementException,
912 : ::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
913 :
914 : // XSimpleText
915 : virtual ::com::sun::star::uno::Reference< ::com::sun::star::text::XTextCursor > SAL_CALL
916 : createTextCursor() throw(::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
917 : virtual ::com::sun::star::uno::Reference< ::com::sun::star::text::XTextCursor > SAL_CALL
918 : createTextCursorByRange( const ::com::sun::star::uno::Reference<
919 : ::com::sun::star::text::XTextRange >& aTextPosition )
920 : throw(::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
921 : virtual void SAL_CALL insertString( const ::com::sun::star::uno::Reference<
922 : ::com::sun::star::text::XTextRange >& xRange,
923 : const OUString& aString, sal_Bool bAbsorb )
924 : throw(::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
925 : virtual void SAL_CALL insertControlCharacter( const ::com::sun::star::uno::Reference<
926 : ::com::sun::star::text::XTextRange >& xRange,
927 : sal_Int16 nControlCharacter, sal_Bool bAbsorb )
928 : throw(::com::sun::star::lang::IllegalArgumentException,
929 : ::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
930 :
931 : // XTextRange
932 : virtual ::com::sun::star::uno::Reference< ::com::sun::star::text::XText > SAL_CALL
933 : getText() 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 : getStart() throw(::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
936 : virtual ::com::sun::star::uno::Reference< ::com::sun::star::text::XTextRange > SAL_CALL
937 : getEnd() throw(::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
938 : virtual OUString SAL_CALL getString() throw(::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
939 : virtual void SAL_CALL setString( const OUString& aString )
940 : throw(::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
941 :
942 : // XEnumerationAccess
943 : virtual ::com::sun::star::uno::Reference< ::com::sun::star::container::XEnumeration > SAL_CALL
944 : createEnumeration() throw(::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
945 :
946 : // XElementAccess
947 : virtual ::com::sun::star::uno::Type SAL_CALL getElementType()
948 : throw(::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
949 : virtual sal_Bool SAL_CALL hasElements() throw(::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
950 :
951 : // XCell
952 : virtual OUString SAL_CALL getFormula() throw(::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
953 : virtual void SAL_CALL setFormula( const OUString& aFormula )
954 : throw(::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
955 : virtual void SAL_CALL setFormulaResult( double nValue )
956 : throw(::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
957 : virtual void SAL_CALL setFormulaString( const OUString& aFormula )
958 : throw(::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
959 : virtual double SAL_CALL getValue() throw(::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
960 : virtual void SAL_CALL setValue( double nValue ) throw(::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
961 : virtual ::com::sun::star::table::CellContentType SAL_CALL getType()
962 : throw(::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
963 : virtual sal_Int32 SAL_CALL getError() throw(::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
964 :
965 : // XFormulaTokens
966 : virtual ::com::sun::star::uno::Sequence< ::com::sun::star::sheet::FormulaToken > SAL_CALL getTokens()
967 : throw (::com::sun::star::uno::RuntimeException,
968 : std::exception) SAL_OVERRIDE;
969 : virtual void SAL_CALL setTokens( const ::com::sun::star::uno::Sequence<
970 : ::com::sun::star::sheet::FormulaToken >& aTokens )
971 : throw (::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
972 :
973 : // XCellAddressable
974 : virtual ::com::sun::star::table::CellAddress SAL_CALL getCellAddress()
975 : throw(::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
976 :
977 : // XSheetAnnotationAnchor
978 : virtual ::com::sun::star::uno::Reference< ::com::sun::star::sheet::XSheetAnnotation > SAL_CALL
979 : getAnnotation() throw(::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
980 :
981 : // XTextFieldsSupplier
982 : virtual ::com::sun::star::uno::Reference< ::com::sun::star::container::XEnumerationAccess > SAL_CALL
983 : getTextFields() throw(::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
984 : virtual ::com::sun::star::uno::Reference< ::com::sun::star::container::XNameAccess > SAL_CALL
985 : getTextFieldMasters() throw(::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
986 :
987 : // XPropertySet overloaded due to cell properties
988 : virtual ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySetInfo >
989 : SAL_CALL getPropertySetInfo()
990 : throw(::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
991 :
992 : // XServiceInfo
993 : virtual OUString SAL_CALL getImplementationName()
994 : throw(::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
995 : virtual sal_Bool SAL_CALL supportsService( const OUString& ServiceName )
996 : throw(::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
997 : virtual ::com::sun::star::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames()
998 : throw(::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
999 :
1000 : // XTypeProvider
1001 : virtual ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Type > SAL_CALL getTypes()
1002 : throw(::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
1003 : virtual ::com::sun::star::uno::Sequence< sal_Int8 > SAL_CALL getImplementationId()
1004 : throw(::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
1005 :
1006 : // XActionLockable
1007 : virtual sal_Bool SAL_CALL isActionLocked() throw(::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
1008 : virtual void SAL_CALL addActionLock() throw(::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
1009 : virtual void SAL_CALL removeActionLock() throw(::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
1010 : virtual void SAL_CALL setActionLocks( sal_Int16 nLock )
1011 : throw(::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
1012 : virtual sal_Int16 SAL_CALL resetActionLocks() throw(::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
1013 :
1014 : static OUString GetOutputString_Impl(ScDocument* pDoc, const ScAddress& aPos);
1015 : };
1016 :
1017 :
1018 : class ScTableSheetObj : public ScCellRangeObj,
1019 : public com::sun::star::sheet::XSpreadsheet,
1020 : public com::sun::star::container::XNamed,
1021 : public com::sun::star::sheet::XSheetPageBreak,
1022 : public com::sun::star::sheet::XCellRangeMovement,
1023 : public com::sun::star::table::XTableChartsSupplier,
1024 : public com::sun::star::sheet::XDataPilotTablesSupplier,
1025 : public com::sun::star::sheet::XScenariosSupplier,
1026 : public com::sun::star::sheet::XSheetAnnotationsSupplier,
1027 : public com::sun::star::drawing::XDrawPageSupplier,
1028 : public com::sun::star::sheet::XPrintAreas,
1029 : public com::sun::star::sheet::XSheetLinkable,
1030 : public com::sun::star::sheet::XSheetAuditing,
1031 : public com::sun::star::sheet::XSheetOutline,
1032 : public com::sun::star::util::XProtectable,
1033 : public com::sun::star::sheet::XScenario,
1034 : public com::sun::star::sheet::XScenarioEnhanced,
1035 : public com::sun::star::sheet::XExternalSheetName,
1036 : public com::sun::star::document::XEventsSupplier
1037 : {
1038 : friend class ScTableSheetsObj; // for insertByName()
1039 :
1040 : private:
1041 : const SfxItemPropertySet* pSheetPropSet;
1042 :
1043 : SCTAB GetTab_Impl() const;
1044 : void PrintAreaUndo_Impl( ScPrintRangeSaver* pOldRanges );
1045 :
1046 : protected:
1047 : virtual const SfxItemPropertyMap& GetItemPropertyMap() SAL_OVERRIDE;
1048 : virtual void GetOnePropertyValue( const SfxItemPropertySimpleEntry* pEntry,
1049 : ::com::sun::star::uno::Any& )
1050 : throw(::com::sun::star::uno::RuntimeException,
1051 : std::exception) SAL_OVERRIDE;
1052 : virtual void SetOnePropertyValue( const SfxItemPropertySimpleEntry* pEntry,
1053 : const ::com::sun::star::uno::Any& aValue )
1054 : throw(::com::sun::star::lang::IllegalArgumentException,
1055 : ::com::sun::star::uno::RuntimeException,
1056 : std::exception) SAL_OVERRIDE;
1057 :
1058 : public:
1059 : ScTableSheetObj(ScDocShell* pDocSh, SCTAB nTab);
1060 : virtual ~ScTableSheetObj();
1061 :
1062 : void InitInsertSheet(ScDocShell* pDocSh, SCTAB nTab);
1063 :
1064 : virtual ::com::sun::star::uno::Any SAL_CALL queryInterface(
1065 : const ::com::sun::star::uno::Type & rType )
1066 : throw(::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
1067 : virtual void SAL_CALL acquire() throw() SAL_OVERRIDE;
1068 : virtual void SAL_CALL release() throw() SAL_OVERRIDE;
1069 :
1070 : // XSpreadsheet
1071 : virtual ::com::sun::star::uno::Reference< ::com::sun::star::sheet::XSheetCellCursor >
1072 : SAL_CALL createCursor() throw(::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
1073 : virtual ::com::sun::star::uno::Reference< ::com::sun::star::sheet::XSheetCellCursor > SAL_CALL
1074 : createCursorByRange( const ::com::sun::star::uno::Reference<
1075 : ::com::sun::star::sheet::XSheetCellRange >& aRange )
1076 : throw(::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
1077 :
1078 : // XSheetCellRange
1079 : virtual ::com::sun::star::uno::Reference< ::com::sun::star::sheet::XSpreadsheet > SAL_CALL
1080 : getSpreadsheet() throw(::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
1081 :
1082 : // XCellRange
1083 : virtual ::com::sun::star::uno::Reference< ::com::sun::star::table::XCell > SAL_CALL
1084 : getCellByPosition( sal_Int32 nColumn, sal_Int32 nRow )
1085 : throw(::com::sun::star::lang::IndexOutOfBoundsException,
1086 : ::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
1087 : virtual ::com::sun::star::uno::Reference< ::com::sun::star::table::XCellRange > SAL_CALL
1088 : getCellRangeByPosition( sal_Int32 nLeft, sal_Int32 nTop,
1089 : sal_Int32 nRight, sal_Int32 nBottom )
1090 : throw(::com::sun::star::lang::IndexOutOfBoundsException,
1091 : ::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
1092 : using ScCellRangeObj::getCellRangeByName;
1093 : virtual ::com::sun::star::uno::Reference< ::com::sun::star::table::XCellRange > SAL_CALL
1094 : getCellRangeByName( const OUString& aRange )
1095 : throw(::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
1096 :
1097 : // XNamed
1098 : virtual OUString SAL_CALL getName() throw(::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
1099 : virtual void SAL_CALL setName( const OUString& aName )
1100 : throw(::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
1101 :
1102 : // XSheetPageBreak
1103 : virtual ::com::sun::star::uno::Sequence< ::com::sun::star::sheet::TablePageBreakData > SAL_CALL
1104 : getColumnPageBreaks() throw(::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
1105 : virtual ::com::sun::star::uno::Sequence< ::com::sun::star::sheet::TablePageBreakData > SAL_CALL
1106 : getRowPageBreaks() throw(::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
1107 : virtual void SAL_CALL removeAllManualPageBreaks() throw(::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
1108 :
1109 : // XCellRangeMovement
1110 : virtual void SAL_CALL insertCells( const ::com::sun::star::table::CellRangeAddress& aRange,
1111 : ::com::sun::star::sheet::CellInsertMode nMode )
1112 : throw(::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
1113 : virtual void SAL_CALL removeRange( const ::com::sun::star::table::CellRangeAddress& aRange,
1114 : ::com::sun::star::sheet::CellDeleteMode nMode )
1115 : throw(::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
1116 : virtual void SAL_CALL moveRange( const ::com::sun::star::table::CellAddress& aDestination,
1117 : const ::com::sun::star::table::CellRangeAddress& aSource )
1118 : throw(::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
1119 : virtual void SAL_CALL copyRange( const ::com::sun::star::table::CellAddress& aDestination,
1120 : const ::com::sun::star::table::CellRangeAddress& aSource )
1121 : throw(::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
1122 :
1123 : // XTableChartsSupplier
1124 : virtual ::com::sun::star::uno::Reference< ::com::sun::star::table::XTableCharts > SAL_CALL
1125 : getCharts() throw(::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
1126 :
1127 : // XDataPilotTablesSupplier
1128 : virtual ::com::sun::star::uno::Reference< ::com::sun::star::sheet::XDataPilotTables > SAL_CALL
1129 : getDataPilotTables() throw(::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
1130 :
1131 : // XScenariosSupplier
1132 : virtual ::com::sun::star::uno::Reference< ::com::sun::star::sheet::XScenarios > SAL_CALL
1133 : getScenarios() throw(::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
1134 :
1135 : // XSheetAnnotationsSupplier
1136 : virtual ::com::sun::star::uno::Reference< ::com::sun::star::sheet::XSheetAnnotations > SAL_CALL
1137 : getAnnotations() throw(::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
1138 :
1139 : // XDrawPageSupplier
1140 : virtual ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XDrawPage > SAL_CALL
1141 : getDrawPage() throw(::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
1142 :
1143 : // XPrintAreas
1144 : virtual ::com::sun::star::uno::Sequence< ::com::sun::star::table::CellRangeAddress > SAL_CALL
1145 : getPrintAreas() throw(::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
1146 : virtual void SAL_CALL setPrintAreas( const ::com::sun::star::uno::Sequence<
1147 : ::com::sun::star::table::CellRangeAddress >& aPrintAreas )
1148 : throw(::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
1149 : virtual sal_Bool SAL_CALL getPrintTitleColumns() throw(::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
1150 : virtual void SAL_CALL setPrintTitleColumns( sal_Bool bPrintTitleColumns )
1151 : throw(::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
1152 : virtual ::com::sun::star::table::CellRangeAddress SAL_CALL getTitleColumns()
1153 : throw(::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
1154 : virtual void SAL_CALL setTitleColumns(
1155 : const ::com::sun::star::table::CellRangeAddress& aTitleColumns )
1156 : throw(::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
1157 : virtual sal_Bool SAL_CALL getPrintTitleRows() throw(::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
1158 : virtual void SAL_CALL setPrintTitleRows( sal_Bool bPrintTitleRows )
1159 : throw(::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
1160 : virtual ::com::sun::star::table::CellRangeAddress SAL_CALL getTitleRows()
1161 : throw(::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
1162 : virtual void SAL_CALL setTitleRows(
1163 : const ::com::sun::star::table::CellRangeAddress& aTitleRows )
1164 : throw(::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
1165 :
1166 : // XSheetLinkable
1167 : virtual ::com::sun::star::sheet::SheetLinkMode SAL_CALL getLinkMode()
1168 : throw(::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
1169 : virtual void SAL_CALL setLinkMode( ::com::sun::star::sheet::SheetLinkMode nLinkMode )
1170 : throw(::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
1171 : virtual OUString SAL_CALL getLinkUrl() throw(::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
1172 : virtual void SAL_CALL setLinkUrl( const OUString& aLinkUrl )
1173 : throw(::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
1174 : virtual OUString SAL_CALL getLinkSheetName() throw(::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
1175 : virtual void SAL_CALL setLinkSheetName( const OUString& aLinkSheetName )
1176 : throw(::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
1177 : virtual void SAL_CALL link( const OUString& aUrl,
1178 : const OUString& aSheetName,
1179 : const OUString& aFilterName,
1180 : const OUString& aFilterOptions,
1181 : ::com::sun::star::sheet::SheetLinkMode nMode )
1182 : throw(::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
1183 :
1184 : // XSheetAuditing
1185 : virtual sal_Bool SAL_CALL hideDependents( const ::com::sun::star::table::CellAddress& aPosition )
1186 : throw(::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
1187 : virtual sal_Bool SAL_CALL hidePrecedents( const ::com::sun::star::table::CellAddress& aPosition )
1188 : throw(::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
1189 : virtual sal_Bool SAL_CALL showDependents( const ::com::sun::star::table::CellAddress& aPosition )
1190 : throw(::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
1191 : virtual sal_Bool SAL_CALL showPrecedents( const ::com::sun::star::table::CellAddress& aPosition )
1192 : throw(::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
1193 : virtual sal_Bool SAL_CALL showErrors( const ::com::sun::star::table::CellAddress& aPosition )
1194 : throw(::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
1195 : virtual sal_Bool SAL_CALL showInvalid() throw(::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
1196 : virtual void SAL_CALL clearArrows() throw(::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
1197 :
1198 : // XSheetOutline
1199 : virtual void SAL_CALL group( const ::com::sun::star::table::CellRangeAddress& aRange,
1200 : ::com::sun::star::table::TableOrientation nOrientation )
1201 : throw (::com::sun::star::uno::RuntimeException,
1202 : std::exception) SAL_OVERRIDE;
1203 : virtual void SAL_CALL ungroup( const ::com::sun::star::table::CellRangeAddress& aRange,
1204 : ::com::sun::star::table::TableOrientation nOrientation )
1205 : throw (::com::sun::star::uno::RuntimeException,
1206 : std::exception) SAL_OVERRIDE;
1207 : virtual void SAL_CALL autoOutline( const ::com::sun::star::table::CellRangeAddress& aRange )
1208 : throw(::com::sun::star::uno::RuntimeException,
1209 : std::exception) SAL_OVERRIDE;
1210 : virtual void SAL_CALL clearOutline()
1211 : throw(::com::sun::star::uno::RuntimeException,
1212 : std::exception) SAL_OVERRIDE;
1213 : virtual void SAL_CALL hideDetail( const ::com::sun::star::table::CellRangeAddress& aRange )
1214 : throw(::com::sun::star::uno::RuntimeException,
1215 : std::exception) SAL_OVERRIDE;
1216 : virtual void SAL_CALL showDetail( const ::com::sun::star::table::CellRangeAddress& aRange )
1217 : throw(::com::sun::star::uno::RuntimeException,
1218 : std::exception) SAL_OVERRIDE;
1219 : virtual void SAL_CALL showLevel( sal_Int16 nLevel,
1220 : ::com::sun::star::table::TableOrientation nOrientation )
1221 : throw(::com::sun::star::uno::RuntimeException,
1222 : std::exception) SAL_OVERRIDE;
1223 :
1224 : // XProtectable
1225 : virtual void SAL_CALL protect( const OUString& aPassword )
1226 : throw(::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
1227 : virtual void SAL_CALL unprotect( const OUString& aPassword )
1228 : throw(::com::sun::star::lang::IllegalArgumentException,
1229 : ::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
1230 : virtual sal_Bool SAL_CALL isProtected() throw(::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
1231 :
1232 : // XScenario
1233 : virtual sal_Bool SAL_CALL getIsScenario() throw(::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
1234 : virtual OUString SAL_CALL getScenarioComment() throw(::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
1235 : virtual void SAL_CALL setScenarioComment( const OUString& aScenarioComment )
1236 : throw(::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
1237 : virtual void SAL_CALL addRanges( const ::com::sun::star::uno::Sequence<
1238 : ::com::sun::star::table::CellRangeAddress >& aRanges )
1239 : throw(::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
1240 : virtual void SAL_CALL apply() throw(::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
1241 : // XScenarioEnhanced
1242 : virtual ::com::sun::star::uno::Sequence< ::com::sun::star::table::CellRangeAddress > SAL_CALL
1243 : getRanges( )
1244 : throw(::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
1245 :
1246 : // XExternalSheetName
1247 : virtual void SAL_CALL setExternalName( const OUString& aUrl, const OUString& aSheetName )
1248 : throw (::com::sun::star::container::ElementExistException,
1249 : ::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
1250 :
1251 : // XEventsSupplier
1252 : virtual ::com::sun::star::uno::Reference< ::com::sun::star::container::XNameReplace > SAL_CALL getEvents()
1253 : throw (::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
1254 :
1255 : // XPropertySet overloaded due to sheet properties
1256 : virtual ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySetInfo >
1257 : SAL_CALL getPropertySetInfo()
1258 : throw(::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
1259 :
1260 : // XServiceInfo
1261 : virtual OUString SAL_CALL getImplementationName()
1262 : throw(::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
1263 : virtual sal_Bool SAL_CALL supportsService( const OUString& ServiceName )
1264 : throw(::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
1265 : virtual ::com::sun::star::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames()
1266 : throw(::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
1267 :
1268 : // XUnoTunnel
1269 : virtual sal_Int64 SAL_CALL getSomething( const ::com::sun::star::uno::Sequence<
1270 : sal_Int8 >& aIdentifier )
1271 : throw(::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
1272 :
1273 : static const com::sun::star::uno::Sequence<sal_Int8>& getUnoTunnelId();
1274 : static ScTableSheetObj* getImplementation( const com::sun::star::uno::Reference<
1275 : com::sun::star::uno::XInterface> xObj );
1276 :
1277 : // XTypeProvider
1278 : virtual ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Type > SAL_CALL getTypes()
1279 : throw(::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
1280 : virtual ::com::sun::star::uno::Sequence< sal_Int8 > SAL_CALL getImplementationId()
1281 : throw(::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
1282 : };
1283 :
1284 :
1285 : class ScTableColumnObj : public ScCellRangeObj,
1286 : public com::sun::star::container::XNamed
1287 : {
1288 : private:
1289 : const SfxItemPropertySet* pColPropSet;
1290 :
1291 : protected:
1292 : virtual const SfxItemPropertyMap& GetItemPropertyMap() SAL_OVERRIDE;
1293 : virtual void GetOnePropertyValue( const SfxItemPropertySimpleEntry* pEntry,
1294 : ::com::sun::star::uno::Any& )
1295 : throw(::com::sun::star::uno::RuntimeException,
1296 : std::exception) SAL_OVERRIDE;
1297 : virtual void SetOnePropertyValue( const SfxItemPropertySimpleEntry* pEntry,
1298 : const ::com::sun::star::uno::Any& aValue )
1299 : throw(::com::sun::star::lang::IllegalArgumentException,
1300 : ::com::sun::star::uno::RuntimeException,
1301 : std::exception) SAL_OVERRIDE;
1302 :
1303 : public:
1304 : ScTableColumnObj(ScDocShell* pDocSh, SCCOL nCol, SCTAB nTab);
1305 : virtual ~ScTableColumnObj();
1306 :
1307 : virtual ::com::sun::star::uno::Any SAL_CALL queryInterface(
1308 : const ::com::sun::star::uno::Type & rType )
1309 : throw(::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
1310 : virtual void SAL_CALL acquire() throw() SAL_OVERRIDE;
1311 : virtual void SAL_CALL release() throw() SAL_OVERRIDE;
1312 :
1313 : // XNamed
1314 : virtual OUString SAL_CALL getName() throw(::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
1315 : virtual void SAL_CALL setName( const OUString& aName )
1316 : throw(::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
1317 :
1318 : // XPropertySet overloaded due to column properties
1319 : virtual ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySetInfo >
1320 : SAL_CALL getPropertySetInfo()
1321 : throw(::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
1322 :
1323 : // XServiceInfo
1324 : virtual OUString SAL_CALL getImplementationName()
1325 : throw(::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
1326 : virtual sal_Bool SAL_CALL supportsService( const OUString& ServiceName )
1327 : throw(::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
1328 : virtual ::com::sun::star::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames()
1329 : throw(::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
1330 :
1331 : // XTypeProvider
1332 : virtual ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Type > SAL_CALL getTypes()
1333 : throw(::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
1334 : virtual ::com::sun::star::uno::Sequence< sal_Int8 > SAL_CALL getImplementationId()
1335 : throw(::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
1336 : };
1337 :
1338 :
1339 : class ScTableRowObj : public ScCellRangeObj
1340 : {
1341 : private:
1342 : const SfxItemPropertySet* pRowPropSet;
1343 :
1344 : protected:
1345 : virtual const SfxItemPropertyMap& GetItemPropertyMap() SAL_OVERRIDE;
1346 : virtual void GetOnePropertyValue( const SfxItemPropertySimpleEntry* pEntry,
1347 : ::com::sun::star::uno::Any& )
1348 : throw(::com::sun::star::uno::RuntimeException,
1349 : std::exception) SAL_OVERRIDE;
1350 : virtual void SetOnePropertyValue( const SfxItemPropertySimpleEntry* pEntry,
1351 : const ::com::sun::star::uno::Any& aValue )
1352 : throw(::com::sun::star::lang::IllegalArgumentException,
1353 : ::com::sun::star::uno::RuntimeException,
1354 : std::exception) SAL_OVERRIDE;
1355 :
1356 : public:
1357 : ScTableRowObj(ScDocShell* pDocSh, SCROW nRow, SCTAB nTab);
1358 : virtual ~ScTableRowObj();
1359 :
1360 : // XPropertySet overloaded due to row properties
1361 : virtual ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySetInfo >
1362 : SAL_CALL getPropertySetInfo()
1363 : throw(::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
1364 :
1365 : // XServiceInfo
1366 : virtual OUString SAL_CALL getImplementationName()
1367 : throw(::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
1368 : virtual sal_Bool SAL_CALL supportsService( const OUString& ServiceName )
1369 : throw(::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
1370 : virtual ::com::sun::star::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames()
1371 : throw(::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
1372 : };
1373 :
1374 :
1375 : class ScCellsObj : public cppu::WeakImplHelper2<
1376 : com::sun::star::container::XEnumerationAccess,
1377 : com::sun::star::lang::XServiceInfo >,
1378 : public SfxListener
1379 : {
1380 : private:
1381 : ScDocShell* pDocShell;
1382 : ScRangeList aRanges;
1383 :
1384 : public:
1385 : ScCellsObj(ScDocShell* pDocSh, const ScRangeList& rR);
1386 : virtual ~ScCellsObj();
1387 :
1388 : virtual void Notify( SfxBroadcaster& rBC, const SfxHint& rHint ) SAL_OVERRIDE;
1389 :
1390 : // XEnumerationAccess
1391 : virtual ::com::sun::star::uno::Reference< ::com::sun::star::container::XEnumeration > SAL_CALL
1392 : createEnumeration() throw(::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
1393 :
1394 : // XElementAccess
1395 : virtual ::com::sun::star::uno::Type SAL_CALL getElementType()
1396 : throw(::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
1397 : virtual sal_Bool SAL_CALL hasElements() throw(::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
1398 :
1399 : // XServiceInfo
1400 : virtual OUString SAL_CALL getImplementationName()
1401 : throw(::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
1402 : virtual sal_Bool SAL_CALL supportsService( const OUString& ServiceName )
1403 : throw(::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
1404 : virtual ::com::sun::star::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames()
1405 : throw(::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
1406 : };
1407 :
1408 :
1409 : class ScCellsEnumeration : public cppu::WeakImplHelper2<
1410 : com::sun::star::container::XEnumeration,
1411 : com::sun::star::lang::XServiceInfo >,
1412 : public SfxListener
1413 : {
1414 : private:
1415 : ScDocShell* pDocShell;
1416 : ScRangeList aRanges;
1417 : ScAddress aPos;
1418 : ScMarkData* pMark;
1419 : bool bAtEnd;
1420 :
1421 : private:
1422 : void Advance_Impl();
1423 : void CheckPos_Impl();
1424 :
1425 : public:
1426 : ScCellsEnumeration(ScDocShell* pDocSh, const ScRangeList& rR);
1427 : virtual ~ScCellsEnumeration();
1428 :
1429 : virtual void Notify( SfxBroadcaster& rBC, const SfxHint& rHint ) SAL_OVERRIDE;
1430 :
1431 : // XEnumeration
1432 : virtual sal_Bool SAL_CALL hasMoreElements() throw(::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
1433 : virtual ::com::sun::star::uno::Any SAL_CALL nextElement()
1434 : throw(::com::sun::star::container::NoSuchElementException,
1435 : ::com::sun::star::lang::WrappedTargetException,
1436 : ::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
1437 :
1438 : // XServiceInfo
1439 : virtual OUString SAL_CALL getImplementationName()
1440 : throw(::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
1441 : virtual sal_Bool SAL_CALL supportsService( const OUString& ServiceName )
1442 : throw(::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
1443 : virtual ::com::sun::star::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames()
1444 : throw(::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
1445 : };
1446 :
1447 : class ScCellFormatsObj : public cppu::WeakImplHelper3<
1448 : com::sun::star::container::XIndexAccess,
1449 : com::sun::star::container::XEnumerationAccess,
1450 : com::sun::star::lang::XServiceInfo >,
1451 : public SfxListener
1452 : {
1453 : private:
1454 : ScDocShell* pDocShell;
1455 : ScRange aTotalRange;
1456 :
1457 : private:
1458 : ScCellRangeObj* GetObjectByIndex_Impl(long nIndex) const;
1459 :
1460 : public:
1461 : ScCellFormatsObj(ScDocShell* pDocSh, const ScRange& rR);
1462 : virtual ~ScCellFormatsObj();
1463 :
1464 : virtual void Notify( SfxBroadcaster& rBC, const SfxHint& rHint ) SAL_OVERRIDE;
1465 :
1466 : // XIndexAccess
1467 : virtual sal_Int32 SAL_CALL getCount() throw(::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
1468 : virtual ::com::sun::star::uno::Any SAL_CALL getByIndex( sal_Int32 Index )
1469 : throw(::com::sun::star::lang::IndexOutOfBoundsException,
1470 : ::com::sun::star::lang::WrappedTargetException,
1471 : ::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
1472 :
1473 : // XEnumerationAccess
1474 : virtual ::com::sun::star::uno::Reference< ::com::sun::star::container::XEnumeration > SAL_CALL
1475 : createEnumeration() throw(::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
1476 :
1477 : // XElementAccess
1478 : virtual ::com::sun::star::uno::Type SAL_CALL getElementType()
1479 : throw(::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
1480 : virtual sal_Bool SAL_CALL hasElements() throw(::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
1481 :
1482 : // XServiceInfo
1483 : virtual OUString SAL_CALL getImplementationName()
1484 : throw(::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
1485 : virtual sal_Bool SAL_CALL supportsService( const OUString& ServiceName )
1486 : throw(::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
1487 : virtual ::com::sun::star::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames()
1488 : throw(::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
1489 : };
1490 :
1491 :
1492 : class ScCellFormatsEnumeration : public cppu::WeakImplHelper2<
1493 : com::sun::star::container::XEnumeration,
1494 : com::sun::star::lang::XServiceInfo >,
1495 : public SfxListener
1496 : {
1497 : private:
1498 : ScDocShell* pDocShell;
1499 : SCTAB nTab;
1500 : ScAttrRectIterator* pIter;
1501 : ScRange aNext;
1502 : bool bAtEnd;
1503 : bool bDirty;
1504 :
1505 : private:
1506 : void Advance_Impl();
1507 : ScCellRangeObj* NextObject_Impl();
1508 :
1509 : public:
1510 : ScCellFormatsEnumeration(ScDocShell* pDocSh, const ScRange& rR);
1511 : virtual ~ScCellFormatsEnumeration();
1512 :
1513 : virtual void Notify( SfxBroadcaster& rBC, const SfxHint& rHint ) SAL_OVERRIDE;
1514 :
1515 : // XEnumeration
1516 : virtual sal_Bool SAL_CALL hasMoreElements() throw(::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
1517 : virtual ::com::sun::star::uno::Any SAL_CALL nextElement()
1518 : throw(::com::sun::star::container::NoSuchElementException,
1519 : ::com::sun::star::lang::WrappedTargetException,
1520 : ::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
1521 :
1522 : // XServiceInfo
1523 : virtual OUString SAL_CALL getImplementationName()
1524 : throw(::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
1525 : virtual sal_Bool SAL_CALL supportsService( const OUString& ServiceName )
1526 : throw(::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
1527 : virtual ::com::sun::star::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames()
1528 : throw(::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
1529 : };
1530 :
1531 : typedef std::vector< ScRangeList > ScMyRangeLists;
1532 :
1533 : class ScUniqueCellFormatsObj : public cppu::WeakImplHelper3<
1534 : com::sun::star::container::XIndexAccess,
1535 : com::sun::star::container::XEnumerationAccess,
1536 : com::sun::star::lang::XServiceInfo >,
1537 : public SfxListener
1538 : {
1539 : private:
1540 : ScDocShell* pDocShell;
1541 : ScRange aTotalRange;
1542 : ScMyRangeLists aRangeLists;
1543 :
1544 : private:
1545 : void GetObjects_Impl();
1546 :
1547 : public:
1548 : ScUniqueCellFormatsObj(ScDocShell* pDocSh, const ScRange& rR);
1549 : virtual ~ScUniqueCellFormatsObj();
1550 :
1551 : virtual void Notify( SfxBroadcaster& rBC, const SfxHint& rHint ) SAL_OVERRIDE;
1552 :
1553 : // XIndexAccess
1554 : virtual sal_Int32 SAL_CALL getCount() throw(::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
1555 : virtual ::com::sun::star::uno::Any SAL_CALL getByIndex( sal_Int32 Index )
1556 : throw(::com::sun::star::lang::IndexOutOfBoundsException,
1557 : ::com::sun::star::lang::WrappedTargetException,
1558 : ::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
1559 :
1560 : // XEnumerationAccess
1561 : virtual ::com::sun::star::uno::Reference< ::com::sun::star::container::XEnumeration > SAL_CALL
1562 : createEnumeration() throw(::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
1563 :
1564 : // XElementAccess
1565 : virtual ::com::sun::star::uno::Type SAL_CALL getElementType()
1566 : throw(::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
1567 : virtual sal_Bool SAL_CALL hasElements() throw(::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
1568 :
1569 : // XServiceInfo
1570 : virtual OUString SAL_CALL getImplementationName()
1571 : throw(::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
1572 : virtual sal_Bool SAL_CALL supportsService( const OUString& ServiceName )
1573 : throw(::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
1574 : virtual ::com::sun::star::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames()
1575 : throw(::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
1576 : };
1577 :
1578 : class ScUniqueCellFormatsEnumeration : public cppu::WeakImplHelper2<
1579 : com::sun::star::container::XEnumeration,
1580 : com::sun::star::lang::XServiceInfo >,
1581 : public SfxListener
1582 : {
1583 : private:
1584 : ScMyRangeLists aRangeLists;
1585 : ScDocShell* pDocShell;
1586 : sal_Int32 nCurrentPosition;
1587 :
1588 : public:
1589 : ScUniqueCellFormatsEnumeration(ScDocShell* pDocShell, const ScMyRangeLists& rRangeLists);
1590 : virtual ~ScUniqueCellFormatsEnumeration();
1591 :
1592 : virtual void Notify( SfxBroadcaster& rBC, const SfxHint& rHint ) SAL_OVERRIDE;
1593 :
1594 : // XEnumeration
1595 : virtual sal_Bool SAL_CALL hasMoreElements() throw(::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
1596 : virtual ::com::sun::star::uno::Any SAL_CALL nextElement()
1597 : throw(::com::sun::star::container::NoSuchElementException,
1598 : ::com::sun::star::lang::WrappedTargetException,
1599 : ::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
1600 :
1601 : // XServiceInfo
1602 : virtual OUString SAL_CALL getImplementationName()
1603 : throw(::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
1604 : virtual sal_Bool SAL_CALL supportsService( const OUString& ServiceName )
1605 : throw(::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
1606 : virtual ::com::sun::star::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames()
1607 : throw(::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
1608 : };
1609 :
1610 :
1611 : #endif
1612 :
1613 : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|