Coverage Report

Created: 2026-08-14 10:22

next uncovered line (L), next uncovered region (R), next uncovered branch (B)
/src/libreoffice/sc/inc/docuno.hxx
Line
Count
Source
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 "address.hxx"
23
24
#include <sal/types.h>
25
#include <sfx2/sfxbasemodel.hxx>
26
#include <svl/lstner.hxx>
27
#include <svx/fmdmod.hxx>
28
#include <com/sun/star/view/XRenderable.hpp>
29
#include <com/sun/star/style/XStyleFamiliesSupplier.hpp>
30
#include <com/sun/star/document/XActionLockable.hpp>
31
#include <com/sun/star/document/XLinkTargetSupplier.hpp>
32
#include <com/sun/star/drawing/XDrawPagesSupplier.hpp>
33
#include <com/sun/star/drawing/XDrawPages.hpp>
34
#include <com/sun/star/sheet/XGoalSeek.hpp>
35
#include <com/sun/star/sheet/XCalculatable.hpp>
36
#include <com/sun/star/sheet/XScenarios.hpp>
37
#include <com/sun/star/sheet/XConsolidatable.hpp>
38
#include <com/sun/star/sheet/XSpreadsheetDocument.hpp>
39
#include <com/sun/star/sheet/XSpreadsheets2.hpp>
40
#include <com/sun/star/sheet/XDocumentAuditing.hpp>
41
#include <com/sun/star/chart2/XDataProviderAccess.hpp>
42
#include <com/sun/star/lang/XServiceInfo.hpp>
43
#include <com/sun/star/util/XProtectable.hpp>
44
#include <com/sun/star/container/XEnumerationAccess.hpp>
45
#include <com/sun/star/table/XTableColumns.hpp>
46
#include <com/sun/star/table/XTableRows.hpp>
47
#include <com/sun/star/sheet/XSheetAnnotations.hpp>
48
#include <com/sun/star/beans/XPropertySet.hpp>
49
#include <com/sun/star/sheet/XCellRangesAccess.hpp>
50
#include <com/sun/star/sheet/opencl/XOpenCLSelection.hpp>
51
#include <com/sun/star/util/XChangesNotifier.hpp>
52
#include <com/sun/star/uno/XAggregation.hpp>
53
#include <cppuhelper/implbase.hxx>
54
#include <comphelper/interfacecontainer3.hxx>
55
#include <svl/itemprop.hxx>
56
#include <vcl/ITiledRenderable.hxx>
57
58
class ScDocShell;
59
class ScAnnotationObj;
60
class ScMarkData;
61
class ScPrintFuncCache;
62
struct ScPrintState;
63
class ScPrintSelectionStatus;
64
class ScTableColumnObj;
65
class ScTableRowObj;
66
class ScTableSheetObj;
67
class ScRangeList;
68
class ScPrintUIOptions;
69
class ScSheetSaveData;
70
struct ScFormatSaveData;
71
class ScTableSheetsObj;
72
class SolarMutexGuard;
73
74
class SAL_DLLPUBLIC_RTTI ScModelObj : public SfxBaseModel,
75
                    public vcl::ITiledRenderable,
76
                    public css::sheet::XSpreadsheetDocument,
77
                    public css::document::XActionLockable,
78
                    public css::sheet::XCalculatable,
79
                    public css::util::XProtectable,
80
                    public css::drawing::XDrawPagesSupplier,
81
                    public css::sheet::XGoalSeek,
82
                    public css::sheet::XConsolidatable,
83
                    public css::sheet::XDocumentAuditing,
84
                    public css::style::XStyleFamiliesSupplier,
85
                    public css::view::XRenderable,
86
                    public css::document::XLinkTargetSupplier,
87
                    public css::beans::XPropertySet,
88
                    public SvxFmMSFactory,  ///< derived from XMultiServiceFactory
89
                    public css::lang::XServiceInfo,
90
                    public css::util::XChangesNotifier,
91
                    public css::chart2::XDataProviderAccess,
92
                    public css::sheet::opencl::XOpenCLSelection
