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