1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
3 * This file is part of the LibreOffice project.
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/.
9 * This file incorporates work covered by the following license notice:
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 .
20 #ifndef INCLUDED_SW_INC_UNOTBL_HXX
21 #define INCLUDED_SW_INC_UNOTBL_HXX
23 #include <com/sun/star/container/XNamed.hpp>
24 #include <com/sun/star/container/XEnumerationAccess.hpp>
25 #include <com/sun/star/util/XSortable.hpp>
26 #include <com/sun/star/chart/XChartDataArray.hpp>
27 #include <com/sun/star/text/XTextTableCursor.hpp>
28 #include <com/sun/star/text/XTextTable.hpp>
29 #include <com/sun/star/table/XCellRange.hpp>
30 #include <com/sun/star/sheet/XCellRangeData.hpp>
31 #include <com/sun/star/table/XAutoFormattable.hpp>
33 #include <cppuhelper/implbase.hxx>
35 #include <comphelper/uno3.hxx>
37 #include <svl/listener.hxx>
40 #include "TextCursorHelper.hxx"
41 #include "unotext.hxx"
43 #include "unocrsr.hxx"
49 class SfxItemPropertySet
;
55 css::lang::XServiceInfo
,
56 css::beans::XPropertySet
,
57 css::container::XEnumerationAccess
60 class SwXCell final
: public SwXCellBaseClass
,
64 friend void sw_setString( SwXCell
&rCell
, const OUString
&rText
,
65 bool bKeepNumberFormat
);
66 friend void sw_setValue( SwXCell
&rCell
, double nVal
);
68 const SfxItemPropertySet
* m_pPropSet
;
69 SwTableBox
* pBox
; // only set in non-XML import
70 const SwStartNode
* pStartNode
; // only set in XML import
71 SwFrameFormat
* m_pTableFormat
;
73 // table position where pBox was found last
75 css::uno::Reference
<css::text::XText
> m_xParentText
;
76 static size_t const NOTFOUND
= SAL_MAX_SIZE
;
78 virtual const SwStartNode
*GetStartNode() const override
;
80 virtual css::uno::Reference
< css::text::XTextCursor
>
81 CreateCursor() override
;
85 virtual ~SwXCell() override
;
87 virtual void Notify(const SfxHint
&) override
;
90 SwXCell(SwFrameFormat
* pTableFormat
, SwTableBox
* pBox
, size_t nPos
);
91 SwXCell(SwFrameFormat
* pTableFormat
, const SwStartNode
& rStartNode
); // XML import interface
94 static const css::uno::Sequence
< sal_Int8
> & getUnoTunnelId();
97 virtual sal_Int64 SAL_CALL
getSomething( const css::uno::Sequence
< sal_Int8
>& aIdentifier
) override
;
99 virtual css::uno::Any SAL_CALL
queryInterface( const css::uno::Type
& aType
) override
;
100 virtual void SAL_CALL
acquire( ) throw() override
;
101 virtual void SAL_CALL
release( ) throw() override
;
104 virtual css::uno::Sequence
< css::uno::Type
> SAL_CALL
getTypes( ) override
;
105 virtual css::uno::Sequence
< sal_Int8
> SAL_CALL
getImplementationId( ) override
;
108 virtual OUString SAL_CALL
getFormula( ) override
;
109 virtual void SAL_CALL
setFormula( const OUString
& aFormula
) override
;
110 virtual double SAL_CALL
getValue( ) override
;
111 /// @throws css::uno::RuntimeException
112 double getValue( ) const
113 { return const_cast<SwXCell
*>(this)->getValue(); };
114 virtual void SAL_CALL
setValue( double nValue
) override
;
115 virtual css::table::CellContentType SAL_CALL
getType( ) override
;
116 virtual sal_Int32 SAL_CALL
getError( ) override
;
119 virtual css::uno::Reference
< css::text::XTextCursor
> SAL_CALL
createTextCursor() override
;
120 virtual css::uno::Reference
< css::text::XTextCursor
> SAL_CALL
createTextCursorByRange(const css::uno::Reference
< css::text::XTextRange
> & aTextPosition
) override
;
121 virtual void SAL_CALL
setString(const OUString
& aString
) override
;
124 virtual css::uno::Reference
< css::beans::XPropertySetInfo
> SAL_CALL
getPropertySetInfo( ) override
;
125 virtual void SAL_CALL
setPropertyValue( const OUString
& aPropertyName
, const css::uno::Any
& aValue
) override
;
126 virtual css::uno::Any SAL_CALL
getPropertyValue( const OUString
& PropertyName
) override
;
127 virtual void SAL_CALL
addPropertyChangeListener( const OUString
& aPropertyName
, const css::uno::Reference
< css::beans::XPropertyChangeListener
>& xListener
) override
;
128 virtual void SAL_CALL
removePropertyChangeListener( const OUString
& aPropertyName
, const css::uno::Reference
< css::beans::XPropertyChangeListener
>& aListener
) override
;
129 virtual void SAL_CALL
addVetoableChangeListener( const OUString
& PropertyName
, const css::uno::Reference
< css::beans::XVetoableChangeListener
>& aListener
) override
;
130 virtual void SAL_CALL
removeVetoableChangeListener( const OUString
& PropertyName
, const css::uno::Reference
< css::beans::XVetoableChangeListener
>& aListener
) override
;
133 virtual OUString SAL_CALL
getImplementationName() override
;
134 virtual sal_Bool SAL_CALL
supportsService(const OUString
& ServiceName
) override
;
135 virtual css::uno::Sequence
< OUString
> SAL_CALL
getSupportedServiceNames() override
;
137 //XEnumerationAccess - was: XParagraphEnumerationAccess
138 virtual css::uno::Reference
< css::container::XEnumeration
> SAL_CALL
createEnumeration() override
;
141 virtual css::uno::Type SAL_CALL
getElementType( ) override
;
142 virtual sal_Bool SAL_CALL
hasElements( ) override
;
144 SwTableBox
* GetTableBox() const { return pBox
; }
145 static SwXCell
* CreateXCell(SwFrameFormat
* pTableFormat
, SwTableBox
* pBox
, SwTable
*pTable
= nullptr );
146 SwTableBox
* FindBox(SwTable
* pTable
, SwTableBox
* pBox
);
147 SwFrameFormat
* GetFrameFormat() const { return m_pTableFormat
; }
148 double GetForcedNumericalValue() const;
149 css::uno::Any
GetAny() const;
152 class SwXTextTableRow final
153 : public cppu::WeakImplHelper
<css::beans::XPropertySet
, css::lang::XServiceInfo
>
156 SwFrameFormat
* m_pFormat
;
158 const SfxItemPropertySet
* m_pPropSet
;
160 SwFrameFormat
* GetFrameFormat() { return m_pFormat
; }
161 const SwFrameFormat
* GetFrameFormat() const { return m_pFormat
; }
162 virtual ~SwXTextTableRow() override
;
165 SwXTextTableRow(SwFrameFormat
* pFormat
, SwTableLine
* pLine
);
169 virtual css::uno::Reference
< css::beans::XPropertySetInfo
> SAL_CALL
getPropertySetInfo( ) override
;
170 virtual void SAL_CALL
setPropertyValue( const OUString
& aPropertyName
, const css::uno::Any
& aValue
) override
;
171 virtual css::uno::Any SAL_CALL
getPropertyValue( const OUString
& PropertyName
) override
;
172 virtual void SAL_CALL
addPropertyChangeListener( const OUString
& aPropertyName
, const css::uno::Reference
< css::beans::XPropertyChangeListener
>& xListener
) override
;
173 virtual void SAL_CALL
removePropertyChangeListener( const OUString
& aPropertyName
, const css::uno::Reference
< css::beans::XPropertyChangeListener
>& aListener
) override
;
174 virtual void SAL_CALL
addVetoableChangeListener( const OUString
& PropertyName
, const css::uno::Reference
< css::beans::XVetoableChangeListener
>& aListener
) override
;
175 virtual void SAL_CALL
removeVetoableChangeListener( const OUString
& PropertyName
, const css::uno::Reference
< css::beans::XVetoableChangeListener
>& aListener
) override
;
178 virtual OUString SAL_CALL
getImplementationName() override
;
179 virtual sal_Bool SAL_CALL
supportsService(const OUString
& ServiceName
) override
;
180 virtual css::uno::Sequence
< OUString
> SAL_CALL
getSupportedServiceNames() override
;
182 static SwTableLine
* FindLine(SwTable
* pTable
, SwTableLine
const * pLine
);
184 void Notify(const SfxHint
&) override
;
187 typedef cppu::WeakImplHelper
<
188 css::text::XTextTableCursor
,
189 css::lang::XServiceInfo
,
190 css::beans::XPropertySet
> SwXTextTableCursor_Base
;
191 class SW_DLLPUBLIC SwXTextTableCursor
192 : public SwXTextTableCursor_Base
194 , public OTextCursorHelper
196 SwFrameFormat
* m_pFrameFormat
;
197 const SfxItemPropertySet
* m_pPropSet
;
200 SwXTextTableCursor(SwFrameFormat
* pFormat
, SwTableBox
const* pBox
);
201 SwXTextTableCursor(SwFrameFormat
& rTableFormat
, const SwTableCursor
* pTableSelection
);
205 virtual OUString SAL_CALL
getRangeName() override
;
206 virtual sal_Bool SAL_CALL
gotoCellByName( const OUString
& aCellName
, sal_Bool bExpand
) override
;
207 virtual sal_Bool SAL_CALL
goLeft( sal_Int16 nCount
, sal_Bool bExpand
) override
;
208 virtual sal_Bool SAL_CALL
goRight( sal_Int16 nCount
, sal_Bool bExpand
) override
;
209 virtual sal_Bool SAL_CALL
goUp( sal_Int16 nCount
, sal_Bool bExpand
) override
;
210 virtual sal_Bool SAL_CALL
goDown( sal_Int16 nCount
, sal_Bool bExpand
) override
;
211 virtual void SAL_CALL
gotoStart( sal_Bool bExpand
) override
;
212 virtual void SAL_CALL
gotoEnd( sal_Bool bExpand
) override
;
213 virtual sal_Bool SAL_CALL
mergeRange() override
;
214 virtual sal_Bool SAL_CALL
splitRange( sal_Int16 Count
, sal_Bool Horizontal
) override
;
217 virtual css::uno::Reference
< css::beans::XPropertySetInfo
> SAL_CALL
getPropertySetInfo( ) override
;
218 virtual void SAL_CALL
setPropertyValue( const OUString
& aPropertyName
, const css::uno::Any
& aValue
) override
;
219 virtual css::uno::Any SAL_CALL
getPropertyValue( const OUString
& PropertyName
) override
;
220 virtual void SAL_CALL
addPropertyChangeListener( const OUString
& aPropertyName
, const css::uno::Reference
< css::beans::XPropertyChangeListener
>& xListener
) override
;
221 virtual void SAL_CALL
removePropertyChangeListener( const OUString
& aPropertyName
, const css::uno::Reference
< css::beans::XPropertyChangeListener
>& aListener
) override
;
222 virtual void SAL_CALL
addVetoableChangeListener( const OUString
& PropertyName
, const css::uno::Reference
< css::beans::XVetoableChangeListener
>& aListener
) override
;
223 virtual void SAL_CALL
removeVetoableChangeListener( const OUString
& PropertyName
, const css::uno::Reference
< css::beans::XVetoableChangeListener
>& aListener
) override
;
226 virtual OUString SAL_CALL
getImplementationName() override
;
227 virtual sal_Bool SAL_CALL
supportsService(const OUString
& ServiceName
) override
;
228 virtual css::uno::Sequence
< OUString
> SAL_CALL
getSupportedServiceNames() override
;
232 virtual const SwPaM
* GetPaM() const override
;
233 virtual SwPaM
* GetPaM() override
;
234 virtual const SwDoc
* GetDoc() const override
;
235 virtual SwDoc
* GetDoc() override
;
237 virtual void Notify( const SfxHint
& ) override
;
239 const SwUnoCursor
& GetCursor() const;
240 SwUnoCursor
& GetCursor();
241 sw::UnoCursorPointer m_pUnoCursor
;
242 SwFrameFormat
* GetFrameFormat() const { return m_pFrameFormat
; }
245 struct SwRangeDescriptor
255 class SwXTextTable
: public cppu::WeakImplHelper
257 css::text::XTextTable
,
258 css::lang::XServiceInfo
,
259 css::table::XCellRange
,
260 css::chart::XChartDataArray
,
261 css::beans::XPropertySet
,
262 css::container::XNamed
,
263 css::table::XAutoFormattable
,
264 css::util::XSortable
,
265 css::lang::XUnoTunnel
,
266 css::sheet::XCellRangeData
271 ::sw::UnoImplPtr
<Impl
> m_pImpl
;
274 SwXTextTable(SwFrameFormat
& rFrameFormat
);
275 virtual ~SwXTextTable() override
;
278 static css::uno::Reference
<css::text::XTextTable
>
279 CreateXTextTable(SwFrameFormat
* pFrameFormat
);
281 SW_DLLPUBLIC
static const css::uno::Sequence
< sal_Int8
> & getUnoTunnelId();
283 SW_DLLPUBLIC
static void GetCellPosition(const OUString
& rCellName
, sal_Int32
& o_rColumn
, sal_Int32
& o_rRow
);
285 SW_DLLPUBLIC SwFrameFormat
* GetFrameFormat();
288 virtual sal_Int64 SAL_CALL
getSomething( const css::uno::Sequence
< sal_Int8
>& aIdentifier
) override
;
292 virtual void SAL_CALL
initialize( sal_Int32 nRows
, sal_Int32 nColumns
) override
;
293 virtual css::uno::Reference
< css::table::XTableRows
> SAL_CALL
getRows( ) override
;
294 virtual css::uno::Reference
< css::table::XTableColumns
> SAL_CALL
getColumns( ) override
;
295 virtual css::uno::Reference
< css::table::XCell
> SAL_CALL
getCellByName( const OUString
& aCellName
) override
;
296 virtual css::uno::Sequence
< OUString
> SAL_CALL
getCellNames( ) override
;
297 virtual css::uno::Reference
< css::text::XTextTableCursor
> SAL_CALL
createCursorByCellName( const OUString
& aCellName
) override
;
300 virtual void SAL_CALL
attach(const css::uno::Reference
< css::text::XTextRange
> & xTextRange
) override
;
301 virtual css::uno::Reference
< css::text::XTextRange
> SAL_CALL
getAnchor( ) override
;
304 virtual void SAL_CALL
dispose() override
;
305 virtual void SAL_CALL
addEventListener(const css::uno::Reference
< css::lang::XEventListener
> & aListener
) override
;
306 virtual void SAL_CALL
removeEventListener(const css::uno::Reference
< css::lang::XEventListener
> & aListener
) override
;
309 virtual css::uno::Reference
< css::table::XCell
> SAL_CALL
getCellByPosition( sal_Int32 nColumn
, sal_Int32 nRow
) override
;
310 virtual css::uno::Reference
< css::table::XCellRange
> SAL_CALL
getCellRangeByPosition( sal_Int32 nLeft
, sal_Int32 nTop
, sal_Int32 nRight
, sal_Int32 nBottom
) override
;
311 virtual css::uno::Reference
< css::table::XCellRange
> SAL_CALL
getCellRangeByName( const OUString
& aRange
) override
;
314 virtual css::uno::Sequence
< css::uno::Sequence
< double > > SAL_CALL
getData( ) override
;
315 virtual void SAL_CALL
setData( const css::uno::Sequence
< css::uno::Sequence
< double > >& aData
) override
;
316 virtual css::uno::Sequence
< OUString
> SAL_CALL
getRowDescriptions( ) override
;
317 virtual void SAL_CALL
setRowDescriptions( const css::uno::Sequence
< OUString
>& aRowDescriptions
) override
;
318 virtual css::uno::Sequence
< OUString
> SAL_CALL
getColumnDescriptions( ) override
;
319 virtual void SAL_CALL
setColumnDescriptions( const css::uno::Sequence
< OUString
>& aColumnDescriptions
) override
;
322 virtual void SAL_CALL
addChartDataChangeEventListener( const css::uno::Reference
< css::chart::XChartDataChangeEventListener
>& aListener
) override
;
323 virtual void SAL_CALL
removeChartDataChangeEventListener( const css::uno::Reference
< css::chart::XChartDataChangeEventListener
>& aListener
) override
;
324 virtual double SAL_CALL
getNotANumber( ) override
;
325 virtual sal_Bool SAL_CALL
isNotANumber( double nNumber
) override
;
328 virtual css::uno::Sequence
< css::beans::PropertyValue
> SAL_CALL
createSortDescriptor() override
;
329 virtual void SAL_CALL
sort(const css::uno::Sequence
< css::beans::PropertyValue
>& xDescriptor
) override
;
332 virtual void SAL_CALL
autoFormat(const OUString
& aName
) override
;
335 virtual css::uno::Reference
< css::beans::XPropertySetInfo
> SAL_CALL
getPropertySetInfo( ) override
;
336 virtual void SAL_CALL
setPropertyValue( const OUString
& aPropertyName
, const css::uno::Any
& aValue
) override
;
337 virtual css::uno::Any SAL_CALL
getPropertyValue( const OUString
& PropertyName
) override
;
338 virtual void SAL_CALL
addPropertyChangeListener( const OUString
& aPropertyName
, const css::uno::Reference
< css::beans::XPropertyChangeListener
>& xListener
) override
;
339 virtual void SAL_CALL
removePropertyChangeListener( const OUString
& aPropertyName
, const css::uno::Reference
< css::beans::XPropertyChangeListener
>& aListener
) override
;
340 virtual void SAL_CALL
addVetoableChangeListener( const OUString
& PropertyName
, const css::uno::Reference
< css::beans::XVetoableChangeListener
>& aListener
) override
;
341 virtual void SAL_CALL
removeVetoableChangeListener( const OUString
& PropertyName
, const css::uno::Reference
< css::beans::XVetoableChangeListener
>& aListener
) override
;
344 virtual OUString SAL_CALL
getName() override
;
345 virtual void SAL_CALL
setName(const OUString
& Name_
) override
;
348 virtual css::uno::Sequence
< css::uno::Sequence
< css::uno::Any
> > SAL_CALL
getDataArray( ) override
;
349 virtual void SAL_CALL
setDataArray( const css::uno::Sequence
< css::uno::Sequence
< css::uno::Any
> >& aArray
) override
;
352 virtual OUString SAL_CALL
getImplementationName() override
;
353 virtual sal_Bool SAL_CALL
supportsService(const OUString
& ServiceName
) override
;
354 virtual css::uno::Sequence
< OUString
> SAL_CALL
getSupportedServiceNames() override
;
358 class SwXCellRange
: public cppu::WeakImplHelper
360 css::table::XCellRange
,
361 css::lang::XServiceInfo
,
362 css::lang::XUnoTunnel
,
363 css::beans::XPropertySet
,
364 css::chart::XChartDataArray
,
365 css::util::XSortable
,
366 css::sheet::XCellRangeData
371 ::sw::UnoImplPtr
<Impl
> m_pImpl
;
373 SwXCellRange(const sw::UnoCursorPointer
& pCursor
, SwFrameFormat
& rFrameFormat
, SwRangeDescriptor
const & rDesc
);
374 virtual ~SwXCellRange() override
;
377 static ::rtl::Reference
<SwXCellRange
> CreateXCellRange(
378 const sw::UnoCursorPointer
& pCursor
, SwFrameFormat
& rFrameFormat
,
379 SwRangeDescriptor
const & rDesc
);
381 static const css::uno::Sequence
< sal_Int8
> & getUnoTunnelId();
383 void SetLabels(bool bFirstRowAsLabel
, bool bFirstColumnAsLabel
);
385 std::vector
<css::uno::Reference
<css::table::XCell
>> GetCells();
387 const SwUnoCursor
* GetTableCursor() const;
390 virtual sal_Int64 SAL_CALL
getSomething( const css::uno::Sequence
< sal_Int8
>& aIdentifier
) override
;
393 virtual css::uno::Reference
< css::table::XCell
> SAL_CALL
getCellByPosition( sal_Int32 nColumn
, sal_Int32 nRow
) override
;
394 virtual css::uno::Reference
< css::table::XCellRange
> SAL_CALL
getCellRangeByPosition( sal_Int32 nLeft
, sal_Int32 nTop
, sal_Int32 nRight
, sal_Int32 nBottom
) override
;
395 virtual css::uno::Reference
< css::table::XCellRange
> SAL_CALL
getCellRangeByName( const OUString
& aRange
) override
;
398 virtual css::uno::Reference
< css::beans::XPropertySetInfo
> SAL_CALL
getPropertySetInfo( ) override
;
399 virtual void SAL_CALL
setPropertyValue(const OUString
& aPropertyName
, const css::uno::Any
& aValue
) override
;
400 virtual css::uno::Any SAL_CALL
getPropertyValue(const OUString
& PropertyName
) override
;
401 virtual void SAL_CALL
addPropertyChangeListener( const OUString
& aPropertyName
, const css::uno::Reference
< css::beans::XPropertyChangeListener
>& xListener
) override
;
402 virtual void SAL_CALL
removePropertyChangeListener( const OUString
& aPropertyName
, const css::uno::Reference
< css::beans::XPropertyChangeListener
>& aListener
) override
;
403 virtual void SAL_CALL
addVetoableChangeListener( const OUString
& PropertyName
, const css::uno::Reference
< css::beans::XVetoableChangeListener
>& aListener
) override
;
404 virtual void SAL_CALL
removeVetoableChangeListener( const OUString
& PropertyName
, const css::uno::Reference
< css::beans::XVetoableChangeListener
>& aListener
) override
;
407 virtual void SAL_CALL
addChartDataChangeEventListener( const css::uno::Reference
< css::chart::XChartDataChangeEventListener
>& aListener
) override
;
408 virtual void SAL_CALL
removeChartDataChangeEventListener( const css::uno::Reference
< css::chart::XChartDataChangeEventListener
>& aListener
) override
;
409 virtual double SAL_CALL
getNotANumber( ) override
;
410 virtual sal_Bool SAL_CALL
isNotANumber( double nNumber
) override
;
413 virtual css::uno::Sequence
< css::uno::Sequence
< double > > SAL_CALL
getData( ) override
;
414 virtual void SAL_CALL
setData( const css::uno::Sequence
< css::uno::Sequence
< double > >& aData
) override
;
415 virtual css::uno::Sequence
< OUString
> SAL_CALL
getRowDescriptions( ) override
;
416 virtual void SAL_CALL
setRowDescriptions( const css::uno::Sequence
< OUString
>& aRowDescriptions
) override
;
417 virtual css::uno::Sequence
< OUString
> SAL_CALL
getColumnDescriptions( ) override
;
418 virtual void SAL_CALL
setColumnDescriptions( const css::uno::Sequence
< OUString
>& aColumnDescriptions
) override
;
421 virtual css::uno::Sequence
< css::beans::PropertyValue
> SAL_CALL
createSortDescriptor() override
;
422 virtual void SAL_CALL
sort(const css::uno::Sequence
< css::beans::PropertyValue
>& xDescriptor
) override
;
425 virtual css::uno::Sequence
< css::uno::Sequence
< css::uno::Any
> > SAL_CALL
getDataArray( ) override
;
426 virtual void SAL_CALL
setDataArray( const css::uno::Sequence
< css::uno::Sequence
< css::uno::Any
> >& aArray
) override
;
429 virtual OUString SAL_CALL
getImplementationName() override
;
430 virtual sal_Bool SAL_CALL
supportsService(const OUString
& ServiceName
) override
;
431 virtual css::uno::Sequence
< OUString
> SAL_CALL
getSupportedServiceNames() override
;
435 class SwXTableRows final
: public cppu::WeakImplHelper
437 css::table::XTableRows
,
438 css::lang::XServiceInfo
442 ::sw::UnoImplPtr
<Impl
> m_pImpl
;
443 SwFrameFormat
* GetFrameFormat();
444 const SwFrameFormat
* GetFrameFormat() const { return const_cast<SwXTableRows
*>(this)->GetFrameFormat(); }
445 virtual ~SwXTableRows() override
;
448 SwXTableRows(SwFrameFormat
& rFrameFormat
);
451 virtual sal_Int32 SAL_CALL
getCount() override
;
452 virtual css::uno::Any SAL_CALL
getByIndex(sal_Int32 nIndex
) override
;
455 virtual css::uno::Type SAL_CALL
getElementType( ) override
;
456 virtual sal_Bool SAL_CALL
hasElements( ) override
;
459 virtual void SAL_CALL
insertByIndex(sal_Int32 nIndex
, sal_Int32 nCount
) override
;
460 virtual void SAL_CALL
removeByIndex(sal_Int32 nIndex
, sal_Int32 nCount
) override
;
463 virtual OUString SAL_CALL
getImplementationName() override
;
464 virtual sal_Bool SAL_CALL
supportsService(const OUString
& ServiceName
) override
;
465 virtual css::uno::Sequence
< OUString
> SAL_CALL
getSupportedServiceNames() override
;
468 class SwXTableColumns
: public cppu::WeakImplHelper
470 css::table::XTableColumns
,
471 css::lang::XServiceInfo
476 ::sw::UnoImplPtr
<Impl
> m_pImpl
;
477 SwFrameFormat
* GetFrameFormat() const;
479 virtual ~SwXTableColumns() override
;
481 SwXTableColumns(SwFrameFormat
& rFrameFormat
);
485 virtual sal_Int32 SAL_CALL
getCount() override
;
486 virtual css::uno::Any SAL_CALL
getByIndex(sal_Int32 nIndex
) override
;
489 virtual css::uno::Type SAL_CALL
getElementType( ) override
;
490 virtual sal_Bool SAL_CALL
hasElements( ) override
;
493 virtual void SAL_CALL
insertByIndex(sal_Int32 nIndex
, sal_Int32 nCount
) override
;
494 virtual void SAL_CALL
removeByIndex(sal_Int32 nIndex
, sal_Int32 nCount
) override
;
497 virtual OUString SAL_CALL
getImplementationName() override
;
498 virtual sal_Bool SAL_CALL
supportsService(const OUString
& ServiceName
) override
;
499 virtual css::uno::Sequence
< OUString
> SAL_CALL
getSupportedServiceNames() override
;
502 int sw_CompareCellRanges(
503 const OUString
&rRange1StartCell
, const OUString
&rRange1EndCell
,
504 const OUString
&rRange2StartCell
, const OUString
&rRange2EndCell
,
505 bool bCmpColsFirst
);
507 void sw_NormalizeRange( OUString
&rCell1
, OUString
&rCell2
);
509 OUString
sw_GetCellName( sal_Int32 nColumn
, sal_Int32 nRow
);
511 int sw_CompareCellsByColFirst( const OUString
&rCellName1
, const OUString
&rCellName2
);
513 int sw_CompareCellsByRowFirst( const OUString
&rCellName1
, const OUString
&rCellName2
);
517 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */