LibreOffice Module sd (master) 1
outlview.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 <OutlineView.hxx>
21#include <sfx2/progress.hxx>
23#include <vcl/svapp.hxx>
24#include <svx/svxids.hrc>
25#include <editeng/outliner.hxx>
26#include <editeng/eeitem.hxx>
27#include <editeng/editstat.hxx>
28#include <editeng/lrspitem.hxx>
29#include <svx/svdotext.hxx>
30#include <sfx2/viewfrm.hxx>
31#include <svl/style.hxx>
32#include <svx/svdundo.hxx>
33#include <editeng/numitem.hxx>
34#include <editeng/outlobj.hxx>
35#include <editeng/editeng.hxx>
36#include <xmloff/autolayout.hxx>
37#include <tools/debug.hxx>
38
39#include <editeng/editobj.hxx>
40#include <editeng/editund2.hxx>
41
42#include <editeng/editview.hxx>
43
44#include <com/sun/star/frame/XFrame.hpp>
45
46#include <DrawDocShell.hxx>
47#include <drawdoc.hxx>
48#include <Window.hxx>
49#include <sdpage.hxx>
50#include <pres.hxx>
51#include <OutlineViewShell.hxx>
52#include <app.hrc>
53#include <strings.hrc>
54#include <sdmod.hxx>
55#include <sdresid.hxx>
56#include <Outliner.hxx>
57#include <EventMultiplexer.hxx>
58#include <ViewShellBase.hxx>
59#include <ViewShellManager.hxx>
60#include <undo/undomanager.hxx>
61#include <stlsheet.hxx>
62
63using namespace ::com::sun::star::uno;
64using namespace ::com::sun::star::frame;
65
66namespace sd {
67
68// a progress bar gets displayed when more than
69// PROCESS_WITH_PROGRESS_THRESHOLD pages are concerned
70#define PROCESS_WITH_PROGRESS_THRESHOLD 5
71
73: ::sd::View(*rDocSh.GetDoc(), pWindow->GetOutDev(), &rOutlineViewShell)
74, mrOutlineViewShell(rOutlineViewShell)
75, mrOutliner(*mrDoc.GetOutliner())
76, mnPagesToProcess(0)
77, mnPagesProcessed(0)
78, mbFirstPaint(true)
79, maDocColor( COL_WHITE )
80, maLRSpaceItem(2000, 0, 0, EE_PARA_OUTLLRSPACE)
81{
82 bool bInitOutliner = false;
83
84 if (mrOutliner.GetViewCount() == 0)
85 {
86 // initialize Outliner: set Reference Device
87 bInitOutliner = true;
88 mrOutliner.Init( OutlinerMode::OutlineView );
89 mrOutliner.SetRefDevice( SD_MOD()->GetVirtualRefDevice() );
90 //viewsize without the width of the image and number in front
92 mrOutliner.SetPaperSize(Size(mnPaperWidth, 400000000));
93 }
94 else
95 {
96 // width: DIN A4, two margins at 1 cm each
97 mnPaperWidth = 19000;
98 }
99
100 mpOutlinerViews[0].reset( new OutlinerView(&mrOutliner, pWindow) );
101 mpOutlinerViews[0]->SetOutputArea(::tools::Rectangle());
102 mrOutliner.SetUpdateLayout(false);
103 mrOutliner.InsertView(mpOutlinerViews[0].get(), EE_APPEND);
104
105 onUpdateStyleSettings( true );
106
107 if (bInitOutliner)
108 {
109 // fill Outliner with contents
110 FillOutliner();
111 }
112
113 Link<tools::EventMultiplexerEvent&,void> aLink( LINK(this,OutlineView,EventMultiplexerListener) );
114 mrOutlineViewShell.GetViewShellBase().GetEventMultiplexer()->AddEventListener(aLink);
115
118
119 // Tell undo manager of the document about the undo manager of the
120 // outliner, so that the former can synchronize with the later.
121 sd::UndoManager* pDocUndoMgr = dynamic_cast<sd::UndoManager*>(mpDocSh->GetUndoManager());
122 if (pDocUndoMgr != nullptr)
123 pDocUndoMgr->SetLinkedUndoManager(&mrOutliner.GetUndoManager());
124}
125
130{
132 "sd::OutlineView::~OutlineView(), prior drag operation not finished correctly!");
133
134 Link<tools::EventMultiplexerEvent&,void> aLink( LINK(this,OutlineView,EventMultiplexerListener) );
135 mrOutlineViewShell.GetViewShellBase().GetEventMultiplexer()->RemoveEventListener( aLink );
137
138 mpProgress.reset();
139
140 // unregister OutlinerViews and destroy them
141 for (auto & rpView : mpOutlinerViews)
142 {
143 if (rpView)
144 {
145 mrOutliner.RemoveView( rpView.get() );
146 rpView.reset();
147 }
148 }
149
150 if (mrOutliner.GetViewCount() == 0)
151 {
152 // uninitialize Outliner: enable color display
153 ResetLinks();
154 EEControlBits nCntrl = mrOutliner.GetControlWord();
155 mrOutliner.SetUpdateLayout(false); // otherwise there will be drawn on SetControlWord
156 mrOutliner.SetControlWord(nCntrl & ~EEControlBits::NOCOLORS);
158 mrOutliner.Clear();
159 }
160}
161
163{
164 // When the mode is switched to outline the main view shell grabs focus.
165 // This is done for getting cut/copy/paste commands on slides in the left
166 // pane (slide sorter view shell) to work properly.
167 SfxShell* pTopViewShell = mrOutlineViewShell.GetViewShellBase().GetViewShellManager()->GetTopViewShell();
168 if (pTopViewShell && pTopViewShell == &mrOutlineViewShell)
169 {
171 }
172
173 Application::AddEventListener(LINK(this, OutlineView, AppEventListenerHdl));
174}
175
177{
178 Application::RemoveEventListener(LINK(this, OutlineView, AppEventListenerHdl));
179}
180
181void OutlineView::Paint(const ::tools::Rectangle& rRect, ::sd::Window const * pWin)
182{
183 OutlinerView* pOlView = GetViewByWindow(pWin);
184
185 if (pOlView)
186 {
187 pOlView->HideCursor();
188 pOlView->Paint(rRect);
189
190 pOlView->ShowCursor(mbFirstPaint);
191
192 mbFirstPaint = false;
193 }
194}
195
197{
198 bool bAdded = false;
199 bool bValidArea = false;
200 ::tools::Rectangle aOutputArea;
201 const Color aWhiteColor( COL_WHITE );
202 sal_uInt16 nView = 0;
203
204 while (nView < MAX_OUTLINERVIEWS && !bAdded)
205 {
206 if (mpOutlinerViews[nView] == nullptr)
207 {
208 mpOutlinerViews[nView].reset( new OutlinerView(&mrOutliner, dynamic_cast< ::sd::Window* >(rDev.GetOwnerWindow())) );
209 mpOutlinerViews[nView]->SetBackgroundColor( aWhiteColor );
210 mrOutliner.InsertView(mpOutlinerViews[nView].get(), EE_APPEND);
211 bAdded = true;
212
213 if (bValidArea)
214 {
215 mpOutlinerViews[nView]->SetOutputArea(aOutputArea);
216 }
217 }
218 else if (!bValidArea)
219 {
220 aOutputArea = mpOutlinerViews[nView]->GetOutputArea();
221 bValidArea = true;
222 }
223
224 nView++;
225 }
226
227 // white background in Outliner
228 rDev.SetBackground( Wallpaper( aWhiteColor ) );
229
231}
232
234{
235 bool bRemoved = false;
236 sal_uInt16 nView = 0;
237 vcl::Window* pWindow;
238
239 while (nView < MAX_OUTLINERVIEWS && !bRemoved)
240 {
241 if (mpOutlinerViews[nView] != nullptr)
242 {
243 pWindow = mpOutlinerViews[nView]->GetWindow();
244
245 if (pWindow->GetOutDev() == &rDev)
246 {
247 mrOutliner.RemoveView( mpOutlinerViews[nView].get() );
248 mpOutlinerViews[nView].reset();
249 bRemoved = true;
250 }
251 }
252
253 nView++;
254 }
255
257}
258
263{
264 OutlinerView* pOlView = nullptr;
265 for (std::unique_ptr<OutlinerView> const & pView : mpOutlinerViews)
266 {
267 if (pView != nullptr)
268 {
269 if ( pWin == pView->GetWindow() )
270 {
271 pOlView = pView.get();
272 }
273 }
274 }
275 return pOlView;
276}
277
282{
283 sal_Int32 nPos = mrOutliner.GetAbsPos(pPara);
284
285 if (nPos > 0)
286 {
287 while(nPos)
288 {
289 pPara = mrOutliner.GetParagraph(--nPos);
290 if( ::Outliner::HasParaFlag(pPara, ParaFlag::ISPAGE) )
291 {
292 return const_cast< Paragraph* >( pPara );
293 }
294 }
295
296 }
297 return nullptr;
298}
299
304{
305 Paragraph* pResult = const_cast< Paragraph* >( pPara );
306
307 sal_Int32 nPos = mrOutliner.GetAbsPos(pResult);
308
309 do
310 {
311 pResult = mrOutliner.GetParagraph(++nPos);
312 if( pResult && ::Outliner::HasParaFlag(pResult, ParaFlag::ISPAGE) )
313 return pResult;
314 }
315 while( pResult );
316
317 return nullptr;
318}
319
323IMPL_LINK( OutlineView, ParagraphInsertedHdl, Outliner::ParagraphHdlParam, aParam, void )
324{
325 // we get calls to this handler during binary insert of drag and drop contents but
326 // we ignore it here and handle it later in OnEndPasteOrDrop()
327 if (maDragAndDropModelGuard != nullptr)
328 return;
329
330 OutlineViewPageChangesGuard aGuard(this);
331
332 sal_Int32 nAbsPos = mrOutliner.GetAbsPos( aParam.pPara );
333
334 UpdateParagraph( nAbsPos );
335
336 if( (nAbsPos == 0) ||
337 ::Outliner::HasParaFlag(aParam.pPara, ParaFlag::ISPAGE) ||
338 ::Outliner::HasParaFlag(mrOutliner.GetParagraph( nAbsPos-1 ), ParaFlag::ISPAGE) )
339 {
340 InsertSlideForParagraph( aParam.pPara );
341 }
342}
343
346{
347 DBG_ASSERT( isRecordingUndo(), "sd::OutlineView::InsertSlideForParagraph(), model change without undo?!" );
348
349 OutlineViewPageChangesGuard aGuard(this);
350
351 mrOutliner.SetParaFlag( pPara, ParaFlag::ISPAGE );
352 // how many titles are there before the new title paragraph?
353 sal_uLong nExample = 0; // position of the "example" page
354 sal_uLong nTarget = 0; // position of insertion
355 while(pPara)
356 {
357 pPara = GetPrevTitle(pPara);
358 if (pPara)
359 nTarget++;
360 }
361
362 // if a new paragraph is created via RETURN before the first paragraph, the
363 // Outliner reports the old paragraph (which was moved down) as a new
364 // paragraph
365 if (nTarget == 1)
366 {
367 OUString aTest = mrOutliner.GetText(mrOutliner.GetParagraph(0));
368 if (aTest.isEmpty())
369 {
370 nTarget = 0;
371 }
372 }
373
374 // the "example" page is the previous page - if it is available
375 if (nTarget > 0)
376 {
377 nExample = nTarget - 1;
378
379 sal_uInt16 nPageCount = mrDoc.GetSdPageCount( PageKind::Standard );
380 if( nExample >= nPageCount )
381 nExample = nPageCount - 1;
382 }
383
384 /**********************************************************************
385 * All the time, a standard page is created before a notes page.
386 * It is ensured that after each standard page the corresponding notes page
387 * follows. A handout page is exactly one handout page.
388 **********************************************************************/
389
390 // this page is exemplary
391 SdPage* pExample = mrDoc.GetSdPage(static_cast<sal_uInt16>(nExample), PageKind::Standard);
393
394 pPage->SetLayoutName(pExample->GetLayoutName());
395
396 // insert (page)
397 mrDoc.InsertPage(pPage.get(), static_cast<sal_uInt16>(nTarget) * 2 + 1);
398 if( isRecordingUndo() )
400
401 // assign a master page to the standard page
402 pPage->TRG_SetMasterPage(pExample->TRG_GetMasterPage());
403
404 // set page size
405 pPage->SetSize(pExample->GetSize());
406 pPage->SetBorder( pExample->GetLeftBorder(),
407 pExample->GetUpperBorder(),
408 pExample->GetRightBorder(),
409 pExample->GetLowerBorder() );
410
411 // create new presentation objects (after <Title> or <Title with subtitle>
412 // follows <Title with outline>, otherwise apply the layout of the previous
413 // page
414 AutoLayout eAutoLayout = pExample->GetAutoLayout();
415 if (eAutoLayout == AUTOLAYOUT_TITLE ||
416 eAutoLayout == AUTOLAYOUT_TITLE_ONLY)
417 {
418 pPage->SetAutoLayout(AUTOLAYOUT_TITLE_CONTENT, true);
419 }
420 else
421 {
422 pPage->SetAutoLayout(pExample->GetAutoLayout(), true);
423 }
424
425 /**********************************************************************
426 |* now the notes page
427 \*********************************************************************/
428 pExample = mrDoc.GetSdPage(static_cast<sal_uInt16>(nExample), PageKind::Notes);
429 rtl::Reference<SdPage> pNotesPage = mrDoc.AllocSdPage(false);
430
431 pNotesPage->SetLayoutName(pExample->GetLayoutName());
432
433 pNotesPage->SetPageKind(PageKind::Notes);
434
435 // insert (notes page)
436 mrDoc.InsertPage(pNotesPage.get(), static_cast<sal_uInt16>(nTarget) * 2 + 2);
437 if( isRecordingUndo() )
439
440 // assign a master page to the notes page
441 pNotesPage->TRG_SetMasterPage(pExample->TRG_GetMasterPage());
442
443 // set page size, there must be already one page available
444 pNotesPage->SetSize(pExample->GetSize());
445 pNotesPage->SetBorder( pExample->GetLeftBorder(),
446 pExample->GetUpperBorder(),
447 pExample->GetRightBorder(),
448 pExample->GetLowerBorder() );
449
450 // create presentation objects
451 pNotesPage->SetAutoLayout(pExample->GetAutoLayout(), true);
452
453 mrOutliner.UpdateFields();
454
455 return pPage.get();
456}
457
461IMPL_LINK( OutlineView, ParagraphRemovingHdl, ::Outliner::ParagraphHdlParam, aParam, void )
462{
463 DBG_ASSERT( isRecordingUndo(), "sd::OutlineView::ParagraphRemovingHdl(), model change without undo?!" );
464
465 OutlineViewPageChangesGuard aGuard(this);
466
467 Paragraph* pPara = aParam.pPara;
468 if( !::Outliner::HasParaFlag( pPara, ParaFlag::ISPAGE ) )
469 return;
470
471 // how many titles are in front of the title paragraph in question?
472 sal_uLong nPos = 0;
473 while(pPara)
474 {
475 pPara = GetPrevTitle(pPara);
476 if (pPara) nPos++;
477 }
478
479 // delete page and notes page
480 sal_uInt16 nAbsPos = static_cast<sal_uInt16>(nPos) * 2 + 1;
481 SdrPage* pPage = mrDoc.GetPage(nAbsPos);
482 if( isRecordingUndo() )
483 AddUndo(mrDoc.GetSdrUndoFactory().CreateUndoDeletePage(*pPage));
484 mrDoc.RemovePage(nAbsPos);
485
486 nAbsPos = static_cast<sal_uInt16>(nPos) * 2 + 1;
487 pPage = mrDoc.GetPage(nAbsPos);
488 if( isRecordingUndo() )
489 AddUndo(mrDoc.GetSdrUndoFactory().CreateUndoDeletePage(*pPage));
490 mrDoc.RemovePage(nAbsPos);
491
492 // progress display if necessary
493 if (mnPagesToProcess)
494 {
495 mnPagesProcessed++;
496
497 if(mpProgress)
498 mpProgress->SetState(mnPagesProcessed);
499
500 if (mnPagesProcessed == mnPagesToProcess)
501 {
502 mpProgress.reset();
503 mnPagesToProcess = 0;
504 mnPagesProcessed = 0;
505 }
506 }
507 aParam.pOutliner->UpdateFields();
508}
509
514IMPL_LINK( OutlineView, DepthChangedHdl, ::Outliner::DepthChangeHdlParam, aParam, void )
515{
516 DBG_ASSERT( isRecordingUndo(), "sd::OutlineView::DepthChangedHdl(), no undo for model change?!" );
517
518 OutlineViewPageChangesGuard aGuard(this);
519
520 Paragraph* pPara = aParam.pPara;
521 ::Outliner* pOutliner = aParam.pOutliner;
522 if( ::Outliner::HasParaFlag( pPara, ParaFlag::ISPAGE ) && ((aParam.nPrevFlags & ParaFlag::ISPAGE) == ParaFlag::NONE) )
523 {
524 // the current paragraph is transformed into a slide
525
526 mrOutliner.SetDepth( pPara, -1 );
527
528 // are multiple level 1 paragraphs being brought to level 0 and we
529 // should start a progress view or a timer and didn't already?
530 if (mnPagesToProcess == 0)
531 {
532 Window* pActWin = mrOutlineViewShell.GetActiveWindow();
533 OutlinerView* pOlView = GetViewByWindow(pActWin);
534
535 std::vector<Paragraph*> aSelList;
536 pOlView->CreateSelectionList(aSelList);
537
538 mnPagesToProcess = std::count_if(aSelList.begin(), aSelList.end(),
539 [&pOutliner](const Paragraph *pParagraph) {
540 return !Outliner::HasParaFlag(pParagraph, ParaFlag::ISPAGE) &&
541 (pOutliner->GetDepth(pOutliner->GetAbsPos(pParagraph)) <= 0);
542 });
543
544 mnPagesToProcess++; // the paragraph being in level 0 already
545 // should be included
546 mnPagesProcessed = 0;
547
548 if (mnPagesToProcess > PROCESS_WITH_PROGRESS_THRESHOLD)
549 {
550 mpProgress.reset( new SfxProgress( GetDocSh(), SdResId(STR_CREATE_PAGES), mnPagesToProcess ) );
551 }
552 else
553 {
554 mpDocSh->SetWaitCursor( true );
555 }
556 }
557
558 ParagraphInsertedHdl( { aParam.pOutliner, aParam.pPara } );
559
560 mnPagesProcessed++;
561
562 // should there be a progress display?
563 if (mnPagesToProcess > PROCESS_WITH_PROGRESS_THRESHOLD)
564 {
565 if (mpProgress)
566 mpProgress->SetState(mnPagesProcessed);
567 }
568
569 // was this the last page?
570 if (mnPagesProcessed == mnPagesToProcess)
571 {
572 if (mnPagesToProcess > PROCESS_WITH_PROGRESS_THRESHOLD && mpProgress)
573 {
574 mpProgress.reset();
575 }
576 else
577 mpDocSh->SetWaitCursor( false );
578
579 mnPagesToProcess = 0;
580 mnPagesProcessed = 0;
581 }
582 pOutliner->UpdateFields();
583 }
584 else if( !::Outliner::HasParaFlag( pPara, ParaFlag::ISPAGE ) && ((aParam.nPrevFlags & ParaFlag::ISPAGE) != ParaFlag::NONE) )
585 {
586 // the paragraph was a page but now becomes a normal paragraph
587
588 // how many titles are before the title paragraph in question?
589 sal_uLong nPos = 0;
590 Paragraph* pParagraph = pPara;
591 while(pParagraph)
592 {
593 pParagraph = GetPrevTitle(pParagraph);
594 if (pParagraph)
595 nPos++;
596 }
597 // delete page and notes page
598
599 sal_uInt16 nAbsPos = static_cast<sal_uInt16>(nPos) * 2 + 1;
600 SdrPage* pPage = mrDoc.GetPage(nAbsPos);
601 if( isRecordingUndo() )
602 AddUndo(mrDoc.GetSdrUndoFactory().CreateUndoDeletePage(*pPage));
603 mrDoc.RemovePage(nAbsPos);
604
605 nAbsPos = static_cast<sal_uInt16>(nPos) * 2 + 1;
606 pPage = mrDoc.GetPage(nAbsPos);
607 if( isRecordingUndo() )
608 AddUndo(mrDoc.GetSdrUndoFactory().CreateUndoDeletePage(*pPage));
609 mrDoc.RemovePage(nAbsPos);
610
611 pPage = GetPageForParagraph( pPara );
612
613 mrOutliner.SetDepth( pPara, (pPage && (static_cast<SdPage*>(pPage)->GetAutoLayout() == AUTOLAYOUT_TITLE)) ? -1 : 0 );
614
615 // progress display if necessary
616 if (mnPagesToProcess)
617 {
618 mnPagesProcessed++;
619 if (mpProgress)
620 mpProgress->SetState(mnPagesProcessed);
621
622 if (mnPagesProcessed == mnPagesToProcess)
623 {
624 mpProgress.reset();
625 mnPagesToProcess = 0;
626 mnPagesProcessed = 0;
627 }
628 }
629 pOutliner->UpdateFields();
630 }
631 else if ( (pOutliner->GetPrevDepth() == 1) && ( pOutliner->GetDepth( pOutliner->GetAbsPos( pPara ) ) == 2 ) )
632 {
633 // how many titles are in front of the title paragraph in question?
634 sal_Int32 nPos = -1;
635
636 Paragraph* pParagraph = pPara;
637 while(pParagraph)
638 {
639 pParagraph = GetPrevTitle(pParagraph);
640 if (pParagraph)
641 nPos++;
642 }
643
644 if(nPos >= 0)
645 {
646 SdPage*pPage = mrDoc.GetSdPage( static_cast<sal_uInt16>(nPos), PageKind::Standard);
647
648 if(pPage && pPage->GetPresObj(PresObjKind::Text))
649 pOutliner->SetDepth( pPara, 0 );
650 }
651
652 }
653 // how many titles are in front of the title paragraph in question?
654 sal_Int32 nPos = -1;
655
656 Paragraph* pTempPara = pPara;
657 while(pTempPara)
658 {
659 pTempPara = GetPrevTitle(pTempPara);
660 if (pTempPara)
661 nPos++;
662 }
663
664 if( nPos < 0 )
665 return;
666
667 SdPage* pPage = mrDoc.GetSdPage( static_cast<sal_uInt16>(nPos), PageKind::Standard );
668
669 if( !pPage )
670 return;
671
672 SfxStyleSheet* pStyleSheet = nullptr;
673 sal_Int32 nPara = pOutliner->GetAbsPos( pPara );
674 sal_Int16 nDepth = pOutliner->GetDepth( nPara );
675 bool bSubTitle = pPage->GetPresObj(PresObjKind::Text) != nullptr;
676
677 if( ::Outliner::HasParaFlag(pPara, ParaFlag::ISPAGE) )
678 {
679 pStyleSheet = pPage->GetStyleSheetForPresObj( PresObjKind::Title );
680 }
681 else if( bSubTitle )
682 {
683 pStyleSheet = pPage->GetStyleSheetForPresObj( PresObjKind::Text );
684 }
685 else
686 {
687 pStyleSheet = pPage->GetStyleSheetForPresObj( PresObjKind::Outline );
688
689 if( nDepth > 0 )
690 {
691 OUString aNewStyleSheetName = pStyleSheet->GetName();
692 if (!aNewStyleSheetName.isEmpty())
693 aNewStyleSheetName = aNewStyleSheetName.copy(0, aNewStyleSheetName.getLength() - 1);
694 aNewStyleSheetName += OUString::number( nDepth+1 );
695 SfxStyleSheetBasePool* pStylePool = mrDoc.GetStyleSheetPool();
696 pStyleSheet = static_cast<SfxStyleSheet*>( pStylePool->Find( aNewStyleSheetName, pStyleSheet->GetFamily() ) );
697 }
698 }
699
700 // before we set the style sheet we need to preserve the bullet item
701 // since all items will be deleted while setting a new style sheet
702 SfxItemSet aOldAttrs( pOutliner->GetParaAttribs( nPara ) );
703
704 pOutliner->SetStyleSheet( nPara, pStyleSheet );
705
706 // restore the old bullet item but not if the style changed
707 if ( pOutliner->GetPrevDepth() != -1 && nDepth != -1 &&
708 aOldAttrs.GetItemState( EE_PARA_NUMBULLET ) == SfxItemState::SET )
709 {
710 SfxItemSet aAttrs( pOutliner->GetParaAttribs( nPara ) );
711 aAttrs.Put( *aOldAttrs.GetItem( EE_PARA_NUMBULLET ) );
712 pOutliner->SetParaAttribs( nPara, aAttrs );
713 }
714}
715
719IMPL_LINK_NOARG(OutlineView, StatusEventHdl, EditStatus&, void)
720{
721 ::sd::Window* pWin = mrOutlineViewShell.GetActiveWindow();
722 OutlinerView* pOutlinerView = GetViewByWindow(pWin);
723 ::tools::Rectangle aVis = pOutlinerView->GetVisArea();
724 ::tools::Rectangle aText(Point(0,0),
725 Size(mnPaperWidth,
726 mrOutliner.GetTextHeight()));
727 ::tools::Rectangle aWin(Point(0,0), pWin->GetOutputSizePixel());
728 aWin = pWin->PixelToLogic(aWin);
729
730 if (!aVis.IsEmpty()) // not when opening
731 {
732 if (aWin.GetHeight() > aText.Bottom())
733 aText.SetBottom( aWin.GetHeight() );
734
735 mrOutlineViewShell.InitWindows(Point(0,0), aText.GetSize(), aVis.TopLeft());
736 mrOutlineViewShell.UpdateScrollBars();
737 }
738}
739
741{
742 DBG_ASSERT(maDragAndDropModelGuard == nullptr,
743 "sd::OutlineView::BeginDropHdl(), prior drag operation not finished correctly!");
744
745 maDragAndDropModelGuard.reset( new OutlineViewModelChangeGuard( *this ) );
746}
747
749{
750 maDragAndDropModelGuard.reset();
751}
752
756IMPL_LINK( OutlineView, BeginMovingHdl, ::Outliner *, pOutliner, void )
757{
758 OutlineViewPageChangesGuard aGuard(this);
759
760 // list of selected title paragraphs
761 mpOutlinerViews[0]->CreateSelectionList(maSelectedParas);
762
763 maSelectedParas.erase(std::remove_if(maSelectedParas.begin(), maSelectedParas.end(),
764 [](const Paragraph* pPara) { return !Outliner::HasParaFlag(pPara, ParaFlag::ISPAGE); }),
765 maSelectedParas.end());
766
767 // select the pages belonging to the paragraphs on level 0 to select
768 sal_uInt16 nPos = 0;
769 sal_Int32 nParaPos = 0;
770 Paragraph* pPara = pOutliner->GetParagraph( 0 );
771 std::vector<Paragraph*>::const_iterator fiter;
772
773 while(pPara)
774 {
775 if( ::Outliner::HasParaFlag(pPara, ParaFlag::ISPAGE) ) // one page?
776 {
777 maOldParaOrder.push_back(pPara);
778 SdPage* pPage = mrDoc.GetSdPage(nPos, PageKind::Standard);
779
780 fiter = std::find(maSelectedParas.begin(),maSelectedParas.end(),pPara);
781
782 pPage->SetSelected(fiter != maSelectedParas.end());
783
784 ++nPos;
785 }
786 pPara = pOutliner->GetParagraph( ++nParaPos );
787 }
788}
789
793IMPL_LINK( OutlineView, EndMovingHdl, ::Outliner *, pOutliner, void )
794{
795 OutlineViewPageChangesGuard aGuard(this);
796
797 DBG_ASSERT( isRecordingUndo(), "sd::OutlineView::EndMovingHdl(), model change without undo?!" );
798
799 // look for insertion position via the first paragraph
800 Paragraph* pSearchIt = maSelectedParas.empty() ? nullptr : *(maSelectedParas.begin());
801
802 // look for the first of the selected paragraphs in the new ordering
803 sal_uInt16 nPosNewOrder = 0;
804 sal_Int32 nParaPos = 0;
805 Paragraph* pPara = pOutliner->GetParagraph( 0 );
806 Paragraph* pPrev = nullptr;
807 while (pPara && pPara != pSearchIt)
808 {
809 if( ::Outliner::HasParaFlag(pPara, ParaFlag::ISPAGE) )
810 {
811 nPosNewOrder++;
812 pPrev = pPara;
813 }
814 pPara = pOutliner->GetParagraph( ++nParaPos );
815 }
816
817 sal_uInt16 nPos = nPosNewOrder; // don't change nPosNewOrder
818 if (nPos == 0)
819 {
820 nPos = sal_uInt16(-1); // insert before the first page
821 }
822 else
823 {
824 // look for the predecessor in the old ordering
825 std::vector<Paragraph*>::const_iterator it = std::find(maOldParaOrder.begin(),
826 maOldParaOrder.end(),
827 pPrev);
828
829 if (it != maOldParaOrder.end())
830 nPos = static_cast<sal_uInt16>(it-maOldParaOrder.begin());
831 else
832 nPos = 0xffff;
833
834 DBG_ASSERT(nPos != 0xffff, "Paragraph not found");
835 }
836
837 mrDoc.MovePages(nPos);
838
839 // deselect the pages again
840 sal_uInt16 nPageCount = static_cast<sal_uInt16>(maSelectedParas.size());
841 while (nPageCount)
842 {
843 SdPage* pPage = mrDoc.GetSdPage(nPosNewOrder, PageKind::Standard);
844 pPage->SetSelected(false);
845 nPosNewOrder++;
846 nPageCount--;
847 }
848
849 pOutliner->UpdateFields();
850
851 maSelectedParas.clear();
852 maOldParaOrder.clear();
853}
854
859{
860 const size_t nObjectCount = pPage->GetObjCount();
861 SdrTextObj* pResult = nullptr;
862
863 for (size_t nObject = 0; nObject < nObjectCount; ++nObject)
864 {
865 SdrObject* pObject = pPage->GetObj(nObject);
866 if (pObject->GetObjInventor() == SdrInventor::Default &&
867 pObject->GetObjIdentifier() == SdrObjKind::TitleText)
868 {
869 pResult = static_cast<SdrTextObj*>(pObject);
870 break;
871 }
872 }
873 return pResult;
874}
875
880{
881 const size_t nObjectCount = pPage->GetObjCount();
882 SdrTextObj* pResult = nullptr;
883
884 for (size_t nObject = 0; nObject < nObjectCount; ++nObject)
885 {
886 SdrObject* pObject = pPage->GetObj(nObject);
887 if (pObject->GetObjInventor() == SdrInventor::Default &&
888 pObject->GetObjIdentifier() == SdrObjKind::OutlineText)
889 {
890 pResult = static_cast<SdrTextObj*>(pObject);
891 break;
892 }
893 }
894 return pResult;
895}
896
898{
899 DBG_ASSERT( GetTitleTextObject(pPage) == nullptr, "sd::OutlineView::CreateTitleTextObject(), there is already a title text object!" );
900
901 if( pPage->GetAutoLayout() == AUTOLAYOUT_NONE )
902 {
903 // simple case
904 pPage->SetAutoLayout( AUTOLAYOUT_TITLE_ONLY, true );
905 }
906 else
907 {
908 // we already have a layout with a title but the title
909 // object was deleted, create a new one
910 pPage->InsertAutoLayoutShape( nullptr, PresObjKind::Title, false, pPage->GetTitleRect(), true );
911 }
912
913 return GetTitleTextObject(pPage);
914}
915
917{
918 DBG_ASSERT( GetOutlineTextObject(pPage) == nullptr, "sd::OutlineView::CreateOutlineTextObject(), there is already a layout text object!" );
919
920 AutoLayout eNewLayout = pPage->GetAutoLayout();
921 switch( eNewLayout )
922 {
923 case AUTOLAYOUT_NONE:
925 case AUTOLAYOUT_TITLE: eNewLayout = AUTOLAYOUT_TITLE_CONTENT; break;
926
927 case AUTOLAYOUT_CHART: eNewLayout = AUTOLAYOUT_CHARTTEXT; break;
928
929 case AUTOLAYOUT_ORG:
930 case AUTOLAYOUT_TAB:
931 case AUTOLAYOUT_OBJ: eNewLayout = AUTOLAYOUT_OBJTEXT; break;
932 default:
933 break;
934 }
935
936 if( eNewLayout != pPage->GetAutoLayout() )
937 {
938 pPage->SetAutoLayout( eNewLayout, true );
939 }
940 else
941 {
942 // we already have a layout with a text but the text
943 // object was deleted, create a new one
944 pPage->InsertAutoLayoutShape( nullptr,
946 false, pPage->GetLayoutRect(), true );
947 }
948
949 return GetOutlineTextObject(pPage);
950}
951
954{
955 ::sd::UndoManager* pDocUndoMgr = dynamic_cast<sd::UndoManager*>(mpDocSh->GetUndoManager());
956 if (pDocUndoMgr != nullptr)
957 pDocUndoMgr->SetLinkedUndoManager(nullptr);
958
959 mrOutliner.GetUndoManager().Clear();
960
961 BegUndo(SdResId(STR_UNDO_CHANGE_TITLE_AND_LAYOUT));
963 EndUndo();
965}
966
970bool OutlineView::SetAttributes(const SfxItemSet& rSet, bool /*bSlide*/, bool /*bReplaceAll*/, bool /*bMaster*/)
971{
972 bool bOk = false;
973
975
976 if (pOlView)
977 {
978 pOlView->SetAttribs(rSet);
979 bOk = true;
980 }
981
982 mrOutlineViewShell.Invalidate (SID_PREVIEW_STATE);
983
984 return bOk;
985}
986
990void OutlineView::GetAttributes( SfxItemSet& rTargetSet, bool ) const
991{
992 OutlinerView* pOlView = GetViewByWindow(
994 assert(pOlView && "No OutlinerView found");
995
996 rTargetSet.Put( pOlView->GetAttribs(), false );
997}
998
1001{
1002 mrOutliner.GetUndoManager().Clear();
1003 mrOutliner.EnableUndo(false);
1004 ResetLinks();
1005 const bool bPrevUpdateLayout = mrOutliner.SetUpdateLayout(false);
1006
1007 Paragraph* pTitleToSelect = nullptr;
1008 sal_uInt16 nPageCount = mrDoc.GetSdPageCount(PageKind::Standard);
1009
1010 // fill outliner with paragraphs from slides title & (outlines|subtitles)
1011 for (sal_uInt16 nPage = 0; nPage < nPageCount; nPage++)
1012 {
1013 SdPage* pPage = mrDoc.GetSdPage(nPage, PageKind::Standard);
1014 Paragraph * pPara = nullptr;
1015
1016 // take text from title shape
1017 SdrTextObj* pTO = GetTitleTextObject(pPage);
1018 if(pTO && !(pTO->IsEmptyPresObj()))
1019 {
1021 if (pOPO)
1022 {
1023 bool bVertical = pOPO->IsEffectivelyVertical();
1024 pOPO->SetVertical( false );
1025 mrOutliner.AddText(*pOPO);
1026 pOPO->SetVertical( bVertical );
1027 pPara = mrOutliner.GetParagraph( mrOutliner.GetParagraphCount()-1 );
1028 }
1029 }
1030
1031 if( pPara == nullptr ) // no title, insert an empty paragraph
1032 {
1033 pPara = mrOutliner.Insert(OUString());
1034 mrOutliner.SetDepth(pPara, -1);
1035
1036 // do not apply hard attributes from the previous paragraph
1037 mrOutliner.SetParaAttribs( mrOutliner.GetAbsPos(pPara),
1038 mrOutliner.GetEmptyItemSet() );
1039
1040 mrOutliner.SetStyleSheet( mrOutliner.GetAbsPos( pPara ), pPage->GetStyleSheetForPresObj( PresObjKind::Title ) );
1041 }
1042
1043 mrOutliner.SetParaFlag( pPara, ParaFlag::ISPAGE );
1044
1045 sal_Int32 nPara = mrOutliner.GetAbsPos( pPara );
1046
1047 UpdateParagraph( nPara );
1048
1049 // remember paragraph of currently selected page
1050 if (pPage->IsSelected())
1051 pTitleToSelect = pPara;
1052
1053 // take text from subtitle or outline
1054 pTO = static_cast<SdrTextObj*>(pPage->GetPresObj(PresObjKind::Text));
1055 const bool bSubTitle = pTO != nullptr;
1056
1057 if (!pTO) // if no subtile found, try outline
1058 pTO = GetOutlineTextObject(pPage);
1059
1060 if(pTO && !(pTO->IsEmptyPresObj())) // found some text
1061 {
1063 if (pOPO)
1064 {
1065 sal_Int32 nParaCount1 = mrOutliner.GetParagraphCount();
1066 bool bVertical = pOPO->IsEffectivelyVertical();
1067 pOPO->SetVertical( false );
1068 mrOutliner.AddText(*pOPO);
1069 pOPO->SetVertical( bVertical );
1070
1071 sal_Int32 nParaCount2 = mrOutliner.GetParagraphCount();
1072 for (sal_Int32 n = nParaCount1; n < nParaCount2; n++)
1073 {
1074 if( bSubTitle )
1075 {
1076 Paragraph* p = mrOutliner.GetParagraph(n);
1077 if(p && mrOutliner.GetDepth( n ) > 0 )
1078 mrOutliner.SetDepth(p, 0);
1079 }
1080
1081 UpdateParagraph( n );
1082 }
1083 }
1084 }
1085 }
1086
1087 // place cursor at the start
1088 Paragraph* pFirstPara = mrOutliner.GetParagraph( 0 );
1089 mpOutlinerViews[0]->Select( pFirstPara );
1090 mpOutlinerViews[0]->Select( pFirstPara, false );
1091
1092 // select title of slide that was selected
1093 if (pTitleToSelect)
1094 mpOutlinerViews[0]->Select(pTitleToSelect);
1095
1096 SetLinks();
1097
1098 mrOutliner.EnableUndo(true);
1099
1100 mrOutliner.SetUpdateLayout(bPrevUpdateLayout);
1101}
1102
1106IMPL_LINK_NOARG(OutlineView, RemovingPagesHdl, OutlinerView*, bool)
1107{
1108 sal_Int32 nNumOfPages = mrOutliner.GetSelPageCount();
1109
1110 if (nNumOfPages > PROCESS_WITH_PROGRESS_THRESHOLD)
1111 {
1112 mnPagesToProcess = nNumOfPages;
1113 mnPagesProcessed = 0;
1114 }
1115
1116 if (mnPagesToProcess)
1117 {
1118 mpProgress.reset( new SfxProgress( GetDocSh(), SdResId(STR_DELETE_PAGES), mnPagesToProcess ) );
1119 }
1120 mrOutliner.UpdateFields();
1121
1122 return true;
1123}
1124
1128IMPL_LINK( OutlineView, IndentingPagesHdl, OutlinerView *, pOutlinerView, bool )
1129{
1130 return RemovingPagesHdl(pOutlinerView);
1131}
1132
1136{
1138 OutlinerView* pActiveView = GetViewByWindow(pWin);
1139
1140 std::vector<Paragraph*> aSelList;
1141 pActiveView->CreateSelectionList(aSelList);
1142
1143 Paragraph *pPar = aSelList.empty() ? nullptr : *(aSelList.begin());
1144 SdPage* pCurrent = GetPageForParagraph(pPar);
1145
1146 DBG_ASSERT( pCurrent ||
1147 (mpDocSh->GetUndoManager() && static_cast< sd::UndoManager *>(mpDocSh->GetUndoManager())->IsDoing()) ||
1149 "sd::OutlineView::GetActualPage(), no current page?" );
1150
1151 if( pCurrent )
1152 return pCurrent;
1153
1154 return mrDoc.GetSdPage( 0, PageKind::Standard );
1155}
1156
1158{
1159 if( !::Outliner::HasParaFlag(pPara,ParaFlag::ISPAGE) )
1160 pPara = GetPrevTitle(pPara);
1161
1162 sal_uInt32 nPageToSelect = 0;
1163 while(pPara)
1164 {
1165 pPara = GetPrevTitle(pPara);
1166 if(pPara)
1167 nPageToSelect++;
1168 }
1169
1170 if( nPageToSelect < static_cast<sal_uInt32>(mrDoc.GetSdPageCount( PageKind::Standard )) )
1171 return mrDoc.GetSdPage( static_cast<sal_uInt16>(nPageToSelect), PageKind::Standard );
1172
1173 return nullptr;
1174}
1175
1177{
1178 // get the number of paragraphs with ident 0 we need to skip before
1179 // we find the actual page
1180 sal_uInt32 nPagesToSkip = (pPage->GetPageNum() - 1) >> 1;
1181
1182 sal_Int32 nParaPos = 0;
1183 Paragraph* pPara = rOutl.GetParagraph( 0 );
1184 while( pPara )
1185 {
1186 // if this paragraph is a page...
1187 if( ::Outliner::HasParaFlag(pPara,ParaFlag::ISPAGE) )
1188 {
1189 // see if we already skipped enough pages
1190 if( 0 == nPagesToSkip )
1191 break; // and if so, end the loop
1192
1193 // we skipped another page
1194 nPagesToSkip--;
1195 }
1196
1197 // get next paragraph
1198 pPara = mrOutliner.GetParagraph( ++nParaPos );
1199 }
1200
1201 return pPara;
1202}
1203
1205void OutlineView::SetActualPage( SdPage const * pActual )
1206{
1207 if( pActual && dynamic_cast<SdOutliner&>(mrOutliner).GetIgnoreCurrentPageChangesLevel()==0 && !mbFirstPaint)
1208 {
1209 // if we found a paragraph, select its text at the outliner view
1210 Paragraph* pPara = GetParagraphForPage( mrOutliner, pActual );
1211 if( pPara )
1212 mpOutlinerViews[0]->Select( pPara );
1213 }
1214}
1215
1220{
1222 OutlinerView* pOlView = GetViewByWindow(pActWin);
1223 SfxStyleSheet* pResult = pOlView->GetStyleSheet();
1224 return pResult;
1225}
1226
1231{
1232 // list of selected title paragraphs
1233 std::vector<Paragraph*> aSelParas;
1234 mpOutlinerViews[0]->CreateSelectionList(aSelParas);
1235
1236 aSelParas.erase(std::remove_if(aSelParas.begin(), aSelParas.end(),
1237 [](const Paragraph* pPara) { return !Outliner::HasParaFlag(pPara, ParaFlag::ISPAGE); }),
1238 aSelParas.end());
1239
1240 // select the pages belonging to the paragraphs on level 0 to select
1241 sal_uInt16 nPos = 0;
1242 sal_Int32 nParaPos = 0;
1243 Paragraph *pPara = mrOutliner.GetParagraph( 0 );
1244 std::vector<Paragraph*>::const_iterator fiter;
1245
1246 while(pPara)
1247 {
1248 if( ::Outliner::HasParaFlag(pPara, ParaFlag::ISPAGE) ) // one page
1249 {
1251 DBG_ASSERT(pPage!=nullptr,
1252 "Trying to select non-existing page OutlineView::SetSelectedPages()");
1253
1254 if (pPage)
1255 {
1256 fiter = std::find(aSelParas.begin(),aSelParas.end(),pPara);
1257 pPage->SetSelected(fiter != aSelParas.end());
1258 }
1259
1260 nPos++;
1261 }
1262
1263 pPara = mrOutliner.GetParagraph( ++nParaPos );
1264 }
1265}
1266
1271{
1272 // set notification links
1273 mrOutliner.SetParaInsertedHdl(LINK(this, OutlineView, ParagraphInsertedHdl));
1274 mrOutliner.SetParaRemovingHdl(LINK(this, OutlineView, ParagraphRemovingHdl));
1275 mrOutliner.SetDepthChangedHdl(LINK(this, OutlineView, DepthChangedHdl));
1276 mrOutliner.SetBeginMovingHdl(LINK(this, OutlineView, BeginMovingHdl));
1277 mrOutliner.SetEndMovingHdl(LINK(this, OutlineView, EndMovingHdl));
1278 mrOutliner.SetRemovingPagesHdl(LINK(this, OutlineView, RemovingPagesHdl));
1279 mrOutliner.SetIndentingPagesHdl(LINK(this, OutlineView, IndentingPagesHdl));
1280 mrOutliner.SetStatusEventHdl(LINK(this, OutlineView, StatusEventHdl));
1281 mrOutliner.SetBeginDropHdl(LINK(this,OutlineView, BeginDropHdl));
1282 mrOutliner.SetEndDropHdl(LINK(this,OutlineView, EndDropHdl));
1283 mrOutliner.SetPaintFirstLineHdl(LINK(this,OutlineView,PaintingFirstLineHdl));
1284 mrOutliner.SetBeginPasteOrDropHdl(LINK(this,OutlineView, BeginPasteOrDropHdl));
1285 mrOutliner.SetEndPasteOrDropHdl(LINK(this,OutlineView, EndPasteOrDropHdl));
1286}
1287
1292{
1296 mrOutliner.SetBeginMovingHdl(Link<::Outliner*,void>());
1297 mrOutliner.SetEndMovingHdl(Link<::Outliner*,void>());
1298 mrOutliner.SetStatusEventHdl(Link<EditStatus&,void>());
1299 mrOutliner.SetRemovingPagesHdl(Link<OutlinerView*,bool>());
1300 mrOutliner.SetIndentingPagesHdl(Link<OutlinerView*,bool>());
1301 mrOutliner.SetDrawPortionHdl(Link<DrawPortionInfo*,void>());
1302 mrOutliner.SetBeginPasteOrDropHdl(Link<PasteOrDropInfos*,void>());
1303 mrOutliner.SetEndPasteOrDropHdl(Link<PasteOrDropInfos*,void>());
1304}
1305
1307{
1308 return DND_ACTION_NONE;
1309}
1310
1312{
1313 return DND_ACTION_NONE;
1314}
1315
1316// Re-implement GetScriptType for this view to get correct results
1318{
1320
1321 std::optional<OutlinerParaObject> pTempOPObj = mrOutliner.CreateParaObject();
1322 if(pTempOPObj)
1323 {
1324 nScriptType = pTempOPObj->GetTextObject().GetScriptType();
1325 }
1326
1327 return nScriptType;
1328}
1329
1330void OutlineView::onUpdateStyleSettings( bool bForceUpdate /* = false */ )
1331{
1332 svtools::ColorConfig aColorConfig;
1333 const Color aDocColor( aColorConfig.GetColorValue( svtools::DOCCOLOR ).nColor );
1334 if( !(bForceUpdate || (maDocColor != aDocColor)) )
1335 return;
1336
1337 sal_uInt16 nView;
1338 for( nView = 0; nView < MAX_OUTLINERVIEWS; nView++ )
1339 {
1340 if (mpOutlinerViews[nView] != nullptr)
1341 {
1342 mpOutlinerViews[nView]->SetBackgroundColor( aDocColor );
1343
1344 vcl::Window* pWindow = mpOutlinerViews[nView]->GetWindow();
1345
1346 if( pWindow )
1347 pWindow->SetBackground( Wallpaper( aDocColor ) );
1348
1349 }
1350 }
1351
1352 mrOutliner.SetBackgroundColor( aDocColor );
1353
1354 maDocColor = aDocColor;
1355}
1356
1357IMPL_LINK_NOARG(OutlineView, AppEventListenerHdl, VclSimpleEvent&, void)
1358{
1359 onUpdateStyleSettings(false);
1360}
1361
1362IMPL_LINK(OutlineView, EventMultiplexerListener, ::sd::tools::EventMultiplexerEvent&, rEvent, void)
1363{
1364 switch (rEvent.meEventId)
1365 {
1367 SetActualPage(mrOutlineViewShell.GetActualPage());
1368 break;
1369
1371 if (dynamic_cast<SdOutliner&>(mrOutliner).GetIgnoreCurrentPageChangesLevel()==0)
1372 {
1373 if (((mrDoc.GetPageCount()-1)%2) == 0)
1374 {
1375 mrOutliner.Clear();
1376 FillOutliner();
1377 ::sd::Window* pWindow = mrOutlineViewShell.GetActiveWindow();
1378 if (pWindow != nullptr)
1379 pWindow->Invalidate();
1380 }
1381 }
1382 break;
1383
1384 default: break;
1385 }
1386}
1387
1389{
1390 if (bIgnoreChanges)
1391 dynamic_cast<SdOutliner&>(mrOutliner).IncreIgnoreCurrentPageChangesLevel();
1392 else
1393 dynamic_cast<SdOutliner&>(mrOutliner).DecreIgnoreCurrentPageChangesLevel();
1394}
1395
1399{
1400 mrOutliner.GetUndoManager().EnterListAction("", "", 0, mrOutlineViewShell.GetViewShellBase().GetViewShellId());
1401 BegUndo(SdResId(STR_UNDO_CHANGE_TITLE_AND_LAYOUT));
1402}
1403
1407{
1409
1410 SfxUndoManager* pDocUndoMgr = mpDocSh->GetUndoManager();
1411
1412 bool bHasUndoActions = pDocUndoMgr->GetUndoActionCount() != 0;
1413
1414 EndUndo();
1415
1416 DBG_ASSERT( bHasUndoActions == (mrOutliner.GetUndoManager().GetUndoActionCount() != 0), "sd::OutlineView::EndModelChange(), undo actions not in sync!" );
1417
1418 mrOutliner.GetUndoManager().LeaveListAction();
1419
1420 if( bHasUndoActions && mrOutliner.GetEditEngine().HasTriedMergeOnLastAddUndo() )
1422
1423 mrOutlineViewShell.Invalidate( SID_UNDO );
1424 mrOutlineViewShell.Invalidate( SID_REDO );
1425}
1426
1429{
1430 OutlineViewPageChangesGuard aGuard(this);
1431
1432 const sal_uInt32 nPageCount = mrDoc.GetSdPageCount(PageKind::Standard);
1433 Paragraph* pPara = mrOutliner.GetParagraph( 0 );
1434 sal_uInt32 nPage;
1435 for (nPage = 0; nPage < nPageCount; nPage++)
1436 {
1437 SdPage* pPage = mrDoc.GetSdPage( static_cast<sal_uInt16>(nPage), PageKind::Standard);
1438 mrDoc.SetSelected(pPage, false);
1439
1440 mrOutlineViewShell.UpdateTitleObject( pPage, pPara );
1442
1443 if( pPara )
1444 pPara = GetNextTitle(pPara);
1445 }
1446
1447 DBG_ASSERT( pPara == nullptr, "sd::OutlineView::UpdateDocument(), slides are out of sync, creating missing ones" );
1448 while( pPara )
1449 {
1450 SdPage* pPage = InsertSlideForParagraph( pPara );
1451 mrDoc.SetSelected(pPage, false);
1452
1453 mrOutlineViewShell.UpdateTitleObject( pPage, pPara );
1455
1456 pPara = GetNextTitle(pPara);
1457 }
1458}
1459
1462{
1463 SfxUndoManager& rOutlineUndo = mrOutliner.GetUndoManager();
1464 if( rOutlineUndo.GetUndoActionCount() <= 1 )
1465 return;
1466
1467 SfxListUndoAction* pListAction = dynamic_cast< SfxListUndoAction* >( rOutlineUndo.GetUndoAction() );
1468 SfxListUndoAction* pPrevListAction = dynamic_cast< SfxListUndoAction* >( rOutlineUndo.GetUndoAction(1) );
1469 if( !(pListAction && pPrevListAction) )
1470 return;
1471
1472 // find the top EditUndo action in the top undo action list
1473 size_t nAction = pListAction->maUndoActions.size();
1474 EditUndo* pEditUndo = nullptr;
1475 while( !pEditUndo && nAction )
1476 {
1477 pEditUndo = dynamic_cast< EditUndo* >(pListAction->GetUndoAction(--nAction));
1478 }
1479
1480 sal_uInt16 nEditPos = nAction; // we need this later to remove the merged undo actions
1481
1482 // make sure it is the only EditUndo action in the top undo list
1483 while( pEditUndo && nAction )
1484 {
1485 if( dynamic_cast< EditUndo* >(pListAction->GetUndoAction(--nAction)) )
1486 pEditUndo = nullptr;
1487 }
1488
1489 // do we have one and only one EditUndo action in the top undo list?
1490 if( !pEditUndo )
1491 return;
1492
1493 // yes, see if we can merge it with the prev undo list
1494
1495 nAction = pPrevListAction->maUndoActions.size();
1496 EditUndo* pPrevEditUndo = nullptr;
1497 while( !pPrevEditUndo && nAction )
1498 pPrevEditUndo = dynamic_cast< EditUndo* >(pPrevListAction->GetUndoAction(--nAction));
1499
1500 if( !(pPrevEditUndo && pPrevEditUndo->Merge( pEditUndo )) )
1501 return;
1502
1503 // ok we merged the only EditUndo of the top undo list with
1504 // the top EditUndo of the previous undo list
1505
1506 // first remove the merged undo action
1507 assert( pListAction->GetUndoAction(nEditPos) == pEditUndo &&
1508 "sd::OutlineView::TryToMergeUndoActions(), wrong edit pos!" );
1509 pListAction->Remove(nEditPos);
1510
1511 if ( !pListAction->maUndoActions.empty() )
1512 {
1513 // now we have to move all remaining doc undo actions from the top undo
1514 // list to the previous undo list and remove the top undo list
1515
1516 size_t nCount = pListAction->maUndoActions.size();
1517 size_t nDestAction = pPrevListAction->maUndoActions.size();
1518 while( nCount-- )
1519 {
1520 std::unique_ptr<SfxUndoAction> pTemp = pListAction->Remove(0);
1521 pPrevListAction->Insert( std::move(pTemp), nDestAction++ );
1522 }
1523 pPrevListAction->nCurUndoAction = pPrevListAction->maUndoActions.size();
1524 }
1525
1526 rOutlineUndo.RemoveLastUndoAction();
1527}
1528
1529IMPL_LINK(OutlineView, PaintingFirstLineHdl, PaintFirstLineInfo*, pInfo, void)
1530{
1531 if( !pInfo )
1532 return;
1533
1534 Paragraph* pPara = mrOutliner.GetParagraph( pInfo->mnPara );
1535 EditEngine& rEditEngine = const_cast< EditEngine& >( mrOutliner.GetEditEngine() );
1536
1537 Size aImageSize( pInfo->mpOutDev->PixelToLogic( maSlideImage.GetSizePixel() ) );
1538 Size aOffset( 100, 100 );
1539
1540 // paint slide number
1541 if( !(pPara && ::Outliner::HasParaFlag(pPara,ParaFlag::ISPAGE)) )
1542 return;
1543
1544 ::tools::Long nPage = 0; // todo, printing??
1545 for ( sal_Int32 n = 0; n <= pInfo->mnPara; n++ )
1546 {
1547 Paragraph* p = mrOutliner.GetParagraph( n );
1548 if ( ::Outliner::HasParaFlag(p,ParaFlag::ISPAGE) )
1549 nPage++;
1550 }
1551
1552 ::tools::Long nBulletHeight = static_cast<::tools::Long>(mrOutliner.GetLineHeight( pInfo->mnPara ));
1553 ::tools::Long nFontHeight = 0;
1554 if ( !rEditEngine.IsFlatMode() )
1555 {
1556 nFontHeight = nBulletHeight / 5;
1557 }
1558 else
1559 {
1560 nFontHeight = (nBulletHeight * 10) / 25;
1561 }
1562
1563 Size aFontSz( 0, nFontHeight );
1564
1565 Size aOutSize( 2000, nBulletHeight );
1566
1567 const float fImageHeight = (static_cast<float>(aOutSize.Height()) * float(4)) / float(7);
1568 if (aImageSize.Width() != 0)
1569 {
1570 const float fImageRatio = static_cast<float>(aImageSize.Height()) / static_cast<float>(aImageSize.Width());
1571 aImageSize.setWidth( static_cast<::tools::Long>( fImageRatio * fImageHeight ) );
1572 }
1573 aImageSize.setHeight( static_cast<::tools::Long>(fImageHeight) );
1574
1575 Point aImagePos( pInfo->mrStartPos );
1576 aImagePos.AdjustX(aOutSize.Width() - aImageSize.Width() - aOffset.Width() ) ;
1577 aImagePos.AdjustY((aOutSize.Height() - aImageSize.Height()) / 2 );
1578
1579 pInfo->mpOutDev->DrawImage( aImagePos, aImageSize, maSlideImage );
1580
1581 const bool bVertical = mrOutliner.IsVertical();
1582 const bool bRightToLeftPara = rEditEngine.IsRightToLeft( pInfo->mnPara );
1583
1584 LanguageType eLang = rEditEngine.GetDefaultLanguage();
1585
1586 Point aTextPos( aImagePos.X() - aOffset.Width(), pInfo->mrStartPos.Y() );
1587 vcl::Font aNewFont( OutputDevice::GetDefaultFont( DefaultFontType::SANS_UNICODE, eLang, GetDefaultFontFlags::NONE ) );
1588 aNewFont.SetFontSize( aFontSz );
1589 aNewFont.SetVertical( bVertical );
1590 aNewFont.SetOrientation( Degree10(bVertical ? 2700 : 0) );
1591 aNewFont.SetColor( COL_AUTO );
1592 pInfo->mpOutDev->SetFont( aNewFont );
1593 OUString aPageText = OUString::number( nPage );
1594 Size aTextSz;
1595 aTextSz.setWidth( pInfo->mpOutDev->GetTextWidth( aPageText ) );
1596 aTextSz.setHeight( pInfo->mpOutDev->GetTextHeight() );
1597 if ( !bVertical )
1598 {
1599 aTextPos.AdjustY((aOutSize.Height() - aTextSz.Height()) / 2 );
1600 if ( !bRightToLeftPara )
1601 {
1602 aTextPos.AdjustX( -(aTextSz.Width()) );
1603 }
1604 else
1605 {
1606 aTextPos.AdjustX(aTextSz.Width() );
1607 }
1608 }
1609 else
1610 {
1611 aTextPos.AdjustY( -(aTextSz.Width()) );
1612 aTextPos.AdjustX(nBulletHeight / 2 );
1613 }
1614 pInfo->mpOutDev->DrawText( aTextPos, aPageText );
1615}
1616
1617void OutlineView::UpdateParagraph( sal_Int32 nPara )
1618{
1619 SfxItemSet aNewAttrs2( mrOutliner.GetParaAttribs( nPara ) );
1620 aNewAttrs2.Put( maLRSpaceItem );
1621 mrOutliner.SetParaAttribs( nPara, aNewAttrs2 );
1622}
1623
1625{
1626}
1627
1631{
1632 SdPage* pPage = nullptr;
1634
1635 for( sal_Int32 nPara = pInfo->nStartPara; nPara <= pInfo->nEndPara; nPara++ )
1636 {
1637 Paragraph* pPara = mrOutliner.GetParagraph( nPara );
1638
1639 bool bPage = ::Outliner::HasParaFlag( pPara, ParaFlag::ISPAGE );
1640
1641 if( !bPage )
1642 {
1643 SdStyleSheet* pStyleSheet = dynamic_cast< SdStyleSheet* >( mrOutliner.GetStyleSheet( nPara ) );
1644 if( pStyleSheet )
1645 {
1646 if ( pStyleSheet->GetApiName() == "title" )
1647 bPage = true;
1648 }
1649 }
1650
1651 if( !pPara )
1652 continue; // fatality!?
1653
1654 if( bPage && (nPara != pInfo->nStartPara) )
1655 {
1656 // insert new slide for this paragraph
1657 pPage = InsertSlideForParagraph( pPara );
1658 }
1659 else
1660 {
1661 // newly inserted non page paragraphs get the outline style
1662 if( !pPage )
1663 pPage = GetPageForParagraph( pPara );
1664
1665 if( pPage )
1666 {
1668
1669 if( !bPage )
1670 {
1671 const sal_Int16 nDepth = mrOutliner.GetDepth( nPara );
1672 if( nDepth > 0 )
1673 {
1674 OUString aStyleSheetName = pStyle->GetName();
1675 if (!aStyleSheetName.isEmpty())
1676 aStyleSheetName = aStyleSheetName.copy(0, aStyleSheetName.getLength() - 1);
1677 aStyleSheetName += OUString::number( nDepth );
1678 pStyle = static_cast<SfxStyleSheet*>( pStylePool->Find( aStyleSheetName, pStyle->GetFamily() ) );
1679 DBG_ASSERT( pStyle, "sd::OutlineView::OnEndPasteOrDrop(), Style not found!" );
1680 }
1681 }
1682
1683 mrOutliner.SetStyleSheet( nPara, pStyle );
1684 }
1685
1686 UpdateParagraph( nPara );
1687 }
1688 }
1689}
1690
1691
1693: mrView( rView )
1694{
1696}
1697
1699{
1701}
1702
1703
1705: mpView( pView )
1706{
1707 if( mpView )
1709}
1710
1712{
1713 if( mpView )
1715}
1716
1717} // end of namespace sd
1718
1719/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
@ PageOrder
One or more pages have been inserted into or deleted from the model.
@ CurrentPageChanged
The current page has changed.
SlideSorterView & mrView
AutoLayout
AUTOLAYOUT_TITLE
AUTOLAYOUT_TITLE_ONLY
AUTOLAYOUT_TAB
AUTOLAYOUT_ORG
AUTOLAYOUT_OBJ
AUTOLAYOUT_OBJTEXT
AUTOLAYOUT_NONE
AUTOLAYOUT_CHARTTEXT
AUTOLAYOUT_CHART
AUTOLAYOUT_TITLE_CONTENT
OUString aPageText
static void AddEventListener(const Link< VclSimpleEvent &, void > &rEventListener)
static void RemoveEventListener(const Link< VclSimpleEvent &, void > &rEventListener)
bool IsFlatMode() const
bool IsRightToLeft(sal_Int32 nPara) const
LanguageType GetDefaultLanguage() const
virtual SvtScriptType GetScriptType() const=0
virtual void AddDeviceToPaintView(OutputDevice &rNewDev, vcl::Window *pWindow) override
virtual void DeleteDeviceFromPaintView(OutputDevice &rOldDev) override
const EditTextObject & GetTextObject() const
void SetVertical(bool bNew)
bool IsEffectivelyVertical() const
void Paint(const tools::Rectangle &rRect, OutputDevice *pTargetDevice=nullptr)
const SfxStyleSheet * GetStyleSheet() const
void CreateSelectionList(std::vector< Paragraph * > &aSelList)
tools::Rectangle GetVisArea() const
void HideCursor(bool bDeactivate=false)
SfxItemSet GetAttribs()
void SetAttribs(const SfxItemSet &)
void ShowCursor(bool bGotoCursor=true, bool bActivate=false)
static bool HasParaFlag(const Paragraph *pPara, ParaFlag nFlag)
Paragraph * GetParagraph(sal_Int32 nAbsPos) const
sal_Int16 GetDepth(sal_Int32 nPara) const
void SetStyleSheet(sal_Int32 nPara, SfxStyleSheet *pStyle)
sal_Int16 GetPrevDepth() const
void SetDepth(Paragraph *pParagraph, sal_Int16 nNewDepth)
void SetParaAttribs(sal_Int32 nPara, const SfxItemSet &)
sal_Int32 GetAbsPos(Paragraph const *pPara) const
SfxItemSet const & GetParaAttribs(sal_Int32 nPara) const
bool UpdateFields()
static vcl::Font GetDefaultFont(DefaultFontType nType, LanguageType eLang, GetDefaultFontFlags nFlags, const OutputDevice *pOutDev=nullptr)
void SetBackground()
virtual vcl::Window * GetOwnerWindow() const
tools::Long AdjustY(tools::Long nVertMove)
tools::Long AdjustX(tools::Long nHorzMove)
constexpr tools::Long X() const
SdPage * GetSdPage(sal_uInt16 nPgNum, PageKind ePgKind) const
Definition: drawdoc2.cxx:207
SAL_DLLPRIVATE void InsertPage(SdrPage *pPage, sal_uInt16 nPos=0xFFFF) override
Definition: drawdoc2.cxx:380
SAL_DLLPRIVATE void SetSelected(SdPage *pPage, bool bSelect)
Definition: drawdoc2.cxx:461
SAL_DLLPRIVATE rtl::Reference< SdPage > AllocSdPage(bool bMasterPage)
Definition: drawdoc.cxx:644
sal_uInt16 GetSdPageCount(PageKind ePgKind) const
Definition: drawdoc2.cxx:212
The main purpose of this class is searching and replacing as well as spelling of impress documents.
Definition: Outliner.hxx:123
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
SfxStyleSheet * GetStyleSheetForPresObj(PresObjKind eObjKind) const
Definition: sdpage.cxx:625
::tools::Rectangle GetLayoutRect() const
Definition: sdpage.cxx:1162
bool IsSelected() const
Definition: sdpage.hxx:208
void SetAutoLayout(AutoLayout eLayout, bool bInit=false, bool bCreate=false)
Definition: sdpage.cxx:1610
void SetSelected(bool bSel)
Definition: sdpage.hxx:207
virtual OUString GetLayoutName() const override
Definition: sdpage.hxx:255
SdrObject * InsertAutoLayoutShape(SdrObject *pObj, PresObjKind eObjKind, bool bVertical, const ::tools::Rectangle &rRect, bool bInit)
reuses or creates a presentation shape for an auto layout that fits the given parameter
Definition: sdpage.cxx:2194
::tools::Rectangle GetTitleRect() const
Definition: sdpage.cxx:1076
AutoLayout GetAutoLayout() const
Definition: sdpage.hxx:190
OUString const & GetApiName() const
Definition: stlsheet.cxx:161
void AddUndo(std::unique_ptr< SdrUndoAction > pUndo)
void BegUndo()
void EndUndo()
SfxStyleSheetBasePool * GetStyleSheetPool() const
SdrUndoFactory & GetSdrUndoFactory() const
virtual SvtScriptType GetScriptType() const
SdrObject * GetObj(size_t nNum) const
size_t GetObjCount() const
bool IsEmptyPresObj() const
SdrPage & TRG_GetMasterPage() const
sal_uInt16 GetPageNum() const
Size GetSize() const
sal_Int32 GetUpperBorder() const
sal_Int32 GetRightBorder() const
sal_Int32 GetLeftBorder() const
sal_Int32 GetLowerBorder() const
virtual OutlinerParaObject * GetOutlinerParaObject() const override
virtual std::unique_ptr< SdrUndoAction > CreateUndoNewPage(SdrPage &rPage)
const css::uno::Reference< css::frame::XFrame > & GetFrameInterface() const
SfxItemState GetItemState(sal_uInt16 nWhich, bool bSrchInParent=true, const SfxPoolItem **ppItem=nullptr) const
const SfxPoolItem * GetItem(sal_uInt16 nWhich, bool bSearchInParent=true) const
const SfxPoolItem * Put(const SfxPoolItem &rItem, sal_uInt16 nWhich)
SfxViewFrame * GetFrame() const
virtual void Invalidate(sal_uInt16 nId=0)
virtual SfxStyleSheetBase * Find(const OUString &, SfxStyleFamily eFam, SfxStyleSearchBits n=SfxStyleSearchBits::All)
const OUString & GetName() const
SfxStyleFamily GetFamily() const
void RemoveLastUndoAction()
virtual size_t GetUndoActionCount(bool const i_currentLevel=CurrentLevel) const
SfxUndoAction * GetUndoAction(size_t nNo=0) const
SfxFrame & GetFrame() const
ViewShellId GetViewShellId() const override
constexpr tools::Long Height() const
void setWidth(tools::Long nWidth)
void setHeight(tools::Long nHeight)
constexpr tools::Long Width() const
static bool GetIsAutomaticFontColor()
virtual SfxUndoManager * GetUndoManager() override
Definition: docshell.cxx:363
OutlineViewModelChangeGuard(OutlineView &rView)
Definition: outlview.cxx:1692
~OutlineViewModelChangeGuard() COVERITY_NOEXCEPT_FALSE
Definition: outlview.cxx:1698
OutlineViewPageChangesGuard(OutlineView *pView)
Definition: outlview.cxx:1704
Show a textual overview of the text contents of all slides.
void UpdateTitleObject(SdPage *pPage, Paragraph const *pPara)
Definition: outlnvsh.cxx:1560
void UpdateOutlineObject(SdPage *pPage, Paragraph *pPara)
Definition: outlnvsh.cxx:1640
Derivative of sd::View for the outline mode |* .
Definition: OutlineView.hxx:55
void FillOutliner()
creates outliner model from draw model
Definition: outlview.cxx:1000
SvxLRSpaceItem maLRSpaceItem
void ConnectToApplication()
This method is called by the view shell that owns the view to tell the view that it can safely connec...
Definition: outlview.cxx:162
OutlineViewShell & mrOutlineViewShell
void BeginModelChange()
call this method before you do anything that can modify the outliner and or the drawing document mode...
Definition: outlview.cxx:1398
static SdrTextObj * CreateTitleTextObject(SdPage *pPage)
Definition: outlview.cxx:897
SdPage * GetPageForParagraph(Paragraph *pPara)
Definition: outlview.cxx:1157
void ResetLinks() const
Restore old links.
Definition: outlview.cxx:1291
sal_uLong mnPaperWidth
void SetSelectedPages()
Mark pages as selected / not selected.
Definition: outlview.cxx:1230
virtual ~OutlineView() override
Destructor, restore Links, clear Outliner.
Definition: outlview.cxx:129
SdPage * InsertSlideForParagraph(Paragraph *pPara)
creates and inserts an empty slide for the given paragraph.
Definition: outlview.cxx:345
void EndModelChange()
call this method after BeginModelChange(), when all possible model changes are done.
Definition: outlview.cxx:1406
void IgnoreCurrentPageChanges(bool bIgnore)
After this method has been called with <TRUE> following changes of the current page are ignored in th...
Definition: outlview.cxx:1388
virtual void GetAttributes(SfxItemSet &rTargetSet, bool bOnlyHardAttr=false) const override
Get attributes of the selected text.
Definition: outlview.cxx:990
Paragraph * GetParagraphForPage(::Outliner const &rOutl, SdPage const *pPage)
Definition: outlview.cxx:1176
Paragraph * GetPrevTitle(const Paragraph *pPara)
Return the title before a random paragraph.
Definition: outlview.cxx:281
Color maDocColor
stores the last used document color.
static SdrTextObj * CreateOutlineTextObject(SdPage *pPage)
Definition: outlview.cxx:916
OutlinerView * GetViewByWindow(vcl::Window const *pWin) const
Return a pointer to the OutlinerView corresponding to the window.
Definition: outlview.cxx:262
void PrepareClose()
updates draw model with all changes from outliner model
Definition: outlview.cxx:953
void SetActualPage(SdPage const *pActual)
selects the paragraph for the given page at the outliner view
Definition: outlview.cxx:1205
Paragraph * GetNextTitle(const Paragraph *pPara)
Return the title after a random paragraph.
Definition: outlview.cxx:303
virtual void OnBeginPasteOrDrop(PasteOrDropInfos *pInfo) override
Definition: outlview.cxx:1624
virtual void AddDeviceToPaintView(OutputDevice &rDev, vcl::Window *pWindow) override
Definition: outlview.cxx:196
void Paint(const ::tools::Rectangle &rRect, ::sd::Window const *pWin)
Definition: outlview.cxx:181
SfxStyleSheet * GetStyleSheet() const override
Get StyleSheet from the selection.
Definition: outlview.cxx:1219
SdPage * GetActualPage()
returns the first slide that is selected in the outliner or where the cursor is located
Definition: outlview.cxx:1135
void UpdateParagraph(sal_Int32 nPara)
Definition: outlview.cxx:1617
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: outlview.cxx:1630
void onUpdateStyleSettings(bool bForceUpdate)
updates the high contrast settings and document color if they changed.
Definition: outlview.cxx:1330
virtual bool SetAttributes(const SfxItemSet &rSet, bool bReplaceAll=false, bool bSlide=false, bool bMaster=false) override
Set attributes of the selected text.
Definition: outlview.cxx:970
virtual sal_Int8 AcceptDrop(const AcceptDropEvent &rEvt, DropTargetHelper &rTargetHelper, SdrLayerID nLayer) override
Definition: outlview.cxx:1306
virtual sal_Int8 ExecuteDrop(const ExecuteDropEvent &rEvt, ::sd::Window *pTargetWindow, sal_uInt16 nPage, SdrLayerID nLayer) override
Definition: outlview.cxx:1311
void SetLinks()
Set new links.
Definition: outlview.cxx:1270
OutlineView(DrawDocShell &rDocSh, vcl::Window *pWindow, OutlineViewShell &rOutlineViewSh)
Definition: outlview.cxx:72
static SdrTextObj * GetOutlineTextObject(SdrPage const *pPage)
Look for the outline text object in one page of the model.
Definition: outlview.cxx:879
std::unique_ptr< OutlinerView > mpOutlinerViews[MAX_OUTLINERVIEWS]
void TryToMergeUndoActions()
merge edit engine undo actions if possible
Definition: outlview.cxx:1461
virtual void DeleteDeviceFromPaintView(OutputDevice &rDev) override
Definition: outlview.cxx:233
void DisconnectFromApplication()
Definition: outlview.cxx:176
SdrOutliner & mrOutliner
void UpdateDocument()
updates all changes in the outliner model to the draw model
Definition: outlview.cxx:1428
virtual SvtScriptType GetScriptType() const override
Definition: outlview.cxx:1317
std::unique_ptr< OutlineViewModelChangeGuard, o3tl::default_delete< OutlineViewModelChangeGuard > > maDragAndDropModelGuard
holds a model guard during drag and drop between BeginMovingHdl and EndMovingHdl
std::unique_ptr< SfxProgress > mpProgress
static SdrTextObj * GetTitleTextObject(SdrPage const *pPage)
Look for the title text object in one page of the model.
Definition: outlview.cxx:858
void SetLinkedUndoManager(SfxUndoManager *pLinkedUndoManager)
Set or reset the undo manager linked with the called undo manager.
Definition: undomanager.cxx:47
std::shared_ptr< tools::EventMultiplexer > const & GetEventMultiplexer() const
Return an event multiplexer.
std::shared_ptr< ViewShellManager > const & GetViewShellManager() const
::sd::Window * GetActiveWindow() const
The active window is usually the mpContentWindow.
Definition: ViewShell.hxx:155
SD_DLLPUBLIC ViewShellBase & GetViewShellBase() const
Definition: viewshel.cxx:1397
bool isRecordingUndo() const
returns true if we have an undo manager and there is an open list undo action
Definition: sdview.cxx:1104
DrawDocShell * mpDocSh
Definition: View.hxx:262
SdDrawDocument & mrDoc
Definition: View.hxx:261
SdDrawDocument & GetDoc() const
Definition: View.hxx:293
An SdWindow contains the actual working area of ViewShell.
Definition: Window.hxx:45
void GrabFocus()
Activate window.
Definition: sdwindow.cxx:750
const Size & GetViewSize() const
Definition: Window.hxx:112
ColorConfigValue GetColorValue(ColorConfigEntry eEntry, bool bSmart=true) const
constexpr Point TopLeft() const
constexpr Size GetSize() const
constexpr void SetBottom(tools::Long v)
constexpr tools::Long GetHeight() const
constexpr tools::Long Bottom() const
constexpr bool IsEmpty() const
void SetFontSize(const Size &)
void SetOrientation(Degree10 nLineOrientation)
void SetVertical(bool bVertical)
void SetColor(const Color &)
vcl::Window * GetWindow(GetWindowType nType) const
::OutputDevice const * GetOutDev() const
Point PixelToLogic(const Point &rDevicePt) const
Size GetOutputSizePixel() const
void Invalidate(InvalidateFlags nFlags=InvalidateFlags::NONE)
void SetBackground()
constexpr ::Color COL_WHITE(0xFF, 0xFF, 0xFF)
constexpr ::Color COL_AUTO(ColorTransparency, 0xFF, 0xFF, 0xFF, 0xFF)
int nCount
#define DBG_ASSERT(sCon, aError)
const size_t EE_APPEND
EEControlBits
constexpr TypedWhichId< SvxLRSpaceItem > EE_PARA_OUTLLRSPACE(EE_PARA_START+10)
constexpr TypedWhichId< SvxNumBulletItem > EE_PARA_NUMBULLET(EE_PARA_START+5)
EmbeddedObjectRef * pObject
void * p
sal_Int64 n
SvtScriptType
sal_uInt16 nPos
const int MAX_OUTLINERVIEWS
Definition: OutlineView.hxx:46
IMPL_LINK_NOARG(MainSequence, onTimerHdl, Timer *, void)
IMPL_LINK(SdCharHeightPropertyBox, implMenuSelectHdl, const OUString &, rIdent, void)
css::uno::Reference< css::linguistic2::XProofreadingIterator > get(css::uno::Reference< css::uno::XComponentContext > const &context)
long Long
Image GetImageForCommand(const OUString &rsCommandName, const Reference< frame::XFrame > &rxFrame, vcl::ImageType eImageType)
#define PROCESS_WITH_PROGRESS_THRESHOLD
Definition: outlview.cxx:70
OUString SdResId(TranslateId aId)
Definition: sdmod.cxx:83
#define SD_MOD()
Definition: sdmod.hxx:184
static SfxItemSet & rSet
UnoViewSharedPtr mpView
sal_uIntPtr sal_uLong
sal_Int32 nStartPara
std::vector< MarkedUndoAction > maUndoActions
void Insert(std::unique_ptr< SfxUndoAction > i_action, size_t i_pos)
std::unique_ptr< SfxUndoAction > Remove(int idx)
SfxUndoAction * GetUndoAction(size_t idx)
size_t nCurUndoAction
Reference< XFrame > xFrame
#define DND_ACTION_NONE
signed char sal_Int8