LibreOffice Module sw (master)  1
editsh.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 <hintids.hxx>
21 #include <vcl/commandevent.hxx>
22 #include <unotools/charclass.hxx>
24 #include <comphelper/string.hxx>
26 #include <swwait.hxx>
27 #include <fmtsrnd.hxx>
28 #include <fmtinfmt.hxx>
29 #include <txtinet.hxx>
30 #include <frmfmt.hxx>
31 #include <charfmt.hxx>
32 #include <doc.hxx>
33 #include <IDocumentUndoRedo.hxx>
37 #include <IDocumentStatistics.hxx>
38 #include <IDocumentState.hxx>
39 #include <docary.hxx>
40 #include <editsh.hxx>
41 #include <frame.hxx>
42 #include <cntfrm.hxx>
43 #include <pam.hxx>
44 #include <pamtyp.hxx>
45 #include <ndtxt.hxx>
46 #include <grfatr.hxx>
47 #include <flyfrm.hxx>
48 #include <swtable.hxx>
49 #include <swundo.hxx>
50 #include <calc.hxx>
51 #include <edimp.hxx>
52 #include <ndgrf.hxx>
53 #include <ndole.hxx>
54 #include <txtfrm.hxx>
55 #include <rootfrm.hxx>
56 #include <extinput.hxx>
57 #include <scriptinfo.hxx>
58 #include <unocrsrhelper.hxx>
59 #include <section.hxx>
60 #include <unochart.hxx>
61 #include <numrule.hxx>
62 #include <SwNodeNum.hxx>
63 #include <unocrsr.hxx>
64 #include <calbck.hxx>
65 
66 using namespace com::sun::star;
67 
68 void SwEditShell::Insert( sal_Unicode c, bool bOnlyCurrCursor )
69 {
70  StartAllAction();
71  for(SwPaM& rPaM : GetCursor()->GetRingContainer())
72  {
73  const bool bSuccess = GetDoc()->getIDocumentContentOperations().InsertString(rPaM, OUString(c));
74  OSL_ENSURE( bSuccess, "Doc->Insert() failed." );
75 
76  SaveTableBoxContent( rPaM.GetPoint() );
77  if( bOnlyCurrCursor )
78  break;
79 
80  }
81 
82  EndAllAction();
83 }
84 
85 void SwEditShell::Insert2(const OUString &rStr, const bool bForceExpandHints )
86 {
87  StartAllAction();
88  {
89  const SwInsertFlags nInsertFlags =
90  bForceExpandHints
93 
94  for(SwPaM& rCurrentCursor : getShellCursor( true )->GetRingContainer())
95  {
96  //OPT: GetSystemCharSet
97  const bool bSuccess =
98  GetDoc()->getIDocumentContentOperations().InsertString(rCurrentCursor, rStr, nInsertFlags);
99  OSL_ENSURE( bSuccess, "Doc->Insert() failed." );
100 
101  if (bSuccess)
102  {
103  GetDoc()->UpdateRsid( rCurrentCursor, rStr.getLength() );
104 
105  // Set paragraph rsid if beginning of paragraph
106  SwTextNode *const pTextNode =
107  rCurrentCursor.GetPoint()->nNode.GetNode().GetTextNode();
108  if( pTextNode && pTextNode->Len() == 1)
109  GetDoc()->UpdateParRsid( pTextNode );
110  }
111 
112  SaveTableBoxContent( rCurrentCursor.GetPoint() );
113 
114  }
115  }
116 
117  // calculate cursor bidi level
118  SwCursor* pTmpCursor = GetCursor_();
119  const bool bDoNotSetBidiLevel = ! pTmpCursor ||
120  ( dynamic_cast<SwUnoCursor*>(pTmpCursor) != nullptr );
121 
122  if ( ! bDoNotSetBidiLevel )
123  {
124  SwNode& rNode = pTmpCursor->GetPoint()->nNode.GetNode();
125  if ( rNode.IsTextNode() )
126  {
127  SwIndex& rIdx = pTmpCursor->GetPoint()->nContent;
128  sal_Int32 nPrevPos = rIdx.GetIndex();
129  if ( nPrevPos )
130  --nPrevPos;
131 
132  SwTextFrame const* pFrame;
134  static_cast<SwTextNode&>(rNode), &pFrame, true);
135 
136  sal_uInt8 nLevel = 0;
137  if ( ! pSI )
138  {
139  // seems to be an empty paragraph.
140  Point aPt;
141  std::pair<Point, bool> const tmp(aPt, false);
142  pFrame = static_cast<SwTextFrame*>(
143  static_cast<SwTextNode&>(rNode).getLayoutFrame(
144  GetLayout(), pTmpCursor->GetPoint(), &tmp));
145 
146  SwScriptInfo aScriptInfo;
147  aScriptInfo.InitScriptInfo(static_cast<SwTextNode&>(rNode),
148  pFrame->GetMergedPara(), pFrame->IsRightToLeft());
149  TextFrameIndex const iPrevPos(pFrame->MapModelToView(
150  &static_cast<SwTextNode&>(rNode), nPrevPos));
151  nLevel = aScriptInfo.DirType( iPrevPos );
152  }
153  else
154  {
156  {
157  // mystery why this doesn't use the other overload?
158  pSI->InitScriptInfo(static_cast<SwTextNode&>(rNode), pFrame->GetMergedPara());
159  }
160  TextFrameIndex const iPrevPos(pFrame->MapModelToView(
161  &static_cast<SwTextNode&>(rNode), nPrevPos));
162  nLevel = pSI->DirType(iPrevPos);
163  }
164 
165  pTmpCursor->SetCursorBidiLevel( nLevel );
166  }
167  }
168 
169  SetInFrontOfLabel( false ); // #i27615#
170 
171  EndAllAction();
172 }
173 
174 void SwEditShell::Overwrite(const OUString &rStr)
175 {
176  StartAllAction();
177  for(SwPaM& rPaM : GetCursor()->GetRingContainer())
178  {
179  if( !GetDoc()->getIDocumentContentOperations().Overwrite(rPaM, rStr ) )
180  {
181  OSL_FAIL( "Doc->getIDocumentContentOperations().Overwrite(Str) failed." );
182  }
183  SaveTableBoxContent( rPaM.GetPoint() );
184  }
185  EndAllAction();
186 }
187 
188 void SwEditShell::SplitNode( bool bAutoFormat, bool bCheckTableStart )
189 {
190  StartAllAction();
191  GetDoc()->GetIDocumentUndoRedo().StartUndo(SwUndoId::EMPTY, nullptr);
192 
193  for(SwPaM& rPaM : GetCursor()->GetRingContainer())
194  {
195  // Here, a table cell becomes a normal text cell.
196  GetDoc()->ClearBoxNumAttrs( rPaM.GetPoint()->nNode );
197  GetDoc()->getIDocumentContentOperations().SplitNode( *rPaM.GetPoint(), bCheckTableStart );
198  }
199 
200  GetDoc()->GetIDocumentUndoRedo().EndUndo(SwUndoId::EMPTY, nullptr);
201 
202  if( bAutoFormat )
203  AutoFormatBySplitNode();
204 
205  ClearTableBoxContent();
206 
207  EndAllAction();
208 }
209 
211 {
212  bool bRet = false;
213  StartAllAction();
214  GetDoc()->GetIDocumentUndoRedo().StartUndo(SwUndoId::EMPTY, nullptr);
215 
216  for(SwPaM& rPaM : GetCursor()->GetRingContainer())
217  {
218  GetDoc()->ClearBoxNumAttrs( rPaM.GetPoint()->nNode );
219  bRet = GetDoc()->getIDocumentContentOperations().AppendTextNode( *rPaM.GetPoint()) || bRet;
220  }
221 
222  GetDoc()->GetIDocumentUndoRedo().EndUndo(SwUndoId::EMPTY, nullptr);
223 
224  ClearTableBoxContent();
225 
226  EndAllAction();
227  return bRet;
228 }
229 
230 // the returned SwGrfNode pointer is used in GetGraphic() and GetGraphicSize()
232 {
233  SwGrfNode *pGrfNode = nullptr;
234  SwPaM* pCursor = GetCursor();
235  if( !pCursor->HasMark() ||
236  pCursor->GetPoint()->nNode == pCursor->GetMark()->nNode )
237  pGrfNode = pCursor->GetPoint()->nNode.GetNode().GetGrfNode();
238 
239  return pGrfNode;
240 }
241 
242 // returns a Graphic pointer if CurrentCursor->GetPoint() points to a SwGrfNode and
243 // GetMark is not set or points to the same Graphic
244 const Graphic* SwEditShell::GetGraphic( bool bWait ) const
245 {
246  SwGrfNode* pGrfNode = GetGrfNode_();
247  const Graphic* pGrf( nullptr );
248  if ( pGrfNode )
249  {
250  pGrf = &(pGrfNode->GetGrf(bWait && GraphicType::Default == pGrfNode->GetGrf().GetType()));
251  }
252  return pGrf;
253 }
254 
256 {
257  SwGrfNode *pGrfNode = GetGrfNode_();
258  return pGrfNode &&
259  pGrfNode->IsLinkedFile() &&
260  GraphicType::Default == pGrfNode->GetGrfObj().GetType();
261 }
262 
264 {
265  SwGrfNode* pGrfNode = GetGrfNode_();
266  return pGrfNode ? &(pGrfNode->GetGrfObj()) : nullptr;
267 }
268 
270 {
271  SwGrfNode* pGrfNode = GetGrfNode_();
272  const SwFrame* pFrame = GetCurrFrame(false);
273  return pGrfNode ? &(pGrfNode->GetGraphicAttr( rGA, pFrame )) : nullptr;
274 }
275 
277 {
278  SwGrfNode *pGrfNode = GetGrfNode_();
279  return pGrfNode ? pGrfNode->GetGrfObj().GetType() : GraphicType::NONE;
280 }
281 
282 // returns the size of a graphic in <rSz> if CurrentCursor->GetPoint() points to a SwGrfNode and
283 // GetMark is not set or points to the same graphic
285 {
286  SwNoTextNode* pNoTextNd;
287  SwPaM* pCurrentCursor = GetCursor();
288  if( ( !pCurrentCursor->HasMark()
289  || pCurrentCursor->GetPoint()->nNode == pCurrentCursor->GetMark()->nNode )
290  && nullptr != ( pNoTextNd = pCurrentCursor->GetNode().GetNoTextNode() ) )
291  {
292  rSz = pNoTextNd->GetTwipSize();
293  return true;
294  }
295  return false;
296 
297 }
298 
300 void SwEditShell::ReRead( const OUString& rGrfName, const OUString& rFltName,
301  const Graphic* pGraphic )
302 {
303  StartAllAction();
304  mxDoc->getIDocumentContentOperations().ReRead( *GetCursor(), rGrfName, rFltName, pGraphic );
305  EndAllAction();
306 }
307 
310 void SwEditShell::GetGrfNms( OUString* pGrfName, OUString* pFltName,
311  const SwFlyFrameFormat* pFormat ) const
312 {
313  OSL_ENSURE( pGrfName || pFltName, "No parameters" );
314  if( pFormat )
315  SwDoc::GetGrfNms( *pFormat, pGrfName, pFltName );
316  else
317  {
318  SwGrfNode *pGrfNode = GetGrfNode_();
319  if( pGrfNode && pGrfNode->IsLinkedFile() )
320  pGrfNode->GetFileFilterNms( pGrfName, pFltName );
321  }
322 }
323 
325 {
326  SwNoTextNode *pNd = GetCursor()->GetNode().GetNoTextNode();
327  return pNd->HasContour();
328 }
329 
331 {
332  SwNoTextNode *pNd = GetCursor()->GetNode().GetNoTextNode();
333  StartAllAction();
334  pNd->SetContour( pPoly );
335  SwFlyFrame *pFly = static_cast<SwFlyFrame*>(pNd->getLayoutFrame(GetLayout())->GetUpper());
336  const SwFormatSurround &rSur = pFly->GetFormat()->GetSurround();
337  pFly->GetFormat()->NotifyClients( &rSur, &rSur );
338  GetDoc()->getIDocumentState().SetModified();
339  EndAllAction();
340 }
341 
343 {
344  SwNoTextNode *pNd = GetCursor()->GetNode().GetNoTextNode();
345  OSL_ENSURE( pNd, "is no NoTextNode!" );
346  if( pNd->HasAutomaticContour() )
347  {
348  StartAllAction();
349  pNd->SetContour( nullptr );
350  SwFlyFrame *pFly = static_cast<SwFlyFrame*>(pNd->getLayoutFrame(GetLayout())->GetUpper());
351  const SwFormatSurround &rSur = pFly->GetFormat()->GetSurround();
352  pFly->GetFormat()->NotifyClients( &rSur, &rSur );
353  GetDoc()->getIDocumentState().SetModified();
354  EndAllAction();
355  }
356 }
357 
365 {
366  OSL_ENSURE( CNT_OLE == GetCntType(), "GetOLEObj: no OLENode." );
367  OSL_ENSURE( !GetCursor()->HasMark() ||
368  (GetCursor()->HasMark() &&
369  GetCursor()->GetPoint()->nNode == GetCursor()->GetMark()->nNode),
370  "GetOLEObj: no OLENode." );
371 
372  SwOLENode *pOLENode = GetCursor()->GetNode().GetOLENode();
373  OSL_ENSURE( pOLENode, "GetOLEObj: no OLENode." );
374  SwOLEObj& rOObj = pOLENode->GetOLEObj();
375  return rOObj.GetObject();
376 }
377 
378 bool SwEditShell::HasOLEObj( const OUString &rName ) const
379 {
380  SwStartNode *pStNd;
381  SwNodeIndex aIdx( *GetNodes().GetEndOfAutotext().StartOfSectionNode(), 1 );
382  while ( nullptr != (pStNd = aIdx.GetNode().GetStartNode()) )
383  {
384  ++aIdx;
385  SwNode& rNd = aIdx.GetNode();
386  if( rNd.IsOLENode() &&
387  rName == static_cast<SwOLENode&>(rNd).GetChartTableName() &&
388  static_cast<SwOLENode&>(rNd).getLayoutFrame( GetLayout() ) )
389  return true;
390 
391  aIdx.Assign( *pStNd->EndOfSectionNode(), + 1 );
392  }
393  return false;
394 }
395 
396 void SwEditShell::SetChartName( const OUString &rName )
397 {
398  SwOLENode *pONd = GetCursor()->GetNode().GetOLENode();
399  OSL_ENSURE( pONd, "ChartNode not found" );
400  pONd->SetChartTableName( rName );
401 }
402 
403 void SwEditShell::UpdateCharts( const OUString &rName )
404 {
405  GetDoc()->UpdateCharts( rName );
406 }
407 
409 void SwEditShell::SetTableName( SwFrameFormat& rTableFormat, const OUString &rNewName )
410 {
411  GetDoc()->SetTableName( rTableFormat, rNewName );
412 }
413 
416 {
417  const SwPaM& rPaM = *GetCursor();
418  const SwTextNode* pNd = rPaM.GetNode().GetTextNode();
419  if (!pNd)
420  {
421  return OUString();
422  }
423  SwTextFrame const*const pFrame(static_cast<SwTextFrame*>(pNd->getLayoutFrame(GetLayout())));
424  if (pFrame)
425  {
426  return pFrame->GetCurWord(*rPaM.GetPoint());
427  }
428  return OUString();
429 }
430 
432 {
433  StartAllAction();
434  GetDoc()->getIDocumentStatistics().UpdateDocStat( false, true );
435  EndAllAction();
436 }
437 
439 {
440  StartAllAction();
441  const SwDocStat &rRet = GetDoc()->getIDocumentStatistics().GetUpdatedDocStat( false, true );
442  EndAllAction();
443  return rRet;
444 }
445 
447 const SwFormatRefMark* SwEditShell::GetRefMark( const OUString& rName ) const
448 {
449  return GetDoc()->GetRefMark( rName );
450 }
451 
453 sal_uInt16 SwEditShell::GetRefMarks( std::vector<OUString>* pStrings ) const
454 {
455  return GetDoc()->GetRefMarks( pStrings );
456 }
457 
458 OUString SwEditShell::GetDropText( const sal_Int32 nChars ) const
459 {
460  /*
461  * pb: made changes for #i74939#
462  *
463  * always return a string even though there is a selection
464  */
465 
466  OUString aText;
467  SwPaM* pCursor = GetCursor();
468  if ( IsMultiSelection() )
469  {
470  // if a multi selection exists, search for the first line
471  // -> it is the cursor with the lowest index
472  sal_uLong nIndex = pCursor->GetMark()->nNode.GetIndex();
473  bool bPrev = true;
474  SwPaM* pLast = pCursor;
475  SwPaM* pTemp = pCursor;
476  while ( bPrev )
477  {
478  SwPaM* pPrev2 = pTemp->GetPrev();
479  bPrev = ( pPrev2 && pPrev2 != pLast );
480  if ( bPrev )
481  {
482  pTemp = pPrev2;
483  sal_uLong nTemp = pPrev2->GetMark()->nNode.GetIndex();
484  if ( nTemp < nIndex )
485  {
486  nIndex = nTemp;
487  pCursor = pPrev2;
488  }
489  }
490  }
491  }
492 
493  SwTextNode const*const pTextNd = pCursor->GetNode(false).GetTextNode();
494  if( pTextNd )
495  {
496  SwTextFrame const*const pTextFrame(static_cast<SwTextFrame const*>(
497  pTextNd->getLayoutFrame(GetLayout())));
498  SAL_WARN_IF(!pTextFrame, "sw.core", "GetDropText cursor has no frame?");
499  if (pTextFrame)
500  {
501  TextFrameIndex const nDropLen(pTextFrame->GetDropLen(TextFrameIndex(nChars)));
502  aText = pTextFrame->GetText().copy(0, sal_Int32(nDropLen));
503  }
504  }
505 
506  return aText;
507 }
508 
509 void SwEditShell::ReplaceDropText( const OUString &rStr, SwPaM* pPaM )
510 {
511  SwPaM* pCursor = pPaM ? pPaM : GetCursor();
512  if( pCursor->GetPoint()->nNode == pCursor->GetMark()->nNode &&
513  pCursor->GetNode().GetTextNode()->IsTextNode() )
514  {
515  StartAllAction();
516 
517  const SwNodeIndex& rNd = pCursor->GetPoint()->nNode;
518  SwPaM aPam( rNd, rStr.getLength(), rNd, 0 );
519  SwTextFrame const*const pTextFrame(static_cast<SwTextFrame const*>(
520  rNd.GetNode().GetTextNode()->getLayoutFrame(GetLayout())));
521  if (pTextFrame)
522  {
523  *aPam.GetPoint() = pTextFrame->MapViewToModelPos(TextFrameIndex(0));
524  *aPam.GetMark() = pTextFrame->MapViewToModelPos(TextFrameIndex(
525  std::min(rStr.getLength(), pTextFrame->GetText().getLength())));
526  }
527  if( !GetDoc()->getIDocumentContentOperations().Overwrite( aPam, rStr ) )
528  {
529  OSL_FAIL( "Doc->getIDocumentContentOperations().Overwrite(Str) failed." );
530  }
531 
532  EndAllAction();
533  }
534 }
535 
537 {
538  OUStringBuffer aFormel; // the final formula
539  SwCalc aCalc( *GetDoc() );
540  const CharClass& rCC = GetAppCharClass();
541 
542  for(SwPaM& rCurrentPaM : GetCursor()->GetNext()->GetRingContainer())
543  {
544  SwTextNode* pTextNd = rCurrentPaM.GetNode().GetTextNode();
545  if(pTextNd)
546  {
547  const SwPosition *pStart = rCurrentPaM.Start(), *pEnd = rCurrentPaM.End();
548  const sal_Int32 nStt = pStart->nContent.GetIndex();
549  OUString aStr = pTextNd->GetExpandText(GetLayout(),
550  nStt, pEnd->nContent.GetIndex() - nStt);
551 
552  aStr = rCC.lowercase( aStr );
553 
554  bool bValidFields = false;
555  sal_Int32 nPos = 0;
556 
557  while( nPos < aStr.getLength() )
558  {
559  sal_Unicode ch = aStr[ nPos++ ];
560  if( rCC.isLetter( aStr, nPos-1 ) || ch == '_' )
561  {
562  sal_Int32 nTmpStt = nPos-1;
563  while( nPos < aStr.getLength() &&
564  0 != ( ch = aStr[ nPos++ ]) &&
565  (rCC.isLetterNumeric( aStr, nPos - 1 ) ||
566  ch == '_'|| ch == '.' ))
567  ;
568 
569  if( nPos < aStr.getLength() )
570  --nPos;
571 
572  OUString sVar = aStr.copy( nTmpStt, nPos - nTmpStt );
573  if( !::FindOperator( sVar ) &&
574  (aCalc.GetVarTable().Find(sVar) ||
575  aCalc.VarLook( sVar )) )
576  {
577  if( !bValidFields )
578  {
579  GetDoc()->getIDocumentFieldsAccess().FieldsToCalc( aCalc,
580  pStart->nNode.GetIndex(),
581  pStart->nContent.GetIndex() );
582  bValidFields = true;
583  }
584  aFormel.append("(").append(aCalc.GetStrResult( aCalc.VarLook( sVar )->nValue )).append(")");
585  }
586  else
587  aFormel.append(sVar);
588  }
589  else
590  aFormel.append(ch);
591  }
592  }
593  }
594 
595  return aCalc.GetStrResult( aCalc.Calculate(aFormel.makeStringAndClear()) );
596 }
597 
599 {
600  return mxDoc->getIDocumentLinksAdministration().GetLinkManager();
601 }
602 
604 {
605  // The node on which the cursor points should be sufficient as a unique identifier
606  return static_cast<void*>(&(GetCursor()->GetNode()));
607 }
608 
609 // #i73788#
611 {
612  // returns always a graphic if the cursor is in a Fly
613  SET_CURR_SHELL( const_cast<SwEditShell*>(this) );
614  Graphic aRet;
615  SwPaM* pCursor = GetCursor();
616  if ( !pCursor->HasMark() )
617  {
618  SwNode& rNd =pCursor->GetNode();
619  if( rNd.IsGrfNode() )
620  {
621  SwGrfNode & rGrfNode(static_cast<SwGrfNode&>(rNd));
622  aRet = rGrfNode.GetGrf(GraphicType::Default == rGrfNode.GetGrf().GetType());
623  }
624  else if ( rNd.IsOLENode() )
625  {
626  if (const Graphic* pGraphic = static_cast<SwOLENode&>(rNd).GetGraphic())
627  aRet = *pGraphic;
628  }
629  else
630  {
631  SwFlyFrame* pFlyFrame = rNd.GetContentNode()->getLayoutFrame( GetLayout() )->FindFlyFrame();
632  if(pFlyFrame)
633  aRet = pFlyFrame->GetFormat()->MakeGraphic();
634  }
635  }
636  return aRet;
637 }
638 
639 bool SwEditShell::InsertURL( const SwFormatINetFormat& rFormat, const OUString& rStr, bool bKeepSelection )
640 {
641  // URL and hint text (directly or via selection) necessary
642  if( rFormat.GetValue().isEmpty() || ( rStr.isEmpty() && !HasSelection() ) )
643  return false;
644  StartAllAction();
645  GetDoc()->GetIDocumentUndoRedo().StartUndo( SwUndoId::UI_INSERT_URLTXT, nullptr);
646  bool bInsText = true;
647 
648  if( !rStr.isEmpty() )
649  {
650  SwPaM* pCursor = GetCursor();
651  if( pCursor->HasMark() && *pCursor->GetPoint() != *pCursor->GetMark() )
652  {
653  // Selection existent, multi selection?
654  bool bDelText = true;
655  if( !pCursor->IsMultiSelection() )
656  {
657  // simple selection -> check the text
658  const OUString sText(comphelper::string::stripEnd(GetSelText(), ' '));
659  if( sText == rStr )
660  bDelText = bInsText = false;
661  }
662  else if( rFormat.GetValue() == rStr ) // Are Name and URL equal?
663  bDelText = bInsText = false;
664 
665  if( bDelText )
666  Delete();
667  }
668  else if( pCursor->IsMultiSelection() && rFormat.GetValue() == rStr )
669  bInsText = false;
670 
671  if( bInsText )
672  {
673  Insert2( rStr );
674  SetMark();
675  ExtendSelection( false, rStr.getLength() );
676  }
677  }
678  else
679  bInsText = false;
680 
681  SetAttrItem( rFormat );
682  if (bInsText && !IsCursorPtAtEnd())
683  SwapPam();
684  if(!bKeepSelection)
685  ClearMark();
686  if( bInsText )
687  DontExpandFormat();
688  GetDoc()->GetIDocumentUndoRedo().EndUndo( SwUndoId::UI_INSERT_URLTXT, nullptr );
689  EndAllAction();
690  return true;
691 }
692 
694 {
695  rArr.clear();
696 
697  const SwCharFormats* pFormats = GetDoc()->GetCharFormats();
698  for( auto n = pFormats->size(); 1 < n; )
699  {
700  SwIterator<SwTextINetFormat,SwCharFormat> aIter(*(*pFormats)[--n]);
701  for( SwTextINetFormat* pFnd = aIter.First(); pFnd; pFnd = aIter.Next() )
702  {
703  SwTextNode const*const pTextNd(pFnd->GetpTextNode());
704  SwTextFrame const*const pFrame(pTextNd
705  ? static_cast<SwTextFrame const*>(pTextNd->getLayoutFrame(GetLayout()))
706  : nullptr);
707  if (nullptr != pTextNd && nullptr != pFrame
708  && pTextNd->GetNodes().IsDocNodes()
709  // check it's not fully deleted
710  && pFrame->MapModelToView(pTextNd, pFnd->GetStart())
711  != pFrame->MapModelToView(pTextNd, *pFnd->GetEnd()))
712  {
713  SwTextINetFormat& rAttr = *pFnd;
714  OUString sText( pTextNd->GetExpandText(GetLayout(),
715  rAttr.GetStart(), *rAttr.GetEnd() - rAttr.GetStart()) );
716 
717  sText = sText.replaceAll(OUStringLiteral1(0x0a), "");
718  sText = comphelper::string::strip(sText, ' ');
719 
720  if( !sText.isEmpty() )
721  {
722  rArr.emplace_back(sText, rAttr);
723  }
724  }
725  }
726  }
727 }
728 
732 {
733  bool bRet = SelectTextAttr( RES_TXTATR_INETFMT, false );
734  if( bRet )
735  DeleteSel( *GetCursor() );
736 }
737 
740 {
741  bool bRet = false;
742  if( !IsTableMode() && GetDoc()->DontExpandFormat( *GetCursor()->GetPoint() ))
743  {
744  bRet = true;
745  CallChgLnk();
746  }
747  return bRet;
748 }
749 
751 {
752  return GetDoc()->GetNumberFormatter();
753 }
754 
756 {
757  StartAllAction();
758  bool bRet = GetDoc()->ConvertFieldsToText(*GetLayout());
759  EndAllAction();
760  return bRet;
761 }
762 
764 {
765  StartAllAction();
766  Push();
767  // iterate over all text contents - body, frames, header, footer, footnote text
768  SwPaM* pCursor = GetCursor();
769  for(int i = 0; i < 2; i++)
770  {
771  if(!i)
772  MakeFindRange(SwDocPositions::Start, SwDocPositions::End, pCursor); // body content
773  else
774  MakeFindRange(SwDocPositions::OtherStart, SwDocPositions::OtherEnd, pCursor); // extra content
775  SwPosition* pSttPos = pCursor->Start(), *pEndPos = pCursor->End();
776  sal_uLong nCurrNd = pSttPos->nNode.GetIndex();
777  sal_uLong nEndNd = pEndPos->nNode.GetIndex();
778  if( nCurrNd <= nEndNd )
779  {
780  SwContentFrame* pContentFrame;
781  bool bGoOn = true;
782  // iterate over all paragraphs
783  while( bGoOn )
784  {
785  SwNode* pNd = GetDoc()->GetNodes()[ nCurrNd ];
786  switch( pNd->GetNodeType() )
787  {
788  case SwNodeType::Text:
789  if( nullptr != ( pContentFrame = static_cast<SwTextNode*>(pNd)->getLayoutFrame( GetLayout() )) )
790  {
791  // skip hidden frames - ignore protection!
792  if( !static_cast<SwTextFrame*>(pContentFrame)->IsHiddenNow() )
793  {
794  // if the node is numbered and the starting value of the numbering equals the
795  // start value of the numbering rule then set this value as hard starting value
796 
797  // get the node num
798  // OD 2005-11-09
799  SwTextNode* pTextNd( pNd->GetTextNode() );
800  SwNumRule* pNumRule( pTextNd->GetNumRule() );
801 
802  // sw_redlinehide: not sure what this should do, only called from mail-merge
803  bool bIsNodeNum =
804  ( pNumRule && pTextNd->GetNum() &&
805  ( pTextNd->HasNumber() || pTextNd->HasBullet() ) &&
806  pTextNd->IsCountedInList() &&
807  !pTextNd->IsListRestart() );
808  if (bIsNodeNum)
809  {
810  int nListLevel = pTextNd->GetActualListLevel();
811 
812  if (nListLevel < 0)
813  nListLevel = 0;
814 
815  if (nListLevel >= MAXLEVEL)
816  nListLevel = MAXLEVEL - 1;
817 
818  bIsNodeNum = pTextNd->GetNum()->GetNumber() ==
819  pNumRule->Get( static_cast<sal_uInt16>(nListLevel) ).GetStart();
820  }
821  if (bIsNodeNum)
822  {
823  // now set a the start value as attribute
824  SwPosition aCurrentNode(*pNd);
825  GetDoc()->SetNumRuleStart( aCurrentNode );
826  }
827  }
828  }
829  break;
830  case SwNodeType::Section:
831  // skip hidden sections - ignore protection!
832  if(static_cast<SwSectionNode*>(pNd)->GetSection().IsHidden() )
833  nCurrNd = pNd->EndOfSectionIndex();
834  break;
835  default: break;
836  }
837 
838  bGoOn = nCurrNd < nEndNd;
839  ++nCurrNd;
840  }
841  }
842  }
843 
844  Pop(PopMode::DeleteCurrent);
845  EndAllAction();
846 }
847 
849 {
850  sal_uInt16 nRet = 0;
851  CalcLayout();
852  SwPaM* pPam = GetCursor();
853  SwNodeIndex& rPtIdx = pPam->GetPoint()->nNode;
854  SwNodeIndex aStart( rPtIdx );
855  SwContentNode* pCNd;
856  SwContentFrame *pContentFrame = nullptr;
857 
858  aStart = 0;
859 
860  while( nullptr != ( pCNd = GetDoc()->GetNodes().GoNextSection(
861  &aStart, true, false )) )
862  {
863  if( nullptr != ( pContentFrame = pCNd->getLayoutFrame( GetLayout() ) ) && pContentFrame->IsTextFrame() )
864  {
865  SwTextFrame *const pFrame(static_cast<SwTextFrame*>(pContentFrame));
866  nRet = nRet + pFrame->GetLineCount(TextFrameIndex(COMPLETE_STRING));
867  if (GetLayout()->IsHideRedlines())
868  {
869  if (auto const*const pMerged = pFrame->GetMergedPara())
870  {
871  aStart = *pMerged->pLastNode;
872  }
873  }
874  }
875  }
876  return nRet;
877 }
878 
879 long SwEditShell::CompareDoc( const SwDoc& rDoc )
880 {
881  StartAllAction();
882  long nRet = GetDoc()->CompareDoc( rDoc );
883  EndAllAction();
884  return nRet;
885 }
886 
887 long SwEditShell::MergeDoc( const SwDoc& rDoc )
888 {
889  StartAllAction();
890  long nRet = GetDoc()->MergeDoc( rDoc );
891  EndAllAction();
892  return nRet;
893 }
894 
896 {
897  return GetDoc()->GetFootnoteInfo();
898 }
899 
901 {
902  StartAllAction();
903  SET_CURR_SHELL( this );
904  GetDoc()->SetFootnoteInfo(rInfo);
905  CallChgLnk();
906  EndAllAction();
907 }
908 
910 {
911  return GetDoc()->GetEndNoteInfo();
912 }
913 
915 {
916  StartAllAction();
917  SET_CURR_SHELL( this );
918  GetDoc()->SetEndNoteInfo(rInfo);
919  EndAllAction();
920 }
921 
923 {
924  return GetDoc()->GetLineNumberInfo();
925 }
926 
928 {
929  StartAllAction();
930  SET_CURR_SHELL( this );
931  GetDoc()->SetLineNumberInfo(rInfo);
932  AddPaintRect( GetLayout()->getFrameArea() );
933  EndAllAction();
934 }
935 
936 sal_uInt16 SwEditShell::GetLinkUpdMode() const
937 {
938  return getIDocumentSettingAccess().getLinkUpdateMode( false );
939 }
940 
941 void SwEditShell::SetLinkUpdMode( sal_uInt16 nMode )
942 {
943  getIDocumentSettingAccess().setLinkUpdateMode( nMode );
944 }
945 
946 // Interface for TextInputData - (for text input of japanese/chinese characters)
948 {
949  SwExtTextInput* pRet = GetDoc()->CreateExtTextInput( *GetCursor() );
950  pRet->SetLanguage(eInputLanguage);
952 }
953 
954 OUString SwEditShell::DeleteExtTextInput( bool bInsText )
955 {
956  const SwPosition& rPos = *GetCursor()->GetPoint();
957  SwExtTextInput* pDel = GetDoc()->GetExtTextInput( rPos.nNode.GetNode(),
958  rPos.nContent.GetIndex() );
959  if( !pDel )
960  {
961  //JP 25.10.2001: under UNIX the cursor is moved before the Input-
962  // Engine event comes in. So take any - normally there
963  // exist only one at the time. -- Task 92016
964  pDel = GetDoc()->GetExtTextInput();
965  }
966  OUString sRet;
967  if( pDel )
968  {
969  OUString sTmp;
971  sRet = sTmp;
972  SET_CURR_SHELL( this );
973  StartAllAction();
974  pDel->SetInsText( bInsText );
975  SetOverwriteCursor( pDel->IsOverwriteCursor() );
976  const SwPosition aPos( *pDel->GetPoint() );
977  GetDoc()->DeleteExtTextInput( pDel );
978 
979  // In this case, the "replace" function did not set the cursor
980  // to the original position. Therefore we have to do this manually.
981  if ( ! bInsText && IsOverwriteCursor() )
982  *GetCursor()->GetPoint() = aPos;
983 
984  EndAllAction();
985  }
986  return sRet;
987 }
988 
990 {
991  const SwPosition& rPos = *GetCursor()->GetPoint();
992  SwExtTextInput* pInput = GetDoc()->GetExtTextInput( rPos.nNode.GetNode() );
993  if( !pInput )
994  return;
995 
996  StartAllAction();
997  SET_CURR_SHELL( this );
998 
999  if( !rData.IsOnlyCursorChanged() )
1000  pInput->SetInputData( rData );
1001  // position cursor
1002  const SwPosition& rStt = *pInput->Start();
1003  const sal_Int32 nNewCursorPos = rStt.nContent.GetIndex() + rData.GetCursorPos();
1004 
1005  // ugly but works
1006  ShowCursor();
1007  const sal_Int32 nDiff = nNewCursorPos - rPos.nContent.GetIndex();
1008  if( 0 > nDiff )
1009  Left( -nDiff, CRSR_SKIP_CHARS );
1010  else if( 0 < nDiff )
1011  Right( nDiff, CRSR_SKIP_CHARS );
1012 
1013  SetOverwriteCursor( rData.IsCursorOverwrite() );
1014 
1015  EndAllAction();
1016 
1017  if( !rData.IsCursorVisible() ) // must be called after the EndAction
1018  HideCursor();
1019 
1020 }
1021 
1023 {
1025  StartAllAction();
1026  SET_CURR_SHELL( this );
1027 
1028  SwPaM* pCursor = GetCursor();
1029  if( pCursor->GetNext() != pCursor )
1030  {
1031  GetDoc()->GetIDocumentUndoRedo().StartUndo(SwUndoId::EMPTY, nullptr);
1032  for(SwPaM& rPaM : GetCursor()->GetRingContainer())
1033  {
1034  if( rPaM.HasMark() )
1035  GetDoc()->getIDocumentContentOperations().TransliterateText( rPaM, aTrans );
1036  }
1037  GetDoc()->GetIDocumentUndoRedo().EndUndo(SwUndoId::EMPTY, nullptr);
1038  }
1039  else
1040  GetDoc()->getIDocumentContentOperations().TransliterateText( *pCursor, aTrans );
1041 
1042  EndAllAction();
1043 }
1044 
1046 {
1047  for(SwPaM& rPaM : GetCursor()->GetRingContainer())
1048  {
1049  if( rPaM.HasMark() )
1050  SwDoc::CountWords( rPaM, rStat );
1051 
1052  }
1053 }
1054 
1056 {
1060 }
1061 
1062 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
const SwEndNoteInfo & GetEndNoteInfo() const
Definition: editsh.cxx:909
void SetExtTextInputData(const CommandExtTextInputData &)
Definition: editsh.cxx:989
const SwEndNode * EndOfSectionNode() const
Definition: node.hxx:682
Starts a section of nodes in the document model.
Definition: node.hxx:303
sal_Int32 & GetStart()
start position
Definition: txatbase.hxx:77
void SetFootnoteInfo(const SwFootnoteInfo &rInfo)
Definition: editsh.cxx:900
Base class of the Writer layout elements.
Definition: frame.hxx:295
Represents the visualization of a paragraph.
Definition: txtfrm.hxx:149
Definition: calc.hxx:184
bool AppendTextNode()
Definition: editsh.cxx:210
SwNode & GetNode(bool bPoint=true) const
Definition: pam.hxx:223
TextFrameIndex GetInvalidityA() const
Definition: scriptinfo.hxx:113
sal_uInt16 GetLineCount()
Definition: editsh.cxx:848
OString stripEnd(const OString &rIn, sal_Char c)
virtual const SwFlyFrameFormat * GetFormat() const override
Definition: fly.cxx:2814
virtual void ApplyViewOptions(const SwViewOption &rOpt)
Definition: viewsh.cxx:2114
Marks a position in the document model.
Definition: pam.hxx:35
bool IsMultiSelection() const
Definition: pam.hxx:272
bool IsGrfNode() const
Definition: node.hxx:656
long CompareDoc(const SwDoc &rDoc)
Compare two documents.
Definition: editsh.cxx:879
SwOLENode * GetOLENode()
Inline methods from Node.hxx.
Definition: ndole.hxx:157
bool HasAutomaticContour() const
Definition: ndnotxt.hxx:78
const SwOLEObj & GetOLEObj() const
Definition: ndole.hxx:110
void ReRead(const OUString &rGrfName, const OUString &rFltName, const Graphic *pGraphic=nullptr)
Re-read if graphic is not ok. Current graphic is replaced by the new one.
Definition: editsh.cxx:300
sfx2::LinkManager & GetLinkManager()
Definition: editsh.cxx:598
SwNodeIndex nNode
Definition: pam.hxx:37
void * GetIMapInventor() const
Unique identification of object (for ImageMapDlg).
Definition: editsh.cxx:603
void SetLineNumberInfo(const SwLineNumberInfo &rInfo)
Definition: editsh.cxx:927
CalcOp * FindOperator(const OUString &rSrch)
Definition: calc.cxx:174
void SetEndNoteInfo(const SwEndNoteInfo &rInfo)
Definition: editsh.cxx:914
virtual Size GetTwipSize() const =0
virtual sal_Int32 Len() const override
Definition: ndtxt.cxx:284
sal_uIntPtr sal_uLong
const SwPosition * GetMark() const
Definition: pam.hxx:209
void CountWords(SwDocStat &rStat) const
Count words in current selection.
Definition: editsh.cxx:1045
sw::MergedPara * GetMergedPara()
Definition: txtfrm.hxx:438
SwContentFrame * getLayoutFrame(const SwRootFrame *, const SwPosition *pPos=nullptr, std::pair< Point, bool > const *pViewPosAndCalcFrame=nullptr) const
Definition: node.cxx:1150
GraphicType
Definition: doc.hxx:185
TElementType * Next()
Definition: calbck.hxx:376
SwSectionNode is derived from SwStartNode.
static SwScriptInfo * GetScriptInfo(const SwTextNode &rNode, SwTextFrame const **o_pFrame=nullptr, bool bAllowInvalid=false)
return a frame for the node, ScriptInfo is its member...
Definition: porlay.cxx:2123
bool IsLinkedFile() const
Definition: ndgrf.hxx:165
SwNode & GetNode() const
Definition: ndindex.hxx:118
bool GetGrfSize(Size &) const
Definition: editsh.cxx:284
long MergeDoc(const SwDoc &rDoc)
Merge two documents.
Definition: editsh.cxx:887
const OUString & GetText() const
Returns the text portion we want to edit (for inline see underneath)
Definition: txtfrm.cxx:1278
OUString DeleteExtTextInput(bool bInsText=true)
Definition: editsh.cxx:954
sal_uInt8 DirType(const TextFrameIndex nPos) const
Definition: porlay.cxx:1466
void GetINetAttrs(SwGetINetAttrs &rArr)
Definition: editsh.cxx:693
const tools::PolyPolygon * HasContour() const
Definition: ndnotxt.cxx:107
sal_uInt16 GetRefMarks(std::vector< OUString > *=nullptr) const
get the names of all references in a Doc
Definition: editsh.cxx:453
bool IsOnlyCursorChanged() const
OUString GetCurWord(SwPosition const &) const
Definition: txtedt.cxx:665
bool isLetterNumeric(const OUString &rStr, sal_Int32 nPos) const
sal_uInt16 sal_Unicode
const OUString & GetValue() const
Definition: fmtinfmt.hxx:75
virtual void ApplyViewOptions(const SwViewOption &rOpt) override
Apply ViewOptions with Start-/EndAction.
Definition: editsh.cxx:1055
bool HasOLEObj(const OUString &rName) const
Is there an OLEObject with this name (SwFormat)?
Definition: editsh.cxx:378
bool ConvertFieldsToText()
Replace fields by text - mailmerge support.
Definition: editsh.cxx:755
SwNodeType GetNodeType() const
Definition: node.hxx:144
SwIndex nContent
Definition: pam.hxx:38
virtual sal_Int32 * GetEnd() override
end position
Definition: txatbase.cxx:73
GraphicAttr & GetGraphicAttr(GraphicAttr &, const SwFrame *pFrame) const
Returns the with our graphic attributes filled Graphic-Attr-Structure.
Definition: ndgrf.cxx:727
const tools::PolyPolygon * GetGraphicPolygon() const
Definition: editsh.cxx:324
svt::EmbeddedObjectRef & GetObject()
Definition: ndole.cxx:952
std::vector< SwGetINetAttr > SwGetINetAttrs
Definition: editsh.hxx:128
sal_uLong GetIndex() const
Definition: ndindex.hxx:151
bool IsTextFrame() const
Definition: frame.hxx:1210
const sal_uInt8 MAXLEVEL
Definition: swtypes.hxx:95
SAL_DLLPRIVATE SwGrfNode * GetGrfNode_() const
Returns pointer to a SwGrfNode that will be used by GetGraphic() and GetGraphicSize().
Definition: editsh.cxx:231
void InitScriptInfo(const SwTextNode &rNode, sw::MergedPara const *pMerged, bool bRTL)
Definition: porlay.cxx:742
const SwFormatSurround & GetSurround(bool=true) const
Definition: fmtsrnd.hxx:66
void GetTextFromPam(SwPaM &rPam, OUString &rBuffer, SwRootFrame const *pLayout=nullptr)
Definition: unoobj.cxx:165
void GetGrfNms(OUString *pGrfName, OUString *pFltName, const SwFlyFrameFormat *=nullptr) const
Returns the name and the filter name of a graphic if the pointer is on a graphic. ...
Definition: editsh.cxx:310
SwFlyFrame * FindFlyFrame()
Definition: frame.hxx:1087
bool GetFileFilterNms(OUString *pFileNm, OUString *pFilterNm) const
Definition: ndgrf.cxx:488
bool IsCursorOverwrite() const
OString strip(const OString &rIn, sal_Char c)
void SetLinkUpdMode(sal_uInt16 nMode)
Definition: editsh.cxx:941
void UpdateCharts(const OUString &rName)
Update content of all charts for table with given name.
Definition: editsh.cxx:403
SwPaM * GetNext()
Definition: pam.hxx:264
TransliterationFlags
void SetOverwriteCursor(bool bFlag)
Definition: extinput.cxx:212
bool IsOLENode() const
Definition: node.hxx:652
void SetChartName(const OUString &rName)
Definition: editsh.cxx:396
SwSbxValue nValue
Definition: calc.hxx:134
PaM is Point and Mark: a selection of the document model.
Definition: pam.hxx:136
const SwDocStat & GetUpdatedDocStat()
Definition: editsh.cxx:438
const SwLineNumberInfo & GetLineNumberInfo() const
Definition: editsh.cxx:922
Right
Style of a layout element.
Definition: frmfmt.hxx:57
const SwFormatRefMark * GetRefMark(const OUString &rName) const
get the reference of a given name in the Doc
Definition: editsh.cxx:447
void SetLanguage(LanguageType eSet)
Definition: extinput.hxx:43
GraphicType GetGraphicType() const
Definition: editsh.cxx:276
void Insert2(const OUString &, const bool bForceExpandHints=false)
Definition: editsh.cxx:85
const SwPosition * GetPoint() const
Definition: pam.hxx:207
OUString GetCurWord()
request current word
Definition: editsh.cxx:415
GraphicType GetType() const
void EndAction(const bool bIdleEnd=false, const bool DoSetPosX=false)
Definition: crsrsh.cxx:229
void DelINetAttrWithText()
If cursor is in a INetAttribute it will be deleted completely including the descriptive text (needed ...
Definition: editsh.cxx:731
bool InsertURL(const SwFormatINetFormat &rFormat, const OUString &rStr, bool bKeepSelection=false)
Definition: editsh.cxx:639
TElementType * First()
Definition: calbck.hxx:345
int i
svt::EmbeddedObjectRef & GetOLEObject() const
Get OLE object at pointer.
Definition: editsh.cxx:364
SwContentNode * GetContentNode()
Definition: node.hxx:615
bool HasMark() const
A PaM marks a selection if Point and Mark are distinct positions.
Definition: pam.hxx:205
SwNoTextNode * GetNoTextNode()
Definition: ndnotxt.hxx:96
void SetInsText(bool bFlag)
Definition: extinput.hxx:40
const GraphicObject * GetGraphicObj() const
Definition: editsh.cxx:263
SwLayoutFrame * GetUpper()
Definition: frame.hxx:656
bool DontExpandFormat()
If Cursor is at the end of a character style in which the DontExpand-flag is not yet set...
Definition: editsh.cxx:739
Marks a character position inside a document model node.
Definition: index.hxx:37
size_t size() const
Definition: docary.hxx:90
#define SET_CURR_SHELL(shell)
Definition: swtypes.hxx:101
Marks a node in the document model.
Definition: ndindex.hxx:31
SwNodes & GetNodes()
Node is in which nodes-array/doc?
Definition: node.hxx:693
T * Find(const OUString &rStr, sal_uInt16 *pPos=nullptr) const
Definition: calc.hxx:152
#define CNT_OLE
Definition: editsh.hxx:133
bool IsOverwriteCursor() const
Definition: crsrsh.hxx:461
ring_container GetRingContainer()
Definition: ring.hxx:240
void ClearAutomaticContour()
If there's an automatic, not manipulated polygon at the selected notxtnode, it has to be deleted...
Definition: editsh.cxx:342
Graphic GetIMapGraphic() const
Remove default parameter, because method always called this default value.
Definition: editsh.cxx:610
OUString lowercase(const OUString &rStr, sal_Int32 nPos, sal_Int32 nCount) const
SwStartNode * GetStartNode()
Definition: node.hxx:591
#define RES_TXTATR_INETFMT
Definition: hintids.hxx:141
const Graphic * GetGraphic(bool bWait=true) const
Definition: editsh.cxx:244
const GraphicObject & GetGrfObj(bool bWait=false) const
Definition: ndgrf.cxx:374
static void GetGrfNms(const SwFlyFrameFormat &rFormat, OUString *pGrfName, OUString *pFltName)
Definition: docfly.cxx:709
GraphicType GetType() const
const SwPosition * Start() const
Definition: pam.hxx:212
< purpose of derivation from SwClient: character style for displaying the numbers.
Definition: lineinfo.hxx:37
SwHashTable< SwCalcExp > & GetVarTable()
Definition: calc.hxx:231
void NotifyClients(const SfxPoolItem *pOldValue, const SfxPoolItem *pNewValue)
Definition: calbck.cxx:167
void StartAction()
Definition: crsrsh.cxx:212
SwPaM * GetPrev()
Definition: pam.hxx:268
void SetChartTableName(const OUString &rNm)
Definition: ndole.hxx:149
SwSbxValue Calculate(const OUString &rStr)
Definition: calc.cxx:349
sal_uLong EndOfSectionIndex() const
Definition: node.hxx:677
TextFrameIndex GetDropLen(TextFrameIndex nWishLen) const
nWishLen = 0 indicates that we want a whole word
Definition: txtdrop.cxx:171
const SwFootnoteInfo & GetFootnoteInfo() const
Footnote attributes global to document.
Definition: editsh.cxx:895
SwTextNode is a paragraph in the document model.
Definition: ndtxt.hxx:79
sal_uInt16 GetLineCount(TextFrameIndex nPos)
Determines the line count.
Definition: txtfrm.cxx:3728
void SetGraphicPolygon(const tools::PolyPolygon *pPoly)
Definition: editsh.cxx:330
bool IsCursorVisible() const
OUString GetExpandText(SwRootFrame const *pLayout, const sal_Int32 nIdx=0, const sal_Int32 nLen=-1, const bool bWithNum=false, const bool bAddSpaceAfterListLabelStr=false, const bool bWithSpacesForLevel=false, const ExpandMode eAdditionalMode=ExpandMode::ExpandFootnote) const
add 4th optional parameter indicating, when that a spa...
Definition: ndtxt.cxx:3384
general base class for all free-flowing frames
Definition: flyfrm.hxx:60
#define SAL_WARN_IF(condition, area, stream)
OUString GetDropText(const sal_Int32 nChars) const
Definition: editsh.cxx:458
unsigned char sal_uInt8
TextFrameIndex MapModelToView(SwTextNode const *pNode, sal_Int32 nIndex) const
Definition: txtfrm.cxx:1239
sal_Int32 GetIndex() const
Definition: index.hxx:95
sal_Int32 GetCursorPos() const
const SwPosition * End() const
Definition: pam.hxx:217
void SetCursorBidiLevel(sal_uInt8 nNewLevel)
Definition: swcrsr.hxx:210
bool IsRightToLeft() const
Definition: frame.hxx:963
Reference< XComponentContext > getProcessComponentContext()
OUString GetStrResult(const SwSbxValue &rValue)
Definition: calc.cxx:372
bool IsOverwriteCursor() const
Definition: extinput.hxx:41
SwCalcExp * VarLook(const OUString &rStr, bool bIns=false)
Definition: calc.cxx:410
void TransliterateText(TransliterationFlags nType)
Change text to Upper/Lower/Hiragana/Katakana/...
Definition: editsh.cxx:1022
void Overwrite(const OUString &)
Definition: editsh.cxx:174
void UpdateDocStat()
Document - Statistics.
Definition: editsh.cxx:431
sal_uInt16 GetLinkUpdMode() const
Embeds all local links (ranges/graphics).
Definition: editsh.cxx:936
const sal_uInt16 CRSR_SKIP_CHARS
Definition: swcrsr.hxx:63
void SetTableName(SwFrameFormat &rTableFormat, const OUString &rNewName)
change table name
Definition: editsh.cxx:409
void Insert(sal_Unicode, bool bOnlyCurrCursor=false)
Edit (all selected ranges).
Definition: editsh.cxx:68
void CreateExtTextInput(LanguageType eInputLanguage)
Interface for TextInputData - (for input of Japanese/Chinese chars.)
Definition: editsh.cxx:947
Left
void SplitNode(bool bAutoFormat=false, bool bCheckTableStart=true)
Definition: editsh.cxx:188
const GraphicAttr * GetGraphicAttr(GraphicAttr &rGA) const
Definition: editsh.cxx:269
SwGrfNode * GetGrfNode()
Definition: ndgrf.hxx:155
virtual Graphic MakeGraphic(ImageMap *pMap=nullptr) override
Definition: paintfrm.cxx:7322
void SetNumberingRestart()
Set all numbering start points to a fixed value - mailmerge support.
Definition: editsh.cxx:763
bool IsLinkedGrfSwapOut() const
Definition: editsh.cxx:255
sal_Int32 nPos
o3tl::strong_int< sal_Int32, struct Tag_TextFrameIndex > TextFrameIndex
Denotes a character index in a text frame at a layout level, after extent mapping from a text node at...
void SetInputData(const CommandExtTextInputData &rData)
Definition: extinput.cxx:138
CharClass & GetAppCharClass()
Definition: init.cxx:740
bool IsTextNode() const
Definition: node.hxx:636
void ReplaceDropText(const OUString &rStr, SwPaM *pPaM=nullptr)
Definition: editsh.cxx:509
SvNumberFormatter * GetNumberFormatter()
Query NumberFormatter from document.
Definition: editsh.cxx:750
OUString Calculate()
Calculates selection.
Definition: editsh.cxx:536
aStr
bool isLetter(const OUString &rStr, sal_Int32 nPos) const
const sal_Int32 COMPLETE_STRING
Definition: swtypes.hxx:61
const Graphic & GetGrf(bool bWait=false) const
Definition: ndgrf.cxx:368
static void CountWords(const SwPaM &rPaM, SwDocStat &rStat)
Definition: docedt.cxx:820
void SetContour(const tools::PolyPolygon *pPoly, bool bAutomatic=false)
Definition: ndnotxt.cxx:87
SwTextNode * GetTextNode()
Inline methods from Node.hxx.
Definition: ndtxt.hxx:842
SwNodeIndex & Assign(SwNodes const &rNds, sal_uLong)
Definition: ndindex.hxx:271
Base class of the Writer document model elements.
Definition: node.hxx:79