LibreOffice Module sw (master)  1
edtab.cxx
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 
20 #include <fesh.hxx>
21 #include <hintids.hxx>
22 #include <hints.hxx>
23 
24 #include <swwait.hxx>
25 #include <editsh.hxx>
26 #include <doc.hxx>
27 #include <IDocumentUndoRedo.hxx>
30 #include <IDocumentState.hxx>
31 #include <cntfrm.hxx>
32 #include <pam.hxx>
33 #include <ndtxt.hxx>
34 #include <swtable.hxx>
35 #include <swundo.hxx>
36 #include <tblsel.hxx>
37 #include <cellfrm.hxx>
38 #include <cellatr.hxx>
39 #include <swtblfmt.hxx>
40 #include <swddetbl.hxx>
41 #include <mdiexp.hxx>
42 #include <itabenum.hxx>
43 #include <svl/numformat.hxx>
44 #include <vcl/uitest/logger.hxx>
46 
47 using namespace ::com::sun::star;
48 using namespace ::com::sun::star::uno;
49 namespace {
50 
51 void collectUIInformation(const OUString& rAction, const OUString& aParameters)
52 {
53  EventDescription aDescription;
54  aDescription.aAction = rAction;
55  aDescription.aParameters = {{"parameters", aParameters}};
56  aDescription.aID = "writer_edit";
57  aDescription.aKeyWord = "SwEditWinUIObject";
58  aDescription.aParent = "MainWindow";
59  UITestLogger::getInstance().logEvent(aDescription);
60 }
61 
62 }
63 
64 //Added for bug #i119954# Application crashed if undo/redo convert nest table to text
65 static bool ConvertTableToText( const SwTableNode *pTableNode, sal_Unicode cCh );
66 
67 static void ConvertNestedTablesToText( const SwTableLines &rTableLines, sal_Unicode cCh )
68 {
69  for (size_t n = 0; n < rTableLines.size(); ++n)
70  {
71  SwTableLine* pTableLine = rTableLines[ n ];
72  for (size_t i = 0; i < pTableLine->GetTabBoxes().size(); ++i)
73  {
74  SwTableBox* pTableBox = pTableLine->GetTabBoxes()[ i ];
75  if (pTableBox->GetTabLines().empty())
76  {
77  SwNodeIndex nodeIndex( *pTableBox->GetSttNd(), 1 );
78  SwNodeIndex endNodeIndex( *pTableBox->GetSttNd()->EndOfSectionNode() );
79  for( ; nodeIndex < endNodeIndex ; ++nodeIndex )
80  {
81  if ( SwTableNode* pTableNode = nodeIndex.GetNode().GetTableNode() )
82  ConvertTableToText( pTableNode, cCh );
83  }
84  }
85  else
86  {
87  ConvertNestedTablesToText( pTableBox->GetTabLines(), cCh );
88  }
89  }
90  }
91 }
92 
93 bool ConvertTableToText( const SwTableNode *pConstTableNode, sal_Unicode cCh )
94 {
95  SwTableNode *pTableNode = const_cast< SwTableNode* >( pConstTableNode );
96  ConvertNestedTablesToText( pTableNode->GetTable().GetTabLines(), cCh );
97  return pTableNode->GetDoc().TableToText( pTableNode, cCh );
98 }
99 //End for bug #i119954#
100 
102  sal_uInt16 nRows, sal_uInt16 nCols,
103  const SwTableAutoFormat* pTAFormat )
104 {
105  StartAllAction();
106  SwPosition* pPos = GetCursor()->GetPoint();
107 
108  bool bEndUndo = 0 != pPos->nContent.GetIndex();
109  if( bEndUndo )
110  {
112  GetDoc()->getIDocumentContentOperations().SplitNode( *pPos, false );
113  }
114 
115  // If called from a shell the adjust item is propagated
116  // from pPos to the new content nodes in the table.
117  const SwTable *pTable = GetDoc()->InsertTable( rInsTableOpts, *pPos,
118  nRows, nCols,
119  css::text::HoriOrientation::FULL, pTAFormat,
120  nullptr, true );
121  if( bEndUndo )
123 
124  EndAllAction();
125 
126  OUString parameter = " Columns : " + OUString::number( nCols ) + " , Rows : " + OUString::number( nRows ) + " ";
127  collectUIInformation("CREATE_TABLE", parameter);
128 
129  return *pTable;
130 }
131 
133  sal_Unicode cCh,
134  const SwTableAutoFormat* pTAFormat )
135 {
136  SwWait aWait( *GetDoc()->GetDocShell(), true );
137  bool bRet = false;
138  StartAllAction();
139  for(const SwPaM& rPaM : GetCursor()->GetRingContainer())
140  {
141  if( rPaM.HasMark() )
142  bRet |= nullptr != GetDoc()->TextToTable( rInsTableOpts, rPaM, cCh,
143  css::text::HoriOrientation::FULL, pTAFormat );
144  }
145  EndAllAction();
146  return bRet;
147 }
148 
150 {
151  SwWait aWait( *GetDoc()->GetDocShell(), true );
152  SwPaM* pCursor = GetCursor();
153  const SwTableNode* pTableNd =
154  GetDoc()->IsIdxInTable( pCursor->GetPoint()->nNode );
155  if (!pTableNd)
156  return false;
157 
158  if( IsTableMode() )
159  {
160  ClearMark();
161  pCursor = GetCursor();
162  }
163  else if (pCursor->GetNext() != pCursor)
164  return false;
165 
166  // TL_CHART2:
167  // tell the charts about the table to be deleted and have them use their own data
169 
170  StartAllAction();
171 
172  // move current Cursor out of the listing area
173  SwNodeIndex aTabIdx( *pTableNd );
174  pCursor->DeleteMark();
175  pCursor->GetPoint()->nNode = *pTableNd->EndOfSectionNode();
176  pCursor->GetPoint()->nContent.Assign( nullptr, 0 );
177  // move sPoint and Mark out of the area!
178  pCursor->SetMark();
179  pCursor->DeleteMark();
180 
181  //Modified for bug #i119954# Application crashed if undo/redo convert nest table to text
182  StartUndo();
183  bool bRet = ConvertTableToText( pTableNd, cCh );
184  EndUndo();
185  //End for bug #i119954#
186  pCursor->GetPoint()->nNode = aTabIdx;
187 
188  SwContentNode* pCNd = pCursor->GetContentNode();
189  if( !pCNd )
190  pCursor->Move( fnMoveForward, GoInContent );
191  else
192  pCursor->GetPoint()->nContent.Assign( pCNd, 0 );
193 
194  EndAllAction();
195  return bRet;
196 }
197 
199 {
200  bool bOnlyText = false;
201  for(SwPaM& rPaM : GetCursor()->GetRingContainer())
202  {
203  if( rPaM.HasMark() && *rPaM.GetPoint() != *rPaM.GetMark() )
204  {
205  bOnlyText = true;
206 
207  // check if selection is in listing
208  SwNodeOffset nStt = rPaM.Start()->nNode.GetIndex(),
209  nEnd = rPaM.End()->nNode.GetIndex();
210 
211  for( ; nStt <= nEnd; ++nStt )
212  if( !GetDoc()->GetNodes()[ nStt ]->IsTextNode() )
213  {
214  bOnlyText = false;
215  break;
216  }
217 
218  if( !bOnlyText )
219  break;
220  }
221  }
222 
223  return bOnlyText;
224 }
225 
227  SwDDEFieldType* pDDEType,
228  sal_uInt16 nRows, sal_uInt16 nCols )
229 {
230  SwPosition* pPos = GetCursor()->GetPoint();
231 
232  StartAllAction();
233 
234  bool bEndUndo = 0 != pPos->nContent.GetIndex();
235  if( bEndUndo )
236  {
238  GetDoc()->getIDocumentContentOperations().SplitNode( *pPos, false );
239  }
240 
241  const SwInsertTableOptions aInsTableOpts( rInsTableOpts.mnInsMode | SwInsertTableFlags::DefaultBorder,
242  rInsTableOpts.mnRowsToRepeat );
243  SwTable* pTable = const_cast<SwTable*>(GetDoc()->InsertTable( aInsTableOpts, *pPos,
244  nRows, nCols, css::text::HoriOrientation::FULL ));
245 
246  SwTableNode* pTableNode = const_cast<SwTableNode*>(pTable->GetTabSortBoxes()[ 0 ]->
247  GetSttNd()->FindTableNode());
248  std::unique_ptr<SwDDETable> pDDETable(new SwDDETable( *pTable, pDDEType ));
249  pTableNode->SetNewTable( std::move(pDDETable) ); // set the DDE table
250 
251  if( bEndUndo )
253 
254  EndAllAction();
255 }
256 
259 {
260  const SwTableNode* pTableNd = IsCursorInTable();
261 
262  if( pTableNd )
263  {
264  StartAllAction();
265  if( DoesUndo() )
266  StartUndo();
268  SwTableFormulaUpdate aTableUpdate( &pTableNd->GetTable() );
269  GetDoc()->getIDocumentFieldsAccess().UpdateTableFields( &aTableUpdate );
270  if( DoesUndo() )
271  EndUndo();
272  EndAllAction();
273  }
274 }
275 
276 // get/set Change Mode
277 
279 {
281  const SwTableNode* pTableNd = IsCursorInTable();
282  if( pTableNd )
283  eMode = pTableNd->GetTable().GetTableChgMode();
284  else
285  eMode = GetTableChgDefaultMode();
286  return eMode;
287 }
288 
290 {
291  const SwTableNode* pTableNd = IsCursorInTable();
292 
293  if( pTableNd )
294  {
295  const_cast<SwTable&>(pTableNd->GetTable()).SetTableChgMode( eMode );
296  if( !GetDoc()->getIDocumentState().IsModified() ) // Bug 57028
297  {
299  }
301  }
302 }
303 
305 {
306  SwSelBoxes aBoxes;
307  if( IsTableMode() )
308  ::GetTableSelCrs( *this, aBoxes );
309  else
310  {
311  do {
312  SwFrame *pFrame = GetCurrFrame();
313  do {
314  pFrame = pFrame->GetUpper();
315  } while ( pFrame && !pFrame->IsCellFrame() );
316  if ( pFrame )
317  {
318  SwTableBox *pBox = const_cast<SwTableBox*>(static_cast<SwCellFrame*>(pFrame)->GetTabBox());
319  aBoxes.insert( pBox );
320  }
321  } while( false );
322  }
323 
324  for (size_t n = 0; n < aBoxes.size(); ++n)
325  {
326  const SwTableBox* pSelBox = aBoxes[ n ];
327  const SwTableBoxFormat* pTableFormat = static_cast<SwTableBoxFormat*>(pSelBox->GetFrameFormat());
328  if( !n )
329  {
330  // Convert formulae into external presentation
331  const SwTable& rTable = pSelBox->GetSttNd()->FindTableNode()->GetTable();
332 
333  SwTableFormulaUpdate aTableUpdate( &rTable );
334  aTableUpdate.m_eFlags = TBL_BOXNAME;
335  GetDoc()->getIDocumentFieldsAccess().UpdateTableFields( &aTableUpdate );
336 
337  rSet.Put( pTableFormat->GetAttrSet() );
338  }
339  else
340  rSet.MergeValues( pTableFormat->GetAttrSet() );
341  }
342  return 0 != rSet.Count();
343 }
344 
346 {
347  CurrShell aCurr( this );
348  SwSelBoxes aBoxes;
349  if( IsTableMode() )
350  ::GetTableSelCrs( *this, aBoxes );
351  else
352  {
353  do {
354  SwFrame *pFrame = GetCurrFrame();
355  do {
356  pFrame = pFrame->GetUpper();
357  } while ( pFrame && !pFrame->IsCellFrame() );
358  if ( pFrame )
359  {
360  SwTableBox *pBox = const_cast<SwTableBox*>(static_cast<SwCellFrame*>(pFrame)->GetTabBox());
361  aBoxes.insert( pBox );
362  }
363  } while( false );
364  }
365 
366  // When setting a formula, do not check further!
367  if( SfxItemState::SET == rSet.GetItemState( RES_BOXATR_FORMULA ))
369 
370  StartAllAction();
372  for (size_t n = 0; n < aBoxes.size(); ++n)
373  {
374  GetDoc()->SetTableBoxFormulaAttrs( *aBoxes[ n ], rSet );
375  }
377  EndAllAction();
378 }
379 
381 {
382  if( IsTableMode() )
383  return false;
384 
385  const SwTableBox *pBox = nullptr;
386  {
387  SwFrame *pFrame = GetCurrFrame();
388  do {
389  pFrame = pFrame->GetUpper();
390  } while ( pFrame && !pFrame->IsCellFrame() );
391  if ( pFrame )
392  pBox = static_cast<SwCellFrame*>(pFrame)->GetTabBox();
393  }
394 
395  if( !pBox )
396  return false;
397 
398  sal_uInt32 nFormat = 0;
399  if( const SwTableBoxNumFormat* pItem = pBox->GetFrameFormat()->GetAttrSet().GetItemIfSet(
401  {
402  nFormat = pItem->GetValue();
403  return GetDoc()->GetNumberFormatter()->IsTextFormat( nFormat );
404  }
405 
406  SwNodeOffset nNd = pBox->IsValidNumTextNd();
407  if( NODE_OFFSET_MAX == nNd )
408  return true;
409 
410  const OUString& rText = GetDoc()->GetNodes()[ nNd ]->GetTextNode()->GetText();
411  if( rText.isEmpty() )
412  return false;
413 
414  double fVal;
415  return !GetDoc()->IsNumberFormat( rText, nFormat, fVal );
416 }
417 
419 {
420  OUString sRet;
421  if( !IsTableMode() )
422  {
423  const SwTableBox *pBox = nullptr;
424  {
425  SwFrame *pFrame = GetCurrFrame();
426  do {
427  pFrame = pFrame->GetUpper();
428  } while ( pFrame && !pFrame->IsCellFrame() );
429  if ( pFrame )
430  pBox = static_cast<SwCellFrame*>(pFrame)->GetTabBox();
431  }
432 
433  SwNodeOffset nNd;
434  if( pBox && NODE_OFFSET_MAX != ( nNd = pBox->IsValidNumTextNd() ) )
435  sRet = GetDoc()->GetNodes()[ nNd ]->GetTextNode()->GetText();
436  }
437  return sRet;
438 }
439 
441 {
442  SwPaM *pCursor = GetCursor();
443  if( pCursor->GetNode().FindTableNode() )
444  {
445  StartAllAction();
447 
448  GetDoc()->SplitTable( *pCursor->GetPoint(), eMode, true );
449 
451  ClearFEShellTabCols(*GetDoc(), nullptr);
452  EndAllAction();
453  }
454 }
455 
456 bool SwEditShell::MergeTable( bool bWithPrev )
457 {
458  bool bRet = false;
459  SwPaM *pCursor = GetCursor();
460  if( pCursor->GetNode().FindTableNode() )
461  {
462  StartAllAction();
464 
465  bRet = GetDoc()->MergeTable( *pCursor->GetPoint(), bWithPrev );
466 
468  ClearFEShellTabCols(*GetDoc(), nullptr);
469  EndAllAction();
470  }
471  return bRet;
472 }
473 
474 bool SwEditShell::CanMergeTable( bool bWithPrev, bool* pChkNxtPrv ) const
475 {
476  bool bRet = false;
477  const SwPaM *pCursor = GetCursor();
478  const SwTableNode* pTableNd = pCursor->GetNode().FindTableNode();
479  if( pTableNd && dynamic_cast< const SwDDETable* >(&pTableNd->GetTable()) == nullptr)
480  {
481  bool bNew = pTableNd->GetTable().IsNewModel();
482  const SwNodes& rNds = GetDoc()->GetNodes();
483  if( pChkNxtPrv )
484  {
485  const SwTableNode* pChkNd = rNds[ pTableNd->GetIndex() - 1 ]->FindTableNode();
486  if( pChkNd && dynamic_cast< const SwDDETable* >(&pChkNd->GetTable()) == nullptr &&
487  bNew == pChkNd->GetTable().IsNewModel() &&
488  // Consider table in table case
489  pChkNd->EndOfSectionIndex() == pTableNd->GetIndex() - 1 )
490  {
491  *pChkNxtPrv = true;
492  bRet = true; // using Prev is possible
493  }
494  else
495  {
496  pChkNd = rNds[ pTableNd->EndOfSectionIndex() + 1 ]->GetTableNode();
497  if( pChkNd && dynamic_cast< const SwDDETable* >(&pChkNd->GetTable()) == nullptr &&
498  bNew == pChkNd->GetTable().IsNewModel() )
499  {
500  *pChkNxtPrv = false;
501  bRet = true; // using Next is possible
502  }
503  }
504  }
505  else
506  {
507  const SwTableNode* pTmpTableNd = nullptr;
508 
509  if( bWithPrev )
510  {
511  pTmpTableNd = rNds[ pTableNd->GetIndex() - 1 ]->FindTableNode();
512  // Consider table in table case
513  if ( pTmpTableNd && pTmpTableNd->EndOfSectionIndex() != pTableNd->GetIndex() - 1 )
514  pTmpTableNd = nullptr;
515  }
516  else
517  pTmpTableNd = rNds[ pTableNd->EndOfSectionIndex() + 1 ]->GetTableNode();
518 
519  bRet = pTmpTableNd && dynamic_cast< const SwDDETable* >(&pTmpTableNd->GetTable()) == nullptr &&
520  bNew == pTmpTableNd->GetTable().IsNewModel();
521  }
522  }
523  return bRet;
524 }
525 
528 {
529  GetDoc()->AppendUndoForInsertFromDB( *GetCursor(), bIsTable );
530 }
531 
532 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
void SetTableBoxFormulaAttrs(SwTableBox &rBox, const SfxItemSet &rSet)
Definition: ndtbl.cxx:4194
void AppendUndoForInsertFromDB(const SwPaM &rPam, bool bIsTable)
Set up the InsertDB as Undo table.
Definition: doc.cxx:1701
const SwEndNode * EndOfSectionNode() const
Definition: node.hxx:694
bool IsTableBoxTextFormat() const
Definition: edtab.cxx:380
Base class of the Writer layout elements.
Definition: frame.hxx:314
void DeleteMark()
Definition: pam.hxx:178
SwNode & GetNode(bool bPoint=true) const
Definition: pam.hxx:224
bool GoInContent(SwPaM &rPam, SwMoveFnCollection const &fnMove)
Definition: pam.cxx:994
SwNodeOffset EndOfSectionIndex() const
Definition: node.hxx:689
const T * GetItemIfSet(TypedWhichId< T > nWhich, bool bSrchInParent=true) const
Marks a position in the document model.
Definition: pam.hxx:36
const SwNodes & GetNodes() const
Definition: viewsh.cxx:2190
void InsertDDETable(const SwInsertTableOptions &rInsTableOpts, SwDDEFieldType *pDDEType, sal_uInt16 nRows, sal_uInt16 nCols)
Definition: edtab.cxx:226
constexpr TypedWhichId< SwTableBoxNumFormat > RES_BOXATR_FORMAT(RES_BOXATR_BEGIN)
bool TableToText(const SwTableNode *pTableNd, sal_Unicode cCh)
Table to Text.
Definition: ndtbl.cxx:1450
constexpr SwNodeOffset NODE_OFFSET_MAX(SAL_MAX_INT32)
void ClearTableBoxContent()
Definition: trvltbl.cxx:909
SvNumberFormatter * GetNumberFormatter(bool bCreate=true)
Definition: doc.hxx:1410
SwNodeIndex nNode
Definition: pam.hxx:38
bool IsTableMode() const
Definition: crsrsh.hxx:648
virtual void SetModified()=0
Must be called manually at changes of format.
SwInsertTableFlags mnInsMode
Definition: itabenum.hxx:40
virtual void CreateChartInternalDataProviders(const SwTable *pTable)=0
calls createInternalDataProvider for all charts using the specified table
sal_Int64 n
virtual SwUndoId EndUndo(SwUndoId const eUndoId, SwRewriter const *const pRewriter)=0
Closes undo block.
TableChgMode GetTableChgMode() const
Definition: edtab.cxx:278
SwUndoId EndUndo(SwUndoId eUndoId=SwUndoId::EMPTY, const SwRewriter *pRewriter=nullptr)
Closes parenthesis of nUndoId, not used by UI.
Definition: edws.cxx:234
SwTableLine is one table row in the document model.
Definition: swtable.hxx:357
bool TextToTable(const SwInsertTableOptions &rInsTableOpts, sal_Unicode cCh, const SwTableAutoFormat *pTAFormat=nullptr)
Definition: edtab.cxx:132
IDocumentUndoRedo & GetIDocumentUndoRedo()
Definition: doc.cxx:144
bool IsCellFrame() const
Definition: frame.hxx:1226
IDocumentContentOperations const & getIDocumentContentOperations() const
Definition: doc.cxx:315
void EndAllAction()
Definition: edws.cxx:97
sal_uInt16 mnRowsToRepeat
Definition: itabenum.hxx:41
size_type size() const
Definition: swtable.hxx:76
void GetTableSelCrs(const SwCursorShell &rShell, SwSelBoxes &rBoxes)
Definition: tblsel.cxx:124
SwContentNode * GetContentNode(bool bPoint=true) const
Definition: pam.hxx:230
static UITestLogger & getInstance()
IDocumentFieldsAccess const & getIDocumentFieldsAccess() const
Definition: doc.cxx:357
void logEvent(const EventDescription &rDescription)
sal_uInt16 sal_Unicode
const SwTable & InsertTable(const SwInsertTableOptions &rInsTableOpts, sal_uInt16 nRows, sal_uInt16 nCols, const SwTableAutoFormat *pTAFormat=nullptr)
Inserts an nRows x nCols table to the document at the current position.
Definition: edtab.cxx:101
SwTableNode * GetTableNode()
Definition: node.hxx:611
SwIndex nContent
Definition: pam.hxx:39
virtual void UpdateTableFields(SfxPoolItem *pHt)=0
Mode eMode
const SwTable & GetTable() const
Definition: node.hxx:506
SwDoc * GetDoc() const
Definition: viewsh.hxx:282
size_type size() const
SwPaM * GetNext()
Definition: pam.hxx:265
void SetTableBoxFormulaAttrs(const SfxItemSet &rSet)
Definition: edtab.cxx:345
SwTableSortBoxes & GetTabSortBoxes()
Definition: swtable.hxx:262
void SetTableChgMode(TableChgMode eMode)
Definition: edtab.cxx:289
PaM is Point and Mark: a selection of the document model.
Definition: pam.hxx:137
bool Move(SwMoveFnCollection const &fnMove=fnMoveForward, SwGoInDoc fnGo=GoInContent)
Movement of cursor.
Definition: pam.cxx:503
TableChgMode GetTableChgDefaultMode()
Definition: edtwin3.cxx:103
const SwTableNode * IsCursorInTable() const
Definition: crsrsh.hxx:898
virtual SwUndoId StartUndo(SwUndoId const eUndoId, SwRewriter const *const pRewriter)=0
Opens undo block.
static bool ConvertTableToText(const SwTableNode *pTableNode, sal_Unicode cCh)
Definition: edtab.cxx:93
SfxItemState GetItemState(sal_uInt16 nWhich, bool bSrchInParent=true, const SfxPoolItem **ppItem=nullptr) const
int i
SwDoc & GetDoc()
Definition: node.hxx:213
const SwPosition * GetPoint() const
Definition: pam.hxx:208
bool empty() const
Definition: swtable.hxx:75
virtual bool IsModified() const =0
Changes of document?
virtual void SetUndoNoResetModified()=0
Disable (re)setting the document modified flag on Undo/Redo.
bool EndAllTableBoxEdit()
Definition: trvltbl.cxx:916
SwIndex & Assign(SwIndexReg *, sal_Int32)
Definition: index.cxx:206
SwNodeOffset IsValidNumTextNd(bool bCheckAttr=true) const
Definition: swtable.cxx:2656
bool IsTextFormat(sal_uInt32 nFIndex) const
SwNodeOffset GetIndex() const
Definition: node.hxx:292
sal_uInt16 Count() const
SplitTable_HeadlineOption
Definition: tblenum.hxx:54
SwLayoutFrame * GetUpper()
Definition: frame.hxx:678
SwUndoId StartUndo(SwUndoId eUndoId=SwUndoId::EMPTY, const SwRewriter *pRewriter=nullptr)
Undo: set up Undo parenthesis, return nUndoId of this parenthesis.
Definition: edws.cxx:223
OUString GetTableBoxText() const
Definition: edtab.cxx:418
static void ConvertNestedTablesToText(const SwTableLines &rTableLines, sal_Unicode cCh)
Definition: edtab.cxx:67
IDocumentState const & getIDocumentState() const
Definition: doc.cxx:394
Marks a node in the document model.
Definition: ndindex.hxx:30
SwFrameFormat * GetFrameFormat()
Definition: swtable.hxx:457
ring_container GetRingContainer()
const SwTable * TextToTable(const SwInsertTableOptions &rInsTableOpts, const SwPaM &rRange, sal_Unicode cCh, sal_Int16 eAdjust, const SwTableAutoFormat *)
Text to Table.
Definition: ndtbl.cxx:629
void MergeValues(const SfxItemSet &rSet)
IDocumentChartDataProviderAccess const & getIDocumentChartDataProviderAccess() const
Definition: doc.cxx:227
void UpdateTable()
update fields of a listing
Definition: edtab.cxx:258
SwTableLines & GetTabLines()
Definition: swtable.hxx:201
SwTable is one table in the document model, containing rows (which contain cells).
Definition: swtable.hxx:112
SwTableLines & GetTabLines()
Definition: swtable.hxx:450
TableMergeErr MergeTable(SwPaM &rPam)
Definition: ndtbl.cxx:2224
void AppendUndoForInsertFromDB(bool bIsTable)
Set up InsertDB as table Undo.
Definition: edtab.cxx:527
bool MergeTable(bool bWithPrev)
Definition: edtab.cxx:456
const SfxPoolItem * Put(const SfxPoolItem &rItem, sal_uInt16 nWhich)
SwTableBoxes & GetTabBoxes()
Definition: swtable.hxx:368
SwCursor * GetCursor(bool bMakeTableCursor=true) const
Return pointer to the current shell cursor.
Definition: crsrsh.cxx:195
const SwStartNode * GetSttNd() const
Definition: swtable.hxx:471
bool CanMergeTable(bool bWithPrev=true, bool *pChkNxtPrv=nullptr) const
Merge tables.
Definition: edtab.cxx:474
SwContentFrame * GetCurrFrame(const bool bCalcFrame=true) const
Get current frame in which the cursor is positioned.
Definition: crsrsh.cxx:2457
SwTableNode * IsIdxInTable(const SwNodeIndex &rIdx)
Definition: ndtbl.cxx:219
bool SplitTable(const SwSelBoxes &rBoxes, bool bVert, sal_uInt16 nCnt, bool bSameHeight=false)
Split up/merge Boxes in the Table.
Definition: ndtbl.cxx:2158
bool IsTextToTableAvailable() const
Definition: edtab.cxx:198
SwMoveFnCollection const & fnMoveForward
SwPam::Move()/Find() default argument.
Definition: paminit.cxx:59
sal_Int32 GetIndex() const
Definition: index.hxx:91
bool TableToText(sal_Unicode cCh)
Definition: edtab.cxx:149
SwNodes & GetNodes()
Definition: doc.hxx:408
constexpr TypedWhichId< SwTableBoxFormula > RES_BOXATR_FORMULA(151)
void ClearFEShellTabCols(SwDoc &rDoc, SwTabFrame const *const pFrame)
Definition: fetab.cxx:2162
SwTableBox is one table cell in the document model.
Definition: swtable.hxx:418
bool GetTableBoxFormulaAttrs(SfxItemSet &rSet) const
Definition: edtab.cxx:304
void ClearMark()
Definition: crsrsh.cxx:939
SwTableNode * FindTableNode()
Search table node, in which it is.
Definition: node.cxx:358
bool IsNumberFormat(const OUString &rString, sal_uInt32 &F_Index, double &fOutNumber)
Definition: ndtbl.cxx:4039
virtual bool SplitNode(const SwPosition &rPos, bool bChkTableStart)=0
Split a node at rPos (implemented only for TextNode).
TableChgMode
Definition: tblenum.hxx:47
virtual void SetMark()
Unless this is called, the getter method of Mark will return Point.
Definition: pam.cxx:477
const SwAttrSet & GetAttrSet() const
For querying the attribute array.
Definition: format.hxx:136
TableFormulaUpdateFlags m_eFlags
Definition: hints.hxx:270
bool DoesUndo() const
Definition: edws.cxx:203
std::map< OUString, OUString > aParameters
void SetNewTable(std::unique_ptr< SwTable >, bool bNewFrames=true)
Definition: ndtbl.cxx:2484
std::pair< const_iterator, bool > insert(Value &&x)
void StartAllAction()
For all views of this document.
Definition: edws.cxx:86
bool IsNewModel() const
Definition: swtable.hxx:188
const SwTable * InsertTable(const SwInsertTableOptions &rInsTableOpts, const SwPosition &rPos, sal_uInt16 nRows, sal_uInt16 nCols, sal_Int16 eAdjust, const SwTableAutoFormat *pTAFormat=nullptr, const std::vector< sal_uInt16 > *pColArr=nullptr, bool bCalledFromShell=false, bool bNewModel=true)
Insert new table at position.
Definition: ndtbl.cxx:343
TableChgMode GetTableChgMode() const
Definition: swtable.hxx:333
SwCellFrame is one table cell in the document layout.
Definition: cellfrm.hxx:30
void SplitTable(SplitTable_HeadlineOption eMode)
Split table at cursor position.
Definition: edtab.cxx:440