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