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 virtual css::uno::Reference< css::text::XTextCursor >
81 CreateCursor() override;
82
83 bool IsValid() const;
84
85 virtual ~SwXCell() override;
86
87 virtual void Notify(const SfxHint&) override;
88
89public:
90 SwXCell(SwFrameFormat* pTableFormat, SwTableBox* pBox, size_t nPos);
91 SwXCell(SwFrameFormat* pTableFormat, const SwStartNode& rStartNode); // XML import interface
92
93 virtual css::uno::Any SAL_CALL queryInterface( const css::uno::Type& aType ) override;
94 virtual void SAL_CALL acquire( ) noexcept override;
95 virtual void SAL_CALL release( ) noexcept override;
96
97 //XTypeProvider
98 virtual css::uno::Sequence< css::uno::Type > SAL_CALL getTypes( ) override;
99 virtual css::uno::Sequence< sal_Int8 > SAL_CALL getImplementationId( ) override;
100
101 //XCell
102 virtual OUString SAL_CALL getFormula( ) override;
103 virtual void SAL_CALL setFormula( const OUString& aFormula ) override;
104 virtual double SAL_CALL getValue( ) override;
106 double getValue( ) const
107 { return const_cast<SwXCell*>(this)->getValue(); };
108 virtual void SAL_CALL setValue( double nValue ) override;
109 virtual css::table::CellContentType SAL_CALL getType( ) override;
110 virtual sal_Int32 SAL_CALL getError( ) override;
111
112 //XText
113 virtual css::uno::Reference< css::text::XTextCursor > SAL_CALL createTextCursor() override;
114 virtual css::uno::Reference< css::text::XTextCursor > SAL_CALL createTextCursorByRange(const css::uno::Reference< css::text::XTextRange > & aTextPosition) override;
115 virtual void SAL_CALL setString(const OUString& aString) override;
116
117 //XPropertySet
118 virtual css::uno::Reference< css::beans::XPropertySetInfo > SAL_CALL getPropertySetInfo( ) override;
119 virtual void SAL_CALL setPropertyValue( const OUString& aPropertyName, const css::uno::Any& aValue ) override;
120 virtual css::uno::Any SAL_CALL getPropertyValue( const OUString& PropertyName ) override;
121 virtual void SAL_CALL addPropertyChangeListener( const OUString& aPropertyName, const css::uno::Reference< css::beans::XPropertyChangeListener >& xListener ) override;
122 virtual void SAL_CALL removePropertyChangeListener( const OUString& aPropertyName, const css::uno::Reference< css::beans::XPropertyChangeListener >& aListener ) override;
123 virtual void SAL_CALL addVetoableChangeListener( const OUString& PropertyName, const css::uno::Reference< css::beans::XVetoableChangeListener >& aListener ) override;
124 virtual void SAL_CALL removeVetoableChangeListener( const OUString& PropertyName, const css::uno::Reference< css::beans::XVetoableChangeListener >& aListener ) override;
125
126 //XServiceInfo
127 virtual OUString SAL_CALL getImplementationName() override;
128 virtual sal_Bool SAL_CALL supportsService(const OUString& ServiceName) override;
129 virtual css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames() override;
130
131 //XEnumerationAccess - was: XParagraphEnumerationAccess
132 virtual css::uno::Reference< css::container::XEnumeration > SAL_CALL createEnumeration() override;
133
134 //XElementAccess
135 virtual css::uno::Type SAL_CALL getElementType( ) override;
136 virtual sal_Bool SAL_CALL hasElements( ) override;
137
138 SwTableBox* GetTableBox() const { return m_pBox; }
139 static rtl::Reference<SwXCell> CreateXCell(SwFrameFormat* pTableFormat, SwTableBox* pBox, SwTable *pTable = nullptr );
140 SwTableBox* FindBox(SwTable* pTable, SwTableBox* pBox);
142 double GetForcedNumericalValue() const;
143 css::uno::Any GetAny() const;
144};
145
147 : public cppu::WeakImplHelper<css::beans::XPropertySet, css::lang::XServiceInfo>
148 , public SvtListener
149{
153
155 const SwFrameFormat* GetFrameFormat() const { return m_pFormat; }
156 virtual ~SwXTextTableRow() override;
157
158public:
159 SwXTextTableRow(SwFrameFormat* pFormat, SwTableLine* pLine);
160
161
162 //XPropertySet
163 virtual css::uno::Reference< css::beans::XPropertySetInfo > SAL_CALL getPropertySetInfo( ) override;
164 virtual void SAL_CALL setPropertyValue( const OUString& aPropertyName, const css::uno::Any& aValue ) override;
165 virtual css::uno::Any SAL_CALL getPropertyValue( const OUString& PropertyName ) override;
166 virtual void SAL_CALL addPropertyChangeListener( const OUString& aPropertyName, const css::uno::Reference< css::beans::XPropertyChangeListener >& xListener ) override;
167 virtual void SAL_CALL removePropertyChangeListener( const OUString& aPropertyName, const css::uno::Reference< css::beans::XPropertyChangeListener >& aListener ) override;
168 virtual void SAL_CALL addVetoableChangeListener( const OUString& PropertyName, const css::uno::Reference< css::beans::XVetoableChangeListener >& aListener ) override;
169 virtual void SAL_CALL removeVetoableChangeListener( const OUString& PropertyName, const css::uno::Reference< css::beans::XVetoableChangeListener >& aListener ) override;
170
171 //XServiceInfo
172 virtual OUString SAL_CALL getImplementationName() override;
173 virtual sal_Bool SAL_CALL supportsService(const OUString& ServiceName) override;
174 virtual css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames() override;
175
176 static SwTableLine* FindLine(SwTable* pTable, SwTableLine const * pLine);
177
178 void Notify(const SfxHint&) override;
179};
180
181typedef cppu::WeakImplHelper<
182 css::text::XTextTableCursor,
183 css::lang::XServiceInfo,
184 css::beans::XPropertySet> SwXTextTableCursor_Base;
187 , public SvtListener
188 , public OTextCursorHelper
189{
193
194public:
195 SwXTextTableCursor(SwFrameFormat* pFormat, SwTableBox const* pBox);
196 SwXTextTableCursor(SwFrameFormat& rTableFormat, const SwTableCursor* pTableSelection);
197 virtual void SAL_CALL release() noexcept override;
198
199 //XTextTableCursor
200 virtual OUString SAL_CALL getRangeName() override;
201 virtual sal_Bool SAL_CALL gotoCellByName( const OUString& aCellName, sal_Bool bExpand ) override;
202 virtual sal_Bool SAL_CALL goLeft( sal_Int16 nCount, sal_Bool bExpand ) override;
203 virtual sal_Bool SAL_CALL goRight( sal_Int16 nCount, sal_Bool bExpand ) override;
204 virtual sal_Bool SAL_CALL goUp( sal_Int16 nCount, sal_Bool bExpand ) override;
205 virtual sal_Bool SAL_CALL goDown( sal_Int16 nCount, sal_Bool bExpand ) override;
206 virtual void SAL_CALL gotoStart( sal_Bool bExpand ) override;
207 virtual void SAL_CALL gotoEnd( sal_Bool bExpand ) override;
208 virtual sal_Bool SAL_CALL mergeRange() override;
209 virtual sal_Bool SAL_CALL splitRange( sal_Int16 Count, sal_Bool Horizontal ) override;
210
211 //XPropertySet
212 virtual css::uno::Reference< css::beans::XPropertySetInfo > SAL_CALL getPropertySetInfo( ) override;
213 virtual void SAL_CALL setPropertyValue( const OUString& aPropertyName, const css::uno::Any& aValue ) override;
214 virtual css::uno::Any SAL_CALL getPropertyValue( const OUString& PropertyName ) override;
215 virtual void SAL_CALL addPropertyChangeListener( const OUString& aPropertyName, const css::uno::Reference< css::beans::XPropertyChangeListener >& xListener ) override;
216 virtual void SAL_CALL removePropertyChangeListener( const OUString& aPropertyName, const css::uno::Reference< css::beans::XPropertyChangeListener >& aListener ) override;
217 virtual void SAL_CALL addVetoableChangeListener( const OUString& PropertyName, const css::uno::Reference< css::beans::XVetoableChangeListener >& aListener ) override;
218 virtual void SAL_CALL removeVetoableChangeListener( const OUString& PropertyName, const css::uno::Reference< css::beans::XVetoableChangeListener >& aListener ) override;
219
220 //XServiceInfo
221 virtual OUString SAL_CALL getImplementationName() override;
222 virtual sal_Bool SAL_CALL supportsService(const OUString& ServiceName) override;
223 virtual css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames() override;
224
225
226 // ITextCursorHelper
227 virtual const SwPaM* GetPaM() const override;
228 virtual SwPaM* GetPaM() override;
229 virtual const SwDoc* GetDoc() const override;
230 virtual SwDoc* GetDoc() override;
231
232 virtual void Notify( const SfxHint& ) override;
233
234 const SwUnoCursor& GetCursor() const;
235 SwUnoCursor& GetCursor();
236 SwFrameFormat* GetFrameFormat() const { return m_pFrameFormat; }
237};
238
240{
241 sal_Int32 nTop;
242 sal_Int32 nLeft;
243 sal_Int32 nBottom;
244 sal_Int32 nRight;
245
246 void Normalize();
247};
248
249class SW_DLLPUBLIC SwXTextTable final : public cppu::WeakImplHelper
250<
251 css::text::XTextTable,
252 css::lang::XServiceInfo,
253 css::table::XCellRange,
254 css::chart::XChartDataArray,
255 css::beans::XPropertySet,
256 css::container::XNamed,
257 css::table::XAutoFormattable,
258 css::util::XSortable,
259 css::sheet::XCellRangeData
260>
261{
262private:
263 class Impl;
265
266 SwXTextTable();
267 SwXTextTable(SwFrameFormat& rFrameFormat);
268 virtual ~SwXTextTable() override;
269
270public:
272 CreateXTextTable(SwFrameFormat * pFrameFormat);
273
274 static void GetCellPosition(std::u16string_view aCellName, sal_Int32& o_rColumn, sal_Int32& o_rRow);
275
276 SwFrameFormat* GetFrameFormat();
277
278 //XTextTable
279 virtual void SAL_CALL initialize( sal_Int32 nRows, sal_Int32 nColumns ) override;
280 virtual css::uno::Reference< css::table::XTableRows > SAL_CALL getRows( ) override;
281 virtual css::uno::Reference< css::table::XTableColumns > SAL_CALL getColumns( ) override;
282 virtual css::uno::Reference< css::table::XCell > SAL_CALL getCellByName( const OUString& aCellName ) override;
283 virtual css::uno::Sequence< OUString > SAL_CALL getCellNames( ) override;
284 virtual css::uno::Reference< css::text::XTextTableCursor > SAL_CALL createCursorByCellName( const OUString& aCellName ) override;
285
286 //XTextContent
287 virtual void SAL_CALL attach(const css::uno::Reference< css::text::XTextRange > & xTextRange) override;
288 virtual css::uno::Reference< css::text::XTextRange > SAL_CALL getAnchor( ) override;
289
290 //XComponent
291 virtual void SAL_CALL dispose() override;
292 virtual void SAL_CALL addEventListener(const css::uno::Reference< css::lang::XEventListener > & aListener) override;
293 virtual void SAL_CALL removeEventListener(const css::uno::Reference< css::lang::XEventListener > & aListener) override;
294
295 //XCellRange
296 virtual css::uno::Reference< css::table::XCell > SAL_CALL getCellByPosition( sal_Int32 nColumn, sal_Int32 nRow ) override;
297 virtual css::uno::Reference< css::table::XCellRange > SAL_CALL getCellRangeByPosition( sal_Int32 nLeft, sal_Int32 nTop, sal_Int32 nRight, sal_Int32 nBottom ) override;
298 virtual css::uno::Reference< css::table::XCellRange > SAL_CALL getCellRangeByName( const OUString& aRange ) override;
299
300 //XChartDataArray
301 virtual css::uno::Sequence< css::uno::Sequence< double > > SAL_CALL getData( ) override;
302 virtual void SAL_CALL setData( const css::uno::Sequence< css::uno::Sequence< double > >& aData ) override;
303 virtual css::uno::Sequence< OUString > SAL_CALL getRowDescriptions( ) override;
304 virtual void SAL_CALL setRowDescriptions( const css::uno::Sequence< OUString >& aRowDescriptions ) override;
305 virtual css::uno::Sequence< OUString > SAL_CALL getColumnDescriptions( ) override;
306 virtual void SAL_CALL setColumnDescriptions( const css::uno::Sequence< OUString >& aColumnDescriptions ) override;
307
308 //XChartData
309 virtual void SAL_CALL addChartDataChangeEventListener( const css::uno::Reference< css::chart::XChartDataChangeEventListener >& aListener ) override;
310 virtual void SAL_CALL removeChartDataChangeEventListener( const css::uno::Reference< css::chart::XChartDataChangeEventListener >& aListener ) override;
311 virtual double SAL_CALL getNotANumber( ) override;
312 virtual sal_Bool SAL_CALL isNotANumber( double nNumber ) override;
313
314 //XSortable
315 virtual css::uno::Sequence< css::beans::PropertyValue > SAL_CALL createSortDescriptor() override;
316 virtual void SAL_CALL sort(const css::uno::Sequence< css::beans::PropertyValue >& xDescriptor) override;
317
318 //XAutoFormattable
319 virtual void SAL_CALL autoFormat(const OUString& aName) override;
320
321 //XPropertySet
322 virtual css::uno::Reference< css::beans::XPropertySetInfo > SAL_CALL getPropertySetInfo( ) override;
323 virtual void SAL_CALL setPropertyValue( const OUString& aPropertyName, const css::uno::Any& aValue ) override;
324 virtual css::uno::Any SAL_CALL getPropertyValue( const OUString& PropertyName ) override;
325 virtual void SAL_CALL addPropertyChangeListener( const OUString& aPropertyName, const css::uno::Reference< css::beans::XPropertyChangeListener >& xListener ) override;
326 virtual void SAL_CALL removePropertyChangeListener( const OUString& aPropertyName, const css::uno::Reference< css::beans::XPropertyChangeListener >& aListener ) override;
327 virtual void SAL_CALL addVetoableChangeListener( const OUString& PropertyName, const css::uno::Reference< css::beans::XVetoableChangeListener >& aListener ) override;
328 virtual void SAL_CALL removeVetoableChangeListener( const OUString& PropertyName, const css::uno::Reference< css::beans::XVetoableChangeListener >& aListener ) override;
329
330 //XNamed
331 virtual OUString SAL_CALL getName() override;
332 virtual void SAL_CALL setName(const OUString& Name_) override;
333
334 //XCellRangeData
335 virtual css::uno::Sequence< css::uno::Sequence< css::uno::Any > > SAL_CALL getDataArray( ) override;
336 virtual void SAL_CALL setDataArray( const css::uno::Sequence< css::uno::Sequence< css::uno::Any > >& aArray ) override;
337
338 //XServiceInfo
339 virtual OUString SAL_CALL getImplementationName() override;
340 virtual sal_Bool SAL_CALL supportsService(const OUString& ServiceName) override;
341 virtual css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames() override;
342
343};
344
345class SwXCellRange final : public cppu::WeakImplHelper
346<
347 css::table::XCellRange,
348 css::lang::XServiceInfo,
349 css::beans::XPropertySet,
350 css::chart::XChartDataArray,
351 css::util::XSortable,
352 css::sheet::XCellRangeData
353>
354{
355private:
356 class Impl;
358
359 SwXCellRange(const sw::UnoCursorPointer& pCursor, SwFrameFormat& rFrameFormat, SwRangeDescriptor const & rDesc);
360 virtual ~SwXCellRange() override;
361
362public:
363 static ::rtl::Reference<SwXCellRange> CreateXCellRange(
364 const sw::UnoCursorPointer& pCursor, SwFrameFormat& rFrameFormat,
365 SwRangeDescriptor const & rDesc);
366
367 void SetLabels(bool bFirstRowAsLabel, bool bFirstColumnAsLabel);
368
369 std::vector<css::uno::Reference<css::table::XCell>> GetCells();
370
371 const SwUnoCursor* GetTableCursor() const;
372
373 //XCellRange
374 virtual css::uno::Reference< css::table::XCell > SAL_CALL getCellByPosition( sal_Int32 nColumn, sal_Int32 nRow ) override;
375 virtual css::uno::Reference< css::table::XCellRange > SAL_CALL getCellRangeByPosition( sal_Int32 nLeft, sal_Int32 nTop, sal_Int32 nRight, sal_Int32 nBottom ) override;
376 virtual css::uno::Reference< css::table::XCellRange > SAL_CALL getCellRangeByName( const OUString& aRange ) override;
377
378 //XPropertySet
379 virtual css::uno::Reference< css::beans::XPropertySetInfo > SAL_CALL getPropertySetInfo( ) override;
380 virtual void SAL_CALL setPropertyValue(const OUString& aPropertyName, const css::uno::Any& aValue) override;
381 virtual css::uno::Any SAL_CALL getPropertyValue(const OUString& PropertyName) override;
382 virtual void SAL_CALL addPropertyChangeListener( const OUString& aPropertyName, const css::uno::Reference< css::beans::XPropertyChangeListener >& xListener ) override;
383 virtual void SAL_CALL removePropertyChangeListener( const OUString& aPropertyName, const css::uno::Reference< css::beans::XPropertyChangeListener >& aListener ) override;
384 virtual void SAL_CALL addVetoableChangeListener( const OUString& PropertyName, const css::uno::Reference< css::beans::XVetoableChangeListener >& aListener ) override;
385 virtual void SAL_CALL removeVetoableChangeListener( const OUString& PropertyName, const css::uno::Reference< css::beans::XVetoableChangeListener >& aListener ) override;
386
387 //XChartData
388 virtual void SAL_CALL addChartDataChangeEventListener( const css::uno::Reference< css::chart::XChartDataChangeEventListener >& aListener ) override;
389 virtual void SAL_CALL removeChartDataChangeEventListener( const css::uno::Reference< css::chart::XChartDataChangeEventListener >& aListener ) override;
390 virtual double SAL_CALL getNotANumber( ) override;
391 virtual sal_Bool SAL_CALL isNotANumber( double nNumber ) override;
392
393 //XChartDataArray
394 virtual css::uno::Sequence< css::uno::Sequence< double > > SAL_CALL getData( ) override;
395 virtual void SAL_CALL setData( const css::uno::Sequence< css::uno::Sequence< double > >& aData ) override;
396 virtual css::uno::Sequence< OUString > SAL_CALL getRowDescriptions( ) override;
397 virtual void SAL_CALL setRowDescriptions( const css::uno::Sequence< OUString >& aRowDescriptions ) override;
398 virtual css::uno::Sequence< OUString > SAL_CALL getColumnDescriptions( ) override;
399 virtual void SAL_CALL setColumnDescriptions( const css::uno::Sequence< OUString >& aColumnDescriptions ) override;
400
401 //XSortable
402 virtual css::uno::Sequence< css::beans::PropertyValue > SAL_CALL createSortDescriptor() override;
403 virtual void SAL_CALL sort(const css::uno::Sequence< css::beans::PropertyValue >& xDescriptor) override;
404
405 //XCellRangeData
406 virtual css::uno::Sequence< css::uno::Sequence< css::uno::Any > > SAL_CALL getDataArray( ) override;
407 virtual void SAL_CALL setDataArray( const css::uno::Sequence< css::uno::Sequence< css::uno::Any > >& aArray ) override;
408
409 //XServiceInfo
410 virtual OUString SAL_CALL getImplementationName() override;
411 virtual sal_Bool SAL_CALL supportsService(const OUString& ServiceName) override;
412 virtual css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames() override;
413
414};
415
417class SwXTableRows final : public cppu::WeakImplHelper
418<
419 css::table::XTableRows,
420 css::lang::XServiceInfo
421>
422{
423 class Impl;
426 const SwFrameFormat* GetFrameFormat() const { return const_cast<SwXTableRows*>(this)->GetFrameFormat(); }
427 virtual ~SwXTableRows() override;
428
429public:
430 SwXTableRows(SwFrameFormat& rFrameFormat);
431
432 //XIndexAccess
433 virtual sal_Int32 SAL_CALL getCount() override;
434 virtual css::uno::Any SAL_CALL getByIndex(sal_Int32 nIndex) override;
435
436 //XElementAccess
437 virtual css::uno::Type SAL_CALL getElementType( ) override;
438 virtual sal_Bool SAL_CALL hasElements( ) override;
439
440 //XTableRows
441 virtual void SAL_CALL insertByIndex(sal_Int32 nIndex, sal_Int32 nCount) override;
442 virtual void SAL_CALL removeByIndex(sal_Int32 nIndex, sal_Int32 nCount) override;
443
444 //XServiceInfo
445 virtual OUString SAL_CALL getImplementationName() override;
446 virtual sal_Bool SAL_CALL supportsService(const OUString& ServiceName) override;
447 virtual css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames() override;
448};
449
450class SwXTableColumns final : public cppu::WeakImplHelper
451<
452 css::table::XTableColumns,
453 css::lang::XServiceInfo
454>
455{
456private:
457 class Impl;
460
461 virtual ~SwXTableColumns() override;
462public:
463 SwXTableColumns(SwFrameFormat& rFrameFormat);
464
465
466 //XIndexAccess
467 virtual sal_Int32 SAL_CALL getCount() override;
468 virtual css::uno::Any SAL_CALL getByIndex(sal_Int32 nIndex) override;
469
470 //XElementAccess
471 virtual css::uno::Type SAL_CALL getElementType( ) override;
472 virtual sal_Bool SAL_CALL hasElements( ) override;
473
474 //XTableColumns
475 virtual void SAL_CALL insertByIndex(sal_Int32 nIndex, sal_Int32 nCount) override;
476 virtual void SAL_CALL removeByIndex(sal_Int32 nIndex, sal_Int32 nCount) override;
477
478 //XServiceInfo
479 virtual OUString SAL_CALL getImplementationName() override;
480 virtual sal_Bool SAL_CALL supportsService(const OUString& ServiceName) override;
481 virtual css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames() override;
482};
483
485 std::u16string_view aRange1StartCell, std::u16string_view aRange1EndCell,
486 std::u16string_view aRange2StartCell, std::u16string_view aRange2EndCell,
487 bool bCmpColsFirst );
488
489void sw_NormalizeRange( OUString &rCell1, OUString &rCell2 );
490
491OUString sw_GetCellName( sal_Int32 nColumn, sal_Int32 nRow );
492
493int sw_CompareCellsByColFirst( std::u16string_view aCellName1, std::u16string_view aCellName2 );
494
495int sw_CompareCellsByRowFirst( std::u16string_view aCellName1, std::u16string_view aCellName2 );
496
497#endif
498
499/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
Definition: doc.hxx:195
Style of a layout element.
Definition: frmfmt.hxx:62
PaM is Point and Mark: a selection of the document model.
Definition: pam.hxx:187
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:426
SwTableLine is one table row in the document model.
Definition: swtable.hxx:364
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:3746
::sw::UnoImplPtr< Impl > m_pImpl
Definition: unotbl.hxx:356
virtual OUString SAL_CALL getImplementationName() override
Definition: unotbl.cxx:3134
virtual css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames() override
Definition: unotbl.cxx:3140
virtual sal_Bool SAL_CALL supportsService(const OUString &ServiceName) override
Definition: unotbl.cxx:3137
virtual css::uno::Sequence< OUString > SAL_CALL getColumnDescriptions() override
Definition: unotbl.cxx:3679
virtual void SAL_CALL setRowDescriptions(const css::uno::Sequence< OUString > &aRowDescriptions) override
Definition: unotbl.cxx:3706
virtual css::uno::Sequence< css::uno::Sequence< double > > SAL_CALL getData() override
Definition: unotbl.cxx:3572
virtual css::uno::Sequence< css::beans::PropertyValue > SAL_CALL createSortDescriptor() override
Definition: unotbl.cxx:3740
virtual void SAL_CALL setColumnDescriptions(const css::uno::Sequence< OUString > &aColumnDescriptions) override
Definition: unotbl.cxx:3712
virtual css::uno::Reference< css::table::XCell > SAL_CALL getCellByPosition(sal_Int32 nColumn, sal_Int32 nRow) override
Definition: unotbl.cxx:3192
virtual double SAL_CALL getNotANumber() override
Definition: unotbl.cxx:3737
std::vector< css::uno::Reference< css::table::XCell > > GetCells()
Definition: unotbl.cxx:3178
virtual void SAL_CALL removePropertyChangeListener(const OUString &aPropertyName, const css::uno::Reference< css::beans::XPropertyChangeListener > &aListener) override
Definition: unotbl.cxx:3500
static ::rtl::Reference< SwXCellRange > CreateXCellRange(const sw::UnoCursorPointer &pCursor, SwFrameFormat &rFrameFormat, SwRangeDescriptor const &rDesc)
Definition: unotbl.cxx:3162
virtual ~SwXCellRange() override
Definition: unotbl.cxx:3158
virtual css::uno::Reference< css::beans::XPropertySetInfo > SAL_CALL getPropertySetInfo() override
Definition: unotbl.cxx:3288
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:3215
void SetLabels(bool bFirstRowAsLabel, bool bFirstColumnAsLabel)
Definition: unotbl.cxx:3172
virtual sal_Bool SAL_CALL isNotANumber(double nNumber) override
Definition: unotbl.cxx:3734
virtual void SAL_CALL addPropertyChangeListener(const OUString &aPropertyName, const css::uno::Reference< css::beans::XPropertyChangeListener > &xListener) override
Definition: unotbl.cxx:3497
virtual void SAL_CALL setPropertyValue(const OUString &aPropertyName, const css::uno::Any &aValue) override
Definition: unotbl.cxx:3295
virtual css::uno::Any SAL_CALL getPropertyValue(const OUString &PropertyName) override
Definition: unotbl.cxx:3415
const SwUnoCursor * GetTableCursor() const
Definition: unotbl.cxx:3770
SwXCellRange(const sw::UnoCursorPointer &pCursor, SwFrameFormat &rFrameFormat, SwRangeDescriptor const &rDesc)
Definition: unotbl.cxx:3152
virtual css::uno::Reference< css::table::XCellRange > SAL_CALL getCellRangeByName(const OUString &aRange) override
Definition: unotbl.cxx:3268
virtual void SAL_CALL addVetoableChangeListener(const OUString &PropertyName, const css::uno::Reference< css::beans::XVetoableChangeListener > &aListener) override
Definition: unotbl.cxx:3503
virtual void SAL_CALL setDataArray(const css::uno::Sequence< css::uno::Sequence< css::uno::Any > > &aArray) override
Definition: unotbl.cxx:3537
virtual void SAL_CALL removeChartDataChangeEventListener(const css::uno::Reference< css::chart::XChartDataChangeEventListener > &aListener) override
Definition: unotbl.cxx:3726
virtual void SAL_CALL addChartDataChangeEventListener(const css::uno::Reference< css::chart::XChartDataChangeEventListener > &aListener) override
Definition: unotbl.cxx:3718
virtual void SAL_CALL setData(const css::uno::Sequence< css::uno::Sequence< double > > &aData) override
Definition: unotbl.cxx:3605
virtual css::uno::Sequence< css::uno::Sequence< css::uno::Any > > SAL_CALL getDataArray() override
Definition: unotbl.cxx:3510
virtual void SAL_CALL removeVetoableChangeListener(const OUString &PropertyName, const css::uno::Reference< css::beans::XVetoableChangeListener > &aListener) override
Definition: unotbl.cxx:3506
virtual css::uno::Sequence< OUString > SAL_CALL getRowDescriptions() override
Definition: unotbl.cxx:3674
virtual double SAL_CALL getValue() override
Definition: unotbl.cxx:860
virtual sal_Int32 SAL_CALL getError() override
Definition: unotbl.cxx:899
virtual const SwStartNode * GetStartNode() const override
Definition: unotbl.cxx:779
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:938
virtual void SAL_CALL acquire() noexcept override
Definition: unotbl.cxx:759
double GetForcedNumericalValue() const
Definition: unotbl.cxx:1163
virtual css::uno::Sequence< css::uno::Type > SAL_CALL getTypes() override
Definition: unotbl.cxx:746
virtual css::uno::Reference< css::text::XTextCursor > CreateCursor() override
Definition: unotbl.cxx:790
virtual OUString SAL_CALL getImplementationName() override
Definition: unotbl.cxx:1214
css::uno::Any GetAny() const
Definition: unotbl.cxx:1204
virtual css::uno::Type SAL_CALL getElementType() override
Definition: unotbl.cxx:1099
virtual css::uno::Sequence< sal_Int8 > SAL_CALL getImplementationId() override
Definition: unotbl.cxx:754
SwTableBox * FindBox(SwTable *pTable, SwTableBox *pBox)
search if a box exists in a table
Definition: unotbl.cxx:1143
virtual void SAL_CALL setString(const OUString &aString) override
Definition: unotbl.cxx:893
friend void sw_setValue(SwXCell &rCell, double nVal)
Definition: unotbl.cxx:686
bool IsValid() const
Definition: unotbl.cxx:795
virtual ~SwXCell() override
Definition: unotbl.cxx:740
virtual void SAL_CALL addPropertyChangeListener(const OUString &aPropertyName, const css::uno::Reference< css::beans::XPropertyChangeListener > &xListener) override
Definition: unotbl.cxx:1073
virtual void SAL_CALL setPropertyValue(const OUString &aPropertyName, const css::uno::Any &aValue) override
Definition: unotbl.cxx:944
virtual void SAL_CALL removeVetoableChangeListener(const OUString &PropertyName, const css::uno::Reference< css::beans::XVetoableChangeListener > &aListener) override
Definition: unotbl.cxx:1082
virtual css::uno::Reference< css::text::XTextCursor > SAL_CALL createTextCursor() override
Definition: unotbl.cxx:906
SwTableBox * GetTableBox() const
Definition: unotbl.hxx:138
virtual void Notify(const SfxHint &) override
Definition: unotbl.cxx:1109
size_t m_nFndPos
Definition: unotbl.hxx:74
virtual void SAL_CALL setValue(double nValue) override
Definition: unotbl.cxx:869
virtual void SAL_CALL removePropertyChangeListener(const OUString &aPropertyName, const css::uno::Reference< css::beans::XPropertyChangeListener > &aListener) override
Definition: unotbl.cxx:1076
virtual OUString SAL_CALL getFormula() override
Definition: unotbl.cxx:817
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:1220
virtual void SAL_CALL setFormula(const OUString &aFormula) override
Definition: unotbl.cxx:829
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:1104
virtual css::uno::Any SAL_CALL getPropertyValue(const OUString &PropertyName) override
Definition: unotbl.cxx:1010
virtual css::uno::Reference< css::container::XEnumeration > SAL_CALL createEnumeration() override
Definition: unotbl.cxx:1085
virtual void SAL_CALL addVetoableChangeListener(const OUString &PropertyName, const css::uno::Reference< css::beans::XVetoableChangeListener > &aListener) override
Definition: unotbl.cxx:1079
SwFrameFormat * GetFrameFormat() const
Definition: unotbl.hxx:141
static rtl::Reference< SwXCell > CreateXCell(SwFrameFormat *pTableFormat, SwTableBox *pBox, SwTable *pTable=nullptr)
Definition: unotbl.cxx:1122
virtual void SAL_CALL release() noexcept override
Definition: unotbl.cxx:764
virtual css::uno::Any SAL_CALL queryInterface(const css::uno::Type &aType) override
Definition: unotbl.cxx:771
static size_t const NOTFOUND
Definition: unotbl.hxx:76
const SfxItemPropertySet * m_pPropSet
Definition: unotbl.hxx:68
virtual css::uno::Reference< css::text::XTextCursor > SAL_CALL createTextCursorByRange(const css::uno::Reference< css::text::XTextRange > &aTextPosition) override
Definition: unotbl.cxx:920
SwTableBox * m_pBox
Definition: unotbl.hxx:69
virtual sal_Bool SAL_CALL supportsService(const OUString &ServiceName) override
Definition: unotbl.cxx:1217
SwXCell(SwFrameFormat *pTableFormat, SwTableBox *pBox, size_t nPos)
Definition: unotbl.cxx:718
virtual css::table::CellContentType SAL_CALL getType() override
Definition: unotbl.cxx:875
virtual ~SwXTableColumns() override
Definition: unotbl.cxx:3997
virtual OUString SAL_CALL getImplementationName() override
Definition: unotbl.cxx:3983
virtual sal_Bool SAL_CALL hasElements() override
Definition: unotbl.cxx:4030
virtual sal_Int32 SAL_CALL getCount() override
Definition: unotbl.cxx:4005
SwXTableColumns(SwFrameFormat &rFrameFormat)
Definition: unotbl.cxx:3993
virtual void SAL_CALL insertByIndex(sal_Int32 nIndex, sal_Int32 nCount) override
Definition: unotbl.cxx:4038
::sw::UnoImplPtr< Impl > m_pImpl
Definition: unotbl.hxx:457
SwFrameFormat * GetFrameFormat() const
Definition: unotbl.cxx:4000
virtual void SAL_CALL removeByIndex(sal_Int32 nIndex, sal_Int32 nCount) override
Definition: unotbl.cxx:4077
virtual sal_Bool SAL_CALL supportsService(const OUString &ServiceName) override
Definition: unotbl.cxx:3986
virtual css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames() override
Definition: unotbl.cxx:3989
virtual css::uno::Type SAL_CALL getElementType() override
Definition: unotbl.cxx:4025
virtual css::uno::Any SAL_CALL getByIndex(sal_Int32 nIndex) override
Definition: unotbl.cxx:4017
UNO API wrapper for SwTableLines.
Definition: unotbl.hxx:422
SwXTableRows(SwFrameFormat &rFrameFormat)
Definition: unotbl.cxx:3825
SwFrameFormat * GetFrameFormat()
Definition: unotbl.cxx:3832
virtual ~SwXTableRows() override
Definition: unotbl.cxx:3829
virtual void SAL_CALL removeByIndex(sal_Int32 nIndex, sal_Int32 nCount) override
Definition: unotbl.cxx:3920
virtual css::uno::Type SAL_CALL getElementType() override
Definition: unotbl.cxx:3866
const SwFrameFormat * GetFrameFormat() const
Definition: unotbl.hxx:426
virtual sal_Int32 SAL_CALL getCount() override
Definition: unotbl.cxx:3837
virtual css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames() override
Definition: unotbl.cxx:3821
virtual css::uno::Any SAL_CALL getByIndex(sal_Int32 nIndex) override
Definition: unotbl.cxx:3848
virtual OUString SAL_CALL getImplementationName() override
Definition: unotbl.cxx:3815
virtual void SAL_CALL insertByIndex(sal_Int32 nIndex, sal_Int32 nCount) override
Definition: unotbl.cxx:3881
virtual sal_Bool SAL_CALL supportsService(const OUString &ServiceName) override
Definition: unotbl.cxx:3818
virtual sal_Bool SAL_CALL hasElements() override
Definition: unotbl.cxx:3871
::sw::UnoImplPtr< Impl > m_pImpl
Definition: unotbl.hxx:423
const SfxItemPropertySet * m_pPropSet
Definition: unotbl.hxx:191
SwFrameFormat * m_pFrameFormat
Definition: unotbl.hxx:190
sw::UnoCursorPointer m_pUnoCursor
Definition: unotbl.hxx:192
SwXTextTableRow(SwFrameFormat *pFormat, SwTableLine *pLine)
Definition: unotbl.cxx:1233
virtual css::uno::Reference< css::beans::XPropertySetInfo > SAL_CALL getPropertySetInfo() override
Definition: unotbl.cxx:1247
virtual void SAL_CALL addVetoableChangeListener(const OUString &PropertyName, const css::uno::Reference< css::beans::XVetoableChangeListener > &aListener) override
Definition: unotbl.cxx:1381
SwTableLine * m_pLine
Definition: unotbl.hxx:151
virtual sal_Bool SAL_CALL supportsService(const OUString &ServiceName) override
Definition: unotbl.cxx:1226
SwFrameFormat * m_pFormat
Definition: unotbl.hxx:150
virtual css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames() override
Definition: unotbl.cxx:1229
virtual OUString SAL_CALL getImplementationName() override
Definition: unotbl.cxx:1223
virtual css::uno::Any SAL_CALL getPropertyValue(const OUString &PropertyName) override
Definition: unotbl.cxx:1330
virtual ~SwXTextTableRow() override
Definition: unotbl.cxx:1241
virtual void SAL_CALL setPropertyValue(const OUString &aPropertyName, const css::uno::Any &aValue) override
Definition: unotbl.cxx:1253
const SwFrameFormat * GetFrameFormat() const
Definition: unotbl.hxx:155
virtual void SAL_CALL addPropertyChangeListener(const OUString &aPropertyName, const css::uno::Reference< css::beans::XPropertyChangeListener > &xListener) override
Definition: unotbl.cxx:1375
void Notify(const SfxHint &) override
Definition: unotbl.cxx:1387
virtual void SAL_CALL removeVetoableChangeListener(const OUString &PropertyName, const css::uno::Reference< css::beans::XVetoableChangeListener > &aListener) override
Definition: unotbl.cxx:1384
const SfxItemPropertySet * m_pPropSet
Definition: unotbl.hxx:152
virtual void SAL_CALL removePropertyChangeListener(const OUString &aPropertyName, const css::uno::Reference< css::beans::XPropertyChangeListener > &aListener) override
Definition: unotbl.cxx:1378
SwFrameFormat * GetFrameFormat()
Definition: unotbl.hxx:154
static SwTableLine * FindLine(SwTable *pTable, SwTableLine const *pLine)
Definition: unotbl.cxx:1399
::sw::UnoImplPtr< Impl > m_pImpl
Definition: unotbl.hxx:263
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:3249
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:242
sal_Int32 nBottom
Definition: unotbl.hxx:243
void Normalize()
Definition: unotbl.cxx:537
sal_Int32 nTop
Definition: unotbl.hxx:241
sal_Int32 nRight
Definition: unotbl.hxx:244
#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:184
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