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