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  sal_uLong nStt = rPaM.GetMark()->nNode.GetIndex(),
209  nEnd = rPaM.GetPoint()->nNode.GetIndex();
210  if( nStt > nEnd ) { sal_uLong n = nStt; nStt = nEnd; nEnd = n; }
211 
212  for( ; nStt <= nEnd; ++nStt )
213  if( !GetDoc()->GetNodes()[ nStt ]->IsTextNode() )
214  {
215  bOnlyText = false;
216  break;
217  }
218 
219  if( !bOnlyText )
220  break;
221  }
222  }
223 
224  return bOnlyText;
225 }
226 
228  SwDDEFieldType* pDDEType,
229  sal_uInt16 nRows, sal_uInt16 nCols )
230 {
231  SwPosition* pPos = GetCursor()->GetPoint();
232 
233  StartAllAction();
234 
235  bool bEndUndo = 0 != pPos->nContent.GetIndex();
236  if( bEndUndo )
237  {
239  GetDoc()->getIDocumentContentOperations().SplitNode( *pPos, false );
240  }
241 
242  const SwInsertTableOptions aInsTableOpts( rInsTableOpts.mnInsMode | SwInsertTableFlags::DefaultBorder,
243  rInsTableOpts.mnRowsToRepeat );
244  SwTable* pTable = const_cast<SwTable*>(GetDoc()->InsertTable( aInsTableOpts, *pPos,
245  nRows, nCols, css::text::HoriOrientation::FULL ));
246 
247  SwTableNode* pTableNode = const_cast<SwTableNode*>(pTable->GetTabSortBoxes()[ 0 ]->
248  GetSttNd()->FindTableNode());
249  std::unique_ptr<SwDDETable> pDDETable(new SwDDETable( *pTable, pDDEType ));
250  pTableNode->SetNewTable( std::move(pDDETable) ); // set the DDE table
251 
252  if( bEndUndo )
254 
255  EndAllAction();
256 }
257 
260 {
261  const SwTableNode* pTableNd = IsCursorInTable();
262 
263  if( pTableNd )
264  {
265  StartAllAction();
266  if( DoesUndo() )
267  StartUndo();
269  SwTableFormulaUpdate aTableUpdate( &pTableNd->GetTable() );
270  GetDoc()->getIDocumentFieldsAccess().UpdateTableFields( &aTableUpdate );
271  if( DoesUndo() )
272  EndUndo();
273  EndAllAction();
274  }
275 }
276 
277 // get/set Change Mode
278 
280 {
282  const SwTableNode* pTableNd = IsCursorInTable();
283  if( pTableNd )
284  eMode = pTableNd->GetTable().GetTableChgMode();
285  else
286  eMode = GetTableChgDefaultMode();
287  return eMode;
288 }
289 
291 {
292  const SwTableNode* pTableNd = IsCursorInTable();
293 
294  if( pTableNd )
295  {
296  const_cast<SwTable&>(pTableNd->GetTable()).SetTableChgMode( eMode );
297  if( !GetDoc()->getIDocumentState().IsModified() ) // Bug 57028
298  {
300  }
302  }
303 }
304 
306 {
307  SwSelBoxes aBoxes;
308  if( IsTableMode() )
309  ::GetTableSelCrs( *this, aBoxes );
310  else
311  {
312  do {
313  SwFrame *pFrame = GetCurrFrame();
314  do {
315  pFrame = pFrame->GetUpper();
316  } while ( pFrame && !pFrame->IsCellFrame() );
317  if ( pFrame )
318  {
319  SwTableBox *pBox = const_cast<SwTableBox*>(static_cast<SwCellFrame*>(pFrame)->GetTabBox());
320  aBoxes.insert( pBox );
321  }
322  } while( false );
323  }
324 
325  for (size_t n = 0; n < aBoxes.size(); ++n)
326  {
327  const SwTableBox* pSelBox = aBoxes[ n ];
328  const SwTableBoxFormat* pTableFormat = static_cast<SwTableBoxFormat*>(pSelBox->GetFrameFormat());
329  if( !n )
330  {
331  // Convert formulae into external presentation
332  const SwTable& rTable = pSelBox->GetSttNd()->FindTableNode()->GetTable();
333 
334  SwTableFormulaUpdate aTableUpdate( &rTable );
335  aTableUpdate.m_eFlags = TBL_BOXNAME;
336  GetDoc()->getIDocumentFieldsAccess().UpdateTableFields( &aTableUpdate );
337 
338  rSet.Put( pTableFormat->GetAttrSet() );
339  }
340  else
341  rSet.MergeValues( pTableFormat->GetAttrSet() );
342  }
343  return 0 != rSet.Count();
344 }
345 
347 {
348  CurrShell aCurr( this );
349  SwSelBoxes aBoxes;
350  if( IsTableMode() )
351  ::GetTableSelCrs( *this, aBoxes );
352  else
353  {
354  do {
355  SwFrame *pFrame = GetCurrFrame();
356  do {
357  pFrame = pFrame->GetUpper();
358  } while ( pFrame && !pFrame->IsCellFrame() );
359  if ( pFrame )
360  {
361  SwTableBox *pBox = const_cast<SwTableBox*>(static_cast<SwCellFrame*>(pFrame)->GetTabBox());
362  aBoxes.insert( pBox );
363  }
364  } while( false );
365  }
366 
367  // When setting a formula, do not check further!
368  if( SfxItemState::SET == rSet.GetItemState( RES_BOXATR_FORMULA ))
370 
371  StartAllAction();
373  for (size_t n = 0; n < aBoxes.size(); ++n)
374  {
375  GetDoc()->SetTableBoxFormulaAttrs( *aBoxes[ n ], rSet );
376  }
378  EndAllAction();
379 }
380 
382 {
383  if( IsTableMode() )
384  return false;
385 
386  const SwTableBox *pBox = nullptr;
387  {
388  SwFrame *pFrame = GetCurrFrame();
389  do {
390  pFrame = pFrame->GetUpper();
391  } while ( pFrame && !pFrame->IsCellFrame() );
392  if ( pFrame )
393  pBox = static_cast<SwCellFrame*>(pFrame)->GetTabBox();
394  }
395 
396  if( !pBox )
397  return false;
398 
399  sal_uInt32 nFormat = 0;
400  const SfxPoolItem* pItem;
401  if( SfxItemState::SET == pBox->GetFrameFormat()->GetAttrSet().GetItemState(
402  RES_BOXATR_FORMAT, true, &pItem ))
403  {
404  nFormat = static_cast<const SwTableBoxNumFormat*>(pItem)->GetValue();
405  return GetDoc()->GetNumberFormatter()->IsTextFormat( nFormat );
406  }
407 
408  sal_uLong nNd = pBox->IsValidNumTextNd();
409  if( ULONG_MAX == nNd )
410  return true;
411 
412  const OUString& rText = GetDoc()->GetNodes()[ nNd ]->GetTextNode()->GetText();
413  if( rText.isEmpty() )
414  return false;
415 
416  double fVal;
417  return !GetDoc()->IsNumberFormat( rText, nFormat, fVal );
418 }
419 
421 {
422  OUString sRet;
423  if( !IsTableMode() )
424  {
425  const SwTableBox *pBox = nullptr;
426  {
427  SwFrame *pFrame = GetCurrFrame();
428  do {
429  pFrame = pFrame->GetUpper();
430  } while ( pFrame && !pFrame->IsCellFrame() );
431  if ( pFrame )
432  pBox = static_cast<SwCellFrame*>(pFrame)->GetTabBox();
433  }
434 
435  sal_uLong nNd;
436  if( pBox && ULONG_MAX != ( nNd = pBox->IsValidNumTextNd() ) )
437  sRet = GetDoc()->GetNodes()[ nNd ]->GetTextNode()->GetText();
438  }
439  return sRet;
440 }
441 
443 {
444  SwPaM *pCursor = GetCursor();
445  if( pCursor->GetNode().FindTableNode() )
446  {
447  StartAllAction();
449 
450  GetDoc()->SplitTable( *pCursor->GetPoint(), eMode, true );
451 
453  ClearFEShellTabCols(*GetDoc(), nullptr);
454  EndAllAction();
455  }
456 }
457 
458 bool SwEditShell::MergeTable( bool bWithPrev )
459 {
460  bool bRet = false;
461  SwPaM *pCursor = GetCursor();
462  if( pCursor->GetNode().FindTableNode() )
463  {
464  StartAllAction();
466 
467  bRet = GetDoc()->MergeTable( *pCursor->GetPoint(), bWithPrev );
468 
470  ClearFEShellTabCols(*GetDoc(), nullptr);
471  EndAllAction();
472  }
473  return bRet;
474 }
475 
476 bool SwEditShell::CanMergeTable( bool bWithPrev, bool* pChkNxtPrv ) const
477 {
478  bool bRet = false;
479  const SwPaM *pCursor = GetCursor();
480  const SwTableNode* pTableNd = pCursor->GetNode().FindTableNode();
481  if( pTableNd && dynamic_cast< const SwDDETable* >(&pTableNd->GetTable()) == nullptr)
482  {
483  bool bNew = pTableNd->GetTable().IsNewModel();
484  const SwNodes& rNds = GetDoc()->GetNodes();
485  if( pChkNxtPrv )
486  {
487  const SwTableNode* pChkNd = rNds[ pTableNd->GetIndex() - 1 ]->FindTableNode();
488  if( pChkNd && dynamic_cast< const SwDDETable* >(&pChkNd->GetTable()) == nullptr &&
489  bNew == pChkNd->GetTable().IsNewModel() &&
490  // Consider table in table case
491  pChkNd->EndOfSectionIndex() == pTableNd->GetIndex() - 1 )
492  {
493  *pChkNxtPrv = true;
494  bRet = true; // using Prev is possible
495  }
496  else
497  {
498  pChkNd = rNds[ pTableNd->EndOfSectionIndex() + 1 ]->GetTableNode();
499  if( pChkNd && dynamic_cast< const SwDDETable* >(&pChkNd->GetTable()) == nullptr &&
500  bNew == pChkNd->GetTable().IsNewModel() )
501  {
502  *pChkNxtPrv = false;
503  bRet = true; // using Next is possible
504  }
505  }
506  }
507  else
508  {
509  const SwTableNode* pTmpTableNd = nullptr;
510 
511  if( bWithPrev )
512  {
513  pTmpTableNd = rNds[ pTableNd->GetIndex() - 1 ]->FindTableNode();
514  // Consider table in table case
515  if ( pTmpTableNd && pTmpTableNd->EndOfSectionIndex() != pTableNd->GetIndex() - 1 )
516  pTmpTableNd = nullptr;
517  }
518  else
519  pTmpTableNd = rNds[ pTableNd->EndOfSectionIndex() + 1 ]->GetTableNode();
520 
521  bRet = pTmpTableNd && dynamic_cast< const SwDDETable* >(&pTmpTableNd->GetTable()) == nullptr &&
522  bNew == pTmpTableNd->GetTable().IsNewModel();
523  }
524  }
525  return bRet;
526 }
527 
530 {
531  GetDoc()->AppendUndoForInsertFromDB( *GetCursor(), bIsTable );
532 }
533 
534 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
void SetTableBoxFormulaAttrs(SwTableBox &rBox, const SfxItemSet &rSet)
Definition: ndtbl.cxx:4180
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:683
bool IsTableBoxTextFormat() const
Definition: edtab.cxx:381
Base class of the Writer layout elements.
Definition: frame.hxx:315
void DeleteMark()
Definition: pam.hxx:177
sal_uLong GetIndex() const
Definition: node.hxx:291
SwNode & GetNode(bool bPoint=true) const
Definition: pam.hxx:223
bool GoInContent(SwPaM &rPam, SwMoveFnCollection const &fnMove)
Definition: pam.cxx:970
Marks a position in the document model.
Definition: pam.hxx:35
const SwNodes & GetNodes() const
Definition: viewsh.cxx:2085
void InsertDDETable(const SwInsertTableOptions &rInsTableOpts, SwDDEFieldType *pDDEType, sal_uInt16 nRows, sal_uInt16 nCols)
Definition: edtab.cxx:227
constexpr TypedWhichId< SwTableBoxNumFormat > RES_BOXATR_FORMAT(RES_BOXATR_BEGIN)
bool TableToText(const SwTableNode *pTableNd, sal_Unicode cCh)
Table to Text.
Definition: ndtbl.cxx:1456
void ClearTableBoxContent()
Definition: trvltbl.cxx:909
std::string GetValue
SvNumberFormatter * GetNumberFormatter(bool bCreate=true)
Definition: doc.hxx:1411
SwNodeIndex nNode
Definition: pam.hxx:37
bool IsTableMode() const
Definition: crsrsh.hxx:642
virtual void SetModified()=0
Must be called manually at changes of format.
sal_uIntPtr sal_uLong
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:279
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:1227
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:229
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)
Definition: edtab.cxx:101
SwTableNode * GetTableNode()
Definition: node.hxx:600
SwIndex nContent
Definition: pam.hxx:38
virtual void UpdateTableFields(SfxPoolItem *pHt)=0
Mode eMode
const SwTable & GetTable() const
Definition: node.hxx:499
SwDoc * GetDoc() const
Definition: viewsh.hxx:281
size_type size() const
sal_uLong IsValidNumTextNd(bool bCheckAttr=true) const
Definition: swtable.cxx:2516
SwPaM * GetNext()
Definition: pam.hxx:264
void SetTableBoxFormulaAttrs(const SfxItemSet &rSet)
Definition: edtab.cxx:346
SwTableSortBoxes & GetTabSortBoxes()
Definition: swtable.hxx:262
void SetTableChgMode(TableChgMode eMode)
Definition: edtab.cxx:290
PaM is Point and Mark: a selection of the document model.
Definition: pam.hxx:136
bool Move(SwMoveFnCollection const &fnMove=fnMoveForward, SwGoInDoc fnGo=GoInContent)
Movement of cursor.
Definition: pam.cxx:504
TableChgMode GetTableChgDefaultMode()
Definition: edtwin3.cxx:103
const SwTableNode * IsCursorInTable() const
Definition: crsrsh.hxx:883
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:212
const SwPosition * GetPoint() const
Definition: pam.hxx:207
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
bool IsTextFormat(sal_uInt32 nFIndex) const
sal_uInt16 Count() const
SplitTable_HeadlineOption
Definition: tblenum.hxx:53
SwLayoutFrame * GetUpper()
Definition: frame.hxx:679
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:420
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:31
SwFrameFormat * GetFrameFormat()
Definition: swtable.hxx:444
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:259
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:437
TableMergeErr MergeTable(SwPaM &rPam)
Definition: ndtbl.cxx:2233
void AppendUndoForInsertFromDB(bool bIsTable)
Set up InsertDB as table Undo.
Definition: edtab.cxx:529
bool MergeTable(bool bWithPrev)
Definition: edtab.cxx:458
sal_uLong EndOfSectionIndex() const
Definition: node.hxx:678
const SfxPoolItem * Put(const SfxPoolItem &rItem, sal_uInt16 nWhich)
SwTableBoxes & GetTabBoxes()
Definition: swtable.hxx:367
SwCursor * GetCursor(bool bMakeTableCursor=true) const
Return pointer to the current shell cursor.
Definition: crsrsh.cxx:195
const SwStartNode * GetSttNd() const
Definition: swtable.hxx:458
bool CanMergeTable(bool bWithPrev=true, bool *pChkNxtPrv=nullptr) const
Merge tables.
Definition: edtab.cxx:476
SwContentFrame * GetCurrFrame(const bool bCalcFrame=true) const
Get current frame in which the cursor is positioned.
Definition: crsrsh.cxx:2447
SwTableNode * IsIdxInTable(const SwNodeIndex &rIdx)
Definition: ndtbl.cxx:214
bool SplitTable(const SwSelBoxes &rBoxes, bool bVert, sal_uInt16 nCnt, bool bSameHeight=false)
Split up/merge Boxes in the Table.
Definition: ndtbl.cxx:2167
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:409
constexpr TypedWhichId< SwTableBoxFormula > RES_BOXATR_FORMULA(151)
void ClearFEShellTabCols(SwDoc &rDoc, SwTabFrame const *const pFrame)
Definition: fetab.cxx:2114
SwTableBox is one table cell in the document model.
Definition: swtable.hxx:405
bool GetTableBoxFormulaAttrs(SfxItemSet &rSet) const
Definition: edtab.cxx:305
void ClearMark()
Definition: crsrsh.cxx:939
SwTableNode * FindTableNode()
Search table node, in which it is.
Definition: node.cxx:357
bool IsNumberFormat(const OUString &rString, sal_uInt32 &F_Index, double &fOutNumber)
Definition: ndtbl.cxx:4021
virtual bool SplitNode(const SwPosition &rPos, bool bChkTableStart)=0
Split a node at rPos (implemented only for TextNode).
TableChgMode
Definition: tblenum.hxx:46
virtual void SetMark()
Unless this is called, the getter method of Mark will return Point.
Definition: pam.cxx:478
const SwAttrSet & GetAttrSet() const
For querying the attribute array.
Definition: format.hxx:120
TableFormulaUpdateFlags m_eFlags
Definition: hints.hxx:268
bool DoesUndo() const
Definition: edws.cxx:203
std::map< OUString, OUString > aParameters
void SetNewTable(std::unique_ptr< SwTable >, bool bNewFrames=true)
Definition: ndtbl.cxx:2489
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:338
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:442