LibreOffice Module sw (master) 1
unotbl.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#ifndef INCLUDED_SW_INC_UNOTBL_HXX
21#define INCLUDED_SW_INC_UNOTBL_HXX
22
23#include <com/sun/star/lang/XUnoTunnel.hpp>
24#include <com/sun/star/container/XNamed.hpp>
25#include <com/sun/star/container/XEnumerationAccess.hpp>
26#include <com/sun/star/util/XSortable.hpp>
27#include <com/sun/star/chart/XChartDataArray.hpp>
28#include <com/sun/star/text/XTextTableCursor.hpp>
29#include <com/sun/star/text/XTextTable.hpp>
30#include <com/sun/star/table/XCellRange.hpp>
31#include <com/sun/star/sheet/XCellRangeData.hpp>
32#include <com/sun/star/table/XAutoFormattable.hpp>
33
35
36#include <comphelper/uno3.hxx>
37
38#include <svl/listener.hxx>
39
40#include "TextCursorHelper.hxx"
41#include "unotext.hxx"
42#include "frmfmt.hxx"
43#include "unocrsr.hxx"
44
45class SwTable;
46class SwTableBox;
47class SwTableLine;
48class SwTableCursor;
50
51typedef
52cppu::WeakImplHelper
53<
54 css::table::XCell,
55 css::lang::XServiceInfo,
56 css::beans::XPropertySet,
57 css::container::XEnumerationAccess
58>
60class SwXCell final : public SwXCellBaseClass,
61 public SwXText,
62 public SvtListener
63{
64 friend void sw_setString( SwXCell &rCell, const OUString &rText,
65 bool bKeepNumberFormat );
66 friend void sw_setValue( SwXCell &rCell, double nVal );
67
69 SwTableBox* m_pBox; // only set in non-XML import
70 const SwStartNode* m_pStartNode; // only set in XML import
72
73 // table position where pBox was found last
74 size_t m_nFndPos;
75 css::uno::Reference<css::text::XText> m_xParentText;
76 static size_t const NOTFOUND = SAL_MAX_SIZE;
77
78 virtual const SwStartNode *GetStartNode() const override;
79
80 bool IsValid() const;
81
82 virtual ~SwXCell() override;
83
84 virtual void Notify(const SfxHint&) override;
85
86public:
87 SwXCell(SwFrameFormat* pTableFormat, SwTableBox* pBox, size_t nPos);
88 SwXCell(SwFrameFormat* pTableFormat, const SwStartNode& rStartNode); // XML import interface
89
90 virtual css::uno::Any SAL_CALL queryInterface( const css::uno::Type& aType ) override;
91 virtual void SAL_CALL acquire( ) noexcept override;
92 virtual void SAL_CALL release( ) noexcept override;
93
94 //XTypeProvider
95 virtual css::uno::Sequence< css::uno::Type > SAL_CALL getTypes( ) override;
96 virtual css::uno::Sequence< sal_Int8 > SAL_CALL getImplementationId( ) override;
97
98 //XCell
99 virtual OUString SAL_CALL getFormula( ) override;
100 virtual void SAL_CALL setFormula( const OUString& aFormula ) override;
101 virtual double SAL_CALL getValue( ) override;
103 double getValue( ) const
104 { return const_cast<SwXCell*>(this)->getValue(); };
105 virtual void SAL_CALL setValue( double nValue ) override;
106 virtual css::table::CellContentType SAL_CALL getType( ) override;
107 virtual sal_Int32 SAL_CALL getError( ) override;
108
109 //XText
112 const ::css::uno::Reference< ::css::text::XTextRange >& aTextPosition ) override;
113 virtual void SAL_CALL setString(const OUString& aString) override;
114
115 //XPropertySet
116 virtual css::uno::Reference< css::beans::XPropertySetInfo > SAL_CALL getPropertySetInfo( ) override;
117 virtual void SAL_CALL setPropertyValue( const OUString& aPropertyName, const css::uno::Any& aValue ) override;
118 virtual css::uno::Any SAL_CALL getPropertyValue( const OUString& PropertyName ) override;
119 virtual void SAL_CALL addPropertyChangeListener( const OUString& aPropertyName, const css::uno::Reference< css::beans::XPropertyChangeListener >& xListener ) override;
120 virtual void SAL_CALL removePropertyChangeListener( const OUString& aPropertyName, const css::uno::Reference< css::beans::XPropertyChangeListener >& aListener ) override;
121 virtual void SAL_CALL addVetoableChangeListener( const OUString& PropertyName, const css::uno::Reference< css::beans::XVetoableChangeListener >& aListener ) override;
122 virtual void SAL_CALL removeVetoableChangeListener( const OUString& PropertyName, const css::uno::Reference< css::beans::XVetoableChangeListener >& aListener ) override;
123
124 //XServiceInfo
125 virtual OUString SAL_CALL getImplementationName() override;
126 virtual sal_Bool SAL_CALL supportsService(const OUString& ServiceName) override;
127 virtual css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames() override;
128
129 //XEnumerationAccess - was: XParagraphEnumerationAccess
130 virtual css::uno::Reference< css::container::XEnumeration > SAL_CALL createEnumeration() override;
131
132 //XElementAccess
133 virtual css::uno::Type SAL_CALL getElementType( ) override;
134 virtual sal_Bool SAL_CALL hasElements( ) override;
135
136 SwTableBox* GetTableBox() const { return m_pBox; }
137 static rtl::Reference<SwXCell> CreateXCell(SwFrameFormat* pTableFormat, SwTableBox* pBox, SwTable *pTable = nullptr );
138 SwTableBox* FindBox(SwTable* pTable, SwTableBox* pBox);
140 double GetForcedNumericalValue() const;
141 css::uno::Any GetAny() const;
142};
143
145 : public cppu::WeakImplHelper<css::beans::XPropertySet, css::lang::XServiceInfo>
146 , public SvtListener
147{
151
153 const SwFrameFormat* GetFrameFormat() const { return m_pFormat; }
154 virtual ~SwXTextTableRow() override;
155
156public:
157 SwXTextTableRow(SwFrameFormat* pFormat, SwTableLine* pLine);
158
159
160 //XPropertySet
161 virtual css::uno::Reference< css::beans::XPropertySetInfo > SAL_CALL getPropertySetInfo( ) override;
162 virtual void SAL_CALL setPropertyValue( const OUString& aPropertyName, const css::uno::Any& aValue ) override;
163 virtual css::uno::Any SAL_CALL getPropertyValue( const OUString& PropertyName ) override;
164 virtual void SAL_CALL addPropertyChangeListener( const OUString& aPropertyName, const css::uno::Reference< css::beans::XPropertyChangeListener >& xListener ) override;
165 virtual void SAL_CALL removePropertyChangeListener( const OUString& aPropertyName, const css::uno::Reference< css::beans::XPropertyChangeListener >& aListener ) override;
166 virtual void SAL_CALL addVetoableChangeListener( const OUString& PropertyName, const css::uno::Reference< css::beans::XVetoableChangeListener >& aListener ) override;
167 virtual void SAL_CALL removeVetoableChangeListener( const OUString& PropertyName, const css::uno::Reference< css::beans::XVetoableChangeListener >& aListener ) override;
168
169 //XServiceInfo
170 virtual OUString SAL_CALL getImplementationName() override;
171 virtual sal_Bool SAL_CALL supportsService(const OUString& ServiceName) override;
172 virtual css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames() override;
173
174 static SwTableLine* FindLine(SwTable* pTable, SwTableLine const * pLine);
175
176 void Notify(const SfxHint&) override;
177};
178
179typedef cppu::WeakImplHelper<
180 css::text::XTextTableCursor,
181 css::lang::XServiceInfo,
182 css::beans::XPropertySet> SwXTextTableCursor_Base;
185 , public SvtListener
186 , public OTextCursorHelper
187{
191
192public:
193 SwXTextTableCursor(SwFrameFormat* pFormat, SwTableBox const* pBox);
194 SwXTextTableCursor(SwFrameFormat& rTableFormat, const SwTableCursor* pTableSelection);
195 virtual void SAL_CALL release() noexcept override;
196
197 //XTextTableCursor
198 virtual OUString SAL_CALL getRangeName() override;
199 virtual sal_Bool SAL_CALL gotoCellByName( const OUString& aCellName, sal_Bool bExpand ) override;
200 virtual sal_Bool SAL_CALL goLeft( sal_Int16 nCount, sal_Bool bExpand ) override;
201 virtual sal_Bool SAL_CALL goRight( sal_Int16 nCount, sal_Bool bExpand ) override;
202 virtual sal_Bool SAL_CALL goUp( sal_Int16 nCount, sal_Bool bExpand ) override;
203 virtual sal_Bool SAL_CALL goDown( sal_Int16 nCount, sal_Bool bExpand ) override;
204 virtual void SAL_CALL gotoStart( sal_Bool bExpand ) override;
205 virtual void SAL_CALL gotoEnd( sal_Bool bExpand ) override;
206 virtual sal_Bool SAL_CALL mergeRange() override;
207 virtual sal_Bool SAL_CALL splitRange( sal_Int16 Count, sal_Bool Horizontal ) override;
208
209 //XPropertySet
210 virtual css::uno::Reference< css::beans::XPropertySetInfo > SAL_CALL getPropertySetInfo( ) override;
211 virtual void SAL_CALL setPropertyValue( const OUString& aPropertyName, const css::uno::Any& aValue ) override;
212 virtual css::uno::Any SAL_CALL getPropertyValue( const OUString& PropertyName ) override;
213 virtual void SAL_CALL addPropertyChangeListener( const OUString& aPropertyName, const css::uno::Reference< css::beans::XPropertyChangeListener >& xListener ) override;
214 virtual void SAL_CALL removePropertyChangeListener( const OUString& aPropertyName, const css::uno::Reference< css::beans::XPropertyChangeListener >& aListener ) override;
215 virtual void SAL_CALL addVetoableChangeListener( const OUString& PropertyName, const css::uno::Reference< css::beans::XVetoableChangeListener >& aListener ) override;
216 virtual void SAL_CALL removeVetoableChangeListener( const OUString& PropertyName, const css::uno::Reference< css::beans::XVetoableChangeListener >& aListener ) override;
217
218 //XServiceInfo
219 virtual OUString SAL_CALL getImplementationName() override;
220 virtual sal_Bool SAL_CALL supportsService(const OUString& ServiceName) override;
221 virtual css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames() override;
222
223
224 // ITextCursorHelper
225 virtual const SwPaM* GetPaM() const override;
226 virtual SwPaM* GetPaM() override;
227 virtual const SwDoc* GetDoc() const override;
228 virtual SwDoc* GetDoc() override;
229
230 virtual void Notify( const SfxHint& ) override;
231
232 const SwUnoCursor& GetCursor() const;
233 SwUnoCursor& GetCursor();
234 SwFrameFormat* GetFrameFormat() const { return m_pFrameFormat; }
235};
236
238{
239 sal_Int32 nTop;
240 sal_Int32 nLeft;
241 sal_Int32 nBottom;
242 sal_Int32 nRight;
243
244 void Normalize();
245};
246
247class SW_DLLPUBLIC SwXTextTable final : public cppu::WeakImplHelper
248<
249 css::text::XTextTable,
250 css::lang::XServiceInfo,
251 css::table::XCellRange,
252 css::chart::XChartDataArray,
253 css::beans::XPropertySet,
254 css::container::XNamed,
255 css::table::XAutoFormattable,
256 css::util::XSortable,
257 css::sheet::XCellRangeData
258>
259{
260private:
261 class Impl;
263
264 SwXTextTable();
265 SwXTextTable(SwFrameFormat& rFrameFormat);
266 virtual ~SwXTextTable() override;
267
268public:
270 CreateXTextTable(SwFrameFormat * pFrameFormat);
271
272 static void GetCellPosition(std::u16string_view aCellName, sal_Int32& o_rColumn, sal_Int32& o_rRow);
273
274 SwFrameFormat* GetFrameFormat();
275
276 //XTextTable
277 virtual void SAL_CALL initialize( sal_Int32 nRows, sal_Int32 nColumns ) override;
278 virtual css::uno::Reference< css::table::XTableRows > SAL_CALL getRows( ) override;
279 virtual css::uno::Reference< css::table::XTableColumns > SAL_CALL getColumns( ) override;
280 virtual css::uno::Reference< css::table::XCell > SAL_CALL getCellByName( const OUString& aCellName ) override;
281 virtual css::uno::Sequence< OUString > SAL_CALL getCellNames( ) override;
282 virtual css::uno::Reference< css::text::XTextTableCursor > SAL_CALL createCursorByCellName( const OUString& aCellName ) override;
283
284 //XTextContent
285 virtual void SAL_CALL attach(const css::uno::Reference< css::text::XTextRange > & xTextRange) override;
286 virtual css::uno::Reference< css::text::XTextRange > SAL_CALL getAnchor( ) override;
287
288 //XComponent
289 virtual void SAL_CALL dispose() override;
290 virtual void SAL_CALL addEventListener(const css::uno::Reference< css::lang::XEventListener > & aListener) override;
291 virtual void SAL_CALL removeEventListener(const css::uno::Reference< css::lang::XEventListener > & aListener) override;
292
293 //XCellRange
294 virtual css::uno::Reference< css::table::XCell > SAL_CALL getCellByPosition( sal_Int32 nColumn, sal_Int32 nRow ) override;
295 virtual css::uno::Reference< css::table::XCellRange > SAL_CALL getCellRangeByPosition( sal_Int32 nLeft, sal_Int32 nTop, sal_Int32 nRight, sal_Int32 nBottom ) override;
296 virtual css::uno::Reference< css::table::XCellRange > SAL_CALL getCellRangeByName( const OUString& aRange ) override;
297
298 //XChartDataArray
299 virtual css::uno::Sequence< css::uno::Sequence< double > > SAL_CALL getData( ) override;
300 virtual void SAL_CALL setData( const css::uno::Sequence< css::uno::Sequence< double > >& aData ) override;
301 virtual css::uno::Sequence< OUString > SAL_CALL getRowDescriptions( ) override;
302 virtual void SAL_CALL setRowDescriptions( const css::uno::Sequence< OUString >& aRowDescriptions ) override;
303 virtual css::uno::Sequence< OUString > SAL_CALL getColumnDescriptions( ) override;
304 virtual void SAL_CALL setColumnDescriptions( const css::uno::Sequence< OUString >& aColumnDescriptions ) override;
305
306 //XChartData
307 virtual void SAL_CALL addChartDataChangeEventListener( const css::uno::Reference< css::chart::XChartDataChangeEventListener >& aListener ) override;
308 virtual void SAL_CALL removeChartDataChangeEventListener( const css::uno::Reference< css::chart::XChartDataChangeEventListener >& aListener ) override;
309 virtual double SAL_CALL getNotANumber( ) override;
310 virtual sal_Bool SAL_CALL isNotANumber( double nNumber ) override;
311
312 //XSortable
313 virtual css::uno::Sequence< css::beans::PropertyValue > SAL_CALL createSortDescriptor() override;
314 virtual void SAL_CALL sort(const css::uno::Sequence< css::beans::PropertyValue >& xDescriptor) override;
315
316 //XAutoFormattable
317 virtual void SAL_CALL autoFormat(const OUString& aName) override;
318
319 //XPropertySet
320 virtual css::uno::Reference< css::beans::XPropertySetInfo > SAL_CALL getPropertySetInfo( ) override;
321 virtual void SAL_CALL setPropertyValue( const OUString& aPropertyName, const css::uno::Any& aValue ) override;
322 virtual css::uno::Any SAL_CALL getPropertyValue( const OUString& PropertyName ) override;
323 virtual void SAL_CALL addPropertyChangeListener( const OUString& aPropertyName, const css::uno::Reference< css::beans::XPropertyChangeListener >& xListener ) override;
324 virtual void SAL_CALL removePropertyChangeListener( const OUString& aPropertyName, const css::uno::Reference< css::beans::XPropertyChangeListener >& aListener ) override;
325 virtual void SAL_CALL addVetoableChangeListener( const OUString& PropertyName, const css::uno::Reference< css::beans::XVetoableChangeListener >& aListener ) override;
326 virtual void SAL_CALL removeVetoableChangeListener( const OUString& PropertyName, const css::uno::Reference< css::beans::XVetoableChangeListener >& aListener ) override;
327
328 //XNamed
329 virtual OUString SAL_CALL getName() override;
330 virtual void SAL_CALL setName(const OUString& Name_) override;
331
332 //XCellRangeData
333 virtual css::uno::Sequence< css::uno::Sequence< css::uno::Any > > SAL_CALL getDataArray( ) override;
334 virtual void SAL_CALL setDataArray( const css::uno::Sequence< css::uno::Sequence< css::uno::Any > >& aArray ) override;
335
336 //XServiceInfo
337 virtual OUString SAL_CALL getImplementationName() override;
338 virtual sal_Bool SAL_CALL supportsService(const OUString& ServiceName) override;
339 virtual css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames() override;
340
341};
342
343class SwXCellRange final : public cppu::WeakImplHelper
344<
345 css::table::XCellRange,
346 css::lang::XServiceInfo,
347 css::beans::XPropertySet,
348 css::chart::XChartDataArray,
349 css::util::XSortable,
350 css::sheet::XCellRangeData
351>
352{
353private:
354 class Impl;
356
357 SwXCellRange(const sw::UnoCursorPointer& pCursor, SwFrameFormat& rFrameFormat, SwRangeDescriptor const & rDesc);
358 virtual ~SwXCellRange() override;
359
360public:
361 static ::rtl::Reference<SwXCellRange> CreateXCellRange(
362 const sw::UnoCursorPointer& pCursor, SwFrameFormat& rFrameFormat,
363 SwRangeDescriptor const & rDesc);
364
365 void SetLabels(bool bFirstRowAsLabel, bool bFirstColumnAsLabel);
366
367 std::vector<css::uno::Reference<css::table::XCell>> GetCells();
368
369 const SwUnoCursor* GetTableCursor() const;
370
371 //XCellRange
372 virtual css::uno::Reference< css::table::XCell > SAL_CALL getCellByPosition( sal_Int32 nColumn, sal_Int32 nRow ) override;
373 virtual css::uno::Reference< css::table::XCellRange > SAL_CALL getCellRangeByPosition( sal_Int32 nLeft, sal_Int32 nTop, sal_Int32 nRight, sal_Int32 nBottom ) override;
374 virtual css::uno::Reference< css::table::XCellRange > SAL_CALL getCellRangeByName( const OUString& aRange ) override;
375
376 //XPropertySet
377 virtual css::uno::Reference< css::beans::XPropertySetInfo > SAL_CALL getPropertySetInfo( ) override;
378 virtual void SAL_CALL setPropertyValue(const OUString& aPropertyName, const css::uno::Any& aValue) override;
379 virtual css::uno::Any SAL_CALL getPropertyValue(const OUString& PropertyName) override;
380 virtual void SAL_CALL addPropertyChangeListener( const OUString& aPropertyName, const css::uno::Reference< css::beans::XPropertyChangeListener >& xListener ) override;
381 virtual void SAL_CALL removePropertyChangeListener( const OUString& aPropertyName, const css::uno::Reference< css::beans::XPropertyChangeListener >& aListener ) override;
382 virtual void SAL_CALL addVetoableChangeListener( const OUString& PropertyName, const css::uno::Reference< css::beans::XVetoableChangeListener >& aListener ) override;
383 virtual void SAL_CALL removeVetoableChangeListener( const OUString& PropertyName, const css::uno::Reference< css::beans::XVetoableChangeListener >& aListener ) override;
384
385 //XChartData
386 virtual void SAL_CALL addChartDataChangeEventListener( const css::uno::Reference< css::chart::XChartDataChangeEventListener >& aListener ) override;
387 virtual void SAL_CALL removeChartDataChangeEventListener( const css::uno::Reference< css::chart::XChartDataChangeEventListener >& aListener ) override;
388 virtual double SAL_CALL getNotANumber( ) override;
389 virtual sal_Bool SAL_CALL isNotANumber( double nNumber ) override;
390
391 //XChartDataArray
392 virtual css::uno::Sequence< css::uno::Sequence< double > > SAL_CALL getData( ) override;
393 virtual void SAL_CALL setData( const css::uno::Sequence< css::uno::Sequence< double > >& aData ) override;
394 virtual css::uno::Sequence< OUString > SAL_CALL getRowDescriptions( ) override;
395 virtual void SAL_CALL setRowDescriptions( const css::uno::Sequence< OUString >& aRowDescriptions ) override;
396 virtual css::uno::Sequence< OUString > SAL_CALL getColumnDescriptions( ) override;
397 virtual void SAL_CALL setColumnDescriptions( const css::uno::Sequence< OUString >& aColumnDescriptions ) override;
398
399 //XSortable
400 virtual css::uno::Sequence< css::beans::PropertyValue > SAL_CALL createSortDescriptor() override;
401 virtual void SAL_CALL sort(const css::uno::Sequence< css::beans::PropertyValue >& xDescriptor) override;
402
403 //XCellRangeData
404 virtual css::uno::Sequence< css::uno::Sequence< css::uno::Any > > SAL_CALL getDataArray( ) override;
405 virtual void SAL_CALL setDataArray( const css::uno::Sequence< css::uno::Sequence< css::uno::Any > >& aArray ) override;
406
407 //XServiceInfo
408 virtual OUString SAL_CALL getImplementationName() override;
409 virtual sal_Bool SAL_CALL supportsService(const OUString& ServiceName) override;
410 virtual css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames() override;
411
412};
413
415class SwXTableRows final : public cppu::WeakImplHelper
416<
417 css::table::XTableRows,
418 css::lang::XServiceInfo
419>
420{
421 class Impl;
424 const SwFrameFormat* GetFrameFormat() const { return const_cast<SwXTableRows*>(this)->GetFrameFormat(); }
425 virtual ~SwXTableRows() override;
426
427public:
428 SwXTableRows(SwFrameFormat& rFrameFormat);
429
430 //XIndexAccess
431 virtual sal_Int32 SAL_CALL getCount() override;
432 virtual css::uno::Any SAL_CALL getByIndex(sal_Int32 nIndex) override;
433
434 //XElementAccess
435 virtual css::uno::Type SAL_CALL getElementType( ) override;
436 virtual sal_Bool SAL_CALL hasElements( ) override;
437
438 //XTableRows
439 virtual void SAL_CALL insertByIndex(sal_Int32 nIndex, sal_Int32 nCount) override;
440 virtual void SAL_CALL removeByIndex(sal_Int32 nIndex, sal_Int32 nCount) override;
441
442 //XServiceInfo
443 virtual OUString SAL_CALL getImplementationName() override;
444 virtual sal_Bool SAL_CALL supportsService(const OUString& ServiceName) override;
445 virtual css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames() override;
446};
447
448class SwXTableColumns final : public cppu::WeakImplHelper
449<
450 css::table::XTableColumns,
451 css::lang::XServiceInfo
452>
453{
454private:
455 class Impl;
458
459 virtual ~SwXTableColumns() override;
460public:
461 SwXTableColumns(SwFrameFormat& rFrameFormat);
462
463
464 //XIndexAccess
465 virtual sal_Int32 SAL_CALL getCount() override;
466 virtual css::uno::Any SAL_CALL getByIndex(sal_Int32 nIndex) override;
467
468 //XElementAccess
469 virtual css::uno::Type SAL_CALL getElementType( ) override;
470 virtual sal_Bool SAL_CALL hasElements( ) override;
471
472 //XTableColumns
473 virtual void SAL_CALL insertByIndex(sal_Int32 nIndex, sal_Int32 nCount) override;
474 virtual void SAL_CALL removeByIndex(sal_Int32 nIndex, sal_Int32 nCount) override;
475
476 //XServiceInfo
477 virtual OUString SAL_CALL getImplementationName() override;
478 virtual sal_Bool SAL_CALL supportsService(const OUString& ServiceName) override;
479 virtual css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames() override;
480};
481
483 std::u16string_view aRange1StartCell, std::u16string_view aRange1EndCell,
484 std::u16string_view aRange2StartCell, std::u16string_view aRange2EndCell,
485 bool bCmpColsFirst );
486
487void sw_NormalizeRange( OUString &rCell1, OUString &rCell2 );
488
489OUString sw_GetCellName( sal_Int32 nColumn, sal_Int32 nRow );
490
491int sw_CompareCellsByColFirst( std::u16string_view aCellName1, std::u16string_view aCellName2 );
492
493int sw_CompareCellsByRowFirst( std::u16string_view aCellName1, std::u16string_view aCellName2 );
494
495#endif
496
497/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
Definition: doc.hxx:197
Style of a layout element.
Definition: frmfmt.hxx:72
PaM is Point and Mark: a selection of the document model.
Definition: pam.hxx:188
Starts a section of nodes in the document model.
Definition: node.hxx:348
SwTableBox is one table cell in the document model.
Definition: swtable.hxx:443
SwTableLine is one table row in the document model.
Definition: swtable.hxx:376
SwTable is one table in the document model, containing rows (which contain cells).
Definition: swtable.hxx:113
virtual void SAL_CALL sort(const css::uno::Sequence< css::beans::PropertyValue > &xDescriptor) override
Definition: unotbl.cxx:3739
::sw::UnoImplPtr< Impl > m_pImpl
Definition: unotbl.hxx:354
virtual OUString SAL_CALL getImplementationName() override
Definition: unotbl.cxx:3127
virtual css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames() override
Definition: unotbl.cxx:3133
virtual sal_Bool SAL_CALL supportsService(const OUString &ServiceName) override
Definition: unotbl.cxx:3130
virtual css::uno::Sequence< OUString > SAL_CALL getColumnDescriptions() override
Definition: unotbl.cxx:3672
virtual void SAL_CALL setRowDescriptions(const css::uno::Sequence< OUString > &aRowDescriptions) override
Definition: unotbl.cxx:3699
virtual css::uno::Sequence< css::uno::Sequence< double > > SAL_CALL getData() override
Definition: unotbl.cxx:3565
virtual css::uno::Sequence< css::beans::PropertyValue > SAL_CALL createSortDescriptor() override
Definition: unotbl.cxx:3733
virtual void SAL_CALL setColumnDescriptions(const css::uno::Sequence< OUString > &aColumnDescriptions) override
Definition: unotbl.cxx:3705
virtual css::uno::Reference< css::table::XCell > SAL_CALL getCellByPosition(sal_Int32 nColumn, sal_Int32 nRow) override
Definition: unotbl.cxx:3185
virtual double SAL_CALL getNotANumber() override
Definition: unotbl.cxx:3730
std::vector< css::uno::Reference< css::table::XCell > > GetCells()
Definition: unotbl.cxx:3171
virtual void SAL_CALL removePropertyChangeListener(const OUString &aPropertyName, const css::uno::Reference< css::beans::XPropertyChangeListener > &aListener) override
Definition: unotbl.cxx:3493
static ::rtl::Reference< SwXCellRange > CreateXCellRange(const sw::UnoCursorPointer &pCursor, SwFrameFormat &rFrameFormat, SwRangeDescriptor const &rDesc)
Definition: unotbl.cxx:3155
virtual ~SwXCellRange() override
Definition: unotbl.cxx:3151
virtual css::uno::Reference< css::beans::XPropertySetInfo > SAL_CALL getPropertySetInfo() override
Definition: unotbl.cxx:3281
virtual css::uno::Reference< css::table::XCellRange > SAL_CALL getCellRangeByPosition(sal_Int32 nLeft, sal_Int32 nTop, sal_Int32 nRight, sal_Int32 nBottom) override
Definition: unotbl.cxx:3208
void SetLabels(bool bFirstRowAsLabel, bool bFirstColumnAsLabel)
Definition: unotbl.cxx:3165
virtual sal_Bool SAL_CALL isNotANumber(double nNumber) override
Definition: unotbl.cxx:3727
virtual void SAL_CALL addPropertyChangeListener(const OUString &aPropertyName, const css::uno::Reference< css::beans::XPropertyChangeListener > &xListener) override
Definition: unotbl.cxx:3490
virtual void SAL_CALL setPropertyValue(const OUString &aPropertyName, const css::uno::Any &aValue) override
Definition: unotbl.cxx:3288
virtual css::uno::Any SAL_CALL getPropertyValue(const OUString &PropertyName) override
Definition: unotbl.cxx:3408
const SwUnoCursor * GetTableCursor() const
Definition: unotbl.cxx:3763
SwXCellRange(const sw::UnoCursorPointer &pCursor, SwFrameFormat &rFrameFormat, SwRangeDescriptor const &rDesc)
Definition: unotbl.cxx:3145
virtual css::uno::Reference< css::table::XCellRange > SAL_CALL getCellRangeByName(const OUString &aRange) override
Definition: unotbl.cxx:3261
virtual void SAL_CALL addVetoableChangeListener(const OUString &PropertyName, const css::uno::Reference< css::beans::XVetoableChangeListener > &aListener) override
Definition: unotbl.cxx:3496
virtual void SAL_CALL setDataArray(const css::uno::Sequence< css::uno::Sequence< css::uno::Any > > &aArray) override
Definition: unotbl.cxx:3530
virtual void SAL_CALL removeChartDataChangeEventListener(const css::uno::Reference< css::chart::XChartDataChangeEventListener > &aListener) override
Definition: unotbl.cxx:3719
virtual void SAL_CALL addChartDataChangeEventListener(const css::uno::Reference< css::chart::XChartDataChangeEventListener > &aListener) override
Definition: unotbl.cxx:3711
virtual void SAL_CALL setData(const css::uno::Sequence< css::uno::Sequence< double > > &aData) override
Definition: unotbl.cxx:3598
virtual css::uno::Sequence< css::uno::Sequence< css::uno::Any > > SAL_CALL getDataArray() override
Definition: unotbl.cxx:3503
virtual void SAL_CALL removeVetoableChangeListener(const OUString &PropertyName, const css::uno::Reference< css::beans::XVetoableChangeListener > &aListener) override
Definition: unotbl.cxx:3499
virtual css::uno::Sequence< OUString > SAL_CALL getRowDescriptions() override
Definition: unotbl.cxx:3667
virtual double SAL_CALL getValue() override
Definition: unotbl.cxx:852
virtual sal_Int32 SAL_CALL getError() override
Definition: unotbl.cxx:891
virtual const SwStartNode * GetStartNode() const override
Definition: unotbl.cxx:778
css::uno::Reference< css::text::XText > m_xParentText
Definition: unotbl.hxx:75
virtual css::uno::Reference< css::beans::XPropertySetInfo > SAL_CALL getPropertySetInfo() override
Definition: unotbl.cxx:927
virtual void SAL_CALL acquire() noexcept override
Definition: unotbl.cxx:758
double GetForcedNumericalValue() const
Definition: unotbl.cxx:1152
virtual css::uno::Sequence< css::uno::Type > SAL_CALL getTypes() override
Definition: unotbl.cxx:745
virtual OUString SAL_CALL getImplementationName() override
Definition: unotbl.cxx:1203
css::uno::Any GetAny() const
Definition: unotbl.cxx:1193
virtual css::uno::Type SAL_CALL getElementType() override
Definition: unotbl.cxx:1088
virtual css::uno::Sequence< sal_Int8 > SAL_CALL getImplementationId() override
Definition: unotbl.cxx:753
SwTableBox * FindBox(SwTable *pTable, SwTableBox *pBox)
search if a box exists in a table
Definition: unotbl.cxx:1132
virtual void SAL_CALL setString(const OUString &aString) override
Definition: unotbl.cxx:885
friend void sw_setValue(SwXCell &rCell, double nVal)
Definition: unotbl.cxx:686
bool IsValid() const
Definition: unotbl.cxx:788
virtual rtl::Reference< SwXTextCursor > createXTextCursor() override
Definition: unotbl.cxx:898
virtual ~SwXCell() override
Definition: unotbl.cxx:739
virtual void SAL_CALL addPropertyChangeListener(const OUString &aPropertyName, const css::uno::Reference< css::beans::XPropertyChangeListener > &xListener) override
Definition: unotbl.cxx:1062
virtual void SAL_CALL setPropertyValue(const OUString &aPropertyName, const css::uno::Any &aValue) override
Definition: unotbl.cxx:933
virtual void SAL_CALL removeVetoableChangeListener(const OUString &PropertyName, const css::uno::Reference< css::beans::XVetoableChangeListener > &aListener) override
Definition: unotbl.cxx:1071
SwTableBox * GetTableBox() const
Definition: unotbl.hxx:136
virtual void Notify(const SfxHint &) override
Definition: unotbl.cxx:1098
size_t m_nFndPos
Definition: unotbl.hxx:74
virtual void SAL_CALL setValue(double nValue) override
Definition: unotbl.cxx:861
virtual void SAL_CALL removePropertyChangeListener(const OUString &aPropertyName, const css::uno::Reference< css::beans::XPropertyChangeListener > &aListener) override
Definition: unotbl.cxx:1065
virtual OUString SAL_CALL getFormula() override
Definition: unotbl.cxx:810
const SwStartNode * m_pStartNode
Definition: unotbl.hxx:70
SwFrameFormat * m_pTableFormat
Definition: unotbl.hxx:71
virtual css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames() override
Definition: unotbl.cxx:1209
virtual rtl::Reference< SwXTextCursor > createXTextCursorByRange(const ::css::uno::Reference< ::css::text::XTextRange > &aTextPosition) override
Definition: unotbl.cxx:911
virtual void SAL_CALL setFormula(const OUString &aFormula) override
Definition: unotbl.cxx:822
friend void sw_setString(SwXCell &rCell, const OUString &rText, bool bKeepNumberFormat)
Definition: unotbl.cxx:668
virtual sal_Bool SAL_CALL hasElements() override
Definition: unotbl.cxx:1093
virtual css::uno::Any SAL_CALL getPropertyValue(const OUString &PropertyName) override
Definition: unotbl.cxx:999
virtual css::uno::Reference< css::container::XEnumeration > SAL_CALL createEnumeration() override
Definition: unotbl.cxx:1074
virtual void SAL_CALL addVetoableChangeListener(const OUString &PropertyName, const css::uno::Reference< css::beans::XVetoableChangeListener > &aListener) override
Definition: unotbl.cxx:1068
SwFrameFormat * GetFrameFormat() const
Definition: unotbl.hxx:139
static rtl::Reference< SwXCell > CreateXCell(SwFrameFormat *pTableFormat, SwTableBox *pBox, SwTable *pTable=nullptr)
Definition: unotbl.cxx:1111
virtual void SAL_CALL release() noexcept override
Definition: unotbl.cxx:763
virtual css::uno::Any SAL_CALL queryInterface(const css::uno::Type &aType) override
Definition: unotbl.cxx:770
static size_t const NOTFOUND
Definition: unotbl.hxx:76
const SfxItemPropertySet * m_pPropSet
Definition: unotbl.hxx:68
SwTableBox * m_pBox
Definition: unotbl.hxx:69
virtual sal_Bool SAL_CALL supportsService(const OUString &ServiceName) override
Definition: unotbl.cxx:1206
SwXCell(SwFrameFormat *pTableFormat, SwTableBox *pBox, size_t nPos)
Definition: unotbl.cxx:717
virtual css::table::CellContentType SAL_CALL getType() override
Definition: unotbl.cxx:867
virtual ~SwXTableColumns() override
Definition: unotbl.cxx:3990
virtual OUString SAL_CALL getImplementationName() override
Definition: unotbl.cxx:3976
virtual sal_Bool SAL_CALL hasElements() override
Definition: unotbl.cxx:4023
virtual sal_Int32 SAL_CALL getCount() override
Definition: unotbl.cxx:3998
SwXTableColumns(SwFrameFormat &rFrameFormat)
Definition: unotbl.cxx:3986
virtual void SAL_CALL insertByIndex(sal_Int32 nIndex, sal_Int32 nCount) override
Definition: unotbl.cxx:4031
::sw::UnoImplPtr< Impl > m_pImpl
Definition: unotbl.hxx:455
SwFrameFormat * GetFrameFormat() const
Definition: unotbl.cxx:3993
virtual void SAL_CALL removeByIndex(sal_Int32 nIndex, sal_Int32 nCount) override
Definition: unotbl.cxx:4070
virtual sal_Bool SAL_CALL supportsService(const OUString &ServiceName) override
Definition: unotbl.cxx:3979
virtual css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames() override
Definition: unotbl.cxx:3982
virtual css::uno::Type SAL_CALL getElementType() override
Definition: unotbl.cxx:4018
virtual css::uno::Any SAL_CALL getByIndex(sal_Int32 nIndex) override
Definition: unotbl.cxx:4010
UNO API wrapper for SwTableLines.
Definition: unotbl.hxx:420
SwXTableRows(SwFrameFormat &rFrameFormat)
Definition: unotbl.cxx:3818
SwFrameFormat * GetFrameFormat()
Definition: unotbl.cxx:3825
virtual ~SwXTableRows() override
Definition: unotbl.cxx:3822
virtual void SAL_CALL removeByIndex(sal_Int32 nIndex, sal_Int32 nCount) override
Definition: unotbl.cxx:3913
virtual css::uno::Type SAL_CALL getElementType() override
Definition: unotbl.cxx:3859
const SwFrameFormat * GetFrameFormat() const
Definition: unotbl.hxx:424
virtual sal_Int32 SAL_CALL getCount() override
Definition: unotbl.cxx:3830
virtual css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames() override
Definition: unotbl.cxx:3814
virtual css::uno::Any SAL_CALL getByIndex(sal_Int32 nIndex) override
Definition: unotbl.cxx:3841
virtual OUString SAL_CALL getImplementationName() override
Definition: unotbl.cxx:3808
virtual void SAL_CALL insertByIndex(sal_Int32 nIndex, sal_Int32 nCount) override
Definition: unotbl.cxx:3874
virtual sal_Bool SAL_CALL supportsService(const OUString &ServiceName) override
Definition: unotbl.cxx:3811
virtual sal_Bool SAL_CALL hasElements() override
Definition: unotbl.cxx:3864
::sw::UnoImplPtr< Impl > m_pImpl
Definition: unotbl.hxx:421
const SfxItemPropertySet * m_pPropSet
Definition: unotbl.hxx:189
SwFrameFormat * m_pFrameFormat
Definition: unotbl.hxx:188
sw::UnoCursorPointer m_pUnoCursor
Definition: unotbl.hxx:190
SwXTextTableRow(SwFrameFormat *pFormat, SwTableLine *pLine)
Definition: unotbl.cxx:1222
virtual css::uno::Reference< css::beans::XPropertySetInfo > SAL_CALL getPropertySetInfo() override
Definition: unotbl.cxx:1236
virtual void SAL_CALL addVetoableChangeListener(const OUString &PropertyName, const css::uno::Reference< css::beans::XVetoableChangeListener > &aListener) override
Definition: unotbl.cxx:1370
SwTableLine * m_pLine
Definition: unotbl.hxx:149
virtual sal_Bool SAL_CALL supportsService(const OUString &ServiceName) override
Definition: unotbl.cxx:1215
SwFrameFormat * m_pFormat
Definition: unotbl.hxx:148
virtual css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames() override
Definition: unotbl.cxx:1218
virtual OUString SAL_CALL getImplementationName() override
Definition: unotbl.cxx:1212
virtual css::uno::Any SAL_CALL getPropertyValue(const OUString &PropertyName) override
Definition: unotbl.cxx:1319
virtual ~SwXTextTableRow() override
Definition: unotbl.cxx:1230
virtual void SAL_CALL setPropertyValue(const OUString &aPropertyName, const css::uno::Any &aValue) override
Definition: unotbl.cxx:1242
const SwFrameFormat * GetFrameFormat() const
Definition: unotbl.hxx:153
virtual void SAL_CALL addPropertyChangeListener(const OUString &aPropertyName, const css::uno::Reference< css::beans::XPropertyChangeListener > &xListener) override
Definition: unotbl.cxx:1364
void Notify(const SfxHint &) override
Definition: unotbl.cxx:1376
virtual void SAL_CALL removeVetoableChangeListener(const OUString &PropertyName, const css::uno::Reference< css::beans::XVetoableChangeListener > &aListener) override
Definition: unotbl.cxx:1373
const SfxItemPropertySet * m_pPropSet
Definition: unotbl.hxx:150
virtual void SAL_CALL removePropertyChangeListener(const OUString &aPropertyName, const css::uno::Reference< css::beans::XPropertyChangeListener > &aListener) override
Definition: unotbl.cxx:1367
SwFrameFormat * GetFrameFormat()
Definition: unotbl.hxx:152
static SwTableLine * FindLine(SwTable *pTable, SwTableLine const *pLine)
Definition: unotbl.cxx:1388
::sw::UnoImplPtr< Impl > m_pImpl
Definition: unotbl.hxx:261
void Notify(SwFlyFrame *pFly, SwPageFrame *pOld, const SwRect &rOld, const SwRect *pOldRect=nullptr)
Notify the background based on the difference between old and new rectangle.
Definition: frmtool.cxx:3254
constexpr OUStringLiteral aData
Definition: ww8scan.hxx:48
css::uno::Sequence< OUString > getSupportedServiceNames()
OUString getImplementationName()
Type
bool CPPUHELPER_DLLPUBLIC supportsService(css::lang::XServiceInfo *implementation, rtl::OUString const &name)
VBAHELPER_DLLPUBLIC bool setPropertyValue(css::uno::Sequence< css::beans::PropertyValue > &aProp, const OUString &aName, const css::uno::Any &aValue)
bool getPropertyValue(ValueType &rValue, css::uno::Reference< css::beans::XPropertySet > const &xPropSet, OUString const &propName)
std::unique_ptr< T, UnoImplPtrDeleter< T > > UnoImplPtr
Smart pointer class ensuring that the pointed object is deleted with a locked SolarMutex.
sal_Int32 nLeft
Definition: unotbl.hxx:240
sal_Int32 nBottom
Definition: unotbl.hxx:241
void Normalize()
Definition: unotbl.cxx:537
sal_Int32 nTop
Definition: unotbl.hxx:239
sal_Int32 nRight
Definition: unotbl.hxx:242
#define SW_DLLPUBLIC
Definition: swdllapi.h:28
unsigned char sal_Bool
signed char sal_Int8
cppu::WeakImplHelper< css::text::XTextTableCursor, css::lang::XServiceInfo, css::beans::XPropertySet > SwXTextTableCursor_Base
Definition: unotbl.hxx:182
void sw_NormalizeRange(OUString &rCell1, OUString &rCell2)
cleanup order in a range
Definition: unotbl.cxx:525
int sw_CompareCellsByColFirst(std::u16string_view aCellName1, std::u16string_view aCellName2)
compare position of two cells (check columns first)
Definition: unotbl.cxx:427
int sw_CompareCellsByRowFirst(std::u16string_view aCellName1, std::u16string_view aCellName2)
compare position of two cells (check rows first)
Definition: unotbl.cxx:404
cppu::WeakImplHelper< css::table::XCell, css::lang::XServiceInfo, css::beans::XPropertySet, css::container::XEnumerationAccess > SwXCellBaseClass
Definition: unotbl.hxx:49
OUString sw_GetCellName(sal_Int32 nColumn, sal_Int32 nRow)
get cell name at a specified coordinate
Definition: unotbl.cxx:480
int sw_CompareCellRanges(std::u16string_view aRange1StartCell, std::u16string_view aRange1EndCell, std::u16string_view aRange2StartCell, std::u16string_view aRange2EndCell, bool bCmpColsFirst)
compare position of two cell ranges
Definition: unotbl.cxx:454