From ed5640d8b587fbcfed7dd7967f3de04b37a76f26 Mon Sep 17 00:00:00 2001
From: Daniel Baumann
Date: Sun, 7 Apr 2024 11:06:44 +0200
Subject: Adding upstream version 4:7.4.7.
Signed-off-by: Daniel Baumann
---
sd/inc/Annotation.hxx | 159 +++++++
sd/inc/AnnotationEnumeration.hxx | 37 ++
sd/inc/CustomAnimationCloner.hxx | 33 ++
sd/inc/CustomAnimationEffect.hxx | 454 ++++++++++++++++++
sd/inc/CustomAnimationPreset.hxx | 142 ++++++
sd/inc/DocumentRenderer.hrc | 95 ++++
sd/inc/EffectMigration.hxx | 75 +++
sd/inc/FactoryIds.hxx | 40 ++
sd/inc/Outliner.hxx | 534 +++++++++++++++++++++
sd/inc/OutlinerIterator.hxx | 314 +++++++++++++
sd/inc/SdShapeTypes.hxx | 51 ++
sd/inc/TransitionPreset.hxx | 78 ++++
sd/inc/VectorGraphicSearchContext.hxx | 35 ++
sd/inc/animations.hxx | 50 ++
sd/inc/anminfo.hxx | 67 +++
sd/inc/app.hrc | 462 ++++++++++++++++++
sd/inc/bitmaps.hlst | 212 +++++++++
sd/inc/createpresentation.hxx | 35 ++
sd/inc/createunocustomshow.hxx | 30 ++
sd/inc/createunopageimpl.hxx | 32 ++
sd/inc/cusshow.hxx | 65 +++
sd/inc/customshowlist.hxx | 89 ++++
sd/inc/diadef.h | 30 ++
sd/inc/drawdoc.hxx | 719 +++++++++++++++++++++++++++++
sd/inc/errhdl.hrc | 39 ++
sd/inc/fadedef.h | 28 ++
sd/inc/family.hrc | 43 ++
sd/inc/glob.hxx | 55 +++
sd/inc/helper/simplereferencecomponent.hxx | 63 +++
sd/inc/helpids.h | 62 +++
sd/inc/misc/scopelock.hxx | 51 ++
sd/inc/notifydocumentevent.hxx | 32 ++
sd/inc/pageformatpanel.hrc | 53 +++
sd/inc/pch/precompiled_sd.cxx | 12 +
sd/inc/pch/precompiled_sd.hxx | 581 +++++++++++++++++++++++
sd/inc/pch/precompiled_sdui.cxx | 12 +
sd/inc/pch/precompiled_sdui.hxx | 497 ++++++++++++++++++++
sd/inc/pglink.hxx | 40 ++
sd/inc/pres.hxx | 73 +++
sd/inc/prlayout.hxx | 46 ++
sd/inc/randomnode.hxx | 35 ++
sd/inc/resltn.hxx | 35 ++
sd/inc/sdabstdlg.hxx | 210 +++++++++
sd/inc/sdattr.hrc | 124 +++++
sd/inc/sdattr.hxx | 60 +++
sd/inc/sdcgmfilter.hxx | 37 ++
sd/inc/sdcommands.h | 26 ++
sd/inc/sddll.hxx | 54 +++
sd/inc/sddllapi.h | 30 ++
sd/inc/sdenumdef.hxx | 31 ++
sd/inc/sderror.hxx | 31 ++
sd/inc/sdfilter.hxx | 66 +++
sd/inc/sdgrffilter.hxx | 39 ++
sd/inc/sdhtmlfilter.hxx | 34 ++
sd/inc/sdiocmpt.hxx | 57 +++
sd/inc/sdmod.hxx | 175 +++++++
sd/inc/sdpage.hxx | 404 ++++++++++++++++
sd/inc/sdpdffilter.hxx | 41 ++
sd/inc/sdpptwrp.hxx | 46 ++
sd/inc/sdresid.hxx | 29 ++
sd/inc/sdundo.hxx | 45 ++
sd/inc/sdxmlwrp.hxx | 52 +++
sd/inc/shapelist.hxx | 71 +++
sd/inc/stlfamily.hxx | 116 +++++
sd/inc/stlpool.hxx | 141 ++++++
sd/inc/stlsheet.hxx | 180 ++++++++
sd/inc/strings.hrc | 488 ++++++++++++++++++++
sd/inc/strings.hxx | 23 +
sd/inc/textapi.hxx | 55 +++
sd/inc/undo/undofactory.hxx | 40 ++
sd/inc/undo/undomanager.hxx | 61 +++
sd/inc/undo/undoobjects.hxx | 175 +++++++
sd/inc/undoanim.hxx | 84 ++++
73 files changed, 8620 insertions(+)
create mode 100644 sd/inc/Annotation.hxx
create mode 100644 sd/inc/AnnotationEnumeration.hxx
create mode 100644 sd/inc/CustomAnimationCloner.hxx
create mode 100644 sd/inc/CustomAnimationEffect.hxx
create mode 100644 sd/inc/CustomAnimationPreset.hxx
create mode 100644 sd/inc/DocumentRenderer.hrc
create mode 100644 sd/inc/EffectMigration.hxx
create mode 100644 sd/inc/FactoryIds.hxx
create mode 100644 sd/inc/Outliner.hxx
create mode 100644 sd/inc/OutlinerIterator.hxx
create mode 100644 sd/inc/SdShapeTypes.hxx
create mode 100644 sd/inc/TransitionPreset.hxx
create mode 100644 sd/inc/VectorGraphicSearchContext.hxx
create mode 100644 sd/inc/animations.hxx
create mode 100644 sd/inc/anminfo.hxx
create mode 100644 sd/inc/app.hrc
create mode 100644 sd/inc/bitmaps.hlst
create mode 100644 sd/inc/createpresentation.hxx
create mode 100644 sd/inc/createunocustomshow.hxx
create mode 100644 sd/inc/createunopageimpl.hxx
create mode 100644 sd/inc/cusshow.hxx
create mode 100644 sd/inc/customshowlist.hxx
create mode 100644 sd/inc/diadef.h
create mode 100644 sd/inc/drawdoc.hxx
create mode 100644 sd/inc/errhdl.hrc
create mode 100644 sd/inc/fadedef.h
create mode 100644 sd/inc/family.hrc
create mode 100644 sd/inc/glob.hxx
create mode 100644 sd/inc/helper/simplereferencecomponent.hxx
create mode 100644 sd/inc/helpids.h
create mode 100644 sd/inc/misc/scopelock.hxx
create mode 100644 sd/inc/notifydocumentevent.hxx
create mode 100644 sd/inc/pageformatpanel.hrc
create mode 100644 sd/inc/pch/precompiled_sd.cxx
create mode 100644 sd/inc/pch/precompiled_sd.hxx
create mode 100644 sd/inc/pch/precompiled_sdui.cxx
create mode 100644 sd/inc/pch/precompiled_sdui.hxx
create mode 100644 sd/inc/pglink.hxx
create mode 100644 sd/inc/pres.hxx
create mode 100644 sd/inc/prlayout.hxx
create mode 100644 sd/inc/randomnode.hxx
create mode 100644 sd/inc/resltn.hxx
create mode 100644 sd/inc/sdabstdlg.hxx
create mode 100644 sd/inc/sdattr.hrc
create mode 100644 sd/inc/sdattr.hxx
create mode 100644 sd/inc/sdcgmfilter.hxx
create mode 100644 sd/inc/sdcommands.h
create mode 100644 sd/inc/sddll.hxx
create mode 100644 sd/inc/sddllapi.h
create mode 100644 sd/inc/sdenumdef.hxx
create mode 100644 sd/inc/sderror.hxx
create mode 100644 sd/inc/sdfilter.hxx
create mode 100644 sd/inc/sdgrffilter.hxx
create mode 100644 sd/inc/sdhtmlfilter.hxx
create mode 100644 sd/inc/sdiocmpt.hxx
create mode 100644 sd/inc/sdmod.hxx
create mode 100644 sd/inc/sdpage.hxx
create mode 100644 sd/inc/sdpdffilter.hxx
create mode 100644 sd/inc/sdpptwrp.hxx
create mode 100644 sd/inc/sdresid.hxx
create mode 100644 sd/inc/sdundo.hxx
create mode 100644 sd/inc/sdxmlwrp.hxx
create mode 100644 sd/inc/shapelist.hxx
create mode 100644 sd/inc/stlfamily.hxx
create mode 100644 sd/inc/stlpool.hxx
create mode 100644 sd/inc/stlsheet.hxx
create mode 100644 sd/inc/strings.hrc
create mode 100644 sd/inc/strings.hxx
create mode 100644 sd/inc/textapi.hxx
create mode 100644 sd/inc/undo/undofactory.hxx
create mode 100644 sd/inc/undo/undomanager.hxx
create mode 100644 sd/inc/undo/undoobjects.hxx
create mode 100644 sd/inc/undoanim.hxx
(limited to 'sd/inc')
diff --git a/sd/inc/Annotation.hxx b/sd/inc/Annotation.hxx
new file mode 100644
index 000000000..707f2cdc8
--- /dev/null
+++ b/sd/inc/Annotation.hxx
@@ -0,0 +1,159 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ *
+ * This file incorporates work covered by the following license notice:
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed
+ * with this work for additional information regarding copyright
+ * ownership. The ASF licenses this file to you under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file
+ * except in compliance with the License. You may obtain a copy of
+ * the License at http://www.apache.org/licenses/LICENSE-2.0 .
+ */
+
+#pragma once
+
+#include
+#include
+#include
+
+#include
+#include
+#include
+#include
+
+#include "sdpage.hxx"
+#include "textapi.hxx"
+#include "sddllapi.h"
+
+#include
+#include
+
+class SdrUndoAction;
+
+namespace com::sun::star::office {
+ class XAnnotation;
+}
+
+namespace com::sun::star::uno { template class Reference; }
+
+class SfxViewShell;
+
+namespace sd {
+
+enum class CommentNotificationType { Add, Modify, Remove };
+
+void createAnnotation( css::uno::Reference< css::office::XAnnotation >& xAnnotation, SdPage* pPage );
+
+std::unique_ptr CreateUndoInsertOrRemoveAnnotation( const css::uno::Reference< css::office::XAnnotation >& xAnnotation, bool bInsert );
+
+void CreateChangeUndo(const css::uno::Reference< css::office::XAnnotation >& xAnnotation);
+
+sal_uInt32 getAnnotationId(const css::uno::Reference & xAnnotation);
+
+const SdPage* getAnnotationPage(const css::uno::Reference& xAnnotation);
+
+void LOKCommentNotify(CommentNotificationType nType, const SfxViewShell* pViewShell,
+ css::uno::Reference const & rxAnnotation);
+
+void LOKCommentNotifyAll(CommentNotificationType nType,
+ css::uno::Reference const & rxAnnotation);
+
+struct SD_DLLPUBLIC CustomAnnotationMarker
+{
+ Color maLineColor;
+ Color maFillColor;
+ float mnLineWidth;
+ std::vector maPolygons;
+};
+
+class Annotation final : private ::cppu::BaseMutex,
+ public ::cppu::WeakComponentImplHelper,
+ public ::cppu::PropertySetMixin
+{
+public:
+ explicit Annotation( const css::uno::Reference& context, SdPage* pPage );
+ Annotation(const Annotation&) = delete;
+ Annotation& operator=(const Annotation&) = delete;
+
+ static sal_uInt32 m_nLastId;
+
+ SdPage* GetPage() const { return mpPage; }
+ SdrModel* GetModel() { return (mpPage != nullptr) ? &mpPage->getSdrModelFromSdrPage() : nullptr; }
+ sal_uInt32 GetId() const { return m_nId; }
+
+ // XInterface:
+ virtual css::uno::Any SAL_CALL queryInterface(css::uno::Type const & type) override;
+ virtual void SAL_CALL acquire() noexcept override { ::cppu::WeakComponentImplHelper::acquire(); }
+ virtual void SAL_CALL release() noexcept override { ::cppu::WeakComponentImplHelper::release(); }
+
+ // css::beans::XPropertySet:
+ virtual css::uno::Reference SAL_CALL getPropertySetInfo() override;
+ virtual void SAL_CALL setPropertyValue(const OUString & aPropertyName, const css::uno::Any & aValue) override;
+ virtual css::uno::Any SAL_CALL getPropertyValue(const OUString & PropertyName) override;
+ virtual void SAL_CALL addPropertyChangeListener(const OUString & aPropertyName, const css::uno::Reference & xListener) override;
+ virtual void SAL_CALL removePropertyChangeListener(const OUString & aPropertyName, const css::uno::Reference & aListener) override;
+ virtual void SAL_CALL addVetoableChangeListener(const OUString & PropertyName, const css::uno::Reference & aListener) override;
+ virtual void SAL_CALL removeVetoableChangeListener(const OUString & PropertyName, const css::uno::Reference & aListener) override;
+
+ // css::office::XAnnotation:
+ virtual css::uno::Any SAL_CALL getAnchor() override;
+ virtual css::geometry::RealPoint2D SAL_CALL getPosition() override;
+ virtual void SAL_CALL setPosition(const css::geometry::RealPoint2D & the_value) override;
+ virtual css::geometry::RealSize2D SAL_CALL getSize() override;
+ virtual void SAL_CALL setSize(const css::geometry::RealSize2D& _size) override;
+ virtual OUString SAL_CALL getAuthor() override;
+ virtual void SAL_CALL setAuthor(const OUString & the_value) override;
+ virtual OUString SAL_CALL getInitials() override;
+ virtual void SAL_CALL setInitials(const OUString & the_value) override;
+ virtual css::util::DateTime SAL_CALL getDateTime() override;
+ virtual void SAL_CALL setDateTime(const css::util::DateTime & the_value) override;
+ virtual css::uno::Reference SAL_CALL getTextRange() override;
+
+ void createChangeUndo();
+
+ void createCustomAnnotationMarker()
+ {
+ m_pCustomAnnotationMarker = std::make_unique();
+ }
+
+ CustomAnnotationMarker& getCustomAnnotationMarker()
+ {
+ return *m_pCustomAnnotationMarker;
+ }
+
+ bool hasCustomAnnotationMarker() const
+ {
+ return bool(m_pCustomAnnotationMarker);
+ }
+
+private:
+ // destructor is private and will be called indirectly by the release call virtual ~Annotation() {}
+
+ // override WeakComponentImplHelperBase::disposing()
+ // This function is called upon disposing the component,
+ // if your component needs special work when it becomes
+ // disposed, do it here.
+ virtual void SAL_CALL disposing() override;
+
+ sal_uInt32 m_nId;
+ SdPage* mpPage;
+ css::geometry::RealPoint2D m_Position;
+ css::geometry::RealSize2D m_Size;
+ OUString m_Author;
+ OUString m_Initials;
+ css::util::DateTime m_DateTime;
+ rtl::Reference m_TextRange;
+
+ std::unique_ptr m_pCustomAnnotationMarker;
+};
+
+}
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sd/inc/AnnotationEnumeration.hxx b/sd/inc/AnnotationEnumeration.hxx
new file mode 100644
index 000000000..ed35b46b4
--- /dev/null
+++ b/sd/inc/AnnotationEnumeration.hxx
@@ -0,0 +1,37 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ *
+ * This file incorporates work covered by the following license notice:
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed
+ * with this work for additional information regarding copyright
+ * ownership. The ASF licenses this file to you under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file
+ * except in compliance with the License. You may obtain a copy of
+ * the License at http://www.apache.org/licenses/LICENSE-2.0 .
+ */
+
+#pragma once
+
+#include
+
+#include "sdpage.hxx"
+
+namespace com::sun::star::office
+{
+class XAnnotationEnumeration;
+}
+
+namespace sd
+{
+css::uno::Reference
+createAnnotationEnumeration(AnnotationVector&&);
+}
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sd/inc/CustomAnimationCloner.hxx b/sd/inc/CustomAnimationCloner.hxx
new file mode 100644
index 000000000..5cc71b0e6
--- /dev/null
+++ b/sd/inc/CustomAnimationCloner.hxx
@@ -0,0 +1,33 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ *
+ * This file incorporates work covered by the following license notice:
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed
+ * with this work for additional information regarding copyright
+ * ownership. The ASF licenses this file to you under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file
+ * except in compliance with the License. You may obtain a copy of
+ * the License at http://www.apache.org/licenses/LICENSE-2.0 .
+ */
+
+#pragma once
+
+#include
+
+class SdPage;
+
+namespace sd
+{
+css::uno::Reference
+Clone(const css::uno::Reference& xSourceNode,
+ const SdPage* pSource = nullptr, const SdPage* pTarget = nullptr);
+}
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sd/inc/CustomAnimationEffect.hxx b/sd/inc/CustomAnimationEffect.hxx
new file mode 100644
index 000000000..e117783c9
--- /dev/null
+++ b/sd/inc/CustomAnimationEffect.hxx
@@ -0,0 +1,454 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ *
+ * This file incorporates work covered by the following license notice:
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed
+ * with this work for additional information regarding copyright
+ * ownership. The ASF licenses this file to you under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file
+ * except in compliance with the License. You may obtain a copy of
+ * the License at http://www.apache.org/licenses/LICENSE-2.0 .
+ */
+
+#pragma once
+
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+#include "sddllapi.h"
+#include
+#include
+#include
+
+ The start position is restored after finishing spell checking or
+ replacing all matches in a document.
+
+ Some related pieces of information:
+ The search dialog (SvxSearchDialog) can be controlled in
+ more than one way:
+
- A set of option flags returned by the slot call
+ SID_SEARCH_OPTIONS handled by the
+ SdDrawDocument::GetState() method.
+ - The contents of the search item of type
+ SvxSearchItem.
+ - The HasSelection() view shell method that returns
+ whether or not a selection exists. However, it is called from the
+ search dialog with an argument so that only text selections are
+ queried. This is only sufficient for searching the outline view.
+
+*/
+class SdOutliner final : public SdrOutliner
+{
+public:
+ friend class ::sd::outliner::OutlinerContainer;
+
+ /** Create a new sd outliner object.
+ @param pDoc
+ The draw document from which to take the content.
+ @param nMode
+ The valid values OutlinerMode::DontKnow,
+ OutlinerMode::TextObject,
+ OutlinerMode::TitleObject,
+ OutlinerMode::OutlineObject, and
+ OutlinerMode::OutlineView are defined in
+ editeng/outliner.hxx.
+ */
+ SdOutliner(SdDrawDocument* pDoc, OutlinerMode nMode);
+ virtual ~SdOutliner() override;
+ /// Forbid copy construction and copy assignment
+ SdOutliner(const Outliner&) = delete;
+ SdOutliner& operator=(const Outliner&) = delete;
+
+ /** Despite the name this method is called prior to spell checking *and*
+ searching and replacing. The position of current view
+ mode/page/object/caret position is remembered and, depending on the
+ search mode, may be restored after finishing searching/spell
+ checking.
+ */
+ void PrepareSpelling();
+
+ /** Initialize a spell check but do not start it yet. This method
+ is a better candidate for the name PrepareSpelling.
+ */
+ void StartSpelling();
+
+ /** Initiate a find and/or replace on the next relevant text object.
+ @return
+ Returns when the search/replace is finished (as
+ indicated by user input to the search dialog). A value
+ indicates that another call to this method is required.
+ */
+ bool StartSearchAndReplace(const SvxSearchItem* pSearchItem);
+
+ /** Iterate over the sentences in all text shapes and stop at the
+ next sentence with spelling errors. While doing so the view
+ mode may be changed and text shapes are set into edit mode.
+ */
+ svx::SpellPortions GetNextSpellSentence();
+
+ /** Release all resources that have been created during the find&replace
+ or spell check.
+ */
+ void EndSpelling();
+
+ /** callback for textconversion */
+ bool ConvertNextDocument() override;
+
+ /** Starts the text conversion (hangul/hanja or Chinese simplified/traditional)
+ for the current viewshell */
+ void StartConversion(LanguageType nSourceLanguage, LanguageType nTargetLanguage,
+ const vcl::Font* pTargetFont, sal_Int32 nOptions, bool bIsInteractive);
+
+ /** This is called internally when text conversion is started.
+ The position of current view mode/page/object/caret position
+ is remembered and will be restored after conversion.
+ */
+ void BeginConversion();
+
+ /** Release all resources that have been created during the conversion */
+ void EndConversion();
+
+ int GetIgnoreCurrentPageChangesLevel() const { return mnIgnoreCurrentPageChangesLevel; };
+ void IncreIgnoreCurrentPageChangesLevel() { mnIgnoreCurrentPageChangesLevel++; };
+ void DecreIgnoreCurrentPageChangesLevel() { mnIgnoreCurrentPageChangesLevel--; };
+ SdDrawDocument* GetDoc() const { return mpDrawDocument; }
+
+private:
+ class Implementation;
+ ::std::unique_ptr mpImpl;
+
+ /// Returns the current outline view
+ OutlinerView* getOutlinerView();
+
+ /// Specifies whether to search and replace, to spell check or to do a
+ /// text conversion.
+ enum mode
+ {
+ SEARCH,
+ SPELL,
+ TEXT_CONVERSION
+ } meMode;
+
+ /// The view which displays the searched objects.
+ ::sd::View* mpView;
+ /** The view shell containing the view. It is held as weak
+ pointer to avoid keeping it alive when the view is changed
+ during searching.
+ */
+ std::weak_ptr<::sd::ViewShell> mpWeakViewShell;
+ /// This window contains the view.
+ VclPtr<::sd::Window> mpWindow;
+ /// The document on whose objects and pages this class operates.
+ SdDrawDocument* mpDrawDocument;
+
+ /** this is the language that is used for current text conversion.
+ Only valid if meMode is TEXT_CONVERSION.
+ */
+ LanguageType mnConversionLanguage;
+
+ /** While the value of this flag is greater than 0 changes of the current page
+ do not lead to selecting the corresponding text in the outliner.
+ */
+ int mnIgnoreCurrentPageChangesLevel;
+
+ /// Specifies whether the search string has been found so far.
+ bool mbStringFound;
+
+ /** This flag indicates whether there may exist a match of the search
+ string before/after the current position in the document. It can be
+ set to only when starting from the beginning/end of the
+ document. When reaching the end/beginning with it still be set to
+ then there exists no match and the search can be terminated.
+ */
+ bool mbMatchMayExist;
+
+ /// The number of pages in the current view.
+ sal_uInt16 mnPageCount;
+
+ /** A value indicates that the end of the find&replace or spell
+ check has been reached.
+ */
+ bool mbEndOfSearch;
+
+ /** Set to when an object has been prepared successfully for
+ searching/spell checking. This flag directs the internal iteration
+ which stops when set to .
+ */
+ bool mbFoundObject;
+
+ /** This flag indicates whether to search forward or backwards.
+ */
+ bool mbDirectionIsForward;
+
+ /** This flag indicates that only the selected objects are to be
+ searched.
+ */
+ bool mbRestrictSearchToSelection;
+
+ /** When the search is restricted to the current selection then
+ this list contains pointers to all the objects of the
+ selection. This copy is necessary because during the search
+ process the mark list is modified.
+ */
+ ::std::vector> maMarkListCopy;
+
+ /** Current object that may be a text object. The object pointer to
+ corresponds to mnObjIndex. While iterating over the
+ objects on a page mpObj will point to every object
+ while mpTextObj will be set only to valid text
+ objects.
+ */
+ SdrObject* mpObj;
+
+ /** this stores the first object that is used for text conversion.
+ Conversion automatically wraps around the document and stops when it
+ finds this object again.
+ */
+ SdrObject* mpFirstObj;
+
+ /// Candidate for being searched/spell checked.
+ SdrTextObj* mpSearchSpellTextObj;
+
+ /// Current text to be searched/spelled inside the current text object
+ sal_Int32 mnText;
+
+ /// Paragraph object of mpTextObj.
+ OutlinerParaObject* mpParaObj;
+
+ /// The view mode that was active when starting to search/spell check.
+ PageKind meStartViewMode;
+
+ /// The master page mode that was active when starting to search/spell check.
+ EditMode meStartEditMode;
+
+ /// The current page index on starting to search/spell check.
+ sal_uInt16 mnStartPageIndex;
+
+ /// The object in edit mode when searching /spell checking was started
+ /// (if any).
+ SdrObject* mpStartEditedObject;
+
+ /// The position of the caret when searching /spell checking was started.
+ ESelection maStartSelection;
+
+ /** The search item contains various attributes that define the type of
+ search. It is set every time the
+ SearchAndReplaceAll method is called.
+ */
+ std::unique_ptr mpSearchItem;
+
+ /// The actual object iterator.
+ ::sd::outliner::Iterator maObjectIterator;
+ /// The current position of the object iterator.
+ ::sd::outliner::IteratorPosition maCurrentPosition;
+ /// The position when the search started. Corresponds largely to the
+ /// m?Start* members.
+ ::sd::outliner::Iterator maSearchStartPosition;
+ /** The last valid position describes where the last text object has been
+ found. This position is restored when some dialogs are shown. The
+ position is initially set to the where the search begins.
+ */
+ ::sd::outliner::IteratorPosition maLastValidPosition;
+
+ /** When this flag is true then a PrepareSpelling() is executed when
+ StartSearchAndReplace() is called the next time.
+ */
+ bool mbPrepareSpellingPending;
+
+ /** Initialize the object iterator. Call this method after being
+ invoked from the search or spellcheck dialog. It creates a new
+ iterator pointing at the current object when this has not been done
+ before. It reverses the direction of iteration if the given flag
+ differs from the current direction.
+ @param bDirectionIsForward
+ This flag specifies in which direction to iterator over the
+ objects. If it differs from the current direction the iterator
+ is reversed.
+ */
+ void Initialize(bool bDirectionIsForward);
+
+ /** Do search and replace for whole document.
+ */
+ bool SearchAndReplaceAll();
+
+ /** Do search and replace for next match.
+ @param pSelections
+ When tiled rendering and not 0, then don't emit LOK events, instead
+ assume the caller will do so.
+ @return
+ The return value specifies whether the search ended () or
+ another call to this method is required ().
+ */
+ bool SearchAndReplaceOnce(std::vector<::sd::SearchSelection>* pSelections = nullptr);
+
+ void sendLOKSearchResultCallback(const std::shared_ptr& pViewShell,
+ const OutlinerView* pOutlinerView,
+ std::vector* pSelections);
+
+ /** Detect changes of the document or view and react accordingly. Such
+ changes may occur because different calls to
+ SearchAndReplace() there usually is user
+ interaction. This is at least the press of the search or replace
+ button but may include any other action some of which affect the
+ search.
+ */
+ void DetectChange();
+
+ /** Detect whether the selection has changed.
+ @return
+ Return when the selection has been changed since the
+ last call to this method.
+ */
+ bool DetectSelectionChange();
+
+ /** Remember the current edited object/caret position/page/view mode
+ when starting to search/spell check so that it can be restored on
+ termination.
+ */
+ void RememberStartPosition();
+
+ /** Restore the position stored in the last call of
+ RememberStartPositiony.
+ */
+ void RestoreStartPosition();
+
+ /** Provide next object to search or spell check as text object in edit
+ mode on the current page. This skips all objects that do not
+ match or are no text object.
+ */
+ void ProvideNextTextObject();
+
+ /** Handle the situation that the iterator has reached the last object.
+ This may result in setting the mbEndOfSearch flag
+ back to . This method may show either the end-of-search
+ dialog or the wrap-around dialog.
+ */
+ void EndOfSearch();
+
+ /** Show a dialog that tells the user that the search has ended either
+ because there are no more matches after finding at least one or that
+ no match has been found at all.
+ */
+ void ShowEndOfSearchDialog();
+
+ /** Show a dialog that asks the user whether to wrap around to the
+ beginning/end of the document and continue with the search/spell
+ check.
+ */
+ bool ShowWrapAroundDialog();
+
+ /** Put text of current text object into outliner so that the text can
+ be searched/spell checked.
+ */
+ void PutTextIntoOutliner();
+
+ /** Prepare to do spell checking on the current text object. This
+ includes putting it into edit mode. Under certain conditions this
+ method sets mbEndOfSearch to .
+ */
+ void PrepareSpellCheck();
+
+ /** Prepare to search and replace on the current text object. This
+ includes putting it into edit mode.
+ */
+ void PrepareSearchAndReplace();
+
+ /** Prepare to do a text conversion on the current text
+ object. This includes putting it into edit mode.
+ */
+ void PrepareConversion();
+
+ /** Switch to a new view mode. Try to restore the original edit mode
+ before doing so.
+ @param ePageKind
+ Specifies the new view mode.
+ */
+ void SetViewMode(PageKind ePageKind);
+
+ /** Switch to the page or master page specified by the
+ mnPage index. Master page mode is specified by
+ meEditMode.
+ @param eEditMode
+ The new edit mode.
+ @param nPageIndex
+ The new page index.
+ */
+ void SetPage(EditMode eEditMode, sal_uInt16 nPageIndex);
+
+ /** Switch on edit mode for the currently selected text object.
+ */
+ void EnterEditMode(bool bGrabFocus);
+
+ /** Return the position at which a new search is started with respect to
+ the search direction as specified by the argument.
+ @return
+ The position mentioned above in form of a selection with start
+ equals end.
+ */
+ ESelection GetSearchStartPosition() const;
+
+ /** Detect whether there exists a previous match. Note that only the
+ absence of such a match can be detected reliably. An existing match
+ is assumed when the search started not at the beginning/end of the
+ presentation. This does not have to be true. The user can have set
+ the cursor at the middle of the text without a prior search.
+ @return
+ Returns when there is no previous match and
+ when there may be one.
+ */
+ bool HasNoPreviousMatch();
+
+ /** Handle a failed search (with or without replace) for the outline
+ mode. Show message boxes when the search failed completely,
+ i.e. there is no match in the whole presentation, or when no further
+ match exists.
+ @return
+ The returned value indicates whether another (wrapped around)
+ search shall take place. If that is so, then it is the caller's
+ responsibility to set the cursor position accordingly.
+ */
+ bool HandleFailedSearch();
+
+ /** Take a position as returned by an object iterator and switch to the
+ view and page on which the object specified by this position is
+ located.
+ @param rPosition
+ This position points to a SdrObject object and
+ contains the view and page where it is located.
+ @return
+ Return a pointer to the SdrObject.
+ */
+ SdrObject* SetObject(const ::sd::outliner::IteratorPosition& rPosition);
+
+ /** Use this method when the view shell in which to search has changed.
+ It handles i.e. registering at the associated view as selection
+ change listener.
+ */
+ void SetViewShell(const std::shared_ptr<::sd::ViewShell>& rpViewShell);
+
+ /** Activate or deactivate the search in the current selection. Call
+ this method whenever the selection has changed. This method creates
+ a copy of the current selection and reassigns the object iterator to
+ the current() iterator.
+ */
+ void HandleChangedSelection();
+
+ /** Initiate the spell check of the next relevant text object.
+ When the outline view is active then this method is called
+ after a wrap around to continue at the beginning of the document.
+ @return
+ Returns to indicate that another call to this method is
+ required. When all text objects have been processed then
+ is returned.
+ */
+ virtual bool SpellNextDocument() override;
+
+ /** Find the right parent to use for a message. This function makes sure
+ that the otherwise non-modal search or spell dialogs, if visible, are
+ locked, too.
+ */
+ weld::Window* GetMessageBoxParent();
+};
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sd/inc/OutlinerIterator.hxx b/sd/inc/OutlinerIterator.hxx
new file mode 100644
index 000000000..d160609d8
--- /dev/null
+++ b/sd/inc/OutlinerIterator.hxx
@@ -0,0 +1,314 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ *
+ * This file incorporates work covered by the following license notice:
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed
+ * with this work for additional information regarding copyright
+ * ownership. The ASF licenses this file to you under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file
+ * except in compliance with the License. You may obtain a copy of
+ * the License at http://www.apache.org/licenses/LICENSE-2.0 .
+ */
+
+#pragma once
+
+#include
+
+#include "pres.hxx"
+#include
+#include
+#include
+
+class SdDrawDocument;
+class SdOutliner;
+
+namespace sd {
+
+class ViewShell;
+
+namespace outliner {
+
+class IteratorImplBase;
+class IteratorPosition;
+
+/** Use this enum to specify the initial location of the object pointed to by
+ a newly created iterator. The values are
+
- BEGIN for the first object with reference to
+ iteration direction.
+ - END for one past the last valid object or, if the iterator is a
+ backward iterator, the object in front of the first valid one.
+ - CURRENT for the current object. Because there is only a current
+ page this usually is taken to be the first/last object on the current
+ page.
+*/
+enum IteratorLocation {BEGIN,END,CURRENT};
+
+/** This iterator can be used to iterate over all SdrObject
+ objects of one of three set denoted by the IteratorType:
+ - All objects of the current mark list (selection)
+ (type==SELECTION).
+ - All objects in the current view (type==SINGLE_VIEW).
+ - All objects in all views (type=DOCUMENT).
+
+ Note that the iterator does not change pages or views. It is the
+ task of the user of the iterator to take the information provided by the
+ IteratorPosition as returned by the
+ operator*() method and set view, visible page, and
+ selection/edit mode markers to reflect this position.
+
+ A simple forward iteration from the first to the last object would
+ instantiate the iterator with
+ Iterator(pDocument,pViewShell,true,BEGIN)
for some document
+ and view shell. This iterator can then be compared against
+ Iterator(pDocument,pViewShell,true,END)
. On equality the
+ iteration should be stopped without evaluating the iterator: The position
+ of an end iterator is not valid.
+*/
+class Iterator
+{
+public:
+ Iterator();
+
+ /** The copy constructor creates a new iterator by copying the
+ implementation object.
+ */
+ Iterator (const Iterator& rIterator);
+ Iterator(Iterator&& rIterator) noexcept;
+
+ /** Create a new iterator with the implementation object being the
+ provided one.
+ @param pObject
+ A copy of this object will become the implementation object.
+ */
+ explicit Iterator (std::unique_ptr pObject);
+
+ ~Iterator();
+
+ /** Assign the iterator from the given one. The implementation object
+ of this iterator will be a copy of the given iterator.
+ @param rIterator
+ The iterator which to assign from.
+ */
+ Iterator& operator= (const Iterator& rIterator);
+ Iterator& operator=(Iterator&& rIterator) noexcept;
+
+ /** Return the current position of the iterator.
+ @return
+ Returns a reference to the current position. Therefore this
+ method is not thread safe. The reason for this behaviour is, of
+ course, to omit the copying of the returned position.
+ */
+ const IteratorPosition& operator* () const;
+ /** The prefix increment operator returns the iterator pointing to the
+ next object. When in doubt prefer this operator over the postfix
+ increment operator.
+ @return
+ Returns a reference to this iterator pointing to the next object.
+ */
+ Iterator& operator++ ();
+ /** Test equality of two iterators. Two iterators are taken to be equal
+ when they point are of the same type (their implementation objects
+ are instances of the same class) and point to the same object.
+ @param rIterator
+ The iterator to test equality with.
+ @return
+ Returns when both iterators point to the same object.
+ */
+ bool operator== (const Iterator& rIterator) const;
+ /** Test whether two iterators point to different objects. This is just
+ the negation of the result of the equality operator.
+ @param rIterator
+ The iterator to test inequality with.
+ @return
+ Returns when both iterators point to the different objects.
+ */
+ bool operator!= (const Iterator& rIterator) const;
+ /** Reverse the direction of iteration. The position of the iterator is
+ not changed. Thus calling this method twice returns to the old state.
+ */
+ void Reverse();
+
+private:
+ /// The implementation object to which most of the methods are forwarded.
+ std::unique_ptr mxIterator;
+};
+
+/** This class wraps the SdOutliner class and represents it as
+ a container of SdrObject objects. Its main purpose is to
+ provide iterators for certain sub-sets of those objects. These sub-sets
+ are a) the set of the currently selected objects, b) all objects in the
+ current view, and c) all objects in all views.
+
+ The direction of the returned iterators depends on the underlying
+ SdOutliner object and is usually set in the search
+ dialog.
+*/
+class OutlinerContainer
+{
+public:
+ /** Create a new wrapper object for the given outliner.
+ @param pOutliner
+ The outliner that is represented by the new object as
+ SdrObject container.
+ */
+ OutlinerContainer (SdOutliner* pOutliner);
+
+ /** Return an iterator that points to the first object of one of the
+ sets described above. This takes also into account the direction of
+ iteration.
+ @return
+ The returned iterator points either to the first (forward
+ search) or to the last object (backward search) of the set.
+ */
+ Iterator begin();
+
+ /** Return an iterator that marks the end of the iteration. This takes
+ also into account the direction of iteration. The object pointed to
+ is not valid.
+ @return
+ The returned iterator points either to that object past the last
+ one (forward search) or to the one in front of the first
+ (backward search).
+ */
+ Iterator end();
+
+ /** Return an iterator that points to the current object of one of the
+ sets described above. This takes also into account the direction of
+ iteration.
+ @return
+ The returned iterator points either to the first (forward
+ search) or to the last object (backward search) of the set of
+ selected objects or of the current page if the search set spans
+ more than one page.
+ */
+ Iterator current();
+
+private:
+ /// The wrapped outliner that is represented as object container.
+ SdOutliner* mpOutliner;
+
+ /** Create an iterator. The object pointed to depends on the search
+ direction retrieved from the outliner object
+ mpOutliner and the given location.
+ @param aLocation
+ This specifies whether the returned iterator points to the
+ first, (one past the) last, or current object.
+ @return
+ Returns an iterator as constructed by
+ CreateSelectionIterator(),
+ */
+ Iterator CreateIterator (IteratorLocation aLocation);
+
+ /** Create an iterator that iterates over all currently selected
+ SdrObjects objects of the mpOutliner
+ outliner.
+ @param rObjectList
+ List of currently selected objects. This list is necessary
+ so that the selection can be changed without affecting the
+ iterator.
+ @param pDocument
+ The document to which the objects belong.
+ @param pViewShell
+ The view shell which displays the objects.
+ @param bDirectionIsForward
+ The direction of iteration. It defaults to forward.
+ @param aLocation
+ This specifies at which object the iterator points initially.
+ */
+ static Iterator CreateSelectionIterator (
+ const ::std::vector<::tools::WeakReference>& rObjectList,
+ SdDrawDocument* pDocument,
+ const std::shared_ptr& rpViewShell,
+ bool bDirectionIsForward,
+ IteratorLocation aLocation);
+
+ /** Create an iterator that iterates over all SdrObjects
+ objects of the mpOutliner outliner.
+ @param pDocument
+ The document to which the objects belong.
+ @param pViewShell
+ The view shell which displays the objects.
+ @param bDirectionIsForward
+ The direction of iteration. It defaults to forward.
+ @param aLocation
+ This specifies at which object the iterator points initially.
+ */
+ static Iterator CreateDocumentIterator (
+ SdDrawDocument* pDocument,
+ const std::shared_ptr& rpViewShell,
+ bool bDirectionIsForward,
+ IteratorLocation aLocation);
+
+ /** Return the index of a page that contains an object that a new
+ iterator shall point to. This page index depends primarily on the
+ location, iteration direction, as well as on edit mode and page
+ kind.
+ @param pDocument
+ The document to which the page belongs.
+ @param pViewShell
+ The view shell which displays the page.
+ @param ePageKind
+ Specifies the view the page belongs to.
+ @param eEditMode
+ Specifies whether the page is a master page.
+ @param bDirectionIsForward
+ The direction of iteration.
+ @param aLocation
+ This specifies at which object the iterator points initially.
+ */
+ static sal_Int32 GetPageIndex (
+ SdDrawDocument const * pDocument,
+ const std::shared_ptr& rpViewShell,
+ PageKind ePageKind,
+ EditMode eEditMode,
+ bool bDirectionIsForward,
+ IteratorLocation aLocation);
+
+ // Do not allow default constructor and copying of outliner containers.
+ OutlinerContainer (const OutlinerContainer&) = delete;
+ OutlinerContainer& operator= (const OutlinerContainer&) = delete;
+};
+
+/** Data collection specifying a SdrObject and its position in
+ a document and view.
+*/
+class IteratorPosition
+{
+public:
+ /** Create a new object with all data members set to default values.
+ These values should not be accessed. The only use of the object as
+ it is as a marker in comparisons.
+ */
+ IteratorPosition();
+
+ /** Compare two positions for equality.
+ @return
+ is returned only when all data members have the same
+ values in both position objects.
+ */
+ bool operator== (const IteratorPosition& aPosition) const;
+
+ /// Pointer to the actual SdrObject object.
+ ::tools::WeakReference mxObject;
+
+ /// Number of the actual SdrText from the current SdrObject
+ sal_Int32 mnText;
+
+ /// The index of a page where the object is located on.
+ sal_Int32 mnPageIndex;
+ /// Page kind of the view.
+ PageKind mePageKind;
+ /// Edit mode of the view.
+ EditMode meEditMode;
+};
+
+} } // end of namespace ::sd::outliner
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sd/inc/SdShapeTypes.hxx b/sd/inc/SdShapeTypes.hxx
new file mode 100644
index 000000000..ef944e593
--- /dev/null
+++ b/sd/inc/SdShapeTypes.hxx
@@ -0,0 +1,51 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ *
+ * This file incorporates work covered by the following license notice:
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed
+ * with this work for additional information regarding copyright
+ * ownership. The ASF licenses this file to you under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file
+ * except in compliance with the License. You may obtain a copy of
+ * the License at http://www.apache.org/licenses/LICENSE-2.0 .
+ */
+
+#pragma once
+
+namespace accessibility
+{
+/** Register the SD presentation shape types with the ShapeTypeHandler singleton.
+ This method is usually called while loading the sd library.
+*/
+void RegisterImpressShapeTypes();
+
+/** Enum describing all shape types known in the SD project.
+*/
+enum SdShapeTypes
+{
+ PRESENTATION_OUTLINER,
+ PRESENTATION_SUBTITLE,
+ PRESENTATION_GRAPHIC_OBJECT,
+ PRESENTATION_PAGE,
+ PRESENTATION_OLE,
+ PRESENTATION_CHART,
+ PRESENTATION_TABLE,
+ PRESENTATION_NOTES,
+ PRESENTATION_TITLE,
+ PRESENTATION_HANDOUT,
+ PRESENTATION_HEADER,
+ PRESENTATION_FOOTER,
+ PRESENTATION_DATETIME,
+ PRESENTATION_PAGENUMBER
+};
+
+} // end of namespace accessibility
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sd/inc/TransitionPreset.hxx b/sd/inc/TransitionPreset.hxx
new file mode 100644
index 000000000..0075e3205
--- /dev/null
+++ b/sd/inc/TransitionPreset.hxx
@@ -0,0 +1,78 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ *
+ * This file incorporates work covered by the following license notice:
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed
+ * with this work for additional information regarding copyright
+ * ownership. The ASF licenses this file to you under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file
+ * except in compliance with the License. You may obtain a copy of
+ * the License at http://www.apache.org/licenses/LICENSE-2.0 .
+ */
+
+#pragma once
+
+#include
+
+#include
+#include