93
{
94
private:
95
    SfxItemPropertySet      aPropSet;
96
    ScDocShell*             pDocShell;
97
    std::unique_ptr<ScPrintFuncCache> pPrintFuncCache;
98
    std::unique_ptr<ScPrintUIOptions> pPrinterOptions;
99
    std::unique_ptr<ScPrintState> m_pPrintState;
100
    css::uno::Reference<css::uno::XAggregation> xNumberAgg;
101
    css::uno::Reference<css::uno::XInterface> xDrawGradTab;
102
    css::uno::Reference<css::uno::XInterface> xDrawHatchTab;
103
    css::uno::Reference<css::uno::XInterface> xDrawBitmapTab;
104
    css::uno::Reference<css::uno::XInterface> xDrawTrGradTab;
105
    css::uno::Reference<css::uno::XInterface> xDrawMarkerTab;
106
    css::uno::Reference<css::uno::XInterface> xDrawDashTab;
107
    css::uno::Reference<css::uno::XInterface> xChartDataProv;
108
    css::uno::Reference<css::uno::XInterface> xObjProvider;
109
110
    ::comphelper::OInterfaceContainerHelper3<css::util::XChangesListener> maChangesListeners;
111
112
    bool                    FillRenderMarkData( const css::uno::Any& aSelection,
113
                                                const css::uno::Sequence< css::beans::PropertyValue >& rOptions,
114
                                                ScMarkData& rMark, ScPrintSelectionStatus& rStatus, OUString& rPagesStr,
115
                                                bool& rbRenderToGraphic ) const;
116
    css::uno::Reference<css::uno::XAggregation> const & GetFormatter();
117
    void                    HandleCalculateEvents();
118
119
    css::uno::Reference<css::uno::XInterface> create(
120
        OUString const & aServiceSpecifier,
121
        css::uno::Sequence<css::uno::Any> const * arguments);
122
123
0
    static bool             IsOnEvenPage( sal_Int32 nPage ) { return nPage % 2 == 0; };
124
125
    OUString                maBuildId;
126
    std::vector<sal_Int32>  maValidPages;
127
protected:
128
0
    const SfxItemPropertySet&   GetPropertySet() const { return aPropSet; }
129
130
    /** abstract SdrModel provider */
131
    virtual SdrModel& getSdrModelFromUnoModel() const override;
132
133
public:
134
                            ScModelObj(ScDocShell* pDocSh);
135
    virtual                 ~ScModelObj() override;
136
137
    /// create ScModelObj and set at pDocSh (SetBaseModel)
138
    static void             CreateAndSet(ScDocShell* pDocSh);
139
140
    SC_DLLPUBLIC ScDocument*     GetDocument() const;
141
    SC_DLLPUBLIC SfxObjectShell* GetEmbeddedObject() const;
142
143
    SC_DLLPUBLIC void UpdateAllRowHeights();
144
145
    void                    BeforeXMLLoading();
146
    void                    AfterXMLLoading();
147
    ScSheetSaveData*        GetSheetSaveData();
148
    ScFormatSaveData*       GetFormatSaveData();
149
150
    void                    RepaintRange( const ScRange& rRange );
151
    void                    RepaintRange( const ScRangeList& rRange );
152
153
    bool                    HasChangesListeners() const;
154
155
    void                    NotifyChanges( const OUString& rOperation, const ScRangeList& rRanges,
156
                                           const css::uno::Sequence< css::beans::PropertyValue >& rProperties );
157
158
    virtual css::uno::Any SAL_CALL queryInterface( const css::uno::Type & rType ) override;
159
    virtual void SAL_CALL   acquire() noexcept override;
160
    virtual void SAL_CALL   release() noexcept override;
161
162
    virtual void            Notify( SfxBroadcaster& rBC, const SfxHint& rHint ) override;
163
164
                            /// XSpreadsheetDocument
165
    SC_DLLPUBLIC virtual css::uno::Reference< css::sheet::XSpreadsheets > SAL_CALL
166
                            getSheets() override final;
167
    SC_DLLPUBLIC rtl::Reference< ScTableSheetsObj > getScSheets();
168
169
                            /// XDataProviderAccess
170
    virtual ::css::uno::Reference< css::chart2::data::XDataProvider > SAL_CALL
171
                            createDataProvider() override;
172
173
                            /// XStyleFamiliesSupplier
174
    virtual css::uno::Reference< css::container::XNameAccess > SAL_CALL
175
                            getStyleFamilies() override;
176
177
                            /// XRenderable
178
    virtual sal_Int32 SAL_CALL getRendererCount( const css::uno::Any& aSelection,
179
                                    const css::uno::Sequence< css::beans::PropertyValue >& xOptions ) override;
180
    virtual css::uno::Sequence< css::beans::PropertyValue > SAL_CALL
181
                            getRenderer( sal_Int32 nRenderer, const css::uno::Any& aSelection,
182
                                    const css::uno::Sequence< css::beans::PropertyValue >& xOptions ) override;
183
    virtual void SAL_CALL   render( sal_Int32 nRenderer, const css::uno::Any& aSelection,
184
                                    const css::uno::Sequence< css::beans::PropertyValue >& xOptions ) override;
185
186
                            /// XLinkTargetSupplier
187
    virtual css::uno::Reference< css::container::XNameAccess > SAL_CALL
188
                            getLinks() override;
189
190
                            /// XActionLockable
191
    virtual sal_Bool SAL_CALL isActionLocked() override;
192
    virtual void SAL_CALL   addActionLock() override;
193
    virtual void SAL_CALL   removeActionLock() override;
194
    virtual void SAL_CALL   setActionLocks( sal_Int16 nLock ) override;
195
    virtual sal_Int16 SAL_CALL resetActionLocks() override;
196
197
        virtual void SAL_CALL   lockControllers() override;
198
        virtual void SAL_CALL   unlockControllers() override;
199
200
                            /// XCalculatable
201
    virtual void SAL_CALL   calculate() override;
202
    virtual void SAL_CALL   calculateAll() override;
203
    virtual sal_Bool SAL_CALL isAutomaticCalculationEnabled() override;
204
    virtual void SAL_CALL   enableAutomaticCalculation( sal_Bool bEnabled ) override;
205
206
                            /// XProtectable
207
    virtual void SAL_CALL   protect( const OUString& aPassword ) override;
208
    virtual void SAL_CALL   unprotect( const OUString& aPassword ) override;
209
    virtual sal_Bool SAL_CALL isProtected() override;
210
211
                            /// XDrawPagesSupplier
212
    virtual css::uno::Reference< css::drawing::XDrawPages > SAL_CALL
213
                            getDrawPages() override;
214
215
                            /// XGoalSeek
216
    virtual css::sheet::GoalResult SAL_CALL seekGoal(
217
                                const css::table::CellAddress& aFormulaPosition,
218
                                const css::table::CellAddress& aVariablePosition,
219
                                const OUString& aGoalValue ) override;
220
221
                            /// XConsolidatable
222
    virtual css::uno::Reference< css::sheet::XConsolidationDescriptor >
223
                            SAL_CALL createConsolidationDescriptor( sal_Bool bEmpty ) override;
224
    virtual void SAL_CALL consolidate( const css::uno::Reference< css::sheet::XConsolidationDescriptor >& xDescriptor ) override;
225
226
                            /// XDocumentAuditing
227
    virtual void SAL_CALL   refreshArrows() override;
228
229
                            /// XViewDataSupplier
230
    virtual css::uno::Reference< css::container::XIndexAccess > SAL_CALL getViewData(  ) override;
231
232
                            /// XPropertySet
233
    virtual css::uno::Reference< css::beans::XPropertySetInfo >
234
                            SAL_CALL getPropertySetInfo() override;
235
    virtual void SAL_CALL   setPropertyValue( const OUString& aPropertyName,
236
                                    const css::uno::Any& aValue ) override;
237
    virtual css::uno::Any SAL_CALL getPropertyValue( const OUString& PropertyName ) override;
238
    virtual void SAL_CALL   addPropertyChangeListener( const OUString& aPropertyName,
239
                                    const css::uno::Reference< css::beans::XPropertyChangeListener >& xListener ) override;
240
    virtual void SAL_CALL   removePropertyChangeListener( const OUString& aPropertyName,
241
                                    const css::uno::Reference< css::beans::XPropertyChangeListener >& aListener ) override;
242
    virtual void SAL_CALL   addVetoableChangeListener( const OUString& PropertyName,
243
                                    const css::uno::Reference< css::beans::XVetoableChangeListener >& aListener ) override;
244
    virtual void SAL_CALL   removeVetoableChangeListener( const OUString& PropertyName,
245
                                    const css::uno::Reference< css::beans::XVetoableChangeListener >& aListener ) override;
246
247
                            /// XMultiServiceFactory
248
    virtual css::uno::Reference< css::uno::XInterface > SAL_CALL
249
                            createInstance( const OUString& aServiceSpecifier ) override;
250
    virtual css::uno::Reference< css::uno::XInterface > SAL_CALL
251
                            createInstanceWithArguments( const OUString& ServiceSpecifier,
252
                                const css::uno::Sequence< css::uno::Any >& Arguments ) override;
253
    virtual css::uno::Sequence< OUString > SAL_CALL getAvailableServiceNames() override;
254
255
                            /// XServiceInfo
256
    virtual OUString SAL_CALL getImplementationName() override;
257
    virtual sal_Bool SAL_CALL supportsService( const OUString& ServiceName ) override;
258
    virtual css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames() override;
259
260
                            /// XUnoTunnel
261
    virtual sal_Int64 SAL_CALL getSomething( const css::uno::Sequence< sal_Int8 >& aIdentifier ) override;
262
263
    SC_DLLPUBLIC static const css::uno::Sequence<sal_Int8>& getUnoTunnelId();
264
265
                            /// XTypeProvider
266
    virtual css::uno::Sequence< css::uno::Type > SAL_CALL getTypes() override;
267
    virtual css::uno::Sequence< sal_Int8 > SAL_CALL getImplementationId() override;
268
269
                            /// XChangesNotifier
270
    virtual void SAL_CALL addChangesListener( const css::uno::Reference< css::util::XChangesListener >& aListener ) override;
271
    virtual void SAL_CALL removeChangesListener( const css::uno::Reference< css::util::XChangesListener >& aListener ) override;
272
273
    // XOpenCLSelection
274
    virtual sal_Bool SAL_CALL isOpenCLEnabled() override;
275
276
    virtual void SAL_CALL enableOpenCL(sal_Bool bEnable) override;
277
278
    virtual void SAL_CALL enableAutomaticDeviceSelection(sal_Bool bForce) override;
279
280
    virtual void SAL_CALL disableAutomaticDeviceSelection() override;
281
282
    virtual void SAL_CALL selectOpenCLDevice( sal_Int32 platform, sal_Int32 device ) override;
283
284
    virtual sal_Int32 SAL_CALL getPlatformID() override;
285
286
    virtual sal_Int32 SAL_CALL getDeviceID() override;
287
288
    virtual css::uno::Sequence< css::sheet::opencl::OpenCLPlatform >
289
        SAL_CALL getOpenCLPlatforms() override;
290
291
    virtual void SAL_CALL enableOpcodeSubsetTest() override;
292
293
    virtual void SAL_CALL disableOpcodeSubsetTest() override;
294
295
    virtual sal_Bool SAL_CALL isOpcodeSubsetTested() override;
296
297
    virtual void SAL_CALL setFormulaCellNumberLimit( sal_Int32 number ) override;
298
299
    virtual sal_Int32 SAL_CALL getFormulaCellNumberLimit() override;
300
301
    /// @see vcl::ITiledRenderable::paintTile().
302
    virtual void paintTile( VirtualDevice& rDevice,
303
                            int nOutputWidth,
304
                            int nOutputHeight,
305
                            int nTilePosX,
306
                            int nTilePosY,
307
                            tools::Long nTileWidth,
308
                            tools::Long nTileHeight ) override;
309
310
    /// @see vcl::ITiledRenderable::getDocumentSize().
311
    SC_DLLPUBLIC virtual Size getDocumentSize() final override;
312
313
    /// @see vcl::ITiledRenderable::getDataArea().
314
    virtual Size getDataArea(long nPart) override;
315
316
    /// @see vcl::ITiledRenderable::getPrintRanges().
317
    virtual OUString getPrintRanges() override;
318
319
    /// @see vcl::ITiledRenderable::setPart().
320
    virtual void setPart(int nPart, bool bAllowChangeFocus = true) override;
321
322
    /// @see vcl::ITiledRenderable::getPart().
323
    virtual int getPart() override;
324
325
    /// @see vcl::ITiledRenderable::getParts().
326
    virtual int getParts() override;
327
328
    /// @see vcl::ITiledRenderable::getPartInfo().
329
    virtual OUString getPartInfo( int nPart ) override;
330
331
    /// @see vcl::ITiledRenderable::getPartName().
332
    virtual OUString getPartName(int nPart) override;
333
334
    /// @see vcl::ITiledRenderable::getPartHash().
335
    virtual OUString getPartHash( int nPart ) override;
336
337
    /// @see vcl::ITiledRenderable::getDocWindow().
338
    virtual VclPtr<vcl::Window> getDocWindow() override;
339
340
    /// @see vcl::ITiledRenderable::initializeForTiledRendering().
341
    virtual void initializeForTiledRendering(const css::uno::Sequence<css::beans::PropertyValue>& rArguments) override;
342
343
    /// @see vcl::ITiledRenderable::postKeyEvent().
344
    virtual void postKeyEvent(int nType, int nCharCode, int nKeyCode) override;
345
346
    /// @see vcl::ITiledRenderable::postMouseEvent().
347
    virtual void postMouseEvent(int nType, int nX, int nY, int nCount, int nButtons, int nModifier) override;
348
349
    /// @see vcl::ITiledRenderable::setTextSelection().
350
    virtual void setTextSelection(int nType, int nX, int nY) override;
351
352
    /// @see vcl::ITiledRenderable::getSelection().
353
    virtual css::uno::Reference<css::datatransfer::XTransferable> getSelection() override;
354
355
    /// @see vcl::ITiledRenderable::setGraphicSelection().
356
    virtual void setGraphicSelection(int nType, int nX, int nY) override;
357
358
    /// @see lok::Document::resetSelection().
359
    virtual void resetSelection() override;
360
361
    /// @see vcl::ITiledRenderable::setClipboard().
362
    virtual void setClipboard(const css::uno::Reference<css::datatransfer::clipboard::XClipboard>& xClipboard) override;
363
364
    /// @see vcl::ITiledRenderable::isMimeTypeSupported().
365
    virtual bool isMimeTypeSupported() override;
366
367
    /// @see vcl::ITiledRenderable::setClientZoom().
368
    virtual void setClientZoom(int nTilePixelWidth, int nTilePixelHeight, int nTileTwipWidth, int nTileTwipHeight) override;
369
370
    /// @see vcl::ITiledRenderable::setExportZoom().
371
    virtual void setExportZoom(int nExportZoom) override;
372
373
    /// @see vcl::ITiledRenderable::setOutlineState().
374
    virtual void setOutlineState(bool bColumn, int nLevel, int nIndex, bool bHidden) override;
375
376
    /// @see vcl::ITiledRenderable::getRowColumnHeaders().
377
    virtual void getRowColumnHeaders(const tools::Rectangle& rRectangle, tools::JsonWriter& rJsonWriter) override;
378
379
    /// @see vcl::ITiledRenderable::getSheetGeometryData().
380
    virtual OString getSheetGeometryData(bool bColumns, bool bRows, bool bSizes, bool bHidden,
381
                                         bool bFiltered, bool bGroups) override;
382
383
    /// @see vcl::ITiledRenderable::getCellCursor().
384
    virtual void getCellCursor(tools::JsonWriter& rJsonWriter) override;
385
386
    /// @see vcl::ITiledRenderable::getPointer().
387
    virtual PointerStyle getPointer() override;
388
389
    /// @see vcl::ITiledRenderable::getTrackedChanges().
390
    void getTrackedChanges(tools::JsonWriter&) override;
391
392
    /// @see vcl::ITiledRenderable::setClientVisibleArea().
393
    virtual void setClientVisibleArea(const tools::Rectangle& rRectangle) override;
394
395
    /// @see vcl::ITiledRenderable::getPostIts().
396
    void getPostIts(tools::JsonWriter& rJsonWriter) override;
397
398
    /// @see vcl::ITiledRenderable::getPostItsPos().
399
    void getPostItsPos(tools::JsonWriter& rJsonWriter) override;
400
401
    /// @see vcl::ITiledRenderable::completeFunction().
402
    virtual void completeFunction(const OUString& rFunctionName) override;
403
404
    /// @see vcl::ITiledRenderable::getViewRenderState().
405
    OString getViewRenderState(SfxViewShell* pViewShell = nullptr) override;
406
407
private:
408
    Size getDocumentSize(SCCOL& rnTiledRenderingAreaEndCol, SCROW& rnTiledRenderingAreaEndRow );
409
};
410
411
class ScDrawPagesObj final : public cppu::WeakImplHelper<
412
                                css::drawing::XDrawPages,
