LibreOffice Module sw (master)  1
viscrs.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 <config_feature_desktop.h>
21 
22 #include <vcl/weld.hxx>
23 #include <vcl/svapp.hxx>
24 #include <vcl/settings.hxx>
25 #include <viewopt.hxx>
26 #include <frmtool.hxx>
27 #include <viscrs.hxx>
28 #include <crsrsh.hxx>
29 #include <doc.hxx>
30 #include <swtable.hxx>
31 #include <viewimp.hxx>
32 #include <dview.hxx>
33 #include <rootfrm.hxx>
34 #include <txtfrm.hxx>
35 #include <ndtxt.hxx>
36 #include <txtfld.hxx>
37 #include <scriptinfo.hxx>
38 #include <view.hxx>
40 
42 #include <svx/sdrpaintwindow.hxx>
43 #include <svx/srchdlg.hxx>
45 #include "overlayrangesoutline.hxx"
46 
47 #include <memory>
48 
49 #include <LibreOfficeKit/LibreOfficeKitEnums.h>
50 #include <comphelper/lok.hxx>
51 #include <sfx2/lokhelper.hxx>
52 #include <boost/property_tree/json_parser.hpp>
53 #include <comphelper/string.hxx>
54 #include <osl/diagnose.h>
55 #include <paintfrm.hxx>
56 #include <PostItMgr.hxx>
57 #include <SwGrammarMarkUp.hxx>
58 #include <docsh.hxx>
60 #include <cellfrm.hxx>
61 #include <wrtsh.hxx>
62 
63 // Here static members are defined. They will get changed on alteration of the
64 // MapMode. This is done so that on ShowCursor the same size does not have to be
65 // expensively determined again and again.
66 
70 
71 // Starting from here: classes / methods for the non-text-cursor
73  : m_pCursorShell( pCShell )
74  , m_nPageLastTime(0)
75 {
76  pCShell->GetWin()->SetCursor( &m_aTextCursor );
78  m_bIsDragCursor = false;
80 }
81 
83 {
86 
87  m_pCursorShell->GetWin()->SetCursor( nullptr );
88 }
89 
91 {
92  if( !m_bIsVisible )
93  {
94  m_bIsVisible = true;
95 
96  // display at all?
98  SetPosAndShow(nullptr);
99  }
100 }
101 
103 {
104  if( m_bIsVisible )
105  {
106  m_bIsVisible = false;
107 
108  if( m_aTextCursor.IsVisible() ) // Shouldn't the flags be in effect?
110  }
111 }
112 
113 namespace
114 {
115 
116 // Build JSON message to be sent to Online
117 OString buildHyperlinkJSON(const OUString& sText, const OUString& sLink)
118 {
119  boost::property_tree::ptree aTree;
120  aTree.put("text", sText);
121  aTree.put("link", sLink);
122  std::stringstream aStream;
123  boost::property_tree::write_json(aStream, aTree, false);
124 
125  return OString(aStream.str().c_str()).trim();
126 }
127 
128 }
129 
131 {
132  SwRect aRect;
134  if( 0 > nTmpY )
135  {
136  nTmpY = -nTmpY;
137  m_aTextCursor.SetOrientation( 900_deg10 );
138  aRect = SwRect( m_pCursorShell->m_aCharRect.Pos(),
139  Size( m_pCursorShell->m_aCharRect.Height(), nTmpY ) );
140  aRect.Pos().setX(aRect.Pos().getX() + m_pCursorShell->m_aCursorHeight.getX());
142  aRect.Pos().setY(aRect.Pos().getY() + aRect.Width());
143  }
144  else
145  {
147  aRect = SwRect( m_pCursorShell->m_aCharRect.Pos(),
148  Size( m_pCursorShell->m_aCharRect.Width(), nTmpY ) );
149  aRect.Pos().setY(aRect.Pos().getY() + m_pCursorShell->m_aCursorHeight.getX());
150  }
151 
152  // check if cursor should show the current cursor bidi level
154  const SwCursor* pTmpCursor = m_pCursorShell->GetCursor_();
155 
156  if ( pTmpCursor && !m_pCursorShell->IsOverwriteCursor() )
157  {
158  SwNode& rNode = pTmpCursor->GetPoint()->nNode.GetNode();
159  if( rNode.IsTextNode() )
160  {
161  const SwTextNode& rTNd = *rNode.GetTextNode();
162  const SwFrame* pFrame = rTNd.getLayoutFrame(m_pCursorShell->GetLayout(), nullptr, nullptr);
163  if ( pFrame )
164  {
165  const SwScriptInfo* pSI = static_cast<const SwTextFrame*>(pFrame)->GetScriptInfo();
166  // cursor level has to be shown
167  if ( pSI && pSI->CountDirChg() > 1 )
168  {
170  ( pTmpCursor->GetCursorBidiLevel() % 2 ) ?
171  CursorDirection::RTL :
172  CursorDirection::LTR );
173  }
174  if ( pFrame->IsRightToLeft() )
175  {
177  if ( pOut )
178  {
180  Size aSize( nSize, nSize );
181  aSize = pOut->PixelToLogic( aSize );
182  aRect.Left( aRect.Left() - aSize.Width() );
183  }
184  }
185  }
186  }
187  }
188 
189  if( aRect.Height())
190  {
192 
193  // Disable pixel alignment when tiled rendering, so that twip values of
194  // the cursor don't depend on statics.
196  ::SwAlignRect( aRect, static_cast<SwViewShell const *>(m_pCursorShell), m_pCursorShell->GetOut() );
197  }
200  aRect.Width( 0 );
201 
202  m_aTextCursor.SetSize( aRect.SSize() );
203 
204  m_aTextCursor.SetPos( aRect.Pos() );
205 
206  bool bPostItActive = false;
207  SwView* pView = dynamic_cast<SwView*>(m_pCursorShell->GetSfxViewShell());
208  if (pView)
209  {
210  if (SwPostItMgr* pPostItMgr = pView->GetPostItMgr())
211  bPostItActive = pPostItMgr->GetActiveSidebarWin() != nullptr;
212  }
213 
214  if (comphelper::LibreOfficeKit::isActive() && !bPostItActive)
215  {
216  // notify about page number change (if that happened)
217  sal_uInt16 nPage, nVirtPage;
218  // bCalcFrame=false is important to avoid calculating the layout when
219  // we're in the middle of doing that already.
220  const_cast<SwCursorShell*>(m_pCursorShell)->GetPageNum(nPage, nVirtPage, /*bAtCursorPos=*/true, /*bCalcFrame=*/false);
221  if (nPage != m_nPageLastTime)
222  {
223  m_nPageLastTime = nPage;
224  OString aPayload = OString::number(nPage - 1);
225  m_pCursorShell->GetSfxViewShell()->libreOfficeKitViewCallback(LOK_CALLBACK_SET_PART, aPayload.getStr());
226  }
227 
228  // This may get called often, so instead of sending data on each update, just notify
229  // that there's been an update, and the other side will pull the data using
230  // getLOKPayload() when it decides to.
231  m_aLastLOKRect = aRect;
232  if (pViewShell)
233  {
234  if (pViewShell == m_pCursorShell->GetSfxViewShell())
235  {
236  SfxLokHelper::notifyUpdatePerViewId(pViewShell, LOK_CALLBACK_INVALIDATE_VISIBLE_CURSOR);
237  }
238  else
239  {
241  LOK_CALLBACK_INVALIDATE_VIEW_CURSOR);
242  }
243  }
244  else
245  {
247  m_pCursorShell->GetSfxViewShell(), LOK_CALLBACK_INVALIDATE_VISIBLE_CURSOR);
248  SfxLokHelper::notifyOtherViewsUpdatePerViewId(m_pCursorShell->GetSfxViewShell(), LOK_CALLBACK_INVALIDATE_VIEW_CURSOR);
249  }
250  }
251 
253  return;
254 
255  if ( m_pCursorShell->GetDrawView() )
256  const_cast<SwDrawView*>(static_cast<const SwDrawView*>(m_pCursorShell->GetDrawView()))->SetAnimationEnabled(
258 
259  sal_uInt16 nStyle = m_bIsDragCursor ? CURSOR_SHADOW : 0;
260  if( nStyle != m_aTextCursor.GetStyle() )
261  {
262  m_aTextCursor.SetStyle( nStyle );
264  }
265 
267 }
268 
269 OString SwVisibleCursor::getLOKPayload(int nType, int nViewId, bool*) const
270 {
271  assert(nType == LOK_CALLBACK_INVALIDATE_VISIBLE_CURSOR || nType == LOK_CALLBACK_INVALIDATE_VIEW_CURSOR);
273  {
274  SwRect aRect = m_aLastLOKRect;
275 
276  // notify about the cursor position & size
277  tools::Rectangle aSVRect(aRect.Pos().getX(), aRect.Pos().getY(), aRect.Pos().getX() + aRect.SSize().Width(), aRect.Pos().getY() + aRect.SSize().Height());
278  OString sRect = aSVRect.toString();
279 
280  if(nType == LOK_CALLBACK_INVALIDATE_VIEW_CURSOR)
281  return SfxLokHelper::makePayloadJSON(m_pCursorShell->GetSfxViewShell(), nViewId, "rectangle", sRect);
282 
283  // is cursor at a misspelled word ?
284  bool bIsWrong = false;
285  SwView* pView = dynamic_cast<SwView*>(m_pCursorShell->GetSfxViewShell());
286  if (pView && pView->GetWrtShellPtr())
287  {
288  const SwViewOption* pVOpt = pView->GetWrtShell().GetViewOptions();
289  if(pVOpt && pVOpt->IsOnlineSpell())
290  {
291  SwPaM* pCursor = m_pCursorShell->GetCursor();
292  SwPosition aPos(*pCursor->GetPoint());
293  Point aPt = aRect.Pos();
295  SwTextNode *pNode = nullptr;
296  if (m_pCursorShell->GetLayout()->GetModelPositionForViewPoint(&aPos, aPt, &eTmpState))
297  pNode = aPos.nNode.GetNode().GetTextNode();
298  if (pNode && !pNode->IsInProtectSect())
299  {
300  sal_Int32 nBegin = aPos.nContent.GetIndex();
301  sal_Int32 nLen = 1;
302 
303  SwWrongList *pWrong = pNode->GetWrong();
304  if (!pWrong)
305  pWrong = pNode->GetGrammarCheck();
306  if (pWrong)
307  bIsWrong = pWrong->InWrongWord(nBegin,nLen) && !pNode->IsSymbolAt(nBegin);
308  }
309  }
310  }
311 
312  OString sHyperlink;
313  SwContentAtPos aContentAtPos(IsAttrAtPos::InetAttr);
314  bool bIsSelection = m_pCursorShell->IsSelection();
315 
316  if (const_cast<SwCursorShell*>(m_pCursorShell)->GetContentAtPos(aRect.Pos(), aContentAtPos))
317  {
318  const SwFormatINetFormat* pItem = static_cast<const SwFormatINetFormat*>(aContentAtPos.aFnd.pAttr);
319  sHyperlink = buildHyperlinkJSON(aContentAtPos.sStr, pItem->GetValue());
320  }
321  else if (bIsSelection)
322  {
324 
325  if (pShell)
326  {
329  pShell->GetCurAttr(aSet);
330  if(SfxItemState::SET <= aSet.GetItemState( RES_TXTATR_INETFMT ))
331  {
332  sHyperlink = buildHyperlinkJSON(m_pCursorShell->GetSelText(),
333  aSet.GetItem(RES_TXTATR_INETFMT)->GetValue());
334  }
335  }
336  }
337 
338  return SfxLokHelper::makeVisCursorInvalidation(nViewId, sRect, bIsWrong, sHyperlink);
339  }
340  else
341  abort();
342 }
343 
345 {
346  return m_aTextCursor;
347 }
348 
350  : m_pCursorShell( &rCSh )
351 #if HAVE_FEATURE_DESKTOP
352  , m_bShowTextInputFieldOverlay(true)
353 #endif
354 {
355 }
356 
358 {
359  Hide();
360 }
361 
363 {
364  SwRects::swap(rSwap);
365 
366 #if HAVE_FEATURE_DESKTOP
367  // #i75172# also swap m_pCursorOverlay
368  std::swap(m_pCursorOverlay, rSwap.m_pCursorOverlay);
371 #endif
372 }
373 
375 {
376 #if HAVE_FEATURE_DESKTOP
377  m_pCursorOverlay.reset();
378  m_pTextInputFieldOverlay.reset();
379 #endif
380 
381  SwRects::clear();
382 }
383 
392 static SwRect lcl_getLayoutRect(const Point& rPoint, const SwPosition& rPosition)
393 {
394  const SwContentNode* pNode = rPosition.nNode.GetNode().GetContentNode();
395  std::pair<Point, bool> const tmp(rPoint, true);
396  const SwContentFrame* pFrame = pNode->getLayoutFrame(
398  &rPosition, &tmp);
399  SwRect aRect;
400  pFrame->GetCharRect(aRect, rPosition);
401  return aRect;
402 }
403 
404 void SwShellCursor::FillStartEnd(SwRect& rStart, SwRect& rEnd) const
405 {
406  const SwShellCursor* pCursor = GetShell()->getShellCursor(false);
407  rStart = lcl_getLayoutRect(pCursor->GetSttPos(), *pCursor->Start());
408  rEnd = lcl_getLayoutRect(pCursor->GetEndPos(), *pCursor->End());
409 }
410 
411 void SwSelPaintRects::Show(std::vector<OString>* pSelectionRectangles)
412 {
413  SdrView *const pView = const_cast<SdrView*>(m_pCursorShell->GetDrawView());
414 
415  if(!(pView && pView->PaintWindowCount()))
416  return;
417 
418  // reset rects
419  SwRects::clear();
420  FillRects();
421 
422 #if HAVE_FEATURE_DESKTOP
423  // get new rects
424  std::vector< basegfx::B2DRange > aNewRanges;
425  aNewRanges.reserve(size());
426  for(size_type a = 0; a < size(); ++a)
427  {
428  const SwRect aNextRect((*this)[a]);
429  const tools::Rectangle aPntRect(aNextRect.SVRect());
430 
431  aNewRanges.emplace_back(
432  aPntRect.Left(), aPntRect.Top(),
433  aPntRect.Right() + 1, aPntRect.Bottom() + 1);
434  }
435 
436  if (m_pCursorOverlay)
437  {
438  if(!aNewRanges.empty())
439  {
440  static_cast<sdr::overlay::OverlaySelection*>(m_pCursorOverlay.get())->setRanges(std::move(aNewRanges));
441  }
442  else
443  {
444  m_pCursorOverlay.reset();
445  }
446  }
447  else if(!empty())
448  {
449  SdrPaintWindow* pCandidate = pView->GetPaintWindow(0);
450  const rtl::Reference< sdr::overlay::OverlayManager >& xTargetOverlay = pCandidate->GetOverlayManager();
451 
452  if (xTargetOverlay.is())
453  {
454  // get the system's highlight color
456 
457  // create correct selection
458  m_pCursorOverlay.reset( new sdr::overlay::OverlaySelection(
460  aHighlight,
461  std::move(aNewRanges),
462  true) );
463 
464  xTargetOverlay->add(*m_pCursorOverlay);
465  }
466  }
467 
469 #endif
470 
471  // Tiled editing does not expose the draw and writer cursor, it just
472  // talks about "the" cursor at the moment. As long as that's true,
473  // don't say anything about the Writer cursor till a draw object is
474  // being edited.
476  return;
477 
478  // If pSelectionRectangles is set, we're just collecting the text selections -> don't emit start/end.
479  if (!empty() && !pSelectionRectangles)
480  {
481  SwRect aStartRect;
482  SwRect aEndRect;
483  FillStartEnd(aStartRect, aEndRect);
484 
485  if (aStartRect.HasArea())
486  SfxLokHelper::notifyUpdate(GetShell()->GetSfxViewShell(), LOK_CALLBACK_TEXT_SELECTION_START);
487  if (aEndRect.HasArea())
488  SfxLokHelper::notifyUpdate(GetShell()->GetSfxViewShell(), LOK_CALLBACK_TEXT_SELECTION_END);
489  }
490 
491  std::vector<OString> aRect;
492  aRect.reserve(size());
493  for (size_type i = 0; i < size(); ++i)
494  {
495  const SwRect& rRect = (*this)[i];
496  aRect.push_back(rRect.SVRect().toString());
497  }
498  OString sRect = comphelper::string::join("; ", aRect);
499  if (!pSelectionRectangles)
500  {
501  SfxLokHelper::notifyUpdate(GetShell()->GetSfxViewShell(),LOK_CALLBACK_TEXT_SELECTION);
502  SfxLokHelper::notifyOtherViewsUpdatePerViewId(GetShell()->GetSfxViewShell(), LOK_CALLBACK_TEXT_VIEW_SELECTION);
503  }
504  else
505  pSelectionRectangles->push_back(sRect);
506 }
507 
508 OString SwSelPaintRects::getLOKPayload( int nType, int nViewId, bool* ignore ) const
509 {
510  switch( nType )
511  {
512  case LOK_CALLBACK_TEXT_SELECTION_START:
513  case LOK_CALLBACK_TEXT_SELECTION_END:
514  {
515  // The selection may be a complex polygon, emit the logical
516  // start/end cursor rectangle of the selection as separate
517  // events, if there is a real selection.
518  // This can be used to easily show selection handles on the
519  // client side.
520  SwRect aStartRect;
521  SwRect aEndRect;
522  FillStartEnd(aStartRect, aEndRect);
523 
524  if( nType == LOK_CALLBACK_TEXT_SELECTION_START )
525  {
526  if (aStartRect.HasArea())
527  return aStartRect.SVRect().toString();
528  *ignore = true;
529  return OString();
530  }
531  else // LOK_CALLBACK_TEXT_SELECTION_END
532  {
533  if (aEndRect.HasArea())
534  return aEndRect.SVRect().toString();
535  *ignore = true;
536  return OString();
537  }
538  }
539  break;
540  case LOK_CALLBACK_TEXT_SELECTION:
541  case LOK_CALLBACK_TEXT_VIEW_SELECTION:
542  {
543  std::vector<OString> aRect;
544  aRect.reserve(size());
545  for (size_type i = 0; i < size(); ++i)
546  {
547  const SwRect& rRect = (*this)[i];
548  aRect.push_back(rRect.SVRect().toString());
549  }
550  OString sRect = comphelper::string::join("; ", aRect);
551  if( nType == LOK_CALLBACK_TEXT_SELECTION )
552  return sRect;
553  else // LOK_CALLBACK_TEXT_VIEW_SELECTION
554  return SfxLokHelper::makePayloadJSON(GetShell()->GetSfxViewShell(), nViewId, "selection", sRect);
555  }
556  break;
557  }
558  abort();
559 }
560 
562 {
563  std::vector< basegfx::B2DRange > aInputFieldRanges;
564 
566  {
567  SwTextInputField* pCurTextInputFieldAtCursor =
568  dynamic_cast<SwTextInputField*>(SwCursorShell::GetTextFieldAtPos( GetShell()->GetCursor()->Start(), false ));
569  if ( pCurTextInputFieldAtCursor != nullptr )
570  {
571  SwTextNode* pTextNode = pCurTextInputFieldAtCursor->GetpTextNode();
572  std::unique_ptr<SwShellCursor> pCursorForInputTextField(
573  new SwShellCursor( *GetShell(), SwPosition( *pTextNode, pCurTextInputFieldAtCursor->GetStart() ) ) );
574  pCursorForInputTextField->SetMark();
575  pCursorForInputTextField->GetMark()->nNode = *pTextNode;
576  pCursorForInputTextField->GetMark()->nContent.Assign( pTextNode, *(pCurTextInputFieldAtCursor->End()) );
577 
578  pCursorForInputTextField->FillRects();
579  SwRects* pRects = pCursorForInputTextField.get();
580  for (const SwRect & rNextRect : *pRects)
581  {
582  const tools::Rectangle aPntRect(rNextRect.SVRect());
583 
584  aInputFieldRanges.emplace_back(
585  aPntRect.Left(), aPntRect.Top(),
586  aPntRect.Right() + 1, aPntRect.Bottom() + 1);
587  }
588  }
589  }
590 
591  if ( !aInputFieldRanges.empty() )
592  {
593  if (m_pTextInputFieldOverlay != nullptr)
594  {
595  m_pTextInputFieldOverlay->setRanges( std::move(aInputFieldRanges) );
596  }
597  else
598  {
599  SdrView* pView = const_cast<SdrView*>(GetShell()->GetDrawView());
600  SdrPaintWindow* pCandidate = pView->GetPaintWindow(0);
601  const rtl::Reference<sdr::overlay::OverlayManager>& xTargetOverlay = pCandidate->GetOverlayManager();
602 
603  if (xTargetOverlay.is())
604  {
605  // use system's highlight color with decreased luminance as highlight color
607  aHighlight.DecreaseLuminance( 128 );
608 
610  aHighlight, std::move(aInputFieldRanges) ) );
611  xTargetOverlay->add( *m_pTextInputFieldOverlay );
612  }
613  }
614  }
615  else
616  {
617  m_pTextInputFieldOverlay.reset();
618  }
619 }
620 
622 {
623  size_type nSz = size();
624  if( !nSz )
625  return;
626 
627  SwRegionRects aReg( GetShell()->VisArea() );
628  aReg.assign( begin(), end() );
629  aReg -= rRect;
630  SwRects::erase( begin(), begin() + nSz );
631  SwRects::insert( begin(), aReg.begin(), aReg.end() );
632 
633  // If the selection is to the right or at the bottom, outside the
634  // visible area, it is never aligned on one pixel at the right/bottom.
635  // This has to be determined here and if that is the case the
636  // rectangle has to be expanded.
637  if( !(GetShell()->m_bVisPortChgd && 0 != ( nSz = size())) )
638  return;
639 
641  iterator it = begin();
642  for( ; nSz--; ++it )
643  {
644  SwRect& rRectIt = *it;
645  if( rRectIt.Right() == GetShell()->m_aOldRBPos.X() )
646  rRectIt.AddRight( s_nPixPtX );
647  if( rRectIt.Bottom() == GetShell()->m_aOldRBPos.Y() )
648  rRectIt.AddBottom( s_nPixPtY );
649  }
650 }
651 
652 // check current MapMode of the shell and set possibly the static members.
653 // Optional set the parameters pX, pY
655  tools::Long* pX, tools::Long* pY )
656 {
657  const OutputDevice* pOut = rSh.GetWin()->GetOutDev();
658  if ( ! pOut )
659  pOut = rSh.GetOut();
660 
661  const MapMode& rMM = pOut->GetMapMode();
662  if (s_pMapMode->GetMapUnit() != rMM.GetMapUnit() ||
663  s_pMapMode->GetScaleX() != rMM.GetScaleX() ||
664  s_pMapMode->GetScaleY() != rMM.GetScaleY())
665  {
666  *s_pMapMode = rMM;
667  Size aTmp( 1, 1 );
668  aTmp = pOut->PixelToLogic( aTmp );
669  s_nPixPtX = aTmp.Width();
670  s_nPixPtY = aTmp.Height();
671  }
672  if( pX )
673  *pX = s_nPixPtX;
674  if( pY )
675  *pY = s_nPixPtY;
676 }
677 
679  const SwCursorShell& rCShell,
680  const SwPosition &rPos )
681  : SwCursor(rPos,nullptr)
682  , SwSelPaintRects(rCShell)
683  , m_pInitialPoint(SwPaM::GetPoint())
684 {}
685 
687  const SwCursorShell& rCShell,
688  const SwPosition &rPos,
689  const Point& rPtPos,
690  SwPaM* pRing )
691  : SwCursor(rPos, pRing)
692  , SwSelPaintRects(rCShell)
693  , m_MarkPt(rPtPos)
694  , m_PointPt(rPtPos)
695  , m_pInitialPoint(SwPaM::GetPoint())
696 {}
697 
699  : SwCursor(rICursor, &rICursor)
700  , SwSelPaintRects(*rICursor.GetShell())
701  , m_MarkPt(rICursor.GetMkPos())
702  , m_PointPt(rICursor.GetPtPos())
703  , m_pInitialPoint(SwPaM::GetPoint())
704 {}
705 
707 {}
708 
710 {
711  return GetShell()->IsReadOnlyAvailable();
712 }
713 
715 {
718  else
720  SwPaM::SetMark();
721 }
722 
724 {
725  // calculate the new rectangles
726  if( HasMark() &&
727  GetPoint()->nNode.GetNode().IsContentNode() &&
728  GetPoint()->nNode.GetNode().GetContentNode()->getLayoutFrame( GetShell()->GetLayout() ) &&
729  (GetMark()->nNode == GetPoint()->nNode ||
731  GetMark()->nNode.GetNode().GetContentNode()->getLayoutFrame( GetShell()->GetLayout() ) ) ))
732  GetShell()->GetLayout()->CalcFrameRects( *this );
733 }
734 
735 void SwShellCursor::Show(SfxViewShell const * pViewShell)
736 {
737  std::vector<OString> aSelectionRectangles;
738  for(SwPaM& rPaM : GetRingContainer())
739  {
740  SwShellCursor* pShCursor = dynamic_cast<SwShellCursor*>(&rPaM);
741  if(pShCursor)
742  pShCursor->SwSelPaintRects::Show(&aSelectionRectangles);
743  }
744 
746  return;
747 
748  std::vector<OString> aRect;
749  for (const OString & rSelectionRectangle : aSelectionRectangles)
750  {
751  if (rSelectionRectangle.isEmpty())
752  continue;
753  aRect.push_back(rSelectionRectangle);
754  }
755  OString sRect = comphelper::string::join("; ", aRect);
756  if (pViewShell)
757  {
758  // Just notify pViewShell about our existing selection.
759  if (pViewShell != GetShell()->GetSfxViewShell())
760  SfxLokHelper::notifyOtherView(GetShell()->GetSfxViewShell(), pViewShell, LOK_CALLBACK_TEXT_VIEW_SELECTION, "selection", sRect);
761  }
762  else
763  {
764  GetShell()->GetSfxViewShell()->libreOfficeKitViewCallback(LOK_CALLBACK_TEXT_SELECTION, sRect.getStr());
765  SfxLokHelper::notifyOtherViews(GetShell()->GetSfxViewShell(), LOK_CALLBACK_TEXT_VIEW_SELECTION, "selection", sRect);
766  }
767 }
768 
769 // This rectangle gets painted anew, therefore the SSelection in this
770 // area is invalid.
771 void SwShellCursor::Invalidate( const SwRect& rRect )
772 {
773  for(SwPaM& rPaM : GetRingContainer())
774  {
775  SwShellCursor* pShCursor = dynamic_cast<SwShellCursor*>(&rPaM);
776  // skip any non SwShellCursor objects in the ring
777  // see also: SwAutoFormat::DeleteSel()
778  if(pShCursor)
779  pShCursor->SwSelPaintRects::Invalidate(rRect);
780  }
781 }
782 
784 {
785  for(SwPaM& rPaM : GetRingContainer())
786  {
787  SwShellCursor* pShCursor = dynamic_cast<SwShellCursor*>(&rPaM);
788  if(pShCursor)
789  pShCursor->SwSelPaintRects::Hide();
790  }
791 }
792 
794 {
795  return new SwShellCursor( *GetShell(), *GetPoint(), GetPtPos(), pRing );
796 }
797 
799 {
800  short nRet = RET_YES;
802  if( pDlg )
803  {
804  // Terminate old actions. The table-frames get constructed and
805  // a SSelection can be created.
806  std::vector<sal_uInt16> vActionCounts;
807  for(SwViewShell& rShell : const_cast< SwCursorShell* >( GetShell() )->GetRingContainer())
808  {
809  sal_uInt16 nActCnt = 0;
810  while(rShell.ActionPend())
811  {
812  rShell.EndAction();
813  ++nActCnt;
814  }
815  vActionCounts.push_back(nActCnt);
816  }
817  std::unique_ptr<weld::Builder> xBuilder(Application::CreateBuilder(pDlg->getDialog(), "modules/swriter/ui/asksearchdialog.ui"));
818  std::unique_ptr<weld::MessageDialog> xDialog(xBuilder->weld_message_dialog("AskSearchDialog"));
819  nRet = xDialog->run();
820  auto pActionCount = vActionCounts.begin();
821  for(SwViewShell& rShell : const_cast< SwCursorShell* >( GetShell() )->GetRingContainer())
822  {
823  while(*pActionCount)
824  {
825  rShell.StartAction();
826  --(*pActionCount);
827  }
828  ++pActionCount;
829  }
830  }
831  else
832  // otherwise from the Basic, and then switch to RET_YES
833  nRet = RET_YES;
834 
835  return nRet;
836 }
837 
839 {
840  const_cast<SwCursorShell*>(GetShell())->SaveTableBoxContent( pPos );
841 }
842 
843 bool SwShellCursor::UpDown( bool bUp, sal_uInt16 nCnt )
844 {
845  return SwCursor::UpDown( bUp, nCnt,
846  &GetPtPos(), GetShell()->GetUpDownX(),
847  *GetShell()->GetLayout());
848 }
849 
850 // if <true> than the cursor can be set to the position.
851 bool SwShellCursor::IsAtValidPos( bool bPoint ) const
852 {
853  if( GetShell() && ( GetShell()->IsAllProtect() ||
854  GetShell()->GetViewOptions()->IsReadonly() ||
855  ( GetShell()->Imp()->GetDrawView() &&
856  GetShell()->Imp()->GetDrawView()->GetMarkedObjectList().GetMarkCount() )))
857  return true;
858 
859  return SwCursor::IsAtValidPos( bPoint );
860 }
861 
863  const SwPosition& rPos )
864  : SwCursor(rPos,nullptr), SwShellCursor(rCursorSh, rPos), SwTableCursor(rPos)
865 {
866 }
867 
869  const SwPosition& rMkPos, const Point& rMkPt,
870  const SwPosition& rPtPos, const Point& rPtPt )
871  : SwCursor(rPtPos,nullptr), SwShellCursor(rCursorSh, rPtPos), SwTableCursor(rPtPos)
872 {
873  SetMark();
874  *GetMark() = rMkPos;
875  GetMkPos() = rMkPt;
876  GetPtPos() = rPtPt;
877 }
878 
880 
882 
884 {
885  return SwShellCursor::Create( pRing );
886 }
887 
889 {
891 }
892 
894 {
896 }
897 
899 {
900  // Calculate the new rectangles. If the cursor is still "parked" do nothing
902  return;
903 
904  bool bStart = true;
906  ? GetShell()->getIDocumentLayoutAccess().GetCurrentLayout()->getFrameArea()
907  : GetShell()->VisArea() );
908  SwNodes& rNds = GetDoc().GetNodes();
909  SwFrame* pEndFrame = nullptr;
910  for (size_t n = 0; n < m_SelectedBoxes.size(); ++n)
911  {
912  const SwStartNode* pSttNd = m_SelectedBoxes[n]->GetSttNd();
913  const SwTableNode* pSelTableNd = pSttNd->FindTableNode();
914 
915  SwNodeIndex aIdx( *pSttNd );
916  SwContentNode* pCNd = rNds.GoNextSection( &aIdx, true, false );
917 
918  // table in table
919  // (see also lcl_FindTopLevelTable in unoobj2.cxx for a different
920  // version to do this)
921  const SwTableNode* pCurTableNd = pCNd ? pCNd->FindTableNode() : nullptr;
922  while ( pSelTableNd != pCurTableNd && pCurTableNd )
923  {
924  aIdx = pCurTableNd->EndOfSectionIndex();
925  pCNd = rNds.GoNextSection( &aIdx, true, false );
926  pCurTableNd = pCNd->FindTableNode();
927  }
928 
929  if( !pCNd )
930  continue;
931 
932  std::pair<Point, bool> const tmp(GetSttPos(), false);
933  SwFrame* pFrame = pCNd->getLayoutFrame(GetShell()->GetLayout(), nullptr, &tmp);
934  while( pFrame && !pFrame->IsCellFrame() )
935  pFrame = pFrame->GetUpper();
936 
937  OSL_ENSURE( pFrame, "Node not in a table" );
938 
939  while ( pFrame )
940  {
941  if( aReg.GetOrigin().Overlaps( pFrame->getFrameArea() ) )
942  {
943  aReg -= pFrame->getFrameArea();
944  if (bStart)
945  {
946  bStart = false;
947  m_aStart = SwRect(pFrame->getFrameArea().Left(), pFrame->getFrameArea().Top(), 1, pFrame->getFrameArea().Height());
948  }
949  }
950 
951  pEndFrame = pFrame;
952  pFrame = pFrame->GetNextCellLeaf();
953  }
954  }
955  if (pEndFrame)
956  m_aEnd = SwRect(pEndFrame->getFrameArea().Right(), pEndFrame->getFrameArea().Top(), 1, pEndFrame->getFrameArea().Height());
957  aReg.Invert();
958  insert( begin(), aReg.begin(), aReg.end() );
959 }
960 
962 {
963  rStart = m_aStart;
964  rEnd = m_aEnd;
965 }
966 
967 // Check if the SPoint is within the Table-SSelection.
968 bool SwShellTableCursor::Contains( const Point& rPt ) const
969 {
970  // Calculate the new rectangles. If the cursor is still "parked" do nothing
972  return false;
973 
974  SwNodes& rNds = GetDoc().GetNodes();
975  for (size_t n = 0; n < m_SelectedBoxes.size(); ++n)
976  {
977  SwNodeIndex aIdx( *m_SelectedBoxes[n]->GetSttNd() );
978  SwContentNode* pCNd = rNds.GoNextSection( &aIdx, true, false );
979  if( !pCNd )
980  continue;
981 
982  std::pair<Point, bool> const tmp(GetPtPos(), true);
983  SwFrame* pFrame = pCNd->getLayoutFrame(GetShell()->GetLayout(), nullptr, &tmp);
984  while( pFrame && !pFrame->IsCellFrame() )
985  pFrame = pFrame->GetUpper();
986  OSL_ENSURE( pFrame, "Node not in a table" );
987  if( pFrame && pFrame->getFrameArea().Contains( rPt ) )
988  return true;
989 
990  for ( SwCellFrame* pCellFrame = static_cast<SwCellFrame*>(pFrame); pCellFrame; pCellFrame = pCellFrame->GetFollowCell() )
991  {
992  if( pCellFrame->getFrameArea().Contains( rPt ) )
993  return true;
994  }
995  }
996  return false;
997 }
998 
999 bool SwShellTableCursor::IsAtValidPos( bool bPoint ) const
1000 {
1001  return SwShellCursor::IsAtValidPos( bPoint );
1002 }
1003 
1004 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
bool m_bIsVisible
Definition: viscrs.hxx:48
vcl::RenderContext * GetOut() const
Definition: viewsh.hxx:339
static SwRect lcl_getLayoutRect(const Point &rPoint, const SwPosition &rPosition)
Return a layout rectangle (typically with minimal width) that represents a cursor at rPosition...
Definition: viscrs.cxx:392
const Fraction & GetScaleX() const
virtual short MaxReplaceArived() override
Definition: viscrs.cxx:888
Starts a section of nodes in the document model.
Definition: node.hxx:313
Base class of the Writer layout elements.
Definition: frame.hxx:315
Represents the visualization of a paragraph.
Definition: txtfrm.hxx:159
static void notifyOtherViews(const SfxViewShell *pThisView, int nType, std::string_view rKey, const OString &rPayload)
void Right(const tools::Long nRight)
Definition: swrect.hxx:202
SwNodeOffset EndOfSectionIndex() const
Definition: node.hxx:681
Marks a position in the document model.
Definition: pam.hxx:36
const SwRect & GetOrigin() const
Definition: swregion.hxx:62
const SwPosition * m_pInitialPoint
Definition: viscrs.hxx:126
void SetOrientation(Degree10 nOrientation=0_deg10)
SdrView * GetDrawView()
Definition: vnew.cxx:373
void SwCalcPixStatics(vcl::RenderContext const *pOut)
Set borders alignment statics Adjustment for 'small' twip-to-pixel relations: For 'small' twip-to-pix...
Definition: paintfrm.cxx:379
virtual bool IsAtValidPos(bool bPoint=true) const override
Return if cursor can be set to this position.
Definition: viscrs.cxx:851
void SetPos(const Point &rNewPos)
virtual const SwRootFrame * GetCurrentLayout() const =0
rtl::Reference< sdr::overlay::OverlayManager > const & GetOverlayManager() const
SwDocShell * GetDocShell()
Definition: doc.hxx:1352
void Left(const tools::Long nLeft)
Definition: swrect.hxx:197
SwNodeIndex nNode
Definition: pam.hxx:38
static void notifyUpdatePerViewId(SfxViewShell const *pViewShell, int nType)
SwShellCursor * getShellCursor(bool bBlock)
Delivers the current shell cursor.
Definition: crsrsh.cxx:3037
sal_uInt16 GetStyle() const
SdrTextObj * GetTextEditObject() const
virtual void SaveTableBoxContent(const SwPosition *pPos) override
Definition: viscrs.cxx:893
long Long
const StyleSettings & GetStyleSettings() const
const SfxPoolItem * pAttr
Definition: crsrsh.hxx:97
const SwPosition * GetMark() const
Definition: pam.hxx:210
SwContentFrame * getLayoutFrame(const SwRootFrame *, const SwPosition *pPos=nullptr, std::pair< Point, bool > const *pViewPosAndCalcFrame=nullptr) const
Definition: node.cxx:1210
sal_Int64 n
virtual void SetMark() override
Unless this is called, the getter method of Mark will return Point.
Definition: viscrs.cxx:714
static SvxSearchDialog * GetSearchDialog()
Definition: viewsrch.cxx:820
virtual SwCursor * Create(SwPaM *pRing=nullptr) const override
Definition: viscrs.cxx:883
sal_uInt8 GetCursorBidiLevel() const
Definition: swcrsr.hxx:211
const Point & GetSttPos() const
Definition: viscrs.hxx:150
const MapMode & GetMapMode() const
SwNode & GetNode() const
Definition: ndindex.hxx:121
SwRect m_aEnd
Right edge of the selection end (bottom right cell).
Definition: viscrs.hxx:180
SwTextNode * GetpTextNode() const
Definition: txtfld.hxx:49
void Pos(const Point &rNew)
Definition: swrect.hxx:171
bool IsCellFrame() const
Definition: frame.hxx:1227
Of course Writer needs its own rectangles.
Definition: swrect.hxx:34
SfxViewShell * GetSfxViewShell() const
Definition: viewsh.hxx:446
void Hide()
Definition: viscrs.cxx:783
virtual bool IsAtValidPos(bool bPoint=true) const override
Return if cursor can be set to this position.
Definition: viscrs.cxx:999
bool IsSymbolAt(sal_Int32 nBegin) const
in ndcopy.cxx
Definition: itratr.cxx:854
virtual void SaveTableBoxContent(const SwPosition *pPos) override
Definition: viscrs.cxx:838
SwWrtShell & GetWrtShell() const
Definition: view.hxx:413
void Invalidate(const SwRect &rRect)
Definition: viscrs.cxx:621
bool m_bShowTextInputFieldOverlay
Definition: viscrs.hxx:85
Used by the UI to modify the document model.
Definition: wrtsh.hxx:93
constexpr tools::Long Width() const
virtual bool GetModelPositionForViewPoint(SwPosition *, Point &, SwCursorMoveState *=nullptr, bool bTestBackground=false) const override
Primary passes the call to the first page.
Definition: trvlfrm.cxx:425
const OUString & GetValue() const
Definition: fmtinfmt.hxx:75
RET_YES
Point m_PointPt
Definition: viscrs.hxx:125
void SwAlignRect(SwRect &rRect, const SwViewShell *pSh, const vcl::RenderContext *pRenderContext)
Function is also used outside this file.
Definition: paintfrm.cxx:1124
enumrange< T >::Iterator begin(enumrange< T >)
const SwRect & getFrameArea() const
Definition: frame.hxx:180
OString join(std::string_view rSeparator, const std::vector< OString > &rSequence)
const Fraction & GetScaleY() const
void CalcFrameRects(SwShellCursor &)
Definition: trvlfrm.cxx:2008
static SfxViewShell * Current()
virtual void libreOfficeKitViewCallback(int nType, const char *pPayload) const override
sal_Int32 GetStart() const
Definition: txatbase.hxx:86
void Invert()
invert current rectangle
Definition: swregion.cxx:126
oslFileHandle & pOut
virtual void FillRects() override
Definition: viscrs.cxx:898
SwShellTableCursor(const SwCursorShell &rCursorSh, const SwPosition &rPos)
Definition: viscrs.cxx:862
void Width(tools::Long nNew)
Definition: swrect.hxx:189
#define CURSOR_SHADOW
OUString sStr
Definition: crsrsh.hxx:104
OString getLOKPayload(int nType, int nViewId, bool *ignore) const
Definition: viscrs.cxx:508
Point m_aOldRBPos
Right/Bottom of last VisArea.
Definition: crsrsh.hxx:167
union SwContentAtPos::@24 aFnd
virtual void FillRects() override
Definition: viscrs.cxx:723
SwDoc * GetDoc() const
Definition: viewsh.hxx:282
SwNodeOffset GetIndex() const
Definition: ndindex.hxx:154
void SetStyle(sal_uInt16 nStyle)
virtual short MaxReplaceArived() override
Definition: viscrs.cxx:798
void Show(SfxViewShell const *pViewShell)
Definition: viscrs.cxx:735
size_type size() const
void Invalidate(const SwRect &rRect)
Definition: viscrs.cxx:771
virtual void FillStartEnd(SwRect &rStart, SwRect &rEnd) const =0
Fill rStart and rEnd with a rectangle that represents the start and end for selection handles...
SwLayoutFrame * GetNextCellLeaf()
Definition: findfrm.cxx:1557
virtual bool GetCharRect(SwRect &, const SwPosition &, SwCursorMoveState *=nullptr, bool bAllowFarAway=true) const
Definition: unusedf.cxx:72
constexpr TypedWhichId< SwFormatINetFormat > RES_TXTATR_INETFMT(51)
SfxItemPool & GetPool() const
sal_uInt32 PaintWindowCount() const
SwShellCursor * GetCursor_()
Definition: crsrsh.hxx:328
static MapMode * s_pMapMode
Definition: viscrs.hxx:77
SwVisibleCursor(const SwCursorShell *pCShell)
Definition: viscrs.cxx:72
bool IsContentNode() const
Definition: node.hxx:632
PaM is Point and Mark: a selection of the document model.
Definition: pam.hxx:137
bool IsSelection() const
Definition: crsrsh.hxx:876
virtual ~SwShellTableCursor() override
Definition: viscrs.cxx:879
const SwCursorShell * m_pCursorShell
Definition: viscrs.hxx:79
const SwCursorShell * GetShell() const
Definition: viscrs.hxx:111
SwShellCursor(const SwCursorShell &rCursorSh, const SwPosition &rPos)
Definition: viscrs.cxx:678
void SetPosAndShow(SfxViewShell const *pViewShell)
Definition: viscrs.cxx:130
Shell * GetShell()
void DecreaseLuminance(sal_uInt8 cLumDec)
int i
const SwRect & VisArea() const
Definition: viewsh.cxx:626
uno_Any a
SwDoc & GetDoc()
Definition: node.hxx:213
const SwPosition * GetPoint() const
Definition: pam.hxx:208
bool UpDown(bool bUp, sal_uInt16 nCnt)
Definition: viscrs.cxx:843
void AddBottom(const tools::Long nAdd)
Definition: swrect.cxx:130
bool Contains(const Point &rPt) const
Definition: viscrs.cxx:968
SwContentNode * GetContentNode()
Definition: node.hxx:619
SwNodeOffset GetIndex() const
Definition: node.hxx:292
bool HasMark() const
A PaM marks a selection if Point and Mark are distinct positions.
Definition: pam.hxx:206
SwLayoutFrame * GetUpper()
Definition: frame.hxx:679
virtual ~SwShellCursor() override
Definition: viscrs.cxx:706
bool HasArea() const
Definition: swrect.hxx:300
void SetWindow(vcl::Window *pWindow)
SwGrammarMarkUp * GetGrammarCheck()
Definition: txtedt.cxx:2242
void HighlightInputField()
Definition: viscrs.cxx:561
static void notifyOtherViewsUpdatePerViewId(SfxViewShell const *pViewShell, int nType)
bool IsCursorReadonly() const
Definition: crsrsh.cxx:3291
virtual void FillStartEnd(SwRect &rStart, SwRect &rEnd) const override
Definition: viscrs.cxx:961
virtual void SetMark() override
Unless this is called, the getter method of Mark will return Point.
Definition: viscrs.cxx:881
SwWrtShell * GetWrtShell()
Access to the SwWrtShell belonging to SwView.
Definition: docsh.hxx:225
const Point & GetMkPos() const
Definition: viscrs.hxx:148
size
Marks a node in the document model.
Definition: ndindex.hxx:32
bool UpDown(bool bUp, sal_uInt16 nCnt, Point const *pPt, tools::Long nUpDownX, SwRootFrame &rLayout)
Definition: swcrsr.cxx:1997
void SetSize(const Size &rNewSize)
const AllSettings & GetSettings() const
bool IsOverwriteCursor() const
Definition: crsrsh.hxx:459
ring_container GetRingContainer()
MapUnit GetMapUnit() const
bool IsOnlineSpell() const
Definition: viewopt.hxx:371
void AddRight(const tools::Long nAdd)
Definition: swrect.cxx:127
bool empty() const
void SSize(const Size &rNew)
Definition: swrect.hxx:180
void Show(std::vector< OString > *pSelectionRectangles=nullptr)
Definition: viscrs.cxx:411
SwCellFrame * GetFollowCell() const
Definition: findfrm.cxx:1625
stay with the cursor inside text
IDocumentLayoutAccess const & getIDocumentLayoutAccess() const
Definition: doc.cxx:405
enumrange< T >::Iterator end(enumrange< T >)
const SwPosition * Start() const
Definition: pam.hxx:213
bool Contains(const Point &rPOINT) const
Definition: swrect.hxx:356
bool IsInProtectSect() const
Is node in a protected area?
Definition: node.cxx:416
OString getLOKPayload(int nType, int nViewId, bool *ignore) const
Definition: viscrs.cxx:269
SwSelPaintRects(const SwCursorShell &rCSh)
Definition: viscrs.cxx:349
SwRect m_aLastLOKRect
Definition: viscrs.hxx:46
SAL_WARN_UNUSED_RESULT Point PixelToLogic(const Point &rDevicePt) const
virtual void FillStartEnd(SwRect &rStart, SwRect &rEnd) const override
Definition: viscrs.cxx:404
virtual ~SwSelPaintRects()
Definition: viscrs.cxx:357
static void Get1PixelInLogic(const SwViewShell &rSh, tools::Long *pX=nullptr, tools::Long *pY=nullptr)
Definition: viscrs.cxx:654
virtual void FillRects()=0
void Bottom(const tools::Long nBottom)
Definition: swrect.hxx:211
SwTextNode is a paragraph in the document model.
Definition: ndtxt.hxx:79
SwSelBoxes m_SelectedBoxes
Definition: swcrsr.hxx:261
std::vector< SwRect > SwRects
Definition: swregion.hxx:26
bool IsReadOnlyAvailable() const
Definition: crsrsh.hxx:474
SwWrtShell * GetWrtShellPtr() const
Definition: view.hxx:414
SwCursor * GetCursor(bool bMakeTableCursor=true) const
Return pointer to the current shell cursor.
Definition: crsrsh.cxx:194
tools::Rectangle SVRect() const
Definition: swrect.hxx:292
Point m_aCursorHeight
height & offset from visible Cursor
Definition: crsrsh.hxx:166
bool m_bIsDragCursor
Definition: viscrs.hxx:49
constexpr tools::Long Height() const
const SwViewOption * GetViewOptions() const
Definition: viewsh.hxx:428
void SetCursor(vcl::Cursor *pCursor)
vcl::Window * GetWin() const
Definition: viewsh.hxx:338
vcl::Cursor m_aTextCursor
Definition: viscrs.hxx:42
OUString GetSelText() const
get selected text of a node at current cursor
Definition: crsrsh.cxx:2541
sal_Int32 GetCursorSize() const
size_t CountDirChg() const
Definition: scriptinfo.hxx:139
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
::OutputDevice const * GetOutDev() const
if(aStr!=aBuf) UpdateName_Impl(m_xFollowLb.get()
SwNodes & GetNodes()
Definition: doc.hxx:409
bool m_bParked
Definition: swcrsr.hxx:263
static tools::Long s_nPixPtY
Definition: viscrs.hxx:76
const SwPosition * End() const
Definition: pam.hxx:218
bool IsRightToLeft() const
Definition: frame.hxx:988
void Top(const tools::Long nTop)
Definition: swrect.hxx:206
SwPostItMgr * GetPostItMgr()
Definition: view.hxx:639
const sal_Int32 * End() const
Definition: txatbase.hxx:152
virtual SwCursor * Create(SwPaM *pRing=nullptr) const override
Definition: viscrs.cxx:793
const Point & GetPtPos() const
Definition: viscrs.hxx:146
SwWrongList * GetWrong()
Definition: txtedt.cxx:2214
static tools::Long s_nPixPtX
Definition: viscrs.hxx:76
bool GetCurAttr(SfxItemSet &, const bool bMergeIndentValuesOfNumRule=false) const
Definition: edattr.cxx:171
static OString makeVisCursorInvalidation(int nViewId, const OString &rRectangle, bool bMispelledWord=false, const OString &rHyperlink="")
bool IsVisible() const
SwTableNode * FindTableNode()
Search table node, in which it is.
Definition: node.cxx:357
void Show()
Definition: viscrs.cxx:90
virtual bool IsAtValidPos(bool bPoint=true) const
Return if cursor can be set to this position.
Definition: swcrsr.cxx:720
static void notifyUpdate(SfxViewShell const *pViewShell, int nType)
const Point & GetEndPos() const
Definition: viscrs.hxx:152
static OString makePayloadJSON(const SfxViewShell *pThisView, int nViewId, std::string_view rKey, const OString &rPayload)
SwRect m_aStart
Left edge of the selection start (top left cell).
Definition: viscrs.hxx:178
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:1918
SwDoc & GetDoc() const
Definition: pam.hxx:244
sal_uInt16 m_nPageLastTime
For LibreOfficeKit only - remember what page we were at the last time.
Definition: viscrs.hxx:45
virtual void SetMark()
Unless this is called, the getter method of Mark will return Point.
Definition: pam.cxx:478
const SwCursorShell * m_pCursorShell
Definition: viscrs.hxx:41
virtual bool IsReadOnlyAvailable() const override
Definition: viscrs.cxx:709
SwRect m_aCharRect
Char-SRectangle on which the cursor is located.
Definition: crsrsh.hxx:165
Point m_MarkPt
Definition: viscrs.hxx:124
rtl::OString toString() const
const vcl::Cursor & GetTextCursor() const
Definition: viscrs.cxx:344
SwRootFrame * GetLayout() const
Definition: viewsh.cxx:2166
void swapContent(SwSelPaintRects &rSwap)
Definition: viscrs.cxx:362
void SetDirection(CursorDirection nDirection=CursorDirection::NONE)
bool IsTextNode() const
Definition: node.hxx:640
void Height(tools::Long nNew)
Definition: swrect.hxx:193
std::unique_ptr< sw::overlay::OverlayRangesOutline > m_pTextInputFieldOverlay
Definition: viscrs.hxx:86
bool Overlaps(const SwRect &rRect) const
Definition: swrect.hxx:374
SdrPaintWindow * GetPaintWindow(sal_uInt32 nIndex) const
void SetWidth(tools::Long nNewWidth)
SwCellFrame is one table cell in the document layout.
Definition: cellfrm.hxx:30
Definition: view.hxx:144
static void notifyOtherView(const SfxViewShell *pThisView, SfxViewShell const *pOtherView, int nType, std::string_view rKey, const OString &rPayload)
static std::unique_ptr< weld::Builder > CreateBuilder(weld::Widget *pParent, const OUString &rUIFile, bool bMobile=false, sal_uInt64 nLOKWindowId=0)
SwTextNode * GetTextNode()
Inline methods from Node.hxx.
Definition: ndtxt.hxx:856
bool IsSelectionInReadonly() const
Definition: viewopt.hxx:466
static SwTextField * GetTextFieldAtPos(const SwPosition *pPos, const bool bIncludeInputFieldAtStart)
Definition: crstrvl.cxx:881
Base class of the Writer document model elements.
Definition: node.hxx:81