LibreOffice Module sd (master) 1
drawdoc.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 <libxml/xmlwriter.h>
21
22#include "PageListWatcher.hxx"
23#include <com/sun/star/document/PrinterIndependentLayout.hpp>
24#include <com/sun/star/i18n/ScriptType.hpp>
25#include <com/sun/star/beans/XPropertyContainer.hpp>
26#include <com/sun/star/beans/PropertyAttribute.hpp>
27#include <com/sun/star/document/XDocumentProperties.hpp>
28#include <com/sun/star/frame/XModel.hpp>
30
31#include <svl/srchitem.hxx>
32#include <editeng/eeitem.hxx>
34#include <tools/debug.hxx>
35
38#include <officecfg/Office/Impress.hxx>
39
40#include <sfx2/linkmgr.hxx>
41#include <Outliner.hxx>
42#include <sdmod.hxx>
43#include <editeng/editstat.hxx>
44#include <svx/svdotext.hxx>
45#include <editeng/unolingu.hxx>
46#include <svl/itempool.hxx>
47#include <com/sun/star/lang/XMultiServiceFactory.hpp>
48#include <com/sun/star/beans/XPropertySet.hpp>
49#include <editeng/outlobj.hxx>
55#include <unotools/lingucfg.hxx>
56#include <com/sun/star/uno/Reference.hxx>
57#include <com/sun/star/xml/dom/XDocumentBuilder.hpp>
58#include <com/sun/star/xml/dom/XDocument.hpp>
59#include <com/sun/star/xml/dom/XNodeList.hpp>
60#include <com/sun/star/xml/dom/DocumentBuilder.hpp>
61#include <com/sun/star/uno/XComponentContext.hpp>
62#include <rtl/ustring.hxx>
63
64#include <editeng/outliner.hxx>
65#include <drawdoc.hxx>
66#include <sdpage.hxx>
67#include <strings.hrc>
68#include <glob.hxx>
69#include <stlpool.hxx>
70#include <sdresid.hxx>
71#include <customshowlist.hxx>
72#include <DrawDocShell.hxx>
73#include <GraphicDocShell.hxx>
74#include <sdxfer.hxx>
75#include <optsitem.hxx>
76#include <FrameView.hxx>
77#include <undo/undomanager.hxx>
78#include <sdundogr.hxx>
79#include <undopage.hxx>
80#include <vcl/settings.hxx>
81#include <vcl/svapp.hxx>
82#include <unokywds.hxx>
83
84namespace com::sun::star::linguistic2 { class XHyphenator; }
85namespace com::sun::star::linguistic2 { class XSpellChecker1; }
86
87using namespace ::sd;
88using namespace ::com::sun::star;
89using namespace ::com::sun::star::uno;
90using namespace ::com::sun::star::lang;
91using namespace ::com::sun::star::linguistic2;
92
93using namespace com::sun::star::xml::dom;
94using ::com::sun::star::uno::Reference;
95
96
98
99PresentationSettings::PresentationSettings()
100: mbAll( true ),
101 mbEndless( false ),
102 mbCustomShow(false),
103 mbManual( false ),
104 mbMouseVisible( false ),
105 mbMouseAsPen( false ),
106 mbLockedPages( false ),
107 mbAlwaysOnTop( false ),
108 mbUseNavigation( false ),
109 mbFullScreen( true ),
110 mbAnimationAllowed( true ),
111 mnPauseTimeout( 0 ),
112 mbShowPauseLogo( false ),
113 mbStartCustomShow( false )
114{
115}
116
119 nullptr,
120 pDrDocSh)
121, mpDocSh(static_cast< ::sd::DrawDocShell*>(pDrDocSh))
122, mpCreatingTransferable( nullptr )
123, mbHasOnlineSpellErrors(false)
124, mbInitialOnlineSpellingEnabled(true)
125, mbNewOrLoadCompleted(false)
126, mbOnlineSpell(false)
127, mbStartWithPresentation( false )
128, mbExitAfterPresenting( false )
130, meLanguageCJK( LANGUAGE_SYSTEM )
131, meLanguageCTL( LANGUAGE_SYSTEM )
132, mePageNumType(SVX_NUM_ARABIC)
133, mbAllocDocSh(false)
134, meDocType(eType)
135, mbEmbedFonts(false)
136, mbEmbedUsedFontsOnly(false)
137, mbEmbedFontScriptLatin(true)
138, mbEmbedFontScriptAsian(true)
139, mbEmbedFontScriptComplex(true)
140, mnImagePreferredDPI(0)
141{
142 m_bThemedControls = false;
143
146
149 SetObjectShell(pDrDocSh); // for VCDrawModel
150
151 if (mpDocSh)
152 {
154 }
155
156 // Set measuring unit (of the application) and scale (of SdMod)
157 sal_Int32 nX, nY;
158 SdOptions* pOptions = SD_MOD()->GetSdOptions(meDocType);
159 pOptions->GetScale( nX, nY );
160
161 // Allow UI scale only for draw documents.
163 SetUIUnit( static_cast<FieldUnit>(pOptions->GetMetric()), Fraction( nX, nY ) ); // user-defined
164 else
165 SetUIUnit( static_cast<FieldUnit>(pOptions->GetMetric()), Fraction( 1, 1 ) ); // default
166
167 SetScaleUnit(MapUnit::Map100thMM);
169
170 m_pItemPool->SetDefaultMetric(MapUnit::Map100thMM);
171 m_pItemPool->FreezeIdRanges();
173
174 // DrawingEngine has to know where it is...
176
177 // Set StyleSheetPool for DrawOutliner, so text objects can be read correctly.
178 // The link to the StyleRequest handler of the document is set later, in
179 // NewOrLoadCompleted, because only then do all the templates exist.
180 SdrOutliner& rOutliner = GetDrawOutliner();
181 rOutliner.SetStyleSheetPool(static_cast<SfxStyleSheetPool*>(GetStyleSheetPool()));
182 SetCalcFieldValueHdl( &rOutliner );
183
184 // set linguistic options
186 {
187 const SvtLinguConfig aLinguConfig;
188 SvtLinguOptions aOptions;
189 aLinguConfig.GetOptions( aOptions );
190
192 css::i18n::ScriptType::LATIN), EE_CHAR_LANGUAGE );
194 css::i18n::ScriptType::ASIAN), EE_CHAR_LANGUAGE_CJK );
196 css::i18n::ScriptType::COMPLEX), EE_CHAR_LANGUAGE_CTL );
197
198 mbOnlineSpell = aOptions.bIsSpellAuto;
199 }
200
202 moCharClass.emplace(LanguageTag( eRealLanguage));
203
204 // If the current application language is a language that uses right-to-left text...
206
207 // for korean and japanese languages we have a different default for apply spacing between asian, latin and ctl text
208 if (MsLangId::isKorean(eRealCTLLanguage) || (LANGUAGE_JAPANESE == eRealCTLLanguage))
209 {
211 }
212
213 // Set DefTab and SpellOptions for the SD module
214 sal_uInt16 nDefTab = pOptions->GetDefTab();
215 SetDefaultTabulator( nDefTab );
216
217 try
218 {
219 Reference< XSpellChecker1 > xSpellChecker( LinguMgr::GetSpellChecker() );
220 if ( xSpellChecker.is() )
221 rOutliner.SetSpeller( xSpellChecker );
222
223 Reference< XHyphenator > xHyphenator( LinguMgr::GetHyphenator() );
224 if( xHyphenator.is() )
225 rOutliner.SetHyphenator( xHyphenator );
226
228 }
229 catch(...)
230 {
231 OSL_FAIL("Can't get SpellChecker");
232 }
233
234 rOutliner.SetDefaultLanguage( Application::GetSettings().GetLanguageTag().getLanguageType() );
235
236 if (mpDocSh)
237 {
239 }
240
241 EEControlBits nCntrl = rOutliner.GetControlWord();
242 nCntrl |= EEControlBits::ALLOWBIGOBJS;
243
244 if (mbOnlineSpell)
245 nCntrl |= EEControlBits::ONLINESPELLING;
246 else
247 nCntrl &= ~EEControlBits::ONLINESPELLING;
248
249 nCntrl &= ~ EEControlBits::ULSPACESUMMATION;
252 else
253 {
255 if ( pOptions->IsSummationOfParagraphs() )
256 nCntrl |= EEControlBits::ULSPACESUMMATION;
257 }
258 rOutliner.SetControlWord(nCntrl);
259
260 // Initialize the printer independent layout mode
262
263 // Set the StyleSheetPool for HitTestOutliner.
264 // The link to the StyleRequest handler of the document is set later, in
265 // NewOrLoadCompleted, because only then do all the templates exist.
266 m_pHitTestOutliner->SetStyleSheetPool( static_cast<SfxStyleSheetPool*>(GetStyleSheetPool()) );
267
269
270 try
271 {
272 Reference< XSpellChecker1 > xSpellChecker( LinguMgr::GetSpellChecker() );
273 if ( xSpellChecker.is() )
274 m_pHitTestOutliner->SetSpeller( xSpellChecker );
275
276 Reference< XHyphenator > xHyphenator( LinguMgr::GetHyphenator() );
277 if( xHyphenator.is() )
278 m_pHitTestOutliner->SetHyphenator( xHyphenator );
279 }
280 catch(...)
281 {
282 OSL_FAIL("Can't get SpellChecker");
283 }
284
285 m_pHitTestOutliner->SetDefaultLanguage( Application::GetSettings().GetLanguageTag().getLanguageType() );
286
287 EEControlBits nCntrl2 = m_pHitTestOutliner->GetControlWord();
288 nCntrl2 |= EEControlBits::ALLOWBIGOBJS;
289 nCntrl2 &= ~EEControlBits::ONLINESPELLING;
290
291 nCntrl2 &= ~ EEControlBits::ULSPACESUMMATION;
292 if ( pOptions->IsSummationOfParagraphs() )
293 nCntrl2 |= EEControlBits::ULSPACESUMMATION;
294
295 m_pHitTestOutliner->SetControlWord( nCntrl2 );
296
320 {
321 SdrLayerAdmin& rLayerAdmin = GetLayerAdmin();
322 rLayerAdmin.NewLayer( sUNO_LayerName_layout );
323 rLayerAdmin.NewLayer( sUNO_LayerName_background );
325 rLayerAdmin.NewLayer( sUNO_LayerName_controls);
327
329 }
330
331}
332
333// Destructor
335{
336 Broadcast(SdrHint(SdrHintKind::ModelCleared));
337
339 {
340 if ( mpWorkStartupTimer->IsActive() )
341 mpWorkStartupTimer->Stop();
342
343 mpWorkStartupTimer.reset();
344 }
345
347 mpOnlineSearchItem.reset();
348
350 SetAllocDocSh(false);
351
352 ClearModel(true);
353
354 if (m_pLinkManager)
355 {
356 // Release BaseLinks
357 if ( !m_pLinkManager->GetLinks().empty() )
358 {
360 }
361
362 delete m_pLinkManager;
363 m_pLinkManager = nullptr;
364 }
365
366 maFrameViewList.clear();
367 mpCustomShowList.reset();
368 mpOutliner.reset();
369 mpInternalOutliner.reset();
370 moCharClass.reset();
371}
372
374 const Size& rNewSize,
375 ::tools::Long nLeft,
376 ::tools::Long nRight,
377 ::tools::Long nUpper,
378 ::tools::Long nLower)
379{
380 const sal_uInt16 nMasterPageCnt(GetMasterSdPageCount(PageKind::Standard));
381 const sal_uInt16 nPageCnt(GetSdPageCount(PageKind::Standard));
382
383 if(0 == nMasterPageCnt && 0 == nPageCnt)
384 {
385 return;
386 }
387
388 SdPage* pPage(0 != nPageCnt ? GetSdPage(0, PageKind::Standard) : GetMasterSdPage(0, PageKind::Standard));
389
390 // call fully implemented local version, including getting
391 // some more information from one of the Pages (1st one)
393 rNewSize,
395 nullptr,
396 nLeft,
397 nRight,
398 nUpper,
399 nLower,
400 true,
401 pPage->GetOrientation(),
402 pPage->GetPaperBin(),
403 pPage->IsBackgroundFullSize());
404
405 // adjust handout page to new format of the standard page
406 if(0 != nPageCnt)
407 {
409 }
410}
411
413 const Size& rNewSize,
414 PageKind ePageKind,
415 SdUndoGroup* pUndoGroup,
416 ::tools::Long nLeft,
417 ::tools::Long nRight,
418 ::tools::Long nUpper,
419 ::tools::Long nLower,
420 bool bScaleAll,
421 Orientation eOrientation,
422 sal_uInt16 nPaperBin,
423 bool bBackgroundFullSize)
424{
425 sal_uInt16 i;
426 const sal_uInt16 nMasterPageCnt(GetMasterSdPageCount(ePageKind));
427 const sal_uInt16 nPageCnt(GetSdPageCount(ePageKind));
428
429 if(0 == nMasterPageCnt && 0 == nPageCnt)
430 {
431 return;
432 }
433
434 for (i = 0; i < nMasterPageCnt; i++)
435 {
436 // first, handle all master pages
437 SdPage* pPage(GetMasterSdPage(i, ePageKind));
438
439 if(pUndoGroup)
440 {
441 SdUndoAction* pUndo(
443 this,
444 pPage,
445 pPage->GetSize(),
446 pPage->GetLeftBorder(), pPage->GetRightBorder(),
447 pPage->GetUpperBorder(), pPage->GetLowerBorder(),
448 pPage->GetOrientation(),
449 pPage->GetPaperBin(),
450 pPage->IsBackgroundFullSize(),
451 rNewSize,
452 nLeft, nRight,
453 nUpper, nLower,
454 bScaleAll,
455 eOrientation,
456 nPaperBin,
457 bBackgroundFullSize));
458 pUndoGroup->AddAction(pUndo);
459 }
460
461 if (rNewSize.Width() > 0 || nLeft >= 0 || nRight >= 0 || nUpper >= 0 || nLower >= 0)
462 {
463 ::tools::Rectangle aNewBorderRect(nLeft, nUpper, nRight, nLower);
464 pPage->ScaleObjects(rNewSize, aNewBorderRect, bScaleAll);
465
466 if (rNewSize.Width() > 0)
467 {
468 pPage->SetSize(rNewSize);
469 }
470 }
471
472 if( nLeft >= 0 || nRight >= 0 || nUpper >= 0 || nLower >= 0 )
473 {
474 pPage->SetBorder(nLeft, nUpper, nRight, nLower);
475 }
476
477 pPage->SetOrientation(eOrientation);
478 pPage->SetPaperBin( nPaperBin );
479 pPage->SetBackgroundFullSize( bBackgroundFullSize );
480
481 if ( ePageKind == PageKind::Standard )
482 {
484 }
485
486 pPage->CreateTitleAndLayout();
487 }
488
489 for (i = 0; i < nPageCnt; i++)
490 {
491 // then, handle all pages
492 SdPage* pPage(GetSdPage(i, ePageKind));
493
494 if(pUndoGroup)
495 {
496 SdUndoAction* pUndo(
498 this,
499 pPage,
500 pPage->GetSize(),
501 pPage->GetLeftBorder(), pPage->GetRightBorder(),
502 pPage->GetUpperBorder(), pPage->GetLowerBorder(),
503 pPage->GetOrientation(),
504 pPage->GetPaperBin(),
505 pPage->IsBackgroundFullSize(),
506 rNewSize,
507 nLeft, nRight,
508 nUpper, nLower,
509 bScaleAll,
510 eOrientation,
511 nPaperBin,
512 bBackgroundFullSize));
513 pUndoGroup->AddAction(pUndo);
514 }
515
516 if (rNewSize.Width() > 0 || nLeft >= 0 || nRight >= 0 || nUpper >= 0 || nLower >= 0)
517 {
518 ::tools::Rectangle aNewBorderRect(nLeft, nUpper, nRight, nLower);
519 pPage->ScaleObjects(rNewSize, aNewBorderRect, bScaleAll);
520
521 if (rNewSize.Width() > 0)
522 {
523 pPage->SetSize(rNewSize);
524 }
525 }
526
527 if( nLeft >= 0 || nRight >= 0 || nUpper >= 0 || nLower >= 0 )
528 {
529 pPage->SetBorder(nLeft, nUpper, nRight, nLower);
530 }
531
532 pPage->SetOrientation(eOrientation);
533 pPage->SetPaperBin( nPaperBin );
534 pPage->SetBackgroundFullSize( bBackgroundFullSize );
535
536 if ( ePageKind == PageKind::Standard )
537 {
538 SdPage* pNotesPage = GetSdPage(i, PageKind::Notes);
539 pNotesPage->SetAutoLayout( pNotesPage->GetAutoLayout() );
540 }
541
542 pPage->SetAutoLayout( pPage->GetAutoLayout() );
543 }
544}
545
547{
548 return AllocSdDrawDocument();
549}
550
551namespace
552{
553
555void lcl_copyUserDefinedProperties(const SfxObjectShell* pSource, const SfxObjectShell* pDestination)
556{
557 if (!pSource || !pDestination)
558 return;
559
560 uno::Reference<document::XDocumentProperties> xSource = pSource->getDocProperties();
561 uno::Reference<document::XDocumentProperties> xDestination = pDestination->getDocProperties();
562 uno::Reference<beans::XPropertyContainer> xSourcePropertyContainer = xSource->getUserDefinedProperties();
563 uno::Reference<beans::XPropertyContainer> xDestinationPropertyContainer = xDestination->getUserDefinedProperties();
564 uno::Reference<beans::XPropertySet> xSourcePropertySet(xSourcePropertyContainer, uno::UNO_QUERY);
565 const uno::Sequence<beans::Property> aProperties = xSourcePropertySet->getPropertySetInfo()->getProperties();
566
567 for (const beans::Property& rProperty : aProperties)
568 {
569 const OUString& rKey = rProperty.Name;
570 uno::Any aValue = xSourcePropertySet->getPropertyValue(rKey);
571 // We know that pDestination was just created, so has no properties: addProperty() will never throw.
572 xDestinationPropertyContainer->addProperty(rKey, beans::PropertyAttribute::REMOVABLE, aValue);
573 }
574}
575
576}
577
578// This method creates a new document (SdDrawDocument) and returns a pointer to
579// said document. The drawing engine uses this method to put the document (or
580// parts of it) into the clipboard/DragServer.
582{
583 SdDrawDocument* pNewModel = nullptr;
584
586 {
587 // Document is created for drag & drop/clipboard. To be able to
588 // do this, the document has to know a DocShell (SvPersist).
589 SfxObjectShell* pObj = nullptr;
590 ::sd::DrawDocShell* pNewDocSh = nullptr;
591
593 mpCreatingTransferable->SetDocShell( new ::sd::DrawDocShell(
594 SfxObjectCreateMode::EMBEDDED, true, meDocType ) );
595 else
596 mpCreatingTransferable->SetDocShell( new ::sd::GraphicDocShell(
597 SfxObjectCreateMode::EMBEDDED ) );
598
600 pNewDocSh = static_cast< ::sd::DrawDocShell*>( pObj );
601 pNewDocSh->DoInitNew();
602 pNewModel = pNewDocSh->GetDoc();
603
604 // Only necessary for clipboard -
605 // for drag & drop this is handled by DragServer
606 SdStyleSheetPool* pOldStylePool = static_cast<SdStyleSheetPool*>( GetStyleSheetPool() );
607 SdStyleSheetPool* pNewStylePool = static_cast<SdStyleSheetPool*>( pNewModel->GetStyleSheetPool() );
608
609 pNewStylePool->CopyGraphicSheets(*pOldStylePool);
610 pNewStylePool->CopyCellSheets(*pOldStylePool);
611 pNewStylePool->CopyTableStyles(*pOldStylePool);
612
613 for (sal_uInt16 i = 0; i < GetMasterSdPageCount(PageKind::Standard); i++)
614 {
615 // Move with all of the master page's layouts
616 OUString aOldLayoutName(const_cast<SdDrawDocument*>(this)->GetMasterSdPage(i, PageKind::Standard)->GetLayoutName());
617 aOldLayoutName = aOldLayoutName.copy( 0, aOldLayoutName.indexOf( SD_LT_SEPARATOR ) );
618 StyleSheetCopyResultVector aCreatedSheets;
619 pNewStylePool->CopyLayoutSheets(aOldLayoutName, *pOldStylePool, aCreatedSheets );
620 }
621
622 lcl_copyUserDefinedProperties(GetDocSh(), pNewDocSh);
623
624 pNewModel->NewOrLoadCompleted( DocCreationMode::Loaded ); // loaded from source document
625 }
626 else if( mbAllocDocSh )
627 {
628 // Create a DocShell which is then returned with GetAllocedDocSh()
629 SdDrawDocument* pDoc = const_cast<SdDrawDocument*>(this);
630 pDoc->SetAllocDocSh(false);
631 pDoc->mxAllocedDocShRef = new ::sd::DrawDocShell(
632 SfxObjectCreateMode::EMBEDDED, true, meDocType);
633 pDoc->mxAllocedDocShRef->DoInitNew();
634 pNewModel = pDoc->mxAllocedDocShRef->GetDoc();
635 }
636 else
637 {
638 pNewModel = new SdDrawDocument(meDocType, nullptr);
639 }
640
641 return pNewModel;
642}
643
645{
646 return new SdPage(*this, bMasterPage);
647}
648
649// This method creates a new page (SdPage) and returns a pointer to said page.
650// The drawing engine uses this method to create pages (whose types it does
651// not know, as they are _derivatives_ of SdrPage) when loading.
653{
654 return AllocSdPage(bMasterPage);
655}
656
657// When the model has changed
659{
660 if (mpDocSh)
661 {
663 {
664 // Pass on to base class
666
667 // Forward to ObjectShell
668 mpDocSh->SetModified(bFlag);
669 }
670 }
671 else
672 {
673 // Pass on to base class
675 }
676}
677
678// The model changed, don't call anything else
680{
681 // forward to baseclass
683}
684
685// NewOrLoadCompleted is called when the document is loaded, or when it is clear
686// it won't load any more.
688{
690 {
691 // New document:
692 // create slideshow and default templates,
693 // create pool for virtual controls
696
697 static_cast< SdStyleSheetPool* >( mxStyleSheetPool.get() )->CreatePseudosIfNecessary();
698 }
699 else if (eMode == DocCreationMode::Loaded)
700 {
701 // Document has finished loading
702
704
706 RemoveUnnecessaryMasterPages( nullptr, true, false );
707
708 for ( sal_uInt16 i = 0; i < GetPageCount(); i++ )
709 {
710 // Check for correct layout names
711 SdPage* pPage = static_cast<SdPage*>( GetPage( i ) );
712
713 if(pPage->TRG_HasMasterPage())
714 {
715 SdPage& rMaster = static_cast<SdPage&>(pPage->TRG_GetMasterPage() );
716
717 if(rMaster.GetLayoutName() != pPage->GetLayoutName())
718 {
719 pPage->SetLayoutName(rMaster.GetLayoutName());
720 }
721 }
722 }
723
724 for ( sal_uInt16 nPage = 0; nPage < GetMasterPageCount(); nPage++)
725 {
726 // LayoutName and PageName must be the same
727 SdPage* pPage = static_cast<SdPage*>( GetMasterPage( nPage ) );
728
729 OUString aName( pPage->GetLayoutName() );
730 aName = aName.copy( 0, aName.indexOf( SD_LT_SEPARATOR ) );
731
732 if( aName != pPage->GetName() )
733 pPage->SetName( aName );
734 }
735
736 // Create names of the styles in the user's language
737 static_cast<SdStyleSheetPool*>(mxStyleSheetPool.get())->UpdateStdNames();
738
739 // Create any missing styles - eg. formerly, there was no Subtitle style
740 static_cast<SdStyleSheetPool*>(mxStyleSheetPool.get())->CreatePseudosIfNecessary();
741 }
742
743 // Set default style of Drawing Engine
744 OUString aName( SdResId(STR_STANDARD_STYLESHEET_NAME));
745 SetDefaultStyleSheet(static_cast<SfxStyleSheet*>(mxStyleSheetPool->Find(aName, SfxStyleFamily::Para)));
746
747 // #i119287# Set default StyleSheet for SdrGrafObj and SdrOle2Obj
748 SetDefaultStyleSheetForSdrGrafObjAndSdrOle2Obj(static_cast<SfxStyleSheet*>(mxStyleSheetPool->Find(SdResId(STR_POOLSHEET_OBJNOLINENOFILL), SfxStyleFamily::Para)));
749
750 // Initialize DrawOutliner and DocumentOutliner, but don't initialize the
751 // global outliner, as it is not document specific like StyleSheetPool and
752 // StyleRequestHandler are.
753 ::Outliner& rDrawOutliner = GetDrawOutliner();
754 rDrawOutliner.SetStyleSheetPool(static_cast<SfxStyleSheetPool*>(GetStyleSheetPool()));
755 EEControlBits nCntrl = rDrawOutliner.GetControlWord();
756 if (mbOnlineSpell)
757 nCntrl |= EEControlBits::ONLINESPELLING;
758 else
759 nCntrl &= ~EEControlBits::ONLINESPELLING;
760 rDrawOutliner.SetControlWord(nCntrl);
761
762 // Initialize HitTestOutliner and DocumentOutliner, but don't initialize the
763 // global outliner, as it is not document specific like StyleSheetPool and
764 // StyleRequestHandler are.
765 m_pHitTestOutliner->SetStyleSheetPool(static_cast<SfxStyleSheetPool*>(GetStyleSheetPool()));
766
767 if(mpOutliner)
768 {
769 mpOutliner->SetStyleSheetPool(static_cast<SfxStyleSheetPool*>(GetStyleSheetPool()));
770 }
772 {
773 mpInternalOutliner->SetStyleSheetPool(static_cast<SfxStyleSheetPool*>(GetStyleSheetPool()));
774 }
775
777 {
778 // Make presentation objects listeners of the appropriate styles
779 SdStyleSheetPool* pSPool = static_cast<SdStyleSheetPool*>( GetStyleSheetPool() );
780 sal_uInt16 nPage, nPageCount;
781
782 // create missing layout style sheets for broken documents
783 // that were created with the 5.2
785 for (nPage = 0; nPage < nPageCount; nPage++)
786 {
788 pSPool->CreateLayoutStyleSheets( pPage->GetName(), true );
789 }
790
791 // Default and notes pages:
792 for (nPage = 0; nPage < GetPageCount(); nPage++)
793 {
794 SdPage* pPage = static_cast<SdPage*>(GetPage(nPage));
795 NewOrLoadCompleted( pPage, pSPool );
796 }
797
798 // Master pages:
799 for (nPage = 0; nPage < GetMasterPageCount(); nPage++)
800 {
801 SdPage* pPage = static_cast<SdPage*>(GetMasterPage(nPage));
802
803 NewOrLoadCompleted( pPage, pSPool );
804 }
805 }
806
809 SetChanged( false );
810}
811
814{
816 return;
817
818 s_pDocLockedInsertingLinks = this; // lock inserting links. only links in this document should by resolved
819
820 if (mpDocSh)
821 {
823 rEmbeddedObjectContainer.setUserAllowsLinkUpdate(true);
824 }
825
826 m_pLinkManager->UpdateAllLinks(true, false, nullptr); // query box: update all links?
827
828 if (s_pDocLockedInsertingLinks == this)
829 s_pDocLockedInsertingLinks = nullptr; // unlock inserting links
830}
831
836{
837 sd::ShapeList& rPresentationShapes( pPage->GetPresentationShapeList() );
838 if(rPresentationShapes.isEmpty())
839 return;
840
841 // Create lists of title and outline styles
842 OUString aName = pPage->GetLayoutName();
843 aName = aName.copy( 0, aName.indexOf( SD_LT_SEPARATOR ) );
844
845 std::vector<SfxStyleSheetBase*> aOutlineList;
846 pSPool->CreateOutlineSheetList(aName,aOutlineList);
847
848 SfxStyleSheet* pTitleSheet = static_cast<SfxStyleSheet*>(pSPool->GetTitleSheet(aName));
849
850 SdrObject* pObj = nullptr;
851 rPresentationShapes.seekShape(0);
852
853 // Now look for title and outline text objects, then make those objects
854 // listeners.
855 while( (pObj = rPresentationShapes.getNextShape()) )
856 {
857 if (pObj->GetObjInventor() == SdrInventor::Default)
858 {
861
862 if (nId == SdrObjKind::TitleText)
863 {
864 if( pOPO && pOPO->GetOutlinerMode() == OutlinerMode::DontKnow )
865 pOPO->SetOutlinerMode( OutlinerMode::TitleObject );
866
867 // sal_True: don't delete "hard" attributes when doing this.
868 if (pTitleSheet)
869 pObj->SetStyleSheet(pTitleSheet, true);
870 }
871 else if (nId == SdrObjKind::OutlineText)
872 {
873 if( pOPO && pOPO->GetOutlinerMode() == OutlinerMode::DontKnow )
874 pOPO->SetOutlinerMode( OutlinerMode::OutlineObject );
875
876 std::vector<SfxStyleSheetBase*>::iterator iter;
877 for (iter = aOutlineList.begin(); iter != aOutlineList.end(); ++iter)
878 {
879 SfxStyleSheet* pSheet = static_cast<SfxStyleSheet*>(*iter);
880
881 if (pSheet)
882 {
883 pObj->StartListening(*pSheet);
884
885 if( iter == aOutlineList.begin())
886 // text frame listens to stylesheet of layer 1
887 pObj->NbcSetStyleSheet(pSheet, true);
888 }
889 }
890 }
891
892 if( auto pTextObj = DynCastSdrTextObj( pObj ) )
893 if (pTextObj->IsEmptyPresObj())
894 {
895 PresObjKind ePresObjKind = pPage->GetPresObjKind(pObj);
896 OUString aString( pPage->GetPresObjText(ePresObjKind) );
897
898 if (!aString.isEmpty())
899 {
900 SdOutliner* pInternalOutl = GetInternalOutliner();
901 pPage->SetObjText( pTextObj, pInternalOutl, ePresObjKind, aString );
902 pObj->NbcSetStyleSheet( pPage->GetStyleSheetForPresObj( ePresObjKind ), true );
903 pInternalOutl->Clear();
904 }
905 }
906 }
907 }
908}
909
910// Local outliner that is used for outline mode. In this outliner, OutlinerViews
911// may be inserted.
913{
914 if (!mpOutliner && bCreateOutliner)
915 {
916 mpOutliner.reset(new SdOutliner( this, OutlinerMode::TextObject ));
917
918 if (mpDocSh)
919 mpOutliner->SetRefDevice( SD_MOD()->GetVirtualRefDevice() );
920
921 mpOutliner->SetDefTab( m_nDefaultTabulator );
922 mpOutliner->SetStyleSheetPool(static_cast<SfxStyleSheetPool*>(GetStyleSheetPool()));
923 }
924
925 return mpOutliner.get();
926}
927
928// Internal outliner that is used to create text objects. We don't insert any
929// OutlinerViews into this outliner!
931{
932 if ( !mpInternalOutliner && bCreateOutliner )
933 {
934 mpInternalOutliner.reset( new SdOutliner( this, OutlinerMode::TextObject ) );
935
936 // This outliner is only used to create special text objects. As no
937 // information about portions is saved in this outliner, the update mode
938 // can/should always remain sal_False.
939 mpInternalOutliner->SetUpdateLayout( false );
940 mpInternalOutliner->EnableUndo( false );
941
942 if (mpDocSh)
943 mpInternalOutliner->SetRefDevice( SD_MOD()->GetVirtualRefDevice() );
944
946 mpInternalOutliner->SetStyleSheetPool(static_cast<SfxStyleSheetPool*>(GetStyleSheetPool()));
947 }
948
949 DBG_ASSERT( !mpInternalOutliner || ( ! mpInternalOutliner->IsUpdateLayout() ) , "InternalOutliner: UpdateMode = sal_True !" );
950 DBG_ASSERT( !mpInternalOutliner || ( ! mpInternalOutliner->IsUndoEnabled() ), "InternalOutliner: Undo = sal_True !" );
951
952 // If you add stuff here, always clear it out.
953 // Advantages:
954 // a) no unnecessary Clear calls
955 // b) no wasted memory
956 DBG_ASSERT( !mpInternalOutliner || ( ( mpInternalOutliner->GetParagraphCount() == 1 ) && ( mpInternalOutliner->GetText( mpInternalOutliner->GetParagraph( 0 ) ).isEmpty() ) ), "InternalOutliner: not empty!" );
957
958 return mpInternalOutliner.get();
959}
960
961// OnlineSpelling on/off
963{
964 mbOnlineSpell = bIn;
965 EEControlBits nCntrl;
966
967 if(mpOutliner)
968 {
969 nCntrl = mpOutliner->GetControlWord();
970
971 if(mbOnlineSpell)
972 nCntrl |= EEControlBits::ONLINESPELLING;
973 else
974 nCntrl &= ~EEControlBits::ONLINESPELLING;
975
976 mpOutliner->SetControlWord(nCntrl);
977 }
978
980 {
981 nCntrl = mpInternalOutliner->GetControlWord();
982
983 if (mbOnlineSpell)
984 nCntrl |= EEControlBits::ONLINESPELLING;
985 else
986 nCntrl &= ~EEControlBits::ONLINESPELLING;
987
988 mpInternalOutliner->SetControlWord(nCntrl);
989 }
990
991 ::Outliner& rOutliner = GetDrawOutliner();
992
993 nCntrl = rOutliner.GetControlWord();
994
995 if (mbOnlineSpell)
996 nCntrl |= EEControlBits::ONLINESPELLING;
997 else
998 nCntrl &= ~EEControlBits::ONLINESPELLING;
999
1000 rOutliner.SetControlWord(nCntrl);
1001
1002 if (mbOnlineSpell)
1003 {
1005 }
1006 else
1007 {
1009 }
1010}
1011
1012// OnlineSpelling: highlighting on/off
1013uno::Reference< uno::XInterface > SdDrawDocument::createUnoModel()
1014{
1015 uno::Reference< uno::XInterface > xModel;
1016
1017 try
1018 {
1019 if ( mpDocSh )
1020 xModel = mpDocSh->GetModel();
1021 }
1022 catch( uno::RuntimeException& )
1023 {
1024 }
1025
1026 return xModel;
1027}
1028
1030{
1031 return mePageNumType;
1032}
1033
1035{
1036 switch (nMode)
1037 {
1038 case css::document::PrinterIndependentLayout::DISABLED:
1039 case css::document::PrinterIndependentLayout::ENABLED:
1040 // Just store supported modes and inform the doc shell
1042
1043 // Since it is possible that a SdDrawDocument is constructed without a
1044 // SdDrawDocShell the pointer member mpDocSh needs to be tested
1045 // before the call is executed. This is e. g. used for copy/paste.
1046 if(mpDocSh)
1047 {
1049 }
1050
1051 break;
1052
1053 default:
1054 // Ignore unknown values
1055 break;
1056 }
1057}
1058
1059void SdDrawDocument::SetStartWithPresentation( bool bStartWithPresentation )
1060{
1061 mbStartWithPresentation = bStartWithPresentation;
1062}
1063
1064void SdDrawDocument::SetExitAfterPresenting( bool bExitAfterPresenting )
1065{
1066 mbExitAfterPresenting = bExitAfterPresenting;
1067}
1068
1070{
1071 mpDrawPageListWatcher->Invalidate();
1072}
1073
1075{
1076 mpMasterPageListWatcher->Invalidate();
1077}
1078
1080{
1081 pOutliner->SetCalcFieldValueHdl(LINK(SD_MOD(), SdModule, CalcFieldValueHdl));
1082}
1083
1084sal_uInt16 SdDrawDocument::GetAnnotationAuthorIndex( const OUString& rAuthor )
1085{
1086 // force current user to have first color
1087 if( maAnnotationAuthors.empty() )
1088 {
1089 SvtUserOptions aUserOptions;
1090 maAnnotationAuthors.push_back( aUserOptions.GetFullName() );
1091 }
1092
1093 auto iter = std::find(maAnnotationAuthors.begin(), maAnnotationAuthors.end(), rAuthor);
1094 sal_uInt16 idx = static_cast<sal_uInt16>(std::distance(maAnnotationAuthors.begin(), iter));
1095
1096 if( idx == maAnnotationAuthors.size() )
1097 {
1098 maAnnotationAuthors.push_back( rAuthor );
1099 }
1100
1101 return idx;
1102}
1103
1105{
1107 return;
1108
1109 const Reference<css::uno::XComponentContext> xContext(
1110 ::comphelper::getProcessComponentContext() );
1111
1112 // get file list from configuration
1113 const Sequence< OUString > aFiles(
1114 officecfg::Office::Impress::Misc::LayoutListFiles::get() );
1115
1116 if (aFiles.getLength() == 0)
1117 return;
1118 const Reference<XDocumentBuilder> xDocBuilder = DocumentBuilder::create( xContext );
1119
1120 for( const auto& rFile : aFiles )
1121 {
1122 OUString sFilename = comphelper::getExpandedUri(xContext, rFile);
1123
1124 // load layout file into DOM
1125
1126 try
1127 {
1128 // loop over every layout entry in current file
1129 const Reference<XDocument> xDoc = xDocBuilder->parseURI( sFilename );
1130 const Reference<XNodeList> layoutlist = xDoc->getElementsByTagName("layout");
1131 const int nElements = layoutlist->getLength();
1132 for(int index=0; index < nElements; index++)
1133 maLayoutInfo.push_back( layoutlist->item(index) );
1134 }
1135 catch (const uno::Exception &)
1136 {
1137 // skip missing config. files
1138 }
1139 }
1140}
1141
1143{
1145 return;
1146
1147 const Reference<css::uno::XComponentContext> xContext(
1148 ::comphelper::getProcessComponentContext() );
1149
1150 // get file list from configuration
1151 const Sequence< OUString > aFiles(
1152 officecfg::Office::Impress::Misc::PresObjListFiles::get() );
1153
1154 if (aFiles.getLength() == 0)
1155 return;
1156 const Reference<XDocumentBuilder> xDocBuilder = DocumentBuilder::create( xContext );
1157 for( const auto& rFile : aFiles )
1158 {
1159 OUString sFilename = comphelper::getExpandedUri(xContext, rFile);
1160
1161 // load presentation object file into DOM
1162
1163 try
1164 {
1165 // loop over every object entry in current file
1166 const Reference<XDocument> xDoc = xDocBuilder->parseURI( sFilename );
1167 const Reference<XNodeList> objectlist = xDoc->getElementsByTagName("object");
1168 const int nElements = objectlist->getLength();
1169 for(int index=0; index < nElements; index++)
1170 maPresObjectInfo.push_back( objectlist->item(index) );
1171 }
1172 catch (const uno::Exception &)
1173 {
1174 // skip missing config. files
1175 }
1176 }
1177}
1178
1180{
1181 bool bOwns = false;
1182 if (!pWriter)
1183 {
1184 pWriter = xmlNewTextWriterFilename("model.xml", 0);
1185 xmlTextWriterSetIndent(pWriter,1);
1186 (void)xmlTextWriterSetIndentString(pWriter, BAD_CAST(" "));
1187 (void)xmlTextWriterStartDocument(pWriter, nullptr, nullptr, nullptr);
1188 bOwns = true;
1189 }
1190 (void)xmlTextWriterStartElement(pWriter, BAD_CAST("SdDrawDocument"));
1191 (void)xmlTextWriterWriteFormatAttribute(pWriter, BAD_CAST("ptr"), "%p", this);
1192
1193 if (mpOutliner)
1194 mpOutliner->dumpAsXml(pWriter);
1195 FmFormModel::dumpAsXml(pWriter);
1196 if (GetUndoManager())
1197 GetUndoManager()->dumpAsXml(pWriter);
1198
1199 (void)xmlTextWriterEndElement(pWriter);
1200 if (bOwns)
1201 {
1202 (void)xmlTextWriterEndDocument(pWriter);
1203 xmlFreeTextWriter(pWriter);
1204 }
1205}
1206
1207/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
PropertiesInfo aProperties
const LanguageTag & GetLanguageTag() const
static const AllSettings & GetSettings()
void SetObjectShell(SfxObjectShell *pShell)
LanguageType getLanguageType(bool bResolveSystem=true) const
static css::uno::Reference< css::linguistic2::XSpellChecker1 > GetSpellChecker()
static css::uno::Reference< css::linguistic2::XHyphenator > GetHyphenator()
static LanguageType resolveSystemLanguageByScriptType(LanguageType nLang, sal_Int16 nType)
static bool isKorean(LanguageType nLang)
static LanguageType getRealLanguage(LanguageType nLang)
void SetOutlinerMode(OutlinerMode nNew)
OutlinerMode GetOutlinerMode() const
EEControlBits GetControlWord() const
void SetControlWord(EEControlBits nWord)
void SetStyleSheetPool(SfxStyleSheetPool *pSPool)
void SetCalcFieldValueHdl(const Link< EditFieldInfo *, void > &rLink)
std::unique_ptr< SdOutliner > mpInternalOutliner
internal outliner for creation of text objects
Definition: drawdoc.hxx:131
static SAL_DLLPRIVATE void SetCalcFieldValueHdl(::Outliner *pOutliner)
Definition: drawdoc.cxx:1079
void AdaptPageSizeForAllPages(const Size &rNewSize, PageKind ePageKind, SdUndoGroup *pUndoGroup=nullptr, tools::Long nLeft=0, tools::Long nRight=0, tools::Long nUpper=0, tools::Long nLower=0, bool bScaleAll=false, Orientation eOrientation=Orientation::Landscape, sal_uInt16 nPaperBin=0, bool bBackgroundFullSize=false)
Definition: drawdoc.cxx:412
sal_uInt16 GetMasterSdPageCount(PageKind ePgKind) const
Definition: drawdoc2.cxx:222
bool mbExitAfterPresenting
true if mbStartWithPresentation AND Presentation was shown fully
Definition: drawdoc.hxx:158
SdTransferable * mpCreatingTransferable
Definition: drawdoc.hxx:143
bool mbAllocDocSh
Definition: drawdoc.hxx:164
std::unique_ptr< SdCustomShowList > mpCustomShowList
Definition: drawdoc.hxx:141
SAL_DLLPRIVATE void SetPrinterIndependentLayout(sal_Int32 nMode)
Set the mode that controls whether (and later how) the formatting of the document depends on the curr...
Definition: drawdoc.cxx:1034
SAL_DLLPRIVATE sal_uInt16 GetAnnotationAuthorIndex(const OUString &rAuthor)
Definition: drawdoc.cxx:1084
LanguageType meLanguage
Definition: drawdoc.hxx:159
sal_Int32 mnPrinterIndependentLayout
This member stores the printer independent layout mode.
Definition: drawdoc.hxx:631
virtual void adaptSizeAndBorderForAllPages(const Size &rNewSize, tools::Long nLeft=0, tools::Long nRight=0, tools::Long nUpper=0, tools::Long nLower=0) override
Definition: drawdoc.cxx:373
SAL_DLLPRIVATE void StopOnlineSpelling()
Definition: drawdoc4.cxx:717
SAL_DLLPRIVATE void CreateLayoutTemplates()
Definition: drawdoc4.cxx:137
virtual SAL_DLLPRIVATE rtl::Reference< SdrPage > AllocPage(bool bMasterPage) override
Definition: drawdoc.cxx:652
std::unique_ptr< SvxSearchItem > mpOnlineSearchItem
Definition: drawdoc.hxx:138
SAL_DLLPRIVATE void SetOnlineSpell(bool bIn)
Definition: drawdoc.cxx:962
sd::UndoManager * GetUndoManager() const
Definition: drawdoc2.cxx:1377
DocumentType meDocType
Definition: drawdoc.hxx:165
SAL_DLLPRIVATE SfxItemPool & GetPool()
Definition: drawdoc.hxx:237
SAL_DLLPRIVATE void InitObjectVector()
load xml-based impress master presentation object definitions into document
Definition: drawdoc.cxx:1142
SAL_DLLPRIVATE void SetSummationOfParagraphs(bool bOn=true)
Definition: drawdoc.hxx:405
std::vector< css::uno::Reference< css::xml::dom::XNode > > maLayoutInfo
Definition: drawdoc.hxx:182
bool mbNewOrLoadCompleted
Definition: drawdoc.hxx:153
SAL_DLLPRIVATE void SetAllocDocSh(bool bAlloc)
Definition: drawdoc3.cxx:1148
SAL_DLLPRIVATE SdDrawDocument(DocumentType eType, SfxObjectShell *pDocSh)
Definition: drawdoc.cxx:117
SdPage * GetSdPage(sal_uInt16 nPgNum, PageKind ePgKind) const
Definition: drawdoc2.cxx:207
SdOutliner * GetInternalOutliner(bool bCreateOutliner=true)
Definition: drawdoc.cxx:930
std::unique_ptr< Timer > mpWorkStartupTimer
Definition: drawdoc.hxx:132
::sd::DrawDocShell * mpDocSh
Definition: drawdoc.hxx:142
SAL_DLLPRIVATE SdOutliner * GetOutliner(bool bCreateOutliner=true)
Definition: drawdoc.cxx:912
SAL_DLLPRIVATE void SetLanguage(const LanguageType eLang, const sal_uInt16 nId)
Definition: drawdoc2.cxx:845
SAL_DLLPRIVATE void NbcSetChanged(bool bFlag)
Definition: drawdoc.cxx:679
SAL_DLLPRIVATE void CreateDefaultCellStyles()
Definition: drawdoc4.cxx:629
SAL_DLLPRIVATE void StartOnlineSpelling(bool bForceSpelling=true)
Definition: drawdoc4.cxx:729
SAL_DLLPRIVATE void SetTextDefaults() const
Definition: drawdoc4.cxx:1144
SAL_DLLPRIVATE void SetExitAfterPresenting(bool bExitAfterPresenting)
Definition: drawdoc.cxx:1064
::std::unique_ptr< ImpMasterPageListWatcher > mpMasterPageListWatcher
Definition: drawdoc.hxx:170
bool mbStartWithPresentation
is set to true when starting with command line parameter -start
Definition: drawdoc.hxx:157
SAL_DLLPRIVATE void CheckMasterPages()
this method enforces that the masterpages are in the correct order, that is at position 1 is a PageKi...
Definition: drawdoc2.cxx:989
std::vector< std::unique_ptr< sd::FrameView > > maFrameViewList
Definition: drawdoc.hxx:140
std::vector< css::uno::Reference< css::xml::dom::XNode > > maPresObjectInfo
Definition: drawdoc.hxx:184
virtual SAL_DLLPRIVATE css::uno::Reference< css::uno::XInterface > createUnoModel() override
Definition: drawdoc.cxx:1013
virtual SAL_DLLPRIVATE void PageListChanged() override
Definition: drawdoc.cxx:1069
SAL_DLLPRIVATE void UpdateAllLinks()
updates all links, only links in this document should by resolved
Definition: drawdoc.cxx:813
SvxNumType mePageNumType
Definition: drawdoc.hxx:162
static SAL_DLLPRIVATE SdDrawDocument * s_pDocLockedInsertingLinks
static to prevent recursions while resolving links
Definition: drawdoc.hxx:491
::std::unique_ptr< ImpDrawPageListWatcher > mpDrawPageListWatcher
Definition: drawdoc.hxx:169
bool mbOnlineSpell
Definition: drawdoc.hxx:155
::sd::DrawDocShellRef mxAllocedDocShRef
Definition: drawdoc.hxx:163
SdPage * GetMasterSdPage(sal_uInt16 nPgNum, PageKind ePgKind)
Definition: drawdoc2.cxx:217
SAL_DLLPRIVATE void NewOrLoadCompleted(DocCreationMode eMode)
Definition: drawdoc.cxx:687
std::optional< CharClass > moCharClass
Definition: drawdoc.hxx:167
SAL_DLLPRIVATE void RemoveUnnecessaryMasterPages(SdPage *pMaster=nullptr, bool bOnlyDuplicatePages=false, bool bUndo=true)
Definition: drawdoc3.cxx:1172
SAL_DLLPRIVATE void InitLayoutVector()
load xml-based impress layout definitions into document
Definition: drawdoc.cxx:1104
virtual SAL_DLLPRIVATE void MasterPageListChanged() override
Definition: drawdoc.cxx:1074
virtual SAL_DLLPRIVATE void SetChanged(bool bFlag=true) override
Definition: drawdoc.cxx:658
void CloseBookmarkDoc()
Definition: drawdoc3.cxx:1129
void dumpAsXml(xmlTextWriterPtr pWriter) const override
Definition: drawdoc.cxx:1179
std::vector< OUString > maAnnotationAuthors
Definition: drawdoc.hxx:181
SAL_DLLPRIVATE::sd::DrawDocShell * GetDocSh() const
Definition: drawdoc.hxx:242
virtual SAL_DLLPRIVATE ~SdDrawDocument() override
Definition: drawdoc.cxx:334
SAL_DLLPRIVATE void SetStartWithPresentation(bool bStartWithPresentation)
Definition: drawdoc.cxx:1059
SAL_DLLPRIVATE SdDrawDocument * AllocSdDrawDocument() const
Definition: drawdoc.cxx:581
SAL_DLLPRIVATE SvxNumType GetPageNumType() const override
Definition: drawdoc.cxx:1029
virtual SAL_DLLPRIVATE SdrModel * AllocModel() const override
Definition: drawdoc.cxx:546
std::unique_ptr< SdOutliner > mpOutliner
local outliner for outline mode
Definition: drawdoc.hxx:129
SAL_DLLPRIVATE rtl::Reference< SdPage > AllocSdPage(bool bMasterPage)
Definition: drawdoc.cxx:644
sal_uInt16 GetSdPageCount(PageKind ePgKind) const
Definition: drawdoc2.cxx:212
sal_uInt16 GetDefTab() const
Definition: optsitem.hxx:137
sal_uInt16 GetMetric() const
Definition: optsitem.hxx:136
bool IsSummationOfParagraphs() const
Definition: optsitem.hxx:256
sal_uInt16 GetPrinterIndependentLayout() const
Return the currently selected printer independent layout mode.
Definition: optsitem.hxx:264
void GetScale(sal_Int32 &rX, sal_Int32 &rY) const
Definition: optsitem.hxx:424
The main purpose of this class is searching and replacing as well as spelling of impress documents.
Definition: Outliner.hxx:123
virtual void SetOrientation(Orientation eOrient) override
Definition: sdpage.cxx:2557
virtual Orientation GetOrientation() const override
Definition: sdpage.cxx:2562
void SetObjText(SdrTextObj *pObj, SdrOutliner *pOutliner, PresObjKind eObjKind, std::u16string_view rStr)
Definition: sdpage.cxx:2357
void CreateTitleAndLayout(bool bInit=false, bool bCreate=false)
Definition: sdpage.cxx:793
virtual void SetBorder(sal_Int32 nLft, sal_Int32 nUpp, sal_Int32 nRgt, sal_Int32 Lwr) override
Definition: sdpage.cxx:1756
OUString GetPresObjText(PresObjKind eObjKind) const
Definition: sdpage.cxx:2581
SfxStyleSheet * GetStyleSheetForPresObj(PresObjKind eObjKind) const
Definition: sdpage.cxx:625
sd::ShapeList & GetPresentationShapeList()
Definition: sdpage.hxx:166
PresObjKind GetPresObjKind(SdrObject *pObj) const
Definition: sdpage.cxx:2309
void SetPaperBin(sal_uInt16 nBin)
Definition: sdpage.hxx:277
void SetLayoutName(const OUString &aName)
Definition: sdpage.cxx:2487
void SetAutoLayout(AutoLayout eLayout, bool bInit=false, bool bCreate=false)
Definition: sdpage.cxx:1610
void ScaleObjects(const Size &rNewPageSize, const ::tools::Rectangle &rNewBorderRect, bool bScaleAllObj)
Definition: sdpage.cxx:1807
virtual OUString GetLayoutName() const override
Definition: sdpage.hxx:255
const OUString & GetName() const
Definition: sdpage.cxx:2505
sal_uInt16 GetPaperBin() const
Definition: sdpage.hxx:278
void SetName(const OUString &rName)
Set the name of the page and broadcast a model change.
Definition: sdpage.cxx:2703
AutoLayout GetAutoLayout() const
Definition: sdpage.hxx:190
virtual void SetSize(const Size &aSize) override
Definition: sdpage.cxx:1746
SfxStyleSheetBase * GetTitleSheet(std::u16string_view rLayoutName)
Definition: stlpool.cxx:138
void CopyCellSheets(SdStyleSheetPool &rSourcePool)
Definition: stlpool.cxx:518
void CreateOutlineSheetList(std::u16string_view rLayoutName, std::vector< SfxStyleSheetBase * > &rOutlineStyles)
Definition: stlpool.cxx:152
void CopyLayoutSheets(std::u16string_view rLayoutName, SdStyleSheetPool &rSourcePool, StyleSheetCopyResultVector &rCreatedSheets)
Definition: stlpool.cxx:718
void CopyGraphicSheets(SdStyleSheetPool &rSourcePool)
Definition: stlpool.cxx:513
void CopyTableStyles(SdStyleSheetPool const &rSourcePool)
Definition: stlpool.cxx:523
SD_DLLPUBLIC void CreateLayoutStyleSheets(std::u16string_view rLayoutName, bool bCheck=false)
creates all layout style sheets for the given layout name if they don't exist yet.
Definition: stlpool.cxx:172
const SfxObjectShellRef & GetDocShell() const
Definition: sdxfer.hxx:48
void SetDocShell(const SfxObjectShellRef &rRef)
Definition: sdxfer.hxx:47
void AddAction(SdUndoAction *pAction)
Definition: sdundogr.cxx:64
void SetControlLayerName(const OUString &rNewName)
SdrLayer * NewLayer(const OUString &rName, sal_uInt16 nPos=0xFFFF)
sfx2::LinkManager * m_pLinkManager
sal_uInt16 m_nDefaultTabulator
void SetLinkManager(sfx2::LinkManager *pLinkMgr)
virtual void SetChanged(bool bFlg=true)
const SdrPage * GetMasterPage(sal_uInt16 nPgNum) const
void SetForbiddenCharsTable(const std::shared_ptr< SvxForbiddenCharactersTable > &xForbiddenChars)
void SetDefaultStyleSheet(SfxStyleSheet *pDefSS)
void SetUIUnit(FieldUnit eUnit)
void SetDefaultTabulator(sal_uInt16 nVal)
bool m_bThemedControls
void ClearModel(bool bCalledFromDestructor)
SdrOutliner & GetDrawOutliner(const SdrTextObj *pObj=nullptr) const
sal_uInt16 GetMasterPageCount() const
void SetScaleUnit(MapUnit eMap)
void SetStyleSheetPool(SfxStyleSheetBasePool *pPool)
rtl::Reference< SfxItemPool > m_pItemPool
void SetSwapGraphics()
SfxStyleSheetBasePool * GetStyleSheetPool() const
void SetDefaultFontHeight(sal_Int32 nVal)
void SetDefaultStyleSheetForSdrGrafObjAndSdrOle2Obj(SfxStyleSheet *pDefSS)
const SdrPage * GetPage(sal_uInt16 nPgNum) const
rtl::Reference< SfxStyleSheetBasePool > mxStyleSheetPool
const SdrLayerAdmin & GetLayerAdmin() const
sal_uInt16 GetPageCount() const
virtual void dumpAsXml(xmlTextWriterPtr pWriter) const
std::unique_ptr< SdrOutliner > m_pHitTestOutliner
void SetStyleSheet(SfxStyleSheet *pNewStyleSheet, bool bDontRemoveHardAttr)
virtual SdrInventor GetObjInventor() const
virtual OutlinerParaObject * GetOutlinerParaObject() const
void NbcSetStyleSheet(SfxStyleSheet *pNewStyleSheet, bool bDontRemoveHardAttr)
virtual SdrObjKind GetObjIdentifier() const
SdrPage & TRG_GetMasterPage() const
void SetBackgroundFullSize(bool bIn)
Size GetSize() const
sal_Int32 GetUpperBorder() const
sal_Int32 GetRightBorder() const
sal_Int32 GetLeftBorder() const
bool TRG_HasMasterPage() const
bool IsBackgroundFullSize() const
sal_Int32 GetLowerBorder() const
SfxItemPool * GetSecondaryPool() const
void SetPoolDefaultItem(const SfxPoolItem &)
css::uno::Reference< css::document::XDocumentProperties > getDocProperties() const
bool IsEnableSetModified() const
css::uno::Reference< css::frame::XModel3 > GetModel() const
virtual comphelper::EmbeddedObjectContainer & getEmbeddedObjectContainer() const override
constexpr tools::Long Width() const
void GetOptions(SvtLinguOptions &rOptions) const
OUString GetFullName() const
static std::shared_ptr< SvxForbiddenCharactersTable > makeForbiddenCharactersTable(const css::uno::Reference< css::uno::XComponentContext > &rxContext)
void UpdateRefDevice()
Definition: docshel4.cxx:204
virtual void SetModified(bool=true) override
Definition: docshell.cxx:421
SdDrawDocument * GetDoc()
bool isEmpty() const
returns true if this list is empty
Definition: shapelist.cxx:87
SdrObject * getNextShape()
returns the shape the internal iterator points to, or 0 if the list end is reached.
Definition: shapelist.cxx:116
void seekShape(sal_uInt32 nIndex)
Sets the internal iterator to the shape at given index.
Definition: shapelist.cxx:128
void UpdateAllLinks(bool bAskUpdate, bool bUpdateGrfLinks, weld::Window *pParentWin)
void Remove(SvBaseLink const *pLink)
const SvBaseLinks & GetLinks() const
T * get() const
static bool IsFuzzing()
sal_Int32 nElements
LanguageType meLanguage
#define DBG_ASSERT(sCon, aError)
DocCreationMode
Definition: drawdoc.hxx:90
EEControlBits
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)
constexpr TypedWhichId< SvxScriptSpaceItem > EE_PARA_ASIANCJKSPACING(EE_PARA_START+4)
struct _xmlTextWriter * xmlTextWriterPtr
FieldUnit
DocumentType eType
constexpr OUStringLiteral SD_LT_SEPARATOR
Definition: glob.hxx:49
const sal_uInt16 idx[]
OUString aName
Mode eMode
#define LANGUAGE_SYSTEM
#define LANGUAGE_JAPANESE
COMPHELPER_DLLPUBLIC OUString getExpandedUri(css::uno::Reference< css::uno::XComponentContext > const &context, OUString const &uri)
int i
index
constexpr Point convert(const Point &rPoint, o3tl::Length eFrom, o3tl::Length eTo)
DocumentType
long Long
sal_Int16 nId
PresObjKind
Definition: pres.hxx:22
PageKind
Definition: pres.hxx:45
Orientation
OUString SdResId(TranslateId aId)
Definition: sdmod.cxx:83
#define SD_MOD()
Definition: sdmod.hxx:184
std::vector< StyleSheetCopyResult > StyleSheetCopyResultVector
Definition: stlsheet.hxx:184
LanguageType nDefaultLanguage
LanguageType nDefaultLanguage_CTL
LanguageType nDefaultLanguage_CJK
Reference< XModel > xModel
SVXCORE_DLLPUBLIC SdrTextObj * DynCastSdrTextObj(SdrObject *)
SdrObjKind
SvxNumType
SVX_NUM_ARABIC
constexpr OUStringLiteral sUNO_LayerName_measurelines
Definition: unokywds.hxx:33
constexpr OUStringLiteral sUNO_LayerName_background_objects
Definition: unokywds.hxx:30
constexpr OUStringLiteral sUNO_LayerName_layout
Definition: unokywds.hxx:31
constexpr OUStringLiteral sUNO_LayerName_controls
Definition: unokywds.hxx:32
constexpr OUStringLiteral sUNO_LayerName_background
Definition: unokywds.hxx:29