413
                                css::lang::XServiceInfo>,
414
                        public SfxListener
415
{
416
private:
417
    ScDocShell*             pDocShell;
418
419
css::uno::Reference< css::drawing::XDrawPage >
420
                            GetObjectByIndex_Impl(sal_Int32 nIndex) const;
421
422
public:
423
                            ScDrawPagesObj(ScDocShell* pDocSh);
424
    virtual                 ~ScDrawPagesObj() override;
425
426
    virtual void            Notify( SfxBroadcaster& rBC, const SfxHint& rHint ) override;
427
428
                            /// XDrawPages
429
    virtual css::uno::Reference< css::drawing::XDrawPage > SAL_CALL
430
                            insertNewByIndex( sal_Int32 nIndex ) override;
431
    virtual void SAL_CALL   remove( const css::uno::Reference< css::drawing::XDrawPage >& xPage ) override;
432
433
                            /// XIndexAccess
434
    virtual sal_Int32 SAL_CALL getCount() override;
435
    virtual css::uno::Any SAL_CALL getByIndex( sal_Int32 Index ) override;
436
437
                            /// XElementAccess
438
    virtual css::uno::Type SAL_CALL getElementType() override;
439
    virtual sal_Bool SAL_CALL hasElements() override;
440
441
                            /// XServiceInfo
442
    virtual OUString SAL_CALL getImplementationName() override;
443
    virtual sal_Bool SAL_CALL supportsService( const OUString& ServiceName ) override;
444
    virtual css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames() override;
445
};
446
447
class SC_DLLPUBLIC ScTableSheetsObj final : public cppu::WeakImplHelper<
448
                                css::sheet::XSpreadsheets2,
