LibreOffice Module sd (master) 1
sdmod1.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 <svl/lckbitem.hxx>
21#include <svl/intitem.hxx>
22#include <sfx2/frame.hxx>
23#include <sfx2/viewfrm.hxx>
26#include <osl/diagnose.h>
27#include <vcl/commandevent.hxx>
28#include <vcl/svapp.hxx>
29#include <vcl/errinf.hxx>
30#include <editeng/langitem.hxx>
31#include <vcl/weld.hxx>
32#include <sfx2/dispatch.hxx>
33#include <sfx2/docfile.hxx>
34#include <sfx2/request.hxx>
35#include <sfx2/templatedlg.hxx>
36#include <editeng/eeitem.hxx>
37
38#include <svx/svxids.hrc>
39#include <strings.hrc>
40
41#include <sdmod.hxx>
42#include <pres.hxx>
43#include <optsitem.hxx>
44#include <ViewShell.hxx>
45#include <DrawDocShell.hxx>
46#include <drawdoc.hxx>
47#include <sdresid.hxx>
48#include <OutlineView.hxx>
49#include <OutlineViewShell.hxx>
50#include <ViewShellBase.hxx>
51#include <FactoryIds.hxx>
52#include <memory>
53#include <slideshow.hxx>
54
55using ::sd::framework::FrameworkHelper;
56using ::com::sun::star::uno::Reference;
57using ::com::sun::star::frame::XFrame;
58
59namespace {
60
61class OutlineToImpressFinalizer final
62{
63public:
64 OutlineToImpressFinalizer (
66 SdDrawDocument& rDocument,
67 SvLockBytes const & rBytes);
68 void operator() (bool bEventSeen);
69private:
70 ::sd::ViewShellBase& mrBase;
71 SdDrawDocument& mrDocument;
72 std::shared_ptr<SvMemoryStream> mpStream;
73};
74
75} //end of anonymous namespace
76
78{
79 const SfxItemSet* pSet = rReq.GetArgs();
80 sal_uInt16 nSlotId = rReq.GetSlot();
81
82 switch ( nSlotId )
83 {
84 case SID_NEWDOC:
85 {
87 }
88 break;
89
90 case SID_AUTOSPELL_CHECK:
91 {
92 // automatic spell checker
93 const SfxBoolItem* pItem;
94 if( pSet && (pItem = pSet->GetItemIfSet( SID_AUTOSPELL_CHECK, false ) ) )
95 {
96 bool bOnlineSpelling = pItem->GetValue();
97 // save at document:
98 ::sd::DrawDocShell* pDocSh = dynamic_cast< ::sd::DrawDocShell *>( SfxObjectShell::Current() );
99 if( pDocSh )
100 {
101 SdDrawDocument* pDoc = pDocSh->GetDoc();
102 pDoc->SetOnlineSpell( bOnlineSpelling );
103 }
104 }
105 }
106 break;
107
108 case SID_ATTR_METRIC:
109 {
110 const SfxUInt16Item* pItem;
111 if ( pSet && (pItem = pSet->GetItemIfSet( SID_ATTR_METRIC ) ) )
112 {
113 FieldUnit eUnit = static_cast<FieldUnit>(pItem->GetValue());
114 switch( eUnit )
115 {
116 case FieldUnit::MM: // only the units which are also in the dialog
117 case FieldUnit::CM:
118 case FieldUnit::INCH:
119 case FieldUnit::PICA:
120 case FieldUnit::POINT:
121 {
122 ::sd::DrawDocShell* pDocSh = dynamic_cast< ::sd::DrawDocShell *>( SfxObjectShell::Current() );
123 if(pDocSh)
124 {
125 DocumentType eDocType = pDocSh->GetDoc()->GetDocumentType();
126
127 PutItem( *pItem );
128 SdOptions* pOptions = GetSdOptions( eDocType );
129 if(pOptions)
130 pOptions->SetMetric( static_cast<sal_uInt16>(eUnit) );
131 rReq.Done();
132 }
133 }
134 break;
135 default:
136 break;
137 }
138 }
139
140 }
141 break;
142
143 case SID_ATTR_LANGUAGE:
144 case SID_ATTR_CHAR_CJK_LANGUAGE:
145 case SID_ATTR_CHAR_CTL_LANGUAGE:
146 {
147 const SfxPoolItem* pItem;
148 if( pSet &&
149 (
150 SfxItemState::SET == pSet->GetItemState(SID_ATTR_LANGUAGE, false, &pItem ) ||
151 SfxItemState::SET == pSet->GetItemState(SID_ATTR_CHAR_CJK_LANGUAGE, false, &pItem ) ||
152 SfxItemState::SET == pSet->GetItemState(SID_ATTR_CHAR_CTL_LANGUAGE, false, &pItem )
153 )
154 )
155 {
156 // save at the document:
157 ::sd::DrawDocShell* pDocSh = dynamic_cast< ::sd::DrawDocShell *>( SfxObjectShell::Current() );
158 if ( pDocSh )
159 {
160 LanguageType eLanguage = static_cast<const SvxLanguageItem*>(pItem)->GetValue();
161 SdDrawDocument* pDoc = pDocSh->GetDoc();
162
163 if( nSlotId == SID_ATTR_CHAR_CJK_LANGUAGE )
164 pDoc->SetLanguage( eLanguage, EE_CHAR_LANGUAGE_CJK );
165 else if( nSlotId == SID_ATTR_CHAR_CTL_LANGUAGE )
166 pDoc->SetLanguage( eLanguage, EE_CHAR_LANGUAGE_CTL );
167 else
168 pDoc->SetLanguage( eLanguage, EE_CHAR_LANGUAGE );
169
170 if( pDoc->GetOnlineSpell() )
171 {
172 pDoc->StopOnlineSpelling();
173 pDoc->StartOnlineSpelling();
174 }
175 }
176 }
177 }
178 break;
179
180 case SID_NEWSD:
181 {
182 SfxFrame* pFrame = ExecuteNewDocument( rReq );
183 // if a frame was created, set it as return value
184 if(pFrame)
185 rReq.SetReturnValue(SfxFrameItem(0, pFrame));
186 }
187
188 break;
189
190 case SID_OPENHYPERLINK:
191 case SID_OPENDOC:
192 {
193 bool bIntercept = false;
194 ::sd::DrawDocShell* pDocShell = dynamic_cast< ::sd::DrawDocShell *>( SfxObjectShell::Current() );
195 if (pDocShell)
196 {
197 ::sd::ViewShell* pViewShell = pDocShell->GetViewShell();
198 if (pViewShell)
199 {
200 if( sd::SlideShow::IsRunning( pViewShell->GetViewShellBase() ) )
201 {
202 // Prevent documents from opening while the slide
203 // show is running, except when this request comes
204 // from a shape interaction.
205 if (rReq.GetArgs() == nullptr)
206 {
207 bIntercept = true;
208 }
209 }
210 }
211 }
212
213 if (!bIntercept)
214 {
216 }
217 else
218 {
219 std::unique_ptr<weld::MessageDialog> xErrorBox(Application::CreateMessageDialog(nullptr,
220 VclMessageType::Warning, VclButtonsType::Ok, SdResId(STR_CANT_PERFORM_IN_LIVEMODE)));
221
222 xErrorBox->run();
223
224 const SfxLinkItem* pLinkItem = rReq.GetArg<SfxLinkItem>(SID_DONELINK);
225 if( pLinkItem )
226 pLinkItem->GetValue().Call( nullptr );
227 }
228 }
229 break;
230
231 case SID_OUTLINE_TO_IMPRESS:
232 OutlineToImpress (rReq);
233 break;
234
235 default:
236 break;
237 }
238}
239
241{
242 const SfxItemSet* pSet = rRequest.GetArgs();
243
244 if (pSet)
245 {
246 SvLockBytes* pBytes = static_cast<const SfxLockBytesItem&>(pSet->Get(SID_OUTLINE_TO_IMPRESS)).GetValue();
247
248 if (pBytes)
249 {
250 SfxObjectShellLock xDocShell;
251 ::sd::DrawDocShell* pDocSh;
252 xDocShell = pDocSh = new ::sd::DrawDocShell(
253 SfxObjectCreateMode::STANDARD, false, DocumentType::Impress);
254
255 pDocSh->DoInitNew();
256 SdDrawDocument* pDoc = pDocSh->GetDoc();
257 if(pDoc)
258 {
259 pDoc->CreateFirstPages();
260 pDoc->StopWorkStartupDelay();
261 }
262
263 const SfxFrameItem* pFrmItem = rRequest.GetArg<SfxFrameItem>(SID_DOCFRAME);
265
266 ::sd::ViewShell* pViewSh = pDocSh->GetViewShell();
267
268 if (pViewSh && pDoc)
269 {
270 // AutoLayouts have to be finished
271 pDoc->StopWorkStartupDelay();
272
273 SfxViewFrame* pViewFrame = pViewSh->GetViewFrame();
274
275 // When the view frame has not been just created we have
276 // to switch synchronously to the outline view.
277 // (Otherwise the request will be ignored anyway.)
279 = dynamic_cast< ::sd::ViewShellBase*>(pViewFrame->GetViewShell());
280 if (pBase != nullptr)
281 {
282 std::shared_ptr<FrameworkHelper> pHelper (
283 FrameworkHelper::Instance(*pBase));
284 pHelper->RequestView(
285 FrameworkHelper::msOutlineViewURL,
286 FrameworkHelper::msCenterPaneURL);
287
288 pHelper->RunOnResourceActivation(
289 FrameworkHelper::CreateResourceId(
290 FrameworkHelper::msOutlineViewURL,
291 FrameworkHelper::msCenterPaneURL),
292 OutlineToImpressFinalizer(*pBase, *pDoc, *pBytes));
293 }
294 }
295 }
296 }
297
298 return rRequest.IsDone();
299}
300
302{
303 if( SfxItemState::DEFAULT == rItemSet.GetItemState( SID_ATTR_METRIC ) )
304 {
305 ::sd::DrawDocShell* pDocSh = dynamic_cast< ::sd::DrawDocShell *>( SfxObjectShell::Current() );
306 if(pDocSh)
307 {
308 DocumentType eDocType = pDocSh->GetDoc()->GetDocumentType();
309
310 SdOptions* pOptions = GetSdOptions(eDocType);
311 rItemSet.Put( SfxUInt16Item( SID_ATTR_METRIC, pOptions->GetMetric() ) );
312 }
313 }
314
315 // state of SID_OPENDOC is determined by the base class
316 if (rItemSet.GetItemState(SID_OPENDOC) != SfxItemState::UNKNOWN)
317 {
318 const SfxPoolItem* pItem = SfxGetpApp()->GetSlotState(SID_OPENDOC, SfxGetpApp()->GetInterface());
319 if (pItem)
320 rItemSet.Put(*pItem);
321 }
322
323 // state of SID_OPENHYPERLINK is determined by the base class
324 if (rItemSet.GetItemState(SID_OPENHYPERLINK) != SfxItemState::UNKNOWN)
325 {
326 const SfxPoolItem* pItem = SfxGetpApp()->GetSlotState(SID_OPENHYPERLINK, SfxGetpApp()->GetInterface());
327 if (pItem)
328 rItemSet.Put(*pItem);
329 }
330
331 if( SfxItemState::DEFAULT == rItemSet.GetItemState( SID_AUTOSPELL_CHECK ) )
332 {
333 ::sd::DrawDocShell* pDocSh =
334 dynamic_cast< ::sd::DrawDocShell *>( SfxObjectShell::Current() );
335 if( pDocSh )
336 {
337 SdDrawDocument* pDoc = pDocSh->GetDoc();
338 rItemSet.Put( SfxBoolItem( SID_AUTOSPELL_CHECK, pDoc->GetOnlineSpell() ) );
339 }
340 }
341
342 if( SfxItemState::DEFAULT == rItemSet.GetItemState( SID_ATTR_LANGUAGE ) )
343 {
344 ::sd::DrawDocShell* pDocSh = dynamic_cast< ::sd::DrawDocShell *>( SfxObjectShell::Current() );
345 if( pDocSh )
346 rItemSet.Put( SvxLanguageItem( pDocSh->GetDoc()->GetLanguage( EE_CHAR_LANGUAGE ), SID_ATTR_LANGUAGE ) );
347 }
348
349 if( SfxItemState::DEFAULT == rItemSet.GetItemState( SID_ATTR_CHAR_CJK_LANGUAGE ) )
350 {
351 ::sd::DrawDocShell* pDocSh = dynamic_cast< ::sd::DrawDocShell *>( SfxObjectShell::Current() );
352 if( pDocSh )
353 rItemSet.Put( SvxLanguageItem( pDocSh->GetDoc()->GetLanguage( EE_CHAR_LANGUAGE_CJK ), SID_ATTR_CHAR_CJK_LANGUAGE ) );
354 }
355
356 if( SfxItemState::DEFAULT == rItemSet.GetItemState( SID_ATTR_CHAR_CTL_LANGUAGE ) )
357 {
358 ::sd::DrawDocShell* pDocSh = dynamic_cast< ::sd::DrawDocShell *>( SfxObjectShell::Current() );
359 if( pDocSh )
360 rItemSet.Put( SvxLanguageItem( pDocSh->GetDoc()->GetLanguage( EE_CHAR_LANGUAGE_CTL ), SID_ATTR_CHAR_CTL_LANGUAGE ) );
361 }
362
364 return;
365
366 ::sd::DrawDocShell* pDocShell = dynamic_cast< ::sd::DrawDocShell *>( SfxObjectShell::Current() );
367 if( pDocShell ) // Impress or Draw ?
368 {
369 ::sd::ViewShell* pViewShell = pDocShell->GetViewShell();
370
371 if( pViewShell && (pDocShell->GetDocumentType() == DocumentType::Impress) )
372 {
373 // add our event listener as soon as possible
374 Application::AddEventListener( LINK( this, SdModule, EventListenerHdl ) );
376 }
377 }
378}
379
380IMPL_STATIC_LINK( SdModule, EventListenerHdl, VclSimpleEvent&, rSimpleEvent, void )
381{
382 if( !((rSimpleEvent.GetId() == VclEventId::WindowCommand) && static_cast<VclWindowEvent*>(&rSimpleEvent)->GetData()) )
383 return;
384
385 const CommandEvent& rEvent = *static_cast<const CommandEvent*>(static_cast<VclWindowEvent*>(&rSimpleEvent)->GetData());
386
387 if( rEvent.GetCommand() != CommandEventId::Media )
388 return;
389
390 CommandMediaData* pMediaData = rEvent.GetMediaData();
391 pMediaData->SetPassThroughToOS(false);
392 switch (pMediaData->GetMediaId())
393 {
394 case MediaCommand::Play:
395 {
396 ::sd::DrawDocShell* pDocShell = dynamic_cast< ::sd::DrawDocShell *>( SfxObjectShell::Current() );
397 if( pDocShell ) // Impress or Draw ?
398 {
399 ::sd::ViewShell* pViewShell = pDocShell->GetViewShell();
400
401 // #i97925# start the presentation if and only if an Impress document is focused
402 if( pViewShell && (pDocShell->GetDocumentType() == DocumentType::Impress) )
403 pViewShell->GetViewFrame()->GetDispatcher()->Execute( SID_PRESENTATION );
404 }
405 break;
406 }
407 default:
408 pMediaData->SetPassThroughToOS(true);
409 break;
410 }
411}
412
413
414SfxFrame* SdModule::CreateFromTemplate(const OUString& rTemplatePath, const Reference<XFrame>& i_rFrame,
415 const bool bReplaceable)
416{
417 SfxFrame* pFrame = nullptr;
418
419 SfxObjectShellLock xDocShell;
420
421 std::unique_ptr<SfxItemSet> pSet(new SfxAllItemSet( SfxGetpApp()->GetPool() ));
422 pSet->Put( SfxBoolItem( SID_TEMPLATE, true ) );
423
424 ErrCode lErr = SfxGetpApp()->LoadTemplate( xDocShell, rTemplatePath, std::move(pSet) );
425
426 SfxObjectShell* pDocShell = xDocShell;
427
428 if( lErr )
429 {
431 }
432 else if( pDocShell )
433 {
434 if (pDocShell->GetMedium())
435 pDocShell->GetMedium()->GetItemSet().Put(SfxBoolItem(SID_REPLACEABLE, bReplaceable));
436 SfxViewFrame* pViewFrame = SfxViewFrame::LoadDocumentIntoFrame( *pDocShell, i_rFrame );
437 OSL_ENSURE( pViewFrame, "SdModule::CreateFromTemplate: no view frame - was the document really loaded?" );
438 pFrame = pViewFrame ? &pViewFrame->GetFrame() : nullptr;
439 }
440
441 return pFrame;
442
443}
444
446{
447 SfxFrame* pFrame = nullptr;
448 if ( SvtModuleOptions().IsImpress() )
449 {
450 Reference< XFrame > xTargetFrame;
451 const SfxUnoFrameItem* pFrmItem = rReq.GetArg<SfxUnoFrameItem>(SID_FILLFRAME);
452 if ( pFrmItem )
453 xTargetFrame = pFrmItem->GetFrame();
454
456 bool bStartWithTemplate = pOpt->IsStartWithTemplate();
457
458 bool bNewDocDirect = rReq.GetSlot() == SID_NEWSD;
459
460 if( bNewDocDirect )
461 {
462 //we start without wizard
463
464 //check whether we should load a template document
465 OUString aStandardTemplate( SfxObjectFactory::GetStandardTemplate( u"com.sun.star.presentation.PresentationDocument" ) );
466
467 if( !aStandardTemplate.isEmpty() )
468 {
469 //load a template document
470 pFrame = CreateFromTemplate(aStandardTemplate, xTargetFrame, true);
471 }
472 else
473 {
474 //create an empty document
475 pFrame = CreateEmptyDocument( xTargetFrame );
476 }
477 }
478
479 if (bStartWithTemplate)
480 {
481 //Launch TemplateSelectionDialog
482 SfxTemplateSelectionDlg aTemplDlg(SfxGetpApp()->GetTopWindow());
483 aTemplDlg.run();
484
485 //check to disable the dialog
486 pOpt->SetStartWithTemplate( aTemplDlg.IsStartWithTemplate() );
487
488 //pFrame is loaded with the desired template
489 if (!aTemplDlg.getTemplatePath().isEmpty())
490 pFrame = CreateFromTemplate(aTemplDlg.getTemplatePath(), xTargetFrame, false);
491
492 // show tip-of-the-day dialog if it was deferred because SfxTemplateSelectionDlg
493 // was open
495 {
496 if (SfxDispatcher* pDispatcher = GetDispatcher())
497 {
498 // tdf#127946 pass in argument for dialog parent
499 SfxUnoFrameItem aDocFrame(SID_FILLFRAME, pFrame->GetFrameInterface());
500 pDispatcher->ExecuteList(SID_TIPOFTHEDAY, SfxCallMode::SLOT, {}, { &aDocFrame });
501 }
502 }
503 }
504 }
505
506 return pFrame;
507}
508
509SfxFrame* SdModule::CreateEmptyDocument( const Reference< XFrame >& i_rFrame )
510{
511 SfxFrame* pFrame = nullptr;
512
513 SfxObjectShellLock xDocShell;
514 ::sd::DrawDocShell* pNewDocSh;
515 xDocShell = pNewDocSh = new ::sd::DrawDocShell(SfxObjectCreateMode::STANDARD,false,DocumentType::Impress);
516 pNewDocSh->DoInitNew();
517 SdDrawDocument* pDoc = pNewDocSh->GetDoc();
518 if (pDoc)
519 {
520 pDoc->CreateFirstPages();
521 pDoc->StopWorkStartupDelay();
522 }
523 if (pNewDocSh->GetMedium())
524 pNewDocSh->GetMedium()->GetItemSet().Put(SfxBoolItem(SID_REPLACEABLE, true));
525
526 SfxViewFrame* pViewFrame = SfxViewFrame::LoadDocumentIntoFrame( *pNewDocSh, i_rFrame );
527 OSL_ENSURE( pViewFrame, "SdModule::CreateEmptyDocument: no view frame - was the document really loaded?" );
528 pFrame = pViewFrame ? &pViewFrame->GetFrame() : nullptr;
529
530 return pFrame;
531}
532
533//===== OutlineToImpressFinalize ==============================================
534
535namespace {
536
537OutlineToImpressFinalizer::OutlineToImpressFinalizer (
538 ::sd::ViewShellBase& rBase,
539 SdDrawDocument& rDocument,
540 SvLockBytes const & rBytes)
541 : mrBase(rBase),
542 mrDocument(rDocument)
543{
544 // The given stream has a lifetime shorter than this new
545 // OutlineToImpressFinalizer object. Therefore a local copy of the
546 // stream is created.
547 const SvStream* pStream (rBytes.GetStream());
548 if (pStream == nullptr)
549 return;
550
551 // Create a memory stream and prepare to fill it with the content of
552 // the original stream.
553 mpStream = std::make_shared<SvMemoryStream>();
554 static const std::size_t nBufferSize = 4096;
555 ::std::unique_ptr<sal_Int8[]> pBuffer (new sal_Int8[nBufferSize]);
556
557 sal_uInt64 nReadPosition(0);
558 bool bLoop (true);
559 while (bLoop)
560 {
561 // Read the next part of the original stream.
562 std::size_t nReadByteCount (0);
563 const ErrCode nErrorCode (
564 rBytes.ReadAt(
565 nReadPosition,
566 pBuffer.get(),
567 nBufferSize,
568 &nReadByteCount));
569
570 // Check the error code and stop copying the stream data when an
571 // error has occurred.
572 if (nErrorCode == ERRCODE_NONE)
573 {
574 if (nReadByteCount == 0)
575 bLoop = false;
576 }
577 else if (nErrorCode == ERRCODE_IO_PENDING)
578 ;
579 else
580 {
581 bLoop = false;
582 nReadByteCount = 0;
583 }
584
585 // Append the read bytes to the end of the memory stream.
586 if (nReadByteCount > 0)
587 {
588 mpStream->WriteBytes(pBuffer.get(), nReadByteCount);
589 nReadPosition += nReadByteCount;
590 }
591 }
592
593 // Rewind the memory stream so that in the operator() method its
594 // content is properly read.
595 mpStream->Seek(STREAM_SEEK_TO_BEGIN);
596}
597
598void OutlineToImpressFinalizer::operator() (bool)
599{
600 // Fetch the new outline view shell.
601 ::sd::OutlineViewShell* pOutlineShell
602 = dynamic_cast<sd::OutlineViewShell*>(FrameworkHelper::Instance(mrBase)->GetViewShell(FrameworkHelper::msCenterPaneURL).get());
603
604 if (pOutlineShell != nullptr && mpStream != nullptr)
605 {
606 sd::OutlineView* pView = static_cast<sd::OutlineView*>(pOutlineShell->GetView());
607 // mba: the stream can't contain any relative URLs, because we don't
608 // have any information about a BaseURL!
609 pOutlineShell->ReadRtf(*mpStream);
610
611 // Call UpdatePreview once for every slide to resync the
612 // document with the outliner of the OutlineViewShell.
613 sal_uInt16 nPageCount (mrDocument.GetSdPageCount(PageKind::Standard));
614 for (sal_uInt16 nIndex=0; nIndex<nPageCount; nIndex++)
615 {
616 SdPage* pPage = mrDocument.GetSdPage(nIndex, PageKind::Standard);
617 // Make the page the actual page so that the
618 // following UpdatePreview() call accesses the
619 // correct paragraphs.
620 pView->SetActualPage(pPage);
621 pOutlineShell->UpdatePreview(pPage);
622 }
623 // Select the first slide.
624 SdPage* pPage = mrDocument.GetSdPage(0, PageKind::Standard);
625 pView->SetActualPage(pPage);
626 pOutlineShell->UpdatePreview(pPage);
627 }
628
629 // Undo-Stack needs to be cleared, else the user may remove the
630 // only drawpage and this is a state we cannot handle ATM.
631 ::sd::DrawDocShell* pDocShell = mrDocument.GetDocSh();
632 if( pDocShell )
633 pDocShell->ClearUndoBuffer();
634}
635
636} // end of anonymous namespace
637
638/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
SfxApplication * SfxGetpApp()
static void AddEventListener(const Link< VclSimpleEvent &, void > &rEventListener)
static weld::MessageDialog * CreateMessageDialog(weld::Widget *pParent, VclMessageType eMessageType, VclButtonsType eButtonType, const OUString &rPrimaryMessage, const ILibreOfficeKitNotifier *pNotifier=nullptr)
sal_uInt16 GetValue() const
CommandEventId GetCommand() const
CommandMediaData * GetMediaData() const
MediaCommand GetMediaId() const
void SetPassThroughToOS(bool bPassThroughToOS)
static DialogMask HandleError(ErrCode nId, weld::Window *pParent=nullptr, DialogMask nMask=DialogMask::MAX)
void CreateFirstPages(SdDrawDocument const *pRefDocument=nullptr)
if the document does not contain at least one handout, one slide and one notes page with at least one...
Definition: drawdoc2.cxx:493
SAL_DLLPRIVATE void StopOnlineSpelling()
Definition: drawdoc4.cxx:717
SAL_DLLPRIVATE void SetOnlineSpell(bool bIn)
Definition: drawdoc.cxx:962
SAL_DLLPRIVATE bool GetOnlineSpell() const
Definition: drawdoc.hxx:431
void StopWorkStartupDelay()
Definition: drawdoc2.cxx:932
SAL_DLLPRIVATE void SetLanguage(const LanguageType eLang, const sal_uInt16 nId)
Definition: drawdoc2.cxx:845
SAL_DLLPRIVATE void StartOnlineSpelling(bool bForceSpelling=true)
Definition: drawdoc4.cxx:729
SAL_DLLPRIVATE LanguageType GetLanguage(const sal_uInt16 nId) const
Definition: drawdoc2.cxx:875
SAL_DLLPRIVATE DocumentType GetDocumentType() const
Definition: drawdoc.hxx:251
void GetState(SfxItemSet &)
Definition: sdmod1.cxx:301
SfxFrame * ExecuteNewDocument(SfxRequest const &rReq)
Definition: sdmod1.cxx:445
SdOptions * GetSdOptions(DocumentType eDocType)
Return options.
Definition: sdmod.cxx:126
static bool OutlineToImpress(SfxRequest const &rRequest)
Take an outline from a text document and create a new impress document according to the structure of ...
Definition: sdmod1.cxx:240
void Execute(SfxRequest &rReq)
Definition: sdmod1.cxx:77
bool mbEventListenerAdded
Definition: sdmod.hxx:161
static SfxFrame * CreateEmptyDocument(const css::uno::Reference< css::frame::XFrame > &i_rFrame)
Definition: sdmod1.cxx:509
static SfxFrame * CreateFromTemplate(const OUString &rTemplatePath, const css::uno::Reference< css::frame::XFrame > &i_rFrame, const bool bReplaceable)
Definition: sdmod1.cxx:414
void SetMetric(sal_uInt16 nInMetric)
Definition: optsitem.hxx:144
sal_uInt16 GetMetric() const
Definition: optsitem.hxx:136
bool IsStartWithTemplate() const
Definition: optsitem.hxx:242
void SetStartWithTemplate(bool bOn)
Definition: optsitem.hxx:286
static bool IsHeadlessOrUITest()
ErrCode LoadTemplate(SfxObjectShellLock &xDoc, const OUString &rFileName, std::unique_ptr< SfxItemSet > pArgs)
static bool IsTipOfTheDayDue()
bool GetValue() const
const SfxPoolItem * Execute(sal_uInt16 nSlot, SfxCallMode nCall=SfxCallMode::SLOT, const SfxPoolItem **pArgs=nullptr, sal_uInt16 nModi=0, const SfxPoolItem **pInternalArgs=nullptr)
const css::uno::Reference< css::frame::XFrame > & GetFrameInterface() const
const T * GetItemIfSet(TypedWhichId< T > nWhich, bool bSrchInParent=true) 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
const Link< SfxPoolItem const *, void > & GetValue() const
SfxItemSet & GetItemSet() const
static OUString GetStandardTemplate(std::u16string_view rServiceName)
SfxMedium * GetMedium() const
static SAL_WARN_UNUSED_RESULT SfxObjectShell * Current()
sal_uInt16 GetSlot() const
const SfxItemSet * GetArgs() const
const T * GetArg(sal_uInt16 nSlotId) const
void SetReturnValue(const SfxPoolItem &)
bool IsDone() const
void Done(bool bRemove=false)
void PutItem(const SfxPoolItem &rItem)
const SfxPoolItem * GetSlotState(sal_uInt16 nSlotId, const SfxInterface *pIF=nullptr, SfxItemSet *pStateSet=nullptr)
SfxItemPool & GetPool() const
virtual SfxInterface * GetInterface() const
const SfxPoolItem * ExecuteSlot(SfxRequest &rReq, const SfxInterface *pIF=nullptr)
SfxViewShell * GetViewShell() const
SfxDispatcher * GetDispatcher() const
OUString const & getTemplatePath() const
virtual short run() override
bool IsStartWithTemplate() const
const css::uno::Reference< css::frame::XFrame > & GetFrame() const
static SfxViewFrame * LoadDocumentIntoFrame(SfxObjectShell const &i_rDoc, const SfxFrameItem *i_pFrameItem, SfxInterfaceId i_nViewId)
SfxDispatcher * GetDispatcher()
SfxFrame & GetFrame() const
virtual ErrCode ReadAt(sal_uInt64 nPos, void *pBuffer, std::size_t nCount, std::size_t *pRead) const
const SvStream * GetStream() const
void * GetData() const
void ClearUndoBuffer()
Definition: docshell.cxx:455
sd::ViewShell * GetViewShell()
DocumentType GetDocumentType() const
SdDrawDocument * GetDoc()
Show a textual overview of the text contents of all slides.
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
Derivative of sd::View for the outline mode |* .
Definition: OutlineView.hxx:55
void SetActualPage(SdPage const *pActual)
selects the paragraph for the given page at the outliner view
Definition: outlview.cxx:1205
static bool IsRunning(ViewShellBase const &rBase)
returns true if there is a running presentation for the given ViewShellBase
Definition: slideshow.cxx:208
SfxViewShell descendant that the stacked Draw/Impress shells are based on.
Base class of the stacked shell hierarchy.
Definition: ViewShell.hxx:92
::sd::View * GetView() const
Definition: ViewShell.hxx:144
SD_DLLPUBLIC ViewShellBase & GetViewShellBase() const
Definition: viewshel.cxx:1397
SD_DLLPUBLIC SfxViewFrame * GetViewFrame() const
Definition: viewshel.cxx:118
float u
constexpr TypedWhichId< SvxLanguageItem > EE_CHAR_LANGUAGE_CTL(EE_CHAR_START+16)
constexpr TypedWhichId< SvxLanguageItem > EE_CHAR_LANGUAGE_CJK(EE_CHAR_START+15)
constexpr TypedWhichId< SvxLanguageItem > EE_CHAR_LANGUAGE(EE_CHAR_START+14)
FieldUnit
sal_Int32 nIndex
constexpr auto OUTLINE_FACTORY_ID
Definition: FactoryIds.hxx:35
DocumentType
const char GetValue[]
IMPL_STATIC_LINK(SdModule, EventListenerHdl, VclSimpleEvent &, rSimpleEvent, void)
Definition: sdmod1.cxx:380
OUString SdResId(TranslateId aId)
Definition: sdmod.cxx:83
signed char sal_Int8