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