449
                                css::sheet::XCellRangesAccess,
450
                                css::container::XEnumerationAccess,
451
                                css::container::XIndexAccess,
452
                                css::lang::XServiceInfo>,
453
                         public SfxListener
454
{
455
private:
456
    ScDocShell*             pDocShell;
457
458
    rtl::Reference<ScTableSheetObj> GetObjectByName_Impl(const OUString& aName) const;
459
460
public:
461
                            ScTableSheetsObj(ScDocShell* pDocSh);
462
    virtual                 ~ScTableSheetsObj() override;
463
464
    virtual void            Notify( SfxBroadcaster& rBC, const SfxHint& rHint ) override;
465
466
                            /// XSpreadsheets
467
    virtual void SAL_CALL   insertNewByName( const OUString& aName, sal_Int16 nPosition ) override;
468
    virtual void SAL_CALL   moveByName( const OUString& aName, sal_Int16 nDestination ) override;
469
    virtual void SAL_CALL   copyByName( const OUString& aName,
470
                                const OUString& aCopy, sal_Int16 nDestination ) override;
471
472
                            /// XSpreadsheets2
473
    virtual sal_Int32 SAL_CALL importSheet(
474
        const css::uno::Reference< css::sheet::XSpreadsheetDocument > & xDocSrc,
475
        const OUString& srcName,
476
        sal_Int32 nDestPosition) override;
477
478
                            /// XCellRangesAccess
479
480
    virtual css::uno::Reference< css::table::XCell >
481
        SAL_CALL getCellByPosition( sal_Int32 nColumn, sal_Int32 nRow, sal_Int32 nSheet ) override;
482
483
    virtual css::uno::Reference< css::table::XCellRange >
484
        SAL_CALL getCellRangeByPosition( sal_Int32 nLeft, sal_Int32 nTop, sal_Int32 nRight, sal_Int32 nBottom, sal_Int32 nSheet ) override;
485
486
    virtual css::uno::Sequence < css::uno::Reference< css::table::XCellRange > >
487
        SAL_CALL getCellRangesByName( const OUString& aRange ) override;
488
489
                            /// XNameContainer
490
    virtual void SAL_CALL   insertByName( const OUString& aName,
491
                                const css::uno::Any& aElement ) override;
492
    virtual void SAL_CALL   removeByName( const OUString& Name ) override;
493
494
                            /// XNameReplace
495
    virtual void SAL_CALL   replaceByName( const OUString& aName,
496
                                const css::uno::Any& aElement ) override;
497
498
                            /// XEnumerationAccess
499
    virtual css::uno::Reference< css::container::XEnumeration > SAL_CALL
500
                            createEnumeration() override;
501
502
                            /// XElementAccess
503
    virtual css::uno::Type SAL_CALL getElementType() override;
504
    virtual sal_Bool SAL_CALL hasElements() override;
505
506
                            /// XIndexAccess
507
    virtual sal_Int32 SAL_CALL getCount() override;
508
    virtual css::uno::Any SAL_CALL getByIndex( sal_Int32 Index ) override;
509
510
                            /// XNameAccess
511
    virtual css::uno::Any SAL_CALL getByName( const OUString& aName ) override;
512
    virtual css::uno::Sequence< OUString > SAL_CALL getElementNames() override;
513
    virtual sal_Bool SAL_CALL hasByName( const OUString& aName ) override;
514
515
                            /// XServiceInfo
516
    virtual OUString SAL_CALL getImplementationName() override;
517
    virtual sal_Bool SAL_CALL supportsService( const OUString& ServiceName ) override;
518
    virtual css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames() override;
519
520
    rtl::Reference<ScTableSheetObj> GetSheetByIndex(sal_Int32 nIndex) const;
521
    rtl::Reference<ScTableSheetObj> GetSheetByName(const OUString& rName) const;
522
};
523
524
class SAL_DLLPUBLIC_RTTI ScTableColumnsObj final : public cppu::WeakImplHelper<
525
                                css::table::XTableColumns,
