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