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