Branch libreoffice-5-0-4
[LibreOffice.git] / sw / inc / unotbl.hxx
blob11b30a346ca7a3b6627c362ed8f21110e7f99d1d
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*
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/XChartData.hpp>
27 #include <com/sun/star/chart/XChartDataArray.hpp>
28 #include <com/sun/star/chart2/data/XLabeledDataSequence.hpp>
29 #include <com/sun/star/text/XTextTableCursor.hpp>
30 #include <com/sun/star/text/XTextTable.hpp>
31 #include <com/sun/star/table/XCellRange.hpp>
32 #include <com/sun/star/sheet/XCellRangeData.hpp>
33 #include <com/sun/star/table/XAutoFormattable.hpp>
35 #include <cppuhelper/implbase.hxx>
36 #include <cppuhelper/interfacecontainer.h>
38 #include <comphelper/uno3.hxx>
40 #include <calbck.hxx>
41 #include <TextCursorHelper.hxx>
42 #include <unotext.hxx>
43 #include <frmfmt.hxx>
44 #include <tuple>
46 class SwUnoCrsr;
47 class SwTable;
48 class SwTableBox;
49 class SwTableLine;
50 class SwTableCursor;
51 class SwTableBoxFormat;
52 class SwChartDataProvider;
53 class SwFrameFormat;
55 typedef
56 cppu::WeakImplHelper
58 ::com::sun::star::table::XCell,
59 ::com::sun::star::lang::XServiceInfo,
60 ::com::sun::star::beans::XPropertySet,
61 ::com::sun::star::container::XEnumerationAccess
63 SwXCellBaseClass;
64 class SwXCell SAL_FINAL : public SwXCellBaseClass,
65 public SwXText,
66 public SwClient
68 friend void sw_setString( SwXCell &rCell, const OUString &rText,
69 bool bKeepNumberFormat );
70 friend double sw_getValue( SwXCell &rCell );
71 friend void sw_setValue( SwXCell &rCell, double nVal );
73 const SfxItemPropertySet* m_pPropSet;
74 SwTableBox* pBox; // only set in non-XML import
75 const SwStartNode* pStartNode; // only set in XML import
77 // table position where pBox was found last
78 size_t nFndPos;
79 static size_t const NOTFOUND = SAL_MAX_SIZE;
81 protected:
82 virtual const SwStartNode *GetStartNode() const SAL_OVERRIDE;
84 virtual ::com::sun::star::uno::Reference<
85 ::com::sun::star::text::XTextCursor >
86 CreateCursor()
87 throw (::com::sun::star::uno::RuntimeException) SAL_OVERRIDE;
89 bool IsValid() const;
91 virtual ~SwXCell();
93 //SwClient
94 virtual void Modify( const SfxPoolItem* pOld, const SfxPoolItem *pNew) SAL_OVERRIDE;
95 virtual void SwClientNotify(const SwModify&, const SfxHint&) SAL_OVERRIDE;
97 public:
98 SwXCell(SwFrameFormat* pTableFormat, SwTableBox* pBox, size_t nPos = NOTFOUND);
99 SwXCell(SwFrameFormat* pTableFormat, const SwStartNode& rStartNode); // XML import interface
101 TYPEINFO_OVERRIDE();
103 static const ::com::sun::star::uno::Sequence< sal_Int8 > & getUnoTunnelId();
105 //XUnoTunnel
106 virtual sal_Int64 SAL_CALL getSomething( const ::com::sun::star::uno::Sequence< sal_Int8 >& aIdentifier ) throw(::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
108 virtual ::com::sun::star::uno::Any SAL_CALL queryInterface( const ::com::sun::star::uno::Type& aType ) throw(::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
109 virtual void SAL_CALL acquire( ) throw() SAL_OVERRIDE;
110 virtual void SAL_CALL release( ) throw() SAL_OVERRIDE;
112 //XTypeProvider
113 virtual ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Type > SAL_CALL getTypes( ) throw(::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
114 virtual ::com::sun::star::uno::Sequence< sal_Int8 > SAL_CALL getImplementationId( ) throw(::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
116 //XCell
117 virtual OUString SAL_CALL getFormula( ) throw(::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
118 virtual void SAL_CALL setFormula( const OUString& aFormula ) throw(::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
119 virtual double SAL_CALL getValue( ) throw(::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
120 virtual void SAL_CALL setValue( double nValue ) throw(::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
121 virtual ::com::sun::star::table::CellContentType SAL_CALL getType( ) throw(::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
122 virtual sal_Int32 SAL_CALL getError( ) throw(::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
124 //XText
125 virtual ::com::sun::star::uno::Reference< ::com::sun::star::text::XTextCursor > SAL_CALL createTextCursor() throw( ::com::sun::star::uno::RuntimeException, std::exception ) SAL_OVERRIDE;
126 virtual ::com::sun::star::uno::Reference< ::com::sun::star::text::XTextCursor > SAL_CALL createTextCursorByRange(const ::com::sun::star::uno::Reference< ::com::sun::star::text::XTextRange > & aTextPosition) throw( ::com::sun::star::uno::RuntimeException, std::exception ) SAL_OVERRIDE;
127 virtual void SAL_CALL setString(const OUString& aString) throw( ::com::sun::star::uno::RuntimeException, std::exception ) SAL_OVERRIDE;
129 //XPropertySet
130 virtual ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySetInfo > SAL_CALL getPropertySetInfo( ) throw(::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
131 virtual void SAL_CALL setPropertyValue( const OUString& aPropertyName, const ::com::sun::star::uno::Any& aValue ) throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::beans::PropertyVetoException, ::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
132 virtual ::com::sun::star::uno::Any SAL_CALL getPropertyValue( const OUString& PropertyName ) throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
133 virtual void SAL_CALL addPropertyChangeListener( const OUString& aPropertyName, const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertyChangeListener >& xListener ) throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
134 virtual void SAL_CALL removePropertyChangeListener( const OUString& aPropertyName, const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertyChangeListener >& aListener ) throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
135 virtual void SAL_CALL addVetoableChangeListener( const OUString& PropertyName, const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XVetoableChangeListener >& aListener ) throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
136 virtual void SAL_CALL removeVetoableChangeListener( const OUString& PropertyName, const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XVetoableChangeListener >& aListener ) throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
138 //XServiceInfo
139 virtual OUString SAL_CALL getImplementationName() throw( ::com::sun::star::uno::RuntimeException, std::exception ) SAL_OVERRIDE;
140 virtual sal_Bool SAL_CALL supportsService(const OUString& ServiceName) throw( ::com::sun::star::uno::RuntimeException, std::exception ) SAL_OVERRIDE;
141 virtual ::com::sun::star::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames() throw( ::com::sun::star::uno::RuntimeException, std::exception ) SAL_OVERRIDE;
143 //XEnumerationAccess - was: XParagraphEnumerationAccess
144 virtual ::com::sun::star::uno::Reference< ::com::sun::star::container::XEnumeration > SAL_CALL createEnumeration() throw( ::com::sun::star::uno::RuntimeException, std::exception ) SAL_OVERRIDE;
146 //XElementAccess
147 virtual ::com::sun::star::uno::Type SAL_CALL getElementType( ) throw(::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
148 virtual sal_Bool SAL_CALL hasElements( ) throw(::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
150 SwTableBox* GetTableBox()const {return pBox;}
151 static SwXCell* CreateXCell(SwFrameFormat* pTableFormat, SwTableBox* pBox, SwTable *pTable = 0 );
152 SwTableBox* FindBox(SwTable* pTable, SwTableBox* pBox);
154 SwFrameFormat* GetFrameFormat() const { return const_cast<SwFrameFormat*>(static_cast<const SwFrameFormat*>(GetRegisteredIn())); }
157 class SwXTextTableRow SAL_FINAL : public cppu::WeakImplHelper
159 ::com::sun::star::beans::XPropertySet,
160 ::com::sun::star::lang::XServiceInfo
162 public SwClient
164 const SfxItemPropertySet* m_pPropSet;
165 SwTableLine* pLine;
167 SwFrameFormat* GetFrameFormat() { return static_cast<SwFrameFormat*>(GetRegisteredIn()); }
168 const SwFrameFormat* GetFrameFormat() const { return const_cast<SwXTextTableRow*>(this)->GetFrameFormat(); }
169 protected:
170 virtual ~SwXTextTableRow();
171 //SwClient
172 virtual void Modify( const SfxPoolItem* pOld, const SfxPoolItem *pNew) SAL_OVERRIDE;
173 virtual void SwClientNotify(const SwModify&, const SfxHint&) SAL_OVERRIDE;
175 public:
176 SwXTextTableRow(SwFrameFormat* pFormat, SwTableLine* pLine);
178 TYPEINFO_OVERRIDE();
180 //XPropertySet
181 virtual ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySetInfo > SAL_CALL getPropertySetInfo( ) throw(::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
182 virtual void SAL_CALL setPropertyValue( const OUString& aPropertyName, const ::com::sun::star::uno::Any& aValue )
183 throw(::com::sun::star::beans::UnknownPropertyException,
184 ::com::sun::star::beans::PropertyVetoException,
185 ::com::sun::star::lang::IllegalArgumentException,
186 ::com::sun::star::lang::WrappedTargetException,
187 ::com::sun::star::uno::RuntimeException,
188 std::exception) SAL_OVERRIDE;
189 virtual ::com::sun::star::uno::Any SAL_CALL getPropertyValue( const OUString& PropertyName ) throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
190 virtual void SAL_CALL addPropertyChangeListener( const OUString& aPropertyName, const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertyChangeListener >& xListener ) throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
191 virtual void SAL_CALL removePropertyChangeListener( const OUString& aPropertyName, const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertyChangeListener >& aListener ) throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
192 virtual void SAL_CALL addVetoableChangeListener( const OUString& PropertyName, const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XVetoableChangeListener >& aListener ) throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
193 virtual void SAL_CALL removeVetoableChangeListener( const OUString& PropertyName, const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XVetoableChangeListener >& aListener ) throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
195 //XServiceInfo
196 virtual OUString SAL_CALL getImplementationName() throw( ::com::sun::star::uno::RuntimeException, std::exception ) SAL_OVERRIDE;
197 virtual sal_Bool SAL_CALL supportsService(const OUString& ServiceName) throw( ::com::sun::star::uno::RuntimeException, std::exception ) SAL_OVERRIDE;
198 virtual ::com::sun::star::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames() throw( ::com::sun::star::uno::RuntimeException, std::exception ) SAL_OVERRIDE;
200 const SwTableLine* GetTableRow() const {return pLine;}
201 static SwTableLine* FindLine(SwTable* pTable, SwTableLine* pLine);
204 typedef cppu::WeakImplHelper<
205 ::com::sun::star::text::XTextTableCursor,
206 ::com::sun::star::lang::XServiceInfo,
207 ::com::sun::star::beans::XPropertySet
208 > SwXTextTableCursor_Base;
209 class SW_DLLPUBLIC SwXTextTableCursor : public SwXTextTableCursor_Base
210 ,public SwClient
211 ,public OTextCursorHelper
213 SwDepend aCrsrDepend;
214 const SfxItemPropertySet* m_pPropSet;
216 protected:
217 virtual ~SwXTextTableCursor();
218 public:
219 SwXTextTableCursor(SwFrameFormat* pFormat, SwTableBox* pBox);
220 SwXTextTableCursor(SwFrameFormat& rTableFormat,
221 const SwTableCursor* pTableSelection);
223 DECLARE_XINTERFACE()
225 //XTextTableCursor
226 virtual OUString SAL_CALL getRangeName()
227 throw (::com::sun::star::uno::RuntimeException,
228 std::exception) SAL_OVERRIDE;
229 virtual sal_Bool SAL_CALL gotoCellByName( const OUString& aCellName, sal_Bool bExpand ) throw(::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
230 virtual sal_Bool SAL_CALL goLeft( sal_Int16 nCount, sal_Bool bExpand ) throw(::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
231 virtual sal_Bool SAL_CALL goRight( sal_Int16 nCount, sal_Bool bExpand ) throw(::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
232 virtual sal_Bool SAL_CALL goUp( sal_Int16 nCount, sal_Bool bExpand ) throw(::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
233 virtual sal_Bool SAL_CALL goDown( sal_Int16 nCount, sal_Bool bExpand ) throw(::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
234 virtual void SAL_CALL gotoStart( sal_Bool bExpand ) throw(::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
235 virtual void SAL_CALL gotoEnd( sal_Bool bExpand ) throw(::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
236 virtual sal_Bool SAL_CALL mergeRange()
237 throw (::com::sun::star::uno::RuntimeException,
238 std::exception) SAL_OVERRIDE;
239 virtual sal_Bool SAL_CALL splitRange( sal_Int16 Count, sal_Bool Horizontal )
240 throw (::com::sun::star::uno::RuntimeException,
241 std::exception) SAL_OVERRIDE;
243 //XPropertySet
244 virtual ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySetInfo > SAL_CALL getPropertySetInfo( ) throw(::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
245 virtual void SAL_CALL setPropertyValue( const OUString& aPropertyName, const ::com::sun::star::uno::Any& aValue )
246 throw (::com::sun::star::beans::UnknownPropertyException,
247 ::com::sun::star::beans::PropertyVetoException,
248 ::com::sun::star::lang::IllegalArgumentException,
249 ::com::sun::star::lang::WrappedTargetException,
250 ::com::sun::star::uno::RuntimeException,
251 std::exception) SAL_OVERRIDE;
252 virtual ::com::sun::star::uno::Any SAL_CALL getPropertyValue( const OUString& PropertyName )
253 throw (::com::sun::star::beans::UnknownPropertyException,
254 ::com::sun::star::lang::WrappedTargetException,
255 ::com::sun::star::uno::RuntimeException,
256 std::exception) SAL_OVERRIDE;
257 virtual void SAL_CALL addPropertyChangeListener( const OUString& aPropertyName, const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertyChangeListener >& xListener ) throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
258 virtual void SAL_CALL removePropertyChangeListener( const OUString& aPropertyName, const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertyChangeListener >& aListener ) throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
259 virtual void SAL_CALL addVetoableChangeListener( const OUString& PropertyName, const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XVetoableChangeListener >& aListener ) throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
260 virtual void SAL_CALL removeVetoableChangeListener( const OUString& PropertyName, const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XVetoableChangeListener >& aListener ) throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
262 //XServiceInfo
263 virtual OUString SAL_CALL getImplementationName() throw( ::com::sun::star::uno::RuntimeException, std::exception ) SAL_OVERRIDE;
264 virtual sal_Bool SAL_CALL supportsService(const OUString& ServiceName) throw( ::com::sun::star::uno::RuntimeException, std::exception ) SAL_OVERRIDE;
265 virtual ::com::sun::star::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames() throw( ::com::sun::star::uno::RuntimeException, std::exception ) SAL_OVERRIDE;
267 //SwClient
268 virtual void Modify( const SfxPoolItem* pOld, const SfxPoolItem *pNew) SAL_OVERRIDE;
270 // ITextCursorHelper
271 virtual const SwPaM* GetPaM() const SAL_OVERRIDE;
272 virtual SwPaM* GetPaM() SAL_OVERRIDE;
273 virtual const SwDoc* GetDoc() const SAL_OVERRIDE;
274 virtual SwDoc* GetDoc() SAL_OVERRIDE;
276 const SwUnoCrsr* GetCrsr() const;
277 SwUnoCrsr* GetCrsr();
278 SwFrameFormat* GetFrameFormat() const { return const_cast<SwFrameFormat*>(static_cast<const SwFrameFormat*>(GetRegisteredIn())); }
281 struct SwRangeDescriptor
283 sal_Int32 nTop;
284 sal_Int32 nLeft;
285 sal_Int32 nBottom;
286 sal_Int32 nRight;
288 void Normalize();
291 class SwTableProperties_Impl;
292 class SwXTextTable : public cppu::WeakImplHelper
294 ::com::sun::star::text::XTextTable,
295 ::com::sun::star::lang::XServiceInfo,
296 ::com::sun::star::table::XCellRange,
297 ::com::sun::star::chart::XChartDataArray,
298 ::com::sun::star::beans::XPropertySet,
299 ::com::sun::star::container::XNamed,
300 ::com::sun::star::table::XAutoFormattable,
301 ::com::sun::star::util::XSortable,
302 ::com::sun::star::lang::XUnoTunnel,
303 ::com::sun::star::sheet::XCellRangeData
305 public SwClient
307 private:
308 class Impl;
309 ::sw::UnoImplPtr<Impl> m_pImpl;
310 ::com::sun::star::uno::WeakReference< ::com::sun::star::table::XTableRows > m_xRows;
311 ::com::sun::star::uno::WeakReference< ::com::sun::star::table::XTableColumns > m_xColumns;
313 const SfxItemPropertySet* m_pPropSet;
315 // Descriptor-interface
316 SwTableProperties_Impl* pTableProps;
317 OUString m_sTableName;
318 bool bIsDescriptor;
319 unsigned short nRows;
320 unsigned short nColumns;
322 bool m_bFirstRowAsLabel;
323 bool m_bFirstColumnAsLabel;
324 protected:
325 virtual ~SwXTextTable();
326 SwXTextTable();
327 SwXTextTable(SwFrameFormat& rFrameFormat);
329 public:
330 static css::uno::Reference<css::text::XTextTable>
331 CreateXTextTable(SwFrameFormat * pFrameFormat);
333 SW_DLLPUBLIC static const ::com::sun::star::uno::Sequence< sal_Int8 > & getUnoTunnelId();
335 //XUnoTunnel
336 virtual sal_Int64 SAL_CALL getSomething( const ::com::sun::star::uno::Sequence< sal_Int8 >& aIdentifier ) throw(::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
338 TYPEINFO_OVERRIDE();
340 //XTextTable
341 virtual void SAL_CALL initialize( sal_Int32 nRows, sal_Int32 nColumns ) throw(::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
342 virtual ::com::sun::star::uno::Reference< ::com::sun::star::table::XTableRows > SAL_CALL getRows( ) throw(::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
343 virtual ::com::sun::star::uno::Reference< ::com::sun::star::table::XTableColumns > SAL_CALL getColumns( ) throw(::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
344 virtual ::com::sun::star::uno::Reference< ::com::sun::star::table::XCell > SAL_CALL getCellByName( const OUString& aCellName ) throw(::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
345 virtual ::com::sun::star::uno::Sequence< OUString > SAL_CALL getCellNames( ) throw(::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
346 virtual ::com::sun::star::uno::Reference< ::com::sun::star::text::XTextTableCursor > SAL_CALL createCursorByCellName( const OUString& aCellName )
347 throw (::com::sun::star::uno::RuntimeException,
348 std::exception) SAL_OVERRIDE;
350 //XTextContent
351 virtual void SAL_CALL attach(const ::com::sun::star::uno::Reference< ::com::sun::star::text::XTextRange > & xTextRange) throw( ::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::uno::RuntimeException, std::exception ) SAL_OVERRIDE;
352 virtual ::com::sun::star::uno::Reference< ::com::sun::star::text::XTextRange > SAL_CALL getAnchor( ) throw(::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
354 //XComponent
355 virtual void SAL_CALL dispose() throw( ::com::sun::star::uno::RuntimeException, std::exception ) SAL_OVERRIDE;
356 virtual void SAL_CALL addEventListener(const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XEventListener > & aListener) throw( ::com::sun::star::uno::RuntimeException, std::exception ) SAL_OVERRIDE;
357 virtual void SAL_CALL removeEventListener(const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XEventListener > & aListener) throw( ::com::sun::star::uno::RuntimeException, std::exception ) SAL_OVERRIDE;
359 //XCellRange
360 virtual ::com::sun::star::uno::Reference< ::com::sun::star::table::XCell > SAL_CALL getCellByPosition( sal_Int32 nColumn, sal_Int32 nRow ) throw( ::com::sun::star::lang::IndexOutOfBoundsException, ::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
361 virtual ::com::sun::star::uno::Reference< ::com::sun::star::table::XCellRange > SAL_CALL getCellRangeByPosition( sal_Int32 nLeft, sal_Int32 nTop, sal_Int32 nRight, sal_Int32 nBottom )
362 throw (com::sun::star::lang::IndexOutOfBoundsException,
363 ::com::sun::star::uno::RuntimeException,
364 std::exception) SAL_OVERRIDE;
365 virtual ::com::sun::star::uno::Reference< ::com::sun::star::table::XCellRange > SAL_CALL getCellRangeByName( const OUString& aRange )
366 throw (::com::sun::star::uno::RuntimeException,
367 std::exception) SAL_OVERRIDE;
369 //XChartDataArray
370 virtual ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Sequence< double > > SAL_CALL getData( ) throw(::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
371 virtual void SAL_CALL setData( const ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Sequence< double > >& aData ) throw(::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
372 virtual ::com::sun::star::uno::Sequence< OUString > SAL_CALL getRowDescriptions( ) throw(::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
373 virtual void SAL_CALL setRowDescriptions( const ::com::sun::star::uno::Sequence< OUString >& aRowDescriptions ) throw(::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
374 virtual ::com::sun::star::uno::Sequence< OUString > SAL_CALL getColumnDescriptions( ) throw(::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
375 virtual void SAL_CALL setColumnDescriptions( const ::com::sun::star::uno::Sequence< OUString >& aColumnDescriptions ) throw(::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
377 //XChartData
378 virtual void SAL_CALL addChartDataChangeEventListener( const ::com::sun::star::uno::Reference< ::com::sun::star::chart::XChartDataChangeEventListener >& aListener ) throw(::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
379 virtual void SAL_CALL removeChartDataChangeEventListener( const ::com::sun::star::uno::Reference< ::com::sun::star::chart::XChartDataChangeEventListener >& aListener ) throw(::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
380 virtual double SAL_CALL getNotANumber( ) throw(::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
381 virtual sal_Bool SAL_CALL isNotANumber( double nNumber ) throw(::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
383 //XSortable
384 virtual ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue > SAL_CALL createSortDescriptor() throw( ::com::sun::star::uno::RuntimeException, std::exception ) SAL_OVERRIDE;
385 virtual void SAL_CALL sort(const ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue >& xDescriptor)
386 throw (::com::sun::star::uno::RuntimeException,
387 std::exception) SAL_OVERRIDE;
389 //XAutoFormattable
390 virtual void SAL_CALL autoFormat(const OUString& aName)
391 throw (::com::sun::star::lang::IllegalArgumentException,
392 ::com::sun::star::uno::RuntimeException,
393 std::exception) SAL_OVERRIDE;
395 //XPropertySet
396 virtual ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySetInfo > SAL_CALL getPropertySetInfo( ) throw(::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
397 virtual void SAL_CALL setPropertyValue( const OUString& aPropertyName, const ::com::sun::star::uno::Any& aValue )
398 throw(::com::sun::star::beans::UnknownPropertyException,
399 ::com::sun::star::beans::PropertyVetoException,
400 ::com::sun::star::lang::IllegalArgumentException,
401 ::com::sun::star::lang::WrappedTargetException,
402 ::com::sun::star::uno::RuntimeException,
403 std::exception) SAL_OVERRIDE;
404 virtual ::com::sun::star::uno::Any SAL_CALL getPropertyValue( const OUString& PropertyName )
405 throw (::com::sun::star::beans::UnknownPropertyException,
406 ::com::sun::star::lang::WrappedTargetException,
407 ::com::sun::star::uno::RuntimeException,
408 std::exception) SAL_OVERRIDE;
409 virtual void SAL_CALL addPropertyChangeListener( const OUString& aPropertyName, const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertyChangeListener >& xListener ) throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
410 virtual void SAL_CALL removePropertyChangeListener( const OUString& aPropertyName, const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertyChangeListener >& aListener ) throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
411 virtual void SAL_CALL addVetoableChangeListener( const OUString& PropertyName, const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XVetoableChangeListener >& aListener ) throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
412 virtual void SAL_CALL removeVetoableChangeListener( const OUString& PropertyName, const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XVetoableChangeListener >& aListener ) throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
414 //XNamed
415 virtual OUString SAL_CALL getName() throw( ::com::sun::star::uno::RuntimeException, std::exception ) SAL_OVERRIDE;
416 virtual void SAL_CALL setName(const OUString& Name_) throw( ::com::sun::star::uno::RuntimeException, std::exception ) SAL_OVERRIDE;
418 //XCellRangeData
419 virtual ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Any > > SAL_CALL getDataArray( ) throw (::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
420 virtual void SAL_CALL setDataArray( const ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Any > >& aArray ) throw (::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
422 //XServiceInfo
423 virtual OUString SAL_CALL getImplementationName() throw( ::com::sun::star::uno::RuntimeException, std::exception ) SAL_OVERRIDE;
424 virtual sal_Bool SAL_CALL supportsService(const OUString& ServiceName) throw( ::com::sun::star::uno::RuntimeException, std::exception ) SAL_OVERRIDE;
425 virtual ::com::sun::star::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames() throw( ::com::sun::star::uno::RuntimeException, std::exception ) SAL_OVERRIDE;
427 void attachToRange(const ::com::sun::star::uno::Reference< ::com::sun::star::text::XTextRange > & xTextRange)throw( ::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::uno::RuntimeException );
429 sal_uInt16 getRowCount();
430 sal_uInt16 getColumnCount();
431 static ::com::sun::star::uno::Reference< ::com::sun::star::table::XCellRange > GetRangeByName(SwFrameFormat* pFormat, SwTable* pTable,
432 const OUString& sTLName, const OUString& sBRName,
433 SwRangeDescriptor& rDesc);
435 //SwClient
436 virtual void Modify( const SfxPoolItem* pOld, const SfxPoolItem *pNew) SAL_OVERRIDE;
438 SwFrameFormat* GetFrameFormat() const { return const_cast<SwFrameFormat*>(static_cast<const SwFrameFormat*>(GetRegisteredIn())); }
441 class SwXCellRange : public cppu::WeakImplHelper
443 ::com::sun::star::table::XCellRange,
444 ::com::sun::star::lang::XServiceInfo,
445 ::com::sun::star::lang::XUnoTunnel,
446 ::com::sun::star::beans::XPropertySet,
447 ::com::sun::star::chart::XChartDataArray,
448 ::com::sun::star::util::XSortable,
449 ::com::sun::star::sheet::XCellRangeData
451 public SwClient
453 SwDepend aCursorDepend; //the cursor is removed after the doc has been removed
454 ::osl::Mutex m_Mutex;
455 ::cppu::OInterfaceContainerHelper m_ChartListeners;
457 SwRangeDescriptor aRgDesc;
458 const SfxItemPropertySet* m_pPropSet;
460 SwUnoCrsr* pTableCrsr;
462 bool m_bFirstRowAsLabel;
463 bool m_bFirstColumnAsLabel;
464 std::tuple<sal_uInt32, sal_uInt32, sal_uInt32, sal_uInt32> getLabelCoordinates(bool bRow);
465 css::uno::Sequence<OUString> getLabelDescriptions(bool bRow);
466 void setLabelDescriptions(const css::uno::Sequence<OUString>& rDesc, bool bRow);
468 public:
469 SwXCellRange(SwUnoCrsr* pCrsr, SwFrameFormat& rFrameFormat, SwRangeDescriptor& rDesc);
470 void SetLabels(bool bFirstRowAsLabel, bool bFirstColumnAsLabel)
471 { m_bFirstRowAsLabel = bFirstRowAsLabel, m_bFirstColumnAsLabel = bFirstColumnAsLabel; }
472 std::vector< css::uno::Reference< css::table::XCell > > getCells();
473 virtual ~SwXCellRange();
475 TYPEINFO_OVERRIDE();
477 static const ::com::sun::star::uno::Sequence< sal_Int8 > & getUnoTunnelId();
479 //XUnoTunnel
480 virtual sal_Int64 SAL_CALL getSomething( const ::com::sun::star::uno::Sequence< sal_Int8 >& aIdentifier ) throw(::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
482 //XCellRange
483 virtual ::com::sun::star::uno::Reference< ::com::sun::star::table::XCell > SAL_CALL getCellByPosition( sal_Int32 nColumn, sal_Int32 nRow ) throw( ::com::sun::star::lang::IndexOutOfBoundsException, ::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
484 virtual ::com::sun::star::uno::Reference< ::com::sun::star::table::XCellRange > SAL_CALL getCellRangeByPosition( sal_Int32 nLeft, sal_Int32 nTop, sal_Int32 nRight, sal_Int32 nBottom )
485 throw (::com::sun::star::lang::IndexOutOfBoundsException,
486 ::com::sun::star::uno::RuntimeException,
487 std::exception) SAL_OVERRIDE;
488 virtual ::com::sun::star::uno::Reference< ::com::sun::star::table::XCellRange > SAL_CALL getCellRangeByName( const OUString& aRange ) throw(::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
490 //XPropertySet
491 virtual ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySetInfo > SAL_CALL getPropertySetInfo( ) throw(::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
492 virtual void SAL_CALL setPropertyValue(const OUString& aPropertyName, const ::com::sun::star::uno::Any& aValue)
493 throw (::com::sun::star::beans::UnknownPropertyException,
494 ::com::sun::star::beans::PropertyVetoException,
495 ::com::sun::star::lang::IllegalArgumentException,
496 ::com::sun::star::lang::WrappedTargetException,
497 ::com::sun::star::uno::RuntimeException,
498 std::exception) SAL_OVERRIDE;
499 virtual ::com::sun::star::uno::Any SAL_CALL getPropertyValue(const OUString& PropertyName)
500 throw (::com::sun::star::beans::UnknownPropertyException,
501 ::com::sun::star::lang::WrappedTargetException,
502 ::com::sun::star::uno::RuntimeException,
503 std::exception) SAL_OVERRIDE;
504 virtual void SAL_CALL addPropertyChangeListener( const OUString& aPropertyName, const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertyChangeListener >& xListener ) throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
505 virtual void SAL_CALL removePropertyChangeListener( const OUString& aPropertyName, const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertyChangeListener >& aListener ) throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
506 virtual void SAL_CALL addVetoableChangeListener( const OUString& PropertyName, const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XVetoableChangeListener >& aListener ) throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
507 virtual void SAL_CALL removeVetoableChangeListener( const OUString& PropertyName, const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XVetoableChangeListener >& aListener ) throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
509 //XChartData
510 virtual void SAL_CALL addChartDataChangeEventListener( const ::com::sun::star::uno::Reference< ::com::sun::star::chart::XChartDataChangeEventListener >& aListener ) throw(::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
511 virtual void SAL_CALL removeChartDataChangeEventListener( const ::com::sun::star::uno::Reference< ::com::sun::star::chart::XChartDataChangeEventListener >& aListener ) throw(::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
512 virtual double SAL_CALL getNotANumber( ) throw(::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
513 virtual sal_Bool SAL_CALL isNotANumber( double nNumber ) throw(::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
515 //XChartDataArray
516 virtual ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Sequence< double > > SAL_CALL getData( ) throw(::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
517 virtual void SAL_CALL setData( const ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Sequence< double > >& aData ) throw(::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
518 virtual ::com::sun::star::uno::Sequence< OUString > SAL_CALL getRowDescriptions( ) throw(::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
519 virtual void SAL_CALL setRowDescriptions( const ::com::sun::star::uno::Sequence< OUString >& aRowDescriptions ) throw(::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
520 virtual ::com::sun::star::uno::Sequence< OUString > SAL_CALL getColumnDescriptions( ) throw(::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
521 virtual void SAL_CALL setColumnDescriptions( const ::com::sun::star::uno::Sequence< OUString >& aColumnDescriptions ) throw(::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
523 //XSortable
524 virtual ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue > SAL_CALL createSortDescriptor() throw( ::com::sun::star::uno::RuntimeException, std::exception ) SAL_OVERRIDE;
525 virtual void SAL_CALL sort(const ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue >& xDescriptor)
526 throw (::com::sun::star::uno::RuntimeException,
527 std::exception) SAL_OVERRIDE;
529 //XCellRangeData
530 virtual ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Any > > SAL_CALL getDataArray( ) throw (::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
531 virtual void SAL_CALL setDataArray( const ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Any > >& aArray ) throw (::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
533 //XServiceInfo
534 virtual OUString SAL_CALL getImplementationName() throw( ::com::sun::star::uno::RuntimeException, std::exception ) SAL_OVERRIDE;
535 virtual sal_Bool SAL_CALL supportsService(const OUString& ServiceName) throw( ::com::sun::star::uno::RuntimeException, std::exception ) SAL_OVERRIDE;
536 virtual ::com::sun::star::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames() throw( ::com::sun::star::uno::RuntimeException, std::exception ) SAL_OVERRIDE;
538 //SwClient
539 virtual void Modify( const SfxPoolItem* pOld, const SfxPoolItem *pNew) SAL_OVERRIDE;
541 SwFrameFormat* GetFrameFormat() const { return const_cast<SwFrameFormat*>(static_cast<const SwFrameFormat*>(GetRegisteredIn())); }
542 sal_uInt16 getRowCount();
543 sal_uInt16 getColumnCount();
545 const SwUnoCrsr* GetTableCrsr() const;
547 // for SwChartDataSequence
548 void GetDataSequence(
549 ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Any > *pAnySeq,
550 ::com::sun::star::uno::Sequence< OUString > *pTextSeq,
551 ::com::sun::star::uno::Sequence< double > *pDblSeq,
552 bool bForceNumberResults = false ) throw (::com::sun::star::uno::RuntimeException);
556 class SwXTableRows SAL_FINAL : public cppu::WeakImplHelper
558 ::com::sun::star::table::XTableRows,
559 ::com::sun::star::lang::XServiceInfo
561 public SwClient
564 SwFrameFormat* GetFrameFormat() { return static_cast<SwFrameFormat*>(GetRegisteredIn()); }
565 const SwFrameFormat* GetFrameFormat() const { return const_cast<SwXTableRows*>(this)->GetFrameFormat(); }
566 protected:
567 virtual ~SwXTableRows();
568 public:
569 SwXTableRows(SwFrameFormat& rFrameFormat);
571 TYPEINFO_OVERRIDE();
573 //XIndexAccess
574 virtual sal_Int32 SAL_CALL getCount() throw( ::com::sun::star::uno::RuntimeException, std::exception ) SAL_OVERRIDE;
575 virtual ::com::sun::star::uno::Any SAL_CALL getByIndex(sal_Int32 nIndex) throw( ::com::sun::star::lang::IndexOutOfBoundsException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException, std::exception ) SAL_OVERRIDE;
577 //XElementAccess
578 virtual ::com::sun::star::uno::Type SAL_CALL getElementType( ) throw(::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
579 virtual sal_Bool SAL_CALL hasElements( ) throw(::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
581 //XTableRows
582 virtual void SAL_CALL insertByIndex(sal_Int32 nIndex, sal_Int32 nCount)
583 throw (::com::sun::star::uno::RuntimeException,
584 std::exception) SAL_OVERRIDE;
585 virtual void SAL_CALL removeByIndex(sal_Int32 nIndex, sal_Int32 nCount)
586 throw (::com::sun::star::uno::RuntimeException,
587 std::exception) SAL_OVERRIDE;
589 //XServiceInfo
590 virtual OUString SAL_CALL getImplementationName() throw( ::com::sun::star::uno::RuntimeException, std::exception ) SAL_OVERRIDE;
591 virtual sal_Bool SAL_CALL supportsService(const OUString& ServiceName) throw( ::com::sun::star::uno::RuntimeException, std::exception ) SAL_OVERRIDE;
592 virtual ::com::sun::star::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames() throw( ::com::sun::star::uno::RuntimeException, std::exception ) SAL_OVERRIDE;
594 //SwClient
595 virtual void Modify( const SfxPoolItem* pOld, const SfxPoolItem *pNew) SAL_OVERRIDE;
598 class SwXTableColumns : public cppu::WeakImplHelper
600 ::com::sun::star::table::XTableColumns,
601 ::com::sun::star::lang::XServiceInfo
603 public SwClient
606 SwFrameFormat* GetFrameFormat() const { return const_cast<SwFrameFormat*>(static_cast<const SwFrameFormat*>(GetRegisteredIn())); }
607 protected:
608 virtual ~SwXTableColumns();
609 public:
610 SwXTableColumns(SwFrameFormat& rFrameFormat);
612 TYPEINFO_OVERRIDE();
614 //XIndexAccess
615 virtual sal_Int32 SAL_CALL getCount() throw( ::com::sun::star::uno::RuntimeException, std::exception ) SAL_OVERRIDE;
616 virtual ::com::sun::star::uno::Any SAL_CALL getByIndex(sal_Int32 nIndex) throw( ::com::sun::star::lang::IndexOutOfBoundsException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException, std::exception ) SAL_OVERRIDE;
618 //XElementAccess
619 virtual ::com::sun::star::uno::Type SAL_CALL getElementType( ) throw(::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
620 virtual sal_Bool SAL_CALL hasElements( ) throw(::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
622 //XTableColumns
623 virtual void SAL_CALL insertByIndex(sal_Int32 nIndex, sal_Int32 nCount)
624 throw (::com::sun::star::uno::RuntimeException,
625 std::exception) SAL_OVERRIDE;
626 virtual void SAL_CALL removeByIndex(sal_Int32 nIndex, sal_Int32 nCount)
627 throw (::com::sun::star::uno::RuntimeException,
628 std::exception) SAL_OVERRIDE;
630 //XServiceInfo
631 virtual OUString SAL_CALL getImplementationName() throw( ::com::sun::star::uno::RuntimeException, std::exception ) SAL_OVERRIDE;
632 virtual sal_Bool SAL_CALL supportsService(const OUString& ServiceName) throw( ::com::sun::star::uno::RuntimeException, std::exception ) SAL_OVERRIDE;
633 virtual ::com::sun::star::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames() throw( ::com::sun::star::uno::RuntimeException, std::exception ) SAL_OVERRIDE;
635 //SwClient
636 virtual void Modify( const SfxPoolItem* pOld, const SfxPoolItem *pNew) SAL_OVERRIDE;
639 int sw_CompareCellRanges(
640 const OUString &rRange1StartCell, const OUString &rRange1EndCell,
641 const OUString &rRange2StartCell, const OUString &rRange2EndCell,
642 bool bCmpColsFirst );
644 void sw_NormalizeRange( OUString &rCell1, OUString &rCell2 );
646 void sw_GetCellPosition( const OUString &rCellName, sal_Int32 &rColumn, sal_Int32 &rRow);
648 OUString sw_GetCellName( sal_Int32 nColumn, sal_Int32 nRow );
650 int sw_CompareCellsByColFirst( const OUString &rCellName1, const OUString &rCellName2 );
652 #endif
654 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */