LibreOffice Module sw (master)  1
crstrvl.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 <memory>
21 #include <utility>
22 #include <hintids.hxx>
23 #include <comphelper/string.hxx>
24 #include <svl/itemiter.hxx>
25 #include <editeng/lrspitem.hxx>
26 #include <editeng/adjustitem.hxx>
28 #include <svx/svdobj.hxx>
29 #include <crsrsh.hxx>
30 #include <doc.hxx>
31 #include <IDocumentUndoRedo.hxx>
35 #include <pagefrm.hxx>
36 #include <cntfrm.hxx>
37 #include <rootfrm.hxx>
38 #include <pam.hxx>
39 #include <ndtxt.hxx>
40 #include <fldbas.hxx>
41 #include <swtable.hxx>
42 #include <docary.hxx>
43 #include <txtfld.hxx>
44 #include <fmtfld.hxx>
45 #include <txtftn.hxx>
46 #include <txtinet.hxx>
47 #include <fmtinfmt.hxx>
48 #include <txttxmrk.hxx>
49 #include <frmfmt.hxx>
50 #include <flyfrm.hxx>
51 #include <viscrs.hxx>
52 #include "callnk.hxx"
53 #include <doctxm.hxx>
54 #include <docfld.hxx>
55 #include <expfld.hxx>
56 #include <reffld.hxx>
57 #include <flddat.hxx>
58 #include <cellatr.hxx>
59 #include <swundo.hxx>
60 #include <redline.hxx>
61 #include <fmtcntnt.hxx>
62 #include <fmthdft.hxx>
63 #include <pagedesc.hxx>
64 #include <fesh.hxx>
65 #include <charfmt.hxx>
66 #include <fmturl.hxx>
67 #include <txtfrm.hxx>
68 #include <wrong.hxx>
69 #include <calbck.hxx>
70 #include <unotools/intlwrapper.hxx>
71 #include <docufld.hxx>
72 #include <svx/srchdlg.hxx>
73 
74 using namespace ::com::sun::star;
75 
77 {
78  SwCallLink aLk( *this ); // watch Cursor-Moves
79  SwCursorSaveState aSaveState( *m_pCurrentCursor );
80  if( ActionPend() )
81  return;
82  SET_CURR_SHELL( this );
83  // try to set cursor onto this position, at half of the char-
84  // SRectangle's height
86  std::pair<Point, bool> const tmp(aPt, true);
88  GetLayout(), m_pCurrentCursor->GetPoint(), &tmp);
90  pFrame->Calc(GetOut());
91  if( pFrame->IsVertical() )
92  {
93  aPt.setX(m_aCharRect.Center().getX());
94  aPt.setY(pFrame->getFrameArea().Top() + GetUpDownX());
95  }
96  else
97  {
98  aPt.setY(m_aCharRect.Center().getY());
99  aPt.setX(pFrame->getFrameArea().Left() + GetUpDownX());
100  }
101  pFrame->GetCursorOfst( m_pCurrentCursor->GetPoint(), aPt );
104  {
108  }
109 }
110 
113 {
115  return;
116  MoveCursorToNum();
117 }
118 
120 {
122  return;
123  MoveCursorToNum();
124 }
125 
128 {
129  const SwFrame* pFrame = GetCurrFrame()->FindPageFrame();
130  while( pFrame && !pFrame->IsHeaderFrame() )
131  pFrame = pFrame->GetLower();
132  // found header, search 1. content frame
133  while( pFrame && !pFrame->IsContentFrame() )
134  pFrame = pFrame->GetLower();
135 
136  if( pFrame )
137  {
138  SET_CURR_SHELL( this );
139  // get header frame
140  SwCallLink aLk( *this ); // watch Cursor-Moves
141  SwCursor *pTmpCursor = getShellCursor( true );
142  SwCursorSaveState aSaveState( *pTmpCursor );
143  pFrame->Calc(GetOut());
144  Point aPt( pFrame->getFrameArea().Pos() + pFrame->getFramePrintArea().Pos() );
145  pFrame->GetCursorOfst( pTmpCursor->GetPoint(), aPt );
146  if( !pTmpCursor->IsSelOvr() )
147  UpdateCursor();
148  else
149  pFrame = nullptr;
150  }
151  return nullptr != pFrame;
152 }
153 
156 {
157  const SwPageFrame* pFrame = GetCurrFrame()->FindPageFrame();
158  if( pFrame )
159  {
160  const SwFrame* pLower = pFrame->GetLastLower();
161 
162  while( pLower && !pLower->IsFooterFrame() )
163  pLower = pLower->GetLower();
164  // found footer, search 1. content frame
165  while( pLower && !pLower->IsContentFrame() )
166  pLower = pLower->GetLower();
167 
168  if( pLower )
169  {
170  SwCursor *pTmpCursor = getShellCursor( true );
171  SET_CURR_SHELL( this );
172  // get position in footer
173  SwCallLink aLk( *this ); // watch Cursor-Moves
174  SwCursorSaveState aSaveState( *pTmpCursor );
175  pLower->Calc(GetOut());
176  Point aPt( pLower->getFrameArea().Pos() + pLower->getFramePrintArea().Pos() );
177  pLower->GetCursorOfst( pTmpCursor->GetPoint(), aPt );
178  if( !pTmpCursor->IsSelOvr() )
179  UpdateCursor();
180  else
181  pFrame = nullptr;
182  }
183  else
184  pFrame = nullptr;
185  }
186  else
187  pFrame = nullptr;
188  return nullptr != pFrame;
189 }
190 
191 bool SwCursorShell::SetCursorInHdFt( size_t nDescNo, bool bInHeader )
192 {
193  bool bRet = false;
194  SwDoc *pMyDoc = GetDoc();
195  const SwPageDesc* pDesc = nullptr;
196 
197  SET_CURR_SHELL( this );
198 
199  if( SIZE_MAX == nDescNo )
200  {
201  // take the current one
202  const SwContentFrame *pCurrFrame = GetCurrFrame();
203  const SwPageFrame* pPage = (pCurrFrame == nullptr) ? nullptr : pCurrFrame->FindPageFrame();
204  if( pPage && pMyDoc->ContainsPageDesc(
205  pPage->GetPageDesc(), &nDescNo) )
206  pDesc = pPage->GetPageDesc();
207  }
208  else
209  if (nDescNo < pMyDoc->GetPageDescCnt())
210  pDesc = &pMyDoc->GetPageDesc( nDescNo );
211 
212  if( pDesc )
213  {
214  // check if the attribute exists
215  const SwFormatContent* pCnt = nullptr;
216  if( bInHeader )
217  {
218  // mirrored pages? ignore for now
219  const SwFormatHeader& rHd = pDesc->GetMaster().GetHeader();
220  if( rHd.GetHeaderFormat() )
221  pCnt = &rHd.GetHeaderFormat()->GetContent();
222  }
223  else
224  {
225  const SwFormatFooter& rFt = pDesc->GetMaster().GetFooter();
226  if( rFt.GetFooterFormat() )
227  pCnt = &rFt.GetFooterFormat()->GetContent();
228  }
229 
230  if( pCnt && pCnt->GetContentIdx() )
231  {
232  SwNodeIndex aIdx( *pCnt->GetContentIdx(), 1 );
233  SwContentNode* pCNd = aIdx.GetNode().GetContentNode();
234  if( !pCNd )
235  pCNd = pMyDoc->GetNodes().GoNext( &aIdx );
236 
237  Point aPt( m_pCurrentCursor->GetPtPos() );
238 
239  std::pair<Point, bool> const tmp(aPt, false);
240  if (pCNd && nullptr != pCNd->getLayoutFrame(GetLayout(), nullptr, &tmp))
241  {
242  // then we can set the cursor in here
243  SwCallLink aLk( *this ); // watch Cursor-Moves
244  SwCursorSaveState aSaveState( *m_pCurrentCursor );
245 
246  ClearMark();
247 
249  rPos.nNode = *pCNd;
250  rPos.nContent.Assign( pCNd, 0 );
251 
252  bRet = !m_pCurrentCursor->IsSelOvr();
253  if( bRet )
256  }
257  }
258  }
259  return bRet;
260 }
261 
263 bool SwCursorShell::GotoNextTOXBase( const OUString* pName )
264 {
265  bool bRet = false;
266 
267  const SwSectionFormats& rFormats = GetDoc()->GetSections();
268  SwContentNode* pFnd = nullptr;
269  for( SwSectionFormats::size_type n = rFormats.size(); n; )
270  {
271  const SwSection* pSect = rFormats[ --n ]->GetSection();
272  if (TOX_CONTENT_SECTION == pSect->GetType())
273  {
274  SwSectionNode const*const pSectNd(
275  pSect->GetFormat()->GetSectionNode());
276  if ( pSectNd
277  && m_pCurrentCursor->GetPoint()->nNode < pSectNd->GetIndex()
278  && (!pFnd || pFnd->GetIndex() > pSectNd->GetIndex())
279  && (!pName || *pName ==
280  static_cast<SwTOXBaseSection const*>(pSect)->GetTOXName()))
281  {
282  SwNodeIndex aIdx(*pSectNd, 1);
283  SwContentNode* pCNd = aIdx.GetNode().GetContentNode();
284  if (!pCNd)
285  pCNd = GetDoc()->GetNodes().GoNext( &aIdx );
286  if (pCNd &&
287  pCNd->EndOfSectionIndex() <= pSectNd->EndOfSectionIndex())
288  {
289  SwContentFrame const*const pCFrame(
290  pCNd->getLayoutFrame(GetLayout()));
291  if (pCFrame &&
292  (IsReadOnlyAvailable() || !pCFrame->IsProtected()))
293  {
294  pFnd = pCNd;
295  }
296  }
297  }
298  }
299  }
300  if( pFnd )
301  {
302  SwCallLink aLk( *this ); // watch Cursor-Moves
303  SwCursorSaveState aSaveState( *m_pCurrentCursor );
304  m_pCurrentCursor->GetPoint()->nNode = *pFnd;
305  m_pCurrentCursor->GetPoint()->nContent.Assign( pFnd, 0 );
306  bRet = !m_pCurrentCursor->IsSelOvr();
307  if( bRet )
309  }
310  return bRet;
311 }
312 
314 bool SwCursorShell::GotoPrevTOXBase( const OUString* pName )
315 {
316  bool bRet = false;
317 
318  const SwSectionFormats& rFormats = GetDoc()->GetSections();
319  SwContentNode* pFnd = nullptr;
320  for( SwSectionFormats::size_type n = rFormats.size(); n; )
321  {
322  const SwSection* pSect = rFormats[ --n ]->GetSection();
323  if (TOX_CONTENT_SECTION == pSect->GetType())
324  {
325  SwSectionNode const*const pSectNd(
326  pSect->GetFormat()->GetSectionNode());
327  if ( pSectNd
328  && m_pCurrentCursor->GetPoint()->nNode > pSectNd->EndOfSectionIndex()
329  && (!pFnd || pFnd->GetIndex() < pSectNd->GetIndex())
330  && (!pName || *pName ==
331  static_cast<SwTOXBaseSection const*>(pSect)->GetTOXName()))
332  {
333  SwNodeIndex aIdx(*pSectNd, 1);
334  SwContentNode* pCNd = aIdx.GetNode().GetContentNode();
335  if (!pCNd)
336  pCNd = GetDoc()->GetNodes().GoNext( &aIdx );
337  if (pCNd &&
338  pCNd->EndOfSectionIndex() <= pSectNd->EndOfSectionIndex())
339  {
340  SwContentFrame const*const pCFrame(
341  pCNd->getLayoutFrame(GetLayout()));
342  if (pCFrame &&
343  (IsReadOnlyAvailable() || !pCFrame->IsProtected()))
344  {
345  pFnd = pCNd;
346  }
347  }
348  }
349  }
350  }
351 
352  if( pFnd )
353  {
354  SwCallLink aLk( *this ); // watch Cursor-Moves
355  SwCursorSaveState aSaveState( *m_pCurrentCursor );
356  m_pCurrentCursor->GetPoint()->nNode = *pFnd;
357  m_pCurrentCursor->GetPoint()->nContent.Assign( pFnd, 0 );
358  bRet = !m_pCurrentCursor->IsSelOvr();
359  if( bRet )
361  }
362  return bRet;
363 }
364 
367 {
368  bool bRet = false;
369 
370  SwTOXMarks aMarks;
371  sal_uInt16 nCnt = SwDoc::GetCurTOXMark( *m_pCurrentCursor->GetPoint(), aMarks );
372  if( nCnt )
373  {
374  // Take the 1. and get the index type. Search in its dependency list
375  // for the actual index
376  const SwTOXType* pType = aMarks[0]->GetTOXType();
377  SwIterator<SwTOXBase,SwTOXType> aIter( *pType );
378  const SwSectionFormat* pSectFormat;
379 
380  for( SwTOXBase* pTOX = aIter.First(); pTOX; pTOX = aIter.Next() )
381  {
382  const SwSectionNode* pSectNd;
383  if( dynamic_cast<const SwTOXBaseSection*>( pTOX) != nullptr &&
384  nullptr != ( pSectFormat = static_cast<SwTOXBaseSection*>(pTOX)->GetFormat() ) &&
385  nullptr != ( pSectNd = pSectFormat->GetSectionNode() ))
386  {
387  SwNodeIndex aIdx( *pSectNd, 1 );
388  SwContentNode* pCNd = aIdx.GetNode().GetContentNode();
389  if( !pCNd )
390  pCNd = GetDoc()->GetNodes().GoNext( &aIdx );
391  const SwContentFrame* pCFrame;
392  if( pCNd &&
393  pCNd->EndOfSectionIndex() < pSectNd->EndOfSectionIndex() &&
394  nullptr != ( pCFrame = pCNd->getLayoutFrame( GetLayout() ) ) &&
395  ( IsReadOnlyAvailable() || !pCFrame->IsProtected() ))
396  {
397  SwCallLink aLk( *this ); // watch Cursor-Moves
398  SwCursorSaveState aSaveState( *m_pCurrentCursor );
399  assert(pCFrame->IsTextFrame());
401  static_cast<SwTextFrame const*>(pCFrame)
402  ->MapViewToModelPos(TextFrameIndex(0));
403  bRet = !m_pCurrentCursor->IsInProtectTable() &&
405  if( bRet )
407  break;
408  }
409  }
410  }
411  }
412 }
413 
416 bool SwCursorShell::GotoNxtPrvTableFormula( bool bNext, bool bOnlyErrors )
417 {
418  SvxSearchDialogWrapper::SetSearchLabel( SearchLabel::Empty );
419 
420  if( IsTableMode() )
421  return false;
422 
423  bool bFnd = false;
424  SwPosition aOldPos = *m_pCurrentCursor->GetPoint();
426 
427  Point aPt;
428  SwPosition aFndPos( GetDoc()->GetNodes().GetEndOfContent() );
429  if( !bNext )
430  aFndPos.nNode = 0;
431  SetGetExpField aFndGEF( aFndPos ), aCurGEF( rPos );
432 
433  {
434  const SwNode* pSttNd = rPos.nNode.GetNode().FindTableBoxStartNode();
435  if( pSttNd )
436  {
437  const SwTableBox* pTBox = pSttNd->FindTableNode()->GetTable().
438  GetTableBox( pSttNd->GetIndex() );
439  if( pTBox )
440  aCurGEF = SetGetExpField( *pTBox );
441  }
442  }
443 
444  if( rPos.nNode < GetDoc()->GetNodes().GetEndOfExtras() )
445  {
446  // also at collection use only the first frame
447  std::pair<Point, bool> const tmp(aPt, false);
449  &rPos, &tmp) );
450  }
451  {
452  sal_uInt32 nMaxItems = GetDoc()->GetAttrPool().GetItemCount2( RES_BOXATR_FORMULA );
453 
454  if( nMaxItems > 0 )
455  {
456  sal_uInt8 nMaxDo = 2;
457  do {
458  for (const SfxPoolItem* pItem : GetDoc()->GetAttrPool().GetItemSurrogates(RES_BOXATR_FORMULA))
459  {
460  const SwTableBox* pTBox;
461  auto pFormulaItem = dynamic_cast<const SwTableBoxFormula*>(pItem);
462  if( pFormulaItem &&
463  nullptr != (pTBox = pFormulaItem->GetTableBox() ) &&
464  pTBox->GetSttNd() &&
465  pTBox->GetSttNd()->GetNodes().IsDocNodes() &&
466  ( !bOnlyErrors ||
467  !pFormulaItem->HasValidBoxes() ) )
468  {
469  const SwContentFrame* pCFrame;
470  SwNodeIndex aIdx( *pTBox->GetSttNd() );
471  const SwContentNode* pCNd = GetDoc()->GetNodes().GoNext( &aIdx );
472  std::pair<Point, bool> const tmp(aPt, false);
473  if (pCNd && nullptr != (pCFrame = pCNd->getLayoutFrame(GetLayout(), nullptr, &tmp)) &&
474  (IsReadOnlyAvailable() || !pCFrame->IsProtected() ))
475  {
476  SetGetExpField aCmp( *pTBox );
477  aCmp.SetBodyPos( *pCFrame );
478 
479  if( bNext ? ( aCurGEF < aCmp && aCmp < aFndGEF )
480  : ( aCmp < aCurGEF && aFndGEF < aCmp ))
481  {
482  aFndGEF = aCmp;
483  bFnd = true;
484  }
485  }
486  }
487  }
488  if( !bFnd )
489  {
490  if( bNext )
491  {
492  rPos.nNode = 0;
493  rPos.nContent = 0;
494  aCurGEF = SetGetExpField( rPos );
495  SvxSearchDialogWrapper::SetSearchLabel( SearchLabel::EndWrapped );
496  }
497  else
498  {
499  aCurGEF = SetGetExpField( SwPosition( GetDoc()->GetNodes().GetEndOfContent() ) );
500  SvxSearchDialogWrapper::SetSearchLabel( SearchLabel::StartWrapped );
501  }
502  }
503  } while( !bFnd && --nMaxDo );
504  }
505  }
506 
507  if( bFnd )
508  {
509  SET_CURR_SHELL( this );
510  SwCallLink aLk( *this ); // watch Cursor-Moves
511  SwCursorSaveState aSaveState( *m_pCurrentCursor );
512 
513  aFndGEF.GetPosOfContent( rPos );
515 
516  bFnd = !m_pCurrentCursor->IsSelOvr();
517  if( bFnd )
520  }
521  else
522  {
523  rPos = aOldPos;
524  SvxSearchDialogWrapper::SetSearchLabel( SearchLabel::NavElementNotFound );
525  }
526 
527  return bFnd;
528 }
529 
532 {
533  SvxSearchDialogWrapper::SetSearchLabel( SearchLabel::Empty );
534 
535  if( IsTableMode() )
536  return false;
537 
538  bool bFnd = false;
540 
541  Point aPt;
542  SwPosition aFndPos( GetDoc()->GetNodes().GetEndOfContent() );
543  if( !bNext )
544  aFndPos.nNode = 0;
545  SetGetExpField aFndGEF( aFndPos ), aCurGEF( rPos );
546 
547  if( rPos.nNode.GetIndex() < GetDoc()->GetNodes().GetEndOfExtras().GetIndex() )
548  {
549  // also at collection use only the first frame
550  std::pair<Point, bool> const tmp(aPt, false);
551  aCurGEF.SetBodyPos( *rPos.nNode.GetNode().
552  GetContentNode()->getLayoutFrame(GetLayout(), &rPos, &tmp));
553  }
554 
555  {
556  const SwTextNode* pTextNd;
557  const SwTextTOXMark* pTextTOX;
558  sal_uInt32 nMaxItems = GetDoc()->GetAttrPool().GetItemCount2( RES_TXTATR_TOXMARK );
559 
560  if( nMaxItems > 0 )
561  {
562  do {
563  for (const SfxPoolItem* pItem : GetDoc()->GetAttrPool().GetItemSurrogates(RES_TXTATR_TOXMARK))
564  {
565  auto pToxMarkItem = dynamic_cast<const SwTOXMark*>(pItem);
566  const SwContentFrame* pCFrame;
567 
568  std::pair<Point, bool> const tmp(aPt, false);
569  if( pToxMarkItem &&
570  nullptr != (pTextTOX = pToxMarkItem->GetTextTOXMark() ) &&
571  ( pTextNd = &pTextTOX->GetTextNode())->GetNodes().IsDocNodes() &&
572  nullptr != (pCFrame = pTextNd->getLayoutFrame(GetLayout(), nullptr, &tmp)) &&
573  ( IsReadOnlyAvailable() || !pCFrame->IsProtected() ))
574  {
575  SwNodeIndex aNdIndex( *pTextNd ); // UNIX needs this object
576  SetGetExpField aCmp( aNdIndex, *pTextTOX );
577  aCmp.SetBodyPos( *pCFrame );
578 
579  if( bNext ? ( aCurGEF < aCmp && aCmp < aFndGEF )
580  : ( aCmp < aCurGEF && aFndGEF < aCmp ))
581  {
582  aFndGEF = aCmp;
583  bFnd = true;
584  }
585  }
586  }
587  if( !bFnd )
588  {
589  if ( bNext )
590  {
591  rPos.nNode = 0;
592  rPos.nContent = 0;
593  aCurGEF = SetGetExpField( rPos );
594  SvxSearchDialogWrapper::SetSearchLabel( SearchLabel::EndWrapped );
595  }
596  else
597  {
598  aCurGEF = SetGetExpField( SwPosition( GetDoc()->GetNodes().GetEndOfContent() ) );
599  SvxSearchDialogWrapper::SetSearchLabel( SearchLabel::StartWrapped );
600  }
601  }
602  } while ( !bFnd );
603  }
604  else
605  SvxSearchDialogWrapper::SetSearchLabel( SearchLabel::NavElementNotFound );
606  }
607 
608  if( bFnd )
609  {
610  SET_CURR_SHELL( this );
611  SwCallLink aLk( *this ); // watch Cursor-Moves
612  SwCursorSaveState aSaveState( *m_pCurrentCursor );
613 
614  aFndGEF.GetPosOfContent( rPos );
615 
616  bFnd = !m_pCurrentCursor->IsSelOvr();
617  if( bFnd )
620  }
621  return bFnd;
622 }
623 
626  SwTOXSearch eDir )
627 {
628  SET_CURR_SHELL( this );
629  SwCallLink aLk( *this ); // watch Cursor-Moves
630  SwCursorSaveState aSaveState( *m_pCurrentCursor );
631 
632  const SwTOXMark& rNewMark = GetDoc()->GotoTOXMark( rStart, eDir,
634  // set position
635  SwPosition& rPos = *GetCursor()->GetPoint();
636  rPos.nNode = rNewMark.GetTextTOXMark()->GetTextNode();
637  rPos.nContent.Assign( rPos.nNode.GetNode().GetContentNode(),
638  rNewMark.GetTextTOXMark()->GetStart() );
639 
640  if( !m_pCurrentCursor->IsSelOvr() )
643 
644  return rNewMark;
645 }
646 
648 static void lcl_MakeFieldLst(
649  SetGetExpFields& rLst,
650  const SwFieldType& rFieldType,
651  const bool bInReadOnly,
652  const bool bChkInpFlag = false )
653 {
654  // always search the 1. frame
655  Point aPt;
656  SwTextField* pTextField = nullptr;
657  SwIterator<SwFormatField,SwFieldType> aIter(rFieldType);
658  for( SwFormatField* pFormatField = aIter.First(); pFormatField; pFormatField = aIter.Next() )
659  {
660  pTextField = pFormatField->GetTextField();
661  if ( pTextField != nullptr
662  && ( !bChkInpFlag
663  || static_cast<const SwSetExpField*>(pTextField->GetFormatField().GetField())->GetInputFlag() ) )
664  {
665  const SwTextNode& rTextNode = pTextField->GetTextNode();
666  std::pair<Point, bool> const tmp(aPt, false);
667  const SwContentFrame* pCFrame =
668  rTextNode.getLayoutFrame(
670  nullptr, &tmp);
671  if ( pCFrame != nullptr
672  && ( bInReadOnly || !pCFrame->IsProtected() ) )
673  {
674  std::unique_ptr<SetGetExpField> pNew(new SetGetExpField( SwNodeIndex( rTextNode ), pTextField ));
675  pNew->SetBodyPos( *pCFrame );
676  rLst.insert( std::move(pNew) );
677  }
678  }
679  }
680 }
681 
683 lcl_FindField(bool & o_rFound, SetGetExpFields const& rSrtLst,
684  SwRootFrame const *const pLayout, SwTextNode *const pTextNode,
685  SwTextField const *const pTextField, SwPosition const& rPos,
686  sal_Int32 const nContentOffset)
687 {
688  std::unique_ptr<SetGetExpField> pSrch;
689  std::unique_ptr<SwIndex> pIndex;
690  if (-1 == nContentOffset)
691  {
692  pSrch.reset(new SetGetExpField(rPos.nNode, pTextField, &rPos.nContent));
693  }
694  else
695  {
696  pIndex.reset(new SwIndex(rPos.nNode.GetNode().GetContentNode(), nContentOffset));
697  pSrch.reset(new SetGetExpField(rPos.nNode, pTextField, pIndex.get()));
698  }
699 
700  if (rPos.nNode.GetIndex() < pTextNode->GetNodes().GetEndOfExtras().GetIndex())
701  {
702  // also at collection use only the first frame
703  Point aPt;
704  std::pair<Point, bool> const tmp(aPt, false);
705  pSrch->SetBodyPos(*pTextNode->getLayoutFrame(pLayout, &rPos, &tmp));
706  }
707 
708  SetGetExpFields::const_iterator it = rSrtLst.lower_bound(pSrch.get());
709 
710  o_rFound = (it != rSrtLst.end()) && (**it == *pSrch);
711  return it;
712 }
713 
715  const SwFieldType* pFieldType,
716  const bool bNext,
717  const SwFieldIds nResType,
718  const bool bAddSetExpressionFieldsToInputFields )
719 {
720  // sorted list of all fields
721  SetGetExpFields aSrtLst;
722 
723  if ( pFieldType )
724  {
725  if( SwFieldIds::Input != pFieldType->Which() && !pFieldType->HasWriterListeners() )
726  {
727  return false;
728  }
729 
730  // found Modify object, add all fields to array
731  ::lcl_MakeFieldLst( aSrtLst, *pFieldType, IsReadOnlyAvailable() );
732 
733  if( SwFieldIds::Input == pFieldType->Which() && bAddSetExpressionFieldsToInputFields )
734  {
735  // there are hidden input fields in the set exp. fields
736  const SwFieldTypes& rFieldTypes = *mxDoc->getIDocumentFieldsAccess().GetFieldTypes();
737  const size_t nSize = rFieldTypes.size();
738  for( size_t i=0; i < nSize; ++i )
739  {
740  pFieldType = rFieldTypes[ i ].get();
741  if ( SwFieldIds::SetExp == pFieldType->Which() )
742  {
743  ::lcl_MakeFieldLst( aSrtLst, *pFieldType, IsReadOnlyAvailable(), true );
744  }
745  }
746  }
747  }
748  else
749  {
750  const SwFieldTypes& rFieldTypes = *mxDoc->getIDocumentFieldsAccess().GetFieldTypes();
751  const size_t nSize = rFieldTypes.size();
752  for( size_t i=0; i < nSize; ++i )
753  {
754  pFieldType = rFieldTypes[ i ].get();
755  if( nResType == pFieldType->Which() )
756  {
757  ::lcl_MakeFieldLst( aSrtLst, *pFieldType, IsReadOnlyAvailable() );
758  }
759  }
760  }
761 
762  // found no fields?
763  if( aSrtLst.empty() )
764  return false;
765 
767  SwCursor* pCursor = getShellCursor( true );
768  {
769  // (1998): Always use field for search so that the right one is found as
770  // well some are in frames that are anchored to a paragraph that has a
771  // field
772  const SwPosition& rPos = *pCursor->GetPoint();
773 
774  SwTextNode* pTNd = rPos.nNode.GetNode().GetTextNode();
775  OSL_ENSURE( pTNd, "No ContentNode" );
776 
777  SwTextField * pTextField = pTNd->GetFieldTextAttrAt( rPos.nContent.GetIndex(), true );
778  const bool bDelField = ( pTextField == nullptr );
779  sal_Int32 nContentOffset = -1;
780 
781  if( bDelField )
782  {
783  // create dummy for the search
784  SwFormatField* pFormatField = new SwFormatField( SwDateTimeField(
785  static_cast<SwDateTimeFieldType*>(mxDoc->getIDocumentFieldsAccess().GetSysFieldType( SwFieldIds::DateTime ) ) ) );
786 
787  pTextField = new SwTextField( *pFormatField, rPos.nContent.GetIndex(),
788  mxDoc->IsClipBoard() );
789  pTextField->ChgTextNode( pTNd );
790  }
791  else
792  {
793  // the cursor might be anywhere inside the input field,
794  // but we will be searching for the field start
795  if (pTextField->Which() == RES_TXTATR_INPUTFIELD
796  && rPos.nContent.GetIndex() != pTextField->GetStart())
797  nContentOffset = pTextField->GetStart();
798  }
799  bool isSrch;
800  it = lcl_FindField(isSrch, aSrtLst,
801  GetLayout(), pTNd, pTextField, rPos, nContentOffset);
802 
803  if( bDelField )
804  {
805  auto const pFormat(static_cast<SwFormatField*>(&pTextField->GetAttr()));
806  delete pTextField;
807  delete pFormat;
808  }
809 
810  if( it != aSrtLst.end() && isSrch ) // found
811  {
812  if( bNext )
813  {
814  if( ++it == aSrtLst.end() )
815  return false; // already at the end
816  }
817  else
818  {
819  if( it == aSrtLst.begin() )
820  return false; // no more steps backward possible
821  --it;
822  }
823  }
824  else // not found
825  {
826  if( bNext )
827  {
828  if( it == aSrtLst.end() )
829  return false;
830  }
831  else
832  {
833  if( it == aSrtLst.begin() )
834  return false; // no more steps backward possible
835  --it;
836  }
837  }
838  }
839  const SetGetExpField& rFnd = **it;
840 
841  SET_CURR_SHELL( this );
842  SwCallLink aLk( *this ); // watch Cursor-Moves
843  SwCursorSaveState aSaveState( *pCursor );
844 
845  rFnd.GetPosOfContent( *pCursor->GetPoint() );
848  if( bRet )
850  return bRet;
851 }
852 
854 {
855  bool bRet = false;
856  SwTextField const*const pTextField(rField.GetTextField());
857  if (pTextField
858  && (!GetLayout()->IsHideRedlines()
860  GetDoc()->getIDocumentRedlineAccess(), *pTextField)))
861  {
862  SET_CURR_SHELL( this );
863  SwCallLink aLk( *this ); // watch Cursor-Moves
864 
865  SwCursor* pCursor = getShellCursor( true );
866  SwCursorSaveState aSaveState( *pCursor );
867 
868  SwTextNode* pTNd = pTextField->GetpTextNode();
869  pCursor->GetPoint()->nNode = *pTNd;
870  pCursor->GetPoint()->nContent.Assign( pTNd, pTextField->GetStart() );
871 
872  bRet = !pCursor->IsSelOvr();
873  if( bRet )
875  }
876  return bRet;
877 }
878 
880  const SwPosition* pPos,
881  const bool bIncludeInputFieldAtStart )
882 {
883  SwTextField* pTextField = nullptr;
884 
885  SwTextNode * const pNode = pPos->nNode.GetNode().GetTextNode();
886  if ( pNode != nullptr )
887  {
888  pTextField = pNode->GetFieldTextAttrAt( pPos->nContent.GetIndex(), bIncludeInputFieldAtStart );
889  }
890 
891  return pTextField;
892 }
893 
895  const SwPaM* pCursor,
896  const bool bIncludeInputFieldAtStart )
897 {
898  SwTextField* pFieldAtCursor = nullptr;
899 
900  SwTextField* pTextField = GetTextFieldAtPos( pCursor->Start(), bIncludeInputFieldAtStart );
901  if ( pTextField != nullptr
902  && pCursor->Start()->nNode == pCursor->End()->nNode )
903  {
904  const sal_Int32 nTextFieldLength =
905  pTextField->End() != nullptr
906  ? *(pTextField->End()) - pTextField->GetStart()
907  : 1;
908  if ( ( pCursor->End()->nContent.GetIndex() - pCursor->Start()->nContent.GetIndex() ) <= nTextFieldLength )
909  {
910  pFieldAtCursor = pTextField;
911  }
912  }
913 
914  return pFieldAtCursor;
915 }
916 
918  const SwPaM *const pCursor,
919  const bool bIncludeInputFieldAtStart)
920 {
921  SwTextField *const pField(GetTextFieldAtCursor(pCursor, bIncludeInputFieldAtStart));
922  return pField
923  ? const_cast<SwField*>(pField->GetFormatField().GetField())
924  : nullptr;
925 }
926 
927 SwField* SwCursorShell::GetCurField( const bool bIncludeInputFieldAtStart ) const
928 {
929  SwPaM* pCursor = GetCursor();
930  if ( pCursor->IsMultiSelection() )
931  {
932  // multi selection not handled.
933  return nullptr;
934  }
935 
936  SwField* pCurField = GetFieldAtCursor( pCursor, bIncludeInputFieldAtStart );
937  if ( pCurField != nullptr
938  && SwFieldIds::Table == pCurField->GetTyp()->Which() )
939  {
940  // table formula? convert internal name into external
941  const SwTableNode* pTableNd = IsCursorInTable();
942  static_cast<SwTableField*>(pCurField)->PtrToBoxNm( pTableNd ? &pTableNd->GetTable() : nullptr );
943  }
944 
945  return pCurField;
946 }
947 
949 {
950  for(SwPaM& rCursor : GetCursor()->GetRingContainer())
951  {
952  if (dynamic_cast<const SwTextInputField*>(GetTextFieldAtCursor(&rCursor, false)))
953  return true;
954  }
955  return false;
956 }
957 
959 {
960  return dynamic_cast<const SwTextInputField*>(GetTextFieldAtPos( &rPos, false )) != nullptr;
961 }
962 
963 bool SwCursorShell::DocPtInsideInputField( const Point& rDocPt ) const
964 {
965  SwPosition aPos( *(GetCursor()->Start()) );
966  Point aDocPt( rDocPt );
967  if ( GetLayout()->GetCursorOfst( &aPos, aDocPt ) )
968  {
969  return PosInsideInputField( aPos );
970  }
971  return false;
972 }
973 
975 {
976  const SwTextInputField* pTextInputField = dynamic_cast<const SwTextInputField*>(GetTextFieldAtPos( &rPos, true ));
977  assert(pTextInputField != nullptr
978  && "<SwEditShell::StartOfInputFieldAtPos(..)> - no Input Field at given position");
979  return pTextInputField->GetStart();
980 }
981 
983 {
984  const SwTextInputField* pTextInputField = dynamic_cast<const SwTextInputField*>(GetTextFieldAtPos( &rPos, true ));
985  assert(pTextInputField != nullptr
986  && "<SwEditShell::EndOfInputFieldAtPos(..)> - no Input Field at given position");
987  return *(pTextInputField->End());
988 }
989 
991 {
992  SwCursor* pCursor = getShellCursor( true );
993 
994  SET_CURR_SHELL( this );
995  SwCallLink aLk( *this ); // watch Cursor-Moves
996  SwCursorSaveState aSaveState( *pCursor );
997 
998  const SwNodes& rNds = GetDoc()->GetNodes();
999  SwTextNode* pTextNd = rNds.GetOutLineNds()[ nIdx ]->GetTextNode();
1000  pCursor->GetPoint()->nNode = *pTextNd;
1001  pCursor->GetPoint()->nContent.Assign( pTextNd, 0 );
1002 
1003  if( !pCursor->IsSelOvr() )
1005 }
1006 
1007 bool SwCursorShell::GotoOutline( const OUString& rName )
1008 {
1009  SwCursor* pCursor = getShellCursor( true );
1010 
1011  SET_CURR_SHELL( this );
1012  SwCallLink aLk( *this ); // watch Cursor-Moves
1013  SwCursorSaveState aSaveState( *pCursor );
1014 
1015  bool bRet = false;
1016  if (mxDoc->GotoOutline(*pCursor->GetPoint(), rName, GetLayout())
1017  && !pCursor->IsSelOvr())
1018  {
1020  bRet = true;
1021  }
1022  return bRet;
1023 }
1024 
1027 {
1028  const SwNodes& rNds = GetDoc()->GetNodes();
1029 
1030  if ( rNds.GetOutLineNds().empty() )
1031  {
1032  SvxSearchDialogWrapper::SetSearchLabel( SearchLabel::NavElementNotFound );
1033  return false;
1034  }
1035 
1036  SwCursor* pCursor = getShellCursor( true );
1037  SwNode* pNd = &(pCursor->GetNode());
1039  bool bUseFirst = !rNds.GetOutLineNds().Seek_Entry( pNd, &nPos );
1040  SwOutlineNodes::size_type const nStartPos(nPos);
1041 
1042  do
1043  {
1044  if (!bUseFirst)
1045  {
1046  ++nPos;
1047  }
1048  if (rNds.GetOutLineNds().size() <= nPos)
1049  {
1050  nPos = 0;
1051  }
1052 
1053  if (bUseFirst)
1054  {
1055  bUseFirst = false;
1056  }
1057  else
1058  {
1059  if (nPos == nStartPos)
1060  {
1061  SvxSearchDialogWrapper::SetSearchLabel( SearchLabel::NavElementNotFound );
1062  return false;
1063  }
1064  }
1065 
1066  pNd = rNds.GetOutLineNds()[ nPos ];
1067  }
1068  while (!sw::IsParaPropsNode(*GetLayout(), *pNd->GetTextNode()));
1069 
1070  if (nPos < nStartPos)
1071  {
1072  SvxSearchDialogWrapper::SetSearchLabel( SearchLabel::EndWrapped );
1073  }
1074  else
1075  {
1076  SvxSearchDialogWrapper::SetSearchLabel( SearchLabel::Empty );
1077  }
1078 
1079  SET_CURR_SHELL( this );
1080  SwCallLink aLk( *this ); // watch Cursor-Moves
1081  SwCursorSaveState aSaveState( *pCursor );
1082  pCursor->GetPoint()->nNode = *pNd;
1083  pCursor->GetPoint()->nContent.Assign( pNd->GetTextNode(), 0 );
1084 
1085  bool bRet = !pCursor->IsSelOvr();
1086  if( bRet )
1088  return bRet;
1089 }
1090 
1093 {
1094  const SwNodes& rNds = GetDoc()->GetNodes();
1095 
1096  if ( rNds.GetOutLineNds().empty() )
1097  {
1098  SvxSearchDialogWrapper::SetSearchLabel( SearchLabel::NavElementNotFound );
1099  return false;
1100  }
1101 
1102  SwCursor* pCursor = getShellCursor( true );
1103  SwNode* pNd = &(pCursor->GetNode());
1105  bool bRet = false;
1106  (void)rNds.GetOutLineNds().Seek_Entry(pNd, &nPos);
1107  SwOutlineNodes::size_type const nStartPos(nPos);
1108 
1109  do
1110  {
1111  if (nPos == 0)
1112  {
1113  nPos = rNds.GetOutLineNds().size() - 1;
1114  }
1115  else
1116  {
1117  --nPos; // before
1118  }
1119  if (nPos == nStartPos)
1120  {
1121  pNd = nullptr;
1122  break;
1123  }
1124 
1125  pNd = rNds.GetOutLineNds()[ nPos ];
1126  }
1127  while (!sw::IsParaPropsNode(*GetLayout(), *pNd->GetTextNode()));
1128 
1129  if (pNd)
1130  {
1131  if (nStartPos < nPos)
1132  {
1133  SvxSearchDialogWrapper::SetSearchLabel( SearchLabel::StartWrapped );
1134  }
1135  else
1136  {
1137  SvxSearchDialogWrapper::SetSearchLabel( SearchLabel::Empty );
1138  }
1139  SET_CURR_SHELL( this );
1140  SwCallLink aLk( *this ); // watch Cursor-Moves
1141  SwCursorSaveState aSaveState( *pCursor );
1142  pCursor->GetPoint()->nNode = *pNd;
1143  pCursor->GetPoint()->nContent.Assign( pNd->GetTextNode(), 0 );
1144 
1145  bRet = !pCursor->IsSelOvr();
1146  if( bRet )
1148  }
1149  else
1150  {
1151  SvxSearchDialogWrapper::SetSearchLabel( SearchLabel::NavElementNotFound );
1152  }
1153  return bRet;
1154 }
1155 
1158 {
1159  SwPaM* pCursor = getShellCursor( true );
1160  const SwNodes& rNds = GetDoc()->GetNodes();
1161 
1162  SwNode* pNd = &(pCursor->GetNode());
1164  if( rNds.GetOutLineNds().Seek_Entry( pNd, &nPos ))
1165  nPos++; // is at correct position; take next for while
1166 
1167  while( nPos-- ) // check the one in front of the current
1168  {
1169  pNd = rNds.GetOutLineNds()[ nPos ];
1170 
1171  if (sw::IsParaPropsNode(*GetLayout(), *pNd->GetTextNode())
1172  && pNd->GetTextNode()->GetAttrOutlineLevel()-1 <= nLevel)
1173  {
1174  return nPos;
1175  }
1176  }
1177  return SwOutlineNodes::npos; // no more left
1178 }
1179 
1181  bool bWithChildren )
1182 {
1183  const SwNodes& rNds = GetDoc()->GetNodes();
1184  const SwOutlineNodes& rOutlNds = rNds.GetOutLineNds();
1185  if( rOutlNds.empty() )
1186  return false;
1187 
1188  SET_CURR_SHELL( this );
1189  SwCallLink aLk( *this ); // watch Cursor-Moves
1190 
1191  if( nSttPos > nEndPos ) // parameters switched?
1192  {
1193  OSL_ENSURE( false, "Start > End for array access" );
1194  std::swap(nSttPos, nEndPos);
1195  }
1196 
1197  SwNode* pSttNd = rOutlNds[ nSttPos ];
1198  SwNode* pEndNd = rOutlNds[ nEndPos ];
1199 
1200  if( bWithChildren )
1201  {
1202  const int nLevel = pEndNd->GetTextNode()->GetAttrOutlineLevel()-1;
1203  for( ++nEndPos; nEndPos < rOutlNds.size(); ++nEndPos )
1204  {
1205  pEndNd = rOutlNds[ nEndPos ];
1206  const int nNxtLevel = pEndNd->GetTextNode()->GetAttrOutlineLevel()-1;
1207  if( nNxtLevel <= nLevel )
1208  break; // EndPos is now on the next one
1209  }
1210  }
1211  // if without children then set onto next one
1212  else if( ++nEndPos < rOutlNds.size() )
1213  pEndNd = rOutlNds[ nEndPos ];
1214 
1215  if( nEndPos == rOutlNds.size() ) // no end found
1216  pEndNd = &rNds.GetEndOfContent();
1217 
1218  KillPams();
1219 
1220  SwCursorSaveState aSaveState( *m_pCurrentCursor );
1221 
1222  // set end to the end of the previous content node
1223  m_pCurrentCursor->GetPoint()->nNode = *pSttNd;
1226  m_pCurrentCursor->GetPoint()->nNode = *pEndNd;
1227  m_pCurrentCursor->Move( fnMoveBackward, GoInNode ); // end of predecessor
1228 
1229  // and everything is already selected
1230  bool bRet = !m_pCurrentCursor->IsSelOvr();
1231  if( bRet )
1233  return bRet;
1234 }
1235 
1237 bool SwCursorShell::GotoRefMark( const OUString& rRefMark, sal_uInt16 nSubType,
1238  sal_uInt16 nSeqNo )
1239 {
1240  SET_CURR_SHELL( this );
1241  SwCallLink aLk( *this ); // watch Cursor-Moves
1242  SwCursorSaveState aSaveState( *m_pCurrentCursor );
1243 
1244  sal_Int32 nPos = -1;
1245  SwTextNode* pTextNd = SwGetRefFieldType::FindAnchor( GetDoc(), rRefMark,
1246  nSubType, nSeqNo, &nPos, nullptr, GetLayout());
1247  if( pTextNd && pTextNd->GetNodes().IsDocNodes() )
1248  {
1249  m_pCurrentCursor->GetPoint()->nNode = *pTextNd;
1250  m_pCurrentCursor->GetPoint()->nContent.Assign( pTextNd, nPos );
1251 
1252  if( !m_pCurrentCursor->IsSelOvr() )
1253  {
1255  return true;
1256  }
1257  }
1258  return false;
1259 }
1260 
1261 bool SwCursorShell::IsPageAtPos( const Point &rPt ) const
1262 {
1263  if( GetLayout() )
1264  return nullptr != GetLayout()->GetPageAtPos( rPt );
1265  return false;
1266 }
1267 
1269  SwContentAtPos& rContentAtPos,
1270  bool bSetCursor,
1271  SwRect* pFieldRect )
1272 {
1273  SET_CURR_SHELL( this );
1274  bool bRet = false;
1275 
1276  if( !IsTableMode() )
1277  {
1278  Point aPt( rPt );
1279  SwPosition aPos( *m_pCurrentCursor->GetPoint() );
1280 
1281  SwTextNode* pTextNd;
1282  SwContentFrame *pFrame(nullptr);
1283  SwTextAttr* pTextAttr;
1284  SwCursorMoveState aTmpState;
1285  aTmpState.m_bFieldInfo = true;
1286  aTmpState.m_bExactOnly = !( IsAttrAtPos::Outline & rContentAtPos.eContentAtPos );
1287  aTmpState.m_bContentCheck = bool(IsAttrAtPos::ContentCheck & rContentAtPos.eContentAtPos);
1288  aTmpState.m_bSetInReadOnly = IsReadOnlyAvailable();
1289 
1290  SwSpecialPos aSpecialPos;
1291  aTmpState.m_pSpecialPos = ( IsAttrAtPos::SmartTag & rContentAtPos.eContentAtPos ) ?
1292  &aSpecialPos : nullptr;
1293 
1294  const bool bCursorFoundExact = GetLayout()->GetCursorOfst( &aPos, aPt, &aTmpState );
1295  pTextNd = aPos.nNode.GetNode().GetTextNode();
1296 
1297  const SwNodes& rNds = GetDoc()->GetNodes();
1298  if( pTextNd
1299  && IsAttrAtPos::Outline & rContentAtPos.eContentAtPos
1300  && !rNds.GetOutLineNds().empty() )
1301  {
1302  const SwTextNode* pONd = pTextNd->FindOutlineNodeOfLevel(MAXLEVEL-1, GetLayout());
1303  if( pONd )
1304  {
1305  rContentAtPos.eContentAtPos = IsAttrAtPos::Outline;
1306  rContentAtPos.sStr = sw::GetExpandTextMerged(GetLayout(), *pONd, true, false, ExpandMode::ExpandFootnote);
1307  bRet = true;
1308  }
1309  }
1310  else if ( IsAttrAtPos::ContentCheck & rContentAtPos.eContentAtPos
1311  && bCursorFoundExact )
1312  {
1313  bRet = true;
1314  }
1315  else if( pTextNd
1316  && IsAttrAtPos::NumLabel & rContentAtPos.eContentAtPos)
1317  {
1318  bRet = aTmpState.m_bInNumPortion;
1319  rContentAtPos.aFnd.pNode = sw::GetParaPropsNode(*GetLayout(), aPos.nNode);
1320 
1321  Size aSizeLogic(aTmpState.m_nInNumPortionOffset, 0);
1322  Size aSizePixel = GetWin()->LogicToPixel(aSizeLogic);
1323  rContentAtPos.nDist = aSizePixel.Width();
1324  }
1325  else if( bCursorFoundExact && pTextNd )
1326  {
1327  if( !aTmpState.m_bPosCorr )
1328  {
1329  if ( IsAttrAtPos::SmartTag & rContentAtPos.eContentAtPos
1330  && !aTmpState.m_bFootnoteNoInfo )
1331  {
1332  const SwWrongList* pSmartTagList = pTextNd->GetSmartTags();
1333  sal_Int32 nCurrent = aPos.nContent.GetIndex();
1334  const sal_Int32 nBegin = nCurrent;
1335  sal_Int32 nLen = 1;
1336 
1337  if (pSmartTagList && pSmartTagList->InWrongWord(nCurrent, nLen) && !pTextNd->IsSymbolAt(nBegin))
1338  {
1339  const sal_uInt16 nIndex = pSmartTagList->GetWrongPos( nBegin );
1340  const SwWrongList* pSubList = pSmartTagList->SubList( nIndex );
1341  if ( pSubList )
1342  {
1343  nCurrent = aTmpState.m_pSpecialPos->nCharOfst;
1344 
1345  if ( pSubList->InWrongWord( nCurrent, nLen ) )
1346  bRet = true;
1347  }
1348  else
1349  bRet = true;
1350 
1351  if( bRet && bSetCursor )
1352  {
1353  SwCursorSaveState aSaveState( *m_pCurrentCursor );
1354  SwCallLink aLk( *this ); // watch Cursor-Moves
1356  *m_pCurrentCursor->GetPoint() = aPos;
1358  bRet = false;
1359  else
1360  UpdateCursor();
1361  }
1362  if( bRet )
1363  {
1364  rContentAtPos.eContentAtPos = IsAttrAtPos::SmartTag;
1365 
1366  std::pair<Point, bool> tmp(aPt, true);
1367  if (pFieldRect && nullptr != (pFrame = pTextNd->getLayoutFrame(GetLayout(), nullptr, &tmp)))
1368  pFrame->GetCharRect( *pFieldRect, aPos, &aTmpState );
1369  }
1370  }
1371  }
1372 
1373  if ( !bRet
1375  && !aTmpState.m_bFootnoteNoInfo )
1376  {
1377  pTextAttr = pTextNd->GetFieldTextAttrAt( aPos.nContent.GetIndex() );
1378  const SwField* pField = pTextAttr != nullptr
1379  ? pTextAttr->GetFormatField().GetField()
1380  : nullptr;
1381  if ( IsAttrAtPos::ClickField & rContentAtPos.eContentAtPos
1382  && pField && !pField->HasClickHdl() )
1383  {
1384  pField = nullptr;
1385  }
1386 
1387  if ( pField )
1388  {
1389  std::pair<Point, bool> tmp(aPt, true);
1390  if (pFieldRect && nullptr != (pFrame = pTextNd->getLayoutFrame(GetLayout(), nullptr, &tmp)))
1391  {
1392  //tdf#116397 now that we looking for the bounds of the field drop the SmartTag
1393  //index within field setting so we don't the bounds of the char within the field
1394  SwSpecialPos* pSpecialPos = aTmpState.m_pSpecialPos;
1395  aTmpState.m_pSpecialPos = nullptr;
1396  pFrame->GetCharRect( *pFieldRect, aPos, &aTmpState );
1397  aTmpState.m_pSpecialPos = pSpecialPos;
1398  }
1399 
1400  if( bSetCursor )
1401  {
1402  SwCallLink aLk( *this ); // watch Cursor-Moves
1403  SwCursorSaveState aSaveState( *m_pCurrentCursor );
1405  *m_pCurrentCursor->GetPoint() = aPos;
1406  if( m_pCurrentCursor->IsSelOvr() )
1407  {
1408  // allow click fields in protected sections
1409  // only placeholder is not possible
1410  if( IsAttrAtPos::Field & rContentAtPos.eContentAtPos
1411  || SwFieldIds::JumpEdit == pField->Which() )
1412  pField = nullptr;
1413  }
1414  else
1415  UpdateCursor();
1416  }
1417  else if( SwFieldIds::Table == pField->Which() &&
1418  static_cast<const SwTableField*>(pField)->IsIntrnlName() )
1419  {
1420  // create from internal (for CORE) the external
1421  // (for UI) formula
1422  const SwTableNode* pTableNd = pTextNd->FindTableNode();
1423  if( pTableNd ) // is in a table
1424  const_cast<SwTableField*>(static_cast<const SwTableField*>(pField))->PtrToBoxNm( &pTableNd->GetTable() );
1425  }
1426  }
1427 
1428  if( pField )
1429  {
1430  rContentAtPos.aFnd.pField = pField;
1431  rContentAtPos.pFndTextAttr = pTextAttr;
1432  rContentAtPos.eContentAtPos = IsAttrAtPos::Field;
1433  bRet = true;
1434  }
1435  }
1436 
1437  if( !bRet && IsAttrAtPos::FormControl & rContentAtPos.eContentAtPos )
1438  {
1439  IDocumentMarkAccess* pMarksAccess = GetDoc()->getIDocumentMarkAccess( );
1440  sw::mark::IFieldmark* pFieldBookmark = pMarksAccess->getFieldmarkFor( aPos );
1441  if (bCursorFoundExact && pFieldBookmark)
1442  {
1443  rContentAtPos.eContentAtPos = IsAttrAtPos::FormControl;
1444  rContentAtPos.aFnd.pFieldmark = pFieldBookmark;
1445  bRet=true;
1446  }
1447  }
1448 
1449  if( !bRet && IsAttrAtPos::Ftn & rContentAtPos.eContentAtPos )
1450  {
1451  if( aTmpState.m_bFootnoteNoInfo )
1452  {
1453  // over the footnote's char
1454  bRet = true;
1455  if( bSetCursor )
1456  {
1457  *m_pCurrentCursor->GetPoint() = aPos;
1458  if( !GotoFootnoteAnchor() )
1459  bRet = false;
1460  }
1461  if( bRet )
1462  rContentAtPos.eContentAtPos = IsAttrAtPos::Ftn;
1463  }
1464  else if ( nullptr != ( pTextAttr = pTextNd->GetTextAttrForCharAt(
1465  aPos.nContent.GetIndex(), RES_TXTATR_FTN )) )
1466  {
1467  bRet = true;
1468  if( bSetCursor )
1469  {
1470  SwCallLink aLk( *this ); // watch Cursor-Moves
1471  SwCursorSaveState aSaveState( *m_pCurrentCursor );
1472  m_pCurrentCursor->GetPoint()->nNode = *static_cast<SwTextFootnote*>(pTextAttr)->GetStartNode();
1475  true, !IsReadOnlyAvailable() );
1476 
1477  if( pCNd )
1478  {
1479  m_pCurrentCursor->GetPoint()->nContent.Assign( pCNd, 0 );
1482  bRet = false;
1483  else
1484  UpdateCursor();
1485  }
1486  else
1487  bRet = false;
1488  }
1489 
1490  if( bRet )
1491  {
1492  rContentAtPos.eContentAtPos = IsAttrAtPos::Ftn;
1493  rContentAtPos.pFndTextAttr = pTextAttr;
1494  rContentAtPos.aFnd.pAttr = &pTextAttr->GetAttr();
1495 
1496  std::pair<Point, bool> tmp(aPt, true);
1497  if (pFieldRect && nullptr != (pFrame = pTextNd->getLayoutFrame(GetLayout(), nullptr, &tmp)))
1498  pFrame->GetCharRect( *pFieldRect, aPos, &aTmpState );
1499  }
1500  }
1501  }
1502 
1503  if( !bRet
1505  && !aTmpState.m_bFootnoteNoInfo )
1506  {
1507  pTextAttr = nullptr;
1508  if( IsAttrAtPos::ToxMark & rContentAtPos.eContentAtPos )
1509  {
1510  std::vector<SwTextAttr *> const marks(
1511  pTextNd->GetTextAttrsAt(
1512  aPos.nContent.GetIndex(), RES_TXTATR_TOXMARK));
1513  if (!marks.empty())
1514  { // hmm... can only return 1 here
1515  pTextAttr = *marks.begin();
1516  }
1517  }
1518 
1519  if( !pTextAttr &&
1520  IsAttrAtPos::RefMark & rContentAtPos.eContentAtPos )
1521  {
1522  std::vector<SwTextAttr *> const marks(
1523  pTextNd->GetTextAttrsAt(
1524  aPos.nContent.GetIndex(), RES_TXTATR_REFMARK));
1525  if (!marks.empty())
1526  { // hmm... can only return 1 here
1527  pTextAttr = *marks.begin();
1528  }
1529  }
1530 
1531  if( pTextAttr )
1532  {
1533  bRet = true;
1534  if( bSetCursor )
1535  {
1536  SwCallLink aLk( *this ); // watch Cursor-Moves
1537  SwCursorSaveState aSaveState( *m_pCurrentCursor );
1539  *m_pCurrentCursor->GetPoint() = aPos;
1541  bRet = false;
1542  else
1543  UpdateCursor();
1544  }
1545 
1546  if( bRet )
1547  {
1548  const sal_Int32* pEnd = pTextAttr->GetEnd();
1549  if( pEnd )
1550  rContentAtPos.sStr =
1551  pTextNd->GetExpandText(GetLayout(), pTextAttr->GetStart(), *pEnd - pTextAttr->GetStart());
1552  else if( RES_TXTATR_TOXMARK == pTextAttr->Which())
1553  rContentAtPos.sStr =
1554  pTextAttr->GetTOXMark().GetAlternativeText();
1555 
1556  rContentAtPos.eContentAtPos =
1557  RES_TXTATR_TOXMARK == pTextAttr->Which()
1560  rContentAtPos.pFndTextAttr = pTextAttr;
1561  rContentAtPos.aFnd.pAttr = &pTextAttr->GetAttr();
1562 
1563  std::pair<Point, bool> tmp(aPt, true);
1564  if (pFieldRect && nullptr != (pFrame = pTextNd->getLayoutFrame(GetLayout(), nullptr, &tmp)))
1565  pFrame->GetCharRect( *pFieldRect, aPos, &aTmpState );
1566  }
1567  }
1568  }
1569 
1570  if ( !bRet
1571  && IsAttrAtPos::InetAttr & rContentAtPos.eContentAtPos
1572  && !aTmpState.m_bFootnoteNoInfo )
1573  {
1574  pTextAttr = pTextNd->GetTextAttrAt(
1575  aPos.nContent.GetIndex(), RES_TXTATR_INETFMT);
1576  // "detect" only INetAttrs with URLs
1577  if( pTextAttr && !pTextAttr->GetINetFormat().GetValue().isEmpty() )
1578  {
1579  bRet = true;
1580  if( bSetCursor )
1581  {
1582  SwCursorSaveState aSaveState( *m_pCurrentCursor );
1583  SwCallLink aLk( *this ); // watch Cursor-Moves
1585  *m_pCurrentCursor->GetPoint() = aPos;
1588  bRet = false;
1589  else
1590  UpdateCursor();
1591  }
1592  if( bRet )
1593  {
1594  const sal_Int32 nSt = pTextAttr->GetStart();
1595  const sal_Int32 nEnd = *pTextAttr->End();
1596 
1597  rContentAtPos.sStr = pTextNd->GetExpandText(GetLayout(), nSt, nEnd-nSt);
1598 
1599  rContentAtPos.aFnd.pAttr = &pTextAttr->GetAttr();
1600  rContentAtPos.eContentAtPos = IsAttrAtPos::InetAttr;
1601  rContentAtPos.pFndTextAttr = pTextAttr;
1602 
1603  std::pair<Point, bool> tmp(aPt, true);
1604  if (pFieldRect && nullptr != (pFrame = pTextNd->getLayoutFrame(GetLayout(), nullptr, &tmp)))
1605  {
1606  //get bounding box of range
1607  SwRect aStart;
1608  SwPosition aStartPos(*pTextNd, nSt);
1609  pFrame->GetCharRect(aStart, aStartPos, &aTmpState);
1610  SwRect aEnd;
1611  SwPosition aEndPos(*pTextNd, nEnd);
1612  pFrame->GetCharRect(aEnd, aEndPos, &aTmpState);
1613  if (aStart.Top() != aEnd.Top() || aStart.Bottom() != aEnd.Bottom())
1614  {
1615  aStart.Left(pFrame->getFrameArea().Left());
1616  aEnd.Right(pFrame->getFrameArea().Right());
1617  }
1618  *pFieldRect = aStart.Union(aEnd);
1619  }
1620  }
1621  }
1622  }
1623 
1624  if( !bRet && IsAttrAtPos::Redline & rContentAtPos.eContentAtPos )
1625  {
1626  const SwRangeRedline* pRedl = GetDoc()->getIDocumentRedlineAccess().GetRedline(aPos, nullptr);
1627 
1628  if( pRedl )
1629  {
1630  rContentAtPos.aFnd.pRedl = pRedl;
1631  rContentAtPos.eContentAtPos = IsAttrAtPos::Redline;
1632  rContentAtPos.pFndTextAttr = nullptr;
1633  bRet = true;
1634 
1635  std::pair<Point, bool> tmp(aPt, true);
1636  if (pFieldRect && nullptr != (pFrame = pTextNd->getLayoutFrame(GetLayout(), nullptr, &tmp)))
1637  {
1638  // not sure if this should be limited to one
1639  // paragraph, or mark the entire redline; let's
1640  // leave it limited to one for now...
1641  sal_Int32 nStart;
1642  sal_Int32 nEnd;
1643  pRedl->CalcStartEnd(pTextNd->GetIndex(), nStart, nEnd);
1644  if (nStart == COMPLETE_STRING)
1645  {
1646  // consistency: found pRedl, so there must be
1647  // something in pTextNd
1648  assert(nEnd != COMPLETE_STRING);
1649  nStart = 0;
1650  }
1651  if (nEnd == COMPLETE_STRING)
1652  {
1653  nEnd = pTextNd->Len();
1654  }
1655  //get bounding box of range
1656  SwRect aStart;
1657  pFrame->GetCharRect(aStart, SwPosition(*pTextNd, nStart), &aTmpState);
1658  SwRect aEnd;
1659  pFrame->GetCharRect(aEnd, SwPosition(*pTextNd, nEnd), &aTmpState);
1660  if (aStart.Top() != aEnd.Top() || aStart.Bottom() != aEnd.Bottom())
1661  {
1662  aStart.Left(pFrame->getFrameArea().Left());
1663  aEnd.Right(pFrame->getFrameArea().Right());
1664  }
1665  *pFieldRect = aStart.Union(aEnd);
1666  }
1667  }
1668  }
1669  }
1670 
1671  if( !bRet
1672  && ( IsAttrAtPos::TableBoxFml & rContentAtPos.eContentAtPos
1673 #ifdef DBG_UTIL
1674  || IsAttrAtPos::TableBoxValue & rContentAtPos.eContentAtPos
1675 #endif
1676  ) )
1677  {
1678  const SwTableNode* pTableNd;
1679  const SwTableBox* pBox;
1680  const SwStartNode* pSttNd = pTextNd->FindTableBoxStartNode();
1681  const SfxPoolItem* pItem;
1682  if( pSttNd && nullptr != ( pTableNd = pTextNd->FindTableNode()) &&
1683  nullptr != ( pBox = pTableNd->GetTable().GetTableBox(
1684  pSttNd->GetIndex() )) &&
1685 #ifdef DBG_UTIL
1686  ( SfxItemState::SET == pBox->GetFrameFormat()->GetItemState(
1687  RES_BOXATR_FORMULA, false, &pItem ) ||
1688  SfxItemState::SET == pBox->GetFrameFormat()->GetItemState(
1689  RES_BOXATR_VALUE, false, &pItem ))
1690 #else
1691  SfxItemState::SET == pBox->GetFrameFormat()->GetItemState(
1692  RES_BOXATR_FORMULA, false, &pItem )
1693 #endif
1694  )
1695  {
1696  std::pair<Point, bool> tmp(aPt, true);
1697  SwFrame* pF = pTextNd->getLayoutFrame(GetLayout(), nullptr, &tmp);
1698  if( pF )
1699  {
1700  // then the CellFrame
1701  pFrame = static_cast<SwContentFrame*>(pF);
1702  while( pF && !pF->IsCellFrame() )
1703  pF = pF->GetUpper();
1704  }
1705 
1706  if( aTmpState.m_bPosCorr )
1707  {
1708  if( pF && !pF->getFrameArea().IsInside( aPt ))
1709  pF = nullptr;
1710  }
1711  else if( !pF )
1712  pF = pFrame;
1713 
1714  if( pF ) // only then it is valid
1715  {
1716  // create from internal (for CORE) the external
1717  // (for UI) formula
1718  rContentAtPos.eContentAtPos = IsAttrAtPos::TableBoxFml;
1719 #ifdef DBG_UTIL
1720  if( RES_BOXATR_VALUE == pItem->Which() )
1721  rContentAtPos.eContentAtPos = IsAttrAtPos::TableBoxValue;
1722  else
1723 #endif
1724  const_cast<SwTableBoxFormula*>(static_cast<const SwTableBoxFormula*>(pItem))->PtrToBoxNm( &pTableNd->GetTable() );
1725 
1726  bRet = true;
1727  if( bSetCursor )
1728  {
1729  SwCallLink aLk( *this ); // watch Cursor-Moves
1730  SwCursorSaveState aSaveState( *m_pCurrentCursor );
1731  *m_pCurrentCursor->GetPoint() = aPos;
1734  bRet = false;
1735  else
1736  UpdateCursor();
1737  }
1738 
1739  if( bRet )
1740  {
1741  if( pFieldRect )
1742  {
1743  *pFieldRect = pF->getFramePrintArea();
1744  *pFieldRect += pF->getFrameArea().Pos();
1745  }
1746  rContentAtPos.pFndTextAttr = nullptr;
1747  rContentAtPos.aFnd.pAttr = pItem;
1748  }
1749  }
1750  }
1751  }
1752 
1753 #ifdef DBG_UTIL
1754  if( !bRet && IsAttrAtPos::CurrAttrs & rContentAtPos.eContentAtPos )
1755  {
1756  const sal_Int32 n = aPos.nContent.GetIndex();
1758  POOLATTR_END - 1>{} );
1759  if( pTextNd->GetpSwpHints() )
1760  {
1761  for( size_t i = 0; i < pTextNd->GetSwpHints().Count(); ++i )
1762  {
1763  const SwTextAttr* pHt = pTextNd->GetSwpHints().Get(i);
1764  const sal_Int32 nAttrStart = pHt->GetStart();
1765  if( nAttrStart > n ) // over the section
1766  break;
1767 
1768  if( nullptr != pHt->End() && (
1769  ( nAttrStart < n &&
1770  ( pHt->DontExpand() ? n < *pHt->End()
1771  : n <= *pHt->End() )) ||
1772  ( n == nAttrStart &&
1773  ( nAttrStart == *pHt->End() || !n ))) )
1774  {
1775  aSet.Put( pHt->GetAttr() );
1776  }
1777  }
1778  if( pTextNd->HasSwAttrSet() &&
1779  pTextNd->GetpSwAttrSet()->Count() )
1780  {
1781  SfxItemSet aFormatSet( pTextNd->GetSwAttrSet() );
1782  // remove all from format set that are also in TextSet
1783  aFormatSet.Differentiate( aSet );
1784  // now merge all together
1785  aSet.Put( aFormatSet );
1786  }
1787  }
1788  else
1789  pTextNd->SwContentNode::GetAttr( aSet );
1790 
1791  rContentAtPos.sStr = "Pos: (";
1792  rContentAtPos.sStr += OUString::number( aPos.nNode.GetIndex());
1793  rContentAtPos.sStr += ":";
1794  rContentAtPos.sStr += OUString::number( aPos.nContent.GetIndex());
1795  rContentAtPos.sStr += ")";
1796  rContentAtPos.sStr += "\nParagraph Style: ";
1797  rContentAtPos.sStr += pTextNd->GetFormatColl()->GetName();
1798  if( pTextNd->GetCondFormatColl() )
1799  {
1800  rContentAtPos.sStr += "\nConditional Style: " + pTextNd->GetCondFormatColl()->GetName();
1801  }
1802 
1803  if( aSet.Count() )
1804  {
1805  OUStringBuffer sAttrs;
1806  SfxItemIter aIter( aSet );
1807  const SfxPoolItem* pItem = aIter.FirstItem();
1808  const IntlWrapper aInt(SvtSysLocale().GetUILanguageTag());
1809  while( true )
1810  {
1811  if( !IsInvalidItem( pItem ))
1812  {
1813  OUString aStr;
1814  GetDoc()->GetAttrPool().GetPresentation(*pItem,
1815  MapUnit::MapCM, aStr, aInt);
1816  if (!sAttrs.isEmpty())
1817  sAttrs.append(", ");
1818  sAttrs.append(aStr);
1819  }
1820  if( aIter.IsAtEnd() )
1821  break;
1822  pItem = aIter.NextItem();
1823  }
1824  if (!sAttrs.isEmpty())
1825  {
1826  if( !rContentAtPos.sStr.isEmpty() )
1827  rContentAtPos.sStr += "\n";
1828  rContentAtPos.sStr += "Attr: " + sAttrs.toString();
1829  }
1830  }
1831  bRet = true;
1832  rContentAtPos.eContentAtPos = IsAttrAtPos::CurrAttrs;
1833  }
1834 #endif
1835  }
1836  }
1837 
1838  if( !bRet )
1839  {
1840  rContentAtPos.eContentAtPos = IsAttrAtPos::NONE;
1841  rContentAtPos.aFnd.pField = nullptr;
1842  }
1843  return bRet;
1844 }
1845 
1846 // #i90516#
1848 {
1849  const SwPostItField* pPostItField = nullptr;
1850 
1851  if ( !IsTableMode() )
1852  {
1853  const SwPosition* pCursorPos = GetCursor_()->GetPoint();
1854  const SwTextNode* pTextNd = pCursorPos->nNode.GetNode().GetTextNode();
1855  if ( pTextNd )
1856  {
1857  SwTextAttr* pTextAttr = pTextNd->GetFieldTextAttrAt( pCursorPos->nContent.GetIndex() );
1858  const SwField* pField = pTextAttr != nullptr ? pTextAttr->GetFormatField().GetField() : nullptr;
1859  if ( pField && pField->Which()== SwFieldIds::Postit )
1860  {
1861  pPostItField = static_cast<const SwPostItField*>(pField);
1862  }
1863  }
1864  }
1865 
1866  return pPostItField;
1867 }
1868 
1871 {
1872  const SwTextNode* pNd = nullptr;
1873  if( pFndTextAttr )
1874  {
1875  switch( eContentAtPos )
1876  {
1877  case IsAttrAtPos::Field:
1879  pNd = static_txtattr_cast<SwTextField const*>(pFndTextAttr)->GetpTextNode();
1880  break;
1881 
1882  case IsAttrAtPos::Ftn:
1883  pNd = &static_cast<const SwTextFootnote*>(pFndTextAttr)->GetTextNode();
1884  break;
1885 
1886  case IsAttrAtPos::InetAttr:
1887  pNd = static_txtattr_cast<SwTextINetFormat const*>(pFndTextAttr)->GetpTextNode();
1888  break;
1889 
1890  default:
1891  break;
1892  }
1893  }
1894 
1895  const SwContentFrame* pFrame;
1896  return pNd && ( pNd->IsInProtectSect() ||
1897  (nullptr != (pFrame = pNd->getLayoutFrame(pNd->GetDoc()->getIDocumentLayoutAccess().GetCurrentLayout(), nullptr, nullptr)) &&
1898  pFrame->IsProtected() ));
1899 }
1900 
1902 {
1903  bool bRet = false;
1904  const SwTextNode* pNd = nullptr;
1906  {
1907  const SwTextFootnote* pTextFootnote = static_cast<const SwTextFootnote*>(pFndTextAttr);
1908  if(pTextFootnote->GetStartNode())
1909  {
1910  SwStartNode* pSttNd = pTextFootnote->GetStartNode()->GetNode().GetStartNode();
1911  SwPaM aTemp( *pSttNd );
1912  aTemp.Move(fnMoveForward, GoInNode);
1913  SwContentNode* pContentNode = aTemp.GetContentNode();
1914  if(pContentNode && pContentNode->IsTextNode())
1915  pNd = pContentNode->GetTextNode();
1916  }
1917  }
1918  if(pNd)
1919  {
1921  SwTextFrame* pTmpFrame = aIter.First();
1922  while( pTmpFrame )
1923  {
1924  if ( !pTmpFrame->IsFollow())
1925  {
1926  bRet = pTmpFrame->IsRightToLeft();
1927  break;
1928  }
1929  pTmpFrame = aIter.Next();
1930  }
1931  }
1932  return bRet;
1933 }
1934 
1935 bool SwCursorShell::SelectText( const sal_Int32 nStart,
1936  const sal_Int32 nEnd )
1937 {
1938  SET_CURR_SHELL( this );
1939  bool bRet = false;
1940 
1941  SwCallLink aLk( *this );
1942  SwCursorSaveState aSaveState( *m_pCurrentCursor );
1943 
1944  SwPosition& rPos = *m_pCurrentCursor->GetPoint();
1946  rPos.nContent = nStart;
1948  rPos.nContent = nEnd;
1949 
1950  if( !m_pCurrentCursor->IsSelOvr() )
1951  {
1952  UpdateCursor();
1953  bRet = true;
1954  }
1955 
1956  return bRet;
1957 }
1958 
1959 bool SwCursorShell::SelectTextAttr( sal_uInt16 nWhich,
1960  bool bExpand,
1961  const SwTextAttr* pTextAttr )
1962 {
1963  SET_CURR_SHELL( this );
1964  bool bRet = false;
1965 
1966  if( !IsTableMode() )
1967  {
1968  if( !pTextAttr )
1969  {
1970  SwPosition& rPos = *m_pCurrentCursor->GetPoint();
1971  SwTextNode* pTextNd = rPos.nNode.GetNode().GetTextNode();
1972  pTextAttr = pTextNd
1973  ? pTextNd->GetTextAttrAt(rPos.nContent.GetIndex(),
1974  nWhich,
1976  : nullptr;
1977  }
1978 
1979  if( pTextAttr )
1980  {
1981  const sal_Int32* pEnd = pTextAttr->End();
1982  bRet = SelectText( pTextAttr->GetStart(), ( pEnd ? *pEnd : pTextAttr->GetStart() + 1 ) );
1983  }
1984  }
1985  return bRet;
1986 }
1987 
1989 {
1990  bool bRet = false;
1991  if( rAttr.GetpTextNode() )
1992  {
1993  SwCursor* pCursor = getShellCursor( true );
1994 
1995  SET_CURR_SHELL( this );
1996  SwCallLink aLk( *this ); // watch Cursor-Moves
1997  SwCursorSaveState aSaveState( *pCursor );
1998 
1999  pCursor->GetPoint()->nNode = *rAttr.GetpTextNode();
2000  pCursor->GetPoint()->nContent.Assign( const_cast<SwTextNode*>(rAttr.GetpTextNode()),
2001  rAttr.GetStart() );
2002  bRet = !pCursor->IsSelOvr();
2003  if( bRet )
2005  }
2006  return bRet;
2007 }
2008 
2009 const SwFormatINetFormat* SwCursorShell::FindINetAttr( const OUString& rName ) const
2010 {
2011  return mxDoc->FindINetAttr( rName );
2012 }
2013 
2015  SwRect& rRect, sal_Int16& rOrient )
2016 {
2017 
2018  SET_CURR_SHELL( this );
2019  bool bRet = false;
2020 
2021  if (!IsTableMode() && !HasSelection()
2022  && GetDoc()->GetIDocumentUndoRedo().DoesUndo())
2023  {
2024  Point aPt( rPt );
2025  SwPosition aPos( *m_pCurrentCursor->GetPoint() );
2026 
2027  SwFillCursorPos aFPos( eFillMode );
2028  SwCursorMoveState aTmpState( &aFPos );
2029 
2030  if( GetLayout()->GetCursorOfst( &aPos, aPt, &aTmpState ) &&
2031  !aPos.nNode.GetNode().IsProtect())
2032  {
2033  // start position in protected section?
2034  rRect = aFPos.aCursor;
2035  rOrient = aFPos.eOrient;
2036  bRet = true;
2037  }
2038  }
2039  return bRet;
2040 }
2041 
2043 {
2044  SET_CURR_SHELL( this );
2045  bool bRet = false;
2046 
2047  if (!IsTableMode() && !HasSelection()
2048  && GetDoc()->GetIDocumentUndoRedo().DoesUndo())
2049  {
2050  Point aPt( rPt );
2051  SwPosition aPos( *m_pCurrentCursor->GetPoint() );
2052 
2053  SwFillCursorPos aFPos( eFillMode );
2054  SwCursorMoveState aTmpState( &aFPos );
2055 
2056  if( GetLayout()->GetCursorOfst( &aPos, aPt, &aTmpState ) )
2057  {
2058  SwCallLink aLk( *this ); // watch Cursor-Moves
2059  StartAction();
2060 
2061  SwContentNode* pCNd = aPos.nNode.GetNode().GetContentNode();
2063  // If only the paragraph attributes "Adjust" or "LRSpace" are set,
2064  // then the following should not delete those again.
2065  if( 0 == aFPos.nParaCnt + aFPos.nColumnCnt &&
2066  ( FILL_INDENT == aFPos.eMode ||
2067  ( text::HoriOrientation::NONE != aFPos.eOrient &&
2068  0 == aFPos.nTabCnt + aFPos.nSpaceCnt )) &&
2069  pCNd && pCNd->Len() )
2070  nUndoId = SwUndoId::EMPTY;
2071 
2072  GetDoc()->GetIDocumentUndoRedo().StartUndo( nUndoId, nullptr );
2073 
2074  SwTextFormatColl* pNextFormat = nullptr;
2075  SwTextNode* pTNd = pCNd ? pCNd->GetTextNode() : nullptr;
2076  if( pTNd )
2077  pNextFormat = &pTNd->GetTextColl()->GetNextTextFormatColl();
2078 
2079  const SwSectionNode* pSectNd = pCNd ? pCNd->FindSectionNode() : nullptr;
2080  if( pSectNd && aFPos.nParaCnt )
2081  {
2082  SwNodeIndex aEnd( aPos.nNode, 1 );
2083  while( aEnd.GetNode().IsEndNode() &&
2084  &aEnd.GetNode() !=
2085  pSectNd->EndOfSectionNode() )
2086  ++aEnd;
2087 
2088  if( aEnd.GetNode().IsEndNode() &&
2089  pCNd->Len() == aPos.nContent.GetIndex() )
2090  aPos.nNode = *pSectNd->EndOfSectionNode();
2091  }
2092 
2093  for( sal_uInt16 n = 0; n < aFPos.nParaCnt + aFPos.nColumnCnt; ++n )
2094  {
2096  if( !n && pNextFormat )
2097  {
2098  *m_pCurrentCursor->GetPoint() = aPos;
2099  GetDoc()->SetTextFormatColl( *m_pCurrentCursor, pNextFormat, false );
2100  }
2101  if( n < aFPos.nColumnCnt )
2102  {
2103  *m_pCurrentCursor->GetPoint() = aPos;
2105  SvxFormatBreakItem( SvxBreak::ColumnBefore, RES_BREAK ) );
2106  }
2107  }
2108 
2109  *m_pCurrentCursor->GetPoint() = aPos;
2110  switch( aFPos.eMode )
2111  {
2112  case FILL_INDENT:
2113  if( nullptr != (pCNd = aPos.nNode.GetNode().GetContentNode() ))
2114  {
2115  SfxItemSet aSet(
2116  GetDoc()->GetAttrPool(),
2117  svl::Items<
2120  SvxLRSpaceItem aLR( static_cast<const SvxLRSpaceItem&>(
2121  pCNd->GetAttr( RES_LR_SPACE ) ) );
2122  aLR.SetTextLeft( aFPos.nTabCnt );
2123  aLR.SetTextFirstLineOfst( 0 );
2124  aSet.Put( aLR );
2125 
2126  const SvxAdjustItem& rAdj = static_cast<const SvxAdjustItem&>(pCNd->
2127  GetAttr( RES_PARATR_ADJUST ));
2128  if( SvxAdjust::Left != rAdj.GetAdjust() )
2129  aSet.Put( SvxAdjustItem( SvxAdjust::Left, RES_PARATR_ADJUST ) );
2130 
2132  }
2133  else {
2134  OSL_ENSURE( false, "No ContentNode" );
2135  }
2136  break;
2137 
2138  case FILL_TAB:
2139  case FILL_TAB_SPACE:
2140  case FILL_SPACE:
2141  {
2142  OUStringBuffer sInsert;
2143  if (aFPos.eMode == FILL_SPACE)
2144  {
2145  comphelper::string::padToLength(sInsert, sInsert.getLength() + aFPos.nSpaceOnlyCnt, ' ');
2146  }
2147  else
2148  {
2149  if (aFPos.nTabCnt)
2150  comphelper::string::padToLength(sInsert, aFPos.nTabCnt, '\t');
2151  if (aFPos.nSpaceCnt)
2152  comphelper::string::padToLength(sInsert, sInsert.getLength() + aFPos.nSpaceCnt, ' ');
2153  }
2154  if (!sInsert.isEmpty())
2155  GetDoc()->getIDocumentContentOperations().InsertString( *m_pCurrentCursor, sInsert.makeStringAndClear());
2156  }
2157  [[fallthrough]]; // still need to set orientation
2158  case FILL_MARGIN:
2159  if( text::HoriOrientation::NONE != aFPos.eOrient )
2160  {
2161  SvxAdjustItem aAdj( SvxAdjust::Left, RES_PARATR_ADJUST );
2162  switch( aFPos.eOrient )
2163  {
2164  case text::HoriOrientation::CENTER:
2165  aAdj.SetAdjust( SvxAdjust::Center );
2166  break;
2168  aAdj.SetAdjust( SvxAdjust::Right );
2169  break;
2170  default:
2171  break;
2172  }
2174  }
2175  break;
2176  }
2177 
2178  GetDoc()->GetIDocumentUndoRedo().EndUndo( nUndoId, nullptr );
2179  EndAction();
2180 
2181  bRet = true;
2182  }
2183  }
2184  return bRet;
2185 }
2186 
2188 {
2189  const SwRangeRedline* pFnd = nullptr;
2190  if( !IsTableMode() )
2191  {
2192  SET_CURR_SHELL( this );
2193  SwCallLink aLk( *this ); // watch Cursor-Moves
2194  SwCursorSaveState aSaveState( *m_pCurrentCursor );
2195 
2196  // ensure point is at the end so alternating SelNext/SelPrev works
2197  NormalizePam(false);
2201  else
2202  pFnd = nullptr;
2203  }
2204  return pFnd;
2205 }
2206 
2208 {
2209  const SwRangeRedline* pFnd = nullptr;
2210  if( !IsTableMode() )
2211  {
2212  SET_CURR_SHELL( this );
2213  SwCallLink aLk( *this ); // watch Cursor-Moves
2214  SwCursorSaveState aSaveState( *m_pCurrentCursor );
2215 
2216  // ensure point is at the start so alternating SelNext/SelPrev works
2217  NormalizePam(true);
2221  else
2222  pFnd = nullptr;
2223  }
2224  return pFnd;
2225 }
2226 
2228 {
2229  const SwRangeRedline* pFnd = nullptr;
2230  SwCallLink aLk( *this ); // watch Cursor-Moves
2231  SwCursorSaveState aSaveState( *m_pCurrentCursor );
2232 
2233  pFnd = GetDoc()->getIDocumentRedlineAccess().GetRedlineTable()[ nArrPos ];
2234  if( pFnd )
2235  {
2236  *m_pCurrentCursor->GetPoint() = *pFnd->Start();
2237 
2238  SwContentNode* pCNd;
2240  if( !pIdx->GetNode().IsContentNode() &&
2241  nullptr != ( pCNd = GetDoc()->GetNodes().GoNextSection( pIdx,
2242  true, IsReadOnlyAvailable() )) )
2243  {
2244  if( *pIdx <= pFnd->End()->nNode )
2245  m_pCurrentCursor->GetPoint()->nContent.Assign( pCNd, 0 );
2246  else
2247  pFnd = nullptr;
2248  }
2249 
2250  if( pFnd && bSelect )
2251  {
2253  if( RedlineType::FmtColl == pFnd->GetType() )
2254  {
2255  pCNd = pIdx->GetNode().GetContentNode();
2256  m_pCurrentCursor->GetPoint()->nContent.Assign( pCNd, pCNd->Len() );
2257  m_pCurrentCursor->GetMark()->nContent.Assign( pCNd, 0 );
2258  }
2259  else
2260  *m_pCurrentCursor->GetPoint() = *pFnd->End();
2261 
2262  pIdx = &m_pCurrentCursor->GetPoint()->nNode;
2263  if( !pIdx->GetNode().IsContentNode() &&
2264  nullptr != ( pCNd = SwNodes::GoPrevSection( pIdx,
2265  true, IsReadOnlyAvailable() )) )
2266  {
2267  if( *pIdx >= m_pCurrentCursor->GetMark()->nNode )
2268  m_pCurrentCursor->GetPoint()->nContent.Assign( pCNd, pCNd->Len() );
2269  else
2270  pFnd = nullptr;
2271  }
2272  }
2273 
2274  if( !pFnd )
2275  {
2278  }
2279  else if( bSelect && *m_pCurrentCursor->GetMark() == *m_pCurrentCursor->GetPoint() )
2281 
2285  else
2286  {
2287  pFnd = nullptr;
2288  if( bSelect )
2290  }
2291  }
2292  return pFnd;
2293 }
2294 
2296 {
2297  const SwRangeRedline* pFnd = nullptr;
2298  if( !IsTableMode() )
2299  {
2300  SET_CURR_SHELL( this );
2301 
2303  const SwRangeRedline* pTmp = rTable[ nArrPos ];
2304  sal_uInt16 nSeqNo = pTmp->GetSeqNo();
2305  if( nSeqNo && bSelect )
2306  {
2307  bool bCheck = false;
2308  int nLoopCnt = 2;
2309  SwRedlineTable::size_type nArrSavPos = nArrPos;
2310 
2311  do {
2312  pTmp = GotoRedline_( nArrPos, true );
2313 
2314  if( !pFnd )
2315  pFnd = pTmp;
2316 
2317  if( pTmp && bCheck )
2318  {
2319  // Check for overlaps. These can happen when FormatColl-
2320  // Redlines were stretched over a whole paragraph
2321  SwPaM* pCur = m_pCurrentCursor;
2322  SwPaM* pNextPam = pCur->GetNext();
2323  SwPosition* pCStt = pCur->Start(), *pCEnd = pCur->End();
2324  while( pCur != pNextPam )
2325  {
2326  const SwPosition *pNStt = pNextPam->Start(),
2327  *pNEnd = pNextPam->End();
2328 
2329  bool bDel = true;
2330  switch( ::ComparePosition( *pCStt, *pCEnd,
2331  *pNStt, *pNEnd ))
2332  {
2333  case SwComparePosition::Inside: // Pos1 is completely in Pos2
2334  if( !pCur->HasMark() )
2335  {
2336  pCur->SetMark();
2337  *pCur->GetMark() = *pNStt;
2338  }
2339  else
2340  *pCStt = *pNStt;
2341  *pCEnd = *pNEnd;
2342  break;
2343 
2344  case SwComparePosition::Outside: // Pos2 is completely in Pos1
2345  case SwComparePosition::Equal: // Pos1 has same size as Pos2
2346  break;
2347 
2348  case SwComparePosition::OverlapBefore: // Pos1 overlaps Pos2 at beginning
2349  if( !pCur->HasMark() )
2350  pCur->SetMark();
2351  *pCEnd = *pNEnd;
2352  break;
2353  case SwComparePosition::OverlapBehind: // Pos1 overlaps Pos2 at end
2354  if( !pCur->HasMark() )
2355  {
2356  pCur->SetMark();
2357  *pCur->GetMark() = *pNStt;
2358  }
2359  else
2360  *pCStt = *pNStt;
2361  break;
2362 
2363  default:
2364  bDel = false;
2365  }
2366 
2367  if( bDel )
2368  {
2369  // not needed anymore
2370  SwPaM* pPrevPam = pNextPam->GetPrev();
2371  delete pNextPam;
2372  pNextPam = pPrevPam;
2373  }
2374  pNextPam = pNextPam->GetNext();
2375  }
2376  }
2377 
2378  SwRedlineTable::size_type nFndPos = 2 == nLoopCnt
2379  ? rTable.FindNextOfSeqNo( nArrPos )
2380  : rTable.FindPrevOfSeqNo( nArrPos );
2381  if( SwRedlineTable::npos != nFndPos ||
2382  ( 0 != ( --nLoopCnt ) && SwRedlineTable::npos != (
2383  nFndPos = rTable.FindPrevOfSeqNo( nArrSavPos ))) )
2384  {
2385  if( pTmp )
2386  {
2387  // create new cursor
2388  CreateCursor();
2389  bCheck = true;
2390  }
2391  nArrPos = nFndPos;
2392  }
2393  else
2394  nLoopCnt = 0;
2395 
2396  } while( nLoopCnt );
2397  }
2398  else
2399  pFnd = GotoRedline_( nArrPos, bSelect );
2400  }
2401  return pFnd;
2402 }
2403 
2405 {
2406  SwNodes& rNds = GetDoc()->GetNodes();
2407  const SwNode* pBodyEndNd = &rNds.GetEndOfContent();
2408  const SwNode* pBodySttNd = pBodyEndNd->StartOfSectionNode();
2409  sal_uLong nBodySttNdIdx = pBodySttNd->GetIndex();
2410  Point aPt;
2411 
2412  SetGetExpField aCmpPos( SwPosition( bNext ? *pBodyEndNd : *pBodySttNd ) );
2413  SetGetExpField aCurPos( bNext ? *m_pCurrentCursor->End() : *m_pCurrentCursor->Start() );
2414  if( aCurPos.GetNode() < nBodySttNdIdx )
2415  {
2416  const SwContentNode* pCNd = aCurPos.GetNodeFromContent()->GetContentNode();
2417  SwContentFrame* pFrame;
2418  std::pair<Point, bool> tmp(aPt, true);
2419  if (pCNd && nullptr != (pFrame = pCNd->getLayoutFrame(GetLayout(), nullptr, &tmp)))
2420  aCurPos.SetBodyPos( *pFrame );
2421  }
2422 
2423  // check first all the hyperlink fields
2424  {
2425  const SwTextNode* pTextNd;
2426  const SwCharFormats* pFormats = GetDoc()->GetCharFormats();
2427  for( SwCharFormats::size_type n = pFormats->size(); 1 < n; )
2428  {
2429  SwIterator<SwTextINetFormat,SwCharFormat> aIter(*(*pFormats)[--n]);
2430 
2431  for( SwTextINetFormat* pFnd = aIter.First(); pFnd; pFnd = aIter.Next() )
2432  if( nullptr != ( pTextNd = pFnd->GetpTextNode()) &&
2433  pTextNd->GetNodes().IsDocNodes() )
2434  {
2435  SwTextINetFormat& rAttr = *pFnd;
2436  SwPosition aTmpPos( *pTextNd );
2437  SetGetExpField aPos( aTmpPos.nNode, rAttr );
2438  SwContentFrame* pFrame;
2439  if (pTextNd->GetIndex() < nBodySttNdIdx)
2440  {
2441  std::pair<Point, bool> tmp(aPt, true);
2442  pFrame = pTextNd->getLayoutFrame(GetLayout(), nullptr, &tmp);
2443  if (pFrame)
2444  {
2445  aPos.SetBodyPos( *pFrame );
2446  }
2447  }
2448 
2449  if( bNext
2450  ? ( aPos < aCmpPos && aCurPos < aPos )
2451  : ( aCmpPos < aPos && aPos < aCurPos ))
2452  {
2453  OUString sText(pTextNd->GetExpandText(GetLayout(),
2454  rAttr.GetStart(),
2455  *rAttr.GetEnd() - rAttr.GetStart() ) );
2456 
2457  sText = sText.replaceAll(OUStringLiteral1(0x0a), "");
2458  sText = comphelper::string::strip(sText, ' ');
2459 
2460  if( !sText.isEmpty() )
2461  aCmpPos = aPos;
2462  }
2463  }
2464  }
2465  }
2466 
2467  // then check all the Flys with a URL or image map
2468  {
2469  const SwFrameFormats* pFormats = GetDoc()->GetSpzFrameFormats();
2470  for( SwFrameFormats::size_type n = 0, nEnd = pFormats->size(); n < nEnd; ++n )
2471  {
2472  SwFlyFrameFormat* pFormat = static_cast<SwFlyFrameFormat*>((*pFormats)[ n ]);
2473  const SwFormatURL& rURLItem = pFormat->GetURL();
2474  if( rURLItem.GetMap() || !rURLItem.GetURL().isEmpty() )
2475  {
2476  SwFlyFrame* pFly = pFormat->GetFrame( &aPt );
2477  SwPosition aTmpPos( *pBodySttNd );
2478  if( pFly &&
2479  GetBodyTextNode( *GetDoc(), aTmpPos, *pFly->GetLower() ) )
2480  {
2481  SetGetExpField aPos( *pFormat, &aTmpPos );
2482 
2483  if( bNext
2484  ? ( aPos < aCmpPos && aCurPos < aPos )
2485  : ( aCmpPos < aPos && aPos < aCurPos ))
2486  aCmpPos = aPos;
2487  }
2488  }
2489  }
2490  }
2491 
2492  // found any URL ?
2493  bool bRet = false;
2494  const SwTextINetFormat* pFndAttr = aCmpPos.GetINetFormat();
2495  const SwFlyFrameFormat* pFndFormat = aCmpPos.GetFlyFormat();
2496  if( pFndAttr || pFndFormat )
2497  {
2498  SET_CURR_SHELL( this );
2499  SwCallLink aLk( *this );
2500 
2501  // found a text attribute ?
2502  if( pFndAttr )
2503  {
2504  SwCursorSaveState aSaveState( *m_pCurrentCursor );
2505 
2506  aCmpPos.GetPosOfContent( *m_pCurrentCursor->GetPoint() );
2509  m_pCurrentCursor->GetPoint()->nContent = *pFndAttr->End();
2510 
2512  {
2515  bRet = true;
2516  }
2517  }
2518  // found a draw object ?
2519  else if( RES_DRAWFRMFMT == pFndFormat->Which() )
2520  {
2521  const SdrObject* pSObj = pFndFormat->FindSdrObject();
2522  if (pSObj)
2523  {
2524  static_cast<SwFEShell*>(this)->SelectObj( pSObj->GetCurrentBoundRect().Center() );
2525  MakeSelVisible();
2526  bRet = true;
2527  }
2528  }
2529  else // then is it a fly
2530  {
2531  SwFlyFrame* pFly = pFndFormat->GetFrame(&aPt);
2532  if( pFly )
2533  {
2534  static_cast<SwFEShell*>(this)->SelectFlyFrame( *pFly );
2535  MakeSelVisible();
2536  bRet = true;
2537  }
2538  }
2539  }
2540  return bRet;
2541 }
2542 
2543 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
virtual bool GetCursorOfst(SwPosition *, Point &, SwCursorMoveState *=nullptr, bool bTestBackground=false) const override
Primary passes the call to the first page.
Definition: trvlfrm.cxx:420
vcl::RenderContext * GetOut() const
Definition: viewsh.hxx:341
SwSectionNode * FindSectionNode()
Search section node, in which it is.
Definition: ndsect.cxx:960
Instances of SwFields and those derived from it occur 0 to n times.
Definition: fldbas.hxx:233
long Width() const
const SwEndNode * EndOfSectionNode() const
Definition: node.hxx:682
Starts a section of nodes in the document model.
Definition: node.hxx:303
bool IsInRTLText() const
Definition: crstrvl.cxx:1901
Base class of the Writer layout elements.
Definition: frame.hxx:295
Represents the visualization of a paragraph.
Definition: txtfrm.hxx:149
virtual sal_Int32 Len() const
Definition: node.cxx:1181
void DeleteMark()
Definition: pam.hxx:177
bool ContainsPageDesc(const SwPageDesc *pDesc, size_t *pPos) const
Definition: docdesc.cxx:834
void KillPams()
Definition: crsrsh.cxx:1009
const_iterator lower_bound(const Value &x) const
sal_uLong GetIndex() const
Definition: node.hxx:282
virtual const SwRangeRedline * SelPrevRedline(SwPaM &rPam) const =0
bool m_bFieldInfo
should be fields recognized?
Definition: crstate.hxx:142
SAL_DLLPRIVATE void UpdateCursor(sal_uInt16 eFlags=SwCursorShell::SCROLLWIN|SwCursorShell::CHKRANGE, bool bIdleEnd=false)
Definition: crsrsh.cxx:1551
SwNode & GetNode(bool bPoint=true) const
Definition: pam.hxx:223
static SwField * GetFieldAtCursor(const SwPaM *pCursor, const bool bIncludeInputFieldAtStart)
Definition: crstrvl.cxx:917
SwShellCursor * m_pCurrentCursor
current cursor
Definition: crsrsh.hxx:179
bool IsFollow() const
Definition: flowfrm.hxx:166
sal_uInt16 GetSeqNo() const
Definition: redline.hxx:222
Represents the style of a paragraph.
Definition: fmtcol.hxx:55
virtual bool GetPresentation(const SfxPoolItem &rItem, MapUnit ePresentationMetric, OUString &rText, const IntlWrapper &rIntlWrapper) const
Marks a position in the document model.
Definition: pam.hxx:35
virtual const tools::Rectangle & GetCurrentBoundRect() const
sal_Int32 nCharOfst
Definition: crstate.hxx:110
const SwNodes & GetNodes() const
Definition: viewsh.cxx:2089
bool IsInProtectTable(bool bMove=false, bool bChgCursor=true)
Definition: swcrsr.cxx:545
const SwField * GetField() const
Definition: fmtfld.hxx:71
bool IsMultiSelection() const
Definition: pam.hxx:272
const SwPageFrame * GetPageAtPos(const Point &rPt, const Size *pSize=nullptr, bool bExtend=false) const
Point rPt: The point that should be used to find the page Size pSize: If given, we return the (first)...
Definition: findfrm.cxx:572
SwRect & Union(const SwRect &rRect)
Definition: swrect.cxx:39
SwPaM * GetCursor(bool bMakeTableCursor=true) const
Return pointer to the current shell cursor.
Definition: crsrsh.cxx:184
const SwTableBox * GetTableBox(const OUString &rName, const bool bPerformValidCheck=false) const
Definition: swtable.cxx:1344
SvxAdjust GetAdjust() const
SwComparePosition ComparePosition(const T &rStt1, const T &rEnd1, const T &rStt2, const T &rEnd2)
Definition: pam.hxx:77
by left paragraph indention
Definition: crstate.hxx:34
virtual const SwRootFrame * GetCurrentLayout() const =0
const SwFormatHeader & GetHeader(bool=true) const
Definition: fmthdft.hxx:97
SwUndoId
Definition: swundo.hxx:29
fill with spaces and tabs
Definition: crstate.hxx:31
const SwRangeRedline * SelNextRedline()
Definition: crstrvl.cxx:2187
check overlapping PaMs
Definition: crsrsh.hxx:158
SwNodeIndex nNode
Definition: pam.hxx:37
bool IsTableMode() const
Definition: crsrsh.hxx:646
keep Up/Down on columns
Definition: crsrsh.hxx:156
bool MoveFieldType(const SwFieldType *pFieldType, const bool bNext, const SwFieldIds nResType=SwFieldIds::Unknown, const bool bAddSetExpressionFieldsToInputFields=true)
Definition: crstrvl.cxx:714
virtual void InsertItemSet(const SwPaM &rRg, const SfxItemSet &, const SetAttrMode nFlags=SetAttrMode::DEFAULT, SwRootFrame const *pLayout=nullptr)=0
SwShellCursor * getShellCursor(bool bBlock)
Delivers the current shell cursor.
Definition: crsrsh.cxx:2999
const SwTextNode * GetBodyTextNode(const SwDoc &rDoc, SwPosition &rPos, const SwFrame &rFrame)
Forward declaration: get "BodyTextNode" for exp.fld in Fly's headers/footers/footnotes.
Definition: expfld.cxx:166
virtual const sal_Int32 * GetEnd() const
end position
Definition: txatbase.cxx:49
sal_uIntPtr sal_uLong
std::vector< SwTOXMark * > SwTOXMarks
Definition: tox.hxx:44
size_type FindPrevOfSeqNo(size_type nSttPos) const
Definition: docredln.cxx:650
bool MakeOutlineSel(SwOutlineNodes::size_type nSttPos, SwOutlineNodes::size_type nEndPos, bool bWithChildren)
Definition: crstrvl.cxx:1180
const SwRect & getFramePrintArea() const
Definition: frame.hxx:176
Pos1 is as large as Pos2.
const SfxPoolItem * pAttr
Definition: crsrsh.hxx:100
const SwPosition * GetMark() const
Definition: pam.hxx:209
Base class of all fields.
Definition: fldbas.hxx:279
const SwRangeRedline * GotoRedline(SwRedlineTable::size_type nArrPos, bool bSelect)
Definition: crstrvl.cxx:2295
Pos1 completely contained in Pos2.
SwContentFrame * getLayoutFrame(const SwRootFrame *, const SwPosition *pPos=nullptr, std::pair< Point, bool > const *pViewPosAndCalcFrame=nullptr) const
Definition: node.cxx:1148
virtual SwUndoId EndUndo(SwUndoId const eUndoId, SwRewriter const *const pRewriter)=0
Closes undo block.
Provides access to the marks of a document.
virtual void SetMark() override
Unless this is called, the getter method of Mark will return Point.
Definition: viscrs.cxx:567
virtual bool IsSelOvr(SwCursorSelOverFlags eFlags=SwCursorSelOverFlags::CheckNodeSection|SwCursorSelOverFlags::Toggle|SwCursorSelOverFlags::ChangePos)
Definition: swcrsr.cxx:216
Definition: doc.hxx:185
static SwContentNode * GoPrevSection(SwNodeIndex *, bool bSkipHidden=true, bool bSkipProtect=true)
Definition: nodes.cxx:1975
TElementType * Next()
Definition: calbck.hxx:376
static SwContentNode * GetContentNode(SwDoc *pDoc, SwNodeIndex &rIdx, bool bNext)
Definition: fltshell.cxx:80
bool m_bSetInReadOnly
ReadOnly areas may be entered.
Definition: crstate.hxx:148
virtual void MakeSelVisible()
show the current selected "object"
Definition: crsrsh.cxx:3035
sal_uInt16 sal_Char sal_Char * pDesc
bool m_bExactOnly
let GetCursorOfst look for exact matches only, i.e.
Definition: crstate.hxx:145
SwNode & GetNode() const
Definition: ndindex.hxx:118
bool GotoFootnoteAnchor()
jump from footnote to anchor
Definition: trvlfnfl.cxx:156
bool IsAtEnd() const
Content, content of frame (header, footer, fly).
Definition: fmtcntnt.hxx:31
SwSectionFormat * GetFormat()
Definition: section.hxx:337
void Pos(const Point &rNew)
Definition: swrect.hxx:167
IDocumentMarkAccess * getIDocumentMarkAccess()
Definition: docbm.cxx:1552
IDocumentUndoRedo & GetIDocumentUndoRedo()
Definition: doc.cxx:176
virtual void Calc(vcl::RenderContext *pRenderContext) const
Definition: trvlfrm.cxx:1788
bool IsCellFrame() const
Definition: frame.hxx:1202
Of course Writer needs its own rectangles.
Definition: swrect.hxx:34
sal_uInt16 Which() const
Definition: txatbase.hxx:110
virtual const sal_Int32 * GetEnd() const override
end position
Definition: txatbase.cxx:78
SwTextAttr * GetTextAttrAt(sal_Int32 const nIndex, sal_uInt16 const nWhich, enum GetTextAttrMode const eMode=DEFAULT) const
get the innermost text attribute covering position nIndex.
Definition: ndtxt.cxx:1727
bool GotoNxtPrvTableFormula(bool bNext=true, bool bOnlyErrors=false)
Jump to next/previous table formula Optionally it is possible to also jump to broken formulas...
Definition: crstrvl.cxx:416
bool GotoHeaderText()
jump from the content to the header
Definition: crstrvl.cxx:127
IDocumentContentOperations const & getIDocumentContentOperations() const
Definition: doc.cxx:347
bool HasWriterListeners() const
Definition: calbck.hxx:211
void CalcStartEnd(sal_uLong nNdIdx, sal_Int32 &rStart, sal_Int32 &rEnd) const
Calculates the intersection with text node number nNdIdx.
Definition: docredln.cxx:1275
The root element of a Writer document layout.
Definition: rootfrm.hxx:79
const SfxPoolItem * FirstItem()
const SwFrameFormats * GetSpzFrameFormats() const
Definition: doc.hxx:737
int GetAttrOutlineLevel() const
Returns outline level of this text node.
Definition: ndtxt.cxx:4031
bool HasSelection() const
Does the current cursor create a selection?
Definition: crsrsh.cxx:2486
long GetUpDownX() const
Definition: crsrsh.hxx:350
Array of Undo-history.
Definition: docary.hxx:299
SwContentNode * GetContentNode(bool bPoint=true) const
Definition: pam.hxx:229
sal_uInt32 GetItemCount2(sal_uInt16 nWhich) const
#define POOLATTR_END
Definition: hintids.hxx:64
const OUString & GetValue() const
Definition: fmtinfmt.hxx:75
SwWrongList * SubList(sal_uInt16 nIdx) const
Definition: wrong.hxx:346
static SwTextNode * FindAnchor(SwDoc *pDoc, const OUString &rRefMark, sal_uInt16 nSubType, sal_uInt16 nSeqNo, sal_Int32 *pStt, sal_Int32 *pEnd=nullptr, SwRootFrame const *pLayout=nullptr)
Definition: reffld.cxx:1135
void Top(const long nTop)
Definition: swrect.hxx:202
const SwTOXMark & GetTOXMark() const
Definition: txatbase.hxx:212
rtl::Reference< SwDoc > mxDoc
The document; never 0.
Definition: viewsh.hxx:174
SwIndex nContent
Definition: pam.hxx:38
const SwRect & getFrameArea() const
Definition: frame.hxx:175
void NormalizePam(bool bPointFirst=true)
Ensure point and mark of the current PaM are in a specific order.
Definition: crsrsh.cxx:957
const SwTextField * GetTextField() const
Definition: fmtfld.hxx:89
SwSectionNode * GetSectionNode()
Definition: section.cxx:1007
bool SetTextFormatColl(const SwPaM &rRg, SwTextFormatColl *pFormat, const bool bReset=true, const bool bResetListAttrs=false, SwRootFrame const *pLayout=nullptr)
Add 4th optional parameter .
Definition: docfmt.cxx:1096
virtual ::sw::mark::IFieldmark * getFieldmarkFor(const SwPosition &pos) const =0
SwTOXSearch
Definition: toxe.hxx:22
int m_nInNumPortionOffset
distance from number portion's start
Definition: crstate.hxx:164
SwField * GetCurField(const bool bIncludeInputFieldAtStart=false) const
Definition: crstrvl.cxx:927
Footer, for pageformats Client of FrameFormat describing the footer.
Definition: fmthdft.hxx:64
default, fill with tabs
Definition: crstate.hxx:30
bool GotoPrevTOXBase(const OUString *=nullptr)
jump to previous index
Definition: crstrvl.cxx:314
sal_uLong GetIndex() const
Definition: ndindex.hxx:151
bool IsTextFrame() const
Definition: frame.hxx:1210
sal_Int32 GetStart() const
Definition: txatbase.hxx:82
const sal_uInt8 MAXLEVEL
Definition: swtypes.hxx:95
IsAttrAtPos eContentAtPos
Definition: crsrsh.hxx:105
Pos2 completely contained in Pos1.
only for debugging
OUString sStr
Definition: crsrsh.hxx:107
const SwTable & GetTable() const
Definition: node.hxx:497
SwFillMode
Definition: crstate.hxx:28
SwDoc * GetDoc() const
Definition: viewsh.hxx:284
const SwFormatField & GetFormatField() const
Definition: txatbase.hxx:191
static void lcl_MakeFieldLst(SetGetExpFields &rLst, const SwFieldType &rFieldType, const bool bInReadOnly, const bool bChkInpFlag=false)
jump to next/previous field type
Definition: crstrvl.cxx:648
void Right(const long nRight)
Definition: swrect.hxx:198
OString strip(const OString &rIn, sal_Char c)
bool SelectNxtPrvHyperlink(bool bNext)
Definition: crstrvl.cxx:2404
const IDocumentRedlineAccess & getIDocumentRedlineAccess() const
Provides access to the document redline interface.
Definition: viewsh.cxx:2595
size_type size() const
void SetBodyPos(const SwContentFrame &rFrame)
Definition: docfld.cxx:187
SwPaM * GetNext()
Definition: pam.hxx:264
void PtrToBoxNm(const SwTable *pTable)
create from the internal formula (for CORE) the external formula (for UI)
Definition: cellfml.cxx:542
virtual bool GetCharRect(SwRect &, const SwPosition &, SwCursorMoveState *=nullptr, bool bAllowFarAway=true) const
Definition: unusedf.cxx:71
Specific frame formats (frames, DrawObjects).
Definition: docary.hxx:201
const sw::mark::IFieldmark * pFieldmark
Definition: crsrsh.hxx:103
SwNode & GetEndOfContent() const
Regular ContentSection (i.e. the BodyText).
Definition: ndarr.hxx:164
SwOutlineNodes::size_type GetOutlinePos(sal_uInt8 nLevel=UCHAR_MAX)
search "outline position" before previous outline node at given level
Definition: crstrvl.cxx:1157
long getY() const
bool HasClickHdl() const
Does the field possess an action on its ClickHandler? (e.g. INetFields, ...).
Definition: fldbas.cxx:348
SwShellCursor * GetCursor_()
Definition: crsrsh.hxx:331
#define POOLATTR_BEGIN
Definition: hintids.hxx:63
bool SelectText(const sal_Int32 nStart, const sal_Int32 nEnd)
Definition: crstrvl.cxx:1935
long getX() const
const OUString & GetAlternativeText() const
Definition: tox.hxx:533
bool IsContentNode() const
Definition: node.hxx:628
PaM is Point and Mark: a selection of the document model.
Definition: pam.hxx:136
bool Move(SwMoveFnCollection const &fnMove=fnMoveForward, SwGoInDoc fnGo=GoInContent)
Movement of cursor.
Definition: pam.cxx:481
const SfxItemPool & GetAttrPool() const
Definition: viewsh.hxx:614
virtual bool InsertString(const SwPaM &rRg, const OUString &, const SwInsertFlags nInsertMode=SwInsertFlags::EMPTYEXPAND)=0
Insert string into existing text node at position rRg.Point().
static SwNodePtr GetStartNode(SwOutlineNodes const *pOutlNds, int nOutlineLevel, SwOutlineNodes::size_type *nOutl)
Definition: docglbl.cxx:90
const SwTableNode * IsCursorInTable() const
Definition: crsrsh.hxx:888
bool SetShadowCursorPos(const Point &rPt, SwFillMode eFillMode)
Definition: crstrvl.cxx:2042
OUString GetExpandTextMerged(SwRootFrame const *const pLayout, SwTextNode const &rNode, bool const bWithNumber, bool const bWithSpacesForLevel, ExpandMode const i_mode)
bool GetShadowCursorPos(const Point &rPt, SwFillMode eFillMode, SwRect &rRect, sal_Int16 &rOrient)
Definition: crstrvl.cxx:2014
A helper class to save cursor state (position).
Definition: swcrsr.hxx:230
virtual SwUndoId StartUndo(SwUndoId const eUndoId, SwRewriter const *const pRewriter)=0
Opens undo block.
bool IsContentFrame() const
Definition: frame.hxx:1206
static constexpr auto npos
Definition: ndarr.hxx:80
SwPaM * CreateCursor()
delete the current cursor and make the following into the current
Definition: crsrsh.cxx:117
bool GoInNode(SwPaM &rPam, SwMoveFnCollection const &fnMove)
Definition: pam.cxx:892
const SwField * pField
Definition: crsrsh.hxx:99
const SwFrame * GetLastLower() const
Definition: findfrm.cxx:1817
const SwStartNode * StartOfSectionNode() const
Definition: node.hxx:131
const SwFrameFormat * GetFooterFormat() const
Definition: fmthdft.hxx:85
const SwPosition * GetPoint() const
Definition: pam.hxx:207
bool SetCursorInHdFt(size_t nDescNo, bool bInHeader)
Definition: crstrvl.cxx:191
std::vector< SwSectionFormat * >::size_type size_type
Definition: docary.hxx:70
void EndAction(const bool bIdleEnd=false, const bool DoSetPosX=false)
Definition: crsrsh.cxx:228
SwIndex & Assign(SwIndexReg *, sal_Int32)
Definition: index.cxx:198
const SwPageDesc & GetPageDesc(const size_t i) const
Definition: doc.hxx:876
#define RES_TXTATR_FTN
Definition: hintids.hxx:152
SwPageFrame * FindPageFrame()
Definition: frame.hxx:658
const SwRangeRedline * SelPrevRedline()
Definition: crstrvl.cxx:2207
bool ActionPend() const
Definition: viewsh.hxx:199
TElementType * First()
Definition: calbck.hxx:345
int i
SwPageDesc * GetPageDesc()
Definition: pagefrm.hxx:129
SwContentNode * GetContentNode()
Definition: node.hxx:615
vector_type::size_type size_type
Definition: docary.hxx:330
SwFieldIds
Definition: fldbas.hxx:38
bool GotoINetAttr(const SwTextINetFormat &rAttr)
Definition: crstrvl.cxx:1988
const SfxPoolItem * NextItem()
bool HasMark() const
A PaM marks a selection if Point and Mark are distinct positions.
Definition: pam.hxx:205
OStringBuffer & padToLength(OStringBuffer &rBuffer, sal_Int32 nLength, sal_Char cFill= '\0')
SwDoc * GetDoc()
Definition: node.hxx:702
const SwFormatURL & GetURL(bool=true) const
Definition: fmturl.hxx:78
SwLayoutFrame * GetUpper()
Definition: frame.hxx:656
Marks a character position inside a document model node.
Definition: index.hxx:37
size_t size() const
Definition: docary.hxx:91
const SwFormatFooter & GetFooter(bool=true) const
Definition: fmthdft.hxx:99
bool GotoNextTOXBase(const OUString *=nullptr)
jump to the next index
Definition: crstrvl.cxx:263
bool IsPageAtPos(const Point &rPt) const
Definition: crstrvl.cxx:1261
const SwFlyFrameFormat * GetFlyFormat() const
Definition: docfld.hxx:89
#define SET_CURR_SHELL(shell)
Definition: swtypes.hxx:101
SfxItemState GetItemState(sal_uInt16 nWhich, bool bSrchInParent=true, const SfxPoolItem **ppItem=nullptr) const
Definition: format.cxx:396
#define RES_TXTATR_TOXMARK
Definition: hintids.hxx:137
bool GotoPrevOutline()
jump to previous node with outline num.
Definition: crstrvl.cxx:1092
Marks a node in the document model.
Definition: ndindex.hxx:31
SwFrameFormat * GetFrameFormat()
Definition: swtable.hxx:425
bool IsEndNode() const
Definition: node.hxx:632
sal_uInt16 sal_Char * pName
const SwOutlineNodes & GetOutLineNds() const
Array of all OutlineNodes.
Definition: ndarr.hxx:234
SwNodes & GetNodes()
Node is in which nodes-array/doc?
Definition: node.hxx:693
T static_txtattr_cast(S *s)
Definition: txatbase.hxx:237
SwContentNode * pNode
Definition: crsrsh.hxx:102
ring_container GetRingContainer()
const_iterator end() const
SwTextField * GetFieldTextAttrAt(const sal_Int32 nIndex, const bool bIncludeInputFieldAtStart=false) const
Definition: ndtxt.cxx:1771
bool SelectTextAttr(sal_uInt16 nWhich, bool bExpand, const SwTextAttr *pAttr=nullptr)
Definition: crstrvl.cxx:1959
#define RES_BOXATR_VALUE
Definition: hintids.hxx:263
bool empty() const
void SetAdjust(const SvxAdjust eType)
bool IsInProtectSect() const
is the node in a protected section?
Definition: crstrvl.cxx:1870
const SwTextNode * GetpTextNode() const
Definition: txtinet.hxx:46
SwStartNode * GetStartNode()
Definition: node.hxx:591
void GotoTOXMarkBase()
jump to index of TOXMark
Definition: crstrvl.cxx:366
const SwTextAttr * pFndTextAttr
Definition: crsrsh.hxx:108
#define RES_TXTATR_INETFMT
Definition: hintids.hxx:141
A page of the document layout.
Definition: pagefrm.hxx:40
virtual bool GetCursorOfst(SwPosition *, Point &, SwCursorMoveState *=nullptr, bool bTestBackground=false) const
Definition: unusedf.cxx:46
const SwTOXMark & GotoTOXMark(const SwTOXMark &rCurTOXMark, SwTOXSearch eDir, bool bInReadOnly)
Definition: doctxm.cxx:230
static void SetSearchLabel(const SearchLabel &rSL)
IDocumentLayoutAccess const & getIDocumentLayoutAccess() const
Definition: doc.cxx:437
SAL_DLLPRIVATE const SwRangeRedline * GotoRedline_(SwRedlineTable::size_type nArrPos, bool bSelect)
Definition: crstrvl.cxx:2227
static sal_Int32 EndOfInputFieldAtPos(const SwPosition &rPos)
Definition: crstrvl.cxx:982
const SwPosition * Start() const
Definition: pam.hxx:212
Point Center() const
Definition: swrect.cxx:33
SwTextNode * GetParaPropsNode(SwRootFrame const &rLayout, SwNodeIndex const &rNode)
Definition: txtfrm.cxx:336
SwFieldType * GetTyp() const
Definition: fldbas.hxx:382
bool IsInProtectSect() const
Is node in a protected area?
Definition: node.cxx:410
#define RES_LR_SPACE
Definition: hintids.hxx:196
const SwNodeIndex * GetContentIdx() const
Definition: fmtcntnt.hxx:46
const_iterator begin() const
virtual const SwRangeRedline * GetRedline(const SwPosition &rPos, SwRedlineTable::size_type *pFndPos) const =0
Point LogicToPixel(const Point &rLogicPt) const
void StartAction()
Definition: crsrsh.cxx:211
DEFAULT: (Start <= nIndex < End)
Definition: ndtxt.hxx:363
SwPaM * GetPrev()
Definition: pam.hxx:268
const ImageMap * GetMap() const
Definition: fmturl.hxx:68
bool m_bFootnoteNoInfo
recognized footnote numbering
Definition: crstate.hxx:144
sal_uInt16 Which() const
for Querying of Writer-functions.
Definition: format.hxx:78
bool DocPtInsideInputField(const Point &rDocPt) const
Definition: crstrvl.cxx:963
const SwTextNode & GetTextNode() const
Definition: txttxmrk.hxx:49
bool m_bInNumPortion
point is in number portion #i23726#
Definition: crstate.hxx:163
size_type FindNextOfSeqNo(size_type nSttPos) const
Definition: docredln.cxx:643
IDocumentUndoRedo const & GetIDocumentUndoRedo() const
Provides access to the document undo/redo interface.
Definition: viewsh.cxx:2605
void Left(const long nLeft)
Definition: swrect.hxx:193
SwFrameFormat & GetMaster()
Definition: pagedesc.hxx:216
sal_uLong EndOfSectionIndex() const
Definition: node.hxx:677
SwTextNode is a paragraph in the document model.
Definition: ndtxt.hxx:79
void Bottom(const long nBottom)
Definition: swrect.hxx:207
IDocumentRedlineAccess const & getIDocumentRedlineAccess() const
Definition: doc.cxx:367
bool IsReadOnlyAvailable() const
Definition: crsrsh.hxx:477
const SwStartNode * GetSttNd() const
Definition: swtable.hxx:439
const SwTextNode * FindOutlineNodeOfLevel(sal_uInt8 nLvl, SwRootFrame const *pLayout=nullptr) const
Definition: node.cxx:764
SwFieldIds Which() const
ResId.
Definition: fldbas.cxx:202
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
const SwCharFormats * GetCharFormats() const
Definition: doc.hxx:733
general base class for all free-flowing frames
Definition: flyfrm.hxx:60
bool IsFieldDeletedInModel(IDocumentRedlineAccess const &rIDRA, SwTextField const &rTextField)
SwContentFrame * GetCurrFrame(const bool bCalcFrame=true) const
Get current frame in which the cursor is positioned.
Definition: crsrsh.cxx:2426
#define RES_DRAWFRMFMT
Definition: hintids.hxx:277
Pos1 overlaps Pos2 at the end.
unsigned char sal_uInt8
static sal_uInt16 GetCurTOXMark(const SwPosition &rPos, SwTOXMarks &)
Get current table of contents Mark.
Definition: doctxm.cxx:122
vcl::Window * GetWin() const
Definition: viewsh.hxx:340
static sal_Int32 StartOfInputFieldAtPos(const SwPosition &rPos)
Definition: crstrvl.cxx:974
virtual bool InsertPoolItem(const SwPaM &rRg, const SfxPoolItem &, const SetAttrMode nFlags=SetAttrMode::DEFAULT, SwRootFrame const *pLayout=nullptr, bool bExpandCharToPara=false, SwTextAttr **ppNewTextAttr=nullptr)=0
Insert an attribute.
SwMoveFnCollection const & fnMoveForward
SwPam::Move()/Find() default argument.
Definition: paminit.cxx:59
sal_uInt16 GetWrongPos(sal_Int32 nValue) const
Find the first position that is greater or equal to the given value.
Definition: wrong.cxx:190
sal_Int32 GetIndex() const
Definition: index.hxx:95
bool InWrongWord(sal_Int32 &rChk, sal_Int32 &rLn) const
If a word is incorrectly selected, this method returns begin and length of it.
Definition: wrong.cxx:102
bool IsInside(const Point &rPOINT) const
Definition: swrect.cxx:107
SwNodes & GetNodes()
Definition: doc.hxx:402
SAL_DLLPRIVATE void MoveCursorToNum()
Definition: crstrvl.cxx:76
const SwTextINetFormat * GetINetFormat() const
Definition: docfld.hxx:87
static bool PosInsideInputField(const SwPosition &rPos)
Definition: crstrvl.cxx:958
const SwPosition * End() const
Definition: pam.hxx:217
bool IsRightToLeft() const
Definition: frame.hxx:963
RedlineType GetType(sal_uInt16 nPos=0) const
Definition: docredln.cxx:1739
const sal_Int32 * End() const
Definition: txatbase.hxx:148
SwTableBox is one table cell in the document model.
Definition: swtable.hxx:386
SwFrame * GetLower()
Definition: findfrm.cxx:169
static bool GotoNextNum(SwPosition &, SwRootFrame const *pLayout, bool bOverUpper=true, sal_uInt8 *pUpper=nullptr, sal_uInt8 *pLower=nullptr)
Definition: docnum.cxx:1628
#define RES_PARATR_ADJUST
Definition: hintids.hxx:162
const Point & GetPtPos() const
Definition: viscrs.hxx:140
SwSpecialPos * m_pSpecialPos
for positions inside fields
Definition: crstate.hxx:136
virtual const SwRangeRedline * SelNextRedline(SwPaM &rPam) const =0
scroll window
Definition: crsrsh.hxx:157
bool IsParaPropsNode(SwRootFrame const &rLayout, SwTextNode const &rNode)
Definition: txtfrm.cxx:319
#define RES_TXTATR_REFMARK
Definition: hintids.hxx:136
Header, for PageFormats Client of FrameFormat describing the header.
Definition: fmthdft.hxx:33
void ClearMark()
Definition: crsrsh.cxx:926
static bool GotoPrevNum(SwPosition &, SwRootFrame const *pLayout, bool bOverUpper=true)
Definition: docnum.cxx:1714
virtual bool AppendTextNode(SwPosition &rPos)=0
const SwStartNode * FindTableBoxStartNode() const
Definition: node.hxx:196
const SwRangeRedline * pRedl
Definition: crsrsh.hxx:101
const SwTOXMark & GotoTOXMark(const SwTOXMark &rStart, SwTOXSearch eDir)
traveling between marks
Definition: crstrvl.cxx:625
const SwFormatContent & GetContent(bool=true) const
Definition: fmtcntnt.hxx:55
SwMoveFnCollection const & fnMoveBackward
Definition: paminit.cxx:58
SwTableNode * FindTableNode()
Search table node, in which it is.
Definition: node.cxx:351
static SetGetExpFields::const_iterator lcl_FindField(bool &o_rFound, SetGetExpFields const &rSrtLst, SwRootFrame const *const pLayout, SwTextNode *const pTextNode, SwTextField const *const pTextField, SwPosition const &rPos, sal_Int32 const nContentOffset)
Definition: crstrvl.cxx:683
bool m_bPosCorr
Point had to be corrected.
Definition: crstate.hxx:143
const SfxPoolItem & GetAttr() const
Definition: txatbase.hxx:159
bool IsVertical() const
Definition: frame.hxx:949
bool DontExpand() const
Definition: txatbase.hxx:92
void GotoPrevNum()
Definition: crstrvl.cxx:119
SwNodeIndex * GetStartNode() const
Definition: txtftn.hxx:41
SwContentNode * GoNextSection(SwNodeIndex *, bool bSkipHidden=true, bool bSkipProtect=true) const
Go to next content-node that is not protected or hidden (Both set FALSE ==> GoNext/GoPrevious!!!).
Definition: nodes.cxx:1923
bool GotoNxtPrvTOXMark(bool bNext=true)
jump to next/previous index marker
Definition: crstrvl.cxx:531
bool IsDocNodes() const
Is the NodesArray the regular one of Doc? (and not the UndoNds, ...) Implementation in doc...
Definition: nodes.cxx:2336
size_t size() const
Definition: docary.hxx:225
void GetPosOfContent(SwPosition &rPos) const
Definition: docfld.cxx:169
make visible in spite of Readonly
Definition: crsrsh.hxx:159
const SwTextTOXMark * GetTextTOXMark() const
Definition: tox.hxx:137
SwFrameFormatsBase::size_type size_type
Definition: docary.hxx:217
bool GetContentAtPos(const Point &rPt, SwContentAtPos &rContentAtPos, bool bSetCursor=false, SwRect *pFieldRect=nullptr)
Definition: crstrvl.cxx:1268
virtual void SetMark()
Unless this is called, the getter method of Mark will return Point.
Definition: pam.cxx:455
SectionType GetType() const
Definition: section.hxx:171
bool Seek_Entry(SwNode *rP, size_type *pnPos) const
Definition: ndnum.cxx:34
fill with spaces
Definition: crstate.hxx:32
virtual const SwRedlineTable & GetRedlineTable() const =0
SwRect m_aCharRect
Char-SRectangle on which the cursor is located.
Definition: crsrsh.hxx:168
SwTextNode & GetTextNode() const
Definition: txtfld.hxx:53
std::pair< const_iterator, bool > insert(Value &&x)
const SfxPoolItem & GetAttr(sal_uInt16 nWhich, bool bInParent=true) const
SS for PoolItems: hard attributation.
Definition: node.hxx:730
bool IsInvalidItem(const SfxPoolItem *pItem)
std::vector< SwNode * >::size_type size_type
#define RES_BREAK
Definition: hintids.hxx:199
SwNode & GetEndOfExtras() const
This is the last EndNode of a special section.
Definition: ndarr.hxx:162
SwRootFrame * GetLayout() const
Definition: viewsh.cxx:2071
const SwPostItField * GetPostItFieldAtCursor() const
Definition: crstrvl.cxx:1847
SwSectionFormats & GetSections()
Definition: doc.hxx:1327
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...
static SwTextField * GetTextFieldAtCursor(const SwPaM *pCursor, const bool bIncludeInputFieldAtStart)
Definition: crstrvl.cxx:894
bool IsTextNode() const
Definition: node.hxx:636
bool GotoOutline(const OUString &rName)
Definition: crstrvl.cxx:1007
static constexpr size_type npos
Definition: docary.hxx:331
void GotoNextNum()
go to next/previous point on the same level
Definition: crstrvl.cxx:112
#define RES_TXTATR_INPUTFIELD
Definition: hintids.hxx:145
only align left, center, right
Definition: crstate.hxx:33
SwFieldIds Which() const
Definition: fldbas.hxx:265
aStr
SwContentNode * GoNext(SwNodeIndex *) const
Definition: nodes.cxx:1273
bool GotoFormatField(const SwFormatField &rField)
Definition: crstrvl.cxx:853
SdrObject * FindSdrObject()
Definition: frmfmt.hxx:137
const SwFormatINetFormat * FindINetAttr(const OUString &rName) const
Definition: crstrvl.cxx:2009
bool IsFooterFrame() const
Definition: frame.hxx:1170
const sal_Int32 COMPLETE_STRING
Definition: swtypes.hxx:61
sal_uInt16 Which() const
Pos1 overlaps Pos2 at the beginning.
Point Center() const
only for debugging
const SwFrameFormat * GetHeaderFormat() const
Definition: fmthdft.hxx:54
bool GotoRefMark(const OUString &rRefMark, sal_uInt16 nSubType, sal_uInt16 nSeqNo)
jump to reference marker
Definition: crstrvl.cxx:1237
std::vector< std::unique_ptr< SetGetExpField > >::const_iterator const_iterator
SwTextFormatColl & GetNextTextFormatColl() const
Definition: fmtcol.hxx:97
const SwAttrPool & GetAttrPool() const
Definition: doc.hxx:1308
bool GotoFooterText()
jump from the content to the footer
Definition: crstrvl.cxx:155
void RestoreSavePos()
Restore cursor state to the one saved by SwCursorSaveState.
Definition: swcrsr.cxx:2246
const SwFormatINetFormat & GetINetFormat() const
Definition: txatbase.hxx:224
SwTextNode * GetTextNode()
Inline methods from Node.hxx.
Definition: ndtxt.hxx:843
bool GotoNextOutline()
jump to next node with outline num.
Definition: crstrvl.cxx:1026
bool IsHeaderFrame() const
Definition: frame.hxx:1166
SwFlyFrame * GetFrame(const Point *pDocPos=nullptr) const
Definition: atrfrm.cxx:3033
#define RES_BOXATR_FORMULA
Definition: hintids.hxx:262
bool IsProtected() const
Is the Frame or rather the Section in which it lies protected?
Definition: trvlfrm.cxx:1622
const OUString & GetURL() const
Definition: fmturl.hxx:66
static SwTextField * GetTextFieldAtPos(const SwPosition *pPos, const bool bIncludeInputFieldAtStart)
Definition: crstrvl.cxx:879
Base class of the Writer document model elements.
Definition: node.hxx:79
SwTextFormatColl * GetTextColl() const
Definition: ndtxt.hxx:837
bool CursorInsideInputField() const
Definition: crstrvl.cxx:948
union SwContentAtPos::@25 aFnd
typedef void(CALLTYPE *GetFuncDataPtr)(sal_uInt16 &nNo