xref: /aoo42x/main/sw/inc/swtable.hxx (revision 1d2dbeb0)
1 /**************************************************************
2  *
3  * Licensed to the Apache Software Foundation (ASF) under one
4  * or more contributor license agreements.  See the NOTICE file
5  * distributed with this work for additional information
6  * regarding copyright ownership.  The ASF licenses this file
7  * to you under the Apache License, Version 2.0 (the
8  * "License"); you may not use this file except in compliance
9  * with the License.  You may obtain a copy of the License at
10  *
11  *   http://www.apache.org/licenses/LICENSE-2.0
12  *
13  * Unless required by applicable law or agreed to in writing,
14  * software distributed under the License is distributed on an
15  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16  * KIND, either express or implied.  See the License for the
17  * specific language governing permissions and limitations
18  * under the License.
19  *
20  *************************************************************/
21 
22 
23 #ifndef _SWTABLE_HXX
24 #define _SWTABLE_HXX
25 #include <tools/mempool.hxx>
26 #include <tools/ref.hxx>
27 #include <svl/svarray.hxx>
28 #include <tblenum.hxx>
29 #include <swtypes.hxx>
30 #include <calbck.hxx>
31 #include <swrect.hxx>
32 #ifndef DBG_UTIL
33 #include <node.hxx>			// fuer StartNode->GetMyIndex
34 #else
35 class SwStartNode;
36 #include <memory>
37 #include <boost/noncopyable.hpp>
38 #endif
39 
40 class SwFmt;
41 class Color;
42 class SwFrmFmt;
43 class SwTableFmt;
44 class SwTableLineFmt;
45 class SwTableBoxFmt;
46 class SwHTMLTableLayout;
47 class SwTableLine;
48 class SwTableBox;
49 class SwTableNode;
50 class SwTabCols;
51 class SwDoc;
52 class SwSelBoxes;
53 class SwTblCalcPara;
54 class SwChartLines;
55 struct SwPosition;
56 class SwNodeIndex;
57 class SwNode;
58 class SfxPoolItem;
59 class SwUndoTblMerge;
60 class SwUndo;
61 class SwPaM;
62 class SwTableBox_Impl;
63 class SwUndoTblCpyTbl;
64 class SwBoxSelection;
65 struct SwSaveRowSpan;
66 struct Parm;
67 
68 #ifndef SW_DECL_SWSERVEROBJECT_DEFINED
69 #define SW_DECL_SWSERVEROBJECT_DEFINED
70 SV_DECL_REF( SwServerObject )
71 #endif
72 
73 SV_DECL_PTRARR_DEL(SwTableLines, SwTableLine*, 10, 20)
74 SV_DECL_PTRARR_DEL(SwTableBoxes, SwTableBox*, 25, 50)
75 
76 // speicher die Inhaltstragenden Box-Pointer zusaetzlich in einem
77 // sortierten Array (fuers rechnen in der Tabelle)
78 typedef SwTableBox* SwTableBoxPtr;
79 SV_DECL_PTRARR_SORT( SwTableSortBoxes, SwTableBoxPtr, 25, 50 )
80 typedef SwTableLine* SwTableLinePtr;
81 
82 class SW_DLLPUBLIC SwTable: public SwClient			 //Client vom FrmFmt
83 {
84 
85 
86 protected:
87 	SwTableLines aLines;
88 	SwTableSortBoxes aSortCntBoxes;
89 	SwServerObjectRef refObj;	// falls DataServer -> Pointer gesetzt
90 
91 	SwHTMLTableLayout *pHTMLLayout;
92 
93     // Usually, the table node of a SwTable can be accessed by getting a box
94     // out of aSortCntBoxes, which know their SwStartNode. But in some rare
95     // cases, we need to know the table node of a SwTable, before the table
96     // boxes have been build (SwTableNode::MakeCopy with tables in tables).
97     SwTableNode* pTableNode;
98 
99 //SOLL das fuer jede Tabelle einstellbar sein?
100 	TblChgMode	eTblChgMode;
101 
102 	sal_uInt16		nGrfsThatResize;	// Anzahl der Grfs, die beim HTML-Import
103 									// noch ein Resize der Tbl. anstossen
104     sal_uInt16      nRowsToRepeat;      // number of rows to repeat on every page
105 
106 	sal_Bool		bModifyLocked	:1;
107     sal_Bool        bNewModel       :1; // sal_False: old SubTableModel; sal_True: new RowSpanModel
108 #ifdef DBG_UTIL
109     bool bDontChangeModel;  // This is set by functions (like Merge()) to forbid a laet model change
110 #endif
111 
IsModifyLocked()112 	sal_Bool IsModifyLocked(){ return bModifyLocked;}
113 
114    virtual void Modify( const SfxPoolItem* pOld, const SfxPoolItem* pNew );
115 
116 public:
117     enum SearchType
118     {
119         SEARCH_NONE, // Default: expand to rectangle
120         SEARCH_ROW,	// row selection
121         SEARCH_COL  // column selection
122     };
123 
124 	TYPEINFO();
125 
126 	// single argument ctors shall be explicit.
127 	explicit SwTable( SwTableFmt* );
128 	virtual ~SwTable();
129 
130 	// @@@ public copy ctor, but no copy assignment?
131 	SwTable( const SwTable& rTable );		// kein Copy der Lines !!
132 private:
133 	// @@@ public copy ctor, but no copy assignment?
134 	SwTable & operator= (const SwTable &);
135 	// no default ctor.
136 	SwTable();
137 	sal_Bool OldMerge( SwDoc*, const SwSelBoxes&, SwTableBox*, SwUndoTblMerge* );
138     sal_Bool OldSplitRow( SwDoc*, const SwSelBoxes&, sal_uInt16, sal_Bool );
139 	sal_Bool NewMerge( SwDoc*, const SwSelBoxes&, const SwSelBoxes& rMerged,
140                    SwTableBox*, SwUndoTblMerge* );
141     sal_Bool NewSplitRow( SwDoc*, const SwSelBoxes&, sal_uInt16, sal_Bool );
142     SwBoxSelection* CollectBoxSelection( const SwPaM& rPam ) const;
143     void InsertSpannedRow( SwDoc* pDoc, sal_uInt16 nIdx, sal_uInt16 nCnt );
144 	sal_Bool _InsertRow( SwDoc*, const SwSelBoxes&,	sal_uInt16 nCnt, sal_Bool bBehind );
145     sal_Bool NewInsertCol( SwDoc*, const SwSelBoxes& rBoxes, sal_uInt16 nCnt, sal_Bool );
146     void _FindSuperfluousRows( SwSelBoxes& rBoxes, SwTableLine*, SwTableLine* );
147     void AdjustWidths( const long nOld, const long nNew );
148     void NewSetTabCols( Parm &rP, const SwTabCols &rNew, const SwTabCols &rOld,
149 					    const SwTableBox *pStart, sal_Bool bCurRowOnly );
150 
151 public:
152 
GetHTMLTableLayout()153 	SwHTMLTableLayout *GetHTMLTableLayout() { return pHTMLLayout; }
GetHTMLTableLayout() const154 	const SwHTMLTableLayout *GetHTMLTableLayout() const { return pHTMLLayout; }
155 	void SetHTMLTableLayout( SwHTMLTableLayout *p );	//Eigentumsuebergang!
156 
IncGrfsThatResize()157 	sal_uInt16 IncGrfsThatResize() { return ++nGrfsThatResize; }
DecGrfsThatResize()158 	sal_uInt16 DecGrfsThatResize() { return nGrfsThatResize ? --nGrfsThatResize : 0; }
159 
LockModify()160 	void LockModify()	{ bModifyLocked = sal_True; }	//Muessen _immer_ paarig
UnlockModify()161 	void UnlockModify()	{ bModifyLocked = sal_False;}	//benutzt werden!
162 
SetTableModel(sal_Bool bNew)163 	void SetTableModel( sal_Bool bNew ){ bNewModel = bNew; }
IsNewModel() const164 	sal_Bool IsNewModel() const { return bNewModel; }
165 
GetRowsToRepeat() const166     sal_uInt16 GetRowsToRepeat() const { return Min( GetTabLines().Count(), nRowsToRepeat ); }
_GetRowsToRepeat() const167     sal_uInt16 _GetRowsToRepeat() const { return nRowsToRepeat; }
SetRowsToRepeat(sal_uInt16 nNumOfRows)168     void SetRowsToRepeat( sal_uInt16 nNumOfRows ) { nRowsToRepeat = nNumOfRows; }
169 
170     bool IsHeadline( const SwTableLine& rLine ) const;
171 
GetTabLines()172 		  SwTableLines &GetTabLines() { return aLines; }
GetTabLines() const173 	const SwTableLines &GetTabLines() const { return aLines; }
174 
GetFrmFmt()175 	SwFrmFmt* GetFrmFmt() 		{ return (SwFrmFmt*)GetRegisteredIn(); }
GetFrmFmt() const176 	SwFrmFmt* GetFrmFmt() const	{ return (SwFrmFmt*)GetRegisteredIn(); }
GetTableFmt() const177 	SwTableFmt* GetTableFmt() const	{ return (SwTableFmt*)GetRegisteredIn(); }
178 
179 	void GetTabCols( SwTabCols &rToFill, const SwTableBox *pStart,
180 					 sal_Bool bHidden = sal_False, sal_Bool bCurRowOnly = sal_False ) const;
181     void SetTabCols( const SwTabCols &rNew, const SwTabCols &rOld,
182 					 const SwTableBox *pStart, sal_Bool bCurRowOnly );
183 
184 // The following functions are for new table model only...
185     void CreateSelection(  const SwPaM& rPam, SwSelBoxes& rBoxes,
186         const SearchType eSearchType, bool bProtect ) const;
187     void CreateSelection( const SwNode* pStart, const SwNode* pEnd,
188         SwSelBoxes& rBoxes, const SearchType eSearchType, bool bProtect ) const;
189     void ExpandSelection( SwSelBoxes& rBoxes ) const;
190     // When a table is splitted into two tables, the row spans which overlaps
191     // the split have to be corrected and stored for undo
192     // SwSavRowSpan is the structure needed by Undo to undo the split operation
193     // CleanUpRowSpan corrects the (top of the) second table and delviers the structure
194     // for Undo
195     SwSaveRowSpan* CleanUpTopRowSpan( sal_uInt16 nSplitLine );
196     // RestoreRowSpan is called by Undo to restore the old row span values
197     void RestoreRowSpan( const SwSaveRowSpan& );
198     // CleanUpBottomRowSpan corrects the overhanging row spans at the end of the first table
199     void CleanUpBottomRowSpan( sal_uInt16 nDelLines );
200 
201 
202 // The following functions are "pseudo-virtual", i.e. they are different for old and new table model
203 // It's not allowed to change the table model after the first call of one of these functions.
204 
Merge(SwDoc * pDoc,const SwSelBoxes & rBoxes,const SwSelBoxes & rMerged,SwTableBox * pMergeBox,SwUndoTblMerge * pUndo=0)205 	sal_Bool Merge( SwDoc* pDoc, const SwSelBoxes& rBoxes, const SwSelBoxes& rMerged,
206 				SwTableBox* pMergeBox, SwUndoTblMerge* pUndo = 0 )
207     {
208 #ifdef DBG_UTIL
209         bDontChangeModel = true;
210 #endif
211         return bNewModel ? NewMerge( pDoc, rBoxes, rMerged, pMergeBox, pUndo ) :
212                            OldMerge( pDoc, rBoxes, pMergeBox, pUndo );
213     }
SplitRow(SwDoc * pDoc,const SwSelBoxes & rBoxes,sal_uInt16 nCnt=1,sal_Bool bSameHeight=sal_False)214     sal_Bool SplitRow( SwDoc* pDoc, const SwSelBoxes& rBoxes, sal_uInt16 nCnt=1,
215                    sal_Bool bSameHeight = sal_False )
216     {
217 #ifdef DBG_UTIL
218         bDontChangeModel = true;
219 #endif
220         return bNewModel ? NewSplitRow( pDoc, rBoxes, nCnt, bSameHeight ) :
221                            OldSplitRow( pDoc, rBoxes, nCnt, bSameHeight );
222     }
223     bool PrepareMerge( const SwPaM& rPam, SwSelBoxes& rBoxes,
224         SwSelBoxes& rMerged, SwTableBox** ppMergeBox, SwUndoTblMerge* pUndo );
225     void ExpandColumnSelection( SwSelBoxes& rBoxes, long &rMin, long &rMax ) const;
226     void PrepareDeleteCol( long nMin, long nMax );
227 
228     sal_Bool InsertCol( SwDoc*, const SwSelBoxes& rBoxes,
229 					sal_uInt16 nCnt = 1, sal_Bool bBehind = sal_True );
230 	sal_Bool InsertRow( SwDoc*, const SwSelBoxes& rBoxes,
231 					sal_uInt16 nCnt = 1, sal_Bool bBehind = sal_True );
232 	sal_Bool AppendRow( SwDoc* pDoc, sal_uInt16 nCnt = 1 );
233     void PrepareDelBoxes( const SwSelBoxes& rBoxes );
234 	sal_Bool DeleteSel( SwDoc*, const SwSelBoxes& rBoxes, const SwSelBoxes* pMerged,
235         SwUndo* pUndo, const sal_Bool bDelMakeFrms, const sal_Bool bCorrBorder );
236 	sal_Bool SplitCol( SwDoc* pDoc, const SwSelBoxes& rBoxes, sal_uInt16 nCnt=1 );
237     sal_Bool Merge( const SwSelBoxes& rBoxes,
238 				SwTableBox* pMergeBox, SwUndoTblMerge* = 0 );
239 
FindSuperfluousRows(SwSelBoxes & rBoxes)240     void FindSuperfluousRows( SwSelBoxes& rBoxes )
241         { _FindSuperfluousRows( rBoxes, 0, 0 ); }
242     void CheckRowSpan( SwTableLinePtr &rpLine, bool bUp ) const;
243 
GetTabSortBoxes()244 		  SwTableSortBoxes& GetTabSortBoxes() 		{ return aSortCntBoxes; }
GetTabSortBoxes() const245 	const SwTableSortBoxes& GetTabSortBoxes() const { return aSortCntBoxes; }
246 
247 		// lese die 1. Nummer und loesche sie aus dem String
248 		// (wird von GetTblBox und SwTblFld benutzt)
249     // --> OD 2007-08-03 #i80314#
250     // add 3rd parameter in order to control validation check on <rStr>
251     static sal_uInt16 _GetBoxNum( String& rStr,
252                               sal_Bool bFirst = sal_False,
253                               const bool bPerformValidCheck = false );
254     // <--
255 		// suche die Inhaltstragende Box mit dem Namen
256     // --> OD 2007-08-03 #i80314#
257     // add 2nd parameter in order to control validation check in called method
258     // <_GetBoxNum(..)>
259     const SwTableBox* GetTblBox( const String& rName,
260                                  const bool bPerformValidCheck = false ) const;
261     // <--
262 		// kopiere die selektierten Boxen in ein anderes Dokument.
263 	sal_Bool MakeCopy( SwDoc*, const SwPosition&, const SwSelBoxes&,
264 					sal_Bool bCpyNds = sal_True, sal_Bool bCpyName = sal_False ) const;
265 		// kopiere die Tabelle in diese. (die Logik steht im TBLRWCL.CXX)
266 	sal_Bool InsTable( const SwTable& rCpyTbl, const SwNodeIndex&,
267 					SwUndoTblCpyTbl* pUndo = 0 );
268 	sal_Bool InsTable( const SwTable& rCpyTbl, const SwSelBoxes&,
269 					SwUndoTblCpyTbl* pUndo = 0 );
270 	sal_Bool InsNewTable( const SwTable& rCpyTbl, const SwSelBoxes&,
271 					  SwUndoTblCpyTbl* pUndo );
272 		// kopiere die Headline (mit Inhalt!) der Tabelle in eine andere
273 	sal_Bool CopyHeadlineIntoTable( SwTableNode& rTblNd );
274 
275 		// erfrage die Box, dessen Start-Index auf nBoxStt steht
276 		  SwTableBox* GetTblBox( sal_uLong nSttIdx );
GetTblBox(sal_uLong nSttIdx) const277 	const SwTableBox* GetTblBox( sal_uLong nSttIdx ) const
278 						{	return ((SwTable*)this)->GetTblBox( nSttIdx );	}
279 
280 	// returnt sal_True wenn sich in der Tabelle Verschachtelungen befinden
281 	sal_Bool IsTblComplex() const;
282 
283 	//returnt sal_True wenn die Tabelle oder Selektion ausgeglichen ist
284 	sal_Bool IsTblComplexForChart( const String& rSel,
285 								SwChartLines* pGetCLines = 0  ) const;
286 
287 	// suche alle Inhaltstragenden-Boxen der Grundline in der diese Box
288 	// steht. rBoxes auch als Return-Wert, um es gleich weiter zu benutzen
289 	//JP 31.01.97: bToTop = sal_True -> hoch bis zur Grundline,
290 	//						sal_False-> sonst nur die Line der Box
291 	SwSelBoxes& SelLineFromBox( const SwTableBox* pBox,
292 							SwSelBoxes& rBoxes, sal_Bool bToTop = sal_True ) const;
293 		// erfrage vom Client Informationen
294 	virtual sal_Bool GetInfo( SfxPoolItem& ) const;
295 
296 		// suche im Format nach der angemeldeten Tabelle
297     static SwTable * FindTable( SwFrmFmt const*const pFmt );
298 
299 		// Struktur ein wenig aufraeumen
300 	void GCLines();
301 
302     // returns the table node via aSortCntBoxes or pTableNode
303 	SwTableNode* GetTableNode() const;
SetTableNode(SwTableNode * pNode)304     void SetTableNode( SwTableNode* pNode ) { pTableNode = pNode; }
305 
306 		// Daten Server-Methoden
307 	void SetRefObject( SwServerObject* );
GetObject() const308     const SwServerObject* GetObject() const     {  return &refObj; }
GetObject()309           SwServerObject* GetObject()           {  return &refObj; }
310 
311 	//Daten fuer das Chart fuellen.
312     void UpdateCharts() const;
313 
GetTblChgMode() const314 	TblChgMode GetTblChgMode() const 		{ return eTblChgMode; }
SetTblChgMode(TblChgMode eMode)315 	void SetTblChgMode( TblChgMode eMode )	{ eTblChgMode = eMode; }
316 
317 	sal_Bool SetColWidth( SwTableBox& rAktBox, sal_uInt16 eType,
318 						SwTwips nAbsDiff, SwTwips nRelDiff, SwUndo** ppUndo );
319 	sal_Bool SetRowHeight( SwTableBox& rAktBox, sal_uInt16 eType,
320 						SwTwips nAbsDiff, SwTwips nRelDiff, SwUndo** ppUndo );
321     void RegisterToFormat( SwFmt& rFmt );
322 #ifdef DBG_UTIL
323     void CheckConsistency() const;
324 #endif
325 };
326 
327 class SW_DLLPUBLIC SwTableLine: public SwClient		// Client vom FrmFmt
328 {
329 	SwTableBoxes aBoxes;
330 	SwTableBox *pUpper;
331 
332 public:
333 	TYPEINFO();
334 
SwTableLine()335 	SwTableLine() : pUpper(0) {}
336 
337 	SwTableLine( SwTableLineFmt*, sal_uInt16 nBoxes, SwTableBox *pUp );
338 	virtual ~SwTableLine();
339 
GetTabBoxes()340 		  SwTableBoxes &GetTabBoxes() { return aBoxes; }
GetTabBoxes() const341 	const SwTableBoxes &GetTabBoxes() const { return aBoxes; }
342 
GetUpper()343 		  SwTableBox *GetUpper() { return pUpper; }
GetUpper() const344 	const SwTableBox *GetUpper() const { return pUpper; }
SetUpper(SwTableBox * pNew)345 	void SetUpper( SwTableBox *pNew ) { pUpper = pNew; }
346 
347 
GetFrmFmt()348 	SwFrmFmt* GetFrmFmt()		{ return (SwFrmFmt*)GetRegisteredIn(); }
GetFrmFmt() const349 	SwFrmFmt* GetFrmFmt() const	{ return (SwFrmFmt*)GetRegisteredIn(); }
350 
351 	//Macht ein eingenes FrmFmt wenn noch mehr Lines von ihm abhaengen.
352 	SwFrmFmt* ClaimFrmFmt();
353 	void ChgFrmFmt( SwTableLineFmt* pNewFmt );
354 
355 	// suche nach der naechsten/vorherigen Box mit Inhalt
356 	SwTableBox* FindNextBox( const SwTable&, const SwTableBox* =0,
357 							sal_Bool bOvrTblLns=sal_True ) const;
358 	SwTableBox* FindPreviousBox( const SwTable&, const SwTableBox* =0,
359 							sal_Bool bOvrTblLns=sal_True ) const;
360 
361     SwTwips GetTableLineHeight( bool& bLayoutAvailable ) const;
362 
363     bool hasSoftPageBreak() const;
364     void RegisterToFormat( SwFmt& rFmt );
365 };
366 
367 class SW_DLLPUBLIC SwTableBox: public SwClient		//Client vom FrmFmt
368 {
369 	friend class SwNodes;			// um den Index umzusetzen !
370 	friend void DelBoxNode(SwTableSortBoxes&);  // um den StartNode* zu loeschen !
371 	friend class SwXMLTableContext;
372 
373 	//nicht (mehr) implementiert.
374 	SwTableBox( const SwTableBox & );
375 	SwTableBox &operator=( const SwTableBox &);	//gibts nicht.
376 
377 	SwTableLines aLines;
378 	const SwStartNode * pSttNd;
379 	SwTableLine *pUpper;
380 	SwTableBox_Impl* pImpl;
381 
382 	// falls das Format schon Formeln/Values enthaelt, muss ein neues
383 	// fuer die neue Box erzeugt werden.
384 	SwTableBoxFmt* CheckBoxFmt( SwTableBoxFmt* );
385 
386 public:
387 	TYPEINFO();
388 
SwTableBox()389 	SwTableBox() : pSttNd(0), pUpper(0), pImpl(0) {}
390 
391 	SwTableBox( SwTableBoxFmt*, sal_uInt16 nLines, SwTableLine *pUp = 0 );
392 	SwTableBox( SwTableBoxFmt*, const SwStartNode&, SwTableLine *pUp = 0 );
393 	SwTableBox( SwTableBoxFmt*, const SwNodeIndex&, SwTableLine *pUp = 0 );
394 	virtual ~SwTableBox();
395 
GetTabLines()396 		  SwTableLines &GetTabLines() { return aLines; }
GetTabLines() const397 	const SwTableLines &GetTabLines() const { return aLines; }
398 
GetUpper()399 		  SwTableLine *GetUpper() { return pUpper; }
GetUpper() const400 	const SwTableLine *GetUpper() const { return pUpper; }
SetUpper(SwTableLine * pNew)401 	void SetUpper( SwTableLine *pNew ) { pUpper = pNew; }
402 
GetFrmFmt()403 	SwFrmFmt* GetFrmFmt()		{ return (SwFrmFmt*)GetRegisteredIn(); }
GetFrmFmt() const404 	SwFrmFmt* GetFrmFmt() const	{ return (SwFrmFmt*)GetRegisteredIn(); }
405 
406 	//Macht ein eingenes FrmFmt wenn noch mehr Boxen von ihm abhaengen.
407 	SwFrmFmt* ClaimFrmFmt();
408 	void ChgFrmFmt( SwTableBoxFmt *pNewFmt );
409 
GetSttNd() const410 	const SwStartNode *GetSttNd() const { return pSttNd; }
GetSttIdx() const411 	sal_uLong GetSttIdx() const
412 #ifndef DBG_UTIL
413 		{ return pSttNd ? pSttNd->GetIndex() : 0; }
414 #else
415 		;
416 #endif
417 
418 	// suche nach der naechsten/vorherigen Box mit Inhalt
419 	SwTableBox* FindNextBox( const SwTable&, const SwTableBox* =0,
420 							sal_Bool bOvrTblLns=sal_True ) const;
421 	SwTableBox* FindPreviousBox( const SwTable&, const SwTableBox* =0,
422 							sal_Bool bOvrTblLns=sal_True ) const;
423 	// gebe den Namen dieser Box zurueck. Dieser wird dynamisch bestimmt
424 	// und ergibt sich aus der Position in den Lines/Boxen/Tabelle
425 	String GetName() const;
426 	// gebe den "Wert" der Box zurueck (fuers rechnen in der Tabelle)
427 	double GetValue( SwTblCalcPara& rPara ) const;
428 
429 	sal_Bool IsInHeadline( const SwTable* pTbl = 0 ) const;
430 
431 	// enthaelt die Box Inhalt, der als Nummer formatiert werden kann?
432 	sal_Bool HasNumCntnt( double& rNum, sal_uInt32& rFmtIndex,
433 					sal_Bool& rIsEmptyTxtNd ) const;
434 	sal_uLong IsValidNumTxtNd( sal_Bool bCheckAttr = sal_True ) const;
435 	// teste ob der BoxInhalt mit der Nummer uebereinstimmt, wenn eine
436 	// Tabellenformel gesetzt ist. (fuers Redo des Change vom NumFormat!)
437 	sal_Bool IsNumberChanged() const;
438 
439 	// ist das eine FormelBox oder eine Box mit numerischen Inhalt (AutoSum)
440 	// Was es ist, besagt der ReturnWert - die WhichId des Attributes
441 	// Leere Boxen haben den ReturnWert USHRT_MAX !!
442 	sal_uInt16 IsFormulaOrValueBox() const;
443 
444 	// Loading of a document requires an actualisation of cells with values
445 	void ActualiseValueBox();
446 
447 	DECL_FIXEDMEMPOOL_NEWDEL(SwTableBox)
448 
449 	// zugriff auf interne Daten - z.Z. benutzt fuer den NumFormatter
450 	inline const Color* GetSaveUserColor()	const;
451 	inline const Color* GetSaveNumFmtColor() const;
452 	inline void SetSaveUserColor(const Color* p );
453 	inline void SetSaveNumFmtColor( const Color* p );
454 
455     long getRowSpan() const;
456     void setRowSpan( long nNewRowSpan );
457     bool getDummyFlag() const;
458     void setDummyFlag( bool bDummy );
459 
460     SwTableBox& FindStartOfRowSpan( const SwTable&, sal_uInt16 nMaxStep = USHRT_MAX );
FindStartOfRowSpan(const SwTable & rTable,sal_uInt16 nMaxStep=USHRT_MAX) const461     const SwTableBox& FindStartOfRowSpan( const SwTable& rTable,
462         sal_uInt16 nMaxStep = USHRT_MAX ) const
463         { return const_cast<SwTableBox*>(this)->FindStartOfRowSpan( rTable, nMaxStep ); }
464 
465     SwTableBox& FindEndOfRowSpan( const SwTable&, sal_uInt16 nMaxStep = USHRT_MAX );
FindEndOfRowSpan(const SwTable & rTable,sal_uInt16 nMaxStep=USHRT_MAX) const466     const SwTableBox& FindEndOfRowSpan( const SwTable& rTable,
467         sal_uInt16 nMaxStep = USHRT_MAX ) const
468         { return const_cast<SwTableBox*>(this)->FindEndOfRowSpan( rTable, nMaxStep ); }
469     void RegisterToFormat( SwFmt& rFmt ) ;
470     void ForgetFrmFmt();
471 };
472 
473 class SwCellFrm;
474 class SW_DLLPUBLIC SwTableCellInfo : public ::boost::noncopyable
475 {
476     struct Impl;
477     ::std::auto_ptr<Impl> m_pImpl;
478 
479     const SwCellFrm * getCellFrm() const ;
480 
481 public:
482     SwTableCellInfo(const SwTable * pTable);
483     ~SwTableCellInfo();
484 
485     bool getNext();
486     SwRect getRect() const;
487     const SwTableBox * getTableBox() const;
488 };
489 
490 #endif	//_SWTABLE_HXX
491