LibreOffice Module sd (master) 1
sdview.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 <config_features.h>
21
22#include <com/sun/star/embed/NoVisualAreaSizeException.hpp>
23#include <com/sun/star/embed/XEmbeddedObject.hpp>
24#include <com/sun/star/linguistic2/XSpellChecker1.hpp>
25
26#include <View.hxx>
28#include <editeng/outlobj.hxx>
29#include <editeng/unolingu.hxx>
30#include <o3tl/deleter.hxx>
31#include <svx/obj3d.hxx>
32#include <svx/fmview.hxx>
33#include <editeng/outliner.hxx>
34#include <svx/svdograf.hxx>
35#include <svx/svdoole2.hxx>
36#include <svx/svdundo.hxx>
37
38#include <vcl/settings.hxx>
39
40#include <officecfg/Office/Common.hxx>
41#include <sfx2/dispatch.hxx>
42#include <svx/svdpagv.hxx>
43#include <svx/svdoutl.hxx>
45
46#include <svx/svdetc.hxx>
47#include <editeng/editstat.hxx>
48
49#include <sfx2/viewfrm.hxx>
51#include <svx/xfillit0.hxx>
52
53#include <app.hrc>
54#include <strings.hrc>
55#include <Window.hxx>
56#include <Client.hxx>
57#include <drawdoc.hxx>
58#include <DrawDocShell.hxx>
59#include <sdmod.hxx>
60#include <sdpage.hxx>
61#include <sdresid.hxx>
62#include <unokywds.hxx>
63#include <ViewClipboard.hxx>
64#include <undo/undomanager.hxx>
67#include <svx/svdotable.hxx>
68#include <EventMultiplexer.hxx>
69#include <ViewShellBase.hxx>
70#include <ViewShell.hxx>
71
82#include <svx/unoapi.hxx>
84#include <comphelper/lok.hxx>
85#include <sfx2/lokhelper.hxx>
86#include <LibreOfficeKit/LibreOfficeKitEnums.h>
87#include <DrawController.hxx>
89
90#include <memory>
91#include <numeric>
92
93using namespace com::sun::star;
94using namespace com::sun::star::uno;
95using namespace sdr::table;
96namespace sd {
97
99 SdDrawDocument& rDrawDoc,
100 OutputDevice* pOutDev,
101 ViewShell* pViewShell)
102: FmFormView(rDrawDoc, pOutDev),
103 mrDoc(rDrawDoc),
104 mpDocSh(rDrawDoc.GetDocSh()),
105 mpViewSh(pViewShell),
106 mpDropMarkerObj(nullptr),
107 mnDragSrcPgNum(SDRPAGE_NOTFOUND),
108 mnAction(DND_ACTION_NONE),
109 maDropErrorIdle("sd View DropError"),
110 maDropInsertFileIdle("sd View DropInsertFile"),
111 mnLockRedrawSmph(0),
112 mbIsDropAllowed(true),
113 maSmartTags(*this),
114 mpClipboard (new ViewClipboard (*this))
115{
116 // #i73602# Use default from the configuration
118
119 // #i74769#, #i75172# Use default from the configuration
121
124
126
130
131 // Timer for delayed drop (has to be for MAC)
132 maDropErrorIdle.SetInvokeHandler( LINK(this, View, DropErrorHdl) );
133 maDropInsertFileIdle.SetInvokeHandler( LINK(this, View, DropInsertFileHdl) );
134}
135
137{
138 mpDropMarker.reset();
139}
140
142{
144
145 // release content of selection clipboard, if we own the content
147
148#if HAVE_FEATURE_AVMEDIA
150 {
153 }
154#endif
155
158
160
161 while(PaintWindowCount())
162 {
163 // remove all registered OutDevs
165 }
166}
167
168namespace {
169
170class ViewRedirector : public sdr::contact::ViewObjectContactRedirector
171{
172public:
173 ViewRedirector();
174
175 // all default implementations just call the same methods at the original. To do something
176 // different, override the method and at least do what the method does.
177 virtual void createRedirectedPrimitive2DSequence(
178 const sdr::contact::ViewObjectContact& rOriginal,
179 const sdr::contact::DisplayInfo& rDisplayInfo,
181};
182
183}
184
185ViewRedirector::ViewRedirector()
186{
187}
188
189void ViewRedirector::createRedirectedPrimitive2DSequence(
190 const sdr::contact::ViewObjectContact& rOriginal,
191 const sdr::contact::DisplayInfo& rDisplayInfo,
193{
195 SdrPage* pSdrPage = pObject ? pObject->getSdrPageFromSdrObject() : nullptr;
196 if(!pObject || !pSdrPage)
197 {
198 // not a SdrObject visualisation (maybe e.g. page) or no page
200 return;
201 }
202
203 const bool bDoCreateGeometry(pSdrPage->checkVisibility( rOriginal, rDisplayInfo, true ));
204
205 if(!bDoCreateGeometry &&
206 (( pObject->GetObjInventor() != SdrInventor::Default ) || ( pObject->GetObjIdentifier() != SdrObjKind::Page )) )
207 return;
208
210 const bool bSubContentProcessing(rDisplayInfo.GetSubContentActive());
211 const bool bIsMasterPageObject(pSdrPage->IsMasterPage());
212 const bool bIsPrinting(rOriginal.GetObjectContact().isOutputToPrinter());
213 const SdrPageView* pPageView = rOriginal.GetObjectContact().TryToGetSdrPageView();
215 const SdPage* pObjectsSdPage = dynamic_cast< SdPage* >(pSdrPage);
216 const bool bIsInsidePageObj(pPageView && pPageView->GetPage() != pVisualizedPage);
217
218 // check if we need to draw a placeholder border. Never do it for
219 // objects inside a SdrPageObj and never when printing
220 if(!bIsInsidePageObj && !bIsPrinting)
221 {
222 bool bCreateOutline(false);
223
224 if( pObject->IsEmptyPresObj() && DynCastSdrTextObj( pObject ) != nullptr )
225 {
226 if( !bSubContentProcessing || !pObject->IsNotVisibleAsMaster() )
227 {
228 eKind = pObjectsSdPage ? pObjectsSdPage->GetPresObjKind(pObject) : PresObjKind::NONE;
229 bCreateOutline = true;
230 }
231 }
232 else if( ( pObject->GetObjInventor() == SdrInventor::Default ) && ( pObject->GetObjIdentifier() == SdrObjKind::Text ) )
233 {
234 if( pObjectsSdPage )
235 {
236 eKind = pObjectsSdPage->GetPresObjKind(pObject);
237
238 if((eKind == PresObjKind::Footer) || (eKind == PresObjKind::Header) || (eKind == PresObjKind::DateTime) || (eKind == PresObjKind::SlideNumber) )
239 {
240 if( !bSubContentProcessing )
241 {
242 // only draw a boundary for header&footer objects on the masterpage itself
243 bCreateOutline = true;
244 }
245 }
246 }
247 }
248 else if( ( pObject->GetObjInventor() == SdrInventor::Default ) && ( pObject->GetObjIdentifier() == SdrObjKind::Page ) )
249 {
250 // only for handout page, else this frame will be created for each
251 // page preview object in SlideSorter and PagePane
252 if(pObjectsSdPage && PageKind::Handout == pObjectsSdPage->GetPageKind())
253 {
254 bCreateOutline = true;
255 }
256 }
257
258 if(bCreateOutline)
259 {
260 // empty presentation objects get a gray frame
261 const svtools::ColorConfig aColorConfig;
263
264 if( aColor.bIsVisible )
265 {
266 // get basic object transformation
267 const basegfx::BColor aRGBColor(aColor.nColor.getBColor());
268 basegfx::B2DHomMatrix aObjectMatrix;
269 basegfx::B2DPolyPolygon aObjectPolyPolygon;
270 pObject->TRGetBaseGeometry(aObjectMatrix, aObjectPolyPolygon);
271
272 // create dashed border
273 {
274 // create object polygon
276 aPolygon.transform(aObjectMatrix);
277
278 // create line and stroke attribute
279 ::std::vector< double > aDotDashArray { 160.0, 80.0 };
280
281 const double fFullDotDashLen(::std::accumulate(aDotDashArray.begin(), aDotDashArray.end(), 0.0));
282 const drawinglayer::attribute::LineAttribute aLine(aRGBColor);
283 drawinglayer::attribute::StrokeAttribute aStroke(std::move(aDotDashArray), fFullDotDashLen);
284
285 // create primitive and add
287 std::move(aPolygon),
288 aLine,
289 std::move(aStroke)));
290 rVisitor.visit(xRef);
291 }
292
293 // now paint the placeholder description, but only when masterpage
294 // is displayed as page directly (MasterPage view)
295 if(!bSubContentProcessing && bIsMasterPageObject)
296 {
297 OUString aObjectString;
298
299 switch( eKind )
300 {
302 {
303 if(pObjectsSdPage && pObjectsSdPage->GetPageKind() == PageKind::Standard)
304 {
305 static OUString aTitleAreaStr(SdResId(STR_PLACEHOLDER_DESCRIPTION_TITLE));
306 aObjectString = aTitleAreaStr;
307 }
308
309 break;
310 }
312 {
313 static OUString aOutlineAreaStr(SdResId(STR_PLACEHOLDER_DESCRIPTION_OUTLINE));
314 aObjectString = aOutlineAreaStr;
315 break;
316 }
318 {
319 static OUString aFooterAreaStr(SdResId(STR_PLACEHOLDER_DESCRIPTION_FOOTER));
320 aObjectString = aFooterAreaStr;
321 break;
322 }
324 {
325 static OUString aHeaderAreaStr(SdResId(STR_PLACEHOLDER_DESCRIPTION_HEADER));
326 aObjectString = aHeaderAreaStr;
327 break;
328 }
330 {
331 static OUString aDateTimeStr(SdResId(STR_PLACEHOLDER_DESCRIPTION_DATETIME));
332 aObjectString = aDateTimeStr;
333 break;
334 }
336 {
337 static OUString aDateTimeStr(SdResId(STR_PLACEHOLDER_DESCRIPTION_NOTES));
338 aObjectString = aDateTimeStr;
339 break;
340 }
342 {
343 if(pObjectsSdPage && pObjectsSdPage->GetPageKind() == PageKind::Standard)
344 {
345 static OUString aSlideAreaStr(SdResId(STR_PLACEHOLDER_DESCRIPTION_SLIDE));
346 aObjectString = aSlideAreaStr;
347 }
348 else
349 {
350 static OUString aNumberAreaStr(SdResId(STR_PLACEHOLDER_DESCRIPTION_NUMBER));
351 aObjectString = aNumberAreaStr;
352 }
353 break;
354 }
355 default:
356 {
357 break;
358 }
359 }
360
361 if( !aObjectString.isEmpty() )
362 {
363 // decompose object matrix to be able to place text correctly
364 basegfx::B2DTuple aScale;
365 basegfx::B2DTuple aTranslate;
366 double fRotate, fShearX;
367 aObjectMatrix.decompose(aScale, aTranslate, fRotate, fShearX);
368
369 // create font
370 SdrTextObj* pTextObj = DynCastSdrTextObj( pObject );
371 const SdrTextVertAdjust eTVA(pTextObj ? pTextObj->GetTextVerticalAdjust() : SDRTEXTVERTADJUST_CENTER);
372 vcl::Font aScaledVclFont;
373
374 // use a text size factor to get more reliable text sizes from the text layouter
375 // (and from vcl), tipp from HDU
376 static const sal_uInt32 nTextSizeFactor(100);
377
378 // use a factor to get more linear text size calculations
379 aScaledVclFont.SetFontHeight( 500 * nTextSizeFactor );
380
381 // get basic geometry and get text size
383 aTextLayouter.setFont(aScaledVclFont);
384 const sal_Int32 nTextLength(aObjectString.getLength());
385
386 // do not forget to use the factor again to get the width for the 500
387 const double fTextWidth(aTextLayouter.getTextWidth(aObjectString, 0, nTextLength) * (1.0 / nTextSizeFactor));
388 const double fTextHeight(aTextLayouter.getTextHeight() * (1.0 / nTextSizeFactor));
389
390 // calculate text primitive position. If text is at bottom, use top for
391 // the extra text and vice versa
392 const double fHorDist(125);
393 const double fVerDist(125);
394 const double fPosX((aTranslate.getX() + aScale.getX()) - fTextWidth - fHorDist);
395 const double fPosY((SDRTEXTVERTADJUST_BOTTOM == eTVA)
396 ? aTranslate.getY() - fVerDist + fTextHeight
397 : (aTranslate.getY() + aScale.getY()) - fVerDist);
398
399 // get font attributes; use normally scaled font
400 vcl::Font aVclFont;
401 basegfx::B2DVector aTextSizeAttribute;
402
403 aVclFont.SetFontHeight( 500 );
404
407 aTextSizeAttribute,
408 aVclFont,
409 false,
410 false));
411
412 // fill text matrix
414 aTextSizeAttribute.getX(), aTextSizeAttribute.getY(),
415 fShearX,
416 fRotate,
417 fPosX, fPosY));
418
419 // create DXTextArray (can be empty one)
420 ::std::vector< double > aDXArray{};
421
422 // create locale; this may need some more information in the future
423 css::lang::Locale aLocale;
424
425 // create primitive and add
428 aTextMatrix,
429 aObjectString,
430 0,
431 nTextLength,
432 std::move(aDXArray),
433 {},
434 std::move(aFontAttribute),
435 std::move(aLocale),
436 aRGBColor));
437 rVisitor.visit(xRef);
438 }
439 }
440 }
441 }
442 }
443
444 if(bDoCreateGeometry)
445 {
447 rOriginal,
448 rDisplayInfo, rVisitor);
449 }
450}
451
452namespace
453{
454 void setOutlinerBgFromPage(::Outliner& rOutl, SdrPageView& rPgView, bool bScreenDisplay)
455 {
456 SdPage* pPage = static_cast<SdPage*>(rPgView.GetPage());
457 if (pPage)
458 {
459 // #i75566# Name change GetBackgroundColor -> GetPageBackgroundColor and
460 // hint value if screen display. Only then the AutoColor mechanisms shall be applied
461 rOutl.SetBackgroundColor(pPage->GetPageBackgroundColor(&rPgView, bScreenDisplay));
462 }
463 }
464}
465
470{
471 // execute ??
472 if (mnLockRedrawSmph != 0)
473 return;
474
475 SdrPageView* pPgView = GetSdrPageView();
476
477 if (pPgView)
478 {
479 SdPage* pPage = static_cast<SdPage*>( pPgView->GetPage() );
480 if( pPage )
481 {
483 bool bScreenDisplay(true);
484
485 // #i75566# printing; suppress AutoColor BackgroundColor generation
486 // for visibility reasons by giving GetPageBackgroundColor()
487 // the needed hint
488 // #i75566# PDF export; suppress AutoColor BackgroundColor generation (see printing)
489 if (pOutDev && ((OUTDEV_PRINTER == pOutDev->GetOutDevType())
490 || (OUTDEV_PDF == pOutDev->GetOutDevType())))
491 bScreenDisplay = false;
492
493 setOutlinerBgFromPage(rOutl, *pPgView, bScreenDisplay);
494 }
495 }
496
497 ViewRedirector aViewRedirector;
498 FmFormView::CompleteRedraw(pOutDev, rReg, pRedirector ? pRedirector : &aViewRedirector);
499}
500
502{
504
505 if( GetMarkedObjectCount() > 0 )
507}
508
509bool View::SetAttributes(const SfxItemSet& rSet, bool bReplaceAll, bool /*bSlide*/, bool /*bMaster*/)
510{
511 bool bOk = FmFormView::SetAttributes(rSet, bReplaceAll);
512 return bOk;
513}
514
515void View::GetAttributes( SfxItemSet& rTargetSet, bool bOnlyHardAttr ) const
516{
517 FmFormView::GetAttributes( rTargetSet, bOnlyHardAttr );
518}
519
523bool View::IsPresObjSelected(bool bOnPage, bool bOnMasterPage, bool bCheckPresObjListOnly, bool bCheckLayoutOnly) const
524{
525 SdrMarkList* pMarkList;
526
528 mnDragSrcPgNum != GetSdrPageView()->GetPage()->GetPageNum())
529 {
530 /* Drag&Drop is in progress
531 Source and destination page are different:
532 we use the saved mark list */
533 pMarkList = mpDragSrcMarkList.get();
534 }
535 else
536 {
537 // We use the current mark list
538 pMarkList = new SdrMarkList(GetMarkedObjectList());
539 }
540
541 SdrMark* pMark;
542 SdPage* pPage;
543
544 bool bSelected = false;
545 bool bMasterPage = false;
546
547 for (size_t nMark = pMarkList->GetMarkCount(); nMark && !bSelected; )
548 {
549 --nMark;
550 // Backwards through mark list
551 pMark = pMarkList->GetMark(nMark);
552 SdrObject* pObj = pMark->GetMarkedSdrObj();
553
554 if ( pObj && ( bCheckPresObjListOnly || pObj->IsEmptyPresObj() || pObj->GetUserCall() ) )
555 {
556 pPage = static_cast<SdPage*>( pObj->getSdrPageFromSdrObject() );
557 bMasterPage = pPage && pPage->IsMasterPage();
558
559 if ( (bMasterPage && bOnMasterPage) || (!bMasterPage && bOnPage) )
560 {
561 if ( pPage && pPage->IsPresObj(pObj) )
562 {
563 if( bCheckLayoutOnly )
564 {
565 PresObjKind eKind = pPage->GetPresObjKind(pObj);
566
567 if((eKind != PresObjKind::Footer) && (eKind != PresObjKind::Header) && (eKind != PresObjKind::DateTime) && (eKind != PresObjKind::SlideNumber) )
568 bSelected = true;
569 }
570 else
571 {
572 bSelected = true;
573 }
574 }
575 }
576 }
577 }
578
579 if (pMarkList != mpDragSrcMarkList.get())
580 {
581 delete pMarkList;
582 }
583
584 return bSelected;
585}
586
588{
589 if ( IsTextEdit() )
590 {
593 pOLV->SelectRange( 0, pOutliner->GetParagraphCount() );
594 }
595 else
596 {
597 MarkAll();
598 }
599}
600
601bool View::SetStyleSheet(SfxStyleSheet* pStyleSheet, bool bDontRemoveHardAttr)
602{
603 // forward to SdrView
604 FmFormView::SetStyleSheet(pStyleSheet, bDontRemoveHardAttr);
605 return true;
606}
607
611static void SetSpellOptions( const SdDrawDocument& rDoc, EEControlBits& rCntrl )
612{
613 bool bOnlineSpell = rDoc.GetOnlineSpell();
614
615 if( bOnlineSpell )
616 rCntrl |= EEControlBits::ONLINESPELLING;
617 else
618 rCntrl &= ~EEControlBits::ONLINESPELLING;
619}
620
622{
623 m_pOutl = pOutl;
624 OutlinerView* pOutlView = m_pOutl->GetView(0);
625 m_bReadOnly = pOutlView->IsReadOnly();
626 pOutlView->SetReadOnly(true);
627}
628
630{
631 if (m_pOutl)
632 {
633 OutlinerView* pOutlView = m_pOutl->GetView(0);
634 pOutlView->SetReadOnly(m_bReadOnly);
635 m_pOutl = nullptr;
636 }
637}
638
640{
641 SfxViewShell* pRet = nullptr;
642
643 if (mpViewSh)
644 pRet = &mpViewSh->GetViewShellBase();
645
646 return pRet;
647}
648
649// Create a new view-local UndoManager manager for Impress/Draw
650std::unique_ptr<SdrUndoManager> View::createLocalTextUndoManager()
651{
652 std::unique_ptr<SdrUndoManager> pUndoManager(new sd::UndoManager);
653 pUndoManager->SetDocShell(mpDocSh);
654 return pUndoManager;
655}
656
658 SdrObject* pObj, SdrPageView* pPV, vcl::Window* pWin,
659 bool bIsNewObj,
660 SdrOutliner* pOutl, OutlinerView* pGivenOutlinerView,
661 bool bDontDeleteOutliner, bool bOnlyOneView, bool bGrabFocus )
662{
663 SdrPage* pPage = pObj ? pObj->getSdrPageFromSdrObject() : nullptr;
664 bool bMasterPage = pPage && pPage->IsMasterPage();
665
667 EventMultiplexerEventId::BeginTextEdit, static_cast<void*>(pObj) );
668
669 if( pOutl==nullptr && pObj )
670 pOutl = SdrMakeOutliner(OutlinerMode::TextObject, pObj->getSdrModelFromSdrObject()).release();
671
672 // make draw&impress specific initialisations
673 if( pOutl )
674 {
675 pOutl->SetStyleSheetPool(static_cast<SfxStyleSheetPool*>( mrDoc.GetStyleSheetPool() ));
676 pOutl->SetCalcFieldValueHdl(LINK(SD_MOD(), SdModule, CalcFieldValueHdl));
677 EEControlBits nCntrl = pOutl->GetControlWord();
678 nCntrl |= EEControlBits::ALLOWBIGOBJS;
679 nCntrl |= EEControlBits::MARKFIELDS;
680 nCntrl |= EEControlBits::AUTOCORRECT;
681
682 nCntrl &= ~EEControlBits::ULSPACESUMMATION;
684 nCntrl |= EEControlBits::ULSPACESUMMATION;
685
686 SetSpellOptions( mrDoc, nCntrl );
687
688 pOutl->SetControlWord(nCntrl);
689
691 if ( xSpellChecker.is() )
692 pOutl->SetSpeller( xSpellChecker );
693
695 if( xHyphenator.is() )
696 pOutl->SetHyphenator( xHyphenator );
697
698 pOutl->SetDefaultLanguage( Application::GetSettings().GetLanguageTag().getLanguageType() );
699 }
700
701 bool bReturn = FmFormView::SdrBeginTextEdit(
702 pObj, pPV, pWin, bIsNewObj, pOutl,
703 pGivenOutlinerView, bDontDeleteOutliner,
704 bOnlyOneView, bGrabFocus);
705
706 if ( mpViewSh )
707 {
709
710 if (pObj && pObj->GetObjIdentifier() == SdrObjKind::Table)
712
714 {
716 {
717 ::tools::Rectangle aRectangle = pView->GetOutputArea();
718 if (pWin && pWin->GetMapMode().GetMapUnit() == MapUnit::Map100thMM)
719 {
720 aRectangle = o3tl::convert(aRectangle, o3tl::Length::mm100, o3tl::Length::twip);
721 }
722 OString sRectangle = aRectangle.toString();
723 SfxLokHelper::notifyOtherViews(&mpViewSh->GetViewShellBase(), LOK_CALLBACK_VIEW_LOCK, "rectangle", sRectangle);
724 }
725 }
726 }
727
728 if (::Outliner* pOL = bReturn ? GetTextEditOutliner() : nullptr)
729 {
730 if (pObj)
731 {
732 if( pObj->GetObjInventor() == SdrInventor::Default && pObj->GetObjIdentifier() == SdrObjKind::Table )
733 {
734 Color aBackground = GetTextEditBackgroundColor(*this);
735 pOL->SetBackgroundColor( aBackground );
736 }
737 else
738 {
739 // tdf#148140 Set the background to determine autocolor.
740 // Use any explicit bg with fallback to underlying page if
741 // none found
742 if (!pObj->setSuitableOutlinerBg(*pOL) && pPV)
743 setOutlinerBgFromPage(*pOL, *pPV, true);
744 }
745 }
746
747 pOL->SetParaInsertedHdl(LINK(this, View, OnParagraphInsertedHdl));
748 pOL->SetParaRemovingHdl(LINK(this, View, OnParagraphRemovingHdl));
749 }
750
751 if (bMasterPage && bReturn && pOutl)
752 {
753 const SdrTextObj* pTextObj = pOutl->GetTextObj();
754 const SdPage* pSdPage = pTextObj ? static_cast<const SdPage*>(pTextObj->getSdrPageFromSdrObject()) : nullptr;
755 const PresObjKind eKind = pSdPage ? pSdPage->GetPresObjKind(const_cast<SdrTextObj*>(pTextObj)) : PresObjKind::NONE;
756 switch (eKind)
757 {
762 break;
763 default:
764 break;
765 }
766 }
767
768 return bReturn;
769}
770
773{
775
777
778 bool bDefaultTextRestored = RestoreDefaultText( xObj );
779
780 SdrEndTextEditKind eKind = FmFormView::SdrEndTextEdit(bDontDeleteReally);
781
782 if( bDefaultTextRestored )
783 {
784 if( xObj && !xObj->IsEmptyPresObj() )
785 {
786 xObj->SetEmptyPresObj( true );
787 }
788 else
789 {
790 eKind = SdrEndTextEditKind::Unchanged;
791 }
792 }
793 else if( xObj && xObj->IsEmptyPresObj() )
794 {
795 if( xObj && xObj->HasText() )
796 {
797 SdrPage* pPage = xObj->getSdrPageFromSdrObject();
798 if( !pPage || !pPage->IsMasterPage() )
799 xObj->SetEmptyPresObj( false );
800 }
801 }
802
805 static_cast<void*>(xObj) );
806
807 if( xObj )
808 {
809 if ( mpViewSh )
810 {
812
814 SfxLokHelper::notifyOtherViews(&mpViewSh->GetViewShellBase(), LOK_CALLBACK_VIEW_LOCK, "rectangle", "EMPTY");
815
816 }
817
818 SdPage* pPage = dynamic_cast< SdPage* >( xObj->getSdrPageFromSdrObject() );
819 if( pPage )
820 pPage->onEndTextEdit( xObj );
821 }
822
823 return eKind;
824}
825
829{
830 bool bRestored = false;
831
832 if( pTextObj && (pTextObj == GetTextEditObject()) )
833 {
834 if( !pTextObj->HasText() )
835 {
836 SdPage* pPage = dynamic_cast< SdPage* >( pTextObj->getSdrPageFromSdrObject() );
837
838 if(pPage)
839 {
840 bRestored = pPage->RestoreDefaultText( pTextObj );
841 if( bRestored )
842 {
843 SdrOutliner* pOutliner = GetTextEditOutliner();
844 pTextObj->SetTextEditOutliner( pOutliner );
845 OutlinerParaObject* pParaObj = pTextObj->GetOutlinerParaObject();
846 if (pOutliner)
847 pOutliner->SetText(*pParaObj);
848 }
849 }
850 }
851 }
852
853 return bRestored;
854}
855
860{
861 std::unique_ptr<SdrUndoGroup> pUndoGroup(new SdrUndoGroup(mrDoc));
862 const size_t nCount = GetMarkedObjectCount();
863 bool bOK = false;
864
865 for( size_t i = 0; i < nCount; ++i )
866 {
868
869 if( pObj->GetObjInventor() == SdrInventor::Default )
870 {
871 if( pObj->GetObjIdentifier() == SdrObjKind::OLE2 )
872 {
873 uno::Reference < embed::XEmbeddedObject > xObj = static_cast<SdrOle2Obj*>(pObj)->GetObjRef();
874 if( xObj.is() )
875 {
876 // TODO/LEAN: working with VisualArea can switch object to running state
877
878 sal_Int64 nAspect = static_cast<SdrOle2Obj*>(pObj)->GetAspect();
879 Size aOleSize;
880
881 if ( nAspect == embed::Aspects::MSOLE_ICON )
882 {
883 MapMode aMap100( MapUnit::Map100thMM );
884 aOleSize = static_cast<SdrOle2Obj*>(pObj)->GetOrigObjSize( &aMap100 );
885 bOK = true;
886 }
887 else
888 {
889 MapUnit aUnit = VCLUnoHelper::UnoEmbed2VCLMapUnit( xObj->getMapUnit( nAspect ) );
890 try
891 {
892 awt::Size aSz = xObj->getVisualAreaSize( nAspect );
893 aOleSize = OutputDevice::LogicToLogic(Size(aSz.Width, aSz.Height), MapMode(aUnit), MapMode(MapUnit::Map100thMM));
894 bOK = true;
895 }
896 catch( embed::NoVisualAreaSizeException& )
897 {}
898 }
899
900 if ( bOK )
901 {
902 ::tools::Rectangle aDrawRect( pObj->GetLogicRect() );
903
904 pUndoGroup->AddAction( mrDoc.GetSdrUndoFactory().CreateUndoGeoObject( *pObj ) );
905 pObj->Resize( aDrawRect.TopLeft(), Fraction( aOleSize.Width(), aDrawRect.GetWidth() ),
906 Fraction( aOleSize.Height(), aDrawRect.GetHeight() ) );
907 }
908 }
909 }
910 else if( pObj->GetObjIdentifier() == SdrObjKind::Graphic )
911 {
912 const SdrGrafObj* pSdrGrafObj = static_cast< const SdrGrafObj* >(pObj);
913 const Size aSize = pSdrGrafObj->getOriginalSize( );
914 pUndoGroup->AddAction(GetModel().GetSdrUndoFactory().CreateUndoGeoObject(*pObj));
915 ::tools::Rectangle aRect( pObj->GetLogicRect() );
916 aRect.SetSize( aSize );
917 pObj->SetLogicRect( aRect );
918 bOK = true;
919 }
920 }
921 }
922
923 if( bOK )
924 {
925 pUndoGroup->SetComment(SdResId(STR_UNDO_ORIGINALSIZE));
926 mpDocSh->GetUndoManager()->AddUndoAction(std::move(pUndoGroup));
927 }
928}
929
934{
935 if (!mpViewSh)
936 return;
937
938 uno::Reference < embed::XEmbeddedObject > xObj( pObj->GetObjRef() );
939 if( !xObj.is() )
940 return;
941
943 SfxInPlaceClient* pSdClient = mpViewSh-> GetViewShellBase().FindIPClient( xObj, pWindow );
944 if ( pSdClient )
945 return;
946
947 pSdClient = new Client(pObj, mpViewSh, pWindow);
948 ::tools::Rectangle aRect = pObj->GetLogicRect();
949 {
950 // TODO/LEAN: working with visual area can switch object to running state
951 Size aDrawSize = aRect.GetSize();
952
953 MapMode aMapMode( mrDoc.GetScaleUnit() );
954 Size aObjAreaSize = pObj->GetOrigObjSize( &aMapMode );
955
956 Fraction aScaleWidth (aDrawSize.Width(), aObjAreaSize.Width() );
957 Fraction aScaleHeight(aDrawSize.Height(), aObjAreaSize.Height() );
958 aScaleWidth.ReduceInaccurate(10); // compatible to SdrOle2Obj
959 aScaleHeight.ReduceInaccurate(10);
960 pSdClient->SetSizeScale(aScaleWidth, aScaleHeight);
961
962 // visible area is only changed in-place!
963 // the object area must be set after the scaling, since it triggers resize
964 aRect.SetSize(aObjAreaSize);
965 pSdClient->SetObjArea(aRect);
966 }
967}
968
970{
971 const SdrMarkList& rMarkList = GetMarkedObjectList();
972 bool bRet = false;
973
974 if ( rMarkList.GetMarkCount() == 2 )
975 {
976 const SdrObject* pObj1 = rMarkList.GetMark( 0 )->GetMarkedSdrObj();
977 const SdrObject* pObj2 = rMarkList.GetMark( 1 )->GetMarkedSdrObj();
978 const SdrObjKind nKind1 = pObj1->GetObjIdentifier();
979 const SdrObjKind nKind2 = pObj2->GetObjIdentifier();
980
981 if ( ( nKind1 != SdrObjKind::Text && nKind2 != SdrObjKind::Text ) &&
982 ( nKind1 != SdrObjKind::TitleText && nKind2 != SdrObjKind::TitleText ) &&
983 ( nKind1 != SdrObjKind::OutlineText && nKind2 != SdrObjKind::OutlineText ) &&
984 ( nKind1 != SdrObjKind::Group && nKind2 != SdrObjKind::Group ) &&
985 ( nKind1 != SdrObjKind::Line && nKind2 != SdrObjKind::Line ) &&
986 ( nKind1 != SdrObjKind::PolyLine && nKind2 != SdrObjKind::PolyLine ) &&
987 ( nKind1 != SdrObjKind::PathLine && nKind2 != SdrObjKind::PathLine ) &&
988 ( nKind1 != SdrObjKind::FreehandLine && nKind2 != SdrObjKind::FreehandLine ) &&
989 ( nKind1 != SdrObjKind::PathPolyLine && nKind2 != SdrObjKind::PathPolyLine ) &&
990 ( nKind1 != SdrObjKind::Measure && nKind2 != SdrObjKind::Measure ) &&
991 ( nKind1 != SdrObjKind::Edge && nKind2 != SdrObjKind::Edge ) &&
992 ( nKind1 != SdrObjKind::Graphic && nKind2 != SdrObjKind::Graphic ) &&
993 ( nKind1 != SdrObjKind::OLE2 && nKind2 != SdrObjKind::OLE2 ) &&
994 ( nKind1 != SdrObjKind::Caption && nKind2 != SdrObjKind::Caption ) &&
995 DynCastE3dObject( pObj1 ) == nullptr && DynCastE3dObject( pObj2 ) == nullptr )
996 {
999
1000 aSet1.Put(pObj1->GetMergedItemSet());
1001 aSet2.Put(pObj2->GetMergedItemSet());
1002
1003 const drawing::FillStyle eFillStyle1 = aSet1.Get( XATTR_FILLSTYLE ).GetValue();
1004 const drawing::FillStyle eFillStyle2 = aSet2.Get( XATTR_FILLSTYLE ).GetValue();
1005
1006 if( ( eFillStyle1 == drawing::FillStyle_NONE || eFillStyle1 == drawing::FillStyle_SOLID ) &&
1007 ( eFillStyle2 == drawing::FillStyle_NONE || eFillStyle2 == drawing::FillStyle_SOLID ) )
1008 bRet = true;
1009 }
1010 }
1011
1012 return bRet;
1013}
1014
1016{
1017 const SdrMarkList& rMarkList = GetMarkedObjectList();
1018 bool bRet = false;
1019
1020 if( rMarkList.GetMarkCount() == 1 )
1021 {
1022 const SdrGrafObj* pObj = dynamic_cast< const SdrGrafObj* >(rMarkList.GetMark( 0 )->GetMarkedSdrObj());
1023
1024 if(pObj)
1025 {
1026 if(GraphicType::Bitmap == pObj->GetGraphicType() && !pObj->isEmbeddedVectorGraphicData())
1027 {
1028 bRet = true;
1029 }
1030 }
1031 }
1032
1033 return bRet;
1034}
1035
1037{
1038 if( !mpViewSh )
1039 return;
1040
1042 if( !pWindow )
1043 return;
1044
1045 const StyleSettings& rStyleSettings = pWindow->GetSettings().GetStyleSettings();
1046
1048 {
1049 sal_uInt16 nOutputSlot, nPreviewSlot;
1050
1051 if( rStyleSettings.GetHighContrastMode() )
1052 {
1053 nOutputSlot = SID_OUTPUT_QUALITY_CONTRAST;
1054 }
1055 else
1056 {
1057 nOutputSlot = SID_OUTPUT_QUALITY_COLOR;
1058 }
1059
1060 if( rStyleSettings.GetHighContrastMode()
1061 && officecfg::Office::Common::Accessibility::IsForPagePreviews::get() )
1062 {
1063 nPreviewSlot = SID_PREVIEW_QUALITY_CONTRAST;
1064 }
1065 else
1066 {
1067 nPreviewSlot = SID_PREVIEW_QUALITY_COLOR;
1068 }
1069
1070 mpViewSh->GetViewFrame()->GetDispatcher()->Execute( nOutputSlot, SfxCallMode::ASYNCHRON );
1071 mpViewSh->GetViewFrame()->GetDispatcher()->Execute( nPreviewSlot, SfxCallMode::ASYNCHRON );
1072 }
1073
1075}
1076
1077IMPL_LINK( View, OnParagraphInsertedHdl, ::Outliner::ParagraphHdlParam, aParam, void )
1078{
1079 SdrObject* pObj = GetTextEditObject();
1080
1081 if( aParam.pPara && pObj )
1082 {
1083 SdPage* pPage = dynamic_cast< SdPage* >( pObj->getSdrPageFromSdrObject() );
1084 if( pPage )
1085 pPage->onParagraphInserted( aParam.pOutliner, aParam.pPara, pObj );
1086 }
1087}
1088
1092IMPL_LINK( View, OnParagraphRemovingHdl, ::Outliner::ParagraphHdlParam, aParam, void )
1093{
1094 SdrObject* pObj = GetTextEditObject();
1095
1096 if( aParam.pPara && pObj )
1097 {
1098 SdPage* pPage = dynamic_cast< SdPage* >( pObj->getSdrPageFromSdrObject() );
1099 if( pPage )
1100 pPage->onParagraphRemoving( aParam.pOutliner, aParam.pPara, pObj );
1101 }
1102}
1103
1105{
1106 if( mrDoc.IsUndoEnabled() )
1107 {
1108 sd::UndoManager* pUndoManager = mrDoc.GetUndoManager();
1109 return pUndoManager && pUndoManager->IsInListAction();
1110 }
1111 else
1112 {
1113 return false;
1114 }
1115}
1116
1118{
1120}
1121
1123{
1124 AdjustMarkHdl();
1125}
1126
1128{
1129 SdrViewContext eContext = SdrViewContext::Standard;
1130 if( maSmartTags.getContext( eContext ) )
1131 return eContext;
1132 else
1133 return FmFormView::GetContext();
1134}
1135
1137{
1139 return true;
1140 else
1142}
1143
1145{
1148 return nCount;
1149}
1150
1152{
1154 return true;
1155 else
1157}
1158
1159bool View::MarkPoint(SdrHdl& rHdl, bool bUnmark )
1160{
1161 if( maSmartTags.MarkPoint( rHdl, bUnmark ) )
1162 return true;
1163 else
1164 return FmFormView::MarkPoint( rHdl, bUnmark );
1165}
1166
1167bool View::MarkPoints(const ::tools::Rectangle* pRect, bool bUnmark)
1168{
1169 if( maSmartTags.MarkPoints( pRect, bUnmark ) )
1170 return true;
1171 else
1172 return FmFormView::MarkPoints( pRect, bUnmark );
1173}
1174
1176{
1179}
1180
1182{
1183 SdrOutliner* pOutliner = GetTextEditOutliner();
1184 if (!pOutliner)
1185 return;
1186
1187 // Turn character attributes of the paragraph of the insert position into
1188 // character-level attributes, so they are not lost when OnEndPasteOrDrop()
1189 // sets the paragraph stylesheet.
1190 SfxItemSet aSet(pOutliner->GetParaAttribs(pInfo->nStartPara));
1191 pOutliner->SetCharAttribs(pInfo->nStartPara, aSet);
1192}
1193
1197{
1198 /* Style Sheet handling */
1199 SdrTextObj* pTextObj = GetTextEditObject();
1200 SdrOutliner* pOutliner = GetTextEditOutliner();
1201 if( !pOutliner || !pTextObj || !pTextObj->getSdrPageFromSdrObject() )
1202 return;
1203
1204 SdPage* pPage = static_cast< SdPage* >( pTextObj->getSdrPageFromSdrObject() );
1205 const PresObjKind eKind = pPage->GetPresObjKind(pTextObj);
1206
1207 // outline kinds are taken care of in Outliner::ImplSetLevelDependentStyleSheet
1208 if( eKind == PresObjKind::Outline )
1209 return;
1210
1211 SfxStyleSheet* pStyleSheet = nullptr;
1212 if( eKind != PresObjKind::NONE )
1213 pStyleSheet = pPage->GetStyleSheetForPresObj(eKind);
1214 else
1215 pStyleSheet = pTextObj->GetStyleSheet();
1216 // just put the object style on each new paragraph
1217 for ( sal_Int32 nPara = pInfo->nStartPara; nPara <= pInfo->nEndPara; nPara++ )
1218 {
1219 pOutliner->SetStyleSheet( nPara, pStyleSheet );
1220 }
1221}
1222
1224 const bool bBulletOnOffMode,
1225 const bool bNormalBullet)
1226{
1227 // If setting bullets/numbering by the dialog, always should toggle on.
1228 if (!bBulletOnOffMode)
1229 return true;
1230 SdrModel& rSdrModel = GetModel();
1231
1232 bool bToggleOn = false;
1233 std::unique_ptr<SdrOutliner> pOutliner(SdrMakeOutliner(OutlinerMode::TextObject, rSdrModel));
1234 const size_t nMarkCount = GetMarkedObjectCount();
1235 for (size_t nIndex = 0; nIndex < nMarkCount && !bToggleOn; ++nIndex)
1236 {
1238 if (!pTextObj || pTextObj->IsTextEditActive())
1239 continue;
1240 if( dynamic_cast< const SdrTableObj *>( pTextObj ) != nullptr)
1241 {
1242 SdrTableObj* pTableObj = dynamic_cast< SdrTableObj* >(pTextObj);
1243 if (!pTableObj)
1244 continue;
1245 CellPos aStart, aEnd;
1246 SvxTableController* pTableController = dynamic_cast< SvxTableController* >(getSelectionController().get());
1247 if (pTableController)
1248 {
1249 pTableController->getSelectedCells(aStart, aEnd);
1250 }
1251 else
1252 {
1253 aStart = SdrTableObj::getFirstCell();
1254 aEnd = pTableObj->getLastCell();
1255 }
1256 sal_Int32 nColCount = pTableObj->getColumnCount();
1257 for (sal_Int32 nRow = aStart.mnRow; nRow <= aEnd.mnRow && !bToggleOn; nRow++)
1258 {
1259 for (sal_Int32 nCol = aStart.mnCol; nCol <= aEnd.mnCol && !bToggleOn; nCol++)
1260 {
1261 sal_Int32 nCellIndex = nRow * nColCount + nCol;
1262 SdrText* pText = pTableObj->getText(nCellIndex);
1263 if (!pText || !pText->GetOutlinerParaObject())
1264 continue;
1265 pOutliner->SetText(*(pText->GetOutlinerParaObject()));
1266 sal_Int16 nStatus = pOutliner->GetBulletsNumberingStatus();
1267 bToggleOn = (bNormalBullet && nStatus != 0) || (!bNormalBullet && nStatus != 1);
1268 pOutliner->Clear();
1269 }
1270 }
1271 }
1272 else
1273 {
1274 OutlinerParaObject* pParaObj = pTextObj->GetOutlinerParaObject();
1275 if (!pParaObj)
1276 continue;
1277 pOutliner->SetText(*pParaObj);
1278 sal_Int16 nStatus = pOutliner->GetBulletsNumberingStatus();
1279 bToggleOn = (bNormalBullet && nStatus != 0) || (!bNormalBullet && nStatus != 1);
1280 pOutliner->Clear();
1281 }
1282 }
1283 return bToggleOn;
1284}
1285
1287 const bool bToggle,
1288 const bool bHandleBullets,
1289 const SvxNumRule* pNumRule )
1290{
1291 SdrModel& rSdrModel = GetModel();
1293 vcl::Window* pWindow = pOut ? pOut->GetOwnerWindow() : nullptr;
1294 if (!pWindow)
1295 return;
1296
1297 const bool bUndoEnabled = rSdrModel.IsUndoEnabled();
1298 std::unique_ptr<SdrUndoGroup> pUndoGroup(bUndoEnabled ? new SdrUndoGroup(rSdrModel) : nullptr);
1299
1300 const bool bToggleOn = ShouldToggleOn( bToggle, bHandleBullets );
1301
1302 std::unique_ptr<SdrOutliner> pOutliner(SdrMakeOutliner(OutlinerMode::TextObject, rSdrModel));
1303 OutlinerView aOutlinerView(pOutliner.get(), pWindow);
1304
1305 const size_t nMarkCount = GetMarkedObjectCount();
1306 for (size_t nIndex = 0; nIndex < nMarkCount; ++nIndex)
1307 {
1309 if (!pTextObj || pTextObj->IsTextEditActive())
1310 continue;
1311 if( dynamic_cast< SdrTableObj *>( pTextObj ) != nullptr)
1312 {
1313 SdrTableObj* pTableObj = dynamic_cast< SdrTableObj* >(pTextObj);
1314 if (!pTableObj)
1315 continue;
1316 CellPos aStart, aEnd;
1317 SvxTableController* pTableController = dynamic_cast< SvxTableController* >(getSelectionController().get());
1318 if (pTableController)
1319 {
1320 pTableController->getSelectedCells(aStart, aEnd);
1321 }
1322 else
1323 {
1324 aStart = SdrTableObj::getFirstCell();
1325 aEnd = pTableObj->getLastCell();
1326 }
1327 sal_Int32 nColCount = pTableObj->getColumnCount();
1328 for (sal_Int32 nRow = aStart.mnRow; nRow <= aEnd.mnRow; nRow++)
1329 {
1330 for (sal_Int32 nCol = aStart.mnCol; nCol <= aEnd.mnCol; nCol++)
1331 {
1332 sal_Int32 nCellIndex = nRow * nColCount + nCol;
1333 SdrText* pText = pTableObj->getText(nCellIndex);
1334 if (!pText || !pText->GetOutlinerParaObject())
1335 continue;
1336
1337 pOutliner->SetText(*(pText->GetOutlinerParaObject()));
1338 if (bUndoEnabled)
1339 {
1340 pUndoGroup->AddAction(rSdrModel.GetSdrUndoFactory().CreateUndoObjectSetText(*pTextObj, nCellIndex));
1341 }
1342 if ( !bToggleOn )
1343 {
1344 aOutlinerView.SwitchOffBulletsNumbering();
1345 }
1346 else
1347 {
1348 aOutlinerView.ApplyBulletsNumbering( bHandleBullets, pNumRule, bToggle );
1349 }
1350 sal_uInt32 nParaCount = pOutliner->GetParagraphCount();
1351 pText->SetOutlinerParaObject(pOutliner->CreateParaObject(0, static_cast<sal_uInt16>(nParaCount)));
1352 pOutliner->Clear();
1353 }
1354 }
1355 // Broadcast the object change event.
1356 if (!pTextObj->AdjustTextFrameWidthAndHeight())
1357 {
1358 pTextObj->SetChanged();
1359 pTextObj->BroadcastObjectChange();
1360 }
1361 }
1362 else
1363 {
1364 OutlinerParaObject* pParaObj = pTextObj->GetOutlinerParaObject();
1365 if (!pParaObj)
1366 continue;
1367 pOutliner->SetText(*pParaObj);
1368 if (bUndoEnabled)
1369 {
1370 pUndoGroup->AddAction(
1371 rSdrModel.GetSdrUndoFactory().CreateUndoObjectSetText(*pTextObj, 0));
1372 }
1373 if ( !bToggleOn )
1374 {
1375 aOutlinerView.SwitchOffBulletsNumbering();
1376 }
1377 else
1378 {
1379 aOutlinerView.ApplyBulletsNumbering( bHandleBullets, pNumRule, bToggle );
1380 }
1381 sal_uInt32 nParaCount = pOutliner->GetParagraphCount();
1382 pTextObj->SetOutlinerParaObject(pOutliner->CreateParaObject(0, static_cast<sal_uInt16>(nParaCount)));
1383 pOutliner->Clear();
1384 }
1385 }
1386
1387 if ( bUndoEnabled && pUndoGroup->GetActionCount() > 0 )
1388 {
1389 rSdrModel.BegUndo();
1390 rSdrModel.AddUndo(std::move(pUndoGroup));
1391 rSdrModel.EndUndo();
1392 }
1393}
1394
1395} // end of namespace sd
1396
1397/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
@ BeginTextEdit
Text editing in one of the shapes in the MainViewShell has started.
@ EndTextEdit
Text editing in one of the shapes in the MainViewShell has ended.
const StyleSettings & GetStyleSettings() const
static const AllSettings & GetSettings()
virtual void CheckPossibilities() override
virtual void MarkListHasChanged() override
virtual void DeleteDeviceFromPaintView(OutputDevice &rOldDev) override
void ReduceInaccurate(unsigned nSignificantBits)
static css::uno::Reference< css::linguistic2::XSpellChecker1 > GetSpellChecker()
static css::uno::Reference< css::linguistic2::XHyphenator > GetHyphenator()
MapUnit GetMapUnit() const
void ApplyBulletsNumbering(const bool bHandleBullets, const SvxNumRule *pNewNumRule, const bool bCheckCurrentNumRuleBeforeApplyingNewNumRule, const bool bAtSelection=false)
bool IsReadOnly() const
void SetReadOnly(bool bReadOnly)
void SwitchOffBulletsNumbering(const bool bAtSelection=false)
void SelectRange(sal_Int32 nFirst, sal_Int32 nCount)
void SetBackgroundColor(const Color &rColor)
SAL_WARN_UNUSED_RESULT Point LogicToLogic(const Point &rPtSource, const MapMode *pMapModeSource, const MapMode *pMapModeDest) const
OutDevType GetOutDevType() const
sd::UndoManager * GetUndoManager() const
Definition: drawdoc2.cxx:1377
SAL_DLLPRIVATE SfxItemPool & GetPool()
Definition: drawdoc.hxx:237
SAL_DLLPRIVATE bool GetOnlineSpell() const
Definition: drawdoc.hxx:431
SAL_DLLPRIVATE bool IsSummationOfParagraphs() const
Definition: drawdoc.hxx:406
bool IsPresObj(const SdrObject *pObj)
Definition: sdpage.cxx:2322
void onParagraphRemoving(const ::Outliner *pOutliner, Paragraph const *pPara, SdrObject *pObj)
callback from the sd::View when a paragraph from one object on this page is removed
PageKind GetPageKind() const
Definition: sdpage.hxx:205
SfxStyleSheet * GetStyleSheetForPresObj(PresObjKind eObjKind) const
Definition: sdpage.cxx:625
PresObjKind GetPresObjKind(SdrObject *pObj) const
Definition: sdpage.cxx:2309
void onEndTextEdit(SdrObject *pObj)
callback from the sd::View when an object just left text edit mode
bool RestoreDefaultText(SdrObject *pObj)
Definition: sdpage.cxx:2866
void onParagraphInserted(const ::Outliner *pOutliner, Paragraph const *pPara, SdrObject *pObj)
callback from the sd::View when a new paragraph for one object on this page is created
void SetStyleSheet(SfxStyleSheet *pStyleSheet, bool bDontRemoveHardAttr)
void SetUseIncompatiblePathCreateInterface(bool bOn)
void SetMeasureLayer(const OUString &rName)
GraphicType GetGraphicType() const
bool isEmbeddedVectorGraphicData() const
Size getOriginalSize() const
size_t GetMarkCount() const
SdrMark * GetMark(size_t nNum) const
virtual sal_Int32 GetMarkablePointCount() const
const SdrMarkList & GetMarkedObjectList() const
SdrObject * GetMarkedObjectByIndex(size_t nNum) const
SdrHdlList maHdlList
virtual bool HasMarkedPoints() const
size_t GetMarkedObjectCount() const
virtual bool MarkPoint(SdrHdl &rHdl, bool bUnmark=false)
virtual bool HasMarkablePoints() const
void AdjustMarkHdl(SfxViewShell *pOtherShell=nullptr)
virtual bool MarkPoints(const tools::Rectangle *pRect, bool bUnmark)
SdrObject * GetMarkedSdrObj() const
void BegUndo()
MapUnit GetScaleUnit() const
void AddUndo(std::unique_ptr< SdrUndoAction > pUndo)
SdrOutliner & GetDrawOutliner(const SdrTextObj *pObj=nullptr) const
SfxStyleSheetBasePool * GetStyleSheetPool() const
SdrUndoFactory & GetSdrUndoFactory() const
bool IsUndoEnabled() const
void EndUndo()
SdrTextObj * GetTextEditObject() const
virtual SdrEndTextEditKind SdrEndTextEdit(bool bDontDeleteReally=false)
const OutlinerView * GetTextEditOutlinerView() const
const rtl::Reference< sdr::SelectionController > & getSelectionController() const
virtual bool IsTextEdit() const final override
virtual bool SdrBeginTextEdit(SdrObject *pObj, SdrPageView *pPV=nullptr, vcl::Window *pWin=nullptr, bool bIsNewObj=false, SdrOutliner *pGivenOutliner=nullptr, OutlinerView *pGivenOutlinerView=nullptr, bool bDontDeleteOutliner=false, bool bOnlyOneView=false, bool bGrabFocus=true)
const SdrOutliner * GetTextEditOutliner() const
SdrObjUserCall * GetUserCall() const
bool setSuitableOutlinerBg(Outliner &rOutliner) const
void SetOutlinerParaObject(std::optional< OutlinerParaObject > pTextObject)
void BroadcastObjectChange() const
void SetEmptyPresObj(bool bEpt)
virtual SdrInventor GetObjInventor() const
bool IsEmptyPresObj() const
SdrModel & getSdrModelFromSdrObject() const
virtual void SetLogicRect(const tools::Rectangle &rRect)
SfxStyleSheet * GetStyleSheet() const
virtual void SetChanged()
virtual SdrObjKind GetObjIdentifier() const
SdrPage * getSdrPageFromSdrObject() const
const SfxItemSet & GetMergedItemSet() const
virtual const tools::Rectangle & GetLogicRect() const
virtual void Resize(const Point &rRef, const Fraction &xFact, const Fraction &yFact, bool bUnsetRelative=true)
css::uno::Reference< css::embed::XEmbeddedObject > const & GetObjRef() const
Size GetOrigObjSize(MapMode const *pTargetMapMode=nullptr) const
const SdrTextObj * GetTextObj() const
SdrPage * GetPage() const
bool IsMasterPage() const
virtual bool checkVisibility(const sdr::contact::ViewObjectContact &rOriginal, const sdr::contact::DisplayInfo &rDisplayInfo, bool bEdit)
Color GetPageBackgroundColor() const
virtual void CompleteRedraw(OutputDevice *pOut, const vcl::Region &rReg, sdr::contact::ViewObjectContactRedirector *pRedirector=nullptr)
OutputDevice * GetFirstOutputDevice() const
void SetBufferedOverlayAllowed(bool bNew)
void SetHitTolerancePixel(sal_uInt16 nVal)
sal_uInt32 PaintWindowCount() const
SdrPageView * GetSdrPageView() const
SdrModel & GetModel() const
void SetMinMoveDistancePixel(sal_uInt16 nVal)
void SetBufferedOutputAllowed(bool bNew)
void SetTextEditOutliner(SdrOutliner *pOutl)
bool IsTextEditActive() const
virtual bool AdjustTextFrameWidthAndHeight(tools::Rectangle &rR, bool bHgt=true, bool bWdt=true) const
virtual OutlinerParaObject * GetOutlinerParaObject() const override
virtual const tools::Rectangle & GetLogicRect() const override
virtual bool HasText() const override
SdrTextVertAdjust GetTextVerticalAdjust(const SfxItemSet &rSet) const
OutlinerParaObject * GetOutlinerParaObject()
virtual void SetOutlinerParaObject(std::optional< OutlinerParaObject > pTextObject)
virtual std::unique_ptr< SdrUndoAction > CreateUndoObjectSetText(SdrObject &rNewObj, sal_Int32 nText)
virtual std::unique_ptr< SdrUndoAction > CreateUndoGeoObject(SdrObject &rObject)
virtual SdrViewContext GetContext() const
void EnableExtendedMouseEventDispatcher(bool bOn)
bool SetAttributes(const SfxItemSet &rSet, bool bReplaceAll=false)
void MarkAll()
void EnableExtendedKeyInputDispatcher(bool bOn)
void GetAttributes(SfxItemSet &rTargetSet, bool bOnlyHardAttr=false) const
const SfxPoolItem * Execute(sal_uInt16 nSlot, SfxCallMode nCall=SfxCallMode::SLOT, const SfxPoolItem **pArgs=nullptr, sal_uInt16 nModi=0, const SfxPoolItem **pInternalArgs=nullptr)
bool SetObjArea(const tools::Rectangle &)
void SetSizeScale(const Fraction &rScaleWidth, const Fraction &rScaleHeight)
const SfxPoolItem * Put(const SfxPoolItem &rItem, sal_uInt16 nWhich)
const SfxPoolItem & Get(sal_uInt16 nWhich, bool bSrchInParent=true) const
static void notifyOtherViews(const SfxViewShell *pThisView, int nType, std::string_view rKey, const OString &rPayload)
virtual void Invalidate(sal_uInt16 nId=0)
virtual void AddUndoAction(std::unique_ptr< SfxUndoAction > pAction, bool bTryMerg=false)
SfxDispatcher * GetDispatcher()
constexpr tools::Long Height() const
constexpr tools::Long Width() const
bool GetHighContrastMode() const
void Stop()
void SetInvokeHandler(const Link< Timer *, void > &rLink)
static MapUnit UnoEmbed2VCLMapUnit(sal_Int32 nUnoEmbedMapUnit)
bool decompose(B2DTuple &rScale, B2DTuple &rTranslate, double &rRotate, double &rShearX) const
TYPE getX() const
TYPE getY() const
const css::uno::Reference< css::drawing::XDrawPage > & getVisualizedPage() const
virtual void visit(const Primitive2DReference &)=0
double getTextWidth(const OUString &rText, sal_uInt32 nIndex, sal_uInt32 nLength) const
void setFont(const vcl::Font &rFont)
void FireSelectionChangeListener() noexcept
Call this method when the selection has changed.
virtual SfxUndoManager * GetUndoManager() override
Definition: docshell.cxx:363
SdrOutliner * m_pOutl
Definition: View.hxx:59
void Start(SdrOutliner *pOutl)
Definition: sdview.cxx:621
void Dispose()
disposes all smart tags and clears the set
Definition: smarttag.cxx:144
bool HasMarkedPoints() const
Definition: smarttag.cxx:285
sal_uLong GetMarkablePointCount() const
Definition: smarttag.cxx:278
bool MarkPoints(const ::tools::Rectangle *pRect, bool bUnmark)
Definition: smarttag.cxx:306
void CheckPossibilities()
Definition: smarttag.cxx:313
bool HasMarkablePoints() const
Definition: smarttag.cxx:273
void deselect()
deselects the current selected smart tag and updates all handles
Definition: smarttag.cxx:172
bool getContext(SdrViewContext &rContext) const
returns true if the currently selected smart tag has a special context, returned in rContext.
Definition: smarttag.cxx:263
bool MarkPoint(SdrHdl &rHdl, bool bUnmark)
Definition: smarttag.cxx:298
void addCustomHandles(SdrHdlList &rHandlerList)
adds the handles from all smart tags to the given list
Definition: smarttag.cxx:255
Handle clipboard related tasks for the draw view.
DrawController * GetDrawController() const
std::shared_ptr< tools::EventMultiplexer > const & GetEventMultiplexer() const
Return an event multiplexer.
Base class of the stacked shell hierarchy.
Definition: ViewShell.hxx:92
virtual void UpdateScrollBars()
Set internal values of all scroll bars that determine thumb size and position.
Definition: viewshe2.cxx:71
::sd::Window * GetActiveWindow() const
The active window is usually the mpContentWindow.
Definition: ViewShell.hxx:155
SD_DLLPUBLIC ViewShellBase & GetViewShellBase() const
Definition: viewshel.cxx:1397
SD_DLLPUBLIC SfxViewFrame * GetViewFrame() const
Definition: viewshel.cxx:118
bool IsPresObjSelected(bool bOnPage=true, bool bOnMasterPage=true, bool bCheckPresObjListOnly=false, bool bCheckLayoutOnly=false) const
Is a presentation object selected?
Definition: sdview.cxx:523
virtual bool HasMarkedPoints() const override
Definition: sdview.cxx:1151
rtl::Reference< avmedia::PlayerListener > mxDropMediaSizeListener
Definition: View.hxx:273
void SetMarkedOriginalSize()
Sets the original size of the marked objects.
Definition: sdview.cxx:859
virtual bool SetStyleSheet(SfxStyleSheet *pStyleSheet, bool bDontRemoveHardAttr=false)
Definition: sdview.cxx:601
virtual bool SetAttributes(const SfxItemSet &rSet, bool bReplaceAll=false, bool bSlide=false, bool bMaster=false)
Definition: sdview.cxx:509
bool ShouldToggleOn(const bool bBulletOnOffMode, const bool bNormalBullet)
Definition: sdview.cxx:1223
virtual void GetAttributes(SfxItemSet &rTargetSet, bool bOnlyHardAttr=false) const
Definition: sdview.cxx:515
std::unique_ptr< SdrUndoManager > createLocalTextUndoManager() override
Definition: sdview.cxx:650
bool isRecordingUndo() const
returns true if we have an undo manager and there is an open list undo action
Definition: sdview.cxx:1104
virtual bool HasMarkablePoints() const override
Definition: sdview.cxx:1136
virtual void DoConnect(SdrOle2Obj *pOleObj) override
Connect OLE object to client.
Definition: sdview.cxx:933
DrawDocShell * mpDocSh
Definition: View.hxx:262
ViewShell * GetViewShell() const
Definition: View.hxx:144
virtual bool SdrBeginTextEdit(SdrObject *pObj, SdrPageView *pPV=nullptr, vcl::Window *pWin=nullptr, bool bIsNewObj=false, SdrOutliner *pGivenOutliner=nullptr, OutlinerView *pGivenOutlinerView=nullptr, bool bDontDeleteOutliner=false, bool bOnlyOneView=false, bool bGrabFocus=true) override
Definition: sdview.cxx:657
void ChangeMarkedObjectsBulletsNumbering(const bool bToggle, const bool bHandleBullets, const SvxNumRule *pNumRule)
change the bullets/numbering of the marked objects
Definition: sdview.cxx:1286
View(SdDrawDocument &rDrawDoc, OutputDevice *pOutDev, ViewShell *pViewSh=nullptr)
Definition: sdview.cxx:98
virtual void OnBeginPasteOrDrop(PasteOrDropInfos *pInfo) override
Definition: sdview.cxx:1181
sal_uInt16 mnLockRedrawSmph
Definition: View.hxx:274
virtual void OnEndPasteOrDrop(PasteOrDropInfos *pInfo) override
this is called after a paste or drop operation, make sure that the newly inserted paragraphs get the ...
Definition: sdview.cxx:1196
virtual void onAccessibilityOptionsChanged() override
Definition: sdview.cxx:1036
ViewShell * mpViewSh
Definition: View.hxx:263
void ClearSelectionClipboard()
Definition: sdview2.cxx:226
std::unique_ptr< SdrMarkList > mpDragSrcMarkList
Definition: View.hxx:264
void CompleteRedraw(OutputDevice *pOutDev, const vcl::Region &rReg, sdr::contact::ViewObjectContactRedirector *pRedirector=nullptr) override
The event will be forwarded to the View.
Definition: sdview.cxx:469
bool IsMorphingAllowed() const
Definition: sdview.cxx:969
virtual bool MarkPoints(const ::tools::Rectangle *pRect, bool bUnmark) override
Definition: sdview.cxx:1167
virtual SdrEndTextEditKind SdrEndTextEdit(bool bDontDeleteReally=false) override
ends current text editing
Definition: sdview.cxx:772
bool RestoreDefaultText(SdrTextObj *pTextObj)
restores the default text if the given text object is currently in edit mode and no text has been ent...
Definition: sdview.cxx:828
virtual bool MarkPoint(SdrHdl &rHdl, bool bUnmark=false) override
Definition: sdview.cxx:1159
void SelectAll()
Definition: sdview.cxx:587
SfxViewShell * GetSfxViewShell() const override
Definition: sdview.cxx:639
virtual void CheckPossibilities() override
Definition: sdview.cxx:1175
virtual sal_Int32 GetMarkablePointCount() const override
Definition: sdview.cxx:1144
virtual void AddCustomHdl() override
Definition: sdview.cxx:1117
SdPage * GetPage()
Definition: sdview5.cxx:45
virtual ~View() override
Definition: sdview.cxx:141
void ImplClearDrawDropMarker()
Definition: sdview.cxx:136
std::unique_ptr< SdrDropMarkerOverlay > mpDropMarker
Definition: View.hxx:266
SdDrawDocument & mrDoc
Definition: View.hxx:261
sal_uInt16 mnDragSrcPgNum
Definition: View.hxx:267
bool IsVectorizeAllowed() const
Definition: sdview.cxx:1015
OutlinerMasterViewFilter maMasterViewFilter
Definition: View.hxx:287
virtual SdrViewContext GetContext() const override
Definition: sdview.cxx:1127
Idle maDropErrorIdle
Definition: View.hxx:271
void updateHandles()
Definition: sdview.cxx:1122
SmartTagSet maSmartTags
Definition: View.hxx:283
virtual void MarkListHasChanged() override
Definition: sdview.cxx:501
Idle maDropInsertFileIdle
Definition: View.hxx:272
An SdWindow contains the actual working area of ViewShell.
Definition: Window.hxx:45
bool GetSubContentActive() const
virtual SdrPageView * TryToGetSdrPageView() const
virtual bool isOutputToPrinter() const
const drawinglayer::geometry::ViewInformation2D & getViewInformation2D() const
virtual SdrObject * TryToGetSdrObject() const
virtual void createRedirectedPrimitive2DSequence(const sdr::contact::ViewObjectContact &rOriginal, const sdr::contact::DisplayInfo &rDisplayInfo, drawinglayer::primitive2d::Primitive2DDecompositionVisitor &rVisitor)
ViewContact & GetViewContact() const
ObjectContact & GetObjectContact() const
CellPos getLastCell() const
sal_Int32 getColumnCount() const
virtual SdrText * getText(sal_Int32 nIndex) const override
void getSelectedCells(CellPos &rFirstPos, CellPos &rLastPos) override
ColorConfigValue GetColorValue(ColorConfigEntry eEntry, bool bSmart=true) const
constexpr tools::Long GetWidth() const
void SetSize(const Size &)
constexpr Point TopLeft() const
constexpr Size GetSize() const
constexpr tools::Long GetHeight() const
rtl::OString toString() const
void SetFontHeight(tools::Long nHeight)
const AllSettings & GetSettings() const
const MapMode & GetMapMode() const
int nCount
#define suppress_fun_call_w_exception(expr)
EEControlBits
EmbeddedObjectRef * pObject
sal_Int32 nIndex
MapUnit
bool IsOverlayBuffer_DrawImpress()
B2DHomMatrix createScaleShearXRotateTranslateB2DHomMatrix(double fScaleX, double fScaleY, double fShearX, double fRadiant, double fTranslateX, double fTranslateY)
B2DPolygon const & createUnitPolygon()
attribute::FontAttribute getFontAttributeFromVclFont(basegfx::B2DVector &o_rSize, const vcl::Font &rFont, bool bRTL, bool bBiDiStrong)
int i
constexpr Point convert(const Point &rPoint, o3tl::Length eFrom, o3tl::Length eTo)
static void SetSpellOptions(const SdDrawDocument &rDoc, EEControlBits &rCntrl)
Start text input.
Definition: sdview.cxx:611
IMPL_LINK(SdCharHeightPropertyBox, implMenuSelectHdl, const OUString &, rIdent, void)
OUTDEV_PDF
OUTDEV_PRINTER
PresObjKind
Definition: pres.hxx:22
OUString SdResId(TranslateId aId)
Definition: sdmod.cxx:83
#define SD_MOD()
Definition: sdmod.hxx:184
SdrTextVertAdjust
static SfxItemSet & rSet
sal_Int32 nStartPara
SdrEndTextEditKind
SVXCORE_DLLPUBLIC Color GetTextEditBackgroundColor(const SdrObjEditView &rView)
SVXCORE_DLLPUBLIC std::unique_ptr< SdrOutliner > SdrMakeOutliner(OutlinerMode nOutlinerMode, SdrModel &rMod)
SVXCORE_DLLPUBLIC SdrTextObj * DynCastSdrTextObj(SdrObject *)
SVXCORE_DLLPUBLIC E3dObject * DynCastE3dObject(SdrObject *)
SdrObjKind
#define SDRPAGE_NOTFOUND
SdrViewContext
#define DND_ACTION_NONE
SVXCORE_DLLPUBLIC SdrPage * GetSdrPageFromXDrawPage(const css::uno::Reference< css::drawing::XDrawPage > &xDrawPage) noexcept
constexpr OUStringLiteral sUNO_LayerName_measurelines
Definition: unokywds.hxx:33
oslFileHandle & pOut
constexpr TypedWhichId< XFillStyleItem > XATTR_FILLSTYLE(XATTR_FILL_FIRST)