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