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