LibreOffice Module sd (master) 1
outlnvsh.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 <OutlineViewShell.hxx>
21
22#include <helpids.h>
23#include <app.hrc>
24#include <svx/hyperdlg.hxx>
26#include <svx/svdundo.hxx>
27
28#include <sfx2/infobar.hxx>
29#include <sfx2/objface.hxx>
30#include <sfx2/zoomitem.hxx>
31#include <editeng/editview.hxx>
32#include <editeng/eeitem.hxx>
33#include <editeng/flditem.hxx>
34#include <sfx2/shell.hxx>
35#include <sfx2/request.hxx>
36#include <svx/hlnkitem.hxx>
37#include <svx/svdotext.hxx>
38#include <svx/svdoutl.hxx>
39#include <sfx2/dispatch.hxx>
40#include <sfx2/viewfrm.hxx>
41#include <vcl/commandevent.hxx>
42#include <vcl/settings.hxx>
43
44#include <sal/log.hxx>
45#include <svl/stritem.hxx>
46#include <svl/whiter.hxx>
47#include <editeng/editstat.hxx>
48#include <svl/itempool.hxx>
49#include <sfx2/tplpitem.hxx>
51#include <vcl/EnumContext.hxx>
52#include <sot/formats.hxx>
53#include <com/sun/star/linguistic2/XThesaurus.hpp>
54#include <editeng/unolingu.hxx>
55#include <editeng/outlobj.hxx>
56#include <svl/cjkoptions.hxx>
58#include <svl/srchitem.hxx>
59#include <editeng/editobj.hxx>
60#include <fubullet.hxx>
61
62#include <strings.hrc>
63
64#include <Window.hxx>
65#include <drawdoc.hxx>
66#include <sdresid.hxx>
67#include <sdpage.hxx>
68#include <fuoltext.hxx>
69#include <FrameView.hxx>
70#include <zoomlist.hxx>
71#include <stlsheet.hxx>
72#include <SdUnoOutlineView.hxx>
73#include <SpellDialogChildWindow.hxx>
74
76#include <ViewShellBase.hxx>
77#include <DrawController.hxx>
78#include <DrawDocShell.hxx>
79#include <OutlineView.hxx>
82
83#include <memory>
84
85using namespace ::com::sun::star;
86using namespace ::com::sun::star::uno;
87using namespace ::com::sun::star::lang;
88using namespace ::com::sun::star::linguistic2;
89
90using namespace sd;
91
92#define ShellClass_OutlineViewShell
93#include <sdslots.hxx>
94
95namespace sd {
96
97#define MIN_ZOOM 10 // minimum zoom factor
98#define MAX_ZOOM 1000 // maximum zoom factor
99
104
105void OutlineViewShell::InitInterface_Impl()
106{
107 GetStaticInterface()->RegisterPopupMenu("outline");
108
109 GetStaticInterface()->RegisterObjectBar(SFX_OBJECTBAR_TOOLS, SfxVisibilityFlags::Standard | SfxVisibilityFlags::FullScreen | SfxVisibilityFlags::Server,
110 ToolbarId::Outline_Toolbox);
111 GetStaticInterface()->RegisterObjectBar(SFX_OBJECTBAR_APPLICATION, SfxVisibilityFlags::Standard | SfxVisibilityFlags::Client | SfxVisibilityFlags::Viewer | SfxVisibilityFlags::ReadonlyDoc,
112 ToolbarId::Draw_Viewer_Toolbox);
113
114 GetStaticInterface()->RegisterChildWindow(SfxInfoBarContainerChild::GetChildWindowId());
115 GetStaticInterface()->RegisterChildWindow(SvxHlinkDlgWrapper::GetChildWindowId());
116 GetStaticInterface()->RegisterChildWindow(::sd::SpellDialogChildWindow::GetChildWindowId());
117 GetStaticInterface()->RegisterChildWindow(SID_SEARCH_DLG);
118 GetStaticInterface()->RegisterChildWindow(sfx2::sidebar::SidebarChildWindow::GetChildWindowId());
119 GetStaticInterface()->RegisterChildWindow(DevelopmentToolChildWindow::GetChildWindowId());
120}
121
122
127{
128 bool bModified = GetDoc()->IsChanged();
129
131 Size aSize(29700, 21000);
132 Point aWinPos (0, 0);
133 Point aViewOrigin(0, 0);
137 InitWindows(aViewOrigin, aSize, aWinPos);
138 pOlView.reset( new OutlineView(*GetDocSh(), GetActiveWindow(), *this) );
139 mpView = pOlView.get(); // Pointer of base class ViewShell
140
141 SetPool( &GetDoc()->GetPool() );
142
143 SetZoom(69);
144
145 // Apply settings of FrameView
147
148 ::Outliner& rOutl = pOlView->GetOutliner();
149 rOutl.SetUpdateLayout(true);
150
151 if (!bModified)
152 {
153 rOutl.ClearModifyFlag();
154 }
155
157
158 SetName( "OutlineViewShell" );
159
161}
162
163Reference<drawing::XDrawSubController> OutlineViewShell::CreateSubController()
164{
165 Reference<drawing::XDrawSubController> xSubController;
166
167 if (IsMainViewShell())
168 {
169 // Create uno sub controller for the main view shell.
170 xSubController.set( new SdUnoOutlineView(*this) );
171 }
172
173 return xSubController;
174}
175
180 SfxViewFrame* /*pFrame*/,
181 ViewShellBase& rViewShellBase,
182 vcl::Window* pParentWindow,
183 FrameView* pFrameViewArgument)
184 : ViewShell(pParentWindow, rViewShellBase),
185 pLastPage( nullptr ),
186 bPastePossible(false),
187 mbInitialized(false)
188
189{
190 if (pFrameViewArgument != nullptr)
191 mpFrameView = pFrameViewArgument;
192 else
194
196
197 Construct();
198
200
201 m_StrOldPageName.clear();
202
203 doShow();
204}
205
207{
209
210 pOlView.reset();
211
213
214 if ( mxClipEvtLstnr.is() )
215 {
216 mxClipEvtLstnr->RemoveListener( GetActiveWindow() );
217 mxClipEvtLstnr->ClearCallbackLink(); // prevent callback if another thread is waiting
218 }
219}
220
222{
224
225 PrepareClose();
226}
227
232void OutlineViewShell::Paint(const ::tools::Rectangle& rRect, ::sd::Window* pWin)
233{
234 if (pOlView)
235 {
236 pOlView->Paint(rRect, pWin);
237 }
238}
239
241{
242 // Retrieve the current size (thickness) of the scroll bars. That is
243 // the width of the vertical and the height of the horizontal scroll
244 // bar.
245 int nScrollBarSize =
247 maScrBarWH = Size (nScrollBarSize, nScrollBarSize);
248
250
251 ::sd::Window* pWindow = mpContentWindow.get();
252 if (pWindow == nullptr)
253 return;
254
255 pWindow->SetMinZoomAutoCalc(false);
256
257 // change OutputArea of the OutlinerView
258 OutlinerView* pOutlinerView = pOlView->GetViewByWindow(pWindow);
259
260 ::tools::Rectangle aWin(Point(0,0), pWindow->GetOutputSizePixel());
261
262 aWin = pWindow->PixelToLogic(aWin);
263 pOutlinerView->SetOutputArea(aWin);
264
265 ::tools::Rectangle aVis = pOutlinerView->GetVisArea();
266
267 ::tools::Rectangle aText(Point(0,0),
268 Size(pOlView->GetPaperWidth(),
269 pOlView->GetOutliner().GetTextHeight()));
270 if (aWin.GetHeight() > aText.Bottom())
271 aText.SetBottom( aWin.GetHeight() );
272
273 if (!aWin.IsEmpty()) // not when opening
274 {
275 InitWindows(Point(0,0), aText.GetSize(), aVis.TopLeft());
277 }
278}
279
284{
285 sal_uInt16 nSlot = rReq.GetSlot();
286 switch ( nSlot )
287 {
288 case SID_MAIL_SCROLLBODY_PAGEDOWN:
289 {
290 ExecReq( rReq );
291 break;
292 }
293
294 case SID_OPT_LOCALE_CHANGED:
295 {
296 pOlView->GetOutliner().UpdateFields();
298 rReq.Done();
299 break;
300 }
301
302 default:
303 break;
304 }
305}
306
310void OutlineViewShell::Activate( bool bIsMDIActivate )
311{
312 if ( ! mbInitialized)
313 {
314 mbInitialized = true;
315 SfxRequest aRequest (SID_EDIT_OUTLINER, SfxCallMode::SLOT, GetDoc()->GetItemPool());
316 FuPermanent (aRequest);
317 }
318
319 ViewShell::Activate( bIsMDIActivate );
321
322 pOlView->SetLinks();
323 pOlView->ConnectToApplication();
324
325 if( bIsMDIActivate )
326 {
327 OutlinerView* pOutlinerView = pOlView->GetViewByWindow( GetActiveWindow() );
328 ::Outliner* pOutl = pOutlinerView->GetOutliner();
329 pOutl->UpdateFields();
330 }
331}
332
333void OutlineViewShell::Deactivate( bool bIsMDIActivate )
334{
335 pOlView->DisconnectFromApplication();
336
337 // Links must be kept also on deactivated viewshell, to allow drag'n'drop
338 // to function properly
339 ViewShell::Deactivate( bIsMDIActivate );
340}
341
346{
347 if (SfxItemState::DEFAULT == rSet.GetItemState(SID_HYPERLINK_GETLINK))
348 {
349 SvxHyperlinkItem aHLinkItem;
350
351 OutlinerView* pOLV = pOlView->GetViewByWindow(GetActiveWindow());
352 if (pOLV)
353 {
354 const SvxFieldItem* pFieldItem = pOLV->GetFieldAtSelection();
355 if (pFieldItem)
356 {
357 ESelection aSel = pOLV->GetSelection();
358 if ( abs( aSel.nEndPos - aSel.nStartPos ) == 1 )
359 {
360 const SvxFieldData* pField = pFieldItem->GetField();
361 if ( auto pUrlField = dynamic_cast< const SvxURLField *>( pField ) )
362 {
363 aHLinkItem.SetName(pUrlField->GetRepresentation());
364 aHLinkItem.SetURL(pUrlField->GetURL());
365 aHLinkItem.SetTargetFrame(pUrlField->GetTargetFrame());
366 }
367 }
368 }
369 }
370 rSet.Put(aHLinkItem);
371 }
372 rSet.Put( SfxBoolItem( SID_READONLY_MODE, GetDocSh()->IsReadOnly() ) );
373
374 if ( SfxItemState::DEFAULT == rSet.GetItemState(SID_MAIL_SCROLLBODY_PAGEDOWN) )
375 rSet.Put( SfxBoolItem( SID_MAIL_SCROLLBODY_PAGEDOWN, true ) );
376
377 if ( !(SfxItemState::DEFAULT == rSet.GetItemState(SID_TRANSLITERATE_HALFWIDTH) ||
378 SfxItemState::DEFAULT == rSet.GetItemState(SID_TRANSLITERATE_FULLWIDTH) ||
379 SfxItemState::DEFAULT == rSet.GetItemState(SID_TRANSLITERATE_HIRAGANA) ||
380 SfxItemState::DEFAULT == rSet.GetItemState(SID_TRANSLITERATE_KATAKANA)) )
381 return;
382
384 {
385 GetViewFrame()->GetBindings().SetVisibleState( SID_TRANSLITERATE_HALFWIDTH, false );
386 GetViewFrame()->GetBindings().SetVisibleState( SID_TRANSLITERATE_FULLWIDTH, false );
387 GetViewFrame()->GetBindings().SetVisibleState( SID_TRANSLITERATE_HIRAGANA, false );
388 GetViewFrame()->GetBindings().SetVisibleState( SID_TRANSLITERATE_KATAKANA, false );
389 rSet.DisableItem( SID_TRANSLITERATE_HALFWIDTH );
390 rSet.DisableItem( SID_TRANSLITERATE_FULLWIDTH );
391 rSet.DisableItem( SID_TRANSLITERATE_HIRAGANA );
392 rSet.DisableItem( SID_TRANSLITERATE_KATAKANA );
393 }
394 else
395 {
396 GetViewFrame()->GetBindings().SetVisibleState( SID_TRANSLITERATE_HALFWIDTH, true );
397 GetViewFrame()->GetBindings().SetVisibleState( SID_TRANSLITERATE_FULLWIDTH, true );
398 GetViewFrame()->GetBindings().SetVisibleState( SID_TRANSLITERATE_HIRAGANA, true );
399 GetViewFrame()->GetBindings().SetVisibleState( SID_TRANSLITERATE_KATAKANA, true );
400 }
401}
402
407{
408 if( rReq.GetSlot() == SID_STYLE_FAMILY && rReq.GetArgs())
409 GetDocSh()->SetStyleFamily(static_cast<SfxStyleFamily>(rReq.GetArgs()->Get( SID_STYLE_FAMILY ).GetValue()));
410
411 bool bPreviewState = false;
412 sal_uInt16 nSlot = rReq.GetSlot();
413
414 std::unique_ptr<OutlineViewModelChangeGuard, o3tl::default_delete<OutlineViewModelChangeGuard>> aGuard;
415 if( pOlView && (
416 (nSlot == SID_TRANSLITERATE_SENTENCE_CASE) ||
417 (nSlot == SID_TRANSLITERATE_TITLE_CASE) ||
418 (nSlot == SID_TRANSLITERATE_TOGGLE_CASE) ||
419 (nSlot == SID_TRANSLITERATE_UPPER) ||
420 (nSlot == SID_TRANSLITERATE_LOWER) ||
421 (nSlot == SID_TRANSLITERATE_HALFWIDTH) ||
422 (nSlot == SID_TRANSLITERATE_FULLWIDTH) ||
423 (nSlot == SID_TRANSLITERATE_HIRAGANA) ||
424 (nSlot == SID_TRANSLITERATE_KATAKANA) ||
425 (nSlot == SID_CUT) ||
426 (nSlot == SID_PASTE) ||
427 (nSlot == SID_PASTE_UNFORMATTED) ||
428 (nSlot == SID_DELETE)))
429 {
430 aGuard.reset( new OutlineViewModelChangeGuard( *pOlView ) );
431 }
432
433 switch ( nSlot )
434 {
435 case SID_CUT:
436 {
438 {
439 GetCurrentFunction()->DoCut();
440 }
441 else if (pOlView)
442 {
443 pOlView->DoCut();
444 }
445 rReq.Done();
446 bPreviewState = true;
447 }
448 break;
449
450 case SID_COPY:
451 {
453 {
454 GetCurrentFunction()->DoCopy();
455 }
456 else if (pOlView)
457 {
458 pOlView->DoCopy();
459 }
460 rReq.Done();
461 bPreviewState = true;
462 }
463 break;
464
465 case SID_PASTE:
466 {
468
470 {
471 GetCurrentFunction()->DoPaste();
472 }
473 else if (pOlView)
474 {
475 pOlView->DoPaste();
476 }
477 rReq.Done();
478 bPreviewState = true;
479 }
480 break;
481
482 case SID_PASTE_UNFORMATTED:
483 {
485
487 {
488 GetCurrentFunction()->DoPasteUnformatted();
489 }
490 else if(pOlView)
491 {
493 if (aDataHelper.GetTransferable().is())
494 {
495 sal_Int8 nAction = DND_ACTION_COPY;
496 pOlView->InsertData( aDataHelper,
497 GetActiveWindow()->PixelToLogic( ::tools::Rectangle( Point(), GetActiveWindow()->GetOutputSizePixel() ).Center() ),
498 nAction, false, SotClipboardFormatId::STRING);
499 }
500 }
501
502 rReq.Ignore ();
503 }
504 break;
505 case SID_DELETE:
506 {
507 if( pOlView )
508 {
509 OutlinerView* pOutlView = pOlView->GetViewByWindow(GetActiveWindow());
510 if (pOutlView)
511 {
513
514 vcl::KeyCode aKCode(KEY_DELETE);
515 KeyEvent aKEvt( 0, aKCode );
516 pOutlView->PostKeyEvent(aKEvt);
517
519 FuOutlineText* pFuOutlineText = dynamic_cast< FuOutlineText* >( xFunc.get() );
520 if( pFuOutlineText )
521 pFuOutlineText->UpdateForKeyPress (aKEvt);
522 }
523 }
524 rReq.Done();
525 bPreviewState = true;
526 }
527 break;
528
529 case SID_DRAWINGMODE:
530 case SID_SLIDE_MASTER_MODE:
531 case SID_NOTES_MODE:
532 case SID_NOTES_MASTER_MODE:
533 case SID_HANDOUT_MASTER_MODE:
534 case SID_SLIDE_SORTER_MODE:
535 case SID_OUTLINE_MODE:
537 nSlot,
538 rReq);
539 rReq.Done();
540 break;
541
542 case SID_RULER:
543 SetRuler( !HasRuler() );
544 Invalidate( SID_RULER );
545 rReq.Done();
546 break;
547
548 case SID_ZOOM_PREV:
549 {
550 if (mpZoomList->IsPreviousPossible())
551 {
552 SetZoomRect(mpZoomList->GetPreviousZoomRect());
553 }
554 rReq.Done ();
555 }
556 break;
557
558 case SID_ZOOM_NEXT:
559 {
560 if (mpZoomList->IsNextPossible())
561 {
562 SetZoomRect(mpZoomList->GetNextZoomRect());
563 }
564 rReq.Done ();
565 }
566 break;
567
568 case SID_AUTOSPELL_CHECK:
569 {
570 GetDoc()->SetOnlineSpell(!GetDoc()->GetOnlineSpell());
571 rReq.Done ();
572 }
573 break;
574
575 case SID_TRANSLITERATE_SENTENCE_CASE:
576 case SID_TRANSLITERATE_TITLE_CASE:
577 case SID_TRANSLITERATE_TOGGLE_CASE:
578 case SID_TRANSLITERATE_UPPER:
579 case SID_TRANSLITERATE_LOWER:
580 case SID_TRANSLITERATE_HALFWIDTH:
581 case SID_TRANSLITERATE_FULLWIDTH:
582 case SID_TRANSLITERATE_HIRAGANA:
583 case SID_TRANSLITERATE_KATAKANA:
584 {
585 OutlinerView* pOLV = pOlView ? pOlView->GetViewByWindow( GetActiveWindow() ) : nullptr;
586 if( pOLV )
587 {
588 TransliterationFlags nType = TransliterationFlags::NONE;
589
590 switch( nSlot )
591 {
592 case SID_TRANSLITERATE_SENTENCE_CASE:
593 nType = TransliterationFlags::SENTENCE_CASE;
594 break;
595 case SID_TRANSLITERATE_TITLE_CASE:
596 nType = TransliterationFlags::TITLE_CASE;
597 break;
598 case SID_TRANSLITERATE_TOGGLE_CASE:
599 nType = TransliterationFlags::TOGGLE_CASE;
600 break;
601 case SID_TRANSLITERATE_UPPER:
602 nType = TransliterationFlags::LOWERCASE_UPPERCASE;
603 break;
604 case SID_TRANSLITERATE_LOWER:
605 nType = TransliterationFlags::UPPERCASE_LOWERCASE;
606 break;
607 case SID_TRANSLITERATE_HALFWIDTH:
608 nType = TransliterationFlags::FULLWIDTH_HALFWIDTH;
609 break;
610 case SID_TRANSLITERATE_FULLWIDTH:
611 nType = TransliterationFlags::HALFWIDTH_FULLWIDTH;
612 break;
613 case SID_TRANSLITERATE_HIRAGANA:
614 nType = TransliterationFlags::KATAKANA_HIRAGANA;
615 break;
616 case SID_TRANSLITERATE_KATAKANA:
617 nType = TransliterationFlags::HIRAGANA_KATAKANA;
618 break;
619 }
620
621 pOLV->TransliterateText( nType );
622 }
623
624 rReq.Done();
625 bPreviewState = true;
626 }
627 break;
628
629 // added Undo/Redo handling
630 case SID_UNDO :
631 {
633 ImpSidUndo(rReq);
634 }
635 break;
636 case SID_REDO :
637 {
639 ImpSidRedo(rReq);
640 }
641 break;
642
643 default:
644 break;
645 }
646
647 if( bPreviewState )
648 Invalidate( SID_PREVIEW_STATE );
649
650 Invalidate(SID_CUT);
651 Invalidate(SID_COPY);
652 Invalidate(SID_PASTE);
653}
654
659{
661 {
663 }
664
665 switch ( rReq.GetSlot() )
666 {
667 case SID_EDIT_OUTLINER:
668 {
669 ::Outliner& rOutl = pOlView->GetOutliner();
670 rOutl.GetUndoManager().Clear();
671 rOutl.UpdateFields();
672
674
675 rReq.Done();
676 }
677 break;
678
679 default:
680 break;
681 }
682
683 if(HasOldFunction())
684 {
685 GetOldFunction()->Deactivate();
686 SetOldFunction(nullptr);
687 }
688
690 {
691 GetCurrentFunction()->Activate();
693 }
694}
695
696IMPL_LINK( OutlineViewShell, ClipboardChanged, TransferableDataHelper*, pDataHelper, void )
697{
698 bPastePossible = pDataHelper->GetFormatCount() != 0 &&
699 ( pDataHelper->HasFormat( SotClipboardFormatId::STRING ) ||
700 pDataHelper->HasFormat( SotClipboardFormatId::RTF ) ||
701 pDataHelper->HasFormat( SotClipboardFormatId::RICHTEXT ) ||
702 pDataHelper->HasFormat( SotClipboardFormatId::HTML ) );
703
704 SfxBindings& rBindings = GetViewFrame()->GetBindings();
705 rBindings.Invalidate( SID_PASTE );
706 rBindings.Invalidate( SID_PASTE_SPECIAL );
707 rBindings.Invalidate( SID_PASTE_UNFORMATTED );
708 rBindings.Invalidate( SID_CLIPBOARD_FORMAT_ITEMS );
709}
710
715{
717
718 rSet.Put(SfxBoolItem(SID_SLIDE_SORTER_MODE, false));
719 rSet.Put(SfxBoolItem(SID_DRAWINGMODE, false));
720 rSet.Put(SfxBoolItem(SID_SLIDE_MASTER_MODE, false));
721 rSet.Put(SfxBoolItem(SID_OUTLINE_MODE, true));
722 rSet.Put(SfxBoolItem(SID_NOTES_MODE, false));
723 rSet.Put(SfxBoolItem(SID_NOTES_MASTER_MODE, false));
724 rSet.Put(SfxBoolItem(SID_HANDOUT_MASTER_MODE, false));
725
726 if (!mpZoomList->IsNextPossible())
727 {
728 rSet.DisableItem(SID_ZOOM_NEXT);
729 }
730 if (!mpZoomList->IsPreviousPossible())
731 {
732 rSet.DisableItem(SID_ZOOM_PREV);
733 }
734
735 if( SfxItemState::DEFAULT == rSet.GetItemState( SID_ZOOM_IN ) ||
736 SfxItemState::DEFAULT == rSet.GetItemState( SID_ZOOM_OUT ) )
737 {
738 if( GetActiveWindow()->GetZoom() <= GetActiveWindow()->GetMinZoom() || GetDocSh()->IsUIActive() )
739 rSet.DisableItem( SID_ZOOM_OUT );
740 if( GetActiveWindow()->GetZoom() >= GetActiveWindow()->GetMaxZoom() || GetDocSh()->IsUIActive() )
741 rSet.DisableItem( SID_ZOOM_IN );
742 }
743
744 ::Outliner& rOutl = pOlView->GetOutliner();
745
746 // allow 'Select All'?
747 if( SfxItemState::DEFAULT == rSet.GetItemState( SID_SELECTALL ) )
748 {
749 sal_Int32 nParaCount = rOutl.GetParagraphCount();
750 bool bDisable = nParaCount == 0;
751 if (!bDisable && nParaCount == 1)
752 {
753 OUString aTest = rOutl.GetText(rOutl.GetParagraph(0));
754 if (aTest.isEmpty())
755 {
756 bDisable = true;
757 }
758 }
759 if (bDisable)
760 rSet.DisableItem(SID_SELECTALL);
761 }
762
763 // set status of Ruler
764 rSet.Put( SfxBoolItem( SID_RULER, HasRuler() ) );
765
766 // Enable formatting?
767 rSet.Put( SfxBoolItem( SID_OUTLINE_FORMAT, !rOutl.IsFlatMode() ) );
768
769 if( rOutl.IsFlatMode() )
770 rSet.DisableItem( SID_COLORVIEW );
771 else
772 {
773 // Enable color view?
774 EEControlBits nCntrl = rOutl.GetControlWord();
775 bool bNoColor = false;
776 if (nCntrl & EEControlBits::NOCOLORS)
777 bNoColor = true;
778
779 rSet.Put( SfxBoolItem( SID_COLORVIEW, bNoColor ) );
780 }
781
782 // Buttons of toolbar
783 // first the selection dependent ones: COLLAPSE, EXPAND
784 bool bDisableCollapse = true;
785 bool bDisableExpand = true;
786 bool bUnique = true;
787 OutlinerView* pOutlinerView = pOlView->GetViewByWindow(GetActiveWindow());
788
789 std::vector<Paragraph*> aSelList;
790 pOutlinerView->CreateSelectionList(aSelList);
791
792 if (!aSelList.empty())
793 {
794 sal_Int16 nTmpDepth = rOutl.GetDepth( rOutl.GetAbsPos( aSelList.front() ) );
795 bool bPage = ::Outliner::HasParaFlag( aSelList.front(), ParaFlag::ISPAGE );
796
797 for (const Paragraph* pPara : aSelList)
798 {
799 sal_Int16 nDepth = rOutl.GetDepth( rOutl.GetAbsPos( pPara ) );
800
801 if( nDepth != nTmpDepth || bPage != ::Outliner::HasParaFlag( pPara, ParaFlag::ISPAGE ))
802 bUnique = false;
803
804 if (rOutl.HasChildren(pPara))
805 {
806 if (!rOutl.IsExpanded(pPara))
807 bDisableExpand = false;
808 else
809 bDisableCollapse = false;
810 }
811 }
812 }
813
814 if (bDisableExpand)
815 rSet.DisableItem(SID_OUTLINE_EXPAND);
816 if (bDisableCollapse)
817 rSet.DisableItem(SID_OUTLINE_COLLAPSE);
818
819 // does the selection provide a unique presentation layout?
820 // if not, the templates must not be edited
822 GetStatusBarState(aSet);
823 OUString aTest = aSet.Get(SID_STATUS_LAYOUT).GetValue();
824 if (aTest.isEmpty())
825 {
826 bUnique = false;
827 }
828
829 if (!bUnique)
830 rSet.DisableItem( SID_PRESENTATIONOBJECT );
831
832 // now the selection independent ones: COLLAPSE_ALL, EXPAND_ALL
833 bool bDisableCollapseAll = true;
834 bool bDisableExpandAll = true;
835
836 // does the selection contain something collapsible/expandable?
837 if (!bDisableCollapse)
838 bDisableCollapseAll = false;
839 if (!bDisableExpand)
840 bDisableExpandAll = false;
841
842 // otherwise look through all paragraphs
843 if (bDisableCollapseAll || bDisableExpandAll)
844 {
845 sal_Int32 nParaPos = 0;
846 Paragraph* pPara = rOutl.GetParagraph( nParaPos );
847 while (pPara && (bDisableCollapseAll || bDisableExpandAll))
848 {
849 if (!rOutl.IsExpanded(pPara) && rOutl.HasChildren(pPara))
850 bDisableExpandAll = false;
851
852 if (rOutl.IsExpanded(pPara) && rOutl.HasChildren(pPara))
853 bDisableCollapseAll = false;
854
855 pPara = rOutl.GetParagraph( ++nParaPos );
856 }
857 }
858
859 if (bDisableExpandAll)
860 rSet.DisableItem(SID_OUTLINE_EXPAND_ALL);
861 if (bDisableCollapseAll)
862 rSet.DisableItem(SID_OUTLINE_COLLAPSE_ALL);
863
864 if( SfxItemState::DEFAULT == rSet.GetItemState( SID_PASTE ) )
865 {
866 if ( !mxClipEvtLstnr.is() )
867 {
868 // create listener
869 mxClipEvtLstnr = new TransferableClipboardListener( LINK( this, OutlineViewShell, ClipboardChanged ) );
870 mxClipEvtLstnr->AddListener( GetActiveWindow() );
871
872 // get initial state
874 bPastePossible = ( aDataHelper.GetFormatCount() != 0 &&
875 ( aDataHelper.HasFormat( SotClipboardFormatId::STRING ) ||
876 aDataHelper.HasFormat( SotClipboardFormatId::RTF ) ||
877 aDataHelper.HasFormat( SotClipboardFormatId::RICHTEXT ) ||
878 aDataHelper.HasFormat( SotClipboardFormatId::HTML ) ) );
879 }
880
881 if( !bPastePossible )
882 {
883 rSet.DisableItem( SID_PASTE );
884 }
885 }
886
887 if (!pOlView->GetViewByWindow(GetActiveWindow())->HasSelection()
889 {
890 rSet.DisableItem(SID_CUT);
891 rSet.DisableItem(SID_COPY);
892 }
893
894 if (pOlView->GetOutliner().IsModified())
895 {
896 GetDoc()->SetChanged();
897 }
898
899 // the status has to be set here because of overriding
900 if( !GetDocSh()->IsModified() )
901 {
902 rSet.DisableItem( SID_SAVEDOC );
903 }
904
905 if ( GetDocSh()->IsReadOnly() )
906 {
907 rSet.DisableItem( SID_AUTOSPELL_CHECK );
908 }
909 else
910 {
911 if (GetDoc()->GetOnlineSpell())
912 {
913 rSet.Put(SfxBoolItem(SID_AUTOSPELL_CHECK, true));
914 }
915 else
916 {
917 rSet.Put(SfxBoolItem(SID_AUTOSPELL_CHECK, false));
918 }
919 }
920
921 // field commands
922 if( SfxItemState::DEFAULT == rSet.GetItemState( SID_MODIFY_FIELD ) )
923 {
924 const SvxFieldItem* pFldItem = pOutlinerView->GetFieldAtSelection();
925
926 if( !( pFldItem && (nullptr != dynamic_cast< const SvxDateField *>( pFldItem->GetField() ) ||
927 nullptr != dynamic_cast< const SvxAuthorField *>( pFldItem->GetField() ) ||
928 nullptr != dynamic_cast< const SvxExtFileField *>( pFldItem->GetField() ) ||
929 nullptr != dynamic_cast< const SvxExtTimeField *>( pFldItem->GetField() ) ) ) )
930 {
931 rSet.DisableItem( SID_MODIFY_FIELD );
932 }
933 }
934
935 if (SfxItemState::DEFAULT == rSet.GetItemState(SID_EXPAND_PAGE))
936 {
937 bool bDisable = true;
938 sal_uInt16 i = 0;
940 pOlView->SetSelectedPages();
941
942 while (i < nCount && bDisable)
943 {
945
946 if (pPage->IsSelected())
947 {
949
950 if (pObj!=nullptr )
951 {
952 if( !pObj->IsEmptyPresObj() )
953 {
954 bDisable = false;
955 }
956 else
957 {
958 // check if the object is in edit, then if it's temporarily not empty
959 SdrTextObj* pTextObj = DynCastSdrTextObj( pObj );
960 if( pTextObj )
961 {
962 if( pTextObj->CanCreateEditOutlinerParaObject() )
963 {
964 bDisable = false;
965 }
966 }
967 }
968 }
969 }
970
971 i++;
972 }
973
974 if (bDisable)
975 {
976 rSet.DisableItem(SID_EXPAND_PAGE);
977 }
978 }
979
980 if (SfxItemState::DEFAULT == rSet.GetItemState(SID_SUMMARY_PAGE))
981 {
982 bool bDisable = true;
983 sal_uInt16 i = 0;
985 pOlView->SetSelectedPages();
986
987 while (i < nCount && bDisable)
988 {
990
991 if (pPage->IsSelected())
992 {
994
995 if (pObj && !pObj->IsEmptyPresObj())
996 {
997 bDisable = false;
998 }
999 }
1000
1001 i++;
1002 }
1003
1004 if (bDisable)
1005 {
1006 rSet.DisableItem(SID_SUMMARY_PAGE);
1007 }
1008 }
1009
1010 if( SfxItemState::DEFAULT == rSet.GetItemState( SID_THESAURUS ) )
1011 {
1012 if ( !pOlView->IsTextEdit() )
1013 {
1014 rSet.DisableItem( SID_THESAURUS );
1015 }
1016 else
1017 {
1019 Reference< XThesaurus > xThesaurus( LinguMgr::GetThesaurus() );
1020
1021 if (!xThesaurus.is() || eLang == LANGUAGE_NONE || !xThesaurus->hasLocale( LanguageTag::convertToLocale( eLang)))
1022 rSet.DisableItem( SID_THESAURUS );
1023 }
1024 }
1025
1026 // is starting the presentation possible?
1027 if( SfxItemState::DEFAULT == rSet.GetItemState( SID_PRESENTATION ) )
1028 {
1029 bool bDisable = true;
1031
1032 for( sal_uInt16 i = 0; i < nCount && bDisable; i++ )
1033 {
1035
1036 if( !pPage->IsExcluded() )
1037 bDisable = false;
1038 }
1039 if( bDisable || GetDocSh()->IsPreview())
1040 {
1041 rSet.DisableItem( SID_PRESENTATION );
1042 }
1043 }
1044
1046
1047}
1048
1053{
1054 ::tools::Long nThumb = pHScroll->GetThumbPos();
1055 ::tools::Long nRange = pHScroll->GetRange().Len();
1056 double fX = static_cast<double>(nThumb) / nRange;
1057
1058 Window* pWin = mpContentWindow.get();
1059 OutlinerView* pOutlinerView = pOlView->GetViewByWindow(pWin);
1060 ::tools::Long nViewWidth = pWin->PixelToLogic(
1061 pWin->GetSizePixel()).Width();
1062 ::tools::Long nTextWidth = pOlView->GetPaperWidth();
1063 nViewWidth = std::max(nViewWidth, nTextWidth);
1064 ::tools::Long nCurrentPos = pOutlinerView->GetVisArea().Left();
1065 ::tools::Long nTargetPos = static_cast<::tools::Long>(fX * nViewWidth);
1066 ::tools::Long nDelta = nTargetPos - nCurrentPos;
1067
1068 pOutlinerView->HideCursor();
1069 pOutlinerView->Scroll(-nDelta, 0);
1070 pOutlinerView->ShowCursor(false);
1071}
1072
1074{
1075 ::tools::Long nThumb = pVScroll->GetThumbPos();
1076 ::tools::Long nRange = pVScroll->GetRange().Len();
1077 double fY = static_cast<double>(nThumb) / nRange;
1078
1079 Window* pWin = mpContentWindow.get();
1080 OutlinerView* pOutlinerView = pOlView->GetViewByWindow(pWin);
1081 ::tools::Long nViewHeight = pWin->PixelToLogic(
1082 pWin->GetSizePixel()).Height();
1083 ::tools::Long nTextHeight = pOlView->GetOutliner().GetTextHeight();
1084 nViewHeight += nTextHeight;
1085 ::tools::Long nCurrentPos = pOutlinerView->GetVisArea().Top();
1086 ::tools::Long nTargetPos = static_cast<::tools::Long>(fY * nViewHeight);
1087 ::tools::Long nDelta = nTargetPos - nCurrentPos;
1088
1089 pOutlinerView->HideCursor();
1090 pOutlinerView->Scroll(0, -nDelta);
1091 pOutlinerView->ShowCursor(false);
1092}
1093
1099{
1100 if( !ViewShell::PrepareClose(bUI) )
1101 return false;
1102
1103 if (pOlView)
1104 pOlView->PrepareClose();
1105 return true;
1106}
1107
1112{
1113 ViewShell::SetZoom(nZoom);
1114
1115 ::sd::Window* pWindow = mpContentWindow.get();
1116 if (pWindow)
1117 {
1118 // change OutputArea of OutlinerView
1119 OutlinerView* pOutlinerView = pOlView->GetViewByWindow(pWindow);
1120 ::tools::Rectangle aWin(Point(0,0), pWindow->GetOutputSizePixel());
1121 aWin = pWindow->PixelToLogic(aWin);
1122 pOutlinerView->SetOutputArea(aWin);
1123 }
1124
1125 GetViewFrame()->GetBindings().Invalidate( SID_ATTR_ZOOM );
1126 GetViewFrame()->GetBindings().Invalidate( SID_ATTR_ZOOMSLIDER );
1127}
1128
1132void OutlineViewShell::SetZoomRect(const ::tools::Rectangle& rZoomRect)
1133{
1134 ViewShell::SetZoomRect(rZoomRect);
1135
1136 ::sd::Window* pWindow = mpContentWindow.get();
1137 if (pWindow)
1138 {
1139 // change OutputArea of OutlinerView
1140 OutlinerView* pOutlinerView = pOlView->GetViewByWindow(pWindow);
1141 ::tools::Rectangle aWin(Point(0,0), pWindow->GetOutputSizePixel());
1142 aWin = pWindow->PixelToLogic(aWin);
1143 pOutlinerView->SetOutputArea(aWin);
1144 }
1145
1146 GetViewFrame()->GetBindings().Invalidate( SID_ATTR_ZOOM );
1147 GetViewFrame()->GetBindings().Invalidate( SID_ATTR_ZOOMSLIDER );
1148}
1149
1155{
1156 bool bForwardCall = true;
1157
1158 switch(rReq.GetSlot())
1159 {
1160 case SID_SAVEDOC:
1161 case SID_SAVEASDOC:
1162 PrepareClose();
1163 break;
1164
1165 case SID_SEARCH_ITEM:
1166 // Forward this request to the common (old) code of the
1167 // document shell.
1168 GetDocSh()->Execute (rReq);
1169 bForwardCall = false;
1170 break;
1171
1172 case SID_SPELL_DIALOG:
1173 {
1174 SfxViewFrame* pViewFrame = GetViewFrame();
1175 if (rReq.GetArgs() != nullptr)
1176 pViewFrame->SetChildWindow (SID_SPELL_DIALOG,
1177 static_cast<const SfxBoolItem&>(rReq.GetArgs()->
1178 Get(SID_SPELL_DIALOG)).GetValue());
1179 else
1180 pViewFrame->ToggleChildWindow(SID_SPELL_DIALOG);
1181
1182 pViewFrame->GetBindings().Invalidate(SID_SPELL_DIALOG);
1183 rReq.Done ();
1184
1185 bForwardCall = false;
1186 }
1187 break;
1188
1189 default:
1190 SAL_WARN("sd", "OutlineViewShell::Execute(): can not handle slot " << rReq.GetSlot());
1191 break;
1192
1193 }
1194
1195 if (bForwardCall)
1196 static_cast<DrawDocShell*>(GetViewFrame()->GetObjectShell())->ExecuteSlot( rReq );
1197}
1198
1203{
1204 ::Outliner& rOutl = pOlView->GetOutliner();
1205
1206 rOutl.SetFlatMode( pView->IsNoAttribs() );
1207
1208 EEControlBits nCntrl = rOutl.GetControlWord();
1209
1210 if ( pView->IsNoColors() )
1211 rOutl.SetControlWord(nCntrl | EEControlBits::NOCOLORS);
1212 else
1213 rOutl.SetControlWord(nCntrl & ~EEControlBits::NOCOLORS);
1214
1215 sal_uInt16 nPage = mpFrameView->GetSelectedPage();
1217 pOlView->SetActualPage(pLastPage);
1218}
1219
1224{
1225 ::Outliner& rOutl = pOlView->GetOutliner();
1226
1227 EEControlBits nCntrl = rOutl.GetControlWord();
1228 bool bNoColor = false;
1229 if (nCntrl & EEControlBits::NOCOLORS)
1230 bNoColor = true;
1231 mpFrameView->SetNoColors(bNoColor);
1233 SdPage* pActualPage = pOlView->GetActualPage();
1234 DBG_ASSERT(pActualPage, "No current page");
1235 if( pActualPage )
1236 mpFrameView->SetSelectedPage((pActualPage->GetPageNum() - 1) / 2);
1237}
1238
1243{
1244}
1245
1247{
1248 // Zoom-Item
1249 if( SfxItemState::DEFAULT == rSet.GetItemState( SID_ATTR_ZOOM ) )
1250 {
1251 sal_uInt16 nZoom = static_cast<sal_uInt16>(GetActiveWindow()->GetZoom());
1252
1253 std::unique_ptr<SvxZoomItem> pZoomItem(new SvxZoomItem( SvxZoomType::PERCENT, nZoom ));
1254
1255 // limit area
1256 SvxZoomEnableFlags nZoomValues = SvxZoomEnableFlags::ALL;
1257 nZoomValues &= ~SvxZoomEnableFlags::OPTIMAL;
1258 nZoomValues &= ~SvxZoomEnableFlags::WHOLEPAGE;
1259 nZoomValues &= ~SvxZoomEnableFlags::PAGEWIDTH;
1260
1261 pZoomItem->SetValueSet( nZoomValues );
1262 rSet.Put( std::move(pZoomItem) );
1263 }
1264
1265 if( SfxItemState::DEFAULT == rSet.GetItemState( SID_ATTR_ZOOMSLIDER ) )
1266 {
1267 if (GetDocSh()->IsUIActive() || !GetActiveWindow() )
1268 {
1269 rSet.DisableItem( SID_ATTR_ZOOMSLIDER );
1270 }
1271 else
1272 {
1273 sd::Window * pActiveWindow = GetActiveWindow();
1274 SvxZoomSliderItem aZoomItem( static_cast<sal_uInt16>(pActiveWindow->GetZoom()), static_cast<sal_uInt16>(pActiveWindow->GetMinZoom()), static_cast<sal_uInt16>(pActiveWindow->GetMaxZoom()) ) ;
1275 aZoomItem.AddSnappingPoint(100);
1276 rSet.Put( aZoomItem );
1277 }
1278 }
1279
1280 // page view and layout
1281
1282 sal_uInt16 nPageCount = GetDoc()->GetSdPageCount( PageKind::Standard );
1283 OUString aPageStr, aLayoutStr;
1284
1285 ::sd::Window* pWin = GetActiveWindow();
1286 OutlinerView* pActiveView = pOlView->GetViewByWindow( pWin );
1287
1288 std::vector<Paragraph*> aSelList;
1289 pActiveView->CreateSelectionList(aSelList);
1290
1291 Paragraph *pFirstPara = nullptr;
1292 Paragraph *pLastPara = nullptr;
1293
1294 if (!aSelList.empty())
1295 {
1296 pFirstPara = *(aSelList.begin());
1297 pLastPara = *(aSelList.rbegin());
1298 }
1299
1300 if( !::Outliner::HasParaFlag(pFirstPara,ParaFlag::ISPAGE) )
1301 pFirstPara = pOlView->GetPrevTitle( pFirstPara );
1302
1303 if( !::Outliner::HasParaFlag(pLastPara, ParaFlag::ISPAGE) )
1304 pLastPara = pOlView->GetPrevTitle( pLastPara );
1305
1306 // only one page selected?
1307 if( pFirstPara == pLastPara )
1308 {
1309 // how many pages are we before the selected page?
1310 sal_uLong nPos = 0;
1311 while( pFirstPara )
1312 {
1313 pFirstPara = pOlView->GetPrevTitle( pFirstPara );
1314 if( pFirstPara )
1315 nPos++;
1316 }
1317
1319 nPos = 0;
1320
1321 SdrPage* pPage = GetDoc()->GetSdPage( static_cast<sal_uInt16>(nPos), PageKind::Standard );
1322
1323 if (GetDoc()->GetDocumentType() == DocumentType::Draw)
1324 aPageStr = SdResId(STR_SD_PAGE_COUNT_DRAW);
1325 else
1326 aPageStr = SdResId(STR_SD_PAGE_COUNT);
1327
1328 aPageStr = aPageStr.replaceFirst("%1", OUString::number(static_cast<sal_Int32>(nPos + 1)));
1329 aPageStr = aPageStr.replaceFirst("%2", OUString::number(nPageCount));
1330
1331 aLayoutStr = pPage->GetLayoutName();
1332 sal_Int32 nIndex = aLayoutStr.indexOf(SD_LT_SEPARATOR);
1333 if (nIndex != -1)
1334 aLayoutStr = aLayoutStr.copy(0, nIndex);
1335 //Now, CurrentPage property change is already sent for DrawView and OutlineView, so it is not necessary to send again here
1336 if(m_StrOldPageName!=aPageStr)
1337 {
1339 m_StrOldPageName = aPageStr;
1340 }
1341 }
1342 rSet.Put( SfxStringItem( SID_STATUS_PAGE, aPageStr ) );
1343 rSet.Put( SfxStringItem( SID_STATUS_LAYOUT, aLayoutStr ) );
1344}
1345
1347{
1348 if ( rCEvt.GetCommand() == CommandEventId::ContextMenu )
1349 {
1351
1352 OutlinerView* pOLV = pOlView->GetViewByWindow(GetActiveWindow());
1353 Point aPos(rCEvt.GetMousePosPixel());
1354
1355 if (pOLV && pOLV->IsWrongSpelledWordAtPos(aPos))
1356 {
1357 // Popup for Online-Spelling now handled by DrawDocShell
1358 Link<SpellCallbackInfo&,void> aLink = LINK(GetDocSh(), DrawDocShell, OnlineSpellCallback);
1359
1360 pOLV->ExecuteSpellPopup(aPos, aLink);
1361 pOLV->GetEditView().Invalidate();
1362 }
1363 else
1364 {
1365 GetViewFrame()->GetDispatcher()->ExecutePopup("outline");
1366 }
1367 }
1368 else
1369 {
1370 ViewShell::Command( rCEvt, pWin );
1371
1372 // if necessary communicate the new context to the Preview
1373 Invalidate( SID_PREVIEW_STATE );
1374
1375 }
1376}
1377
1379{
1380 bool bReturn = false;
1382
1383 if (pWin == nullptr && HasCurrentFunction())
1384 {
1385 bReturn = GetCurrentFunction()->KeyInput(rKEvt);
1386 }
1387
1388 // no, forward to base class
1389 else
1390 {
1391 bReturn = ViewShell::KeyInput(rKEvt, pWin);
1392 }
1393
1394 Invalidate(SID_STYLE_EDIT);
1395 Invalidate(SID_STYLE_NEW);
1396 Invalidate(SID_STYLE_DELETE);
1397 Invalidate(SID_STYLE_HIDE);
1398 Invalidate(SID_STYLE_SHOW);
1399 Invalidate(SID_STYLE_UPDATE_BY_EXAMPLE);
1400 Invalidate(SID_STYLE_NEW_BY_EXAMPLE);
1401 Invalidate(SID_STYLE_WATERCAN);
1402 Invalidate(SID_STYLE_FAMILY5);
1403
1404 // check and distinguish cursor movements- or input-keys
1405 vcl::KeyCode aKeyGroup( rKEvt.GetKeyCode().GetGroup() );
1406 if( (aKeyGroup != KEYGROUP_CURSOR && aKeyGroup != KEYGROUP_FKEYS) ||
1407 (GetActualPage() != pLastPage) )
1408 {
1409 Invalidate( SID_PREVIEW_STATE );
1410 }
1411
1412 return bReturn;
1413}
1414
1419{
1420 SfxWhichIter aIter( rSet );
1421 sal_uInt16 nWhich = aIter.FirstWhich();
1422 SfxAllItemSet aAllSet( *rSet.GetPool() );
1423
1424 while ( nWhich )
1425 {
1426 sal_uInt16 nSlotId = SfxItemPool::IsWhich(nWhich)
1427 ? GetPool().GetSlotId(nWhich)
1428 : nWhich;
1429
1430 switch ( nSlotId )
1431 {
1432 case SID_STYLE_FAMILY2:
1433 case SID_STYLE_FAMILY3:
1434 {
1435 rSet.DisableItem( nWhich );
1436 }
1437 break;
1438
1439 case SID_STYLE_FAMILY5:
1440 {
1441 SfxStyleSheet* pStyleSheet = pOlView->GetViewByWindow(GetActiveWindow())->GetStyleSheet();
1442
1443 if( pStyleSheet )
1444 {
1445 pStyleSheet = static_cast<SdStyleSheet*>(pStyleSheet)->GetPseudoStyleSheet();
1446
1447 if (pStyleSheet)
1448 {
1449 SfxTemplateItem aItem( nWhich, pStyleSheet->GetName() );
1450 aAllSet.Put( aItem, aItem.Which() );
1451 }
1452 }
1453
1454 if( !pStyleSheet )
1455 {
1456 SfxTemplateItem aItem( nWhich, OUString() );
1457 aAllSet.Put( aItem, aItem.Which() );
1458 // rSet.DisableItem( nWhich );
1459 }
1460 }
1461 break;
1462
1463 case SID_STYLE_EDIT:
1464 {
1465 std::unique_ptr<SfxUInt16Item> pFamilyItem;
1466 GetViewFrame()->GetBindings().QueryState(SID_STYLE_FAMILY, pFamilyItem);
1467 if (pFamilyItem && static_cast<SfxStyleFamily>(pFamilyItem->GetValue()) == SfxStyleFamily::Pseudo)
1468 {
1470 GetStatusBarState(aSet);
1471 OUString aRealStyle = aSet.Get(SID_STATUS_LAYOUT).GetValue();
1472 if (aRealStyle.isEmpty())
1473 {
1474 // no unique layout name found
1475 rSet.DisableItem(nWhich);
1476 }
1477 }
1478 }
1479 break;
1480
1481 case SID_STYLE_UPDATE_BY_EXAMPLE:
1482 {
1483 ::sd::Window* pActWin = GetActiveWindow();
1484 OutlinerView* pOV = pOlView->GetViewByWindow(pActWin);
1485 ESelection aESel(pOV->GetSelection());
1486
1487 if (aESel.nStartPara != aESel.nEndPara ||
1488 aESel.nStartPos != aESel.nEndPos)
1489 // spanned selection, i.e. StyleSheet and/or
1490 // attribution not necessarily unique
1491 rSet.DisableItem(nWhich);
1492 }
1493 break;
1494
1495 case SID_STYLE_NEW:
1496 case SID_STYLE_DELETE:
1497 case SID_STYLE_HIDE:
1498 case SID_STYLE_SHOW:
1499 case SID_STYLE_NEW_BY_EXAMPLE:
1500 case SID_STYLE_WATERCAN:
1501 {
1502 rSet.DisableItem(nWhich);
1503 }
1504 break;
1505 }
1506
1507 nWhich = aIter.NextWhich();
1508 }
1509
1510 rSet.Put( aAllSet, false );
1511}
1512
1514{
1515 // first the base classes
1516 ViewShell::MouseButtonUp(rMEvt, pWin);
1517
1518 Invalidate(SID_STYLE_EDIT);
1519 Invalidate(SID_STYLE_NEW);
1520 Invalidate(SID_STYLE_DELETE);
1521 Invalidate(SID_STYLE_HIDE);
1522 Invalidate(SID_STYLE_SHOW);
1523 Invalidate(SID_STYLE_UPDATE_BY_EXAMPLE);
1524 Invalidate(SID_STYLE_NEW_BY_EXAMPLE);
1525 Invalidate(SID_STYLE_WATERCAN);
1526 Invalidate(SID_STYLE_FAMILY5);
1527
1528 // if necessary communicate the new context to the Preview
1529 if( GetActualPage() != pLastPage )
1530 Invalidate( SID_PREVIEW_STATE );
1531}
1532
1534{
1535 // since there are no master pages in outline view, we can
1536 // for now use the GetActualPage method
1537 return const_cast<OutlineViewShell*>(this)->GetActualPage();
1538}
1539
1545{
1546 return pOlView->GetActualPage();
1547}
1548
1550{
1551 const bool bNewPage = pPage != pLastPage;
1552 pLastPage = pPage;
1553 if (bNewPage)
1554 {
1556 SetCurrentPage(pPage);
1557 }
1558}
1559
1561{
1562 DBG_ASSERT( pPage, "sd::OutlineViewShell::UpdateTitleObject(), pPage == 0?" );
1563 DBG_ASSERT( pPara, "sd::OutlineViewShell::UpdateTitleObject(), pPara == 0?" );
1564
1565 if( !pPage || !pPara )
1566 return;
1567
1568 ::Outliner& rOutliner = pOlView->GetOutliner();
1570
1571 OUString aTest = rOutliner.GetText(pPara);
1572 bool bText = !aTest.isEmpty();
1573
1574 if( bText )
1575 {
1576 bool bNewObject = false;
1577 // create a title object if we don't have one but have text
1578 if( !pTO )
1579 {
1580 DBG_ASSERT( pOlView->isRecordingUndo(), "sd::OutlineViewShell::UpdateTitleObject(), no undo for model change!?" );
1582 bNewObject = true;
1583 }
1584
1585 // if we have a title object and a text, set the text
1587 if (pTO)
1588 pOPO = rOutliner.CreateParaObject(rOutliner.GetAbsPos(pPara), 1);
1589 if (pOPO)
1590 {
1591 pOPO->SetOutlinerMode( OutlinerMode::TitleObject );
1592 assert(pTO);
1593 pOPO->SetVertical( pTO->IsVerticalWriting() );
1594 if( pTO->GetOutlinerParaObject() && (pOPO->GetTextObject() == pTO->GetOutlinerParaObject()->GetTextObject()) )
1595 {
1596 // do nothing, same text already set
1597 }
1598 else
1599 {
1600 DBG_ASSERT( pOlView->isRecordingUndo(), "sd::OutlineViewShell::UpdateTitleObject(), no undo for model change!?" );
1601 if( !bNewObject && pOlView->isRecordingUndo() )
1602 pOlView->AddUndo(GetDoc()->GetSdrUndoFactory().CreateUndoObjectSetText(*pTO,0));
1603
1604 pTO->SetOutlinerParaObject( std::move(pOPO) );
1605 pTO->SetEmptyPresObj( false );
1606 pTO->ActionChanged();
1607 }
1608 }
1609 }
1610 else if( pTO )
1611 {
1612 // no text but object available?
1613 // outline object available, but we have no text
1614 if(pPage->IsPresObj(pTO))
1615 {
1616 // if it is not already empty
1617 if( !pTO->IsEmptyPresObj() )
1618 {
1619 DBG_ASSERT( pOlView->isRecordingUndo(), "sd::OutlineViewShell::UpdateTitleObject(), no undo for model change!?" );
1620
1621 // make it empty
1622 if( pOlView->isRecordingUndo() )
1623 pOlView->AddUndo(GetDoc()->GetSdrUndoFactory().CreateUndoObjectSetText(*pTO,0));
1624 pPage->RestoreDefaultText( pTO );
1625 pTO->SetEmptyPresObj(true);
1626 pTO->ActionChanged();
1627 }
1628 }
1629 else
1630 {
1631 DBG_ASSERT( pOlView->isRecordingUndo(), "sd::OutlineViewShell::UpdateTitleObject(), no undo for model change!?" );
1632 // outline object is not part of the layout, delete it
1633 if( pOlView->isRecordingUndo() )
1634 pOlView->AddUndo(GetDoc()->GetSdrUndoFactory().CreateUndoRemoveObject(*pTO));
1635 pPage->RemoveObject(pTO->GetOrdNum());
1636 }
1637 }
1638}
1639
1641{
1642 DBG_ASSERT( pPage, "sd::OutlineViewShell::UpdateOutlineObject(), pPage == 0?" );
1643 DBG_ASSERT( pPara, "sd::OutlineViewShell::UpdateOutlineObject(), pPara == 0?" );
1644
1645 if( !pPage || !pPara )
1646 return;
1647
1648 ::Outliner& rOutliner = pOlView->GetOutliner();
1650 SdrTextObj* pTO = nullptr;
1651
1652 OutlinerMode eOutlinerMode = OutlinerMode::TitleObject;
1653 pTO = static_cast<SdrTextObj*>(pPage->GetPresObj( PresObjKind::Text ));
1654 if( !pTO )
1655 {
1656 eOutlinerMode = OutlinerMode::OutlineObject;
1657 pTO = OutlineView::GetOutlineTextObject( pPage );
1658 }
1659
1660 // how many paragraphs in the outline?
1661 sal_Int32 nTitlePara = rOutliner.GetAbsPos( pPara );
1662 sal_Int32 nPara = nTitlePara + 1;
1663 sal_Int32 nParasInLayout = 0;
1664 pPara = rOutliner.GetParagraph( nPara );
1665 while( pPara && !::Outliner::HasParaFlag(pPara, ParaFlag::ISPAGE) )
1666 {
1667 nParasInLayout++;
1668 pPara = rOutliner.GetParagraph( ++nPara );
1669 }
1670 if( nParasInLayout )
1671 {
1672 // create an OutlinerParaObject
1673 pOPO = rOutliner.CreateParaObject( nTitlePara + 1, nParasInLayout );
1674 }
1675
1676 if( pOPO )
1677 {
1678 DBG_ASSERT( pOlView->isRecordingUndo(), "sd::OutlineViewShell::UpdateOutlineObject(), no undo for model change!?" );
1679 bool bNewObject = false;
1680
1681 // do we need an outline text object?
1682 if( !pTO )
1683 {
1685 bNewObject = true;
1686 }
1687
1688 // page object, outline text in Outliner:
1689 // apply text
1690 if( pTO )
1691 {
1692 pOPO->SetVertical( pTO->IsVerticalWriting() );
1693 pOPO->SetOutlinerMode( eOutlinerMode );
1694 if( pTO->GetOutlinerParaObject() && (pOPO->GetTextObject() == pTO->GetOutlinerParaObject()->GetTextObject()) )
1695 {
1696 // do nothing, same text already set
1697 }
1698 else
1699 {
1700 if( !bNewObject && pOlView->isRecordingUndo() )
1701 pOlView->AddUndo(GetDoc()->GetSdrUndoFactory().CreateUndoObjectSetText(*pTO,0));
1702
1703 pTO->SetOutlinerParaObject( std::move(pOPO) );
1704 pTO->SetEmptyPresObj( false );
1705 pTO->ActionChanged();
1706 }
1707 }
1708 }
1709 else if( pTO )
1710 {
1711 // page object but no outline text:
1712 // if the object is in the outline of the page -> default text
1713
1714 // otherwise delete object
1715 if( pPage->IsPresObj(pTO) )
1716 {
1717 if( !pTO->IsEmptyPresObj() )
1718 {
1719 DBG_ASSERT( pOlView->isRecordingUndo(), "sd::OutlineViewShell::UpdateOutlineObject(), no undo for model change!?" );
1720
1721 // delete old OutlinerParaObject, too
1722 if( pOlView->isRecordingUndo() )
1723 pOlView->AddUndo(GetDoc()->GetSdrUndoFactory().CreateUndoObjectSetText(*pTO,0));
1724 pPage->RestoreDefaultText( pTO );
1725 pTO->SetEmptyPresObj(true);
1726 pTO->ActionChanged();
1727 }
1728 }
1729 else
1730 {
1731 DBG_ASSERT( pOlView->isRecordingUndo(), "sd::OutlineViewShell::UpdateOutlineObject(), no undo for model change!?" );
1732 if( pOlView->isRecordingUndo() )
1733 pOlView->AddUndo(GetDoc()->GetSdrUndoFactory().CreateUndoRemoveObject(*pTO));
1734 pPage->RemoveObject(pTO->GetOrdNum());
1735 }
1736 }
1737}
1738
1743{
1744 ErrCode bRet = ERRCODE_NONE;
1745
1746 ::Outliner& rOutl = pOlView->GetOutliner();
1747
1748 OutlineViewPageChangesGuard aGuard( pOlView.get() );
1750
1751 bRet = rOutl.Read( rInput, OUString(), EETextFormat::Rtf, GetDocSh()->GetHeaderAttributes() );
1752
1753 SdPage* pPage = GetDoc()->GetSdPage( GetDoc()->GetSdPageCount(PageKind::Standard) - 1, PageKind::Standard );
1756
1757 sal_Int32 nParaCount = rOutl.GetParagraphCount();
1758 if ( nParaCount > 0 )
1759 {
1760 for ( sal_Int32 nPara = 0; nPara < nParaCount; nPara++ )
1761 {
1762 pOlView->UpdateParagraph( nPara );
1763
1764 sal_Int16 nDepth = rOutl.GetDepth( nPara );
1765
1766 if( (nDepth == 0) || !nPara )
1767 {
1768 Paragraph* pPara = rOutl.GetParagraph( nPara );
1769 rOutl.SetDepth(pPara, -1);
1770 rOutl.SetParaFlag(pPara, ParaFlag::ISPAGE);
1771
1772 rOutl.SetStyleSheet( nPara, pTitleSheet );
1773
1774 if( nPara ) // first slide already exists
1775 pOlView->InsertSlideForParagraph( pPara );
1776 }
1777 else
1778 {
1779 rOutl.SetDepth( rOutl.GetParagraph( nPara ), nDepth - 1 );
1780 OUString aStyleSheetName = pOutlSheet->GetName();
1781 if (!aStyleSheetName.isEmpty())
1782 aStyleSheetName = aStyleSheetName.copy(0, aStyleSheetName.getLength() - 1);
1783 aStyleSheetName += OUString::number( nDepth );
1785 SfxStyleSheet* pStyle = static_cast<SfxStyleSheet*>( pStylePool->Find( aStyleSheetName, pOutlSheet->GetFamily() ) );
1786 DBG_ASSERT( pStyle, "AutoStyleSheetName - Style not found!" );
1787 if ( pStyle )
1788 rOutl.SetStyleSheet( nPara, pStyle );
1789 }
1790 }
1791 }
1792
1793 rOutl.GetUndoManager().Clear();
1794
1795 return bRet;
1796}
1797
1798void OutlineViewShell::WriteUserDataSequence ( css::uno::Sequence < css::beans::PropertyValue >& rSequence )
1799{
1801
1803}
1804
1805void OutlineViewShell::ReadUserDataSequence ( const css::uno::Sequence < css::beans::PropertyValue >& rSequence )
1806{
1808
1810
1812}
1813
1814void OutlineViewShell::VisAreaChanged(const ::tools::Rectangle& rRect)
1815{
1817
1819}
1820
1825css::uno::Reference<css::accessibility::XAccessible>
1827{
1828 OSL_ASSERT (GetViewShell()!=nullptr);
1829 if (GetViewShell()->GetController() != nullptr)
1830 {
1832 new ::accessibility::AccessibleOutlineView (
1833 pWindow,
1834 this,
1837 pDocumentView->Init();
1838 return pDocumentView;
1839 }
1840
1841 SAL_WARN("sd", "OutlineViewShell::CreateAccessibleDocumentView: no controller");
1842 return css::uno::Reference< css::accessibility::XAccessible >();
1843}
1844
1846{
1847 // Iterate over all requested items in the set.
1848 SfxWhichIter aIter( rSet );
1849 sal_uInt16 nWhich = aIter.FirstWhich();
1850 while (nWhich)
1851 {
1852 switch (nWhich)
1853 {
1854 case SID_SEARCH_ITEM:
1855 case SID_SEARCH_OPTIONS:
1856 // Call common (old) implementation in the document shell.
1857 GetDocSh()->GetState (rSet);
1858 break;
1859 default:
1860 SAL_WARN("sd", "OutlineViewShell::GetState(): can not handle which id " << nWhich);
1861 break;
1862 }
1863 nWhich = aIter.NextWhich();
1864 }
1865}
1866
1868{
1869 // Adapt the selection of the model.
1870 for (sal_uInt16 i=0; i<GetDoc()->GetSdPageCount(PageKind::Standard); i++)
1873 false);
1874 GetDoc()->SetSelected (pPage, true);
1875
1876 DrawController& rController(*GetViewShellBase().GetDrawController());
1877 rController.FireSelectionChangeListener();
1878 rController.FireSwitchCurrentPage (pPage);
1879
1880 pOlView->SetActualPage(pPage);
1881}
1882
1883} // end of namespace sd
1884
1885/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
bool mbInitialized
const StyleSettings & GetStyleSettings() const
CommandEventId GetCommand() const
const Point & GetMousePosPixel() const
void Invalidate()
const vcl::KeyCode & GetKeyCode() const
static css::lang::Locale convertToLocale(LanguageType nLangID, bool bResolveSystem=true)
static css::uno::Reference< css::linguistic2::XThesaurus > GetThesaurus()
void SetOutlinerMode(OutlinerMode nNew)
const EditTextObject & GetTextObject() const
void SetVertical(bool bNew)
bool IsWrongSpelledWordAtPos(const Point &rPosPixel)
void Scroll(tools::Long nHorzScroll, tools::Long nVertScroll)
const SvxFieldItem * GetFieldAtSelection() const
void SetOutputArea(const tools::Rectangle &rRect)
void TransliterateText(TransliterationFlags nTransliterationMode)
void CreateSelectionList(std::vector< Paragraph * > &aSelList)
tools::Rectangle GetVisArea() const
void HideCursor(bool bDeactivate=false)
ESelection GetSelection() const
bool PostKeyEvent(const KeyEvent &rKEvt, vcl::Window const *pFrameWin=nullptr)
void ExecuteSpellPopup(const Point &rPosPixel, const Link< SpellCallbackInfo &, void > &rCallBack)
Outliner * GetOutliner() const
EditView & GetEditView() const
void ShowCursor(bool bGotoCursor=true, bool bActivate=false)
static bool HasParaFlag(const Paragraph *pPara, ParaFlag nFlag)
OUString GetText(Paragraph const *pPara, sal_Int32 nParaCount=1) const
void SetFlatMode(bool bFlat)
Paragraph * GetParagraph(sal_Int32 nAbsPos) const
std::optional< OutlinerParaObject > CreateParaObject(sal_Int32 nStartPara=0, sal_Int32 nParaCount=EE_PARA_ALL) const
sal_Int16 GetDepth(sal_Int32 nPara) const
void SetStyleSheet(sal_Int32 nPara, SfxStyleSheet *pStyle)
bool SetUpdateLayout(bool bUpdate)
void SetDepth(Paragraph *pParagraph, sal_Int16 nNewDepth)
EEControlBits GetControlWord() const
sal_Int32 GetAbsPos(Paragraph const *pPara) const
bool IsExpanded(Paragraph const *pPara) const
SfxUndoManager & GetUndoManager()
void SetControlWord(EEControlBits nWord)
bool UpdateFields()
void SetParaFlag(Paragraph *pPara, ParaFlag nFlag)
bool IsFlatMode() const
void ClearModifyFlag()
bool HasChildren(Paragraph const *pParagraph) const
ErrCode Read(SvStream &rInput, const OUString &rBaseURL, EETextFormat, SvKeyValueIterator *pHTTPHeaderAttrs=nullptr)
sal_Int32 GetParagraphCount() const
tools::Long Len() const
virtual tools::Long GetThumbPos() const override
virtual Range GetRange() const override
SAL_DLLPRIVATE void SetOnlineSpell(bool bIn)
Definition: drawdoc.cxx:962
SdPage * GetSdPage(sal_uInt16 nPgNum, PageKind ePgKind) const
Definition: drawdoc2.cxx:207
SAL_DLLPRIVATE LanguageType GetLanguage(const sal_uInt16 nId) const
Definition: drawdoc2.cxx:875
SAL_DLLPRIVATE void SetSelected(SdPage *pPage, bool bSelect)
Definition: drawdoc2.cxx:461
virtual SAL_DLLPRIVATE void SetChanged(bool bFlag=true) override
Definition: drawdoc.cxx:658
sal_uInt16 GetSdPageCount(PageKind ePgKind) const
Definition: drawdoc2.cxx:212
SdrObject * GetPresObj(PresObjKind eObjKind, int nIndex=1, bool bFuzzySearch=false)
returns the nIndex'th object from the given PresObjKind, index starts with 1
Definition: sdpage.cxx:203
virtual rtl::Reference< SdrObject > RemoveObject(size_t nObjNum) override
Definition: sdpage.cxx:1706
bool IsPresObj(const SdrObject *pObj)
Definition: sdpage.cxx:2322
SfxStyleSheet * GetStyleSheetForPresObj(PresObjKind eObjKind) const
Definition: sdpage.cxx:625
bool IsSelected() const
Definition: sdpage.hxx:208
bool IsExcluded() const
Definition: sdpage.hxx:223
bool RestoreDefaultText(SdrObject *pObj)
Definition: sdpage.cxx:2866
bool IsChanged() const
SfxStyleSheetBasePool * GetStyleSheetPool() const
void ActionChanged() const
void SetOutlinerParaObject(std::optional< OutlinerParaObject > pTextObject)
void SetEmptyPresObj(bool bEpt)
sal_uInt32 GetOrdNum() const
bool IsEmptyPresObj() const
sal_uInt16 GetPageNum() const
virtual OUString GetLayoutName() const
bool CanCreateEditOutlinerParaObject() const
virtual OutlinerParaObject * GetOutlinerParaObject() const override
virtual bool IsVerticalWriting() const
void SetVisibleState(sal_uInt16 nId, bool bShow)
SfxItemState QueryState(sal_uInt16 nSID, std::unique_ptr< SfxPoolItem > &rpState)
void Invalidate(sal_uInt16 nId)
void ExecutePopup(const OUString &rResName, vcl::Window *pWin=nullptr, const Point *pPos=nullptr)
sal_uInt16 GetSlotId(sal_uInt16 nWhich) const
static bool IsWhich(sal_uInt16 nId)
SfxItemPool * GetPool() const
SfxItemState GetItemState(sal_uInt16 nWhich, bool bSrchInParent=true, const SfxPoolItem **ppItem=nullptr) const
const SfxPoolItem * Put(const SfxPoolItem &rItem, sal_uInt16 nWhich)
const SfxPoolItem & Get(sal_uInt16 nWhich, bool bSrchInParent=true) const
void DisableItem(sal_uInt16 nWhich)
bool isContentExtractionLocked() const
sal_uInt16 GetSlot() const
void Ignore()
const SfxItemSet * GetArgs() const
void Done(bool bRemove=false)
SfxItemPool & GetPool() const
void BroadcastContextForActivation(const bool bIsActivated)
void SetContextName(const OUString &rsContextName)
virtual void Invalidate(sal_uInt16 nId=0)
virtual SfxObjectShell * GetObjectShell()
const SfxPoolItem * ExecuteSlot(SfxRequest &rReq, const SfxInterface *pIF=nullptr)
SfxViewShell * GetViewShell() const
void SetPool(SfxItemPool *pNewPool)
void SetName(const OUString &rName)
virtual SfxStyleSheetBase * Find(const OUString &, SfxStyleFamily eFam, SfxStyleSearchBits n=SfxStyleSearchBits::All)
const OUString & GetName() const
SfxStyleFamily GetFamily() const
virtual void Clear()
void ToggleChildWindow(sal_uInt16)
SfxBindings & GetBindings()
void SetChildWindow(sal_uInt16 nId, bool bVisible, bool bSetFocus=true)
SfxDispatcher * GetDispatcher()
virtual SfxObjectShell * GetObjectShell() override
sal_uInt16 FirstWhich()
sal_uInt16 NextWhich()
sal_Int32 GetScrollBarSize() const
const SvxFieldData * GetField() const
void SetName(const OUString &rName)
void SetURL(const OUString &rURL)
void SetTargetFrame(const OUString &rTarget)
void AddSnappingPoint(sal_Int32 nNew)
sal_uInt32 GetFormatCount() const
static TransferableDataHelper CreateFromSystemClipboard(vcl::Window *pWindow)
bool HasFormat(SotClipboardFormatId nFormat) const
const css::uno::Reference< css::datatransfer::XTransferable > & GetTransferable() const
reference_type * get() const
The DrawController is the UNO controller for Impress and Draw.
void FireSelectionChangeListener() noexcept
Call this method when the selection has changed.
void FireVisAreaChanged(const ::tools::Rectangle &rVisArea) noexcept
Call this method when the VisArea has changed.
void fireSwitchCurrentPage(sal_Int32 pageIndex) noexcept
void FireSwitchCurrentPage(SdPage *pCurrentPage) noexcept
Call this method when there is a new current page.
void Execute(SfxRequest &rReq)
Handles SFX-Requests.
Definition: docshel3.cxx:134
void SetStyleFamily(SfxStyleFamily nSF)
void GetState(SfxItemSet &)
Definition: docshell.cxx:205
View for MDIFrame.
Definition: FrameView.hxx:36
bool IsNoColors() const
Definition: FrameView.hxx:75
sal_uInt16 GetSelectedPage() const
Definition: FrameView.hxx:96
void Connect()
Definition: frmview.cxx:256
void SetNoAttribs(const bool bNoAttr)
Definition: FrameView.hxx:77
bool IsNoAttribs() const
Definition: FrameView.hxx:79
void Disconnect()
Definition: frmview.cxx:261
void SetNoColors(const bool bNoCol)
Definition: FrameView.hxx:73
void SetSelectedPage(sal_uInt16 nPage)
Definition: frmview.cxx:907
static void GetSlotState(SfxItemSet &rSet, ViewShell const *pViewShell, SfxViewFrame *pViewFrame)
Definition: fubullet.cxx:276
text functions in outline mode
Definition: fuoltext.hxx:39
void UpdateForKeyPress(const KeyEvent &rEvent)
Call this method when the text in the outliner (may) has changed.
Definition: fuoltext.cxx:235
static rtl::Reference< FuPoor > Create(ViewShell *pViewSh, ::sd::Window *pWin, ::sd::View *pView, SdDrawDocument *pDoc, SfxRequest &rReq)
Definition: fuoltext.cxx:115
Show a textual overview of the text contents of all slides.
virtual bool KeyInput(const KeyEvent &rKEvt, ::sd::Window *pWin) override
Definition: outlnvsh.cxx:1378
ErrCode ReadRtf(SvStream &rInput)
Fill Outliner from Stream.
Definition: outlnvsh.cxx:1742
virtual void UpdatePreview(SdPage *pPage) override
Update the preview to show the specified page.
Definition: outlnvsh.cxx:1549
virtual ~OutlineViewShell() override
Definition: outlnvsh.cxx:206
void Execute(SfxRequest &rReq)
Before saving: Update Model of the Drawing Engine, then forward the invocation to the ObjectShell.
Definition: outlnvsh.cxx:1154
std::unique_ptr< OutlineView > pOlView
void UpdateTitleObject(SdPage *pPage, Paragraph const *pPara)
Definition: outlnvsh.cxx:1560
void GetStatusBarState(SfxItemSet &rSet)
Definition: outlnvsh.cxx:1246
virtual void ReadUserDataSequence(const css::uno::Sequence< css::beans::PropertyValue > &) override
Definition: outlnvsh.cxx:1805
void GetAttrState(SfxItemSet &rSet)
Status of Attribute-Items.
Definition: outlnvsh.cxx:1418
void FuSupport(SfxRequest &rReq)
SfxRequests for support functions.
Definition: outlnvsh.cxx:406
void FuPermanent(SfxRequest &rReq)
SfxRequests for permanent functions.
Definition: outlnvsh.cxx:658
virtual void WriteUserDataSequence(css::uno::Sequence< css::beans::PropertyValue > &) override
Definition: outlnvsh.cxx:1798
virtual css::uno::Reference< css::drawing::XDrawSubController > CreateSubController() override
Return a sub controller that implements the view shell specific part of the DrawController.
Definition: outlnvsh.cxx:163
virtual void VirtVScrollHdl(ScrollAdaptor *pVHScroll) override
handling for vertical Scrollbars
Definition: outlnvsh.cxx:1073
void GetState(SfxItemSet &rSet)
Definition: outlnvsh.cxx:1845
virtual void Deactivate(bool IsMDIActivate) override
Definition: outlnvsh.cxx:333
void Construct()
common initialization part of both constructors
Definition: outlnvsh.cxx:126
rtl::Reference< TransferableClipboardListener > mxClipEvtLstnr
virtual SdPage * GetActualPage() override
Returns the first selected page.
Definition: outlnvsh.cxx:1544
void ExecCtrl(SfxRequest &rReq)
Handle SfxRequest for the Controller.
Definition: outlnvsh.cxx:283
virtual void SetZoom(::tools::Long nZoom) override
Zoom with zoom factor.
Definition: outlnvsh.cxx:1111
virtual void Shutdown() override
This method is more or less an alias to Deactivate().
Definition: outlnvsh.cxx:221
void UpdateOutlineObject(SdPage *pPage, Paragraph *pPara)
Definition: outlnvsh.cxx:1640
virtual void ArrangeGUIElements() override
Arrange and resize the GUI elements like rulers, sliders, and buttons as well as the actual document ...
Definition: outlnvsh.cxx:240
void GetMenuState(SfxItemSet &rSet)
Set Status (Enabled/Disabled) of Menu-SfxSlots.
Definition: outlnvsh.cxx:714
virtual css::uno::Reference< css::accessibility::XAccessible > CreateAccessibleDocumentView(::sd::Window *pWindow) override
Create an accessible object representing the specified window.
Definition: outlnvsh.cxx:1826
virtual void VisAreaChanged(const ::tools::Rectangle &rRect) override
this method is called when the visible area of the view from this viewshell is changed
Definition: outlnvsh.cxx:1814
virtual void VirtHScrollHdl(ScrollAdaptor *pHScroll) override
gets invoked when ScrollBar is used
Definition: outlnvsh.cxx:1052
virtual SdPage * getCurrentPage() const override
inherited from sd::ViewShell
Definition: outlnvsh.cxx:1533
virtual void Command(const CommandEvent &rCEvt, ::sd::Window *pWin) override
Definition: outlnvsh.cxx:1346
virtual bool PrepareClose(bool bUI=true) override
PrepareClose, gets called when the Shell shall be destroyed.
Definition: outlnvsh.cxx:1098
virtual void Activate(bool IsMDIActivate) override
Activate(): during the first invocation the fields get updated.
Definition: outlnvsh.cxx:310
void SetCurrentPage(SdPage *pPage)
Make the given page the new current page.
Definition: outlnvsh.cxx:1867
virtual void Paint(const ::tools::Rectangle &rRect, ::sd::Window *pWin) override
Paint method: the event gets forwarded from pWindow to the Viewshell and the current function.
Definition: outlnvsh.cxx:232
virtual void SetZoomRect(const ::tools::Rectangle &rZoomRect) override
Zoom with zoom rectangle.
Definition: outlnvsh.cxx:1132
OutlineViewShell(SfxViewFrame *pFrame, ViewShellBase &rViewShellBase, vcl::Window *pParentWindow, FrameView *pFrameView)
Create a new view shell for the outline mode.
Definition: outlnvsh.cxx:179
virtual void ReadFrameViewData(FrameView *pView) override
Read FrameViews data and set actual views data.
Definition: outlnvsh.cxx:1202
static void ExecStatusBar(SfxRequest &rReq)
Handle SfxRequests for the StatusBar.
Definition: outlnvsh.cxx:1242
virtual void MouseButtonUp(const MouseEvent &rMEvt, ::sd::Window *pWin) override
Definition: outlnvsh.cxx:1513
virtual void WriteFrameViewData() override
Write actual views data to FrameView.
Definition: outlnvsh.cxx:1223
void GetCtrlState(SfxItemSet &rSet)
Set status of Controller-SfxSlots.
Definition: outlnvsh.cxx:345
Derivative of sd::View for the outline mode |* .
Definition: OutlineView.hxx:55
static SdrTextObj * CreateTitleTextObject(SdPage *pPage)
Definition: outlview.cxx:897
static SdrTextObj * CreateOutlineTextObject(SdPage *pPage)
Definition: outlview.cxx:916
static SdrTextObj * GetOutlineTextObject(SdrPage const *pPage)
Look for the outline text object in one page of the model.
Definition: outlview.cxx:879
static SdrTextObj * GetTitleTextObject(SdrPage const *pPage)
Look for the title text object in one page of the model.
Definition: outlview.cxx:858
This class implements the OutlineViewShell specific part of the controller.
SfxViewShell descendant that the stacked Draw/Impress shells are based on.
DrawController * GetDrawController() const
Base class of the stacked shell hierarchy.
Definition: ViewShell.hxx:92
SD_DLLPUBLIC DrawDocShell * GetDocSh() const
Definition: viewshel.cxx:1407
virtual bool KeyInput(const KeyEvent &rKEvt, ::sd::Window *pWin)
Definition: viewshel.cxx:391
bool IsMainViewShell() const
Return <TRUE> when the called view shell is the main sub shell of its ViewShellBase object,...
Definition: viewshel.cxx:1493
const rtl::Reference< FuPoor > & GetCurrentFunction() const
Definition: ViewShell.hxx:250
void ImpSidUndo(SfxRequest &rReq)
Definition: viewshel.cxx:1202
FrameView * mpFrameView
Definition: ViewShell.hxx:453
SdDrawDocument * GetDoc() const
Definition: viewshel.cxx:1412
virtual void SetZoom(::tools::Long nZoom)
Set zoom factor for all split windows.
Definition: viewshe2.cxx:309
virtual void Shutdown()
This method is more or less an alias to Deactivate().
Definition: viewshel.cxx:386
virtual void UpdateScrollBars()
Set internal values of all scroll bars that determine thumb size and position.
Definition: viewshe2.cxx:71
void GetMenuState(SfxItemSet &rSet)
set state (enabled/disabled) of Menu SfxSlots
Definition: viewshe3.cxx:61
virtual void Command(const CommandEvent &rCEvt, ::sd::Window *pWin)
Definition: viewshel.cxx:621
std::unique_ptr< ZoomList > mpZoomList
Definition: ViewShell.hxx:457
virtual void MouseButtonUp(const MouseEvent &rMEvt, ::sd::Window *pWin)
Definition: viewshel.cxx:584
void DisposeFunctions()
must be called in the beginning of each subclass d'tor.
Definition: viewshel.cxx:1475
ShellType meShellType
The type of the shell. Returned by GetShellType().
Definition: ViewShell.hxx:483
void SetRuler(bool bRuler)
Switch ruler on/off.
Definition: viewshe2.cxx:814
virtual void ArrangeGUIElements()
Set position and size of the GUI elements that are controlled by the view shell like rulers and scrol...
Definition: viewshel.cxx:965
virtual void ReadUserDataSequence(const css::uno::Sequence< css::beans::PropertyValue > &)
Definition: viewshe2.cxx:897
virtual void VisAreaChanged(const ::tools::Rectangle &rRect)
this method is called when the visible area of the view from this viewshell is changed
Definition: viewshe2.cxx:902
::sd::Window * GetActiveWindow() const
The active window is usually the mpContentWindow.
Definition: ViewShell.hxx:155
virtual bool PrepareClose(bool bUI=true)
Tell the FmFormShell that the view shell is closing.
Definition: viewshel.cxx:1076
void DeactivateCurrentFunction(bool bPermanent=false)
Definition: viewshel.cxx:1459
const rtl::Reference< FuPoor > & GetOldFunction() const
Definition: ViewShell.hxx:248
vcl::Window * GetParentWindow() const
Return the window that is the parent of all controls of this view shell.
Definition: ViewShell.hxx:140
virtual void WriteUserDataSequence(css::uno::Sequence< css::beans::PropertyValue > &)
Definition: viewshe2.cxx:878
virtual void SetZoomRect(const ::tools::Rectangle &rZoomRect)
Set zoom rectangle for active window.
Definition: viewshe2.cxx:358
::tools::Long GetZoom() const
Definition: viewshe2.cxx:344
void SetOldFunction(const rtl::Reference< FuPoor > &xFunction)
Definition: viewshel.cxx:1430
void InitWindows(const Point &rViewOrigin, const Size &rViewSize, const Point &rWinPos, bool bUpdate=false)
Initialize imaging parameters for all split windows.
Definition: viewshe2.cxx:403
bool HasOldFunction() const
Definition: ViewShell.hxx:249
::sd::View * mpView
Definition: ViewShell.hxx:452
void ImpSidRedo(SfxRequest &rReq)
Definition: viewshel.cxx:1270
void SetCurrentFunction(const rtl::Reference< FuPoor > &xFunction)
Definition: viewshel.cxx:1422
void ExecReq(SfxRequest &rReq)
Definition: viewshel.cxx:1339
virtual void Activate(bool IsMDIActivate) override
set focus to working window
Definition: viewshel.cxx:289
VclPtr< sd::Window > mpContentWindow
Window inside the rulers and scroll bars that shows a view of the document.
Definition: ViewShell.hxx:434
SD_DLLPUBLIC ViewShellBase & GetViewShellBase() const
Definition: viewshel.cxx:1397
SD_DLLPUBLIC SfxViewFrame * GetViewFrame() const
Definition: viewshel.cxx:118
bool HasCurrentFunction() const
Definition: ViewShell.hxx:252
void doShow()
This must be called after the ctor, but before anything else.
Definition: viewshel.cxx:238
bool HasRuler() const
Definition: ViewShell.hxx:191
virtual void Deactivate(bool IsMDIActivate) override
Definition: viewshel.cxx:352
An SdWindow contains the actual working area of ViewShell.
Definition: Window.hxx:45
void SetMaxZoom(::tools::Long nMax)
Definition: sdwindow.cxx:178
::tools::Long GetMaxZoom() const
Definition: Window.hxx:106
::tools::Long GetMinZoom() const
Definition: Window.hxx:104
void SetMinZoomAutoCalc(bool bAuto)
Definition: sdwindow.cxx:526
void SetMinZoom(::tools::Long nMin)
Definition: sdwindow.cxx:173
::tools::Long GetZoom() const
Definition: sdwindow.cxx:183
static ::std::shared_ptr< FrameworkHelper > Instance(ViewShellBase &rBase)
Return the FrameworkHelper object that is associated with the given ViewShellBase.
constexpr tools::Long Top() const
constexpr Point TopLeft() const
constexpr Size GetSize() const
constexpr void SetBottom(tools::Long v)
constexpr tools::Long GetHeight() const
constexpr tools::Long Left() const
constexpr tools::Long Bottom() const
constexpr bool IsEmpty() const
static const OUString & GetContextName(const Context eContext)
sal_uInt16 GetGroup() const
vcl::Window * GetAccessibleParentWindow() const
const AllSettings & GetSettings() const
void ReleaseMouse()
Point PixelToLogic(const Point &rDevicePt) const
css::uno::Reference< css::accessibility::XAccessible > GetAccessible(bool bCreate=true)
virtual Size GetSizePixel() const
Size GetOutputSizePixel() const
void SetHelpId(const OUString &)
int nCount
#define DBG_ASSERT(sCon, aError)
virtual std::shared_ptr< SfxDialogController > GetController() override
EEControlBits
constexpr TypedWhichId< SvxLanguageItem > EE_CHAR_LANGUAGE(EE_CHAR_START+14)
#define ERRCODE_NONE
constexpr OUStringLiteral IsReadOnly(u"IsReadOnly")
constexpr OUStringLiteral SD_LT_SEPARATOR
Definition: glob.hxx:49
constexpr OUStringLiteral HID_SDOUTLINEVIEWSHELL
Definition: helpids.h:26
sal_Int32 nIndex
constexpr sal_uInt16 KEYGROUP_FKEYS
constexpr sal_uInt16 KEY_DELETE
constexpr sal_uInt16 KEYGROUP_CURSOR
#define LANGUAGE_NONE
sal_uInt16 nPos
#define SAL_WARN(area, stream)
SVXCORE_DLLPUBLIC MSO_SPT Get(const OUString &)
bool IsChangeCaseMapEnabled()
int i
IMPL_LINK(SdCharHeightPropertyBox, implMenuSelectHdl, const OUString &, rIdent, void)
long Long
SwNodeOffset abs(const SwNodeOffset &a)
#define SFX_OBJECTBAR_APPLICATION
#define SFX_OBJECTBAR_TOOLS
const char GetValue[]
OutlinerMode
#define MAX_ZOOM
Definition: outlnvsh.cxx:98
#define MIN_ZOOM
Definition: outlnvsh.cxx:97
QPRO_FUNC_TYPE nType
OUString SdResId(TranslateId aId)
Definition: sdmod.cxx:83
static SfxItemSet & rSet
#define SFX_IMPL_INTERFACE(Class, SuperClass)
sal_uIntPtr sal_uLong
sal_Int32 nStartPara
sal_Int32 nEndPos
sal_Int32 nStartPos
sal_Int32 nEndPara
SfxStyleFamily
SVXCORE_DLLPUBLIC SdrTextObj * DynCastSdrTextObj(SdrObject *)
Center
#define DND_ACTION_COPY
TransliterationFlags
signed char sal_Int8
SvxZoomEnableFlags