526
                                css::container::XEnumerationAccess,
527
                                css::container::XNameAccess,
528
                                css::beans::XPropertySet,
529
                                css::lang::XServiceInfo>,
530
                          public SfxListener
531
{
532
private:
533
    ScDocShell*             pDocShell;
534
    SCTAB                   nTab;
535
    SCCOL                   nStartCol;
536
    SCCOL                   nEndCol;
537
538
    rtl::Reference<ScTableColumnObj> GetObjectByIndex_Impl(sal_Int32 nIndex) const;
539
    rtl::Reference<ScTableColumnObj> GetObjectByName_Impl(std::u16string_view aName) const;
540
541
public:
542
                            ScTableColumnsObj(ScDocShell* pDocSh, SCTAB nT,
543
                                                SCCOL nSC, SCCOL nEC);
544
    virtual                 ~ScTableColumnsObj() override;
545
546
    virtual void            Notify( SfxBroadcaster& rBC, const SfxHint& rHint ) override;
547
548
                            /// XTableColumns
549
    virtual void SAL_CALL   insertByIndex( sal_Int32 nIndex, sal_Int32 nCount ) override;
550
    virtual void SAL_CALL   removeByIndex( sal_Int32 nIndex, sal_Int32 nCount ) override;
551
552
                            /// XNameAccess
553
    virtual css::uno::Any SAL_CALL getByName( const OUString& aName ) override;
554
    virtual css::uno::Sequence< OUString > SAL_CALL getElementNames() override;
555
    virtual sal_Bool SAL_CALL hasByName( const OUString& aName ) override;
556
557
                            /// XIndexAccess
558
    virtual sal_Int32 SAL_CALL getCount() override;
559
    virtual css::uno::Any SAL_CALL getByIndex( sal_Int32 Index ) override;
560
561
                            /// XEnumerationAccess
562
    virtual css::uno::Reference< css::container::XEnumeration > SAL_CALL
563
                            createEnumeration() override;
564
565
                            /// XElementAccess
566
    virtual css::uno::Type SAL_CALL getElementType() override;
567
    virtual sal_Bool SAL_CALL hasElements() override;
568
569
                            /// XPropertySet
570
    virtual css::uno::Reference< css::beans::XPropertySetInfo >
571
                            SAL_CALL getPropertySetInfo() override;
572
    virtual void SAL_CALL   setPropertyValue( const OUString& aPropertyName,
573
                                    const css::uno::Any& aValue ) override;
574
    virtual css::uno::Any SAL_CALL getPropertyValue(
575
                                    const OUString& PropertyName ) override;
576
    virtual void SAL_CALL   addPropertyChangeListener( const OUString& aPropertyName,
577
                                    const css::uno::Reference< css::beans::XPropertyChangeListener >& xListener ) override;
578
    virtual void SAL_CALL   removePropertyChangeListener( const OUString& aPropertyName,
579
                                    const css::uno::Reference< css::beans::XPropertyChangeListener >& aListener ) override;
580
    virtual void SAL_CALL   addVetoableChangeListener( const OUString& PropertyName,
581
                                    const css::uno::Reference< css::beans::XVetoableChangeListener >& aListener ) override;
582
    virtual void SAL_CALL   removeVetoableChangeListener( const OUString& PropertyName,
583
                                    const css::uno::Reference< css::beans::XVetoableChangeListener >& aListener ) override;
584
585
                            /// XServiceInfo
586
    virtual OUString SAL_CALL getImplementationName() override;
587
    virtual sal_Bool SAL_CALL supportsService( const OUString& ServiceName ) override;
588
    virtual css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames() override;
589
590
    SC_DLLPUBLIC rtl::Reference<ScTableColumnObj> getScTableColumnByIndex( sal_Int32 Index ) const;
591
};
592
593
class SAL_DLLPUBLIC_RTTI ScTableRowsObj final : public cppu::WeakImplHelper<
594
                                css::table::XTableRows,
