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 
52 using namespace ::com::sun::star;
53 using namespace ::com::sun::star::uno;
54 
55 //Added for bug #i119954# Application crashed if undo/redo covert nest table to text
56 static bool ConvertTableToText( const SwTableNode *pTableNode, sal_Unicode cCh );
57 
58 static void ConvertNestedTablesToText( const SwTableLines &rTableLines, sal_Unicode cCh )
59 {
60  for (size_t n = 0; n < rTableLines.size(); ++n)
61  {
62  SwTableLine* pTableLine = rTableLines[ n ];
63  for (size_t i = 0; i < pTableLine->GetTabBoxes().size(); ++i)
64  {
65  SwTableBox* pTableBox = pTableLine->GetTabBoxes()[ i ];
66  if (pTableBox->GetTabLines().empty())
67  {
68  SwNodeIndex nodeIndex( *pTableBox->GetSttNd(), 1 );
69  SwNodeIndex endNodeIndex( *pTableBox->GetSttNd()->EndOfSectionNode() );
70  for( ; nodeIndex < endNodeIndex ; ++nodeIndex )
71  {
72  if ( SwTableNode* pTableNode = nodeIndex.GetNode().GetTableNode() )
73  ConvertTableToText( pTableNode, cCh );
74  }
75  }
76  else
77  {
78  ConvertNestedTablesToText( pTableBox->GetTabLines(), cCh );
79  }
80  }
81  }
82 }
83 
84 bool ConvertTableToText( const SwTableNode *pConstTableNode, sal_Unicode cCh )
85 {
86  SwTableNode *pTableNode = const_cast< SwTableNode* >( pConstTableNode );
87  ConvertNestedTablesToText( pTableNode->GetTable().GetTabLines(), cCh );
88  return pTableNode->GetDoc()->TableToText( pTableNode, cCh );
89 }
90 //End for bug #i119954#
91 
93  sal_uInt16 nRows, sal_uInt16 nCols,
94  const SwTableAutoFormat* pTAFormat )
95 {
97  SwPosition* pPos = GetCursor()->GetPoint();
98 
99  bool bEndUndo = 0 != pPos->nContent.GetIndex();
100  if( bEndUndo )
101  {
103  GetDoc()->getIDocumentContentOperations().SplitNode( *pPos, false );
104  }
105 
106  // If called from a shell the adjust item is propagated
107  // from pPos to the new content nodes in the table.
108  const SwTable *pTable = GetDoc()->InsertTable( rInsTableOpts, *pPos,
109  nRows, nCols,
110  css::text::HoriOrientation::FULL, pTAFormat,
111  nullptr, true );
112  if( bEndUndo )
114 
115  EndAllAction();
116  return *pTable;
117 }
118 
120  sal_Unicode cCh,
121  const SwTableAutoFormat* pTAFormat )
122 {
123  SwWait aWait( *GetDoc()->GetDocShell(), true );
124  bool bRet = false;
125  StartAllAction();
126  for(SwPaM& rPaM : GetCursor()->GetRingContainer())
127  {
128  if( rPaM.HasMark() )
129  bRet |= nullptr != GetDoc()->TextToTable( rInsTableOpts, rPaM, cCh,
130  css::text::HoriOrientation::FULL, pTAFormat );
131  }
132  EndAllAction();
133  return bRet;
134 }
135 
137 {
138  SwWait aWait( *GetDoc()->GetDocShell(), true );
139  bool bRet = false;
140  SwPaM* pCursor = GetCursor();
141  const SwTableNode* pTableNd =
142  GetDoc()->IsIdxInTable( pCursor->GetPoint()->nNode );
143  if( IsTableMode() )
144  {
145  ClearMark();
146  pCursor = GetCursor();
147  }
148  else if( !pTableNd || pCursor->GetNext() != pCursor )
149  return bRet;
150 
151  // TL_CHART2:
152  // tell the charts about the table to be deleted and have them use their own data
154 
155  StartAllAction();
156 
157  // move current Cursor out of the listing area
158  SwNodeIndex aTabIdx( *pTableNd );
159  pCursor->DeleteMark();
160  pCursor->GetPoint()->nNode = *pTableNd->EndOfSectionNode();
161  pCursor->GetPoint()->nContent.Assign( nullptr, 0 );
162  // move sPoint and Mark out of the area!
163  pCursor->SetMark();
164  pCursor->DeleteMark();
165 
166  //Modified for bug #i119954# Application crashed if undo/redo covert nest table to text
167  StartUndo();
168  bRet = ConvertTableToText( pTableNd, cCh );
169  EndUndo();
170  //End for bug #i119954#
171  pCursor->GetPoint()->nNode = aTabIdx;
172 
173  SwContentNode* pCNd = pCursor->GetContentNode();
174  if( !pCNd )
175  pCursor->Move( fnMoveForward, GoInContent );
176  else
177  pCursor->GetPoint()->nContent.Assign( pCNd, 0 );
178 
179  EndAllAction();
180  return bRet;
181 }
182 
184 {
185  bool bOnlyText = false;
186  for(SwPaM& rPaM : GetCursor()->GetRingContainer())
187  {
188  if( rPaM.HasMark() && *rPaM.GetPoint() != *rPaM.GetMark() )
189  {
190  bOnlyText = true;
191 
192  // check if selection is in listing
193  sal_uLong nStt = rPaM.GetMark()->nNode.GetIndex(),
194  nEnd = rPaM.GetPoint()->nNode.GetIndex();
195  if( nStt > nEnd ) { sal_uLong n = nStt; nStt = nEnd; nEnd = n; }
196 
197  for( ; nStt <= nEnd; ++nStt )
198  if( !GetDoc()->GetNodes()[ nStt ]->IsTextNode() )
199  {
200  bOnlyText = false;
201  break;
202  }
203 
204  if( !bOnlyText )
205  break;
206  }
207  }
208 
209  return bOnlyText;
210 }
211 
213  SwDDEFieldType* pDDEType,
214  sal_uInt16 nRows, sal_uInt16 nCols )
215 {
216  SwPosition* pPos = GetCursor()->GetPoint();
217 
218  StartAllAction();
219 
220  bool bEndUndo = 0 != pPos->nContent.GetIndex();
221  if( bEndUndo )
222  {
224  GetDoc()->getIDocumentContentOperations().SplitNode( *pPos, false );
225  }
226 
227  const SwInsertTableOptions aInsTableOpts( rInsTableOpts.mnInsMode | SwInsertTableFlags::DefaultBorder,
228  rInsTableOpts.mnRowsToRepeat );
229  SwTable* pTable = const_cast<SwTable*>(GetDoc()->InsertTable( aInsTableOpts, *pPos,
230  nRows, nCols, css::text::HoriOrientation::FULL ));
231 
232  SwTableNode* pTableNode = const_cast<SwTableNode*>(pTable->GetTabSortBoxes()[ 0 ]->
233  GetSttNd()->FindTableNode());
234  std::unique_ptr<SwDDETable> pDDETable(new SwDDETable( *pTable, pDDEType ));
235  pTableNode->SetNewTable( std::move(pDDETable) ); // set the DDE table
236 
237  if( bEndUndo )
239 
240  EndAllAction();
241 }
242 
245 {
246  const SwTableNode* pTableNd = IsCursorInTable();
247 
248  if( pTableNd )
249  {
250  StartAllAction();
251  if( DoesUndo() )
252  StartUndo();
254  SwTableFormulaUpdate aTableUpdate( &pTableNd->GetTable() );
255  GetDoc()->getIDocumentFieldsAccess().UpdateTableFields( &aTableUpdate );
256  if( DoesUndo() )
257  EndUndo();
258  EndAllAction();
259  }
260 }
261 
262 // get/set Change Mode
263 
265 {
266  TableChgMode eMode;
267  const SwTableNode* pTableNd = IsCursorInTable();
268  if( pTableNd )
269  eMode = pTableNd->GetTable().GetTableChgMode();
270  else
271  eMode = GetTableChgDefaultMode();
272  return eMode;
273 }
274 
276 {
277  const SwTableNode* pTableNd = IsCursorInTable();
278 
279  if( pTableNd )
280  {
281  const_cast<SwTable&>(pTableNd->GetTable()).SetTableChgMode( eMode );
282  if( !GetDoc()->getIDocumentState().IsModified() ) // Bug 57028
283  {
285  }
287  }
288 }
289 
291 {
292  SwSelBoxes aBoxes;
293  if( IsTableMode() )
294  ::GetTableSelCrs( *this, aBoxes );
295  else
296  {
297  do {
298  SwFrame *pFrame = GetCurrFrame();
299  do {
300  pFrame = pFrame->GetUpper();
301  } while ( pFrame && !pFrame->IsCellFrame() );
302  if ( pFrame )
303  {
304  SwTableBox *pBox = const_cast<SwTableBox*>(static_cast<SwCellFrame*>(pFrame)->GetTabBox());
305  aBoxes.insert( pBox );
306  }
307  } while( false );
308  }
309 
310  for (size_t n = 0; n < aBoxes.size(); ++n)
311  {
312  const SwTableBox* pSelBox = aBoxes[ n ];
313  const SwTableBoxFormat* pTableFormat = static_cast<SwTableBoxFormat*>(pSelBox->GetFrameFormat());
314  if( !n )
315  {
316  // Convert formulae into external presentation
317  const SwTable& rTable = pSelBox->GetSttNd()->FindTableNode()->GetTable();
318 
319  SwTableFormulaUpdate aTableUpdate( &rTable );
320  aTableUpdate.m_eFlags = TBL_BOXNAME;
321  GetDoc()->getIDocumentFieldsAccess().UpdateTableFields( &aTableUpdate );
322 
323  rSet.Put( pTableFormat->GetAttrSet() );
324  }
325  else
326  rSet.MergeValues( pTableFormat->GetAttrSet() );
327  }
328  return 0 != rSet.Count();
329 }
330 
332 {
333  SET_CURR_SHELL( this );
334  SwSelBoxes aBoxes;
335  if( IsTableMode() )
336  ::GetTableSelCrs( *this, aBoxes );
337  else
338  {
339  do {
340  SwFrame *pFrame = GetCurrFrame();
341  do {
342  pFrame = pFrame->GetUpper();
343  } while ( pFrame && !pFrame->IsCellFrame() );
344  if ( pFrame )
345  {
346  SwTableBox *pBox = const_cast<SwTableBox*>(static_cast<SwCellFrame*>(pFrame)->GetTabBox());
347  aBoxes.insert( pBox );
348  }
349  } while( false );
350  }
351 
352  // When setting a formula, do not check further!
353  if( SfxItemState::SET == rSet.GetItemState( RES_BOXATR_FORMULA ))
355 
356  StartAllAction();
358  for (size_t n = 0; n < aBoxes.size(); ++n)
359  {
360  GetDoc()->SetTableBoxFormulaAttrs( *aBoxes[ n ], rSet );
361  }
363  EndAllAction();
364 }
365 
367 {
368  if( IsTableMode() )
369  return false;
370 
371  const SwTableBox *pBox = nullptr;
372  {
373  SwFrame *pFrame = GetCurrFrame();
374  do {
375  pFrame = pFrame->GetUpper();
376  } while ( pFrame && !pFrame->IsCellFrame() );
377  if ( pFrame )
378  pBox = static_cast<SwCellFrame*>(pFrame)->GetTabBox();
379  }
380 
381  if( !pBox )
382  return false;
383 
384  sal_uInt32 nFormat = 0;
385  const SfxPoolItem* pItem;
386  if( SfxItemState::SET == pBox->GetFrameFormat()->GetAttrSet().GetItemState(
387  RES_BOXATR_FORMAT, true, &pItem ))
388  {
389  nFormat = static_cast<const SwTableBoxNumFormat*>(pItem)->GetValue();
390  return GetDoc()->GetNumberFormatter()->IsTextFormat( nFormat );
391  }
392 
393  sal_uLong nNd = pBox->IsValidNumTextNd();
394  if( ULONG_MAX == nNd )
395  return true;
396 
397  const OUString& rText = GetDoc()->GetNodes()[ nNd ]->GetTextNode()->GetText();
398  if( rText.isEmpty() )
399  return false;
400 
401  double fVal;
402  return !GetDoc()->IsNumberFormat( rText, nFormat, fVal );
403 }
404 
406 {
407  OUString sRet;
408  if( !IsTableMode() )
409  {
410  const SwTableBox *pBox = nullptr;
411  {
412  SwFrame *pFrame = GetCurrFrame();
413  do {
414  pFrame = pFrame->GetUpper();
415  } while ( pFrame && !pFrame->IsCellFrame() );
416  if ( pFrame )
417  pBox = static_cast<SwCellFrame*>(pFrame)->GetTabBox();
418  }
419 
420  sal_uLong nNd;
421  if( pBox && ULONG_MAX != ( nNd = pBox->IsValidNumTextNd() ) )
422  sRet = GetDoc()->GetNodes()[ nNd ]->GetTextNode()->GetText();
423  }
424  return sRet;
425 }
426 
428 {
429  SwPaM *pCursor = GetCursor();
430  if( pCursor->GetNode().FindTableNode() )
431  {
432  StartAllAction();
434 
435  GetDoc()->SplitTable( *pCursor->GetPoint(), eMode, true );
436 
438  ClearFEShellTabCols(*GetDoc(), nullptr);
439  EndAllAction();
440  }
441 }
442 
443 bool SwEditShell::MergeTable( bool bWithPrev )
444 {
445  bool bRet = false;
446  SwPaM *pCursor = GetCursor();
447  if( pCursor->GetNode().FindTableNode() )
448  {
449  StartAllAction();
451 
452  bRet = GetDoc()->MergeTable( *pCursor->GetPoint(), bWithPrev );
453 
455  ClearFEShellTabCols(*GetDoc(), nullptr);
456  EndAllAction();
457  }
458  return bRet;
459 }
460 
461 bool SwEditShell::CanMergeTable( bool bWithPrev, bool* pChkNxtPrv ) const
462 {
463  bool bRet = false;
464  const SwPaM *pCursor = GetCursor();
465  const SwTableNode* pTableNd = pCursor->GetNode().FindTableNode();
466  if( pTableNd && dynamic_cast< const SwDDETable* >(&pTableNd->GetTable()) == nullptr)
467  {
468  bool bNew = pTableNd->GetTable().IsNewModel();
469  const SwNodes& rNds = GetDoc()->GetNodes();
470  if( pChkNxtPrv )
471  {
472  const SwTableNode* pChkNd = rNds[ pTableNd->GetIndex() - 1 ]->FindTableNode();
473  if( pChkNd && dynamic_cast< const SwDDETable* >(&pChkNd->GetTable()) == nullptr &&
474  bNew == pChkNd->GetTable().IsNewModel() &&
475  // Consider table in table case
476  pChkNd->EndOfSectionIndex() == pTableNd->GetIndex() - 1 )
477  {
478  *pChkNxtPrv = true;
479  bRet = true; // using Prev is possible
480  }
481  else
482  {
483  pChkNd = rNds[ pTableNd->EndOfSectionIndex() + 1 ]->GetTableNode();
484  if( pChkNd && dynamic_cast< const SwDDETable* >(&pChkNd->GetTable()) == nullptr &&
485  bNew == pChkNd->GetTable().IsNewModel() )
486  {
487  *pChkNxtPrv = false;
488  bRet = true; // using Next is possible
489  }
490  }
491  }
492  else
493  {
494  const SwTableNode* pTmpTableNd = nullptr;
495 
496  if( bWithPrev )
497  {
498  pTmpTableNd = rNds[ pTableNd->GetIndex() - 1 ]->FindTableNode();
499  // Consider table in table case
500  if ( pTmpTableNd && pTmpTableNd->EndOfSectionIndex() != pTableNd->GetIndex() - 1 )
501  pTmpTableNd = nullptr;
502  }
503  else
504  pTmpTableNd = rNds[ pTableNd->EndOfSectionIndex() + 1 ]->GetTableNode();
505 
506  bRet = pTmpTableNd && dynamic_cast< const SwDDETable* >(&pTmpTableNd->GetTable()) == nullptr &&
507  bNew == pTmpTableNd->GetTable().IsNewModel();
508  }
509  }
510  return bRet;
511 }
512 
515 {
516  GetDoc()->AppendUndoForInsertFromDB( *GetCursor(), bIsTable );
517 }
518 
519 /* 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:366
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:903
Marks a position in the document model.
Definition: pam.hxx:35
const SwNodes & GetNodes() const
Definition: viewsh.cxx:2090
SwPaM * GetCursor(bool bMakeTableCursor=true) const
Return pointer to the current shell cursor.
Definition: crsrsh.cxx:185
void InsertDDETable(const SwInsertTableOptions &rInsTableOpts, SwDDEFieldType *pDDEType, sal_uInt16 nRows, sal_uInt16 nCols)
Definition: edtab.cxx:212
bool TableToText(const SwTableNode *pTableNd, sal_Unicode cCh)
Table to Text.
Definition: ndtbl.cxx:1451
void ClearTableBoxContent()
Definition: trvltbl.cxx:912
std::string GetValue
SvNumberFormatter * GetNumberFormatter(bool bCreate=true)
Definition: doc.hxx:1399
SwNodeIndex nNode
Definition: pam.hxx:37
bool IsTableMode() const
Definition: crsrsh.hxx:645
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:264
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:119
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
IDocumentFieldsAccess const & getIDocumentFieldsAccess() const
Definition: doc.cxx:389
sal_uInt16 sal_Unicode
const SwTable & InsertTable(const SwInsertTableOptions &rInsTableOpts, sal_uInt16 nRows, sal_uInt16 nCols, const SwTableAutoFormat *pTAFormat=nullptr)
Definition: edtab.cxx:92
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:331
SwTableSortBoxes & GetTabSortBoxes()
Definition: swtable.hxx:259
void SetTableChgMode(TableChgMode eMode)
Definition: edtab.cxx:275
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:483
TableChgMode GetTableChgDefaultMode()
Definition: edtwin3.cxx:110
const SwTableNode * IsCursorInTable() const
Definition: crsrsh.hxx:887
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:84
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:919
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:405
static void ConvertNestedTablesToText(const SwTableLines &rTableLines, sal_Unicode cCh)
Definition: edtab.cxx:58
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:244
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:514
bool MergeTable(bool bWithPrev)
Definition: edtab.cxx:443
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:461
SwContentFrame * GetCurrFrame(const bool bCalcFrame=true) const
Get current frame in which the cursor is positioned.
Definition: crsrsh.cxx:2350
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:183
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:136
SwNodes & GetNodes()
Definition: doc.hxx:403
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:290
void ClearMark()
Definition: crsrsh.cxx:927
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:457
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
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:427