LibreOffice Module sc (master) 1
cellsuno.hxx
Go to the documentation of this file.
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#pragma once
21
22#include <config_options.h>
23#include "address.hxx"
24#include "rangelst.hxx"
25
26#include <formula/grammar.hxx>
27#include <rtl/ref.hxx>
28#include <sal/types.h>
29#include <tools/link.hxx>
30#include <svl/itemset.hxx>
31#include <svl/lstner.hxx>
32#include <svl/listener.hxx>
33#include <com/sun/star/table/XTableChartsSupplier.hpp>
34#include <com/sun/star/table/XTablePivotChartsSupplier.hpp>
35#include <com/sun/star/chart/XChartDataArray.hpp>
36#include <com/sun/star/text/XTextFieldsSupplier.hpp>
37#include <com/sun/star/drawing/XDrawPageSupplier.hpp>
38#include <com/sun/star/sheet/XSheetCellRange.hpp>
39#include <com/sun/star/sheet/XFormulaQuery.hpp>
40#include <com/sun/star/sheet/XCellRangeAddressable.hpp>
41#include <com/sun/star/sheet/XSheetOperation.hpp>
42#include <com/sun/star/sheet/XSheetCellRangeContainer.hpp>
43#include <com/sun/star/sheet/XCellFormatRangesSupplier.hpp>
44#include <com/sun/star/sheet/XUniqueCellFormatRangesSupplier.hpp>
45#include <com/sun/star/sheet/XCellRangesQuery.hpp>
46#include <com/sun/star/sheet/XSheetFilterableEx.hpp>
47#include <com/sun/star/sheet/XSpreadsheet.hpp>
48#include <com/sun/star/sheet/XSheetPageBreak.hpp>
49#include <com/sun/star/sheet/XCellRangeMovement.hpp>
50#include <com/sun/star/text/XText.hpp>
51#include <com/sun/star/sheet/XPrintAreas.hpp>
52#include <com/sun/star/sheet/XSheetLinkable.hpp>
53#include <com/sun/star/sheet/XSubTotalCalculatable.hpp>
54#include <com/sun/star/sheet/XArrayFormulaRange.hpp>
55#include <com/sun/star/sheet/XCellRangeData.hpp>
56#include <com/sun/star/sheet/XCellRangeFormula.hpp>
57#include <com/sun/star/sheet/XCellSeries.hpp>
58#include <com/sun/star/sheet/XMultipleOperation.hpp>
59#include <com/sun/star/sheet/XFormulaTokens.hpp>
60#include <com/sun/star/sheet/XArrayFormulaTokens.hpp>
61#include <com/sun/star/sheet/XCellAddressable.hpp>
62#include <com/sun/star/util/XReplaceable.hpp>
63#include <com/sun/star/util/XIndent.hpp>
64#include <com/sun/star/lang/XServiceInfo.hpp>
65#include <com/sun/star/container/XNameContainer.hpp>
66#include <com/sun/star/util/XMergeable.hpp>
67#include <com/sun/star/table/XAutoFormattable.hpp>
68#include <com/sun/star/util/XSortable.hpp>
69#include <com/sun/star/util/XImportable.hpp>
70#include <com/sun/star/table/XColumnRowRange.hpp>
71#include <com/sun/star/table/XCell2.hpp>
72#include <com/sun/star/sheet/XDataPilotTablesSupplier.hpp>
73#include <com/sun/star/sheet/XSheetAnnotationAnchor.hpp>
74#include <com/sun/star/sheet/XScenariosSupplier.hpp>
75#include <com/sun/star/sheet/XSheetAnnotationsSupplier.hpp>
76#include <com/sun/star/sheet/XSheetAuditing.hpp>
77#include <com/sun/star/sheet/XSheetOutline.hpp>
78#include <com/sun/star/util/XProtectable.hpp>
79#include <com/sun/star/sheet/XScenario.hpp>
80#include <com/sun/star/sheet/XScenarioEnhanced.hpp>
81#include <com/sun/star/util/XModifyBroadcaster.hpp>
82#include <com/sun/star/beans/XPropertyState.hpp>
83#include <com/sun/star/beans/XMultiPropertySet.hpp>
84#include <com/sun/star/document/XActionLockable.hpp>
85#include <com/sun/star/beans/XTolerantMultiPropertySet.hpp>
86#include <com/sun/star/sheet/XExternalSheetName.hpp>
87#include <com/sun/star/document/XEventsSupplier.hpp>
90
91#include <memory>
92#include <optional>
93#include <vector>
94
95namespace com::sun::star::table { struct BorderLine2; }
96namespace com::sun::star::table { struct BorderLine; }
97namespace com::sun::star::table { struct TableBorder2; }
98namespace com::sun::star::table { struct TableBorder; }
99
100class ScDocShell;
101class ScMarkData;
102class ScMemChart;
105class ScCellRangeObj;
106class ScPatternAttr;
107class SvxBoxItem;
108class SvxBoxInfoItem;
110class SvxUnoText;
111class ScDocument;
112class SfxBroadcaster;
113class SfxHint;
117
118namespace editeng { class SvxBorderLine; }
119
120class ScLinkListener final : public SvtListener
121{
123public:
125 virtual ~ScLinkListener() override;
126 virtual void Notify( const SfxHint& rHint ) override;
127};
128
129typedef std::vector< css::uno::Reference< css::util::XModifyListener > > XModifyListenerArr_Impl;
130
131// ScCellRangesBase - base class for ScCellRangesObj (with access by index)
132// and ScCellRangeObj (without access by index)
133
134// XServiceInfo is implemented in derived classes
135
137{
138public:
139 static const ::editeng::SvxBorderLine* GetBorderLine( ::editeng::SvxBorderLine& rLine, const css::table::BorderLine& rStruct );
140 static const ::editeng::SvxBorderLine* GetBorderLine( ::editeng::SvxBorderLine& rLine, const css::table::BorderLine2& rStruct );
141 static void FillBoxItems( SvxBoxItem& rOuter, SvxBoxInfoItem& rInner, const css::table::TableBorder& rBorder );
142 static void FillBoxItems( SvxBoxItem& rOuter, SvxBoxInfoItem& rInner, const css::table::TableBorder2& rBorder );
143 static void FillBorderLine( css::table::BorderLine& rStruct, const ::editeng::SvxBorderLine* pLine );
144 static void FillBorderLine( css::table::BorderLine2& rStruct, const ::editeng::SvxBorderLine* pLine );
145 static void AssignTableBorderToAny( css::uno::Any& rAny,
146 const SvxBoxItem& rOuter, const SvxBoxInfoItem& rInner, bool bInvalidateHorVerDist = false );
147 static void AssignTableBorder2ToAny( css::uno::Any& rAny,
148 const SvxBoxItem& rOuter, const SvxBoxInfoItem& rInner, bool bInvalidateHorVerDist = false );
149 static void ApplyBorder( ScDocShell* pDocShell, const ScRangeList& rRanges,
150 const SvxBoxItem& rOuter, const SvxBoxInfoItem& rInner );
151};
152
153namespace ooo::vba::excel {
154 class ScVbaCellRangeAccess; // Vba Helper class
155}
156
157class SC_DLLPUBLIC SAL_LOPLUGIN_ANNOTATE("crosscast") ScCellRangesBase :
158 public cppu::WeakImplHelper<
159 css::beans::XPropertySet,
160 css::beans::XMultiPropertySet,
161 css::beans::XPropertyState,
162 css::sheet::XSheetOperation,
163 css::chart::XChartDataArray,
164 css::util::XIndent,
165 css::sheet::XCellRangesQuery,
166 css::sheet::XFormulaQuery,
167 css::util::XReplaceable,
168 css::util::XModifyBroadcaster,
169 css::lang::XServiceInfo,
170 css::beans::XTolerantMultiPropertySet>,
171 public SfxListener
172{
173 friend class ScTabViewObj; // for select()
174 friend class ScTableSheetObj; // for createCursorByRange()
176
177private:
178 const SfxItemPropertySet* pPropSet;
179 ScDocShell* pDocShell;
180 std::unique_ptr<ScLinkListener> pValueListener;
181 std::unique_ptr<ScPatternAttr> pCurrentFlat;
182 std::unique_ptr<ScPatternAttr> pCurrentDeep;
183 std::optional<SfxItemSet> moCurrentDataSet;
184 std::optional<SfxItemSet> moNoDfltCurrentDataSet;
185 std::unique_ptr<ScMarkData> pMarkData;
186 ScRangeList aRanges;
187 sal_Int64 nObjectId;
188 bool bChartColAsHdr;
189 bool bChartRowAsHdr;
190 bool bCursorOnly;
191 bool bGotDataChangedHint;
192 XModifyListenerArr_Impl aValueListeners;
193
194 DECL_DLLPRIVATE_LINK( ValueListenerHdl, const SfxHint&, void );
195
196private:
197 void PaintGridRanges_Impl();
198 ScRangeListRef GetLimitedChartRanges_Impl( sal_Int32 nDataColumns, sal_Int32 nDataRows ) const;
199 void ForceChartListener_Impl();
200 std::unique_ptr<ScMemChart> CreateMemChart_Impl() const;
201
202 const ScPatternAttr* GetCurrentAttrsFlat();
203 const ScPatternAttr* GetCurrentAttrsDeep();
204 SfxItemSet* GetCurrentDataSet(bool bNoDflt = false);
205 void ForgetMarkData();
206 void ForgetCurrentAttrs();
207
208 css::uno::Reference<css::sheet::XSheetCellRanges>
209 QueryDifferences_Impl(const css::table::CellAddress& aCompare,
210 bool bColumnDiff);
211 css::uno::Reference<css::uno::XInterface>
212 Find_Impl(const css::uno::Reference<css::util::XSearchDescriptor>& xDesc,
213 const ScAddress* pLastPos);
214
215protected:
216 const ScMarkData* GetMarkData();
217
218 // GetItemPropertyMap for derived classes must contain all entries, including base class
219 virtual const SfxItemPropertyMap& GetItemPropertyMap();
220 css::beans::PropertyState GetOnePropertyState(
221 sal_uInt16 nItemWhich, const SfxItemPropertyMapEntry* pEntry );
223 virtual void GetOnePropertyValue( const SfxItemPropertyMapEntry* pEntry,
224 css::uno::Any& );
227 virtual void SetOnePropertyValue( const SfxItemPropertyMapEntry* pEntry,
228 const css::uno::Any& aValue );
229
230public:
231 ScCellRangesBase(ScDocShell* pDocSh, const ScRange& rR);
232 ScCellRangesBase(ScDocShell* pDocSh, ScRangeList aR);
233 virtual ~ScCellRangesBase() override;
234
235 virtual void Notify( SfxBroadcaster& rBC, const SfxHint& rHint ) override;
236 virtual void RefChanged();
237
238 // from derived classes and by getImplementation
239 ScDocShell* GetDocShell() const { return pDocShell; }
240 ScDocument* GetDocument() const;
241 const ScRangeList& GetRangeList() const { return aRanges; }
242 void AddRange(const ScRange& rRange, const bool bMergeRanges);
243
244 // arouse object created via service:
245 void InitInsertRange(ScDocShell* pDocSh, const ScRange& rR);
246
247 void SetNewRange(const ScRange& rNew); // for cursor
248 void SetNewRanges(const ScRangeList& rNew);
249
250 void SetCursorOnly(bool bSet);
251 bool IsCursorOnly() const { return bCursorOnly; }
252
253 // XSheetOperation
254 virtual double SAL_CALL computeFunction( css::sheet::GeneralFunction nFunction ) override;
255 virtual void SAL_CALL clearContents( sal_Int32 nContentFlags ) override;
256
257 // XPropertySet
258 virtual css::uno::Reference< css::beans::XPropertySetInfo >
259 SAL_CALL getPropertySetInfo() override;
260 virtual void SAL_CALL setPropertyValue( const OUString& aPropertyName,
261 const css::uno::Any& aValue ) override;
262 virtual css::uno::Any SAL_CALL getPropertyValue(
263 const OUString& PropertyName ) override;
264 virtual void SAL_CALL addPropertyChangeListener( const OUString& aPropertyName,
265 const css::uno::Reference< css::beans::XPropertyChangeListener >& xListener ) override;
266 virtual void SAL_CALL removePropertyChangeListener( const OUString& aPropertyName,
267 const css::uno::Reference< css::beans::XPropertyChangeListener >& aListener ) override;
268 virtual void SAL_CALL addVetoableChangeListener( const OUString& PropertyName,
269 const css::uno::Reference< css::beans::XVetoableChangeListener >& aListener ) override;
270 virtual void SAL_CALL removeVetoableChangeListener( const OUString& PropertyName,
271 const css::uno::Reference< css::beans::XVetoableChangeListener >& aListener ) override;
272
273 // XMultiPropertySet
274 virtual void SAL_CALL setPropertyValues( const css::uno::Sequence< OUString >& aPropertyNames,
275 const css::uno::Sequence< css::uno::Any >& aValues ) override;
276 virtual css::uno::Sequence< css::uno::Any > SAL_CALL
277 getPropertyValues( const css::uno::Sequence< OUString >& aPropertyNames ) override;
278 virtual void SAL_CALL addPropertiesChangeListener( const css::uno::Sequence< OUString >& aPropertyNames,
279 const css::uno::Reference< css::beans::XPropertiesChangeListener >& xListener ) override;
280 virtual void SAL_CALL removePropertiesChangeListener( const css::uno::Reference< css::beans::XPropertiesChangeListener >& xListener ) override;
281 virtual void SAL_CALL firePropertiesChangeEvent( const css::uno::Sequence< OUString >& aPropertyNames,
282 const css::uno::Reference< css::beans::XPropertiesChangeListener >& xListener ) override;
283
284 // XTolerantMultiPropertySet
285 virtual css::uno::Sequence< css::beans::SetPropertyTolerantFailed > SAL_CALL
286 setPropertyValuesTolerant( const css::uno::Sequence< OUString >& aPropertyNames,
287 const css::uno::Sequence< css::uno::Any >& aValues ) override;
288 virtual css::uno::Sequence< css::beans::GetPropertyTolerantResult > SAL_CALL
289 getPropertyValuesTolerant( const css::uno::Sequence< OUString >& aPropertyNames ) override;
290 virtual css::uno::Sequence< css::beans::GetDirectPropertyTolerantResult > SAL_CALL
291 getDirectPropertyValuesTolerant( const css::uno::Sequence< OUString >& aPropertyNames ) override;
292
293 // XPropertyState
294 virtual css::beans::PropertyState SAL_CALL getPropertyState(
295 const OUString& PropertyName ) override;
296 virtual css::uno::Sequence< css::beans::PropertyState > SAL_CALL
297 getPropertyStates( const css::uno::Sequence<
298 OUString >& aPropertyName ) override;
299 virtual void SAL_CALL setPropertyToDefault( const OUString& PropertyName ) override;
300 virtual css::uno::Any SAL_CALL getPropertyDefault(
301 const OUString& aPropertyName ) override;
302
303 // XIndent
304 virtual void SAL_CALL decrementIndent() override;
305 virtual void SAL_CALL incrementIndent() override;
306
307 // XChartData
308 virtual void SAL_CALL addChartDataChangeEventListener(
309 const css::uno::Reference< css::chart::XChartDataChangeEventListener >& aListener ) override;
310 virtual void SAL_CALL removeChartDataChangeEventListener( const css::uno::Reference<
311 css::chart::XChartDataChangeEventListener >& aListener ) override;
312 virtual double SAL_CALL getNotANumber() override;
313 virtual sal_Bool SAL_CALL isNotANumber( double nNumber ) override;
314
315 // XChartDataArray
316 virtual css::uno::Sequence< css::uno::Sequence< double > > SAL_CALL
317 getData() override;
318 virtual void SAL_CALL setData( const css::uno::Sequence< css::uno::Sequence< double > >& aData ) override;
319 virtual css::uno::Sequence< OUString > SAL_CALL getRowDescriptions() override;
320 virtual void SAL_CALL setRowDescriptions( const css::uno::Sequence< OUString >& aRowDescriptions ) override;
321 virtual css::uno::Sequence< OUString > SAL_CALL getColumnDescriptions() override;
322 virtual void SAL_CALL setColumnDescriptions( const css::uno::Sequence< OUString >& aColumnDescriptions ) override;
323
324 // XCellRangesQuery
325 virtual css::uno::Reference< css::sheet::XSheetCellRanges > SAL_CALL
326 queryVisibleCells() override;
327 virtual css::uno::Reference< css::sheet::XSheetCellRanges > SAL_CALL
328 queryEmptyCells() override;
329 virtual css::uno::Reference< css::sheet::XSheetCellRanges > SAL_CALL
330 queryContentCells( sal_Int16 nContentFlags ) override;
331 virtual css::uno::Reference< css::sheet::XSheetCellRanges > SAL_CALL
332 queryFormulaCells( sal_Int32 nResultFlags ) override;
333 virtual css::uno::Reference< css::sheet::XSheetCellRanges > SAL_CALL
334 queryColumnDifferences(
335 const css::table::CellAddress& aCompare ) override;
336 virtual css::uno::Reference< css::sheet::XSheetCellRanges > SAL_CALL
337 queryRowDifferences(
338 const css::table::CellAddress& aCompare ) override;
339 virtual css::uno::Reference< css::sheet::XSheetCellRanges > SAL_CALL
340 queryIntersection(
341 const css::table::CellRangeAddress& aRange ) override;
342
343 // XFormulaQuery
344 virtual css::uno::Reference< css::sheet::XSheetCellRanges > SAL_CALL
345 queryDependents( sal_Bool bRecursive ) override;
346 virtual css::uno::Reference< css::sheet::XSheetCellRanges > SAL_CALL
347 queryPrecedents( sal_Bool bRecursive ) override;
348
349 // XSearchable
350 virtual css::uno::Reference< css::util::XSearchDescriptor > SAL_CALL
351 createSearchDescriptor() override;
352 virtual css::uno::Reference< css::container::XIndexAccess > SAL_CALL
353 findAll( const css::uno::Reference< css::util::XSearchDescriptor >& xDesc ) override;
354 virtual css::uno::Reference< css::uno::XInterface > SAL_CALL
355 findFirst( const css::uno::Reference< css::util::XSearchDescriptor >& xDesc ) override;
356 virtual css::uno::Reference< css::uno::XInterface > SAL_CALL
357 findNext( const css::uno::Reference< css::uno::XInterface >& xStartAt,
358 const css::uno::Reference< css::util::XSearchDescriptor >& xDesc ) override;
359
360 // XReplaceable
361 virtual css::uno::Reference< css::util::XReplaceDescriptor > SAL_CALL
362 createReplaceDescriptor() override;
363 virtual sal_Int32 SAL_CALL replaceAll( const css::uno::Reference< css::util::XSearchDescriptor >& xDesc ) override;
364
365 // XModifyBroadcaster
366 virtual void SAL_CALL addModifyListener( const css::uno::Reference< css::util::XModifyListener >& aListener ) override;
367 virtual void SAL_CALL removeModifyListener( const css::uno::Reference< css::util::XModifyListener >& aListener ) override;
368
369 // XServiceInfo
370 virtual OUString SAL_CALL getImplementationName() override;
371 virtual sal_Bool SAL_CALL supportsService( const OUString& ServiceName ) override;
372 virtual css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames() override;
373};
374
375class UNLESS_MERGELIBS(SC_DLLPUBLIC) ScCellRangesObj final : public ScCellRangesBase,
376 public css::sheet::XSheetCellRangeContainer,
377 public css::container::XNameContainer,
378 public css::container::XEnumerationAccess
379{
380public:
381 struct ScNamedEntry
382 {
383 OUString aName;
384 ScRange aRange;
385 const OUString& GetName() const { return aName; }
386 const ScRange& GetRange() const { return aRange; }
387 };
388private:
389 std::vector<ScNamedEntry> m_aNamedEntries;
390
391 rtl::Reference<ScCellRangeObj> GetObjectByIndex_Impl(sal_Int32 nIndex) const;
392
393public:
394 IF_MERGELIBS(SC_DLLPUBLIC)
395 ScCellRangesObj(ScDocShell* pDocSh, const ScRangeList& rR);
396 virtual ~ScCellRangesObj() override;
397
398 virtual css::uno::Any SAL_CALL queryInterface( const css::uno::Type & rType ) override;
399 IF_MERGELIBS(SC_DLLPUBLIC)
400 virtual void SAL_CALL acquire() noexcept override;
401 virtual void SAL_CALL release() noexcept override;
402
403 virtual void RefChanged() override;
404
405 // XSheetCellRanges
406 virtual css::uno::Reference< css::container::XEnumerationAccess > SAL_CALL
407 getCells() override;
408 virtual OUString SAL_CALL getRangeAddressesAsString() override;
409 virtual css::uno::Sequence< css::table::CellRangeAddress > SAL_CALL
410 getRangeAddresses() override;
411
412 // XSheetCellRangeContainer
413 virtual void SAL_CALL addRangeAddress( const css::table::CellRangeAddress& rRange,
414 sal_Bool bMergeRanges ) override;
415 virtual void SAL_CALL removeRangeAddress( const css::table::CellRangeAddress& rRange ) override;
416 virtual void SAL_CALL addRangeAddresses( const css::uno::Sequence<
417 css::table::CellRangeAddress >& rRanges,
418 sal_Bool bMergeRanges ) override;
419 virtual void SAL_CALL removeRangeAddresses( const css::uno::Sequence<
420 css::table::CellRangeAddress >& rRanges ) override;
421
422 // XNameContainer
423 virtual void SAL_CALL insertByName( const OUString& aName,
424 const css::uno::Any& aElement ) override;
425 virtual void SAL_CALL removeByName( const OUString& Name ) override;
426
427 // XNameReplace
428 virtual void SAL_CALL replaceByName( const OUString& aName,
429 const css::uno::Any& aElement ) override;
430
431 // XNameAccess
432 virtual css::uno::Any SAL_CALL getByName( const OUString& aName ) override;
433 virtual css::uno::Sequence< OUString > SAL_CALL getElementNames() override;
434 virtual sal_Bool SAL_CALL hasByName( const OUString& aName ) override;
435
436 // XIndexAccess
437 virtual sal_Int32 SAL_CALL getCount() override;
438 virtual css::uno::Any SAL_CALL getByIndex( sal_Int32 Index ) override;
439
440 // XElementAccess
441 virtual css::uno::Type SAL_CALL getElementType() override;
442 virtual sal_Bool SAL_CALL hasElements() override;
443
444 // XEnumerationAccess
445 virtual css::uno::Reference< css::container::XEnumeration > SAL_CALL
446 createEnumeration() override;
447
448 // XServiceInfo
449 virtual OUString SAL_CALL getImplementationName() override;
450 virtual sal_Bool SAL_CALL supportsService( const OUString& ServiceName ) override;
451 virtual css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames() override;
452
453 // XTypeProvider
454 virtual css::uno::Sequence< css::uno::Type > SAL_CALL getTypes() override;
455 virtual css::uno::Sequence< sal_Int8 > SAL_CALL getImplementationId() override;
456};
457
458class SC_DLLPUBLIC ScCellRangeObj : public ScCellRangesBase,
459 public css::sheet::XCellRangeAddressable,
460 public css::sheet::XSheetCellRange,
461 public css::sheet::XArrayFormulaRange,
462 public css::sheet::XArrayFormulaTokens,
463 public css::sheet::XCellRangeData,
464 public css::sheet::XCellRangeFormula,
465 public css::sheet::XMultipleOperation,
466 public css::util::XMergeable,
467 public css::sheet::XCellSeries,
468 public css::table::XAutoFormattable,
469 public css::util::XSortable,
470 public css::sheet::XSheetFilterableEx,
471 public css::sheet::XSubTotalCalculatable,
472 public css::util::XImportable,
473 public css::sheet::XCellFormatRangesSupplier,
474 public css::sheet::XUniqueCellFormatRangesSupplier,
475 public css::table::XColumnRowRange
476{
477private:
480
481protected:
482 const ScRange& GetRange() const { return aRange; }
483 virtual const SfxItemPropertyMap& GetItemPropertyMap() override;
484 virtual void GetOnePropertyValue( const SfxItemPropertyMapEntry* pEntry,
485 css::uno::Any& ) override;
486 virtual void SetOnePropertyValue( const SfxItemPropertyMapEntry* pEntry,
487 const css::uno::Any& aValue ) override;
488
491 css::uno::Reference< css::table::XCell >
492 GetCellByPosition_Impl( sal_Int32 nColumn, sal_Int32 nRow );
493
495 void SetArrayFormula_Impl( const OUString& rFormula,
496 const formula::FormulaGrammar::Grammar eGrammar );
497
498public:
499 ScCellRangeObj(ScDocShell* pDocSh, const ScRange& rR);
500 virtual ~ScCellRangeObj() override;
501
502 // uses ObjectShell from document, if set (returns NULL otherwise)
503 static css::uno::Reference<css::table::XCellRange>
504 CreateRangeFromDoc( const ScDocument& rDoc, const ScRange& rR );
505
506 virtual css::uno::Any SAL_CALL queryInterface(
507 const css::uno::Type & rType ) override;
508 virtual void SAL_CALL acquire() noexcept override;
509 virtual void SAL_CALL release() noexcept override;
510
511 virtual void RefChanged() override;
512
513 // XCellRangeAddressable
514 virtual css::table::CellRangeAddress SAL_CALL getRangeAddress() override;
515
516 // XSheetCellRange
517 virtual css::uno::Reference< css::sheet::XSpreadsheet > SAL_CALL
518 getSpreadsheet() override;
519
520 // XArrayFormulaRange
521 virtual OUString SAL_CALL getArrayFormula() override;
522 virtual void SAL_CALL setArrayFormula( const OUString& aFormula ) override;
523
524 // XArrayFormulaTokens
525 virtual css::uno::Sequence< css::sheet::FormulaToken > SAL_CALL getArrayTokens() override;
526 virtual void SAL_CALL setArrayTokens( const css::uno::Sequence<
527 css::sheet::FormulaToken >& aTokens ) override;
528
529 // XCellRangeData
530 virtual css::uno::Sequence< css::uno::Sequence< css::uno::Any > > SAL_CALL getDataArray() override;
531 virtual void SAL_CALL setDataArray( const css::uno::Sequence< css::uno::Sequence< css::uno::Any > >& aArray ) override;
532
533 // XCellRangeFormula
534 virtual css::uno::Sequence< css::uno::Sequence<
535 OUString > > SAL_CALL getFormulaArray() override;
536 virtual void SAL_CALL setFormulaArray( const css::uno::Sequence< css::uno::Sequence< OUString > >& aArray ) override;
537
538 // XMultipleOperation
539 virtual void SAL_CALL setTableOperation(
540 const css::table::CellRangeAddress& aFormulaRange,
541 css::sheet::TableOperationMode nMode,
542 const css::table::CellAddress& aColumnCell,
543 const css::table::CellAddress& aRowCell ) override;
544
545 // XMergeable
546 virtual void SAL_CALL merge( sal_Bool bMerge ) override;
547 virtual sal_Bool SAL_CALL getIsMerged() override;
548
549 // XCellSeries
550 virtual void SAL_CALL fillSeries( css::sheet::FillDirection nFillDirection,
551 css::sheet::FillMode nFillMode,
552 css::sheet::FillDateMode nFillDateMode,
553 double fStep, double fEndValue ) override;
554 virtual void SAL_CALL fillAuto( css::sheet::FillDirection nFillDirection,
555 sal_Int32 nSourceCount ) override;
556
557 // XAutoFormattable
558 virtual void SAL_CALL autoFormat( const OUString& aName ) override;
559
560 // XSortable
561 virtual css::uno::Sequence< css::beans::PropertyValue > SAL_CALL
562 createSortDescriptor() override;
563 virtual void SAL_CALL sort( const css::uno::Sequence<
564 css::beans::PropertyValue >& xDescriptor ) override;
565
566 // XSheetFilterableEx
567 virtual css::uno::Reference< css::sheet::XSheetFilterDescriptor > SAL_CALL
568 createFilterDescriptorByObject( const css::uno::Reference<
569 css::sheet::XSheetFilterable >& xObject ) override;
570
571 // XSheetFilterable
572 virtual css::uno::Reference< css::sheet::XSheetFilterDescriptor > SAL_CALL
573 createFilterDescriptor( sal_Bool bEmpty ) override;
574 virtual void SAL_CALL filter( const css::uno::Reference<
575 css::sheet::XSheetFilterDescriptor >& xDescriptor ) override;
576
577 // XSubTotalCalculatable
578 virtual css::uno::Reference< css::sheet::XSubTotalDescriptor > SAL_CALL
579 createSubTotalDescriptor( sal_Bool bEmpty ) override;
580 virtual void SAL_CALL applySubTotals(const css::uno::Reference< css::sheet::XSubTotalDescriptor >& xDescriptor,
581 sal_Bool bReplace) override;
582 virtual void SAL_CALL removeSubTotals() override;
583
584 // XImportable
585 virtual css::uno::Sequence< css::beans::PropertyValue > SAL_CALL
586 createImportDescriptor( sal_Bool bEmpty ) override;
587 virtual void SAL_CALL doImport( const css::uno::Sequence< css::beans::PropertyValue >& aDescriptor ) override;
588
589 // XCellFormatRangesSupplier
590 virtual css::uno::Reference< css::container::XIndexAccess > SAL_CALL
591 getCellFormatRanges() override;
592
593 // XUniqueCellFormatRangesSupplier
594 virtual css::uno::Reference< css::container::XIndexAccess > SAL_CALL
595 getUniqueCellFormatRanges() override;
596
597 // XColumnRowRange
598 virtual css::uno::Reference< css::table::XTableColumns > SAL_CALL
599 getColumns() override;
600 virtual css::uno::Reference< css::table::XTableRows > SAL_CALL
601 getRows() override;
602
603 // XCellRange
604 virtual css::uno::Reference< css::table::XCell > SAL_CALL
605 getCellByPosition( sal_Int32 nColumn, sal_Int32 nRow ) override;
606 virtual css::uno::Reference< css::table::XCellRange > SAL_CALL
607 getCellRangeByPosition( sal_Int32 nLeft, sal_Int32 nTop,
608 sal_Int32 nRight, sal_Int32 nBottom ) override;
609 virtual css::uno::Reference< css::table::XCellRange > SAL_CALL
610 getCellRangeByName( const OUString& aRange ) override;
612 css::uno::Reference< css::table::XCellRange >
613 getCellRangeByName( const OUString& aRange, const ScAddress::Details& rDetails );
614
615 // XPropertySet override due to Range-Properties
616 virtual css::uno::Reference< css::beans::XPropertySetInfo >
617 SAL_CALL getPropertySetInfo() override;
618
619 // XServiceInfo
620 virtual OUString SAL_CALL getImplementationName() override;
621 virtual sal_Bool SAL_CALL supportsService( const OUString& ServiceName ) override;
622 virtual css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames() override;
623
624 // XTypeProvider
625 virtual css::uno::Sequence< css::uno::Type > SAL_CALL getTypes() override;
626 virtual css::uno::Sequence< sal_Int8 > SAL_CALL getImplementationId() override;
627};
628
630
632 public css::text::XText,
633 public css::container::XEnumerationAccess,
634 public css::table::XCell2,
635 public css::sheet::XFormulaTokens,
636 public css::sheet::XCellAddressable,
637 public css::sheet::XSheetAnnotationAnchor,
638 public css::text::XTextFieldsSupplier,
639 public css::document::XActionLockable
640{
641private:
646
647private:
648 OUString GetInputString_Impl(bool bEnglish) const;
649 OUString GetOutputString_Impl() const;
650 void SetString_Impl(const OUString& rString, bool bInterpret, bool bEnglish);
651 double GetValue_Impl() const;
652 void SetValue_Impl(double fValue);
653 css::table::CellContentType GetContentType_Impl();
654 sal_Int32 GetResultType_Impl() const;
655
656 virtual const SfxItemPropertyMap& GetItemPropertyMap() override;
657 virtual void GetOnePropertyValue( const SfxItemPropertyMapEntry* pEntry,
658 css::uno::Any& ) override;
659 virtual void SetOnePropertyValue( const SfxItemPropertyMapEntry* pEntry,
660 const css::uno::Any& aValue ) override;
661
662public:
663 static const SvxItemPropertySet* GetEditPropertySet();
664 static const SfxItemPropertyMap& GetCellPropertyMap();
665
666 ScCellObj(ScDocShell* pDocSh, const ScAddress& rP);
667 virtual ~ScCellObj() override;
668
669 virtual css::uno::Any SAL_CALL queryInterface( const css::uno::Type & rType ) override;
670 virtual void SAL_CALL acquire() noexcept override;
671 virtual void SAL_CALL release() noexcept override;
672
673 virtual void RefChanged() override;
674
675 SvxUnoText& GetUnoText();
676
677 // XML import needs to set results at formula cells,
678 // not meant for any other purpose.
679 const ScAddress& GetPosition() const { return aCellPos; }
680
681 void InputEnglishString( const OUString& rText );
682
683 // XText
684 virtual void SAL_CALL insertTextContent( const css::uno::Reference< css::text::XTextRange >& xRange,
685 const css::uno::Reference< css::text::XTextContent >& xContent,
686 sal_Bool bAbsorb ) override;
687 virtual void SAL_CALL removeTextContent( const css::uno::Reference< css::text::XTextContent >& xContent ) override;
688
689 // XSimpleText
690 virtual css::uno::Reference< css::text::XTextCursor > SAL_CALL
691 createTextCursor() override;
692 virtual css::uno::Reference< css::text::XTextCursor > SAL_CALL
693 createTextCursorByRange( const css::uno::Reference< css::text::XTextRange >& aTextPosition ) override;
694 virtual void SAL_CALL insertString( const css::uno::Reference< css::text::XTextRange >& xRange,
695 const OUString& aString, sal_Bool bAbsorb ) override;
696 virtual void SAL_CALL insertControlCharacter( const css::uno::Reference< css::text::XTextRange >& xRange,
697 sal_Int16 nControlCharacter, sal_Bool bAbsorb ) override;
698
699 // XTextRange
700 virtual css::uno::Reference< css::text::XText > SAL_CALL
701 getText() override;
702 virtual css::uno::Reference< css::text::XTextRange > SAL_CALL
703 getStart() override;
704 virtual css::uno::Reference< css::text::XTextRange > SAL_CALL
705 getEnd() override;
706 virtual OUString SAL_CALL getString() override;
707 virtual void SAL_CALL setString( const OUString& aString ) override;
708
709 // XEnumerationAccess
710 virtual css::uno::Reference< css::container::XEnumeration > SAL_CALL
711 createEnumeration() override;
712
713 // XElementAccess
714 virtual css::uno::Type SAL_CALL getElementType() override;
715 virtual sal_Bool SAL_CALL hasElements() override;
716
717 // XCell
718 virtual OUString SAL_CALL getFormula() override;
719 virtual void SAL_CALL setFormula( const OUString& aFormula ) override;
720 virtual void SAL_CALL setFormulaResult( double nValue ) override;
721 virtual void SAL_CALL setFormulaString( const OUString& aFormula ) override;
722 virtual double SAL_CALL getValue() override;
723 virtual void SAL_CALL setValue( double nValue ) override;
724 virtual css::table::CellContentType SAL_CALL getType() override;
725 virtual sal_Int32 SAL_CALL getError() override;
726
727 // XFormulaTokens
728 virtual css::uno::Sequence< css::sheet::FormulaToken > SAL_CALL getTokens() override;
729 virtual void SAL_CALL setTokens( const css::uno::Sequence< css::sheet::FormulaToken >& aTokens ) override;
730
731 // XCellAddressable
732 virtual css::table::CellAddress SAL_CALL getCellAddress() override;
733
734 // XSheetAnnotationAnchor
735 virtual css::uno::Reference< css::sheet::XSheetAnnotation > SAL_CALL
736 getAnnotation() override;
737
738 // XTextFieldsSupplier
739 virtual css::uno::Reference< css::container::XEnumerationAccess > SAL_CALL
740 getTextFields() override;
741 virtual css::uno::Reference< css::container::XNameAccess > SAL_CALL
742 getTextFieldMasters() override;
743
744 // XPropertySet override due to cell properties
745 virtual css::uno::Reference< css::beans::XPropertySetInfo >
746 SAL_CALL getPropertySetInfo() override;
747
748 // XServiceInfo
749 virtual OUString SAL_CALL getImplementationName() override;
750 virtual sal_Bool SAL_CALL supportsService( const OUString& ServiceName ) override;
751 virtual css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames() override;
752
753 // XTypeProvider
754 virtual css::uno::Sequence< css::uno::Type > SAL_CALL getTypes() override;
755 virtual css::uno::Sequence< sal_Int8 > SAL_CALL getImplementationId() override;
756
757 // XActionLockable
758 virtual sal_Bool SAL_CALL isActionLocked() override;
759 virtual void SAL_CALL addActionLock() override;
760 virtual void SAL_CALL removeActionLock() override;
761 virtual void SAL_CALL setActionLocks( sal_Int16 nLock ) override;
762 virtual sal_Int16 SAL_CALL resetActionLocks() override;
763};
764
766 public css::sheet::XSpreadsheet,
767 public css::container::XNamed,
768 public css::sheet::XSheetPageBreak,
769 public css::sheet::XCellRangeMovement,
770 public css::table::XTableChartsSupplier,
771 public css::table::XTablePivotChartsSupplier,
772 public css::sheet::XDataPilotTablesSupplier,
773 public css::sheet::XScenariosSupplier,
774 public css::sheet::XSheetAnnotationsSupplier,
775 public css::drawing::XDrawPageSupplier,
776 public css::sheet::XPrintAreas,
777 public css::sheet::XSheetLinkable,
778 public css::sheet::XSheetAuditing,
779 public css::sheet::XSheetOutline,
780 public css::util::XProtectable,
781 public css::sheet::XScenario,
782 public css::sheet::XScenarioEnhanced,
783 public css::sheet::XExternalSheetName,
784 public css::document::XEventsSupplier
785{
786 friend class ScTableSheetsObj; // for insertByName()
787
788private:
790
791 SCTAB GetTab_Impl() const;
792 void PrintAreaUndo_Impl( std::unique_ptr<ScPrintRangeSaver> pOldRanges );
793
794 virtual const SfxItemPropertyMap& GetItemPropertyMap() override;
795 virtual void GetOnePropertyValue( const SfxItemPropertyMapEntry* pEntry,
796 css::uno::Any& ) override;
797 virtual void SetOnePropertyValue( const SfxItemPropertyMapEntry* pEntry,
798 const css::uno::Any& aValue ) override;
799
800public:
801 ScTableSheetObj(ScDocShell* pDocSh, SCTAB nTab);
802 virtual ~ScTableSheetObj() override;
803
804 void InitInsertSheet(ScDocShell* pDocSh, SCTAB nTab);
805
806 virtual css::uno::Any SAL_CALL queryInterface( const css::uno::Type & rType ) override;
807 virtual void SAL_CALL acquire() noexcept override;
808 virtual void SAL_CALL release() noexcept override;
809
810 // XSpreadsheet
811 virtual css::uno::Reference< css::sheet::XSheetCellCursor >
812 SAL_CALL createCursor() override;
813 virtual css::uno::Reference< css::sheet::XSheetCellCursor > SAL_CALL
814 createCursorByRange( const css::uno::Reference<
815 css::sheet::XSheetCellRange >& aRange ) override;
816
817 // XSheetCellRange
818 virtual css::uno::Reference< css::sheet::XSpreadsheet > SAL_CALL
819 getSpreadsheet() override;
820
821 // XCellRange
822 virtual css::uno::Reference< css::table::XCell > SAL_CALL
823 getCellByPosition( sal_Int32 nColumn, sal_Int32 nRow ) override;
824 virtual css::uno::Reference< css::table::XCellRange > SAL_CALL
825 getCellRangeByPosition( sal_Int32 nLeft, sal_Int32 nTop,
826 sal_Int32 nRight, sal_Int32 nBottom ) override;
827 using ScCellRangeObj::getCellRangeByName;
828 virtual css::uno::Reference< css::table::XCellRange > SAL_CALL
829 getCellRangeByName( const OUString& aRange ) override;
830
831 // XNamed
832 virtual OUString SAL_CALL getName() override;
833 virtual void SAL_CALL setName( const OUString& aName ) override;
834
835 // XSheetPageBreak
836 virtual css::uno::Sequence< css::sheet::TablePageBreakData > SAL_CALL
837 getColumnPageBreaks() override;
838 virtual css::uno::Sequence< css::sheet::TablePageBreakData > SAL_CALL
839 getRowPageBreaks() override;
840 virtual void SAL_CALL removeAllManualPageBreaks() override;
841
842 // XCellRangeMovement
843 virtual void SAL_CALL insertCells( const css::table::CellRangeAddress& aRange,
844 css::sheet::CellInsertMode nMode ) override;
845 virtual void SAL_CALL removeRange( const css::table::CellRangeAddress& aRange,
846 css::sheet::CellDeleteMode nMode ) override;
847 virtual void SAL_CALL moveRange( const css::table::CellAddress& aDestination,
848 const css::table::CellRangeAddress& aSource ) override;
849 virtual void SAL_CALL copyRange( const css::table::CellAddress& aDestination,
850 const css::table::CellRangeAddress& aSource ) override;
851
852 // XTableChartsSupplier
853 virtual css::uno::Reference< css::table::XTableCharts > SAL_CALL
854 getCharts() override;
855
856 // XTablePivotChartsSupplier
857 virtual css::uno::Reference<css::table::XTablePivotCharts> SAL_CALL
858 getPivotCharts() override;
859
860 // XDataPilotTablesSupplier
861 virtual css::uno::Reference< css::sheet::XDataPilotTables > SAL_CALL
862 getDataPilotTables() override;
863
864 // XScenariosSupplier
865 virtual css::uno::Reference< css::sheet::XScenarios > SAL_CALL
866 getScenarios() override;
867
868 // XSheetAnnotationsSupplier
869 virtual css::uno::Reference< css::sheet::XSheetAnnotations > SAL_CALL
870 getAnnotations() override;
871
872 // XDrawPageSupplier
873 virtual css::uno::Reference< css::drawing::XDrawPage > SAL_CALL
874 getDrawPage() override;
875
876 // XPrintAreas
877 virtual css::uno::Sequence< css::table::CellRangeAddress > SAL_CALL
878 getPrintAreas() override;
879 virtual void SAL_CALL setPrintAreas( const css::uno::Sequence<
880 css::table::CellRangeAddress >& aPrintAreas ) override;
881 virtual sal_Bool SAL_CALL getPrintTitleColumns() override;
882 virtual void SAL_CALL setPrintTitleColumns( sal_Bool bPrintTitleColumns ) override;
883 virtual css::table::CellRangeAddress SAL_CALL getTitleColumns() override;
884 virtual void SAL_CALL setTitleColumns(
885 const css::table::CellRangeAddress& aTitleColumns ) override;
886 virtual sal_Bool SAL_CALL getPrintTitleRows() override;
887 virtual void SAL_CALL setPrintTitleRows( sal_Bool bPrintTitleRows ) override;
888 virtual css::table::CellRangeAddress SAL_CALL getTitleRows() override;
889 virtual void SAL_CALL setTitleRows(
890 const css::table::CellRangeAddress& aTitleRows ) override;
891
892 // XSheetLinkable
893 virtual css::sheet::SheetLinkMode SAL_CALL getLinkMode() override;
894 virtual void SAL_CALL setLinkMode( css::sheet::SheetLinkMode nLinkMode ) override;
895 virtual OUString SAL_CALL getLinkUrl() override;
896 virtual void SAL_CALL setLinkUrl( const OUString& aLinkUrl ) override;
897 virtual OUString SAL_CALL getLinkSheetName() override;
898 virtual void SAL_CALL setLinkSheetName( const OUString& aLinkSheetName ) override;
899 virtual void SAL_CALL link( const OUString& aUrl,
900 const OUString& aSheetName,
901 const OUString& aFilterName,
902 const OUString& aFilterOptions,
903 css::sheet::SheetLinkMode nMode ) override;
904
905 // XSheetAuditing
906 virtual sal_Bool SAL_CALL hideDependents( const css::table::CellAddress& aPosition ) override;
907 virtual sal_Bool SAL_CALL hidePrecedents( const css::table::CellAddress& aPosition ) override;
908 virtual sal_Bool SAL_CALL showDependents( const css::table::CellAddress& aPosition ) override;
909 virtual sal_Bool SAL_CALL showPrecedents( const css::table::CellAddress& aPosition ) override;
910 virtual sal_Bool SAL_CALL showErrors( const css::table::CellAddress& aPosition ) override;
911 virtual sal_Bool SAL_CALL showInvalid() override;
912 virtual void SAL_CALL clearArrows() override;
913
914 // XSheetOutline
915 virtual void SAL_CALL group( const css::table::CellRangeAddress& aRange,
916 css::table::TableOrientation nOrientation ) override;
917 virtual void SAL_CALL ungroup( const css::table::CellRangeAddress& aRange,
918 css::table::TableOrientation nOrientation ) override;
919 virtual void SAL_CALL autoOutline( const css::table::CellRangeAddress& aRange ) override;
920 virtual void SAL_CALL clearOutline() override;
921 virtual void SAL_CALL hideDetail( const css::table::CellRangeAddress& aRange ) override;
922 virtual void SAL_CALL showDetail( const css::table::CellRangeAddress& aRange ) override;
923 virtual void SAL_CALL showLevel( sal_Int16 nLevel,
924 css::table::TableOrientation nOrientation ) override;
925
926 // XProtectable
927 virtual void SAL_CALL protect( const OUString& aPassword ) override;
928 virtual void SAL_CALL unprotect( const OUString& aPassword ) override;
929 virtual sal_Bool SAL_CALL isProtected() override;
930
931 // XScenario
932 virtual sal_Bool SAL_CALL getIsScenario() override;
933 virtual OUString SAL_CALL getScenarioComment() override;
934 virtual void SAL_CALL setScenarioComment( const OUString& aScenarioComment ) override;
935 virtual void SAL_CALL addRanges( const css::uno::Sequence<
936 css::table::CellRangeAddress >& aRanges ) override;
937 virtual void SAL_CALL apply() override;
938 // XScenarioEnhanced
939 virtual css::uno::Sequence< css::table::CellRangeAddress > SAL_CALL
940 getRanges( ) override;
941
942 // XExternalSheetName
943 virtual void SAL_CALL setExternalName( const OUString& aUrl, const OUString& aSheetName ) override;
944
945 // XEventsSupplier
946 virtual css::uno::Reference< css::container::XNameReplace > SAL_CALL getEvents() override;
947
948 // XPropertySet override due to sheet properties
949 virtual css::uno::Reference< css::beans::XPropertySetInfo >
950 SAL_CALL getPropertySetInfo() override;
951
952 // XServiceInfo
953 virtual OUString SAL_CALL getImplementationName() override;
954 virtual sal_Bool SAL_CALL supportsService( const OUString& ServiceName ) override;
955 virtual css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames() override;
956
957 // XTypeProvider
958 virtual css::uno::Sequence< css::uno::Type > SAL_CALL getTypes() override;
959 virtual css::uno::Sequence< sal_Int8 > SAL_CALL getImplementationId() override;
960};
961
962class ScTableColumnObj final : public ScCellRangeObj,
963 public css::container::XNamed
964{
965private:
967
968 virtual const SfxItemPropertyMap& GetItemPropertyMap() override;
969 virtual void GetOnePropertyValue( const SfxItemPropertyMapEntry* pEntry,
970 css::uno::Any& ) override;
971 virtual void SetOnePropertyValue( const SfxItemPropertyMapEntry* pEntry,
972 const css::uno::Any& aValue ) override;
973
974public:
975 ScTableColumnObj(ScDocShell* pDocSh, SCCOL nCol, SCTAB nTab);
976 virtual ~ScTableColumnObj() override;
977
978 virtual css::uno::Any SAL_CALL queryInterface(
979 const css::uno::Type & rType ) override;
980 virtual void SAL_CALL acquire() noexcept override;
981 virtual void SAL_CALL release() noexcept override;
982
983 // XNamed
984 virtual OUString SAL_CALL getName() override;
985 virtual void SAL_CALL setName( const OUString& aName ) override;
986
987 // XPropertySet override due to column properties
988 virtual css::uno::Reference< css::beans::XPropertySetInfo >
989 SAL_CALL getPropertySetInfo() override;
990
991 // XServiceInfo
992 virtual OUString SAL_CALL getImplementationName() override;
993 virtual sal_Bool SAL_CALL supportsService( const OUString& ServiceName ) override;
994 virtual css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames() override;
995
996 // XTypeProvider
997 virtual css::uno::Sequence< css::uno::Type > SAL_CALL getTypes() override;
998 virtual css::uno::Sequence< sal_Int8 > SAL_CALL getImplementationId() override;
999};
1000
1001class ScTableRowObj final : public ScCellRangeObj
1002{
1003private:
1005
1006 virtual const SfxItemPropertyMap& GetItemPropertyMap() override;
1007 virtual void GetOnePropertyValue( const SfxItemPropertyMapEntry* pEntry,
1008 css::uno::Any& ) override;
1009 virtual void SetOnePropertyValue( const SfxItemPropertyMapEntry* pEntry,
1010 const css::uno::Any& aValue ) override;
1011
1012public:
1013 ScTableRowObj(ScDocShell* pDocSh, SCROW nRow, SCTAB nTab);
1014 virtual ~ScTableRowObj() override;
1015
1016 // XPropertySet override due to row properties
1017 virtual css::uno::Reference< css::beans::XPropertySetInfo >
1018 SAL_CALL getPropertySetInfo() override;
1019
1020 // XServiceInfo
1021 virtual OUString SAL_CALL getImplementationName() override;
1022 virtual sal_Bool SAL_CALL supportsService( const OUString& ServiceName ) override;
1023 virtual css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames() override;
1024};
1025
1026class ScCellsObj final : public cppu::WeakImplHelper<
1027 css::container::XEnumerationAccess,
1028 css::lang::XServiceInfo >,
1029 public SfxListener
1030{
1031private:
1034
1035public:
1036 ScCellsObj(ScDocShell* pDocSh, ScRangeList aR);
1037 virtual ~ScCellsObj() override;
1038
1039 virtual void Notify( SfxBroadcaster& rBC, const SfxHint& rHint ) override;
1040
1041 // XEnumerationAccess
1042 virtual css::uno::Reference< css::container::XEnumeration > SAL_CALL
1043 createEnumeration() override;
1044
1045 // XElementAccess
1046 virtual css::uno::Type SAL_CALL getElementType() override;
1047 virtual sal_Bool SAL_CALL hasElements() override;
1048
1049 // XServiceInfo
1050 virtual OUString SAL_CALL getImplementationName() override;
1051 virtual sal_Bool SAL_CALL supportsService( const OUString& ServiceName ) override;
1052 virtual css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames() override;
1053};
1054
1055class ScCellsEnumeration final : public cppu::WeakImplHelper<
1056 css::container::XEnumeration,
1057 css::lang::XServiceInfo >,
1058 public SfxListener
1059{
1060private:
1064 std::unique_ptr<ScMarkData> pMark;
1066
1067private:
1068 void Advance_Impl();
1069 void CheckPos_Impl();
1070
1071public:
1073 virtual ~ScCellsEnumeration() override;
1074
1075 virtual void Notify( SfxBroadcaster& rBC, const SfxHint& rHint ) override;
1076
1077 // XEnumeration
1078 virtual sal_Bool SAL_CALL hasMoreElements() override;
1079 virtual css::uno::Any SAL_CALL nextElement() override;
1080
1081 // XServiceInfo
1082 virtual OUString SAL_CALL getImplementationName() override;
1083 virtual sal_Bool SAL_CALL supportsService( const OUString& ServiceName ) override;
1084 virtual css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames() override;
1085};
1086
1087class ScCellFormatsObj final : public cppu::WeakImplHelper<
1088 css::container::XIndexAccess,
1089 css::container::XEnumerationAccess,
1090 css::lang::XServiceInfo >,
1091 public SfxListener
1092{
1093private:
1096
1097private:
1098 rtl::Reference<ScCellRangeObj> GetObjectByIndex_Impl(tools::Long nIndex) const;
1099
1100public:
1101 ScCellFormatsObj(ScDocShell* pDocSh, const ScRange& rR);
1102 virtual ~ScCellFormatsObj() override;
1103
1104 virtual void Notify( SfxBroadcaster& rBC, const SfxHint& rHint ) override;
1105
1106 // XIndexAccess
1107 virtual sal_Int32 SAL_CALL getCount() override;
1108 virtual css::uno::Any SAL_CALL getByIndex( sal_Int32 Index ) override;
1109
1110 // XEnumerationAccess
1111 virtual css::uno::Reference< css::container::XEnumeration > SAL_CALL
1112 createEnumeration() override;
1113
1114 // XElementAccess
1115 virtual css::uno::Type SAL_CALL getElementType() override;
1116 virtual sal_Bool SAL_CALL hasElements() override;
1117
1118 // XServiceInfo
1119 virtual OUString SAL_CALL getImplementationName() override;
1120 virtual sal_Bool SAL_CALL supportsService( const OUString& ServiceName ) override;
1121 virtual css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames() override;
1122};
1123
1124class ScCellFormatsEnumeration final : public cppu::WeakImplHelper<
1125 css::container::XEnumeration,
1126 css::lang::XServiceInfo >,
1127 public SfxListener
1128{
1129private:
1132 std::unique_ptr<ScAttrRectIterator> pIter;
1136
1137private:
1138 void Advance_Impl();
1139 rtl::Reference<ScCellRangeObj> NextObject_Impl();
1140
1141public:
1142 ScCellFormatsEnumeration(ScDocShell* pDocSh, const ScRange& rR);
1143 virtual ~ScCellFormatsEnumeration() override;
1144
1145 virtual void Notify( SfxBroadcaster& rBC, const SfxHint& rHint ) override;
1146
1147 // XEnumeration
1148 virtual sal_Bool SAL_CALL hasMoreElements() override;
1149 virtual css::uno::Any SAL_CALL nextElement() override;
1150
1151 // XServiceInfo
1152 virtual OUString SAL_CALL getImplementationName() override;
1153 virtual sal_Bool SAL_CALL supportsService( const OUString& ServiceName ) override;
1154 virtual css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames() override;
1155};
1156
1157class ScUniqueCellFormatsObj final : public cppu::WeakImplHelper<
1158 css::container::XIndexAccess,
1159 css::container::XEnumerationAccess,
1160 css::lang::XServiceInfo >,
1161 public SfxListener
1162{
1163private:
1165 std::vector<ScRangeList> aRangeLists;
1166
1167public:
1168 ScUniqueCellFormatsObj(ScDocShell* pDocSh, const ScRange& rR);
1169 virtual ~ScUniqueCellFormatsObj() override;
1170
1171 virtual void Notify( SfxBroadcaster& rBC, const SfxHint& rHint ) override;
1172
1173 // XIndexAccess
1174 virtual sal_Int32 SAL_CALL getCount() override;
1175 virtual css::uno::Any SAL_CALL getByIndex( sal_Int32 Index ) override;
1176
1177 // XEnumerationAccess
1178 virtual css::uno::Reference< css::container::XEnumeration > SAL_CALL
1179 createEnumeration() override;
1180
1181 // XElementAccess
1182 virtual css::uno::Type SAL_CALL getElementType() override;
1183 virtual sal_Bool SAL_CALL hasElements() override;
1184
1185 // XServiceInfo
1186 virtual OUString SAL_CALL getImplementationName() override;
1187 virtual sal_Bool SAL_CALL supportsService( const OUString& ServiceName ) override;
1188 virtual css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames() override;
1189};
1190
1191class ScUniqueCellFormatsEnumeration final : public cppu::WeakImplHelper<
1192 css::container::XEnumeration,
1193 css::lang::XServiceInfo >,
1194 public SfxListener
1195{
1196private:
1197 std::vector<ScRangeList> aRangeLists;
1200
1201public:
1202 ScUniqueCellFormatsEnumeration(ScDocShell* pDocShell, std::vector<ScRangeList>&& rRangeLists);
1203 virtual ~ScUniqueCellFormatsEnumeration() override;
1204
1205 virtual void Notify( SfxBroadcaster& rBC, const SfxHint& rHint ) override;
1206
1207 // XEnumeration
1208 virtual sal_Bool SAL_CALL hasMoreElements() override;
1209 virtual css::uno::Any SAL_CALL nextElement() override;
1210
1211 // XServiceInfo
1212 virtual OUString SAL_CALL getImplementationName() override;
1213 virtual sal_Bool SAL_CALL supportsService( const OUString& ServiceName ) override;
1214 virtual css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames() override;
1215};
1216
1217/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
struct _ADOIndex Index
std::vector< css::uno::Reference< css::util::XModifyListener > > XModifyListenerArr_Impl
Definition: cellsuno.hxx:129
std::unique_ptr< ScAttrRectIterator > pIter
Definition: cellsuno.hxx:1132
virtual sal_Bool SAL_CALL supportsService(const OUString &ServiceName) override
virtual css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames() override
virtual OUString SAL_CALL getImplementationName() override
ScRange aTotalRange
Definition: cellsuno.hxx:1095
virtual OUString SAL_CALL getImplementationName() override
virtual sal_Bool SAL_CALL supportsService(const OUString &ServiceName) override
ScDocShell * pDocShell
Definition: cellsuno.hxx:1094
virtual css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames() override
really derive cell from range?
Definition: cellsuno.hxx:640
rtl::Reference< SvxUnoText > mxUnoText
Definition: cellsuno.hxx:642
ScAddress aCellPos
Definition: cellsuno.hxx:644
sal_Int16 nActionLockCount
Definition: cellsuno.hxx:645
const SfxItemPropertySet * pCellPropSet
Definition: cellsuno.hxx:643
const SfxItemPropertySet * pRangePropSet
Definition: cellsuno.hxx:478
const ScRange & GetRange() const
Definition: cellsuno.hxx:482
ScRange aRange
Definition: cellsuno.hxx:479
virtual OUString SAL_CALL getImplementationName() override
virtual css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames() override
virtual sal_Bool SAL_CALL supportsService(const OUString &ServiceName) override
ScDocShell * pDocShell
Definition: cellsuno.hxx:1061
std::unique_ptr< ScMarkData > pMark
Definition: cellsuno.hxx:1064
ScRangeList aRanges
Definition: cellsuno.hxx:1062
ScDocShell * pDocShell
Definition: cellsuno.hxx:1032
virtual OUString SAL_CALL getImplementationName() override
virtual css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames() override
virtual sal_Bool SAL_CALL supportsService(const OUString &ServiceName) override
ScRangeList aRanges
Definition: cellsuno.hxx:1033
static void FillBoxItems(SvxBoxItem &rOuter, SvxBoxInfoItem &rInner, const css::table::TableBorder2 &rBorder)
static void AssignTableBorder2ToAny(css::uno::Any &rAny, const SvxBoxItem &rOuter, const SvxBoxInfoItem &rInner, bool bInvalidateHorVerDist=false)
Definition: cellsuno.cxx:979
static void FillBorderLine(css::table::BorderLine &rStruct, const ::editeng::SvxBorderLine *pLine)
static void ApplyBorder(ScDocShell *pDocShell, const ScRangeList &rRanges, const SvxBoxItem &rOuter, const SvxBoxInfoItem &rInner)
move lcl_ApplyBorder to docfunc !
Definition: cellsuno.cxx:989
static void FillBoxItems(SvxBoxItem &rOuter, SvxBoxInfoItem &rInner, const css::table::TableBorder &rBorder)
static void FillBorderLine(css::table::BorderLine2 &rStruct, const ::editeng::SvxBorderLine *pLine)
static void AssignTableBorderToAny(css::uno::Any &rAny, const SvxBoxItem &rOuter, const SvxBoxInfoItem &rInner, bool bInvalidateHorVerDist=false)
Definition: cellsuno.cxx:971
static const ::editeng::SvxBorderLine * GetBorderLine(::editeng::SvxBorderLine &rLine, const css::table::BorderLine2 &rStruct)
static const ::editeng::SvxBorderLine * GetBorderLine(::editeng::SvxBorderLine &rLine, const css::table::BorderLine &rStruct)
virtual void Notify(const SfxHint &rHint) override
Definition: cellsuno.cxx:837
Link< const SfxHint &, void > aLink
Definition: cellsuno.hxx:122
virtual ~ScLinkListener() override
move ScLinkListener into another file !!!
Definition: cellsuno.cxx:833
ScLinkListener(const Link< const SfxHint &, void > &rL)
Definition: cellsuno.hxx:124
todo: It should be possible to have MarkArrays for each table, in order to enable "search all" across...
Definition: markdata.hxx:43
const SfxItemPropertySet * pColPropSet
Definition: cellsuno.hxx:966
virtual OUString SAL_CALL getImplementationName() override
virtual sal_Bool SAL_CALL supportsService(const OUString &ServiceName) override
const SfxItemPropertySet * pRowPropSet
Definition: cellsuno.hxx:1004
virtual css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames() override
const SfxItemPropertySet * pSheetPropSet
Definition: cellsuno.hxx:789
virtual css::uno::Reference< css::table::XCellRange > SAL_CALL getCellRangeByPosition(sal_Int32 nLeft, sal_Int32 nTop, sal_Int32 nRight, sal_Int32 nBottom, sal_Int32 nSheet) override
Definition: docuno.cxx:3970
virtual css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames() override
virtual css::uno::Reference< css::table::XCell > SAL_CALL getCellByPosition(sal_Int32 nColumn, sal_Int32 nRow, sal_Int32 nSheet) override
XCellRangesAccess.
Definition: docuno.cxx:3960
virtual OUString SAL_CALL getImplementationName() override
XServiceInfo.
virtual sal_Bool SAL_CALL supportsService(const OUString &ServiceName) override
virtual sal_Bool SAL_CALL supportsService(const OUString &ServiceName) override
virtual css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames() override
virtual OUString SAL_CALL getImplementationName() override
std::vector< ScRangeList > aRangeLists
Definition: cellsuno.hxx:1197
virtual sal_Bool SAL_CALL supportsService(const OUString &ServiceName) override
ScDocShell * pDocShell
Definition: cellsuno.hxx:1164
virtual OUString SAL_CALL getImplementationName() override
virtual css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames() override
std::vector< ScRangeList > aRangeLists
Definition: cellsuno.hxx:1165
virtual void Notify(SfxBroadcaster &rBC, const SfxHint &rHint)
class SAL_WARN_UNUSED SAL_LOPLUGIN_ANNOTATE("crosscast") SwContentIndexReg
virtual OUString GetName() const override
OUString aName
void Notify(ScModelObj &rModelObj, const ScRangeList &rChangeRanges, const OUString &rType=OUString("cell-change"), const css::uno::Sequence< css::beans::PropertyValue > &rProperties=css::uno::Sequence< css::beans::PropertyValue >())
Definition: docsh.hxx:498
OUString getString(const Any &_rAny)
css::uno::Sequence< OUString > getSupportedServiceNames()
OUString getImplementationName()
Type
css::uno::Any SAL_CALL queryInterface(const css::uno::Type &rType, Interface1 *p1)
bool CPPUHELPER_DLLPUBLIC supportsService(css::lang::XServiceInfo *implementation, rtl::OUString const &name)
css::beans::Optional< css::uno::Any > getValue(std::u16string_view id)
uno::Any getPropertyValue(const uno::Sequence< beans::PropertyValue > &aProp, const OUString &aName)
bool setPropertyValue(uno::Sequence< beans::PropertyValue > &aProp, const OUString &aName, const uno::Any &aValue)
long Long
bool getType(BSTR name, Type &type)
RegError REGISTRY_CALLTYPE setValue(RegKeyHandle hKey, rtl_uString *keyName, RegValueType valueType, RegValue pData, sal_uInt32 valueSize)
#define SC_DLLPUBLIC
Definition: scdllapi.h:27
unsigned char sal_Bool
signed char sal_Int8
sal_Int16 SCTAB
Definition: types.hxx:22
sal_Int16 SCCOL
Definition: types.hxx:21
sal_Int32 SCROW
Definition: types.hxx:17