595
                                css::container::XEnumerationAccess,
596
                                css::beans::XPropertySet,
597
                                css::lang::XServiceInfo>,
598
                          public SfxListener
599
{
600
private:
601
    ScDocShell*             pDocShell;
602
    SCTAB                   nTab;
603
    SCROW                   nStartRow;
604
    SCROW                   nEndRow;
605
606
    rtl::Reference<ScTableRowObj> GetObjectByIndex_Impl(sal_Int32 nIndex) const;
607
608
public:
609
                            ScTableRowsObj(ScDocShell* pDocSh, SCTAB nT,
610
                                                SCROW nSR, SCROW nER);
611
    virtual                 ~ScTableRowsObj() override;
612
613
    virtual void            Notify( SfxBroadcaster& rBC, const SfxHint& rHint ) override;
614
615
                            /// XTableRows
616
    virtual void SAL_CALL   insertByIndex( sal_Int32 nIndex, sal_Int32 nCount ) override;
617
    virtual void SAL_CALL   removeByIndex( sal_Int32 nIndex, sal_Int32 nCount ) override;
618
619
                            /// XIndexAccess
620
    virtual sal_Int32 SAL_CALL getCount() override;
621
    virtual css::uno::Any SAL_CALL getByIndex( sal_Int32 Index ) override;
622
623
                            /// XEnumerationAccess
624
    virtual css::uno::Reference< css::container::XEnumeration > SAL_CALL
625
                            createEnumeration() override;
626
627
                            /// XElementAccess
628
    virtual css::uno::Type SAL_CALL getElementType() override;
629
    virtual sal_Bool SAL_CALL hasElements() override;
630
631
                            /// XPropertySet
632
    virtual css::uno::Reference< css::beans::XPropertySetInfo >
633
                            SAL_CALL getPropertySetInfo() override;
634
    virtual void SAL_CALL   setPropertyValue( const OUString& aPropertyName,
635
                                    const css::uno::Any& aValue ) override;
636
    virtual css::uno::Any SAL_CALL getPropertyValue( const OUString& PropertyName ) override;
637
    virtual void SAL_CALL   addPropertyChangeListener( const OUString& aPropertyName,
638
                                    const css::uno::Reference< css::beans::XPropertyChangeListener >& xListener ) override;
639
    virtual void SAL_CALL   removePropertyChangeListener( const OUString& aPropertyName,
640
                                    const css::uno::Reference< css::beans::XPropertyChangeListener >& aListener ) override;
641
    virtual void SAL_CALL   addVetoableChangeListener( const OUString& PropertyName,
642
                                    const css::uno::Reference< css::beans::XVetoableChangeListener >& aListener ) override;
643
    virtual void SAL_CALL   removeVetoableChangeListener( const OUString& PropertyName,
644
                                    const css::uno::Reference< css::beans::XVetoableChangeListener >& aListener ) override;
645
646
                            /// XServiceInfo
647
    virtual OUString SAL_CALL getImplementationName() override;
648
    virtual sal_Bool SAL_CALL supportsService( const OUString& ServiceName ) override;
649
    virtual css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames() override;
650
651
    void setPropertyValueIsFiltered( SolarMutexGuard& rGuard, bool b );
652
    bool getPropertyValueOHeight( SolarMutexGuard& rGuard );
653
    SC_DLLPUBLIC rtl::Reference<ScTableRowObj> GetTableRowByIndex( sal_Int32 nIndex) const;
654
};
655
656
class ScSpreadsheetSettingsObj final : public cppu::WeakImplHelper<
657
                                    css::beans::XPropertySet,
