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