/* -*- 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 .
*/
// construct pool before constructing EditEngine, destroy pool after EditEngine class ScEnginePoolHelper
{ protected:
rtl::Reference<SfxItemPool> m_pEnginePool;
std::optional<SfxItemSet> m_oDefaults; bool m_bDeleteEnginePool;
class SC_DLLPUBLIC ScEditEngineDefaulter : public ScEnginePoolHelper, public EditEngine
{ public: using EditEngine::SetText; /// bDeleteEnginePool: Engine becomes the owner of the pool /// and deletes it on destruction
ScEditEngineDefaulter( SfxItemPool* pEnginePool, bool bDeleteEnginePool = false ); /// If rOrg.bDeleteEnginePool: pool gets cloned and will be /// deleted on destruction. Defaults are not set.
ScEditEngineDefaulter( const ScEditEngineDefaulter& rOrg ); virtual ~ScEditEngineDefaulter() override;
/// Creates a copy of SfxItemSet void SetDefaults( const SfxItemSet& rDefaults );
/// Becomes the owner of the SfxItemSet void SetDefaults( SfxItemSet&& aDefaults );
/// Set the item in the default ItemSet which is created /// if it doesn't exist yet. /// The default ItemSet is then applied to each paragraph. void SetDefaultItem( const SfxPoolItem& rItem );
/// Returns the stored defaults, used to find non-default character attributes const SfxItemSet& GetDefaults();
/// SetText and apply defaults already set void SetTextCurrentDefaults( const EditTextObject& rTextObject ); /// Current defaults are not applied, new defaults are applied void SetTextNewDefaults( const EditTextObject& rTextObject,
SfxItemSet&& aDefaults ); /// New defaults are applied, but not stored void SetTextTempDefaults( const EditTextObject& rTextObject, const SfxItemSet& rDefaults );
/// SetText and apply defaults already set void SetTextCurrentDefaults( const OUString& rText ); /// Current defaults are not applied, new defaults are applied void SetTextNewDefaults( const OUString& rText, SfxItemSet&& aDefaults );
/// Paragraph attributes that are not defaults are copied to /// character attributes and all paragraph attributes reset void RemoveParaAttribs();
/// Re-apply existing defaults if set, same as in SetText, /// but without EnableUndo/SetUpdateMode. void RepeatDefaults();
private: /// Apply the passed defaults, without storing them void ApplyDefaults(const SfxItemSet& rNewSet);
};
// for field commands (or just fields?) in a table class SC_DLLPUBLIC ScFieldEditEngine : public ScEditEngineDefaulter
{ private:
ScDocument* mpDoc; bool bExecuteURL;
// 1/100 mm class SC_DLLPUBLIC ScTabEditEngine final : public ScFieldEditEngine
{ private: void Init(const ScPatternAttr& rPattern); public:
ScTabEditEngine( ScDocument& rDoc ); // Default
ScTabEditEngine(const ScPatternAttr& rPattern,
SfxItemPool *pEngineItemPool, ScDocument& rDoc,
SfxItemPool* pTextObjectPool = nullptr );
};
struct ScHeaderFieldData
{
OUString aTitle; // title or file name (if no title)
OUString aLongDocName; // path and file name
OUString aShortDocName; // pure file name
OUString aTabName;
DateTime aDateTime;
tools::Long nPageNo;
tools::Long nTotalPages;
SvxNumType eNumType;
ScHeaderFieldData();
};
// for headers/footers with fields class SC_DLLPUBLIC ScHeaderEditEngine final : public ScEditEngineDefaulter
{ private:
ScHeaderFieldData aData;
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.