658
                                    css::lang::XServiceInfo>,
659
                                 public SfxListener
660
{
661
public:
662
    virtual                 ~ScSpreadsheetSettingsObj() override;
663
664
                            /// XPropertySet
665
    virtual css::uno::Reference< css::beans::XPropertySetInfo >
666
                            SAL_CALL getPropertySetInfo() override;
667
    virtual void SAL_CALL   setPropertyValue( const OUString& aPropertyName,
668
                                    const css::uno::Any& aValue ) override;
669
    virtual css::uno::Any SAL_CALL getPropertyValue( const OUString& PropertyName ) override;
670
    virtual void SAL_CALL   addPropertyChangeListener( const OUString& aPropertyName,
671
                                    const css::uno::Reference< css::beans::XPropertyChangeListener >& xListener ) override;
672
    virtual void SAL_CALL   removePropertyChangeListener( const OUString& aPropertyName,
673
                                    const css::uno::Reference< css::beans::XPropertyChangeListener >& aListener ) override;
674
    virtual void SAL_CALL   addVetoableChangeListener( const OUString& PropertyName,
675
                                    const css::uno::Reference< css::beans::XVetoableChangeListener >& aListener ) override;
676
    virtual void SAL_CALL   removeVetoableChangeListener( const OUString& PropertyName,
677
                                    const css::uno::Reference< css::beans::XVetoableChangeListener >& aListener ) override;
678
679
                            /// XServiceInfo
680
    virtual OUString SAL_CALL getImplementationName() override;
681
    virtual sal_Bool SAL_CALL supportsService( const OUString& ServiceName ) override;
682
    virtual css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames() override;
683
};
684
685
class SAL_DLLPUBLIC_RTTI ScAnnotationsObj final : public cppu::WeakImplHelper<
686
                                css::sheet::XSheetAnnotations,
