LibreOffice Module sw (master)  1
swtable.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 #ifndef INCLUDED_SW_INC_SWTABLE_HXX
20 #define INCLUDED_SW_INC_SWTABLE_HXX
21 
22 #include <tools/solar.h>
23 #include <tools/ref.hxx>
24 #include "tblenum.hxx"
25 #include "swtypes.hxx"
26 #include "calbck.hxx"
27 #include "swrect.hxx"
28 #include "swtblfmt.hxx"
29 #include "docary.hxx"
30 #include "nodeoffset.hxx"
31 
32 #include <memory>
33 #include <vector>
34 #include <algorithm>
35 #include <o3tl/sorted_vector.hxx>
36 #include <optional>
37 
38 class SwStartNode;
39 class SwFormat;
40 class Color;
41 class SwHTMLTableLayout;
42 class SwTableLine;
43 class SwTableBox;
44 class SwTableNode;
45 class SwTabCols;
46 class SwDoc;
47 class SwSelBoxes;
48 class SwTableCalcPara;
49 struct SwPosition;
50 class SwNodeIndex;
51 class SwNode;
52 class SfxPoolItem;
53 class SwUndoTableMerge;
54 class SwUndo;
55 class SwPaM;
57 class SwBoxSelection;
58 struct SwSaveRowSpan;
59 struct Parm;
60 class SwServerObject;
61 
62 void sw_GetTableBoxColStr( sal_uInt16 nCol, OUString& rNm );
63 
65 {
66  std::vector<SwTableLine*> m_vLines;
67 
68 public:
69  typedef std::vector<SwTableLine*>::size_type size_type;
70  typedef std::vector<SwTableLine*>::iterator iterator;
71  typedef std::vector<SwTableLine*>::const_iterator const_iterator;
72 
73  // free's any remaining child objects
74  ~SwTableLines();
75 
76  bool empty() const { return m_vLines.empty(); }
77  size_type size() const { return m_vLines.size(); }
78  iterator begin() { return m_vLines.begin(); }
79  const_iterator begin() const { return m_vLines.begin(); }
80  iterator end() { return m_vLines.end(); }
81  const_iterator end() const { return m_vLines.end(); }
82  SwTableLine* front() const { return m_vLines.front(); }
83  SwTableLine* back() const { return m_vLines.back(); }
84  void clear() { m_vLines.clear(); }
85  iterator erase( iterator aIt ) { return m_vLines.erase( aIt ); }
86  iterator erase( iterator aFirst, iterator aLast ) { return m_vLines.erase( aFirst, aLast ); }
87  iterator insert( iterator aIt, SwTableLine* pLine ) { return m_vLines.insert( aIt, pLine ); }
88  template<typename TInputIterator>
89  void insert( iterator aIt, TInputIterator aFirst, TInputIterator aLast )
90  {
91  m_vLines.insert( aIt, aFirst, aLast );
92  }
93  void push_back( SwTableLine* pLine ) { m_vLines.push_back( pLine ); }
94  void reserve( size_type nSize ) { m_vLines.reserve( nSize ); }
95  SwTableLine*& operator[]( size_type nPos ) { return m_vLines[ nPos ]; }
96  SwTableLine* operator[]( size_type nPos ) const { return m_vLines[ nPos ]; }
97 
98  // return USHRT_MAX if not found, else index of position
99  sal_uInt16 GetPos(const SwTableLine* pBox) const
100  {
101  const_iterator it = std::find(begin(), end(), pBox);
102  return it == end() ? USHRT_MAX : it - begin();
103  }
104 };
105 
106 using SwTableBoxes = std::vector<SwTableBox*>;
107 
108 // Save content-bearing box-pointers additionally in a sorted array
109 // (for calculation in table).
110 class SwTableSortBoxes : public o3tl::sorted_vector<SwTableBox*> {};
111 
113 class SW_DLLPUBLIC SwTable: public SwClient //Client of FrameFormat.
114 {
115 
116 protected:
119  tools::SvRef<SwServerObject> m_xRefObj; // In case DataServer -> pointer is set.
120 
121  std::shared_ptr<SwHTMLTableLayout> m_xHTMLLayout;
122 
123  // Usually, the table node of a SwTable can be accessed by getting a box
124  // out of m_TabSortContentBoxes, which know their SwStartNode. But in some rare
125  // cases, we need to know the table node of a SwTable, before the table
126  // boxes have been build (SwTableNode::MakeCopy with tables in tables).
128 
129  // Should that be adjustable for every table?
131 
132  sal_uInt16 m_nGraphicsThatResize; // Count of Grfs that initiate a resize of table
133  // at HTML-import.
134  sal_uInt16 m_nRowsToRepeat; // Number of rows to repeat on every page.
135 
138 
139  bool m_bModifyLocked :1;
140  bool m_bNewModel :1; // false: old SubTableModel; true: new RowSpanModel
141 
142  virtual void SwClientNotify(const SwModify&, const SfxHint&) override;
143 
144 public:
146  {
147  SEARCH_NONE, // Default: expand to rectangle
148  SEARCH_ROW, // row selection
149  SEARCH_COL // column selection
150  };
151 
152 
153  explicit SwTable();
154  virtual ~SwTable() override;
155 
156  // @@@ public copy ctor, but no copy assignment?
157  SwTable( const SwTable& rTable ); // no copy of the lines !!
158 private:
159  // @@@ public copy ctor, but no copy assignment?
160  SwTable & operator= (const SwTable &) = delete;
161  bool OldMerge( SwDoc*, const SwSelBoxes&, SwTableBox*, SwUndoTableMerge* );
162  bool OldSplitRow( SwDoc&, const SwSelBoxes&, sal_uInt16, bool );
163  bool NewMerge( SwDoc*, const SwSelBoxes&, const SwSelBoxes& rMerged,
164  SwUndoTableMerge* );
165  bool NewSplitRow( SwDoc&, const SwSelBoxes&, sal_uInt16, bool );
166  std::unique_ptr<SwBoxSelection> CollectBoxSelection( const SwPaM& rPam ) const;
167  void InsertSpannedRow( SwDoc& rDoc, sal_uInt16 nIdx, sal_uInt16 nCnt );
168  bool InsertRow_( SwDoc*, const SwSelBoxes&, sal_uInt16 nCnt, bool bBehind );
169  bool NewInsertCol( SwDoc&, const SwSelBoxes& rBoxes, sal_uInt16 nCnt, bool );
170  void FindSuperfluousRows_( SwSelBoxes& rBoxes, SwTableLine*, SwTableLine* );
171  void AdjustWidths( const tools::Long nOld, const tools::Long nNew );
172  void NewSetTabCols( Parm &rP, const SwTabCols &rNew, const SwTabCols &rOld,
173  const SwTableBox *pStart, bool bCurRowOnly );
174  void ConvertSubtableBox(sal_uInt16 const nRow, sal_uInt16 const nBox);
175 
176 public:
177 
178  SwHTMLTableLayout *GetHTMLTableLayout() { return m_xHTMLLayout.get(); }
179  const SwHTMLTableLayout *GetHTMLTableLayout() const { return m_xHTMLLayout.get(); }
180  void SetHTMLTableLayout(std::shared_ptr<SwHTMLTableLayout> const& r); //Change of property!
181 
182  sal_uInt16 IncGrfsThatResize() { return ++m_nGraphicsThatResize; }
183  sal_uInt16 DecGrfsThatResize() { return m_nGraphicsThatResize ? --m_nGraphicsThatResize : 0; }
184 
185  void LockModify() { m_bModifyLocked = true; } // Must be used always
186  void UnlockModify() { m_bModifyLocked = false;} // in pairs!
187 
188  void SetTableModel( bool bNew ){ m_bNewModel = bNew; }
189  bool IsNewModel() const { return m_bNewModel; }
190 
192  const OUString& GetTableStyleName() const { return maTableStyleName; }
193 
195  void SetTableStyleName(const OUString& rName) { maTableStyleName = rName; }
196 
197  sal_uInt16 GetRowsToRepeat() const { return std::min( o3tl::narrowing<sal_uInt16>(GetTabLines().size()), m_nRowsToRepeat ); }
198  void SetRowsToRepeat( sal_uInt16 nNumOfRows ) { m_nRowsToRepeat = nNumOfRows; }
199 
200  bool IsHeadline( const SwTableLine& rLine ) const;
201 
202  SwTableLines &GetTabLines() { return m_aLines; }
203  const SwTableLines &GetTabLines() const { return m_aLines; }
204 
206  SwTableFormat* GetFrameFormat() const { return const_cast<SwTableFormat*>(static_cast<const SwTableFormat*>(GetRegisteredIn())); }
207 
208  void GetTabCols( SwTabCols &rToFill, const SwTableBox *pStart,
209  bool bHidden = false, bool bCurRowOnly = false ) const;
210  void SetTabCols( const SwTabCols &rNew, const SwTabCols &rOld,
211  const SwTableBox *pStart, bool bCurRowOnly );
212 
213 // The following functions are for new table model only...
214  void CreateSelection( const SwPaM& rPam, SwSelBoxes& rBoxes,
215  const SearchType eSearchType, bool bProtect ) const;
216  void CreateSelection( const SwNode* pStart, const SwNode* pEnd,
217  SwSelBoxes& rBoxes, const SearchType eSearchType, bool bProtect ) const;
218  void ExpandSelection( SwSelBoxes& rBoxes ) const;
219  // When a table is split into two tables, the row spans which overlaps
220  // the split have to be corrected and stored for undo
221  // SwSavRowSpan is the structure needed by Undo to undo the split operation
222  // CleanUpRowSpan corrects the (top of the) second table and delivers the structure
223  // for Undo
224  std::unique_ptr<SwSaveRowSpan> CleanUpTopRowSpan( sal_uInt16 nSplitLine );
225  // RestoreRowSpan is called by Undo to restore the old row span values
226  void RestoreRowSpan( const SwSaveRowSpan& );
227  // CleanUpBottomRowSpan corrects the overhanging row spans at the end of the first table
228  void CleanUpBottomRowSpan( sal_uInt16 nDelLines );
229 
230 // The following functions are "pseudo-virtual", i.e. they are different for old and new table model
231 // It's not allowed to change the table model after the first call of one of these functions.
232 
233  bool Merge( SwDoc* pDoc, const SwSelBoxes& rBoxes, const SwSelBoxes& rMerged,
234  SwTableBox* pMergeBox, SwUndoTableMerge* pUndo )
235  {
236  return m_bNewModel ? NewMerge( pDoc, rBoxes, rMerged, pUndo ) :
237  OldMerge( pDoc, rBoxes, pMergeBox, pUndo );
238  }
239  bool SplitRow( SwDoc& rDoc, const SwSelBoxes& rBoxes, sal_uInt16 nCnt,
240  bool bSameHeight )
241  {
242  return m_bNewModel ? NewSplitRow( rDoc, rBoxes, nCnt, bSameHeight ) :
243  OldSplitRow( rDoc, rBoxes, nCnt, bSameHeight );
244  }
245  bool PrepareMerge( const SwPaM& rPam, SwSelBoxes& rBoxes,
246  SwSelBoxes& rMerged, SwTableBox** ppMergeBox, SwUndoTableMerge* pUndo );
247  void ExpandColumnSelection( SwSelBoxes& rBoxes, tools::Long &rMin, tools::Long &rMax ) const;
248  void PrepareDeleteCol( tools::Long nMin, tools::Long nMax );
249 
250  bool InsertCol( SwDoc&, const SwSelBoxes& rBoxes,
251  sal_uInt16 nCnt, bool bBehind );
252  bool InsertRow( SwDoc*, const SwSelBoxes& rBoxes,
253  sal_uInt16 nCnt, bool bBehind );
254  void PrepareDelBoxes( const SwSelBoxes& rBoxes );
255  bool DeleteSel( SwDoc*, const SwSelBoxes& rBoxes, const SwSelBoxes* pMerged,
256  SwUndo* pUndo, const bool bDelMakeFrames, const bool bCorrBorder );
257  bool SplitCol( SwDoc& rDoc, const SwSelBoxes& rBoxes, sal_uInt16 nCnt );
258 
260  { FindSuperfluousRows_( rBoxes, nullptr, nullptr ); }
261  void CheckRowSpan( SwTableLine* &rpLine, bool bUp ) const;
262 
263  SwTableSortBoxes& GetTabSortBoxes() { return m_TabSortContentBoxes; }
264  const SwTableSortBoxes& GetTabSortBoxes() const { return m_TabSortContentBoxes; }
265 
266  // Read 1st number and delete it from string (used by GetTableBox and SwTableField).
267 
268  // #i80314#
269  // add 3rd parameter in order to control validation check on <rStr>
270  static sal_uInt16 GetBoxNum( OUString& rStr,
271  bool bFirst = false,
272  const bool bPerformValidCheck = false );
273 
274  // Search content-bearing box with that name.
275 
276  // #i80314#
277  // add 2nd parameter in order to control validation check in called method
278  // <GetBoxNum(..)>
279  const SwTableBox* GetTableBox( const OUString& rName,
280  const bool bPerformValidCheck = false ) const;
281  // Copy selected boxes to another document.
282  bool MakeCopy( SwDoc&, const SwPosition&, const SwSelBoxes&,
283  bool bCpyName = false, const OUString& rStyleName = "" ) const;
284  // Copy table in this
285  bool InsTable( const SwTable& rCpyTable, const SwNodeIndex&,
286  SwUndoTableCpyTable* pUndo );
287  bool InsTable( const SwTable& rCpyTable, const SwSelBoxes&,
288  SwUndoTableCpyTable* pUndo );
289  bool InsNewTable( const SwTable& rCpyTable, const SwSelBoxes&,
290  SwUndoTableCpyTable* pUndo );
291  // Copy headline of table (with content!) into another one.
292  void CopyHeadlineIntoTable( SwTableNode& rTableNd );
293 
294  // Get box, whose start index is set on nBoxStt.
295  SwTableBox* GetTableBox( SwNodeOffset nSttIdx );
296  const SwTableBox* GetTableBox( SwNodeOffset nSttIdx ) const
297  { return const_cast<SwTable*>(this)->GetTableBox( nSttIdx ); }
298 
299  // Returns true if table contains nestings.
300  bool IsTableComplex() const;
301 
302  // Returns true if table or selection is balanced.
303  bool IsTableComplexForChart( const OUString& rSel ) const;
304 
305  // Search all content-bearing boxes of the base line on which this box stands.
306  // rBoxes as a return value for immediate use.
307  // bToTop = true -> up to base line, false-> else only line of box.
308  static SwSelBoxes& SelLineFromBox( const SwTableBox* pBox,
309  SwSelBoxes& rBoxes, bool bToTop = true );
310 
311  // Get information from client.
312  virtual bool GetInfo( SfxPoolItem& ) const override;
313 
314  // Search in format for registered table.
315  static SwTable * FindTable( SwFrameFormat const*const pFormat );
316 
317  // Clean up structure of subtables a bit:
318  // convert row with 1 box with subtable; box with subtable with 1 row;
319  // by removing the subtable (both recursively)
320  void GCLines();
321 
322  // Returns the table node via m_TabSortContentBoxes or pTableNode.
323  SwTableNode* GetTableNode() const;
324  void SetTableNode( SwTableNode* pNode ) { m_pTableNode = pNode; }
325 
326  // Data server methods.
327  void SetRefObject( SwServerObject* );
328  const SwServerObject* GetObject() const { return m_xRefObj.get(); }
329  SwServerObject* GetObject() { return m_xRefObj.get(); }
330 
331  // Fill data for chart.
332  void UpdateCharts() const;
333 
334  TableChgMode GetTableChgMode() const { return m_eTableChgMode; }
335  void SetTableChgMode( TableChgMode eMode ) { m_eTableChgMode = eMode; }
336 
337  bool SetColWidth( SwTableBox& rCurrentBox, TableChgWidthHeightType eType,
338  SwTwips nAbsDiff, SwTwips nRelDiff, std::unique_ptr<SwUndo>* ppUndo );
339  bool SetRowHeight( SwTableBox& rCurrentBox, TableChgWidthHeightType eType,
340  SwTwips nAbsDiff, SwTwips nRelDiff, std::unique_ptr<SwUndo>* ppUndo );
341  void RegisterToFormat( SwFormat& rFormat );
342 #ifdef DBG_UTIL
343  void CheckConsistency() const;
344 #endif
345 
346  bool HasLayout() const;
347 
348  bool CanConvertSubtables() const;
349  void ConvertSubtables();
350 
351  // is it a table deleted completely with change tracking
352  bool IsDeleted() const;
353  // is it a table with deleted row(s)
354  bool HasDeletedRow() const;
355 };
356 
358 class SW_DLLPUBLIC SwTableLine final : public SwClient // Client of FrameFormat.
359 {
362 
363 public:
364 
365  SwTableLine( SwTableLineFormat*, sal_uInt16 nBoxes, SwTableBox *pUp );
366  virtual ~SwTableLine() override;
367 
368  SwTableBoxes &GetTabBoxes() { return m_aBoxes; }
369  const SwTableBoxes &GetTabBoxes() const { return m_aBoxes; }
370  sal_uInt16 GetBoxPos(const SwTableBox* pBox) const
371  {
372  SwTableBoxes::const_iterator it = std::find(m_aBoxes.begin(), m_aBoxes.end(), pBox);
373  return it == m_aBoxes.end() ? USHRT_MAX : it - m_aBoxes.begin();
374  }
375 
376  SwTableBox *GetUpper() { return m_pUpper; }
377  const SwTableBox *GetUpper() const { return m_pUpper; }
378  void SetUpper( SwTableBox *pNew ) { m_pUpper = pNew; }
379 
381  SwFrameFormat* GetFrameFormat() const { return const_cast<SwFrameFormat*>(static_cast<const SwFrameFormat*>(GetRegisteredIn())); }
382 
383  // Creates an own FrameFormat if more lines depend on it.
384  SwFrameFormat* ClaimFrameFormat();
385  void ChgFrameFormat( SwTableLineFormat* pNewFormat );
386 
387  // Search next/previous box with content.
388  SwTableBox* FindNextBox( const SwTable&, const SwTableBox* =nullptr,
389  bool bOvrTableLns=true ) const;
390  SwTableBox* FindPreviousBox( const SwTable&, const SwTableBox* =nullptr,
391  bool bOvrTableLns=true ) const;
392 
393  SwTwips GetTableLineHeight( bool& bLayoutAvailable ) const;
394 
395  bool hasSoftPageBreak() const;
396 
397  // it doesn't contain box content
398  bool IsEmpty() const;
399 
400  // is it a tracked deleted row
401  // (search its first redline from rRedlinePos to speed up SwTable::IsDeleted())
402  bool IsDeleted(SwRedlineTable::size_type& rRedlinePos) const;
403 };
404 
406 class SW_DLLPUBLIC SwTableBox final : public SwClient //Client of FrameFormat.
407 {
408  friend class SwNodes; // Transpose index.
409  friend void DelBoxNode(SwTableSortBoxes const &); // Delete StartNode* !
410  friend class SwXMLTableContext;
411 
412  SwTableBox( const SwTableBox & ) = delete;
413  SwTableBox &operator=( const SwTableBox &) = delete;
414 
418 
419  std::optional<Color> mxUserColor;
420  std::optional<Color> mxNumFormatColor;
421  sal_Int32 mnRowSpan;
423 
426 
427  // In case Format contains formulas/values already,
428  // a new one must be created for the new box.
429  static SwTableBoxFormat* CheckBoxFormat( SwTableBoxFormat* );
430 
431 public:
432 
433  SwTableBox( SwTableBoxFormat*, sal_uInt16 nLines, SwTableLine *pUp );
436  virtual ~SwTableBox() override;
437 
438  SwTableLines &GetTabLines() { return m_aLines; }
439  const SwTableLines &GetTabLines() const { return m_aLines; }
440 
441  SwTableLine *GetUpper() { return m_pUpper; }
442  const SwTableLine *GetUpper() const { return m_pUpper; }
443  void SetUpper( SwTableLine *pNew ) { m_pUpper = pNew; }
444 
446  SwFrameFormat* GetFrameFormat() const { return const_cast<SwFrameFormat*>(static_cast<const SwFrameFormat*>(GetRegisteredIn())); }
447 
449  void SetDirectFormatting(bool bDirect) { mbDirectFormatting = bDirect; }
450 
452  bool HasDirectFormatting() const { return mbDirectFormatting; }
453 
454  // Creates its own FrameFormat if more boxes depend on it.
455  SwFrameFormat* ClaimFrameFormat();
456  void ChgFrameFormat( SwTableBoxFormat *pNewFormat, bool bNeedToReregister = true );
457 
458  void RemoveFromTable();
459  const SwStartNode *GetSttNd() const { return m_pStartNode; }
460  SwNodeOffset GetSttIdx() const;
461  // it doesn't contain box content
462  bool IsEmpty() const;
463 
464  // Search next/previous box with content.
465  SwTableBox* FindNextBox( const SwTable&, const SwTableBox*,
466  bool bOvrTableLns=true ) const;
467  SwTableBox* FindPreviousBox( const SwTable&, const SwTableBox* ) const;
468  // Return name of this box. It is determined dynamically and
469  // is calculated from the position in the lines/boxes/table.
470  OUString GetName() const;
471  // Return "value" of box (for calculating in table).
472  double GetValue( SwTableCalcPara& rPara ) const;
473 
474  // Computes "coordinates" of a box, used to computed selection
475  // width or height when inserting cols or rows
476  Point GetCoordinates() const;
477 
478  bool IsInHeadline( const SwTable* pTable ) const;
479 
480  // Contains box contents, that can be formatted as a number?
481  bool HasNumContent( double& rNum, sal_uInt32& rFormatIndex,
482  bool& rIsEmptyTextNd ) const;
483  SwNodeOffset IsValidNumTextNd( bool bCheckAttr = true ) const;
484  // If a table formula is set, test if box contents is congruent with number.
485  // (For Redo of change of NumFormat!).
486  bool IsNumberChanged() const;
487 
488  // Is that a formula box or a box with numeric contents (AutoSum)?
489  // What it is indicated by the return value - the WhichId of the attribute.
490  // Empty boxes have the return value USHRT_MAX !!
491  sal_uInt16 IsFormulaOrValueBox() const;
492 
493  // Loading of a document requires an actualization of cells with values
494  void ActualiseValueBox();
495 
496  // Access on internal data - currently used for the NumFormatter.
497  const std::optional<Color>& GetSaveUserColor() const { return mxUserColor; }
498  const std::optional<Color>& GetSaveNumFormatColor() const { return mxNumFormatColor; }
499  void SetSaveUserColor(std::optional<Color> p ) { mxUserColor = p; }
500  void SetSaveNumFormatColor( std::optional<Color> p ) { mxNumFormatColor = p; }
501 
502  sal_Int32 getRowSpan() const;
503  void setRowSpan( sal_Int32 nNewRowSpan );
504  bool getDummyFlag() const;
505  void setDummyFlag( bool bDummy );
506 
507  SwTableBox& FindStartOfRowSpan( const SwTable&, sal_uInt16 nMaxStep = USHRT_MAX );
508  const SwTableBox& FindStartOfRowSpan( const SwTable& rTable,
509  sal_uInt16 nMaxStep = USHRT_MAX ) const
510  { return const_cast<SwTableBox*>(this)->FindStartOfRowSpan( rTable, nMaxStep ); }
511 
512  SwTableBox& FindEndOfRowSpan( const SwTable&, sal_uInt16 nMaxStep );
513  const SwTableBox& FindEndOfRowSpan( const SwTable& rTable,
514  sal_uInt16 nMaxStep ) const
515  { return const_cast<SwTableBox*>(this)->FindEndOfRowSpan( rTable, nMaxStep ); }
516  void RegisterToFormat( SwFormat& rFormat ) ;
517 };
518 
519 class SwCellFrame;
521 {
522  struct Impl;
523  std::unique_ptr<Impl> m_pImpl;
524 
525  const SwCellFrame * getCellFrame() const;
526 
527  SwTableCellInfo(SwTableCellInfo const&) = delete;
528  SwTableCellInfo& operator=(SwTableCellInfo const&) = delete;
529 
530 public:
531  SwTableCellInfo(const SwTable * pTable);
532  ~SwTableCellInfo();
533 
534  bool getNext();
535  SwRect getRect() const;
536  const SwTableBox * getTableBox() const;
537 };
538 
539 #endif // INCLUDED_SW_INC_SWTABLE_HXX
540 
541 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
const std::optional< Color > & GetSaveNumFormatColor() const
Definition: swtable.hxx:498
SwTableNode * m_pTableNode
Definition: swtable.hxx:127
const_iterator begin() const
Definition: swtable.hxx:79
Starts a section of nodes in the document model.
Definition: node.hxx:313
SwNodeOffset min(const SwNodeOffset &a, const SwNodeOffset &b)
Definition: nodeoffset.hxx:33
std::vector< SwTableLine * >::size_type size_type
Definition: swtable.hxx:69
const SwHTMLTableLayout * GetHTMLTableLayout() const
Definition: swtable.hxx:179
void SetRowsToRepeat(sal_uInt16 nNumOfRows)
Definition: swtable.hxx:198
Marks a position in the document model.
Definition: pam.hxx:36
const_iterator end() const
Definition: swtable.hxx:81
bool SplitRow(SwDoc &rDoc, const SwSelBoxes &rBoxes, sal_uInt16 nCnt, bool bSameHeight)
Definition: swtable.hxx:239
const SwTableBox * GetUpper() const
Definition: swtable.hxx:377
void FindSuperfluousRows(SwSelBoxes &rBoxes)
Definition: swtable.hxx:259
std::optional< Color > mxUserColor
Definition: swtable.hxx:419
std::string GetValue
bool mbDummyFlag
Definition: swtable.hxx:422
long Long
const SwTableBoxes & GetTabBoxes() const
Definition: swtable.hxx:369
Definition: doc.hxx:188
const SwTableSortBoxes & GetTabSortBoxes() const
Definition: swtable.hxx:264
const SwTableLines & GetTabLines() const
Definition: swtable.hxx:203
TableChgWidthHeightType
Definition: tblenum.hxx:25
void push_back(SwTableLine *pLine)
Definition: swtable.hxx:93
SwTableLine is one table row in the document model.
Definition: swtable.hxx:358
sal_uInt16 GetRowsToRepeat() const
Definition: swtable.hxx:197
virtual void SwClientNotify(const SwModify &, const SfxHint &rHint) override
Definition: calbck.cxx:121
Of course Writer needs its own rectangles.
Definition: swrect.hxx:34
iterator begin()
Definition: swtable.hxx:78
SwTableLine * front() const
Definition: swtable.hxx:82
SwTableFormat * GetFrameFormat()
Definition: swtable.hxx:205
size_type size() const
Definition: swtable.hxx:77
std::optional< Color > mxNumFormatColor
Definition: swtable.hxx:420
SwTableBoxes m_aBoxes
Definition: swtable.hxx:360
SwTableLine * back() const
Definition: swtable.hxx:83
SwTableLines m_aLines
Definition: swtable.hxx:117
const SwTableBox & FindEndOfRowSpan(const SwTable &rTable, sal_uInt16 nMaxStep) const
Definition: swtable.hxx:513
void SetSaveUserColor(std::optional< Color > p)
Definition: swtable.hxx:499
void SetTableModel(bool bNew)
Definition: swtable.hxx:188
void UnlockModify()
Definition: swtable.hxx:186
SwTableBox * m_pUpper
Definition: swtable.hxx:361
This structure is needed by Undo to restore row span attributes when a table has been split into two ...
Definition: tblrwcl.hxx:111
TableChgMode m_eTableChgMode
Definition: swtable.hxx:130
iterator insert(iterator aIt, SwTableLine *pLine)
Definition: swtable.hxx:87
const OUString & GetTableStyleName() const
Return the table style name of this table.
Definition: swtable.hxx:192
void SetTableNode(SwTableNode *pNode)
Definition: swtable.hxx:324
std::vector< SwTableLine * >::const_iterator const_iterator
Definition: swtable.hxx:71
const SwStartNode * m_pStartNode
Definition: swtable.hxx:416
tools::SvRef< SwServerObject > m_xRefObj
Definition: swtable.hxx:119
Base class for various Writer styles.
Definition: format.hxx:46
std::vector< SwTableLine * >::iterator iterator
Definition: swtable.hxx:70
SwTableSortBoxes m_TabSortContentBoxes
Definition: swtable.hxx:118
SwTableSortBoxes & GetTabSortBoxes()
Definition: swtable.hxx:263
PaM is Point and Mark: a selection of the document model.
Definition: pam.hxx:137
T * get() const
Style of a layout element.
Definition: frmfmt.hxx:59
const SwTableBox * GetTableBox(SwNodeOffset nSttIdx) const
Definition: swtable.hxx:296
bool empty() const
Definition: swtable.hxx:76
bool HasDirectFormatting() const
Do we contain any direct formatting (ie. something not affected by the table style)?
Definition: swtable.hxx:452
void clear()
Definition: swtable.hxx:84
const std::optional< Color > & GetSaveUserColor() const
Definition: swtable.hxx:497
void insert(iterator aIt, TInputIterator aFirst, TInputIterator aLast)
Definition: swtable.hxx:89
void LockModify()
Definition: swtable.hxx:185
vector_type::size_type size_type
Definition: docary.hxx:223
SwFrameFormat * GetFrameFormat() const
Definition: swtable.hxx:446
sal_Int32 mnRowSpan
Definition: swtable.hxx:421
SwFrameFormat * GetFrameFormat()
Definition: swtable.hxx:380
void SetSaveNumFormatColor(std::optional< Color > p)
Definition: swtable.hxx:500
size
SwTableLines m_aLines
Definition: swtable.hxx:415
Marks a node in the document model.
Definition: ndindex.hxx:32
SwFrameFormat * GetFrameFormat()
Definition: swtable.hxx:445
bool mbDirectFormatting
Do we contain any direct formatting?
Definition: swtable.hxx:425
std::shared_ptr< SwHTMLTableLayout > m_xHTMLLayout
Definition: swtable.hxx:121
const SwTableBox & FindStartOfRowSpan(const SwTable &rTable, sal_uInt16 nMaxStep=USHRT_MAX) const
Definition: swtable.hxx:508
#define SW_DLLPUBLIC
Definition: swdllapi.h:28
iterator erase(iterator aFirst, iterator aLast)
Definition: swtable.hxx:86
sal_uInt16 m_nRowsToRepeat
Definition: swtable.hxx:134
sal_uInt16 GetBoxPos(const SwTableBox *pBox) const
Definition: swtable.hxx:370
SwTableLine * m_pUpper
Definition: swtable.hxx:417
void DelBoxNode(SwTableSortBoxes const &rSortCntBoxes)
Definition: swtable.cxx:211
sal_uInt16 IncGrfsThatResize()
Definition: swtable.hxx:182
SwTableLines & GetTabLines()
Definition: swtable.hxx:202
tools::Long SwTwips
Definition: swtypes.hxx:52
SwTable is one table in the document model, containing rows (which contain cells).
Definition: swtable.hxx:113
SwTableLines & GetTabLines()
Definition: swtable.hxx:438
void reserve(size_type nSize)
Definition: swtable.hxx:94
const SwServerObject * GetObject() const
Definition: swtable.hxx:328
void SetTableChgMode(TableChgMode eMode)
Definition: swtable.hxx:335
SwTableBoxes & GetTabBoxes()
Definition: swtable.hxx:368
std::vector< SwTableBox * > SwTableBoxes
Definition: swtable.hxx:106
const SwStartNode * GetSttNd() const
Definition: swtable.hxx:459
SwServerObject * GetObject()
Definition: swtable.hxx:329
sal_uInt16 DecGrfsThatResize()
Definition: swtable.hxx:183
std::vector< SwTableLine * > m_vLines
Definition: swtable.hxx:66
const SwTableLines & GetTabLines() const
Definition: swtable.hxx:439
void SetDirectFormatting(bool bDirect)
Set that this table box contains formatting that is not set by the table style.
Definition: swtable.hxx:449
OUString maTableStyleName
Name of the table style to be applied on this table.
Definition: swtable.hxx:137
void SetTableStyleName(const OUString &rName)
Set the new table style name for this table.
Definition: swtable.hxx:195
SwHTMLTableLayout * GetHTMLTableLayout()
Definition: swtable.hxx:178
const SwTableLine * GetUpper() const
Definition: swtable.hxx:442
SwFrameFormat * GetFrameFormat() const
Definition: swtable.hxx:381
SwTableLine *& operator[](size_type nPos)
Definition: swtable.hxx:95
bool Merge(SwDoc *pDoc, const SwSelBoxes &rBoxes, const SwSelBoxes &rMerged, SwTableBox *pMergeBox, SwUndoTableMerge *pUndo)
Definition: swtable.hxx:233
const SwModify * GetRegisteredIn() const
Definition: calbck.hxx:165
SwTableBox is one table cell in the document model.
Definition: swtable.hxx:406
WriterListener & operator=(WriterListener const &)=delete
SwTableBox * GetUpper()
Definition: swtable.hxx:376
virtual bool GetInfo(SfxPoolItem &) const
Definition: calbck.hxx:172
void SetUpper(SwTableBox *pNew)
Definition: swtable.hxx:378
void SetUpper(SwTableLine *pNew)
Definition: swtable.hxx:443
sal_uInt16 GetPos(const SwTableLine *pBox) const
Definition: swtable.hxx:99
TableChgMode
Definition: tblenum.hxx:46
iterator end()
Definition: swtable.hxx:80
bool IsNewModel() const
Definition: swtable.hxx:189
SwTableLine * GetUpper()
Definition: swtable.hxx:441
SwBoxSelection is a small helperclass (structure) to handle selections of cells (boxes) between table...
Definition: swnewtable.cxx:64
void sw_GetTableBoxColStr(sal_uInt16 nCol, OUString &rNm)
Definition: swtable.cxx:1815
TableChgMode GetTableChgMode() const
Definition: swtable.hxx:334
SwCellFrame is one table cell in the document layout.
Definition: cellfrm.hxx:30
iterator erase(iterator aIt)
Definition: swtable.hxx:85
std::unique_ptr< Impl > m_pImpl
Definition: swtable.hxx:522
SwTableFormat * GetFrameFormat() const
Definition: swtable.hxx:206
sal_uInt16 m_nGraphicsThatResize
Definition: swtable.hxx:132
Base class of the Writer document model elements.
Definition: node.hxx:81
SwTableLine * operator[](size_type nPos) const
Definition: swtable.hxx:96