LibreOffice Module sw (master)  1
unotxvw.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 <viscrs.hxx>
22 #include <o3tl/any.hxx>
23 #include <sfx2/frame.hxx>
24 #include <sfx2/printer.hxx>
25 #include <sfx2/viewfrm.hxx>
26 #include <cmdid.h>
27 #include <docsh.hxx>
28 #include <rubylist.hxx>
29 #include <doc.hxx>
31 #include <unotxvw.hxx>
32 #include <unodispatch.hxx>
33 #include <unomap.hxx>
34 #include <unoprnms.hxx>
35 #include <view.hxx>
36 #include <viewopt.hxx>
37 #include <unomod.hxx>
38 #include <unoframe.hxx>
39 #include <unocrsr.hxx>
40 #include <wrtsh.hxx>
41 #include <unotbl.hxx>
42 #include <svx/fmshell.hxx>
43 #include <svx/svdview.hxx>
44 #include <svx/svdpage.hxx>
45 #include <svx/svdouno.hxx>
46 #include <editeng/pbinitem.hxx>
47 #include <pagedesc.hxx>
48 #include <editeng/lrspitem.hxx>
49 #include <editeng/ulspitem.hxx>
50 #include <sfx2/bindings.hxx>
51 #include <sfx2/request.hxx>
52 #include <frmatr.hxx>
53 #include <IMark.hxx>
54 #include <unodraw.hxx>
55 #include <svx/svdpagv.hxx>
56 #include <ndtxt.hxx>
57 #include <SwStyleNameMapper.hxx>
58 #include <com/sun/star/beans/PropertyAttribute.hpp>
59 #include <com/sun/star/drawing/ShapeCollection.hpp>
60 #include <editeng/outliner.hxx>
61 #include <editeng/editview.hxx>
62 #include <unoparagraph.hxx>
63 #include <unocrsrhelper.hxx>
64 #include <unotextrange.hxx>
65 #include <sfx2/docfile.hxx>
66 #include <swdtflvr.hxx>
67 #include <vcl/svapp.hxx>
73 #include <tools/UnitConversion.hxx>
74 
75 using namespace ::com::sun::star;
76 using namespace ::com::sun::star::uno;
77 using namespace ::com::sun::star::lang;
78 using namespace ::com::sun::star::beans;
79 using namespace ::com::sun::star::text;
80 using namespace ::com::sun::star::view;
81 using namespace ::com::sun::star::frame;
82 
83 using ::com::sun::star::util::URL;
84 
86  SfxBaseController(pSwView),
87  m_SelChangedListeners(m_aMutex),
88  m_pView(pSwView),
89  m_pPropSet( aSwMapProvider.GetPropertySet( PROPERTY_MAP_TEXT_VIEW ) ),
90  mxViewSettings(),
91  mxTextViewCursor()
92 {
93 
94 }
95 
97 {
98  Invalidate();
99 }
100 
102 {
103  if(mxViewSettings.is())
104  {
106  static_cast < SwXViewSettings* > ( pSettings )->Invalidate();
107  mxViewSettings.clear();
108  }
109  if(mxTextViewCursor.is())
110  {
111  text::XTextViewCursor* pCursor = mxTextViewCursor.get();
112  static_cast<SwXTextViewCursor*>(pCursor)->Invalidate();
113  mxTextViewCursor.clear();
114  }
115 
116  osl_atomic_increment(&m_refCount); //prevent second d'tor call
117 
118  {
119  uno::Reference<uno::XInterface> const xInt(static_cast<
120  cppu::OWeakObject*>(static_cast<SfxBaseController*>(this)));
121  lang::EventObject aEvent(xInt);
123  }
124 
125  osl_atomic_decrement(&m_refCount);
126  m_pView = nullptr;
127 }
128 
129 Sequence< uno::Type > SAL_CALL SwXTextView::getTypes( )
130 {
131  return cppu::OTypeCollection(
140  SfxBaseController::getTypes()
141  ).getTypes();
142 }
143 
144 Sequence< sal_Int8 > SAL_CALL SwXTextView::getImplementationId( )
145 {
146  return css::uno::Sequence<sal_Int8>();
147 }
148 
149 void SAL_CALL SwXTextView::acquire( )throw()
150 {
151  SfxBaseController::acquire();
152 }
153 
154 void SAL_CALL SwXTextView::release( )throw()
155 {
156  SfxBaseController::release();
157 }
158 
160 {
161  uno::Any aRet;
163  {
164  uno::Reference<view::XSelectionSupplier> xRet = this;
165  aRet <<= xRet;
166  }
167  else if(aType == cppu::UnoType<lang::XServiceInfo>::get())
168  {
169  uno::Reference<lang::XServiceInfo> xRet = this;
170  aRet <<= xRet;
171  }
172  else if(aType == cppu::UnoType<view::XControlAccess>::get())
173  {
174  uno::Reference<view::XControlAccess> xRet = this;
175  aRet <<= xRet;
176  }
178  {
179  uno::Reference<view::XFormLayerAccess> xRet = this;
180  aRet <<= xRet;
181  }
183  {
184  uno::Reference<text::XTextViewCursorSupplier> xRet = this;
185  aRet <<= xRet;
186  }
188  {
189  uno::Reference<view::XViewSettingsSupplier> xRet = this;
190  aRet <<= xRet;
191  }
192  else if(aType == cppu::UnoType<XRubySelection>::get())
193  {
194  uno::Reference<XRubySelection> xRet = this;
195  aRet <<= xRet;
196  }
197  else if(aType == cppu::UnoType<XPropertySet>::get())
198  {
199  uno::Reference<XPropertySet> xRet = this;
200  aRet <<= xRet;
201  }
203  {
204  uno::Reference<datatransfer::XTransferableSupplier> xRet = this;
205  aRet <<= xRet;
206  }
207  else
208  aRet = SfxBaseController::queryInterface(aType);
209  return aRet;
210 }
211 
213 {
214  SolarMutexGuard aGuard;
215 
216  uno::Reference< uno::XInterface > xInterface;
217  if (!GetView() || !(aInterface >>= xInterface))
218  {
219  return false;
220  }
221 
222  SwWrtShell& rSh = GetView()->GetWrtShell();
223  SwDoc* pDoc = GetView()->GetDocShell()->GetDoc();
224  std::vector<SdrObject *> sdrObjects;
225  uno::Reference<awt::XControlModel> const xCtrlModel(xInterface,
226  UNO_QUERY);
227  if (xCtrlModel.is())
228  {
229  uno::Reference<awt::XControl> xControl;
230  SdrObject *const pSdrObject = GetControl(xCtrlModel, xControl);
231  if (pSdrObject) // hmm... needs view to verify it's in right doc...
232  {
233  sdrObjects.push_back(pSdrObject);
234  }
235  }
236  else
237  {
238  SwPaM * pPaM(nullptr);
239  std::pair<OUString, FlyCntType> frame;
240  OUString tableName;
241  SwUnoTableCursor const* pTableCursor(nullptr);
242  ::sw::mark::IMark const* pMark(nullptr);
243  SwUnoCursorHelper::GetSelectableFromAny(xInterface, *pDoc,
244  pPaM, frame, tableName, pTableCursor, pMark, sdrObjects);
245  if (pPaM)
246  {
247  rSh.EnterStdMode();
248  rSh.SetSelection(*pPaM);
249  // the pPaM has been copied - delete it
250  while (pPaM->GetNext() != pPaM)
251  delete pPaM->GetNext();
252  delete pPaM;
253  return true;
254  }
255  else if (!frame.first.isEmpty())
256  {
257  bool const bSuccess(rSh.GotoFly(frame.first, frame.second));
258  if (bSuccess)
259  {
260  rSh.HideCursor();
261  rSh.EnterSelFrameMode();
262  }
263  return true;
264  }
265  else if (!tableName.isEmpty())
266  {
267  rSh.EnterStdMode();
268  rSh.GotoTable(tableName);
269  return true;
270  }
271  else if (pTableCursor)
272  {
273  UnoActionRemoveContext const aContext(*pTableCursor);
274  rSh.EnterStdMode();
275  rSh.SetSelection(*pTableCursor);
276  return true;
277  }
278  else if (pMark)
279  {
280  rSh.EnterStdMode();
281  rSh.GotoMark(pMark);
282  return true;
283  }
284  // sdrObjects handled below
285  }
286  bool bRet(false);
287  if (!sdrObjects.empty())
288  {
289 
290  SdrView *const pDrawView = rSh.GetDrawView();
291  SdrPageView *const pPV = pDrawView->GetSdrPageView();
292 
293  pDrawView->SdrEndTextEdit();
294  pDrawView->UnmarkAll();
295 
296  for (SdrObject* pSdrObject : sdrObjects)
297  {
298  // GetSelectableFromAny did not check pSdrObject is in right doc!
299  if (pPV && pSdrObject->getSdrPageFromSdrObject() == pPV->GetPage())
300  {
301  pDrawView->MarkObj(pSdrObject, pPV);
302  bRet = true;
303  }
304  }
305 
306  // tdf#112696 if we selected every individual element of a group, then
307  // select that group instead
308  const SdrMarkList &rMrkList = pDrawView->GetMarkedObjectList();
309  size_t nMarkCount = rMrkList.GetMarkCount();
310  if (nMarkCount > 1)
311  {
312  SdrObject* pObject = rMrkList.GetMark(0)->GetMarkedSdrObj();
313  SdrObject* pGroupParent = pObject->getParentSdrObjectFromSdrObject();
314  for (size_t i = 1; i < nMarkCount; ++i)
315  {
316  pObject = rMrkList.GetMark(i)->GetMarkedSdrObj();
317  SdrObject* pParent = pObject->getParentSdrObjectFromSdrObject();
318  if (pParent != pGroupParent)
319  {
320  pGroupParent = nullptr;
321  break;
322  }
323  }
324 
325  if (pGroupParent && pGroupParent->IsGroupObject() &&
326  pGroupParent->getChildrenOfSdrObject()->GetObjCount() == nMarkCount)
327  {
328  pDrawView->UnmarkAll();
329  pDrawView->MarkObj(pGroupParent, pPV);
330  }
331  }
332  }
333  return bRet;
334 }
335 
337 {
338  SolarMutexGuard aGuard;
339  uno::Reference< uno::XInterface > aRef;
340  if(GetView())
341  {
342  //force immediat shell update
344  //Generating an interface from the current selection.
345  SwWrtShell& rSh = m_pView->GetWrtShell();
346  ShellMode eSelMode = m_pView->GetShellMode();
347  switch(eSelMode)
348  {
349  case ShellMode::TableText :
350  {
351  if(rSh.GetTableCursor())
352  {
353  OSL_ENSURE(rSh.GetTableFormat(), "not a table format?");
354  uno::Reference< text::XTextTableCursor > xCursor = new SwXTextTableCursor(*rSh.GetTableFormat(),
355  rSh.GetTableCursor());
356  aRef.set(xCursor, uno::UNO_QUERY);
357  break;
358  }
359  [[fallthrough]];
360  // without a table selection the text will be delivered
361  }
362  case ShellMode::ListText :
364  case ShellMode::Text :
365  {
366  uno::Reference< container::XIndexAccess > xPos = SwXTextRanges::Create(rSh.GetCursor());
367  aRef.set(xPos, uno::UNO_QUERY);
368  }
369  break;
370  case ShellMode::Frame :
371  {
372  SwFrameFormat *const pFormat = rSh.GetFlyFrameFormat();
373  if (pFormat)
374  {
376  *pFormat->GetDoc(), pFormat);
377  }
378  }
379  break;
380  case ShellMode::Graphic :
381  {
382  SwFrameFormat *const pFormat = rSh.GetFlyFrameFormat();
383  if (pFormat)
384  {
386  *pFormat->GetDoc(), pFormat);
387  }
388  }
389  break;
390  case ShellMode::Object :
391  {
392  SwFrameFormat *const pFormat = rSh.GetFlyFrameFormat();
393  if (pFormat)
394  {
396  *pFormat->GetDoc(), pFormat);
397  }
398  }
399  break;
400  case ShellMode::Draw :
401  case ShellMode::DrawForm :
402  case ShellMode::DrawText :
403  case ShellMode::Bezier :
404  {
405  uno::Reference< drawing::XShapes > xShCol = drawing::ShapeCollection::create(
407 
408  const SdrMarkList& rMarkList = rSh.GetDrawView()->GetMarkedObjectList();
409  for(size_t i = 0; i < rMarkList.GetMarkCount(); ++i)
410  {
411  SdrObject* pObj = rMarkList.GetMark(i)->GetMarkedSdrObj();
412  uno::Reference<drawing::XShape> xShape = SwFmDrawPage::GetShape( pObj );
413  xShCol->add(xShape);
414  }
415  aRef.set(xShCol, uno::UNO_QUERY);
416  }
417  break;
418  default:;//prevent warning
419  }
420  }
422  return aRet;
423 }
424 
426  const uno::Reference< view::XSelectionChangeListener > & rxListener)
427 {
428  SolarMutexGuard aGuard;
430 }
431 
433  const uno::Reference< view::XSelectionChangeListener > & rxListener)
434 {
435  SolarMutexGuard aGuard;
437 }
438 
440  const uno::Reference< awt::XControlModel > & xModel,
441  uno::Reference< awt::XControl >& xToFill )
442 {
443  SwView* pView2 = GetView();
444  FmFormShell* pFormShell = pView2 ? pView2->GetFormShell() : nullptr;
445  SdrView* pDrawView = pView2 ? pView2->GetDrawView() : nullptr;
446  vcl::Window* pWindow = pView2 ? pView2->GetWrtShell().GetWin() : nullptr;
447 
448  OSL_ENSURE( pFormShell && pDrawView && pWindow, "SwXTextView::GetControl: how could I?" );
449 
450  SdrObject* pControl = nullptr;
451  if ( pFormShell && pDrawView && pWindow )
452  pControl = pFormShell->GetFormControl( xModel, *pDrawView, *pWindow, xToFill );
453  return pControl;
454 }
455 
456 uno::Reference< awt::XControl > SwXTextView::getControl(const uno::Reference< awt::XControlModel > & xModel)
457 {
458  SolarMutexGuard aGuard;
459  uno::Reference< awt::XControl > xRet;
460  GetControl(xModel, xRet);
461  return xRet;
462 }
463 
464 uno::Reference< form::runtime::XFormController > SAL_CALL SwXTextView::getFormController( const uno::Reference< form::XForm >& Form )
465 {
466  SolarMutexGuard aGuard;
467 
468  SwView* pView2 = GetView();
469  FmFormShell* pFormShell = pView2 ? pView2->GetFormShell() : nullptr;
470  SdrView* pDrawView = pView2 ? pView2->GetDrawView() : nullptr;
471  vcl::Window* pWindow = pView2 ? pView2->GetWrtShell().GetWin() : nullptr;
472  OSL_ENSURE( pFormShell && pDrawView && pWindow, "SwXTextView::getFormController: how could I?" );
473 
474  uno::Reference< form::runtime::XFormController > xController;
475  if ( pFormShell && pDrawView && pWindow )
476  xController = FmFormShell::GetFormController( Form, *pDrawView, *pWindow );
477  return xController;
478 }
479 
481 {
482  SolarMutexGuard aGuard;
483  SwView* pView2 = GetView();
484  FmFormShell* pFormShell = pView2 ? pView2->GetFormShell() : nullptr;
485  return !pFormShell || pFormShell->IsDesignMode();
486 }
487 
488 void SAL_CALL SwXTextView::setFormDesignMode( sal_Bool DesignMode )
489 {
490  SolarMutexGuard aGuard;
491  SwView* pView2 = GetView();
492  FmFormShell* pFormShell = pView2 ? pView2->GetFormShell() : nullptr;
493  if ( pFormShell )
494  pFormShell->SetDesignMode( DesignMode );
495 }
496 
497 uno::Reference< text::XTextViewCursor > SwXTextView::getViewCursor()
498 {
499  SolarMutexGuard aGuard;
500  comphelper::ProfileZone aZone("getViewCursor");
501  if(!GetView())
502  throw uno::RuntimeException();
503 
504  if(!mxTextViewCursor.is())
505  {
507  }
508  return mxTextViewCursor;
509 }
510 
511 uno::Reference< beans::XPropertySet > SwXTextView::getViewSettings()
512 {
513  SolarMutexGuard aGuard;
514  if(!m_pView)
515  throw uno::RuntimeException();
516 
517  if(!mxViewSettings.is())
518  {
520  }
521 
522  return mxViewSettings;
523 }
524 
525 Sequence< Sequence< PropertyValue > > SwXTextView::getRubyList( sal_Bool /*bAutomatic*/ )
526 {
527  SolarMutexGuard aGuard;
528 
529  if(!GetView())
530  throw RuntimeException();
531  SwWrtShell& rSh = m_pView->GetWrtShell();
532  ShellMode eSelMode = m_pView->GetShellMode();
533  if (eSelMode != ShellMode::ListText &&
534  eSelMode != ShellMode::TableListText &&
535  eSelMode != ShellMode::TableText &&
536  eSelMode != ShellMode::Text )
537  return Sequence< Sequence< PropertyValue > > ();
538 
539  SwRubyList aList;
540 
541  const sal_uInt16 nCount = SwDoc::FillRubyList( *rSh.GetCursor(), aList );
542  Sequence< Sequence< PropertyValue > > aRet(nCount);
543  Sequence< PropertyValue >* pRet = aRet.getArray();
544  OUString aString;
545  for(sal_uInt16 n = 0; n < nCount; n++)
546  {
547  const SwRubyListEntry* pEntry = aList[n].get();
548 
549  const OUString& rEntryText = pEntry->GetText();
550  const SwFormatRuby& rAttr = pEntry->GetRubyAttr();
551 
552  pRet[n].realloc(6);
553  PropertyValue* pValues = pRet[n].getArray();
554  pValues[0].Name = UNO_NAME_RUBY_BASE_TEXT;
555  pValues[0].Value <<= rEntryText;
556  pValues[1].Name = UNO_NAME_RUBY_TEXT;
557  pValues[1].Value <<= rAttr.GetText();
558  pValues[2].Name = UNO_NAME_RUBY_CHAR_STYLE_NAME;
560  pValues[2].Value <<= aString;
561  pValues[3].Name = UNO_NAME_RUBY_ADJUST;
562  pValues[3].Value <<= static_cast<sal_Int16>(rAttr.GetAdjustment());
563  pValues[4].Name = UNO_NAME_RUBY_IS_ABOVE;
564  pValues[4].Value <<= !rAttr.GetPosition();
565  pValues[5].Name = UNO_NAME_RUBY_POSITION;
566  pValues[5].Value <<= rAttr.GetPosition();
567  }
568  return aRet;
569 }
570 
572  const Sequence< Sequence< PropertyValue > >& rRubyList, sal_Bool /*bAutomatic*/ )
573 {
574  SolarMutexGuard aGuard;
575 
576  if(!GetView() || !rRubyList.hasElements())
577  throw RuntimeException();
578  SwWrtShell& rSh = m_pView->GetWrtShell();
579  ShellMode eSelMode = m_pView->GetShellMode();
580  if (eSelMode != ShellMode::ListText &&
581  eSelMode != ShellMode::TableListText &&
582  eSelMode != ShellMode::TableText &&
583  eSelMode != ShellMode::Text )
584  throw RuntimeException();
585 
586  SwRubyList aList;
587 
588  for(const Sequence<PropertyValue>& rPropList : rRubyList)
589  {
590  std::unique_ptr<SwRubyListEntry> pEntry(new SwRubyListEntry);
591  OUString sTmp;
592  for(const PropertyValue& rProperty : rPropList)
593  {
594  if(rProperty.Name == UNO_NAME_RUBY_BASE_TEXT)
595  {
596  rProperty.Value >>= sTmp;
597  pEntry->SetText(sTmp);
598  }
599  else if(rProperty.Name == UNO_NAME_RUBY_TEXT)
600  {
601  rProperty.Value >>= sTmp;
602  pEntry->GetRubyAttr().SetText(sTmp);
603  }
604  else if(rProperty.Name == UNO_NAME_RUBY_CHAR_STYLE_NAME)
605  {
606  if(rProperty.Value >>= sTmp)
607  {
608  OUString sName;
610  const sal_uInt16 nPoolId = sName.isEmpty() ? 0
613 
614  pEntry->GetRubyAttr().SetCharFormatName( sName );
615  pEntry->GetRubyAttr().SetCharFormatId( nPoolId );
616  }
617  }
618  else if(rProperty.Name == UNO_NAME_RUBY_ADJUST)
619  {
620  sal_Int16 nTmp = 0;
621  if(rProperty.Value >>= nTmp)
622  pEntry->GetRubyAttr().SetAdjustment(static_cast<css::text::RubyAdjust>(nTmp));
623  }
624  else if(rProperty.Name == UNO_NAME_RUBY_IS_ABOVE)
625  {
626  bool bValue = !rProperty.Value.hasValue() ||
627  *o3tl::doAccess<bool>(rProperty.Value);
628  pEntry->GetRubyAttr().SetPosition(bValue ? 0 : 1);
629  }
630  else if(rProperty.Name == UNO_NAME_RUBY_POSITION)
631  {
632  sal_Int16 nTmp = 0;
633  if(rProperty.Value >>= nTmp)
634  pEntry->GetRubyAttr().SetPosition( nTmp );
635  }
636  }
637  aList.push_back(std::move(pEntry));
638  }
639  SwDoc* pDoc = m_pView->GetDocShell()->GetDoc();
640  pDoc->SetRubyList( *rSh.GetCursor(), aList );
641 }
642 
644 {
645  SwWrtShell& rOldSh = m_pView->GetWrtShell();
646  SfxPrinter *pPrt = rOldSh.getIDocumentDeviceAccess().getPrinter( false );
647  SwDocShell* pDocSh;
648  SfxObjectShellLock xDocSh( pDocSh = new SwDocShell( /*pPrtDoc, */SfxObjectCreateMode::STANDARD ) );
649  xDocSh->DoInitNew();
650  SwDoc *const pTempDoc( pDocSh->GetDoc() );
651  // #i103634#, #i112425#: do not expand numbering and fields on PDF export
652  pTempDoc->SetClipBoard(true);
653  rOldSh.FillPrtDoc(pTempDoc, pPrt);
655  SwView* pDocView = static_cast<SwView*>( pDocFrame->GetViewShell() );
656  pDocView->AttrChangedNotify(nullptr);//So that SelectShell is called.
657  SwWrtShell* pSh = pDocView->GetWrtShellPtr();
658 
660  SfxPrinter* pTempPrinter = rIDDA.getPrinter( true );
661 
662  const SwPageDesc& rCurPageDesc = rOldSh.GetPageDesc(rOldSh.GetCurPageDesc());
663 
664  IDocumentDeviceAccess& rIDDA_old = rOldSh.getIDocumentDeviceAccess();
665 
666  if( rIDDA_old.getPrinter( false ) )
667  {
668  rIDDA.setJobsetup( *rIDDA_old.getJobsetup() );
669  //#69563# if it isn't the same printer then the pointer has been invalidated!
670  pTempPrinter = rIDDA.getPrinter( true );
671  }
672 
673  pTempPrinter->SetPaperBin(rCurPageDesc.GetMaster().GetPaperBin().GetValue());
674 
675  return xDocSh;
676 }
677 
679 {
680  OSL_ENSURE( m_pView, "view is missing" );
681 
682  uno::Reference<uno::XInterface> const xInt(
683  static_cast<cppu::OWeakObject*>(static_cast<SfxBaseController*>(this)));
684 
685  lang::EventObject const aEvent(xInt);
687  &view::XSelectionChangeListener::selectionChanged, aEvent);
688 }
689 
690 namespace {
691  struct DispatchListener
692  {
693  URL const & m_rURL;
694  Sequence<PropertyValue> const& m_rSeq;
695  explicit DispatchListener(URL const& rURL,
696  Sequence<PropertyValue> const& rSeq)
697  : m_rURL(rURL), m_rSeq(rSeq) { }
698  void operator()(uno::Reference<XDispatch> const & xListener) const
699  {
700  xListener->dispatch(m_rURL, m_rSeq);
701  }
702  };
703 }
704 
706 {
707  URL aURL;
708  aURL.Complete = OUString::createFromAscii(SwXDispatch::GetDBChangeURL());
709 
710  m_SelChangedListeners.forEach<XDispatch>(
711  DispatchListener(aURL, Sequence<PropertyValue>(0)));
712 }
713 
714 uno::Reference< beans::XPropertySetInfo > SAL_CALL SwXTextView::getPropertySetInfo( )
715 {
716  SolarMutexGuard aGuard;
717  static uno::Reference< XPropertySetInfo > aRef = m_pPropSet->getPropertySetInfo();
718  return aRef;
719 }
720 
722  const OUString& rPropertyName, const uno::Any& rValue )
723 {
724  SolarMutexGuard aGuard;
725  const SfxItemPropertySimpleEntry* pEntry = m_pPropSet->getPropertyMap().getByName( rPropertyName );
726  if (!pEntry)
727  throw UnknownPropertyException(rPropertyName);
728  else if (pEntry->nFlags & PropertyAttribute::READONLY)
729  throw PropertyVetoException();
730  else
731  {
732  switch (pEntry->nWID)
733  {
735  // deprecated #i91949
736  break;
738  {
739  bool bVal = false;
740  const SwViewOption *pOpt = m_pView->GetWrtShell().GetViewOptions();
741  if (!pOpt || !(rValue >>= bVal))
742  throw RuntimeException();
743  SwViewOption aNewOpt( *pOpt );
744  if (pEntry->nWID == WID_IS_CONSTANT_SPELLCHECK)
745  aNewOpt.SetOnlineSpell(bVal);
746  m_pView->GetWrtShell().ApplyViewOptions( aNewOpt );
747  }
748  break;
749  default :
750  OSL_FAIL("unknown WID");
751  }
752  }
753 }
754 
756  const OUString& rPropertyName )
757 {
758  SolarMutexGuard aGuard;
759 
760  Any aRet;
761 
762  const SfxItemPropertySimpleEntry* pEntry = m_pPropSet->getPropertyMap().getByName( rPropertyName );
763  if (!pEntry)
764  throw UnknownPropertyException(rPropertyName);
765 
766  sal_Int16 nWID = pEntry->nWID;
767  switch (nWID)
768  {
769  case WID_PAGE_COUNT :
770  case WID_LINE_COUNT :
771  {
772  // format document completely in order to get meaningful
773  // values for page count and line count
775 
776  sal_Int32 nCount = -1;
777  if (nWID == WID_PAGE_COUNT)
778  nCount = m_pView->GetWrtShell().GetPageCount();
779  else // WID_LINE_COUNT
780  nCount = m_pView->GetWrtShell().GetLineCount();
781  aRet <<= nCount;
782  }
783  break;
785  // deprecated #i91949
786  break;
788  {
789  const SwViewOption *pOpt = m_pView->GetWrtShell().GetViewOptions();
790  if (!pOpt)
791  throw RuntimeException();
792  aRet <<= bool(pOpt->GetCoreOptions() & ViewOptFlags1::OnlineSpell);
793  }
794  break;
795  default :
796  OSL_FAIL("unknown WID");
797  }
798 
799  return aRet;
800 }
801 
803  const OUString& /*rPropertyName*/,
804  const uno::Reference< beans::XPropertyChangeListener >& /*rxListener*/ )
805 {
806  OSL_FAIL("not implemented");
807 }
808 
810  const OUString& /*rPropertyName*/,
811  const uno::Reference< beans::XPropertyChangeListener >& /*rxListener*/ )
812 {
813  OSL_FAIL("not implemented");
814 }
815 
817  const OUString& /*rPropertyName*/,
818  const uno::Reference< beans::XVetoableChangeListener >& /*rxListener*/ )
819 {
820  OSL_FAIL("not implemented");
821 }
822 
824  const OUString& /*rPropertyName*/,
825  const uno::Reference< beans::XVetoableChangeListener >& /*rxListener*/ )
826 {
827  OSL_FAIL("not implemented");
828 }
829 
831 {
832  return "SwXTextView";
833 }
834 
835 sal_Bool SwXTextView::supportsService(const OUString& rServiceName)
836 {
837  return cppu::supportsService(this, rServiceName);
838 }
839 
841 {
842  return { "com.sun.star.text.TextDocumentView", "com.sun.star.view.OfficeDocumentView" };
843 }
844 
846  m_pView(pVw),
847  m_pPropSet(aSwMapProvider.GetPropertySet(PROPERTY_MAP_TEXT_CURSOR))
848 {
849 }
850 
852 {
853 }
854 
855 // used to determine if there is a text selection or not.
856 // If there is no text selection the functions that need a working
857 // cursor will be disabled (throw RuntimeException). This will be the case
858 // for the following interfaces:
859 // - XViewCursor
860 // - XTextCursor
861 // - XTextRange
862 // - XLineCursor
863 bool SwXTextViewCursor::IsTextSelection( bool bAllowTables ) const
864 {
865 
866  bool bRes = false;
867  OSL_ENSURE(m_pView, "m_pView is NULL ???");
868  if(m_pView)
869  {
873  bRes = ( (SelectionType::Text & eSelType) ||
874  (SelectionType::NumberList & eSelType) ) &&
875  (!(SelectionType::TableCell & eSelType) || bAllowTables);
876  }
877  return bRes;
878 }
879 
881 {
882  OSL_FAIL("not implemented");
883  return true;
884 }
885 
887 {
888  OSL_FAIL("not implemented");
889 }
890 
892 {
893  SolarMutexGuard aGuard;
894  awt::Point aRet;
895  if(!m_pView)
896  throw uno::RuntimeException();
897 
898  const SwWrtShell& rSh = m_pView->GetWrtShell();
899  const SwRect& aCharRect(rSh.GetCharRect());
900 
901  const SwFrameFormat& rMaster = rSh.GetPageDesc( rSh.GetCurPageDesc() ).GetMaster();
902 
903  const SvxULSpaceItem& rUL = rMaster.GetULSpace();
904  const long nY = aCharRect.Top() - (rUL.GetUpper() + DOCUMENTBORDER);
905  aRet.Y = convertTwipToMm100(nY);
906 
907  const SvxLRSpaceItem& rLR = rMaster.GetLRSpace();
908  const long nX = aCharRect.Left() - (rLR.GetLeft() + DOCUMENTBORDER);
909  aRet.X = convertTwipToMm100(nX);
910 
911  return aRet;
912 }
913 
915 {
916  SolarMutexGuard aGuard;
917  if(!m_pView)
918  throw uno::RuntimeException();
919 
920  if (!IsTextSelection())
921  throw uno::RuntimeException("no text selection", static_cast < cppu::OWeakObject * > ( this ) );
922 
923  SwWrtShell& rSh = m_pView->GetWrtShell();
924  if(rSh.HasSelection())
925  {
926  SwPaM* pShellCursor = rSh.GetCursor();
927  if(*pShellCursor->GetPoint() > *pShellCursor->GetMark())
928  pShellCursor->Exchange();
929  pShellCursor->DeleteMark();
930  rSh.EnterStdMode();
931  rSh.SetSelection(*pShellCursor);
932  }
933 
934 }
935 
937 {
938  SolarMutexGuard aGuard;
939  if(!m_pView)
940  throw uno::RuntimeException();
941 
942  if (!IsTextSelection())
943  throw uno::RuntimeException("no text selection", static_cast < cppu::OWeakObject * > ( this ) );
944 
945  SwWrtShell& rSh = m_pView->GetWrtShell();
946  if(rSh.HasSelection())
947  {
948  SwPaM* pShellCursor = rSh.GetCursor();
949  if(*pShellCursor->GetPoint() < *pShellCursor->GetMark())
950  pShellCursor->Exchange();
951  pShellCursor->DeleteMark();
952  rSh.EnterStdMode();
953  rSh.SetSelection(*pShellCursor);
954  }
955 
956 }
957 
959 {
960  SolarMutexGuard aGuard;
961  bool bRet = false;
962  if(!m_pView)
963  throw uno::RuntimeException();
964 
965  if (!IsTextSelection())
966  throw uno::RuntimeException("no text selection", static_cast < cppu::OWeakObject * > ( this ) );
967 
968  const SwWrtShell& rSh = m_pView->GetWrtShell();
969  bRet = !rSh.HasSelection();
970 
971  return bRet;
972 
973 }
974 
975 sal_Bool SwXTextViewCursor::goLeft(sal_Int16 nCount, sal_Bool bExpand)
976 {
977  SolarMutexGuard aGuard;
978  bool bRet = false;
979  if(!m_pView)
980  throw uno::RuntimeException();
981 
982  if (!IsTextSelection())
983  throw uno::RuntimeException("no text selection", static_cast < cppu::OWeakObject * > ( this ) );
984 
985  bRet = m_pView->GetWrtShell().Left( CRSR_SKIP_CHARS, bExpand, nCount, true );
986 
987  return bRet;
988 }
989 
990 sal_Bool SwXTextViewCursor::goRight(sal_Int16 nCount, sal_Bool bExpand)
991 {
992  SolarMutexGuard aGuard;
993  bool bRet = false;
994  if(!m_pView)
995  throw uno::RuntimeException();
996 
997  if (!IsTextSelection())
998  throw uno::RuntimeException("no text selection", static_cast < cppu::OWeakObject * > ( this ) );
999 
1000  bRet = m_pView->GetWrtShell().Right( CRSR_SKIP_CHARS, bExpand, nCount, true );
1001 
1002  return bRet;
1003 
1004 }
1005 
1007  const uno::Reference< text::XTextRange > & xRange,
1008  sal_Bool bExpand)
1009 {
1010  SolarMutexGuard aGuard;
1011  if(!(m_pView && xRange.is()))
1012  throw uno::RuntimeException();
1013 
1014  if (!IsTextSelection())
1015  throw uno::RuntimeException("no text selection", static_cast < cppu::OWeakObject * > ( this ) );
1016 
1017  SwUnoInternalPaM rDestPam(*m_pView->GetDocShell()->GetDoc());
1018  if (!::sw::XTextRangeToSwPaM(rDestPam, xRange))
1019  {
1020  throw uno::RuntimeException();
1021  }
1022 
1023  ShellMode eSelMode = m_pView->GetShellMode();
1024  SwWrtShell& rSh = m_pView->GetWrtShell();
1025  // call EnterStdMode in non-text selections only
1026  if(!bExpand ||
1027  (eSelMode != ShellMode::TableText &&
1028  eSelMode != ShellMode::ListText &&
1029  eSelMode != ShellMode::TableListText &&
1030  eSelMode != ShellMode::Text ))
1031  rSh.EnterStdMode();
1032  SwPaM* pShellCursor = rSh.GetCursor();
1033  SwPaM aOwnPaM(*pShellCursor->GetPoint());
1034  if(pShellCursor->HasMark())
1035  {
1036  aOwnPaM.SetMark();
1037  *aOwnPaM.GetMark() = *pShellCursor->GetMark();
1038  }
1039 
1040  uno::Reference<lang::XUnoTunnel> xRangeTunnel( xRange, uno::UNO_QUERY);
1041  SwXTextRange* pRange = nullptr;
1042  SwXParagraph* pPara = nullptr;
1043  OTextCursorHelper* pCursor = nullptr;
1044  if(xRangeTunnel.is())
1045  {
1046  pRange = reinterpret_cast<SwXTextRange*>(xRangeTunnel->getSomething(
1048  pCursor = reinterpret_cast<OTextCursorHelper*>(xRangeTunnel->getSomething(
1050  pPara = reinterpret_cast<SwXParagraph*>(xRangeTunnel->getSomething(
1052  }
1053 
1054  const FrameTypeFlags nFrameType = rSh.GetFrameType(nullptr,true);
1055 
1056  SwStartNodeType eSearchNodeType = SwNormalStartNode;
1057  if(nFrameType & FrameTypeFlags::FLY_ANY)
1058  eSearchNodeType = SwFlyStartNode;
1059  else if(nFrameType &FrameTypeFlags::HEADER)
1060  eSearchNodeType = SwHeaderStartNode;
1061  else if(nFrameType & FrameTypeFlags::FOOTER)
1062  eSearchNodeType = SwFooterStartNode;
1063  else if(nFrameType & FrameTypeFlags::TABLE)
1064  eSearchNodeType = SwTableBoxStartNode;
1065  else if(nFrameType & FrameTypeFlags::FOOTNOTE)
1066  eSearchNodeType = SwFootnoteStartNode;
1067 
1068  const SwStartNode* pOwnStartNode = aOwnPaM.GetNode().
1069  FindSttNodeByType(eSearchNodeType);
1070 
1071  const SwNode* pSrcNode = nullptr;
1072  if(pCursor && pCursor->GetPaM())
1073  {
1074  pSrcNode = &pCursor->GetPaM()->GetNode();
1075  }
1076  else if (pRange)
1077  {
1078  SwPaM aPam(pRange->GetDoc().GetNodes());
1079  if (pRange->GetPositions(aPam))
1080  {
1081  pSrcNode = &aPam.GetNode();
1082  }
1083  }
1084  else if (pPara && pPara->GetTextNode())
1085  {
1086  pSrcNode = pPara->GetTextNode();
1087  }
1088  const SwStartNode* pTmp = pSrcNode ? pSrcNode->FindSttNodeByType(eSearchNodeType) : nullptr;
1089 
1090  //Skip SectionNodes
1091  while(pTmp && pTmp->IsSectionNode())
1092  {
1093  pTmp = pTmp->StartOfSectionNode();
1094  }
1095  while(pOwnStartNode && pOwnStartNode->IsSectionNode())
1096  {
1097  pOwnStartNode = pOwnStartNode->StartOfSectionNode();
1098  }
1099  //Without Expand it is allowed to jump out with the ViewCursor everywhere,
1100  //with Expand only in the same environment
1101  if(bExpand &&
1102  (pOwnStartNode != pTmp ||
1103  (eSelMode != ShellMode::TableText &&
1104  eSelMode != ShellMode::ListText &&
1105  eSelMode != ShellMode::TableListText &&
1106  eSelMode != ShellMode::Text)))
1107  throw uno::RuntimeException();
1108 
1109  //Now, the selection must be expanded.
1110  if(bExpand)
1111  {
1112  // The cursor should include everything that has been included
1113  // by him and the transferred Range.
1114  SwPosition aOwnLeft(*aOwnPaM.Start());
1115  SwPosition aOwnRight(*aOwnPaM.End());
1116  SwPosition* pParamLeft = rDestPam.Start();
1117  SwPosition* pParamRight = rDestPam.End();
1118  // Now four SwPositions are there, two of them are needed, but which?
1119  if(aOwnRight > *pParamRight)
1120  *aOwnPaM.GetPoint() = aOwnRight;
1121  else
1122  *aOwnPaM.GetPoint() = *pParamRight;
1123  aOwnPaM.SetMark();
1124  if(aOwnLeft < *pParamLeft)
1125  *aOwnPaM.GetMark() = aOwnLeft;
1126  else
1127  *aOwnPaM.GetMark() = *pParamLeft;
1128  }
1129  else
1130  {
1131  //The cursor shall match the passed range.
1132  *aOwnPaM.GetPoint() = *rDestPam.GetPoint();
1133  if(rDestPam.HasMark())
1134  {
1135  aOwnPaM.SetMark();
1136  *aOwnPaM.GetMark() = *rDestPam.GetMark();
1137  }
1138  else
1139  aOwnPaM.DeleteMark();
1140  }
1141  rSh.SetSelection(aOwnPaM);
1142 
1143 
1144 }
1145 
1147 {
1148  SolarMutexGuard aGuard;
1149  comphelper::ProfileZone aZone("SwXTextViewCursor::gotoStart");
1150  if(!m_pView)
1151  throw uno::RuntimeException();
1152 
1153  if (!IsTextSelection())
1154  throw uno::RuntimeException("no text selection", static_cast < cppu::OWeakObject * > ( this ) );
1155 
1156  m_pView->GetWrtShell().StartOfSection( bExpand );
1157 
1158 }
1159 
1161 {
1162  SolarMutexGuard aGuard;
1163  comphelper::ProfileZone aZone("SwXTextViewCursor::gotoEnd");
1164  if(!m_pView)
1165  throw uno::RuntimeException();
1166 
1167  if (!IsTextSelection())
1168  throw uno::RuntimeException("no text selection", static_cast < cppu::OWeakObject * > ( this ) );
1169 
1170  m_pView->GetWrtShell().EndOfSection( bExpand );
1171 
1172 }
1173 
1175 {
1176  SolarMutexGuard aGuard;
1177  bool bRet = false;
1178  if(!m_pView)
1179  throw uno::RuntimeException();
1180 
1181  SwWrtShell& rSh = m_pView->GetWrtShell();
1182  if (rSh.IsSelFrameMode())
1183  {
1184  rSh.UnSelectFrame();
1185  rSh.LeaveSelFrameMode();
1186  }
1187  rSh.EnterStdMode();
1188  bRet = rSh.SttEndDoc(true);
1189 
1190  return bRet;
1191 }
1192 
1194 {
1195  SolarMutexGuard aGuard;
1196  bool bRet = false;
1197  if(!m_pView)
1198  throw uno::RuntimeException();
1199 
1200  SwWrtShell& rSh = m_pView->GetWrtShell();
1201  if (rSh.IsSelFrameMode())
1202  {
1203  rSh.UnSelectFrame();
1204  rSh.LeaveSelFrameMode();
1205  }
1206  rSh.EnterStdMode();
1207  bRet = rSh.SttEndDoc(false);
1208  rSh.SttPg();
1209 
1210  return bRet;
1211 }
1212 
1214 {
1215  SolarMutexGuard aGuard;
1216  bool bRet = false;
1217  if(!m_pView)
1218  throw uno::RuntimeException();
1219 
1220  bRet = m_pView->GetWrtShell().GotoPage(nPage, true);
1221 
1222  return bRet;
1223 }
1224 
1226 {
1227  SolarMutexGuard aGuard;
1228  bool bRet = false;
1229  if(!m_pView)
1230  throw uno::RuntimeException();
1231 
1232  bRet = m_pView->GetWrtShell().SttNxtPg();
1233 
1234  return bRet;
1235 }
1236 
1238 {
1239  SolarMutexGuard aGuard;
1240  bool bRet = false;
1241  if(!m_pView)
1242  throw uno::RuntimeException();
1243 
1244  bRet = m_pView->GetWrtShell().EndPrvPg();
1245 
1246  return bRet;
1247 }
1248 
1250 {
1251  SolarMutexGuard aGuard;
1252  bool bRet = false;
1253  if(!m_pView)
1254  throw uno::RuntimeException();
1255 
1256  bRet = m_pView->GetWrtShell().EndPg();
1257 
1258  return bRet;
1259 }
1260 
1262 {
1263  SolarMutexGuard aGuard;
1264  bool bRet = false;
1265  if(!m_pView)
1266  throw uno::RuntimeException();
1267 
1268  bRet = m_pView->GetWrtShell().SttPg();
1269 
1270  return bRet;
1271 }
1272 
1274 {
1275  SolarMutexGuard aGuard;
1276  sal_Int16 nRet = 0;
1277  if(!m_pView)
1278  throw uno::RuntimeException();
1279 
1280  SwWrtShell& rSh = m_pView->GetWrtShell();
1281  SwPaM* pShellCursor = rSh.GetCursor();
1282  nRet = static_cast<sal_Int16>(pShellCursor->GetPageNum());
1283 
1284  return nRet;
1285 }
1286 
1288 {
1289  SolarMutexGuard aGuard;
1290  bool bRet = false;
1291  if(!m_pView)
1292  throw uno::RuntimeException();
1293 
1294  SfxRequest aReq(FN_PAGEDOWN, SfxCallMode::SLOT, m_pView->GetPool());
1295  m_pView->Execute(aReq);
1296  const SfxPoolItem* pRet = aReq.GetReturnValue();
1297  bRet = pRet && static_cast<const SfxBoolItem*>(pRet)->GetValue();
1298 
1299  return bRet;
1300 }
1301 
1303 {
1304  SolarMutexGuard aGuard;
1305  bool bRet = false;
1306  if(!m_pView)
1307  throw uno::RuntimeException();
1308 
1309  SfxRequest aReq(FN_PAGEUP, SfxCallMode::SLOT, m_pView->GetPool());
1310  m_pView->Execute(aReq);
1311  const SfxPoolItem* pRet = aReq.GetReturnValue();
1312  bRet = pRet && static_cast<const SfxBoolItem*>(pRet)->GetValue();
1313 
1314  return bRet;
1315 }
1316 
1317 uno::Reference< text::XText > SwXTextViewCursor::getText()
1318 {
1319  SolarMutexGuard aGuard;
1320  uno::Reference< text::XText > xRet;
1321  if(!m_pView)
1322  throw uno::RuntimeException();
1323 
1324  if (!IsTextSelection( false ))
1325  throw uno::RuntimeException("no text selection", static_cast < cppu::OWeakObject * > ( this ) );
1326 
1327  SwWrtShell& rSh = m_pView->GetWrtShell();
1328  SwPaM* pShellCursor = rSh.GetCursor();
1329  SwDoc* pDoc = m_pView->GetDocShell()->GetDoc();
1330  xRet = ::sw::CreateParentXText(*pDoc, *pShellCursor->Start());
1331 
1332  return xRet;
1333 }
1334 
1335 uno::Reference< text::XTextRange > SwXTextViewCursor::getStart()
1336 {
1337  SolarMutexGuard aGuard;
1338  uno::Reference< text::XTextRange > xRet;
1339  if(!m_pView)
1340  throw uno::RuntimeException();
1341 
1342  if (!IsTextSelection())
1343  throw uno::RuntimeException("no text selection", static_cast < cppu::OWeakObject * > ( this ) );
1344 
1345  SwWrtShell& rSh = m_pView->GetWrtShell();
1346  SwPaM* pShellCursor = rSh.GetCursor();
1347  SwDoc* pDoc = m_pView->GetDocShell()->GetDoc();
1348  xRet = SwXTextRange::CreateXTextRange(*pDoc, *pShellCursor->Start(), nullptr);
1349 
1350  return xRet;
1351 }
1352 
1353 uno::Reference< text::XTextRange > SwXTextViewCursor::getEnd()
1354 {
1355  SolarMutexGuard aGuard;
1356  uno::Reference< text::XTextRange > xRet;
1357  if(!m_pView)
1358  throw uno::RuntimeException();
1359 
1360  if (!IsTextSelection())
1361  throw uno::RuntimeException("no text selection", static_cast < cppu::OWeakObject * > ( this ) );
1362 
1363  SwWrtShell& rSh = m_pView->GetWrtShell();
1364  SwPaM* pShellCursor = rSh.GetCursor();
1365  SwDoc* pDoc = m_pView->GetDocShell()->GetDoc();
1366  xRet = SwXTextRange::CreateXTextRange(*pDoc, *pShellCursor->End(), nullptr);
1367 
1368  return xRet;
1369 }
1370 
1372 {
1373  SolarMutexGuard aGuard;
1374  OUString uRet;
1375  if(m_pView)
1376  {
1377  if (!IsTextSelection( false ))
1378  {
1379  SAL_WARN("sw.uno", "no text selection in getString() " << static_cast<cppu::OWeakObject*>(this));
1380  return uRet;
1381  }
1382 
1383  ShellMode eSelMode = m_pView->GetShellMode();
1384  switch(eSelMode)
1385  {
1390 
1391  case ShellMode::ListText :
1393  case ShellMode::Text :
1394  {
1395  SwWrtShell& rSh = m_pView->GetWrtShell();
1396  SwPaM* pShellCursor = rSh.GetCursor();
1397  SwUnoCursorHelper::GetTextFromPam(*pShellCursor, uRet,
1398  rSh.GetLayout());
1399  break;
1400  }
1401  default:;//prevent warning
1402  }
1403  }
1404  return uRet;
1405 }
1406 
1407 void SwXTextViewCursor::setString(const OUString& aString)
1408 {
1409  SolarMutexGuard aGuard;
1410  if(!m_pView)
1411  return;
1412 
1413  if (!IsTextSelection( false ))
1414  throw uno::RuntimeException("no text selection", static_cast < cppu::OWeakObject * > ( this ) );
1415 
1416  ShellMode eSelMode = m_pView->GetShellMode();
1417  switch(eSelMode)
1418  {
1423 
1424  case ShellMode::ListText :
1426  case ShellMode::Text :
1427  {
1428  SwWrtShell& rSh = m_pView->GetWrtShell();
1429  SwCursor* pShellCursor = rSh.GetSwCursor();
1430  SwUnoCursorHelper::SetString(*pShellCursor, aString);
1431  break;
1432  }
1433  default:;//prevent warning
1434  }
1435 }
1436 
1437 uno::Reference< XPropertySetInfo > SwXTextViewCursor::getPropertySetInfo( )
1438 {
1439  static uno::Reference< XPropertySetInfo > xRef = m_pPropSet->getPropertySetInfo();
1440  return xRef;
1441 }
1442 
1443 void SwXTextViewCursor::setPropertyValue( const OUString& rPropertyName, const Any& aValue )
1444 {
1445  SolarMutexGuard aGuard;
1446  if(!m_pView)
1447  throw RuntimeException();
1448 
1449  SwWrtShell& rSh = m_pView->GetWrtShell();
1450  SwPaM* pShellCursor = rSh.GetCursor();
1451  SwNode& rNode = pShellCursor->GetNode();
1452  if (!rNode.IsTextNode())
1453  throw RuntimeException();
1454 
1456  *pShellCursor, *m_pPropSet, rPropertyName, aValue );
1457 
1458 
1459 }
1460 
1461 Any SwXTextViewCursor::getPropertyValue( const OUString& rPropertyName )
1462 {
1463  SolarMutexGuard aGuard;
1464  Any aRet;
1465  if(!m_pView)
1466  throw RuntimeException();
1467 
1468  SwWrtShell& rSh = m_pView->GetWrtShell();
1469  SwPaM* pShellCursor = rSh.GetCursor();
1471  *pShellCursor, *m_pPropSet, rPropertyName);
1472 
1473  return aRet;
1474 }
1475 
1477  const OUString& /*aPropertyName*/, const uno::Reference< XPropertyChangeListener >& /*xListener*/ )
1478 {
1479 }
1480 
1482  const OUString& /*aPropertyName*/, const uno::Reference< XPropertyChangeListener >& /*aListener*/ )
1483 {
1484 }
1485 
1487  const OUString& /*PropertyName*/, const uno::Reference< XVetoableChangeListener >& /*aListener*/ )
1488 {
1489 }
1490 
1492  const OUString& /*PropertyName*/, const uno::Reference< XVetoableChangeListener >& /*aListener*/ )
1493 {
1494 }
1495 
1496 PropertyState SwXTextViewCursor::getPropertyState( const OUString& rPropertyName )
1497 {
1498  SolarMutexGuard aGuard;
1499  PropertyState eState;
1500  if(!m_pView)
1501  throw RuntimeException();
1502 
1503  SwWrtShell& rSh = m_pView->GetWrtShell();
1504  SwPaM* pShellCursor = rSh.GetCursor();
1506  *pShellCursor, *m_pPropSet, rPropertyName);
1507 
1508  return eState;
1509 }
1510 
1511 Sequence< PropertyState > SwXTextViewCursor::getPropertyStates(
1512  const Sequence< OUString >& rPropertyNames )
1513 {
1514  SolarMutexGuard aGuard;
1515  Sequence< PropertyState > aRet;
1516  if(m_pView)
1517  {
1518  SwWrtShell& rSh = m_pView->GetWrtShell();
1519  SwPaM* pShellCursor = rSh.GetCursor();
1521  *pShellCursor, *m_pPropSet, rPropertyNames);
1522  }
1523  return aRet;
1524 }
1525 
1526 void SwXTextViewCursor::setPropertyToDefault( const OUString& rPropertyName )
1527 {
1528  SolarMutexGuard aGuard;
1529  if(m_pView)
1530  {
1531  SwWrtShell& rSh = m_pView->GetWrtShell();
1532  SwPaM* pShellCursor = rSh.GetCursor();
1534  *pShellCursor, *m_pPropSet, rPropertyName);
1535  }
1536 }
1537 
1538 Any SwXTextViewCursor::getPropertyDefault( const OUString& rPropertyName )
1539 {
1540  Any aRet;
1541  SolarMutexGuard aGuard;
1542  if(m_pView)
1543  {
1544  SwWrtShell& rSh = m_pView->GetWrtShell();
1545  SwPaM* pShellCursor = rSh.GetCursor();
1547  *pShellCursor, *m_pPropSet, rPropertyName);
1548  }
1549  return aRet;
1550 }
1551 
1552 sal_Bool SwXTextViewCursor::goDown(sal_Int16 nCount, sal_Bool bExpand)
1553 {
1554  SolarMutexGuard aGuard;
1555  comphelper::ProfileZone aZone("SwXTextViewCursor::goDown");
1556  bool bRet = false;
1557  if(!m_pView)
1558  throw uno::RuntimeException();
1559 
1560  if (!IsTextSelection())
1561  throw uno::RuntimeException("no text selection", static_cast < cppu::OWeakObject * > ( this ) );
1562 
1563  bRet = m_pView->GetWrtShell().Down( bExpand, nCount, true );
1564 
1565  return bRet;
1566 }
1567 
1568 sal_Bool SwXTextViewCursor::goUp(sal_Int16 nCount, sal_Bool bExpand)
1569 {
1570  SolarMutexGuard aGuard;
1571  comphelper::ProfileZone aZone("SwXTextViewCursor::goUp");
1572  bool bRet = false;
1573  if(!m_pView)
1574  throw uno::RuntimeException();
1575 
1576  if (!IsTextSelection())
1577  throw uno::RuntimeException("no text selection", static_cast < cppu::OWeakObject * > ( this ) );
1578 
1579  bRet = m_pView->GetWrtShell().Up( bExpand, nCount, true );
1580 
1581  return bRet;
1582 }
1583 
1585 {
1586  SolarMutexGuard aGuard;
1587  bool bRet = false;
1588  if(!m_pView)
1589  throw uno::RuntimeException();
1590 
1591  if (!IsTextSelection( false ))
1592  throw uno::RuntimeException("no text selection", static_cast < cppu::OWeakObject * > ( this ) );
1593 
1594  bRet = m_pView->GetWrtShell().IsAtLeftMargin();
1595 
1596  return bRet;
1597 }
1598 
1600 {
1601  SolarMutexGuard aGuard;
1602  bool bRet = false;
1603  if(!m_pView)
1604  throw uno::RuntimeException();
1605 
1606  if (!IsTextSelection( false ))
1607  throw uno::RuntimeException("no text selection", static_cast < cppu::OWeakObject * > ( this ) );
1608 
1609  bRet = m_pView->GetWrtShell().IsAtRightMargin();
1610 
1611  return bRet;
1612 }
1613 
1615 {
1616  SolarMutexGuard aGuard;
1617  if(!m_pView)
1618  throw uno::RuntimeException();
1619 
1620  if (!IsTextSelection( false ))
1621  throw uno::RuntimeException("no text selection", static_cast < cppu::OWeakObject * > ( this ) );
1622 
1623  m_pView->GetWrtShell().RightMargin(bExpand, true);
1624 
1625 }
1626 
1628 {
1629  SolarMutexGuard aGuard;
1630  if(!m_pView)
1631  throw uno::RuntimeException();
1632 
1633  if (!IsTextSelection( false ))
1634  throw uno::RuntimeException("no text selection", static_cast < cppu::OWeakObject * > ( this ) );
1635 
1636  m_pView->GetWrtShell().LeftMargin(bExpand, true);
1637 
1638 }
1639 
1641 {
1642  return "SwXTextViewCursor";
1643 }
1644 
1645 sal_Bool SwXTextViewCursor::supportsService(const OUString& rServiceName)
1646 {
1647  return cppu::supportsService(this, rServiceName);
1648 }
1649 
1651 {
1652  return { "com.sun.star.text.TextViewCursor",
1653  "com.sun.star.style.CharacterProperties",
1654  "com.sun.star.style.CharacterPropertiesAsian",
1655  "com.sun.star.style.CharacterPropertiesComplex",
1656  "com.sun.star.style.ParagraphProperties",
1657  "com.sun.star.style.ParagraphPropertiesAsian",
1658  "com.sun.star.style.ParagraphPropertiesComplex" };
1659 }
1660 
1661 namespace
1662 {
1663  class theSwXTextViewCursorUnoTunnelId : public rtl::Static< UnoTunnelIdInit, theSwXTextViewCursorUnoTunnelId > {};
1664 }
1665 
1666 const uno::Sequence< sal_Int8 > & SwXTextViewCursor::getUnoTunnelId()
1667 {
1668  return theSwXTextViewCursorUnoTunnelId::get().getSeq();
1669 }
1670 
1671 //XUnoTunnel
1673  const uno::Sequence< sal_Int8 >& rId )
1674 {
1675  if( isUnoTunnelId<SwXTextViewCursor>(rId) )
1676  {
1677  return sal::static_int_cast< sal_Int64 >( reinterpret_cast< sal_IntPtr >( this ));
1678  }
1679  return OTextCursorHelper::getSomething(rId);
1680 }
1681 
1683 const SwDoc* SwXTextViewCursor::GetDoc() const
1684 {
1685  SwWrtShell& rSh = m_pView->GetWrtShell();
1686  return rSh.GetCursor() ? rSh.GetCursor()->GetDoc() : nullptr;
1687 }
1688 
1690 {
1691  SwWrtShell& rSh = m_pView->GetWrtShell();
1692  return rSh.GetCursor() ? rSh.GetCursor()->GetDoc() : nullptr;
1693 }
1694 
1696 {
1697  SwWrtShell& rSh = m_pView->GetWrtShell();
1698  return rSh.GetCursor();
1699 }
1700 
1702 {
1703  SwWrtShell& rSh = m_pView->GetWrtShell();
1704  return rSh.GetCursor();
1705 }
1706 
1707 uno::Reference< datatransfer::XTransferable > SAL_CALL SwXTextView::getTransferable()
1708 {
1709  SolarMutexGuard aGuard;
1710 
1711  //force immediat shell update
1712  GetView()->StopShellTimer();
1713  SwWrtShell& rSh = GetView()->GetWrtShell();
1714  if ( GetView()->GetShellMode() == ShellMode::DrawText )
1715  {
1716  SdrView *pSdrView = rSh.GetDrawView();
1717  OutlinerView* pOLV = pSdrView->GetTextEditOutlinerView();
1718  return pOLV->GetEditView().GetTransferable();
1719  }
1720  else
1721  {
1722  SwTransferable* pTransfer = new SwTransferable( rSh );
1723  const bool bLockedView = rSh.IsViewLocked();
1724  rSh.LockView( true ); //lock visible section
1725  pTransfer->PrepareForCopy();
1726  rSh.LockView( bLockedView );
1727  return uno::Reference< datatransfer::XTransferable >( pTransfer );
1728  }
1729 }
1730 
1731 void SAL_CALL SwXTextView::insertTransferable( const uno::Reference< datatransfer::XTransferable >& xTrans )
1732 {
1733  SolarMutexGuard aGuard;
1734 
1735  //force immediat shell update
1736  GetView()->StopShellTimer();
1737  SwWrtShell& rSh = GetView()->GetWrtShell();
1738  if ( GetView()->GetShellMode() == ShellMode::DrawText )
1739  {
1740  SdrView *pSdrView = rSh.GetDrawView();
1741  OutlinerView* pOLV = pSdrView->GetTextEditOutlinerView();
1742  pOLV->GetEditView().InsertText( xTrans, GetView()->GetDocShell()->GetMedium()->GetBaseURL(), false );
1743  }
1744  else
1745  {
1746  TransferableDataHelper aDataHelper( xTrans );
1747  if ( SwTransferable::IsPaste( rSh, aDataHelper ) )
1748  {
1749  SwTransferable::Paste( rSh, aDataHelper );
1750  if( rSh.IsFrameSelected() || rSh.IsObjSelected() )
1751  rSh.EnterSelFrameMode();
1752  GetView()->AttrChangedNotify(nullptr);
1753  }
1754  }
1755 }
1756 
1757 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
SdrUnoObj * GetFormControl(const css::uno::Reference< css::awt::XControlModel > &_rxModel, const SdrView &_rView, const OutputDevice &_rDevice, css::uno::Reference< css::awt::XControl > &_out_rxControl) const
css::uno::Reference< css::linguistic2::XProofreadingIterator > get(css::uno::Reference< css::uno::XComponentContext > const &context)
virtual css::uno::Sequence< sal_Int8 > SAL_CALL getImplementationId() override
Definition: unotxvw.cxx:144
SwStartNode * FindSttNodeByType(SwStartNodeType eTyp)
Definition: node.cxx:759
long GetLeft() const
#define UNO_NAME_RUBY_POSITION
Definition: unoprnms.hxx:564
void StopShellTimer()
Definition: view.cxx:1752
Starts a section of nodes in the document model.
Definition: node.hxx:303
IMPLEMENT_FORWARD_XINTERFACE2(ChildWindowPane, ChildWindowPaneInterfaceBase, Pane)
const OUString & GetCharFormatName() const
Definition: fmtruby.hxx:64
void DeleteMark()
Definition: pam.hxx:177
bool Right(sal_uInt16 nMode, bool bSelect, sal_uInt16 nCount, bool bBasicCall, bool bVisual=false)
Definition: move.cxx:123
virtual sal_Bool SAL_CALL screenUp() override
Definition: unotxvw.cxx:1302
URL aURL
SwNode & GetNode(bool bPoint=true) const
Definition: pam.hxx:223
sal_uInt16 GetLineCount()
Definition: editsh.cxx:843
bool EndPg(bool bSelect=false)
Definition: move.cxx:346
size_t GetMarkCount() const
Marks a position in the document model.
Definition: pam.hxx:35
static sal_uInt16 FillRubyList(const SwPaM &rPam, SwRubyList &rList)
Definition: docruby.cxx:48
virtual SdrEndTextEditKind SdrEndTextEdit(bool bDontDeleteReally=false)
bool IsSectionNode() const
Definition: node.hxx:644
virtual void SAL_CALL collapseToEnd() override
Definition: unotxvw.cxx:936
SdrView * GetDrawView()
Definition: vnew.cxx:375
SwPaM * GetCursor(bool bMakeTableCursor=true) const
Return pointer to the current shell cursor.
Definition: crsrsh.cxx:189
#define PROPERTY_MAP_TEXT_CURSOR
Definition: unomap.hxx:27
osl::Mutex m_aMutex
bool IsTextSelection(bool bAllowTables=true) const
Definition: unotxvw.cxx:863
#define UNO_NAME_RUBY_BASE_TEXT
Definition: unoprnms.hxx:559
virtual void SAL_CALL removeVetoableChangeListener(const OUString &PropertyName, const css::uno::Reference< css::beans::XVetoableChangeListener > &aListener) override
Definition: unotxvw.cxx:823
virtual void SAL_CALL setPropertyValue(const OUString &aPropertyName, const css::uno::Any &aValue) override
Definition: unotxvw.cxx:1443
virtual void SAL_CALL gotoEnd(sal_Bool bExpand) override
Definition: unotxvw.cxx:1160
bool SttEndDoc(bool bStt)
Definition: crsrsh.cxx:572
virtual OUString SAL_CALL getImplementationName() override
Definition: unotxvw.cxx:830
void notifyEach(void(SAL_CALL ListenerT::*NotificationMethod)(const EventT &), const EventT &Event)
static SwXTextRanges * Create(SwPaM *const pCursor)
Definition: unoobj2.cxx:1460
virtual void SAL_CALL setVisible(sal_Bool bVisible) override
Definition: unotxvw.cxx:886
std::string GetValue
virtual SdrObjList * getChildrenOfSdrObject() const
#define UNO_NAME_RUBY_TEXT
Definition: unoprnms.hxx:560
static void FillUIName(const OUString &rName, OUString &rFillName, SwGetPoolIdFromName)
virtual css::uno::Reference< css::datatransfer::XTransferable > SAL_CALL getTransferable() override
Definition: unotxvw.cxx:1707
css::uno::Reference< css::beans::XPropertySet > mxViewSettings
Definition: unotxvw.hxx:66
ULONG m_refCount
virtual const SwPaM * GetPaM() const override
Definition: unotxvw.cxx:1695
virtual css::uno::Any SAL_CALL getPropertyValue(const OUString &PropertyName) override
Definition: unotxvw.cxx:1461
virtual css::uno::Reference< css::beans::XPropertySet > SAL_CALL getViewSettings() override
Definition: unotxvw.cxx:511
int PrepareForCopy(bool bIsCut=false)
Definition: swdtflvr.cxx:874
bool SttNxtPg(bool bSelect=false)
Definition: move.cxx:316
static bool IsPaste(const SwWrtShell &, const TransferableDataHelper &)
Definition: swdtflvr.cxx:1314
SwView * m_pView
Definition: unotxvw.hxx:62
bool LeftMargin(bool bSelect, bool bBasicCall)
Definition: move.cxx:170
std::vector< std::unique_ptr< SwRubyListEntry >> SwRubyList
Definition: doc.hxx:181
const SwPosition * GetMark() const
Definition: pam.hxx:209
sal_Int32 addInterface(const css::uno::Reference< css::uno::XInterface > &rxIFace)
sal_Int64 n
SwCursor * GetSwCursor() const
Definition: crsrsh.hxx:868
bool EndPrvPg(bool bSelect=false)
Definition: move.cxx:334
Definition: doc.hxx:184
const SwShellTableCursor * GetTableCursor() const
Definition: crsrsh.hxx:645
size_t GetObjCount() const
void disposeAndClear(const css::lang::EventObject &rEvt)
virtual void SAL_CALL addVetoableChangeListener(const OUString &PropertyName, const css::uno::Reference< css::beans::XVetoableChangeListener > &aListener) override
Definition: unotxvw.cxx:816
#define UNO_NAME_RUBY_CHAR_STYLE_NAME
Definition: unoprnms.hxx:562
virtual OUString SAL_CALL getString() override
Definition: unotxvw.cxx:1371
void EnterStdMode()
Definition: select.cxx:550
SdrMark * GetMark(size_t nNum) const
virtual void SAL_CALL gotoEndOfLine(sal_Bool bExpand) override
Definition: unotxvw.cxx:1614
virtual sal_Int64 SAL_CALL getSomething(const css::uno::Sequence< sal_Int8 > &aIdentifier) override
Definition: unotxvw.cxx:1672
void GetSelectableFromAny(uno::Reference< uno::XInterface > const &xIfc, SwDoc &rTargetDoc, SwPaM *&o_rpPaM, std::pair< OUString, FlyCntType > &o_rFrame, OUString &o_rTableName, SwUnoTableCursor const *&o_rpTableCursor,::sw::mark::IMark const *&o_rpMark, std::vector< SdrObject * > &o_rSdrObjects)
Of course Writer needs its own rectangles.
Definition: swrect.hxx:35
sal_Int32 removeInterface(const css::uno::Reference< css::uno::XInterface > &rxIFace)
void SetClipBoard(bool bNew)
Definition: doc.hxx:962
void SetRubyList(const SwPaM &rPam, const SwRubyList &rList)
Definition: docruby.cxx:94
EmbeddedObjectRef * pObject
bool GotoTable(const OUString &rName)
Definition: move.cxx:655
css::uno::Reference< css::beans::XPropertySetInfo > const & getPropertySetInfo() const
virtual void SAL_CALL setRubyList(const css::uno::Sequence< css::uno::Sequence< css::beans::PropertyValue > > &RubyList, sal_Bool bAutomatic) override
Definition: unotxvw.cxx:571
const SfxItemPropertySet * m_pPropSet
Definition: unotxvw.hxx:63
SwWrtShell & GetWrtShell() const
Definition: view.hxx:398
virtual sal_Bool SAL_CALL isFormDesignMode() override
Definition: unotxvw.cxx:480
void SetString(SwCursor &rCursor, const OUString &rString)
Definition: unoobj2.cxx:1499
virtual css::uno::Reference< css::beans::XPropertySetInfo > SAL_CALL getPropertySetInfo() override
Definition: unotxvw.cxx:714
Used by the UI to modify the document model.
Definition: wrtsh.hxx:90
virtual sal_Bool SAL_CALL screenDown() override
Definition: unotxvw.cxx:1287
virtual css::uno::Reference< css::text::XTextRange > SAL_CALL getStart() override
Definition: unotxvw.cxx:1335
virtual sal_Bool SAL_CALL goUp(sal_Int16 nCount, sal_Bool bExpand) override
Definition: unotxvw.cxx:1568
virtual css::beans::PropertyState SAL_CALL getPropertyState(const OUString &PropertyName) override
Definition: unotxvw.cxx:1496
const SwDoc & GetDoc() const
Definition: unoobj2.cxx:733
bool GotoFly(const OUString &rName, FlyCntType eType=FLYCNTTYPE_ALL, bool bSelFrame=true)
Definition: move.cxx:594
constexpr auto SFX_INTERFACE_NONE
virtual css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames() override
Definition: unotxvw.cxx:1650
Reference< XController > xController
SwView * GetView()
Definition: unotxvw.hxx:135
exports com.sun.star. frame
const char * tableName
virtual sal_Bool SAL_CALL goLeft(sal_Int16 nCount, sal_Bool bExpand) override
Definition: unotxvw.cxx:975
int nCount
virtual sal_Bool SAL_CALL isCollapsed() override
Definition: unotxvw.cxx:958
bool CPPUHELPER_DLLPUBLIC supportsService(css::lang::XServiceInfo *implementation, rtl::OUString const &name)
static SW_DLLPUBLIC sal_uInt16 GetPoolIdFromUIName(const OUString &rName, SwGetPoolIdFromName)
static bool Paste(SwWrtShell &, TransferableDataHelper &, RndStdIds nAnchorType=RndStdIds::FLY_AT_PARA, bool bIgnoreComments=false, PasteTableType ePasteTable=PasteTableType::PASTE_DEFAULT)
Definition: swdtflvr.cxx:1390
void GetTextFromPam(SwPaM &rPam, OUString &rBuffer, SwRootFrame const *pLayout=nullptr)
Definition: unoobj.cxx:126
virtual void SAL_CALL addPropertyChangeListener(const OUString &aPropertyName, const css::uno::Reference< css::beans::XPropertyChangeListener > &xListener) override
Definition: unotxvw.cxx:802
virtual css::uno::Sequence< css::uno::Type > SAL_CALL getTypes() override
Definition: unotxvw.cxx:129
virtual css::uno::Reference< css::beans::XPropertySetInfo > SAL_CALL getPropertySetInfo() override
Definition: unotxvw.cxx:1437
css::uno::Any GetPropertyDefault(SwPaM const &rPaM, const SfxItemPropertySet &rPropSet, const OUString &rPropertyName)
Definition: unoobj.cxx:2045
ShellMode
Definition: view.hxx:85
void UnmarkAll()
#define WID_IS_CONSTANT_SPELLCHECK
Definition: unomap.hxx:288
virtual css::uno::Any SAL_CALL getSelection() override
Definition: unotxvw.cxx:336
bool XTextRangeToSwPaM(SwUnoInternalPaM &rToFill, const uno::Reference< text::XTextRange > &xTextRange)
Definition: unoobj2.cxx:952
const char * sName
SwPaM * GetNext()
Definition: pam.hxx:264
virtual sal_Bool SAL_CALL jumpToLastPage() override
Definition: unotxvw.cxx:1193
virtual sal_Bool SAL_CALL jumpToPreviousPage() override
Definition: unotxvw.cxx:1237
EditView & GetEditView() const
SfxItemPool & GetPool() const
const OUString & GetText() const
Definition: fmtruby.hxx:61
static const css::uno::Sequence< sal_Int8 > & getUnoTunnelId()
virtual ~SwXTextViewCursor() override
Definition: unotxvw.cxx:851
virtual sal_Bool SAL_CALL jumpToFirstPage() override
Definition: unotxvw.cxx:1174
virtual css::uno::Any SAL_CALL getPropertyValue(const OUString &PropertyName) override
Definition: unotxvw.cxx:755
SdrObject * GetMarkedSdrObj() const
virtual void SAL_CALL addSelectionChangeListener(const css::uno::Reference< css::view::XSelectionChangeListener > &xListener) override
Definition: unotxvw.cxx:425
SwDoc * GetDoc()
returns Doc. But be careful!
Definition: docsh.hxx:203
virtual void SAL_CALL gotoStart(sal_Bool bExpand) override
Definition: unotxvw.cxx:1146
PaM is Point and Mark: a selection of the document model.
Definition: pam.hxx:136
const IDocumentDeviceAccess & getIDocumentDeviceAccess() const
Provides access to the document device interface.
Definition: viewsh.cxx:2586
virtual css::uno::Any SAL_CALL getPropertyDefault(const OUString &aPropertyName) override
Definition: unotxvw.cxx:1538
sal_uInt16 GetPosition() const
Definition: fmtruby.hxx:70
virtual void SAL_CALL collapseToStart() override
Definition: unotxvw.cxx:914
#define FN_PAGEUP
Definition: cmdid.h:668
SwXTextView(SwView *pSwView)
Definition: unotxvw.cxx:85
virtual FmFormShell * GetFormShell() override
Definition: view.hxx:563
bool Up(bool bSelect, sal_uInt16 nCount=1, bool bBasicCall=false)
Definition: move.cxx:141
virtual void SAL_CALL setPropertyToDefault(const OUString &PropertyName) override
Definition: unotxvw.cxx:1526
virtual sal_Bool SAL_CALL supportsService(const OUString &ServiceName) override
Definition: unotxvw.cxx:1645
Style of a layout element.
Definition: frmfmt.hxx:57
bool HasSelection() const
Definition: wrtsh.hxx:141
#define WID_IS_HIDE_SPELL_MARKS
Definition: unomap.hxx:289
sal_uInt16 GetPageCount() const
Definition: viewsh.cxx:2496
int i
const SwStartNode * StartOfSectionNode() const
Definition: node.hxx:131
const SwPosition * GetPoint() const
Definition: pam.hxx:207
void SetOnlineSpell(bool b)
Definition: viewopt.cxx:322
static const char * GetDBChangeURL()
virtual sal_Bool SAL_CALL isAtStartOfLine() override
Definition: unotxvw.cxx:1584
static const css::uno::Sequence< sal_Int8 > & getUnoTunnelId()
Definition: unotxvw.cxx:1666
void Exchange()
Definition: pam.cxx:489
#define UNO_NAME_RUBY_IS_ABOVE
Definition: unoprnms.hxx:563
SwView * m_pView
Definition: unotxvw.hxx:155
const SdrMarkList & GetMarkedObjectList() const
const SwPageDesc & GetPageDesc(size_t i) const
Definition: fedesc.cxx:125
virtual void SAL_CALL removeSelectionChangeListener(const css::uno::Reference< css::view::XSelectionChangeListener > &xListener) override
Definition: unotxvw.cxx:432
bool HasMark() const
A PaM marks a selection if Point and Mark are distinct positions.
Definition: pam.hxx:205
FrameTypeFlags
values can be combined via logical or
Definition: fesh.hxx:62
SwDoc * GetDoc() const
Definition: pam.hxx:243
void SetSelection(const SwPaM &rCursor)
Definition: crsrsh.cxx:3498
SwXTextViewCursor(SwView *pVw)
Definition: unotxvw.cxx:845
unsigned char sal_Bool
virtual sal_Bool SAL_CALL isVisible() override
Definition: unotxvw.cxx:880
bool RightMargin(bool bSelect, bool bBasicCall)
Definition: move.cxx:186
virtual void SAL_CALL acquire() override
Definition: unotxvw.cxx:149
const SfxItemPropertyMap & getPropertyMap() const
virtual void SAL_CALL removeVetoableChangeListener(const OUString &PropertyName, const css::uno::Reference< css::beans::XVetoableChangeListener > &aListener) override
Definition: unotxvw.cxx:1491
bool IsGroupObject() const
const OutlinerView * GetTextEditOutlinerView() const
virtual sal_Bool SAL_CALL jumpToStartOfPage() override
Definition: unotxvw.cxx:1261
void InsertText(const OUString &rNew, bool bSelect=false)
virtual void setJobsetup(const JobSetup &rJobSetup)=0
Sets the Jobsetup.
virtual OUString SAL_CALL getImplementationName() override
Definition: unotxvw.cxx:1640
void NotifySelChanged()
Definition: unotxvw.cxx:678
const SfxItemPropertySet * m_pPropSet
Definition: unotxvw.hxx:156
css::uno::Reference< css::datatransfer::XTransferable > GetTransferable() const
const SwDoc * GetDoc() const
The document is set in SwAttrPool now, therefore you always can access it.
Definition: format.hxx:119
virtual sal_Int64 SAL_CALL getSomething(const css::uno::Sequence< sal_Int8 > &aIdentifier) override
virtual SfxPrinter * getPrinter(bool bCreate) const =0
Return the printer set at the document.
virtual css::awt::Point SAL_CALL getPosition() override
Definition: unotxvw.cxx:891
virtual void SAL_CALL addVetoableChangeListener(const OUString &PropertyName, const css::uno::Reference< css::beans::XVetoableChangeListener > &aListener) override
Definition: unotxvw.cxx:1486
static css::uno::Reference< css::drawing::XShape > GetShape(SdrObject *pObj)
Definition: unodraw.cxx:292
const SfxItemPropertySimpleEntry * getByName(const OUString &rName) const
virtual css::uno::Reference< css::awt::XControl > SAL_CALL getControl(const css::uno::Reference< css::awt::XControlModel > &Model) override
Definition: unotxvw.cxx:456
virtual sal_Bool SAL_CALL goRight(sal_Int16 nCount, sal_Bool bExpand) override
Definition: unotxvw.cxx:990
bool StartOfSection(bool bSelect=false)
Definition: move.cxx:304
SfxViewShell * GetViewShell() const
virtual const JobSetup * getJobsetup() const =0
Returns the Jobsetup.
void Invalidate()
Definition: unotxvw.cxx:101
const SwPosition * Start() const
Definition: pam.hxx:212
SwDocShell * GetDocShell()
Definition: view.cxx:1108
virtual void SAL_CALL removePropertyChangeListener(const OUString &aPropertyName, const css::uno::Reference< css::beans::XPropertyChangeListener > &aListener) override
Definition: unotxvw.cxx:1481
SwFrameFormat * GetTableFormat()
Definition: edws.cxx:183
::comphelper::OInterfaceContainerHelper2 m_SelChangedListeners
Definition: unotxvw.hxx:60
virtual sal_Int16 SAL_CALL getPage() override
Definition: unotxvw.cxx:1273
bool SttPg(bool bSelect=false)
Definition: move.cxx:340
const OUString & m_rURL
virtual sal_Bool SAL_CALL select(const css::uno::Any &rInterface) override
Definition: unotxvw.cxx:212
#define PROPERTY_MAP_TEXT_VIEW
Definition: unomap.hxx:118
SelectionType
Definition: wrtsh.hxx:58
virtual void SAL_CALL gotoStartOfLine(sal_Bool bExpand) override
Definition: unotxvw.cxx:1627
virtual css::uno::Reference< css::form::runtime::XFormController > SAL_CALL getFormController(const css::uno::Reference< css::form::XForm > &Form) override
Definition: unotxvw.cxx:464
virtual const SwPaM * GetPaM() const =0
const SwFormatRuby & GetRubyAttr() const
Definition: rubylist.hxx:35
Provides access to the formatting devices of a document.
virtual sal_Bool SAL_CALL jumpToPage(sal_Int16 nPage) override
Definition: unotxvw.cxx:1213
static css::uno::Reference< css::form::runtime::XFormController > GetFormController(const css::uno::Reference< css::form::XForm > &_rxForm, const SdrView &_rView, const OutputDevice &_rDevice)
static const css::uno::Sequence< sal_Int8 > & getUnoTunnelId()
Definition: unoobj2.cxx:794
virtual void SAL_CALL setString(const OUString &aString) override
Definition: unotxvw.cxx:1407
void SetDesignMode(bool _bDesignMode)
SwFrameFormat & GetMaster()
Definition: pagedesc.hxx:217
const PropertyValue * pValues
void GotoMark(const ::sw::mark::IMark *const pMark)
Definition: wrtsh3.cxx:133
virtual sal_Bool SAL_CALL jumpToEndOfPage() override
Definition: unotxvw.cxx:1249
virtual void SAL_CALL release() override
Definition: unotxvw.cxx:154
virtual sal_Bool SAL_CALL supportsService(const OUString &ServiceName) override
Definition: unotxvw.cxx:835
void FillPrtDoc(SwDoc *pPrtDoc, const SfxPrinter *pPrt)
Definition: vprint.cxx:304
SwWrtShell * GetWrtShellPtr() const
Definition: view.hxx:399
bool IsAtRightMargin() const
Definition: crsrsh.hxx:746
constexpr sal_Int64 convertTwipToMm100(sal_Int64 n)
virtual void SAL_CALL removePropertyChangeListener(const OUString &aPropertyName, const css::uno::Reference< css::beans::XPropertyChangeListener > &aListener) override
Definition: unotxvw.cxx:809
bool Left(sal_uInt16 nMode, bool bSelect, sal_uInt16 nCount, bool bBasicCall, bool bVisual=false)
Definition: move.cxx:106
virtual const SwDoc * GetDoc() const override
Definition: unotxvw.cxx:1683
void SetPropertyToDefault(SwPaM &rPaM, const SfxItemPropertySet &rPropSet, const OUString &rPropertyName)
Definition: unoobj.cxx:2005
css::uno::Any GetPropertyValue(SwPaM &rPaM, const SfxItemPropertySet &rPropSet, const OUString &rPropertyName)
Definition: unoobj.cxx:1724
static SfxViewFrame * LoadHiddenDocument(SfxObjectShell const &i_rDoc, SfxInterfaceId i_nViewId)
SdrPage * GetPage() const
void LockView(bool b)
Definition: viewsh.hxx:462
const SwViewOption * GetViewOptions() const
Definition: viewsh.hxx:423
bool GetPositions(SwPaM &rToFill) const
Definition: unoobj2.cxx:930
vcl::Window * GetWin() const
Definition: viewsh.hxx:337
css::uno::Sequence< css::beans::PropertyState > GetPropertyStates(SwPaM &rPaM, const SfxItemPropertySet &rPropSet, const css::uno::Sequence< OUString > &rPropertyNames, const SwGetPropertyStatesCaller eCaller=SW_PROPERTY_STATE_CALLER_DEFAULT)
virtual void SAL_CALL setFormDesignMode(sal_Bool DesignMode) override
Definition: unotxvw.cxx:488
virtual void SAL_CALL addPropertyChangeListener(const OUString &aPropertyName, const css::uno::Reference< css::beans::XPropertyChangeListener > &xListener) override
Definition: unotxvw.cxx:1476
void SetPropertyValue(SwPaM &rPaM, const SfxItemPropertySet &rPropSet, const OUString &rPropertyName, const css::uno::Any &rValue, const SetAttrMode nAttrMode=SetAttrMode::DEFAULT)
void NotifyDBChanged()
Definition: unotxvw.cxx:705
static void FillProgName(const OUString &rName, OUString &rFillName, SwGetPoolIdFromName)
bool DoInitNew(SfxMedium *pMedium=nullptr)
static const css::uno::Sequence< sal_Int8 > & getUnoTunnelId()
SwNodes & GetNodes()
Definition: doc.hxx:403
virtual void SAL_CALL insertTransferable(const css::uno::Reference< css::datatransfer::XTransferable > &xTrans) override
Definition: unotxvw.cxx:1731
virtual bool IsDesignMode() const override
#define WID_PAGE_COUNT
Definition: unomap.hxx:286
const SwPosition * End() const
Definition: pam.hxx:217
const SvxPaperBinItem & GetPaperBin(bool=true) const
Definition: frmatr.hxx:72
virtual css::uno::Sequence< css::uno::Sequence< css::beans::PropertyValue > > SAL_CALL getRubyList(sal_Bool bAutomatic) override
Definition: unotxvw.cxx:525
static SW_DLLPUBLIC css::uno::Reference< css::text::XTextFrame > CreateXTextFrame(SwDoc &rDoc, SwFrameFormat *pFrameFormat)
Definition: unoframe.cxx:3178
const SwRect & GetCharRect() const
Definition: crsrsh.hxx:516
void Execute(SfxRequest &)
Definition: view2.cxx:531
size_t IsObjSelected() const
Definition: feshview.cxx:1150
const SwTextNode * GetTextNode() const
Reference< XComponentContext > getProcessComponentContext()
SwUnoPropertyMapProvider aSwMapProvider
Definition: unomap1.cxx:89
void UnSelectFrame()
Definition: select.cxx:322
virtual sal_Bool SAL_CALL goDown(sal_Int16 nCount, sal_Bool bExpand) override
Definition: unotxvw.cxx:1552
#define FN_PAGEDOWN
Definition: cmdid.h:669
SfxObjectShellLock BuildTmpSelectionDoc()
Definition: unotxvw.cxx:643
css::uno::Sequence< css::uno::Type > SAL_CALL getTypes()
virtual css::uno::Reference< css::text::XTextRange > SAL_CALL getEnd() override
Definition: unotxvw.cxx:1353
bool Down(bool bSelect, sal_uInt16 nCount=1, bool bBasicCall=false)
Definition: move.cxx:155
SwStartNodeType
Definition: ndtyp.hxx:50
virtual void CalcLayout() override
To enable set up of StartActions and EndActions.
Definition: edws.cxx:108
SdrObject * getParentSdrObjectFromSdrObject() const
virtual void SAL_CALL gotoRange(const css::uno::Reference< css::text::XTextRange > &xRange, sal_Bool bExpand) override
Definition: unotxvw.cxx:1006
SdrPageView * GetSdrPageView() const
void LeaveSelFrameMode()
Definition: select.cxx:719
css::text::RubyAdjust GetAdjustment() const
Definition: fmtruby.hxx:73
virtual css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames() override
Definition: unotxvw.cxx:840
bool GotoPage(sal_uInt16 nPage, bool bRecord)
Definition: move.cxx:569
const sal_uInt16 CRSR_SKIP_CHARS
Definition: swcrsr.hxx:65
const SwFrameFormat * GetFlyFrameFormat() const
Get FlyFrameFormat; for UI macro linkage at Flys.
Definition: fefly1.cxx:1248
#define SAL_WARN(area, stream)
bool EndOfSection(bool bSelect=false)
Definition: move.cxx:310
SdrObject * GetControl(const css::uno::Reference< css::awt::XControlModel > &Model, css::uno::Reference< css::awt::XControl > &xToFill)
Definition: unotxvw.cxx:439
bool MarkObj(const Point &rPnt, short nTol=-2, bool bToggle=false, bool bDeep=false)
cppu::WeakImplHelper< css::text::XTextViewCursor, css::lang::XServiceInfo, css::text::XPageCursor, css::view::XScreenCursor, css::view::XViewCursor, css::view::XLineCursor, css::beans::XPropertySet, css::beans::XPropertyState > SwXTextViewCursor_Base
Definition: unotxvw.hxx:151
#define WID_LINE_COUNT
Definition: unomap.hxx:287
void EnterSelFrameMode(const Point *pStartDrag=nullptr)
Definition: select.cxx:701
static css::uno::Reference< css::text::XTextContent > CreateXTextEmbeddedObject(SwDoc &rDoc, SwFrameFormat *pFrameFormat)
Definition: unoframe.cxx:3470
const OUString & GetText() const
Definition: rubylist.hxx:32
virtual css::uno::Any SAL_CALL queryInterface(const css::uno::Type &aType) override
Definition: unotxvw.cxx:159
static css::uno::Reference< css::text::XTextContent > CreateXTextGraphicObject(SwDoc &rDoc, SwFrameFormat *pFrameFormat)
Definition: unoframe.cxx:3423
virtual void SetMark()
Unless this is called, the getter method of Mark will return Point.
Definition: pam.cxx:475
css::beans::PropertyState GetPropertyState(SwPaM &rPaM, const SfxItemPropertySet &rPropSet, const OUString &rPropertyName)
Definition: unoobj.cxx:1972
virtual sal_Bool SAL_CALL isAtEndOfLine() override
Definition: unotxvw.cxx:1599
virtual SdrView * GetDrawView() const override
Definition: viewdraw.cxx:612
virtual css::uno::Reference< css::text::XTextViewCursor > SAL_CALL getViewCursor() override
Definition: unotxvw.cxx:497
virtual css::uno::Reference< css::text::XText > SAL_CALL getText() override
Definition: unotxvw.cxx:1317
static css::uno::Reference< css::text::XTextRange > CreateXTextRange(SwDoc &rDoc, const SwPosition &rPos, const SwPosition *const pMark)
Definition: unoobj2.cxx:1054
css::uno::Reference< css::text::XTextViewCursor > mxTextViewCursor
Definition: unotxvw.hxx:67
#define DOCUMENTBORDER
Definition: swtypes.hxx:82
SelectionType GetSelectionType() const
Definition: wrtsh1.cxx:1398
virtual void ApplyViewOptions(const SwViewOption &rOpt) override
Apply ViewOptions with Start-/EndAction.
Definition: wrtsh1.cxx:1793
SwRootFrame * GetLayout() const
Definition: viewsh.cxx:2070
ShellMode GetShellMode() const
Definition: view0.cxx:103
size_t GetCurPageDesc(const bool bCalcFrame=true) const
Definition: fedesc.cxx:166
bool IsTextNode() const
Definition: node.hxx:636
bool IsAtLeftMargin() const
Definition: crsrsh.hxx:745
FrameTypeFlags GetFrameType(const Point *pPt, bool bStopAtFly) const
For return values see above FrameType.
Definition: fews.cxx:236
bool IsFrameSelected() const
Definition: feshview.cxx:1158
uno::Reference< text::XText > CreateParentXText(SwDoc &rDoc, const SwPosition &rPos)
Definition: unoobj2.cxx:1075
virtual css::uno::Sequence< css::beans::PropertyState > SAL_CALL getPropertyStates(const css::uno::Sequence< OUString > &aPropertyName) override
Definition: unotxvw.cxx:1511
#define UNO_NAME_RUBY_ADJUST
Definition: unoprnms.hxx:561
ViewOptFlags1 GetCoreOptions() const
Definition: viewopt.hxx:203
virtual ~SwXTextView() override
Definition: unotxvw.cxx:96
AnyEventRef aEvent
bool IsViewLocked() const
Definition: viewsh.hxx:461
void HideCursor()
Definition: crsrsh.cxx:2404
sal_uInt16 GetPageNum(bool bAtPoint=true, const Point *pLayPos=nullptr)
Get number of page which contains cursor.
Definition: pam.cxx:549
virtual sal_Bool SAL_CALL jumpToNextPage() override
Definition: unotxvw.cxx:1225
Definition: view.hxx:144
bool IsSelFrameMode() const
Definition: wrtsh.hxx:170
sal_uInt16 GetUpper() const
virtual void SAL_CALL setPropertyValue(const OUString &aPropertyName, const css::uno::Any &aValue) override
Definition: unotxvw.cxx:721
Base class of the Writer document model elements.
Definition: node.hxx:79