687
                                css::container::XEnumerationAccess,
688
                                css::lang::XServiceInfo>,
689
                          public SfxListener
690
{
691
private:
692
    ScDocShell*             pDocShell;
693
    SCTAB                   nTab;           ///< Collection belongs to the sheet
694
695
    bool                    GetAddressByIndex_Impl( sal_Int32 nIndex, ScAddress& rPos ) const;
696
    rtl::Reference<ScAnnotationObj> GetObjectByIndex_Impl( sal_Int32 nIndex ) const;
697
698
public:
699
                            ScAnnotationsObj(ScDocShell* pDocSh, SCTAB nT);
700
    virtual                 ~ScAnnotationsObj() override;
701
702
    virtual void            Notify( SfxBroadcaster& rBC, const SfxHint& rHint ) override;
703
704
16.6k
    ScDocShell*             GetDocShell() const { return pDocShell; }
705
706
                            /// XSheetAnnotations
707
    virtual void SAL_CALL   insertNew( const css::table::CellAddress& aPosition,
708
                                const OUString& aText ) override;
709
    virtual void SAL_CALL   removeByIndex( sal_Int32 nIndex ) override;
710
711
                            /// XIndexAccess
712
    virtual sal_Int32 SAL_CALL getCount() override;
713
    virtual css::uno::Any SAL_CALL getByIndex( sal_Int32 Index ) override;
714
715
                            /// XEnumerationAccess
716
    virtual css::uno::Reference< css::container::XEnumeration > SAL_CALL
717
                            createEnumeration() override;
718
719
                            /// XElementAccess
720
    virtual css::uno::Type SAL_CALL getElementType() override;
721
    virtual sal_Bool SAL_CALL hasElements() override;
722
723
                            /// XServiceInfo
724
    virtual OUString SAL_CALL getImplementationName() override;
725
    virtual sal_Bool SAL_CALL supportsService( const OUString& ServiceName ) override;
726
    virtual css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames() override;
727
};
728
729
class SAL_DLLPUBLIC_RTTI ScScenariosObj final : public cppu::WeakImplHelper<
730
                                css::sheet::XScenarios,
731
                                css::container::XEnumerationAccess,
732
                                css::container::XIndexAccess,
733
                                css::lang::XServiceInfo>,
734
                          public SfxListener
735
{
736
private:
737
    ScDocShell*             pDocShell;
738
    SCTAB                   nTab;
739
740
    bool                    GetScenarioIndex_Impl( std::u16string_view rName, SCTAB& rIndex );
741
    rtl::Reference<ScTableSheetObj> GetObjectByIndex_Impl(sal_Int32 nIndex);
742
    rtl::Reference<ScTableSheetObj> GetObjectByName_Impl(std::u16string_view aName);
743
744
public:
745
                            ScScenariosObj(ScDocShell* pDocSh, SCTAB nT);
746
    virtual                 ~ScScenariosObj() override;
747
748
    virtual void            Notify( SfxBroadcaster& rBC, const SfxHint& rHint ) override;
749
750
                            /// XScenarios
751
    SC_DLLPUBLIC virtual void SAL_CALL   addNewByName( const OUString& aName,
752
                                const css::uno::Sequence< css::table::CellRangeAddress >& aRanges,
753
                                const OUString& aComment ) override;
754
    virtual void SAL_CALL   removeByName( const OUString& aName ) override;
755
756
                            /// XNameAccess
757
    SC_DLLPUBLIC virtual css::uno::Any SAL_CALL getByName( const OUString& aName ) override;
758
    virtual css::uno::Sequence< OUString > SAL_CALL getElementNames() override;
759
    virtual sal_Bool SAL_CALL hasByName( const OUString& aName ) override;
760
761
                            /// XIndexAccess
762
    virtual sal_Int32 SAL_CALL getCount() override;
763
    virtual css::uno::Any SAL_CALL getByIndex( sal_Int32 Index ) override;
764
765
                            /// XEnumerationAccess
766
    virtual css::uno::Reference< css::container::XEnumeration > SAL_CALL
767
                            createEnumeration() override;
768
769
                            /// XElementAccess
770
    virtual css::uno::Type SAL_CALL getElementType() override;
771
    virtual sal_Bool SAL_CALL hasElements() override;
772
773
                            /// XServiceInfo
774
    virtual OUString SAL_CALL getImplementationName() override;
775
    virtual sal_Bool SAL_CALL supportsService( const OUString& ServiceName ) override;
776
    virtual css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames() override;
777
};
778
779
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */