merge the formfield patch from ooo-build
[ooovba.git] / sc / inc / cellsuno.hxx
bloba1671b83678d5394e8706d608fa6f827a5a534da
1 /*************************************************************************
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
5 * Copyright 2008 by Sun Microsystems, Inc.
7 * OpenOffice.org - a multi-platform office productivity suite
9 * $RCSfile: cellsuno.hxx,v $
10 * $Revision: 1.33 $
12 * This file is part of OpenOffice.org.
14 * OpenOffice.org is free software: you can redistribute it and/or modify
15 * it under the terms of the GNU Lesser General Public License version 3
16 * only, as published by the Free Software Foundation.
18 * OpenOffice.org is distributed in the hope that it will be useful,
19 * but WITHOUT ANY WARRANTY; without even the implied warranty of
20 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21 * GNU Lesser General Public License version 3 for more details
22 * (a copy is included in the LICENSE file that accompanied this code).
24 * You should have received a copy of the GNU Lesser General Public License
25 * version 3 along with OpenOffice.org. If not, see
26 * <http://www.openoffice.org/license.html>
27 * for a copy of the LGPLv3 License.
29 ************************************************************************/
31 #ifndef SC_CELLSUNO_HXX
32 #define SC_CELLSUNO_HXX
34 #include "global.hxx" // ScRange, ScAddress
35 #include "rangelst.hxx" // ScRangeList
37 #include "formula/grammar.hxx"
38 #include <svtools/lstner.hxx>
39 #include <svtools/listener.hxx>
40 #include <svtools/itemprop.hxx>
41 #include <com/sun/star/table/XTableChartsSupplier.hpp>
42 #include <com/sun/star/chart/XChartDataArray.hpp>
43 #include <com/sun/star/text/XTextFieldsSupplier.hpp>
44 #include <com/sun/star/drawing/XDrawPageSupplier.hpp>
45 #include <com/sun/star/sheet/XSheetCellRange.hpp>
46 #include <com/sun/star/sheet/XFormulaQuery.hpp>
47 #include <com/sun/star/sheet/XCellRangeAddressable.hpp>
48 #include <com/sun/star/sheet/XSheetOperation.hpp>
49 #include <com/sun/star/sheet/XSheetCellRangeContainer.hpp>
50 #include <com/sun/star/sheet/XCellFormatRangesSupplier.hpp>
51 #include <com/sun/star/sheet/XUniqueCellFormatRangesSupplier.hpp>
52 #include <com/sun/star/sheet/XCellRangesQuery.hpp>
53 #include <com/sun/star/sheet/XSheetFilterableEx.hpp>
54 #include <com/sun/star/sheet/XSpreadsheet.hpp>
55 #include <com/sun/star/sheet/XSheetPageBreak.hpp>
56 #include <com/sun/star/sheet/XCellRangeMovement.hpp>
57 #include <com/sun/star/text/XText.hpp>
58 #include <com/sun/star/sheet/XPrintAreas.hpp>
59 #include <com/sun/star/sheet/XSheetLinkable.hpp>
60 #include <com/sun/star/sheet/XSubTotalCalculatable.hpp>
61 #include <com/sun/star/sheet/XArrayFormulaRange.hpp>
62 #include <com/sun/star/sheet/XCellRangeData.hpp>
63 #include <com/sun/star/sheet/XCellRangeFormula.hpp>
64 #include <com/sun/star/sheet/XCellSeries.hpp>
65 #include <com/sun/star/sheet/XMultipleOperation.hpp>
66 #include <com/sun/star/sheet/XFormulaTokens.hpp>
67 #include <com/sun/star/sheet/XArrayFormulaTokens.hpp>
68 #include <com/sun/star/sheet/XCellAddressable.hpp>
69 #include <com/sun/star/util/XReplaceable.hpp>
70 #include <com/sun/star/util/XIndent.hpp>
71 #include <com/sun/star/lang/XServiceInfo.hpp>
72 #include <com/sun/star/container/XNameContainer.hpp>
73 #include <com/sun/star/util/XMergeable.hpp>
74 #include <com/sun/star/table/XAutoFormattable.hpp>
75 #include <com/sun/star/util/XSortable.hpp>
76 #include <com/sun/star/util/XImportable.hpp>
77 #include <com/sun/star/table/XColumnRowRange.hpp>
78 #include <com/sun/star/table/BorderLine.hpp>
79 #include <com/sun/star/table/TableBorder.hpp>
80 #include <com/sun/star/sheet/XDataPilotTablesSupplier.hpp>
81 #include <com/sun/star/sheet/XSheetAnnotationAnchor.hpp>
82 #include <com/sun/star/sheet/XScenariosSupplier.hpp>
83 #include <com/sun/star/sheet/XSheetAnnotationsSupplier.hpp>
84 #include <com/sun/star/sheet/XSheetAuditing.hpp>
85 #include <com/sun/star/sheet/XSheetOutline.hpp>
86 #include <com/sun/star/util/XProtectable.hpp>
87 #include <com/sun/star/sheet/XScenario.hpp>
88 #include <com/sun/star/sheet/XScenarioEnhanced.hpp>
89 #include <com/sun/star/util/XModifyBroadcaster.hpp>
90 #include <com/sun/star/beans/XPropertyState.hpp>
91 #include <com/sun/star/beans/XMultiPropertySet.hpp>
92 #include <com/sun/star/lang/XUnoTunnel.hpp>
93 #include <com/sun/star/document/XActionLockable.hpp>
94 #include <com/sun/star/beans/XTolerantMultiPropertySet.hpp>
95 #include <com/sun/star/sheet/XExternalSheetName.hpp>
96 #include <cppuhelper/implbase2.hxx>
97 #include <cppuhelper/implbase3.hxx>
99 #ifndef __SGI_STL_VECTOR
100 #include <vector>
101 #endif
103 class ScDocShell;
104 class ScMarkData;
105 class ScMemChart;
106 class ScPrintRangeSaver;
107 class ScAttrRectIterator;
108 class ScCellRangeObj;
109 class SvxUnoText;
110 class ScLinkListener;
111 class ScPatternAttr;
112 class SvxBorderLine;
113 class SvxBoxItem;
114 class SvxBoxInfoItem;
115 class SvxItemPropertySet;
117 class ScLinkListener : public SvtListener
119 Link aLink;
120 public:
121 ScLinkListener(const Link& rL) : aLink(rL) {}
122 virtual ~ScLinkListener();
123 virtual void Notify( SvtBroadcaster& rBC, const SfxHint& rHint );
126 typedef ::com::sun::star::uno::Reference<
127 ::com::sun::star::util::XModifyListener >* XModifyListenerPtr;
128 SV_DECL_PTRARR_DEL( XModifyListenerArr_Impl, XModifyListenerPtr, 4, 4 )
130 class ScNamedEntry;
131 typedef ScNamedEntry* ScNamedEntryPtr;
132 SV_DECL_PTRARR_DEL( ScNamedEntryArr_Impl, ScNamedEntryPtr, 4, 4 )
135 // ScCellRangesBase - Basisklasse fuer ScCellRangesObj (mit Index-Access)
136 // und ScCellRangeObj (ohne Index-Access)
138 // XServiceInfo ist in den Ableitungen implementiert
140 class ScHelperFunctions
142 public:
143 static const SvxBorderLine* GetBorderLine( SvxBorderLine& rLine, const com::sun::star::table::BorderLine& rStruct );
144 static void FillBoxItems( SvxBoxItem& rOuter, SvxBoxInfoItem& rInner, const com::sun::star::table::TableBorder& rBorder );
145 static void FillBorderLine( com::sun::star::table::BorderLine& rStruct, const SvxBorderLine* pLine );
146 static void FillTableBorder( com::sun::star::table::TableBorder& rBorder,
147 const SvxBoxItem& rOuter, const SvxBoxInfoItem& rInner );
148 static void ApplyBorder( ScDocShell* pDocShell, const ScRangeList& rRanges,
149 const SvxBoxItem& rOuter, const SvxBoxInfoItem& rInner );
152 namespace ooo
154 namespace vba {
155 namespace excel {
156 class ScVbaCellRangeAccess; // Vba Helper class
161 class SC_DLLPUBLIC ScCellRangesBase : public com::sun::star::beans::XPropertySet,
162 public com::sun::star::beans::XMultiPropertySet,
163 public com::sun::star::beans::XPropertyState,
164 public com::sun::star::sheet::XSheetOperation,
165 public com::sun::star::chart::XChartDataArray,
166 public com::sun::star::util::XIndent,
167 public com::sun::star::sheet::XCellRangesQuery,
168 public com::sun::star::sheet::XFormulaQuery,
169 public com::sun::star::util::XReplaceable,
170 public com::sun::star::util::XModifyBroadcaster,
171 public com::sun::star::lang::XServiceInfo,
172 public com::sun::star::lang::XUnoTunnel,
173 public com::sun::star::lang::XTypeProvider,
174 public com::sun::star::beans::XTolerantMultiPropertySet,
175 public cppu::OWeakObject,
176 public SfxListener
178 friend class ScTabViewObj; // fuer select()
179 friend class ScTableSheetObj; // fuer createCursorByRange()
180 friend class ooo::vba::excel::ScVbaCellRangeAccess;
182 private:
183 const SfxItemPropertySet* pPropSet;
184 ScDocShell* pDocShell;
185 ScLinkListener* pValueListener;
186 ScPatternAttr* pCurrentFlat;
187 ScPatternAttr* pCurrentDeep;
188 SfxItemSet* pCurrentDataSet;
189 SfxItemSet* pNoDfltCurrentDataSet;
190 ScMarkData* pMarkData;
191 ScRangeList aRanges;
192 sal_Int64 nObjectId;
193 BOOL bChartColAsHdr;
194 BOOL bChartRowAsHdr;
195 BOOL bCursorOnly;
196 BOOL bGotDataChangedHint;
197 XModifyListenerArr_Impl aValueListeners;
199 DECL_LINK( ValueListenerHdl, SfxHint* );
201 private:
202 void PaintRanges_Impl( USHORT nPart );
203 ScRangeListRef GetLimitedChartRanges_Impl( long nDataColumns, long nDataRows ) const;
204 void ForceChartListener_Impl();
205 ScMemChart* CreateMemChart_Impl() const;
207 const ScPatternAttr* GetCurrentAttrsFlat();
208 const ScPatternAttr* GetCurrentAttrsDeep();
209 SfxItemSet* GetCurrentDataSet(bool bNoDflt = false);
210 const ScMarkData* GetMarkData();
211 void ForgetMarkData();
212 void ForgetCurrentAttrs();
214 com::sun::star::uno::Reference<com::sun::star::sheet::XSheetCellRanges>
215 QueryDifferences_Impl(const com::sun::star::table::CellAddress& aCompare,
216 BOOL bColumnDiff);
217 com::sun::star::uno::Reference<com::sun::star::uno::XInterface>
218 Find_Impl(const com::sun::star::uno::Reference<
219 com::sun::star::util::XSearchDescriptor>& xDesc,
220 const ScAddress* pLastPos);
222 protected:
223 // GetItemPropertyMap for derived classes must contain all entries, including base class
224 virtual const SfxItemPropertyMap* GetItemPropertyMap();
225 virtual ::com::sun::star::beans::PropertyState GetOnePropertyState(
226 USHORT nItemWhich, const SfxItemPropertySimpleEntry* pEntry );
227 virtual void GetOnePropertyValue( const SfxItemPropertySimpleEntry* pEntry,
228 ::com::sun::star::uno::Any& )
229 throw(::com::sun::star::uno::RuntimeException);
230 virtual void SetOnePropertyValue( const SfxItemPropertySimpleEntry* pEntry,
231 const ::com::sun::star::uno::Any& aValue )
232 throw(::com::sun::star::lang::IllegalArgumentException,
233 ::com::sun::star::uno::RuntimeException);
235 public:
236 ScCellRangesBase(); // fuer SMART_REFLECTION Krempel
237 ScCellRangesBase(ScDocShell* pDocSh, const ScRange& rR);
238 ScCellRangesBase(ScDocShell* pDocSh, const ScRangeList& rR);
239 virtual ~ScCellRangesBase();
241 virtual ::com::sun::star::uno::Any SAL_CALL queryInterface(
242 const ::com::sun::star::uno::Type & rType )
243 throw(::com::sun::star::uno::RuntimeException);
244 virtual void SAL_CALL acquire() throw();
245 virtual void SAL_CALL release() throw();
247 virtual void Notify( SfxBroadcaster& rBC, const SfxHint& rHint );
248 virtual void RefChanged();
250 // aus Ableitungen, aber auch per getImplementation
251 ScDocShell* GetDocShell() const { return pDocShell; }
252 ScDocument* GetDocument() const;
253 const ScRangeList& GetRangeList() const { return aRanges; }
254 void AddRange(const ScRange& rRange, const sal_Bool bMergeRanges);
256 // per Service erzeugtes Objekt zum Leben erwecken:
257 void InitInsertRange(ScDocShell* pDocSh, const ScRange& rR);
259 void SetNewRange(const ScRange& rNew); // fuer Cursor
260 void SetNewRanges(const ScRangeList& rNew);
262 void SetCursorOnly(BOOL bSet);
263 BOOL IsCursorOnly() const { return bCursorOnly; }
265 // XSheetOperation
266 virtual double SAL_CALL computeFunction( ::com::sun::star::sheet::GeneralFunction nFunction )
267 throw(::com::sun::star::uno::Exception,
268 ::com::sun::star::uno::RuntimeException);
269 virtual void SAL_CALL clearContents( sal_Int32 nContentFlags )
270 throw(::com::sun::star::uno::RuntimeException);
272 // XPropertySet
273 virtual ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySetInfo >
274 SAL_CALL getPropertySetInfo()
275 throw(::com::sun::star::uno::RuntimeException);
276 virtual void SAL_CALL setPropertyValue( const ::rtl::OUString& aPropertyName,
277 const ::com::sun::star::uno::Any& aValue )
278 throw(::com::sun::star::beans::UnknownPropertyException,
279 ::com::sun::star::beans::PropertyVetoException,
280 ::com::sun::star::lang::IllegalArgumentException,
281 ::com::sun::star::lang::WrappedTargetException,
282 ::com::sun::star::uno::RuntimeException);
283 virtual ::com::sun::star::uno::Any SAL_CALL getPropertyValue(
284 const ::rtl::OUString& PropertyName )
285 throw(::com::sun::star::beans::UnknownPropertyException,
286 ::com::sun::star::lang::WrappedTargetException,
287 ::com::sun::star::uno::RuntimeException);
288 virtual void SAL_CALL addPropertyChangeListener( const ::rtl::OUString& aPropertyName,
289 const ::com::sun::star::uno::Reference<
290 ::com::sun::star::beans::XPropertyChangeListener >& xListener )
291 throw(::com::sun::star::beans::UnknownPropertyException,
292 ::com::sun::star::lang::WrappedTargetException,
293 ::com::sun::star::uno::RuntimeException);
294 virtual void SAL_CALL removePropertyChangeListener( const ::rtl::OUString& aPropertyName,
295 const ::com::sun::star::uno::Reference<
296 ::com::sun::star::beans::XPropertyChangeListener >& aListener )
297 throw(::com::sun::star::beans::UnknownPropertyException,
298 ::com::sun::star::lang::WrappedTargetException,
299 ::com::sun::star::uno::RuntimeException);
300 virtual void SAL_CALL addVetoableChangeListener( const ::rtl::OUString& PropertyName,
301 const ::com::sun::star::uno::Reference<
302 ::com::sun::star::beans::XVetoableChangeListener >& aListener )
303 throw(::com::sun::star::beans::UnknownPropertyException,
304 ::com::sun::star::lang::WrappedTargetException,
305 ::com::sun::star::uno::RuntimeException);
306 virtual void SAL_CALL removeVetoableChangeListener( const ::rtl::OUString& PropertyName,
307 const ::com::sun::star::uno::Reference<
308 ::com::sun::star::beans::XVetoableChangeListener >& aListener )
309 throw(::com::sun::star::beans::UnknownPropertyException,
310 ::com::sun::star::lang::WrappedTargetException,
311 ::com::sun::star::uno::RuntimeException);
313 // XMultiPropertySet
314 virtual void SAL_CALL setPropertyValues( const ::com::sun::star::uno::Sequence< ::rtl::OUString >& aPropertyNames,
315 const ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Any >& aValues )
316 throw (::com::sun::star::beans::PropertyVetoException,
317 ::com::sun::star::lang::IllegalArgumentException,
318 ::com::sun::star::lang::WrappedTargetException,
319 ::com::sun::star::uno::RuntimeException);
320 virtual ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Any > SAL_CALL
321 getPropertyValues( const ::com::sun::star::uno::Sequence< ::rtl::OUString >& aPropertyNames )
322 throw (::com::sun::star::uno::RuntimeException);
323 virtual void SAL_CALL addPropertiesChangeListener( const ::com::sun::star::uno::Sequence< ::rtl::OUString >& aPropertyNames,
324 const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertiesChangeListener >& xListener )
325 throw (::com::sun::star::uno::RuntimeException);
326 virtual void SAL_CALL removePropertiesChangeListener( const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertiesChangeListener >& xListener )
327 throw (::com::sun::star::uno::RuntimeException);
328 virtual void SAL_CALL firePropertiesChangeEvent( const ::com::sun::star::uno::Sequence< ::rtl::OUString >& aPropertyNames,
329 const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertiesChangeListener >& xListener )
330 throw (::com::sun::star::uno::RuntimeException);
332 // XTolerantMultiPropertySet
333 virtual ::com::sun::star::uno::Sequence< ::com::sun::star::beans::SetPropertyTolerantFailed > SAL_CALL
334 setPropertyValuesTolerant( const ::com::sun::star::uno::Sequence< ::rtl::OUString >& aPropertyNames,
335 const ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Any >& aValues )
336 throw (::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::uno::RuntimeException);
337 virtual ::com::sun::star::uno::Sequence< ::com::sun::star::beans::GetPropertyTolerantResult > SAL_CALL
338 getPropertyValuesTolerant( const ::com::sun::star::uno::Sequence< ::rtl::OUString >& aPropertyNames )
339 throw (::com::sun::star::uno::RuntimeException);
340 virtual ::com::sun::star::uno::Sequence< ::com::sun::star::beans::GetDirectPropertyTolerantResult > SAL_CALL
341 getDirectPropertyValuesTolerant( const ::com::sun::star::uno::Sequence< ::rtl::OUString >& aPropertyNames )
342 throw (::com::sun::star::uno::RuntimeException);
344 // XPropertyState
345 virtual ::com::sun::star::beans::PropertyState SAL_CALL getPropertyState(
346 const ::rtl::OUString& PropertyName )
347 throw(::com::sun::star::beans::UnknownPropertyException,
348 ::com::sun::star::uno::RuntimeException);
349 virtual ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyState > SAL_CALL
350 getPropertyStates( const ::com::sun::star::uno::Sequence<
351 ::rtl::OUString >& aPropertyName )
352 throw(::com::sun::star::beans::UnknownPropertyException,
353 ::com::sun::star::uno::RuntimeException);
354 virtual void SAL_CALL setPropertyToDefault( const ::rtl::OUString& PropertyName )
355 throw(::com::sun::star::beans::UnknownPropertyException,
356 ::com::sun::star::uno::RuntimeException);
357 virtual ::com::sun::star::uno::Any SAL_CALL getPropertyDefault(
358 const ::rtl::OUString& aPropertyName )
359 throw(::com::sun::star::beans::UnknownPropertyException,
360 ::com::sun::star::lang::WrappedTargetException,
361 ::com::sun::star::uno::RuntimeException);
363 // XIndent
364 virtual void SAL_CALL decrementIndent() throw(::com::sun::star::uno::RuntimeException);
365 virtual void SAL_CALL incrementIndent() throw(::com::sun::star::uno::RuntimeException);
367 // XChartData
368 virtual void SAL_CALL addChartDataChangeEventListener(
369 const ::com::sun::star::uno::Reference<
370 ::com::sun::star::chart::XChartDataChangeEventListener >& aListener )
371 throw(::com::sun::star::uno::RuntimeException);
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 virtual double SAL_CALL getNotANumber() throw(::com::sun::star::uno::RuntimeException);
376 virtual sal_Bool SAL_CALL isNotANumber( double nNumber )
377 throw(::com::sun::star::uno::RuntimeException);
379 // XChartDataArray
380 virtual ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Sequence< double > > SAL_CALL
381 getData() throw(::com::sun::star::uno::RuntimeException);
382 virtual void SAL_CALL setData( const ::com::sun::star::uno::Sequence<
383 ::com::sun::star::uno::Sequence< double > >& aData )
384 throw(::com::sun::star::uno::RuntimeException);
385 virtual ::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL getRowDescriptions()
386 throw(::com::sun::star::uno::RuntimeException);
387 virtual void SAL_CALL setRowDescriptions( const ::com::sun::star::uno::Sequence<
388 ::rtl::OUString >& aRowDescriptions )
389 throw(::com::sun::star::uno::RuntimeException);
390 virtual ::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL getColumnDescriptions()
391 throw(::com::sun::star::uno::RuntimeException);
392 virtual void SAL_CALL setColumnDescriptions( const ::com::sun::star::uno::Sequence<
393 ::rtl::OUString >& aColumnDescriptions )
394 throw(::com::sun::star::uno::RuntimeException);
396 // XCellRangesQuery
397 virtual ::com::sun::star::uno::Reference< ::com::sun::star::sheet::XSheetCellRanges > SAL_CALL
398 queryVisibleCells() throw(::com::sun::star::uno::RuntimeException);
399 virtual ::com::sun::star::uno::Reference< ::com::sun::star::sheet::XSheetCellRanges > SAL_CALL
400 queryEmptyCells() throw(::com::sun::star::uno::RuntimeException);
401 virtual ::com::sun::star::uno::Reference< ::com::sun::star::sheet::XSheetCellRanges > SAL_CALL
402 queryContentCells( sal_Int16 nContentFlags )
403 throw(::com::sun::star::uno::RuntimeException);
404 virtual ::com::sun::star::uno::Reference< ::com::sun::star::sheet::XSheetCellRanges > SAL_CALL
405 queryFormulaCells( sal_Int32 nResultFlags )
406 throw(::com::sun::star::uno::RuntimeException);
407 virtual ::com::sun::star::uno::Reference< ::com::sun::star::sheet::XSheetCellRanges > SAL_CALL
408 queryColumnDifferences(
409 const ::com::sun::star::table::CellAddress& aCompare )
410 throw(::com::sun::star::uno::RuntimeException);
411 virtual ::com::sun::star::uno::Reference< ::com::sun::star::sheet::XSheetCellRanges > SAL_CALL
412 queryRowDifferences(
413 const ::com::sun::star::table::CellAddress& aCompare )
414 throw(::com::sun::star::uno::RuntimeException);
415 virtual ::com::sun::star::uno::Reference< ::com::sun::star::sheet::XSheetCellRanges > SAL_CALL
416 queryIntersection(
417 const ::com::sun::star::table::CellRangeAddress& aRange )
418 throw(::com::sun::star::uno::RuntimeException);
420 // XFormulaQuery
421 virtual ::com::sun::star::uno::Reference< ::com::sun::star::sheet::XSheetCellRanges > SAL_CALL
422 queryDependents( sal_Bool bRecursive )
423 throw(::com::sun::star::uno::RuntimeException);
424 virtual ::com::sun::star::uno::Reference< ::com::sun::star::sheet::XSheetCellRanges > SAL_CALL
425 queryPrecedents( sal_Bool bRecursive )
426 throw(::com::sun::star::uno::RuntimeException);
428 // XSearchable
429 virtual ::com::sun::star::uno::Reference< ::com::sun::star::util::XSearchDescriptor > SAL_CALL
430 createSearchDescriptor()
431 throw(::com::sun::star::uno::RuntimeException);
432 virtual ::com::sun::star::uno::Reference< ::com::sun::star::container::XIndexAccess > SAL_CALL
433 findAll( const ::com::sun::star::uno::Reference<
434 ::com::sun::star::util::XSearchDescriptor >& xDesc )
435 throw(::com::sun::star::uno::RuntimeException);
436 virtual ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface > SAL_CALL
437 findFirst( const ::com::sun::star::uno::Reference<
438 ::com::sun::star::util::XSearchDescriptor >& xDesc )
439 throw(::com::sun::star::uno::RuntimeException);
440 virtual ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface > SAL_CALL
441 findNext( const ::com::sun::star::uno::Reference<
442 ::com::sun::star::uno::XInterface >& xStartAt,
443 const ::com::sun::star::uno::Reference<
444 ::com::sun::star::util::XSearchDescriptor >& xDesc )
445 throw(::com::sun::star::uno::RuntimeException);
447 // XReplaceable
448 virtual ::com::sun::star::uno::Reference< ::com::sun::star::util::XReplaceDescriptor > SAL_CALL
449 createReplaceDescriptor() throw(::com::sun::star::uno::RuntimeException);
450 virtual sal_Int32 SAL_CALL replaceAll( const ::com::sun::star::uno::Reference<
451 ::com::sun::star::util::XSearchDescriptor >& xDesc )
452 throw(::com::sun::star::uno::RuntimeException);
454 // XModifyBroadcaster
455 virtual void SAL_CALL addModifyListener( const ::com::sun::star::uno::Reference<
456 ::com::sun::star::util::XModifyListener >& aListener )
457 throw (::com::sun::star::uno::RuntimeException);
458 virtual void SAL_CALL removeModifyListener( const ::com::sun::star::uno::Reference<
459 ::com::sun::star::util::XModifyListener >& aListener )
460 throw (::com::sun::star::uno::RuntimeException);
462 // XServiceInfo
463 virtual ::rtl::OUString SAL_CALL getImplementationName()
464 throw(::com::sun::star::uno::RuntimeException);
465 virtual sal_Bool SAL_CALL supportsService( const ::rtl::OUString& ServiceName )
466 throw(::com::sun::star::uno::RuntimeException);
467 virtual ::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL getSupportedServiceNames()
468 throw(::com::sun::star::uno::RuntimeException);
470 // XUnoTunnel
471 virtual sal_Int64 SAL_CALL getSomething( const ::com::sun::star::uno::Sequence<
472 sal_Int8 >& aIdentifier )
473 throw(::com::sun::star::uno::RuntimeException);
475 static const com::sun::star::uno::Sequence<sal_Int8>& getUnoTunnelId();
476 static ScCellRangesBase* getImplementation( const com::sun::star::uno::Reference<
477 com::sun::star::uno::XInterface> xObj );
479 // XTypeProvider
480 virtual ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Type > SAL_CALL getTypes()
481 throw(::com::sun::star::uno::RuntimeException);
482 virtual ::com::sun::star::uno::Sequence< sal_Int8 > SAL_CALL getImplementationId()
483 throw(::com::sun::star::uno::RuntimeException);
487 class SC_DLLPUBLIC ScCellRangesObj : public ScCellRangesBase,
488 public com::sun::star::sheet::XSheetCellRangeContainer,
489 public com::sun::star::container::XNameContainer,
490 public com::sun::star::container::XEnumerationAccess
492 private:
493 ScNamedEntryArr_Impl aNamedEntries;
495 ScCellRangeObj* GetObjectByIndex_Impl(sal_Int32 nIndex) const;
497 public:
498 ScCellRangesObj(ScDocShell* pDocSh, const ScRangeList& rR);
499 virtual ~ScCellRangesObj();
501 virtual ::com::sun::star::uno::Any SAL_CALL queryInterface(
502 const ::com::sun::star::uno::Type & rType )
503 throw(::com::sun::star::uno::RuntimeException);
504 virtual void SAL_CALL acquire() throw();
505 virtual void SAL_CALL release() throw();
507 virtual void RefChanged();
509 // XSheetCellRanges
510 virtual ::com::sun::star::uno::Reference< ::com::sun::star::container::XEnumerationAccess > SAL_CALL
511 getCells() throw(::com::sun::star::uno::RuntimeException);
512 virtual ::rtl::OUString SAL_CALL getRangeAddressesAsString()
513 throw(::com::sun::star::uno::RuntimeException);
514 virtual ::com::sun::star::uno::Sequence< ::com::sun::star::table::CellRangeAddress > SAL_CALL
515 getRangeAddresses() throw(::com::sun::star::uno::RuntimeException);
517 // XSheetCellRangeContainer
518 virtual void SAL_CALL addRangeAddress( const ::com::sun::star::table::CellRangeAddress& rRange,
519 sal_Bool bMergeRanges )
520 throw(::com::sun::star::uno::RuntimeException);
521 virtual void SAL_CALL removeRangeAddress( const ::com::sun::star::table::CellRangeAddress& rRange )
522 throw(::com::sun::star::container::NoSuchElementException,
523 ::com::sun::star::uno::RuntimeException);
524 virtual void SAL_CALL addRangeAddresses( const ::com::sun::star::uno::Sequence<
525 ::com::sun::star::table::CellRangeAddress >& rRanges,
526 sal_Bool bMergeRanges )
527 throw(::com::sun::star::uno::RuntimeException);
528 virtual void SAL_CALL removeRangeAddresses( const ::com::sun::star::uno::Sequence<
529 ::com::sun::star::table::CellRangeAddress >& rRanges )
530 throw(::com::sun::star::container::NoSuchElementException,
531 ::com::sun::star::uno::RuntimeException);
533 // XNameContainer
534 virtual void SAL_CALL insertByName( const ::rtl::OUString& aName,
535 const ::com::sun::star::uno::Any& aElement )
536 throw(::com::sun::star::lang::IllegalArgumentException,
537 ::com::sun::star::container::ElementExistException,
538 ::com::sun::star::lang::WrappedTargetException,
539 ::com::sun::star::uno::RuntimeException);
540 virtual void SAL_CALL removeByName( const ::rtl::OUString& Name )
541 throw(::com::sun::star::container::NoSuchElementException,
542 ::com::sun::star::lang::WrappedTargetException,
543 ::com::sun::star::uno::RuntimeException);
545 // XNameReplace
546 virtual void SAL_CALL replaceByName( const ::rtl::OUString& aName,
547 const ::com::sun::star::uno::Any& aElement )
548 throw(::com::sun::star::lang::IllegalArgumentException,
549 ::com::sun::star::container::NoSuchElementException,
550 ::com::sun::star::lang::WrappedTargetException,
551 ::com::sun::star::uno::RuntimeException);
553 // XNameAccess
554 virtual ::com::sun::star::uno::Any SAL_CALL getByName( const ::rtl::OUString& aName )
555 throw(::com::sun::star::container::NoSuchElementException,
556 ::com::sun::star::lang::WrappedTargetException,
557 ::com::sun::star::uno::RuntimeException);
558 virtual ::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL getElementNames()
559 throw(::com::sun::star::uno::RuntimeException);
560 virtual sal_Bool SAL_CALL hasByName( const ::rtl::OUString& aName )
561 throw(::com::sun::star::uno::RuntimeException);
563 // XIndexAccess
564 virtual sal_Int32 SAL_CALL getCount() throw(::com::sun::star::uno::RuntimeException);
565 virtual ::com::sun::star::uno::Any SAL_CALL getByIndex( sal_Int32 Index )
566 throw(::com::sun::star::lang::IndexOutOfBoundsException,
567 ::com::sun::star::lang::WrappedTargetException,
568 ::com::sun::star::uno::RuntimeException);
570 // XElementAccess
571 virtual ::com::sun::star::uno::Type SAL_CALL getElementType()
572 throw(::com::sun::star::uno::RuntimeException);
573 virtual sal_Bool SAL_CALL hasElements() throw(::com::sun::star::uno::RuntimeException);
575 // XEnumerationAccess
576 virtual ::com::sun::star::uno::Reference< ::com::sun::star::container::XEnumeration > SAL_CALL
577 createEnumeration() throw(::com::sun::star::uno::RuntimeException);
579 // XServiceInfo
580 virtual ::rtl::OUString SAL_CALL getImplementationName()
581 throw(::com::sun::star::uno::RuntimeException);
582 virtual sal_Bool SAL_CALL supportsService( const ::rtl::OUString& ServiceName )
583 throw(::com::sun::star::uno::RuntimeException);
584 virtual ::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL getSupportedServiceNames()
585 throw(::com::sun::star::uno::RuntimeException);
587 // XTypeProvider
588 virtual ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Type > SAL_CALL getTypes()
589 throw(::com::sun::star::uno::RuntimeException);
590 virtual ::com::sun::star::uno::Sequence< sal_Int8 > SAL_CALL getImplementationId()
591 throw(::com::sun::star::uno::RuntimeException);
595 class SC_DLLPUBLIC ScCellRangeObj : public ScCellRangesBase,
596 public com::sun::star::sheet::XCellRangeAddressable,
597 public com::sun::star::sheet::XSheetCellRange,
598 public com::sun::star::sheet::XArrayFormulaRange,
599 public com::sun::star::sheet::XArrayFormulaTokens,
600 public com::sun::star::sheet::XCellRangeData,
601 public com::sun::star::sheet::XCellRangeFormula,
602 public com::sun::star::sheet::XMultipleOperation,
603 public com::sun::star::util::XMergeable,
604 public com::sun::star::sheet::XCellSeries,
605 public com::sun::star::table::XAutoFormattable,
606 public com::sun::star::util::XSortable,
607 public com::sun::star::sheet::XSheetFilterableEx,
608 public com::sun::star::sheet::XSubTotalCalculatable,
609 public com::sun::star::util::XImportable,
610 public com::sun::star::sheet::XCellFormatRangesSupplier,
611 public com::sun::star::sheet::XUniqueCellFormatRangesSupplier,
612 public com::sun::star::table::XColumnRowRange
614 private:
615 const SfxItemPropertySet* pRangePropSet;
616 ScRange aRange;
618 protected:
619 const ScRange& GetRange() const { return aRange; }
620 virtual const SfxItemPropertyMap* GetItemPropertyMap();
621 virtual void GetOnePropertyValue( const SfxItemPropertySimpleEntry* pEntry,
622 ::com::sun::star::uno::Any& )
623 throw(::com::sun::star::uno::RuntimeException);
624 virtual void SetOnePropertyValue( const SfxItemPropertySimpleEntry* pEntry,
625 const ::com::sun::star::uno::Any& aValue )
626 throw(::com::sun::star::lang::IllegalArgumentException,
627 ::com::sun::star::uno::RuntimeException);
629 ::com::sun::star::uno::Reference< ::com::sun::star::table::XCell >
630 GetCellByPosition_Impl( sal_Int32 nColumn, sal_Int32 nRow )
631 throw(::com::sun::star::lang::IndexOutOfBoundsException,
632 ::com::sun::star::uno::RuntimeException);
634 void SetArrayFormula_Impl( const rtl::OUString& rFormula,
635 const rtl::OUString& rFormulaNmsp,
636 const formula::FormulaGrammar::Grammar eGrammar )
637 throw(::com::sun::star::uno::RuntimeException);
639 public:
640 ScCellRangeObj(ScDocShell* pDocSh, const ScRange& rR);
641 virtual ~ScCellRangeObj();
643 // uses ObjectShell from document, if set (returns NULL otherwise)
644 static com::sun::star::uno::Reference<com::sun::star::table::XCellRange>
645 CreateRangeFromDoc( ScDocument* pDoc, const ScRange& rR );
647 virtual ::com::sun::star::uno::Any SAL_CALL queryInterface(
648 const ::com::sun::star::uno::Type & rType )
649 throw(::com::sun::star::uno::RuntimeException);
650 virtual void SAL_CALL acquire() throw();
651 virtual void SAL_CALL release() throw();
653 virtual void RefChanged();
655 // via getImplementation()
656 virtual void SetArrayFormulaWithGrammar( const ::rtl::OUString& rFormula,
657 const ::rtl::OUString& rFormulaNmsp,
658 const formula::FormulaGrammar::Grammar )
659 throw(::com::sun::star::uno::RuntimeException);
661 // XCellRange ist Basisklasse von XSheetCellRange und XSheetOperation
662 // operator XCellRangeRef() const { return (XSheetCellRange*)this; }
664 // XCellRangeAddressable
665 virtual ::com::sun::star::table::CellRangeAddress SAL_CALL getRangeAddress()
666 throw(::com::sun::star::uno::RuntimeException);
668 // XSheetCellRange
669 virtual ::com::sun::star::uno::Reference< ::com::sun::star::sheet::XSpreadsheet > SAL_CALL
670 getSpreadsheet() throw(::com::sun::star::uno::RuntimeException);
672 // XArrayFormulaRange
673 virtual ::rtl::OUString SAL_CALL getArrayFormula() throw(::com::sun::star::uno::RuntimeException);
674 virtual void SAL_CALL setArrayFormula( const ::rtl::OUString& aFormula )
675 throw(::com::sun::star::uno::RuntimeException);
677 // XArrayFormulaTokens
678 virtual ::com::sun::star::uno::Sequence< ::com::sun::star::sheet::FormulaToken > SAL_CALL getArrayTokens()
679 throw (::com::sun::star::uno::RuntimeException);
680 virtual void SAL_CALL setArrayTokens( const ::com::sun::star::uno::Sequence<
681 ::com::sun::star::sheet::FormulaToken >& aTokens )
682 throw (::com::sun::star::uno::RuntimeException);
684 // XCellRangeData
685 virtual ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Sequence<
686 ::com::sun::star::uno::Any > > SAL_CALL getDataArray()
687 throw(::com::sun::star::uno::RuntimeException);
688 virtual void SAL_CALL setDataArray( const ::com::sun::star::uno::Sequence<
689 ::com::sun::star::uno::Sequence<
690 ::com::sun::star::uno::Any > >& aArray )
691 throw(::com::sun::star::uno::RuntimeException);
693 // XCellRangeFormula
694 virtual ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Sequence<
695 ::rtl::OUString > > SAL_CALL getFormulaArray()
696 throw (::com::sun::star::uno::RuntimeException);
697 virtual void SAL_CALL setFormulaArray( const ::com::sun::star::uno::Sequence<
698 ::com::sun::star::uno::Sequence< ::rtl::OUString > >& aArray )
699 throw (::com::sun::star::uno::RuntimeException);
701 // XMultipleOperation
702 virtual void SAL_CALL setTableOperation(
703 const ::com::sun::star::table::CellRangeAddress& aFormulaRange,
704 ::com::sun::star::sheet::TableOperationMode nMode,
705 const ::com::sun::star::table::CellAddress& aColumnCell,
706 const ::com::sun::star::table::CellAddress& aRowCell )
707 throw(::com::sun::star::uno::RuntimeException);
709 // XMergeable
710 virtual void SAL_CALL merge( sal_Bool bMerge ) throw(::com::sun::star::uno::RuntimeException);
711 virtual sal_Bool SAL_CALL getIsMerged() throw(::com::sun::star::uno::RuntimeException);
713 // XCellSeries
714 virtual void SAL_CALL fillSeries( ::com::sun::star::sheet::FillDirection nFillDirection,
715 ::com::sun::star::sheet::FillMode nFillMode,
716 ::com::sun::star::sheet::FillDateMode nFillDateMode,
717 double fStep, double fEndValue )
718 throw(::com::sun::star::uno::RuntimeException);
719 virtual void SAL_CALL fillAuto( ::com::sun::star::sheet::FillDirection nFillDirection,
720 sal_Int32 nSourceCount )
721 throw(::com::sun::star::uno::RuntimeException);
723 // XAutoFormattable
724 virtual void SAL_CALL autoFormat( const ::rtl::OUString& aName )
725 throw(::com::sun::star::lang::IllegalArgumentException,
726 ::com::sun::star::uno::RuntimeException);
728 // XSortable
729 virtual ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue > SAL_CALL
730 createSortDescriptor() throw(::com::sun::star::uno::RuntimeException);
731 virtual void SAL_CALL sort( const ::com::sun::star::uno::Sequence<
732 ::com::sun::star::beans::PropertyValue >& xDescriptor )
733 throw(::com::sun::star::uno::RuntimeException);
735 // XSheetFilterableEx
736 virtual ::com::sun::star::uno::Reference< ::com::sun::star::sheet::XSheetFilterDescriptor > SAL_CALL
737 createFilterDescriptorByObject( const ::com::sun::star::uno::Reference<
738 ::com::sun::star::sheet::XSheetFilterable >& xObject )
739 throw(::com::sun::star::uno::RuntimeException);
741 // XSheetFilterable
742 virtual ::com::sun::star::uno::Reference< ::com::sun::star::sheet::XSheetFilterDescriptor > SAL_CALL
743 createFilterDescriptor( sal_Bool bEmpty )
744 throw(::com::sun::star::uno::RuntimeException);
745 virtual void SAL_CALL filter( const ::com::sun::star::uno::Reference<
746 ::com::sun::star::sheet::XSheetFilterDescriptor >& xDescriptor )
747 throw(::com::sun::star::uno::RuntimeException);
749 // XSubTotalCalculatable
750 virtual ::com::sun::star::uno::Reference< ::com::sun::star::sheet::XSubTotalDescriptor > SAL_CALL
751 createSubTotalDescriptor( sal_Bool bEmpty )
752 throw(::com::sun::star::uno::RuntimeException);
753 virtual void SAL_CALL applySubTotals( const ::com::sun::star::uno::Reference<
754 ::com::sun::star::sheet::XSubTotalDescriptor >& xDescriptor,
755 sal_Bool bReplace ) throw(::com::sun::star::uno::RuntimeException);
756 virtual void SAL_CALL removeSubTotals() throw(::com::sun::star::uno::RuntimeException);
758 // XImportable
759 virtual ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue > SAL_CALL
760 createImportDescriptor( sal_Bool bEmpty )
761 throw(::com::sun::star::uno::RuntimeException);
762 virtual void SAL_CALL doImport( const ::com::sun::star::uno::Sequence<
763 ::com::sun::star::beans::PropertyValue >& aDescriptor )
764 throw(::com::sun::star::uno::RuntimeException);
766 // XCellFormatRangesSupplier
767 virtual ::com::sun::star::uno::Reference< ::com::sun::star::container::XIndexAccess > SAL_CALL
768 getCellFormatRanges() throw(::com::sun::star::uno::RuntimeException);
770 // XUniqueCellFormatRangesSupplier
771 virtual ::com::sun::star::uno::Reference< ::com::sun::star::container::XIndexAccess > SAL_CALL
772 getUniqueCellFormatRanges() throw(::com::sun::star::uno::RuntimeException);
774 // XColumnRowRange
775 virtual ::com::sun::star::uno::Reference< ::com::sun::star::table::XTableColumns > SAL_CALL
776 getColumns() throw(::com::sun::star::uno::RuntimeException);
777 virtual ::com::sun::star::uno::Reference< ::com::sun::star::table::XTableRows > SAL_CALL
778 getRows() throw(::com::sun::star::uno::RuntimeException);
780 // XCellRange
781 virtual ::com::sun::star::uno::Reference< ::com::sun::star::table::XCell > SAL_CALL
782 getCellByPosition( sal_Int32 nColumn, sal_Int32 nRow )
783 throw(::com::sun::star::lang::IndexOutOfBoundsException,
784 ::com::sun::star::uno::RuntimeException);
785 virtual ::com::sun::star::uno::Reference< ::com::sun::star::table::XCellRange > SAL_CALL
786 getCellRangeByPosition( sal_Int32 nLeft, sal_Int32 nTop,
787 sal_Int32 nRight, sal_Int32 nBottom )
788 throw(::com::sun::star::lang::IndexOutOfBoundsException,
789 ::com::sun::star::uno::RuntimeException);
790 virtual ::com::sun::star::uno::Reference< ::com::sun::star::table::XCellRange > SAL_CALL
791 getCellRangeByName( const ::rtl::OUString& aRange )
792 throw(::com::sun::star::uno::RuntimeException);
793 ::com::sun::star::uno::Reference< ::com::sun::star::table::XCellRange >
794 getCellRangeByName( const ::rtl::OUString& aRange, const ScAddress::Details& rDetails )
795 throw(::com::sun::star::uno::RuntimeException);
797 // XPropertySet ueberladen wegen Range-Properties
798 virtual ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySetInfo >
799 SAL_CALL getPropertySetInfo()
800 throw(::com::sun::star::uno::RuntimeException);
802 // XServiceInfo
803 virtual ::rtl::OUString SAL_CALL getImplementationName()
804 throw(::com::sun::star::uno::RuntimeException);
805 virtual sal_Bool SAL_CALL supportsService( const ::rtl::OUString& ServiceName )
806 throw(::com::sun::star::uno::RuntimeException);
807 virtual ::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL getSupportedServiceNames()
808 throw(::com::sun::star::uno::RuntimeException);
810 // XTypeProvider
811 virtual ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Type > SAL_CALL getTypes()
812 throw(::com::sun::star::uno::RuntimeException);
813 virtual ::com::sun::star::uno::Sequence< sal_Int8 > SAL_CALL getImplementationId()
814 throw(::com::sun::star::uno::RuntimeException);
818 //! really derive cell from range?
820 class ScCellObj : public ScCellRangeObj,
821 public com::sun::star::text::XText,
822 public com::sun::star::container::XEnumerationAccess,
823 public com::sun::star::table::XCell,
824 public com::sun::star::sheet::XFormulaTokens,
825 public com::sun::star::sheet::XCellAddressable,
826 public com::sun::star::sheet::XSheetAnnotationAnchor,
827 public com::sun::star::text::XTextFieldsSupplier,
828 public com::sun::star::document::XActionLockable
830 private:
831 SvxUnoText* pUnoText;
832 const SfxItemPropertySet* pCellPropSet;
833 ScAddress aCellPos;
834 sal_Int16 nActionLockCount;
836 private:
837 String GetInputString_Impl(BOOL bEnglish) const;
838 String GetOutputString_Impl() const;
839 void SetString_Impl(const String& rString, BOOL bInterpret, BOOL bEnglish);
840 double GetValue_Impl() const;
841 void SetValue_Impl(double fValue);
842 com::sun::star::table::CellContentType GetResultType_Impl();
844 protected:
845 virtual const SfxItemPropertyMap* GetItemPropertyMap();
846 virtual void GetOnePropertyValue( const SfxItemPropertySimpleEntry* pEntry,
847 ::com::sun::star::uno::Any& )
848 throw(::com::sun::star::uno::RuntimeException);
849 virtual void SetOnePropertyValue( const SfxItemPropertySimpleEntry* pEntry,
850 const ::com::sun::star::uno::Any& aValue )
851 throw(::com::sun::star::lang::IllegalArgumentException,
852 ::com::sun::star::uno::RuntimeException);
854 public:
855 static const SvxItemPropertySet* GetEditPropertySet();
856 static const SfxItemPropertyMap* GetCellPropertyMap();
858 ScCellObj(ScDocShell* pDocSh, const ScAddress& rP);
859 virtual ~ScCellObj();
861 virtual ::com::sun::star::uno::Any SAL_CALL queryInterface(
862 const ::com::sun::star::uno::Type & rType )
863 throw(::com::sun::star::uno::RuntimeException);
864 virtual void SAL_CALL acquire() throw();
865 virtual void SAL_CALL release() throw();
867 virtual void RefChanged();
869 SvxUnoText& GetUnoText();
871 // XML import needs to set results at formula cells,
872 // not meant for any other purpose.
873 void SetFormulaResultString( const ::rtl::OUString& rResult );
874 void SetFormulaResultDouble( double fResult );
875 void SetFormulaWithGrammar( const ::rtl::OUString& rFormula,
876 const ::rtl::OUString& rFormulaNmsp, const formula::FormulaGrammar::Grammar );
877 const ScAddress& GetPosition() const { return aCellPos; }
879 // XText
880 virtual void SAL_CALL insertTextContent( const ::com::sun::star::uno::Reference<
881 ::com::sun::star::text::XTextRange >& xRange,
882 const ::com::sun::star::uno::Reference<
883 ::com::sun::star::text::XTextContent >& xContent,
884 sal_Bool bAbsorb )
885 throw(::com::sun::star::lang::IllegalArgumentException,
886 ::com::sun::star::uno::RuntimeException);
887 virtual void SAL_CALL removeTextContent( const ::com::sun::star::uno::Reference<
888 ::com::sun::star::text::XTextContent >& xContent )
889 throw(::com::sun::star::container::NoSuchElementException,
890 ::com::sun::star::uno::RuntimeException);
892 // XSimpleText
893 virtual ::com::sun::star::uno::Reference< ::com::sun::star::text::XTextCursor > SAL_CALL
894 createTextCursor() throw(::com::sun::star::uno::RuntimeException);
895 virtual ::com::sun::star::uno::Reference< ::com::sun::star::text::XTextCursor > SAL_CALL
896 createTextCursorByRange( const ::com::sun::star::uno::Reference<
897 ::com::sun::star::text::XTextRange >& aTextPosition )
898 throw(::com::sun::star::uno::RuntimeException);
899 virtual void SAL_CALL insertString( const ::com::sun::star::uno::Reference<
900 ::com::sun::star::text::XTextRange >& xRange,
901 const ::rtl::OUString& aString, sal_Bool bAbsorb )
902 throw(::com::sun::star::uno::RuntimeException);
903 virtual void SAL_CALL insertControlCharacter( const ::com::sun::star::uno::Reference<
904 ::com::sun::star::text::XTextRange >& xRange,
905 sal_Int16 nControlCharacter, sal_Bool bAbsorb )
906 throw(::com::sun::star::lang::IllegalArgumentException,
907 ::com::sun::star::uno::RuntimeException);
909 // XTextRange
910 virtual ::com::sun::star::uno::Reference< ::com::sun::star::text::XText > SAL_CALL
911 getText() throw(::com::sun::star::uno::RuntimeException);
912 virtual ::com::sun::star::uno::Reference< ::com::sun::star::text::XTextRange > SAL_CALL
913 getStart() throw(::com::sun::star::uno::RuntimeException);
914 virtual ::com::sun::star::uno::Reference< ::com::sun::star::text::XTextRange > SAL_CALL
915 getEnd() throw(::com::sun::star::uno::RuntimeException);
916 virtual ::rtl::OUString SAL_CALL getString() throw(::com::sun::star::uno::RuntimeException);
917 virtual void SAL_CALL setString( const ::rtl::OUString& aString )
918 throw(::com::sun::star::uno::RuntimeException);
920 // XEnumerationAccess
921 virtual ::com::sun::star::uno::Reference< ::com::sun::star::container::XEnumeration > SAL_CALL
922 createEnumeration() throw(::com::sun::star::uno::RuntimeException);
924 // XElementAccess
925 virtual ::com::sun::star::uno::Type SAL_CALL getElementType()
926 throw(::com::sun::star::uno::RuntimeException);
927 virtual sal_Bool SAL_CALL hasElements() throw(::com::sun::star::uno::RuntimeException);
929 // XCell
930 virtual ::rtl::OUString SAL_CALL getFormula() throw(::com::sun::star::uno::RuntimeException);
931 virtual void SAL_CALL setFormula( const ::rtl::OUString& aFormula )
932 throw(::com::sun::star::uno::RuntimeException);
933 virtual double SAL_CALL getValue() throw(::com::sun::star::uno::RuntimeException);
934 virtual void SAL_CALL setValue( double nValue ) throw(::com::sun::star::uno::RuntimeException);
935 virtual ::com::sun::star::table::CellContentType SAL_CALL getType()
936 throw(::com::sun::star::uno::RuntimeException);
937 virtual sal_Int32 SAL_CALL getError() throw(::com::sun::star::uno::RuntimeException);
939 // XFormulaTokens
940 virtual ::com::sun::star::uno::Sequence< ::com::sun::star::sheet::FormulaToken > SAL_CALL getTokens()
941 throw (::com::sun::star::uno::RuntimeException);
942 virtual void SAL_CALL setTokens( const ::com::sun::star::uno::Sequence<
943 ::com::sun::star::sheet::FormulaToken >& aTokens )
944 throw (::com::sun::star::uno::RuntimeException);
946 // XCellAddressable
947 virtual ::com::sun::star::table::CellAddress SAL_CALL getCellAddress()
948 throw(::com::sun::star::uno::RuntimeException);
950 // XSheetAnnotationAnchor
951 virtual ::com::sun::star::uno::Reference< ::com::sun::star::sheet::XSheetAnnotation > SAL_CALL
952 getAnnotation() throw(::com::sun::star::uno::RuntimeException);
954 // XTextFieldsSupplier
955 virtual ::com::sun::star::uno::Reference< ::com::sun::star::container::XEnumerationAccess > SAL_CALL
956 getTextFields() throw(::com::sun::star::uno::RuntimeException);
957 virtual ::com::sun::star::uno::Reference< ::com::sun::star::container::XNameAccess > SAL_CALL
958 getTextFieldMasters() throw(::com::sun::star::uno::RuntimeException);
960 // XPropertySet ueberladen wegen Zell-Properties
961 virtual ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySetInfo >
962 SAL_CALL getPropertySetInfo()
963 throw(::com::sun::star::uno::RuntimeException);
965 // XServiceInfo
966 virtual ::rtl::OUString SAL_CALL getImplementationName()
967 throw(::com::sun::star::uno::RuntimeException);
968 virtual sal_Bool SAL_CALL supportsService( const ::rtl::OUString& ServiceName )
969 throw(::com::sun::star::uno::RuntimeException);
970 virtual ::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL getSupportedServiceNames()
971 throw(::com::sun::star::uno::RuntimeException);
973 // XTypeProvider
974 virtual ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Type > SAL_CALL getTypes()
975 throw(::com::sun::star::uno::RuntimeException);
976 virtual ::com::sun::star::uno::Sequence< sal_Int8 > SAL_CALL getImplementationId()
977 throw(::com::sun::star::uno::RuntimeException);
979 // XActionLockable
980 virtual sal_Bool SAL_CALL isActionLocked() throw(::com::sun::star::uno::RuntimeException);
981 virtual void SAL_CALL addActionLock() throw(::com::sun::star::uno::RuntimeException);
982 virtual void SAL_CALL removeActionLock() throw(::com::sun::star::uno::RuntimeException);
983 virtual void SAL_CALL setActionLocks( sal_Int16 nLock )
984 throw(::com::sun::star::uno::RuntimeException);
985 virtual sal_Int16 SAL_CALL resetActionLocks() throw(::com::sun::star::uno::RuntimeException);
987 static String GetOutputString_Impl(ScDocument* pDoc, const ScAddress& aPos);
991 class ScTableSheetObj : public ScCellRangeObj,
992 public com::sun::star::sheet::XSpreadsheet,
993 public com::sun::star::container::XNamed,
994 public com::sun::star::sheet::XSheetPageBreak,
995 public com::sun::star::sheet::XCellRangeMovement,
996 public com::sun::star::table::XTableChartsSupplier,
997 public com::sun::star::sheet::XDataPilotTablesSupplier,
998 public com::sun::star::sheet::XScenariosSupplier,
999 public com::sun::star::sheet::XSheetAnnotationsSupplier,
1000 public com::sun::star::drawing::XDrawPageSupplier,
1001 public com::sun::star::sheet::XPrintAreas,
1002 public com::sun::star::sheet::XSheetLinkable,
1003 public com::sun::star::sheet::XSheetAuditing,
1004 public com::sun::star::sheet::XSheetOutline,
1005 public com::sun::star::util::XProtectable,
1006 public com::sun::star::sheet::XScenario,
1007 public com::sun::star::sheet::XScenarioEnhanced,
1008 public com::sun::star::sheet::XExternalSheetName
1010 friend class ScTableSheetsObj; // fuer insertByName()
1012 private:
1013 const SfxItemPropertySet* pSheetPropSet;
1015 SCTAB GetTab_Impl() const;
1016 void PrintAreaUndo_Impl( ScPrintRangeSaver* pOldRanges );
1018 protected:
1019 virtual const SfxItemPropertyMap* GetItemPropertyMap();
1020 virtual void GetOnePropertyValue( const SfxItemPropertySimpleEntry* pEntry,
1021 ::com::sun::star::uno::Any& )
1022 throw(::com::sun::star::uno::RuntimeException);
1023 virtual void SetOnePropertyValue( const SfxItemPropertySimpleEntry* pEntry,
1024 const ::com::sun::star::uno::Any& aValue )
1025 throw(::com::sun::star::lang::IllegalArgumentException,
1026 ::com::sun::star::uno::RuntimeException);
1028 public:
1029 ScTableSheetObj(ScDocShell* pDocSh, SCTAB nTab);
1030 virtual ~ScTableSheetObj();
1032 void InitInsertSheet(ScDocShell* pDocSh, SCTAB nTab);
1034 virtual ::com::sun::star::uno::Any SAL_CALL queryInterface(
1035 const ::com::sun::star::uno::Type & rType )
1036 throw(::com::sun::star::uno::RuntimeException);
1037 virtual void SAL_CALL acquire() throw();
1038 virtual void SAL_CALL release() throw();
1040 // XSpreadsheet
1041 virtual ::com::sun::star::uno::Reference< ::com::sun::star::sheet::XSheetCellCursor >
1042 SAL_CALL createCursor() throw(::com::sun::star::uno::RuntimeException);
1043 virtual ::com::sun::star::uno::Reference< ::com::sun::star::sheet::XSheetCellCursor > SAL_CALL
1044 createCursorByRange( const ::com::sun::star::uno::Reference<
1045 ::com::sun::star::sheet::XSheetCellRange >& aRange )
1046 throw(::com::sun::star::uno::RuntimeException);
1048 // XSheetCellRange
1049 virtual ::com::sun::star::uno::Reference< ::com::sun::star::sheet::XSpreadsheet > SAL_CALL
1050 getSpreadsheet() throw(::com::sun::star::uno::RuntimeException);
1052 // XCellRange
1053 virtual ::com::sun::star::uno::Reference< ::com::sun::star::table::XCell > SAL_CALL
1054 getCellByPosition( sal_Int32 nColumn, sal_Int32 nRow )
1055 throw(::com::sun::star::lang::IndexOutOfBoundsException,
1056 ::com::sun::star::uno::RuntimeException);
1057 virtual ::com::sun::star::uno::Reference< ::com::sun::star::table::XCellRange > SAL_CALL
1058 getCellRangeByPosition( sal_Int32 nLeft, sal_Int32 nTop,
1059 sal_Int32 nRight, sal_Int32 nBottom )
1060 throw(::com::sun::star::lang::IndexOutOfBoundsException,
1061 ::com::sun::star::uno::RuntimeException);
1062 using ScCellRangeObj::getCellRangeByName;
1063 virtual ::com::sun::star::uno::Reference< ::com::sun::star::table::XCellRange > SAL_CALL
1064 getCellRangeByName( const ::rtl::OUString& aRange )
1065 throw(::com::sun::star::uno::RuntimeException);
1067 // XNamed
1068 virtual ::rtl::OUString SAL_CALL getName() throw(::com::sun::star::uno::RuntimeException);
1069 virtual void SAL_CALL setName( const ::rtl::OUString& aName )
1070 throw(::com::sun::star::uno::RuntimeException);
1072 // XSheetPageBreak
1073 virtual ::com::sun::star::uno::Sequence< ::com::sun::star::sheet::TablePageBreakData > SAL_CALL
1074 getColumnPageBreaks() throw(::com::sun::star::uno::RuntimeException);
1075 virtual ::com::sun::star::uno::Sequence< ::com::sun::star::sheet::TablePageBreakData > SAL_CALL
1076 getRowPageBreaks() throw(::com::sun::star::uno::RuntimeException);
1077 virtual void SAL_CALL removeAllManualPageBreaks() throw(::com::sun::star::uno::RuntimeException);
1079 // XCellRangeMovement
1080 virtual void SAL_CALL insertCells( const ::com::sun::star::table::CellRangeAddress& aRange,
1081 ::com::sun::star::sheet::CellInsertMode nMode )
1082 throw(::com::sun::star::uno::RuntimeException);
1083 virtual void SAL_CALL removeRange( const ::com::sun::star::table::CellRangeAddress& aRange,
1084 ::com::sun::star::sheet::CellDeleteMode nMode )
1085 throw(::com::sun::star::uno::RuntimeException);
1086 virtual void SAL_CALL moveRange( const ::com::sun::star::table::CellAddress& aDestination,
1087 const ::com::sun::star::table::CellRangeAddress& aSource )
1088 throw(::com::sun::star::uno::RuntimeException);
1089 virtual void SAL_CALL copyRange( const ::com::sun::star::table::CellAddress& aDestination,
1090 const ::com::sun::star::table::CellRangeAddress& aSource )
1091 throw(::com::sun::star::uno::RuntimeException);
1093 // XTableChartsSupplier
1094 virtual ::com::sun::star::uno::Reference< ::com::sun::star::table::XTableCharts > SAL_CALL
1095 getCharts() throw(::com::sun::star::uno::RuntimeException);
1097 // XDataPilotTablesSupplier
1098 virtual ::com::sun::star::uno::Reference< ::com::sun::star::sheet::XDataPilotTables > SAL_CALL
1099 getDataPilotTables() throw(::com::sun::star::uno::RuntimeException);
1101 // XScenariosSupplier
1102 virtual ::com::sun::star::uno::Reference< ::com::sun::star::sheet::XScenarios > SAL_CALL
1103 getScenarios() throw(::com::sun::star::uno::RuntimeException);
1105 // XSheetAnnotationsSupplier
1106 virtual ::com::sun::star::uno::Reference< ::com::sun::star::sheet::XSheetAnnotations > SAL_CALL
1107 getAnnotations() throw(::com::sun::star::uno::RuntimeException);
1109 // XDrawPageSupplier
1110 virtual ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XDrawPage > SAL_CALL
1111 getDrawPage() throw(::com::sun::star::uno::RuntimeException);
1113 // XPrintAreas
1114 virtual ::com::sun::star::uno::Sequence< ::com::sun::star::table::CellRangeAddress > SAL_CALL
1115 getPrintAreas() throw(::com::sun::star::uno::RuntimeException);
1116 virtual void SAL_CALL setPrintAreas( const ::com::sun::star::uno::Sequence<
1117 ::com::sun::star::table::CellRangeAddress >& aPrintAreas )
1118 throw(::com::sun::star::uno::RuntimeException);
1119 virtual sal_Bool SAL_CALL getPrintTitleColumns() throw(::com::sun::star::uno::RuntimeException);
1120 virtual void SAL_CALL setPrintTitleColumns( sal_Bool bPrintTitleColumns )
1121 throw(::com::sun::star::uno::RuntimeException);
1122 virtual ::com::sun::star::table::CellRangeAddress SAL_CALL getTitleColumns()
1123 throw(::com::sun::star::uno::RuntimeException);
1124 virtual void SAL_CALL setTitleColumns(
1125 const ::com::sun::star::table::CellRangeAddress& aTitleColumns )
1126 throw(::com::sun::star::uno::RuntimeException);
1127 virtual sal_Bool SAL_CALL getPrintTitleRows() throw(::com::sun::star::uno::RuntimeException);
1128 virtual void SAL_CALL setPrintTitleRows( sal_Bool bPrintTitleRows )
1129 throw(::com::sun::star::uno::RuntimeException);
1130 virtual ::com::sun::star::table::CellRangeAddress SAL_CALL getTitleRows()
1131 throw(::com::sun::star::uno::RuntimeException);
1132 virtual void SAL_CALL setTitleRows(
1133 const ::com::sun::star::table::CellRangeAddress& aTitleRows )
1134 throw(::com::sun::star::uno::RuntimeException);
1136 // XSheetLinkable
1137 virtual ::com::sun::star::sheet::SheetLinkMode SAL_CALL getLinkMode()
1138 throw(::com::sun::star::uno::RuntimeException);
1139 virtual void SAL_CALL setLinkMode( ::com::sun::star::sheet::SheetLinkMode nLinkMode )
1140 throw(::com::sun::star::uno::RuntimeException);
1141 virtual ::rtl::OUString SAL_CALL getLinkUrl() throw(::com::sun::star::uno::RuntimeException);
1142 virtual void SAL_CALL setLinkUrl( const ::rtl::OUString& aLinkUrl )
1143 throw(::com::sun::star::uno::RuntimeException);
1144 virtual ::rtl::OUString SAL_CALL getLinkSheetName() throw(::com::sun::star::uno::RuntimeException);
1145 virtual void SAL_CALL setLinkSheetName( const ::rtl::OUString& aLinkSheetName )
1146 throw(::com::sun::star::uno::RuntimeException);
1147 virtual void SAL_CALL link( const ::rtl::OUString& aUrl,
1148 const ::rtl::OUString& aSheetName,
1149 const ::rtl::OUString& aFilterName,
1150 const ::rtl::OUString& aFilterOptions,
1151 ::com::sun::star::sheet::SheetLinkMode nMode )
1152 throw(::com::sun::star::uno::RuntimeException);
1154 // XSheetAuditing
1155 virtual sal_Bool SAL_CALL hideDependents( const ::com::sun::star::table::CellAddress& aPosition )
1156 throw(::com::sun::star::uno::RuntimeException);
1157 virtual sal_Bool SAL_CALL hidePrecedents( const ::com::sun::star::table::CellAddress& aPosition )
1158 throw(::com::sun::star::uno::RuntimeException);
1159 virtual sal_Bool SAL_CALL showDependents( const ::com::sun::star::table::CellAddress& aPosition )
1160 throw(::com::sun::star::uno::RuntimeException);
1161 virtual sal_Bool SAL_CALL showPrecedents( const ::com::sun::star::table::CellAddress& aPosition )
1162 throw(::com::sun::star::uno::RuntimeException);
1163 virtual sal_Bool SAL_CALL showErrors( const ::com::sun::star::table::CellAddress& aPosition )
1164 throw(::com::sun::star::uno::RuntimeException);
1165 virtual sal_Bool SAL_CALL showInvalid() throw(::com::sun::star::uno::RuntimeException);
1166 virtual void SAL_CALL clearArrows() throw(::com::sun::star::uno::RuntimeException);
1168 // XSheetOutline
1169 virtual void SAL_CALL group( const ::com::sun::star::table::CellRangeAddress& aRange,
1170 ::com::sun::star::table::TableOrientation nOrientation )
1171 throw(::com::sun::star::uno::RuntimeException);
1172 virtual void SAL_CALL ungroup( const ::com::sun::star::table::CellRangeAddress& aRange,
1173 ::com::sun::star::table::TableOrientation nOrientation )
1174 throw(::com::sun::star::uno::RuntimeException);
1175 virtual void SAL_CALL autoOutline( const ::com::sun::star::table::CellRangeAddress& aRange )
1176 throw(::com::sun::star::uno::RuntimeException);
1177 virtual void SAL_CALL clearOutline() throw(::com::sun::star::uno::RuntimeException);
1178 virtual void SAL_CALL hideDetail( const ::com::sun::star::table::CellRangeAddress& aRange )
1179 throw(::com::sun::star::uno::RuntimeException);
1180 virtual void SAL_CALL showDetail( const ::com::sun::star::table::CellRangeAddress& aRange )
1181 throw(::com::sun::star::uno::RuntimeException);
1182 virtual void SAL_CALL showLevel( sal_Int16 nLevel,
1183 ::com::sun::star::table::TableOrientation nOrientation )
1184 throw(::com::sun::star::uno::RuntimeException);
1186 // XProtectable
1187 virtual void SAL_CALL protect( const ::rtl::OUString& aPassword )
1188 throw(::com::sun::star::uno::RuntimeException);
1189 virtual void SAL_CALL unprotect( const ::rtl::OUString& aPassword )
1190 throw(::com::sun::star::lang::IllegalArgumentException,
1191 ::com::sun::star::uno::RuntimeException);
1192 virtual sal_Bool SAL_CALL isProtected() throw(::com::sun::star::uno::RuntimeException);
1194 // XScenario
1195 virtual sal_Bool SAL_CALL getIsScenario() throw(::com::sun::star::uno::RuntimeException);
1196 virtual ::rtl::OUString SAL_CALL getScenarioComment() throw(::com::sun::star::uno::RuntimeException);
1197 virtual void SAL_CALL setScenarioComment( const ::rtl::OUString& aScenarioComment )
1198 throw(::com::sun::star::uno::RuntimeException);
1199 virtual void SAL_CALL addRanges( const ::com::sun::star::uno::Sequence<
1200 ::com::sun::star::table::CellRangeAddress >& aRanges )
1201 throw(::com::sun::star::uno::RuntimeException);
1202 virtual void SAL_CALL apply() throw(::com::sun::star::uno::RuntimeException);
1203 // XScenarioEnhanced
1204 virtual ::com::sun::star::uno::Sequence< ::com::sun::star::table::CellRangeAddress > SAL_CALL
1205 getRanges( )
1206 throw(::com::sun::star::uno::RuntimeException);
1208 // XExternalSheetName
1209 virtual void SAL_CALL setExternalName( const ::rtl::OUString& aUrl, const ::rtl::OUString& aSheetName )
1210 throw (::com::sun::star::container::ElementExistException,
1211 ::com::sun::star::uno::RuntimeException);
1213 // XPropertySet ueberladen wegen Sheet-Properties
1214 virtual ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySetInfo >
1215 SAL_CALL getPropertySetInfo()
1216 throw(::com::sun::star::uno::RuntimeException);
1218 // XServiceInfo
1219 virtual ::rtl::OUString SAL_CALL getImplementationName()
1220 throw(::com::sun::star::uno::RuntimeException);
1221 virtual sal_Bool SAL_CALL supportsService( const ::rtl::OUString& ServiceName )
1222 throw(::com::sun::star::uno::RuntimeException);
1223 virtual ::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL getSupportedServiceNames()
1224 throw(::com::sun::star::uno::RuntimeException);
1226 // XUnoTunnel
1227 virtual sal_Int64 SAL_CALL getSomething( const ::com::sun::star::uno::Sequence<
1228 sal_Int8 >& aIdentifier )
1229 throw(::com::sun::star::uno::RuntimeException);
1231 static const com::sun::star::uno::Sequence<sal_Int8>& getUnoTunnelId();
1232 static ScTableSheetObj* getImplementation( const com::sun::star::uno::Reference<
1233 com::sun::star::uno::XInterface> xObj );
1235 // XTypeProvider
1236 virtual ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Type > SAL_CALL getTypes()
1237 throw(::com::sun::star::uno::RuntimeException);
1238 virtual ::com::sun::star::uno::Sequence< sal_Int8 > SAL_CALL getImplementationId()
1239 throw(::com::sun::star::uno::RuntimeException);
1243 class ScTableColumnObj : public ScCellRangeObj,
1244 public com::sun::star::container::XNamed
1246 private:
1247 const SfxItemPropertySet* pColPropSet;
1249 protected:
1250 virtual const SfxItemPropertyMap* GetItemPropertyMap();
1251 virtual void GetOnePropertyValue( const SfxItemPropertySimpleEntry* pEntry,
1252 ::com::sun::star::uno::Any& )
1253 throw(::com::sun::star::uno::RuntimeException);
1254 virtual void SetOnePropertyValue( const SfxItemPropertySimpleEntry* pEntry,
1255 const ::com::sun::star::uno::Any& aValue )
1256 throw(::com::sun::star::lang::IllegalArgumentException,
1257 ::com::sun::star::uno::RuntimeException);
1259 public:
1260 ScTableColumnObj(ScDocShell* pDocSh, SCCOL nCol, SCTAB nTab);
1261 virtual ~ScTableColumnObj();
1263 virtual ::com::sun::star::uno::Any SAL_CALL queryInterface(
1264 const ::com::sun::star::uno::Type & rType )
1265 throw(::com::sun::star::uno::RuntimeException);
1266 virtual void SAL_CALL acquire() throw();
1267 virtual void SAL_CALL release() throw();
1269 // XNamed
1270 virtual ::rtl::OUString SAL_CALL getName() throw(::com::sun::star::uno::RuntimeException);
1271 virtual void SAL_CALL setName( const ::rtl::OUString& aName )
1272 throw(::com::sun::star::uno::RuntimeException);
1274 // XPropertySet ueberladen wegen Spalten-Properties
1275 virtual ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySetInfo >
1276 SAL_CALL getPropertySetInfo()
1277 throw(::com::sun::star::uno::RuntimeException);
1279 // XServiceInfo
1280 virtual ::rtl::OUString SAL_CALL getImplementationName()
1281 throw(::com::sun::star::uno::RuntimeException);
1282 virtual sal_Bool SAL_CALL supportsService( const ::rtl::OUString& ServiceName )
1283 throw(::com::sun::star::uno::RuntimeException);
1284 virtual ::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL getSupportedServiceNames()
1285 throw(::com::sun::star::uno::RuntimeException);
1287 // XTypeProvider
1288 virtual ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Type > SAL_CALL getTypes()
1289 throw(::com::sun::star::uno::RuntimeException);
1290 virtual ::com::sun::star::uno::Sequence< sal_Int8 > SAL_CALL getImplementationId()
1291 throw(::com::sun::star::uno::RuntimeException);
1295 class ScTableRowObj : public ScCellRangeObj
1297 private:
1298 const SfxItemPropertySet* pRowPropSet;
1300 protected:
1301 virtual const SfxItemPropertyMap* GetItemPropertyMap();
1302 virtual void GetOnePropertyValue( const SfxItemPropertySimpleEntry* pEntry,
1303 ::com::sun::star::uno::Any& )
1304 throw(::com::sun::star::uno::RuntimeException);
1305 virtual void SetOnePropertyValue( const SfxItemPropertySimpleEntry* pEntry,
1306 const ::com::sun::star::uno::Any& aValue )
1307 throw(::com::sun::star::lang::IllegalArgumentException,
1308 ::com::sun::star::uno::RuntimeException);
1310 public:
1311 ScTableRowObj(ScDocShell* pDocSh, SCROW nRow, SCTAB nTab);
1312 virtual ~ScTableRowObj();
1314 // XPropertySet ueberladen wegen Zeilen-Properties
1315 virtual ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySetInfo >
1316 SAL_CALL getPropertySetInfo()
1317 throw(::com::sun::star::uno::RuntimeException);
1319 // XServiceInfo
1320 virtual ::rtl::OUString SAL_CALL getImplementationName()
1321 throw(::com::sun::star::uno::RuntimeException);
1322 virtual sal_Bool SAL_CALL supportsService( const ::rtl::OUString& ServiceName )
1323 throw(::com::sun::star::uno::RuntimeException);
1324 virtual ::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL getSupportedServiceNames()
1325 throw(::com::sun::star::uno::RuntimeException);
1329 class ScCellsObj : public cppu::WeakImplHelper2<
1330 com::sun::star::container::XEnumerationAccess,
1331 com::sun::star::lang::XServiceInfo >,
1332 public SfxListener
1334 private:
1335 ScDocShell* pDocShell;
1336 ScRangeList aRanges;
1338 public:
1339 ScCellsObj(ScDocShell* pDocSh, const ScRangeList& rR);
1340 virtual ~ScCellsObj();
1342 virtual void Notify( SfxBroadcaster& rBC, const SfxHint& rHint );
1344 // XEnumerationAccess
1345 virtual ::com::sun::star::uno::Reference< ::com::sun::star::container::XEnumeration > SAL_CALL
1346 createEnumeration() throw(::com::sun::star::uno::RuntimeException);
1348 // XElementAccess
1349 virtual ::com::sun::star::uno::Type SAL_CALL getElementType()
1350 throw(::com::sun::star::uno::RuntimeException);
1351 virtual sal_Bool SAL_CALL hasElements() throw(::com::sun::star::uno::RuntimeException);
1353 // XServiceInfo
1354 virtual ::rtl::OUString SAL_CALL getImplementationName()
1355 throw(::com::sun::star::uno::RuntimeException);
1356 virtual sal_Bool SAL_CALL supportsService( const ::rtl::OUString& ServiceName )
1357 throw(::com::sun::star::uno::RuntimeException);
1358 virtual ::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL getSupportedServiceNames()
1359 throw(::com::sun::star::uno::RuntimeException);
1363 class ScCellsEnumeration : public cppu::WeakImplHelper2<
1364 com::sun::star::container::XEnumeration,
1365 com::sun::star::lang::XServiceInfo >,
1366 public SfxListener
1368 private:
1369 ScDocShell* pDocShell;
1370 ScRangeList aRanges;
1371 ScAddress aPos;
1372 ScMarkData* pMark;
1373 BOOL bAtEnd;
1375 private:
1376 void Advance_Impl();
1377 void CheckPos_Impl();
1379 public:
1380 ScCellsEnumeration(ScDocShell* pDocSh, const ScRangeList& rR);
1381 virtual ~ScCellsEnumeration();
1383 virtual void Notify( SfxBroadcaster& rBC, const SfxHint& rHint );
1385 // XEnumeration
1386 virtual sal_Bool SAL_CALL hasMoreElements() throw(::com::sun::star::uno::RuntimeException);
1387 virtual ::com::sun::star::uno::Any SAL_CALL nextElement()
1388 throw(::com::sun::star::container::NoSuchElementException,
1389 ::com::sun::star::lang::WrappedTargetException,
1390 ::com::sun::star::uno::RuntimeException);
1392 // XServiceInfo
1393 virtual ::rtl::OUString SAL_CALL getImplementationName()
1394 throw(::com::sun::star::uno::RuntimeException);
1395 virtual sal_Bool SAL_CALL supportsService( const ::rtl::OUString& ServiceName )
1396 throw(::com::sun::star::uno::RuntimeException);
1397 virtual ::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL getSupportedServiceNames()
1398 throw(::com::sun::star::uno::RuntimeException);
1401 class ScCellFormatsObj : public cppu::WeakImplHelper3<
1402 com::sun::star::container::XIndexAccess,
1403 com::sun::star::container::XEnumerationAccess,
1404 com::sun::star::lang::XServiceInfo >,
1405 public SfxListener
1407 private:
1408 ScDocShell* pDocShell;
1409 ScRange aTotalRange;
1411 private:
1412 ScCellRangeObj* GetObjectByIndex_Impl(long nIndex) const;
1414 public:
1415 ScCellFormatsObj(ScDocShell* pDocSh, const ScRange& rR);
1416 virtual ~ScCellFormatsObj();
1418 virtual void Notify( SfxBroadcaster& rBC, const SfxHint& rHint );
1420 // XIndexAccess
1421 virtual sal_Int32 SAL_CALL getCount() throw(::com::sun::star::uno::RuntimeException);
1422 virtual ::com::sun::star::uno::Any SAL_CALL getByIndex( sal_Int32 Index )
1423 throw(::com::sun::star::lang::IndexOutOfBoundsException,
1424 ::com::sun::star::lang::WrappedTargetException,
1425 ::com::sun::star::uno::RuntimeException);
1427 // XEnumerationAccess
1428 virtual ::com::sun::star::uno::Reference< ::com::sun::star::container::XEnumeration > SAL_CALL
1429 createEnumeration() throw(::com::sun::star::uno::RuntimeException);
1431 // XElementAccess
1432 virtual ::com::sun::star::uno::Type SAL_CALL getElementType()
1433 throw(::com::sun::star::uno::RuntimeException);
1434 virtual sal_Bool SAL_CALL hasElements() throw(::com::sun::star::uno::RuntimeException);
1436 // XServiceInfo
1437 virtual ::rtl::OUString SAL_CALL getImplementationName()
1438 throw(::com::sun::star::uno::RuntimeException);
1439 virtual sal_Bool SAL_CALL supportsService( const ::rtl::OUString& ServiceName )
1440 throw(::com::sun::star::uno::RuntimeException);
1441 virtual ::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL getSupportedServiceNames()
1442 throw(::com::sun::star::uno::RuntimeException);
1446 class ScCellFormatsEnumeration : public cppu::WeakImplHelper2<
1447 com::sun::star::container::XEnumeration,
1448 com::sun::star::lang::XServiceInfo >,
1449 public SfxListener
1451 private:
1452 ScDocShell* pDocShell;
1453 SCTAB nTab;
1454 ScAttrRectIterator* pIter;
1455 ScRange aNext;
1456 BOOL bAtEnd;
1457 BOOL bDirty;
1459 private:
1460 void Advance_Impl();
1461 ScCellRangeObj* NextObject_Impl();
1463 public:
1464 ScCellFormatsEnumeration(ScDocShell* pDocSh, const ScRange& rR);
1465 virtual ~ScCellFormatsEnumeration();
1467 virtual void Notify( SfxBroadcaster& rBC, const SfxHint& rHint );
1469 // XEnumeration
1470 virtual sal_Bool SAL_CALL hasMoreElements() throw(::com::sun::star::uno::RuntimeException);
1471 virtual ::com::sun::star::uno::Any SAL_CALL nextElement()
1472 throw(::com::sun::star::container::NoSuchElementException,
1473 ::com::sun::star::lang::WrappedTargetException,
1474 ::com::sun::star::uno::RuntimeException);
1476 // XServiceInfo
1477 virtual ::rtl::OUString SAL_CALL getImplementationName()
1478 throw(::com::sun::star::uno::RuntimeException);
1479 virtual sal_Bool SAL_CALL supportsService( const ::rtl::OUString& ServiceName )
1480 throw(::com::sun::star::uno::RuntimeException);
1481 virtual ::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL getSupportedServiceNames()
1482 throw(::com::sun::star::uno::RuntimeException);
1485 typedef std::vector< ScRangeList > ScMyRangeLists;
1487 class ScUniqueCellFormatsObj : public cppu::WeakImplHelper3<
1488 com::sun::star::container::XIndexAccess,
1489 com::sun::star::container::XEnumerationAccess,
1490 com::sun::star::lang::XServiceInfo >,
1491 public SfxListener
1493 private:
1494 ScDocShell* pDocShell;
1495 ScRange aTotalRange;
1496 ScMyRangeLists aRangeLists;
1498 private:
1499 void GetObjects_Impl();
1501 public:
1502 ScUniqueCellFormatsObj(ScDocShell* pDocSh, const ScRange& rR);
1503 virtual ~ScUniqueCellFormatsObj();
1505 virtual void Notify( SfxBroadcaster& rBC, const SfxHint& rHint );
1507 // XIndexAccess
1508 virtual sal_Int32 SAL_CALL getCount() throw(::com::sun::star::uno::RuntimeException);
1509 virtual ::com::sun::star::uno::Any SAL_CALL getByIndex( sal_Int32 Index )
1510 throw(::com::sun::star::lang::IndexOutOfBoundsException,
1511 ::com::sun::star::lang::WrappedTargetException,
1512 ::com::sun::star::uno::RuntimeException);
1514 // XEnumerationAccess
1515 virtual ::com::sun::star::uno::Reference< ::com::sun::star::container::XEnumeration > SAL_CALL
1516 createEnumeration() throw(::com::sun::star::uno::RuntimeException);
1518 // XElementAccess
1519 virtual ::com::sun::star::uno::Type SAL_CALL getElementType()
1520 throw(::com::sun::star::uno::RuntimeException);
1521 virtual sal_Bool SAL_CALL hasElements() throw(::com::sun::star::uno::RuntimeException);
1523 // XServiceInfo
1524 virtual ::rtl::OUString SAL_CALL getImplementationName()
1525 throw(::com::sun::star::uno::RuntimeException);
1526 virtual sal_Bool SAL_CALL supportsService( const ::rtl::OUString& ServiceName )
1527 throw(::com::sun::star::uno::RuntimeException);
1528 virtual ::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL getSupportedServiceNames()
1529 throw(::com::sun::star::uno::RuntimeException);
1532 class ScUniqueCellFormatsEnumeration : public cppu::WeakImplHelper2<
1533 com::sun::star::container::XEnumeration,
1534 com::sun::star::lang::XServiceInfo >,
1535 public SfxListener
1537 private:
1538 ScMyRangeLists aRangeLists;
1539 ScDocShell* pDocShell;
1540 sal_Int32 nCurrentPosition;
1542 public:
1543 ScUniqueCellFormatsEnumeration(ScDocShell* pDocShell, const ScMyRangeLists& rRangeLists);
1544 virtual ~ScUniqueCellFormatsEnumeration();
1546 virtual void Notify( SfxBroadcaster& rBC, const SfxHint& rHint );
1548 // XEnumeration
1549 virtual sal_Bool SAL_CALL hasMoreElements() throw(::com::sun::star::uno::RuntimeException);
1550 virtual ::com::sun::star::uno::Any SAL_CALL nextElement()
1551 throw(::com::sun::star::container::NoSuchElementException,
1552 ::com::sun::star::lang::WrappedTargetException,
1553 ::com::sun::star::uno::RuntimeException);
1555 // XServiceInfo
1556 virtual ::rtl::OUString SAL_CALL getImplementationName()
1557 throw(::com::sun::star::uno::RuntimeException);
1558 virtual sal_Bool SAL_CALL supportsService( const ::rtl::OUString& ServiceName )
1559 throw(::com::sun::star::uno::RuntimeException);
1560 virtual ::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL getSupportedServiceNames()
1561 throw(::com::sun::star::uno::RuntimeException);
1565 #endif