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