/* -*- 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 . */ #ifndef INCLUDED_SW_INC_FMTFLD_HXX #define INCLUDED_SW_INC_FMTFLD_HXX #include #include #include #include #include "swdllapi.h" #include class SwField; class SwTextField; class SwView; class SwFieldType; // ATT_FLD class SW_DLLPUBLIC SwFormatField : public SfxPoolItem , public SwModify , public SfxBroadcaster { friend void InitCore(); SwFormatField( sal_uInt16 nWhich ); // for default-Attibute css::uno::WeakReference m_wXTextField; SwField* mpField; SwTextField* mpTextField; // the TextAttribute // @@@ copy construction allowed, but copy assignment is not? @@@ SwFormatField& operator=(const SwFormatField& rField) = delete; protected: virtual void Modify( const SfxPoolItem* pOld, const SfxPoolItem *pNew) override; virtual void SwClientNotify( const SwModify& rModify, const SfxHint& rHint ) override; public: /// Single argument constructors shall be explicit. explicit SwFormatField( const SwField &rField ); /// @@@ copy construction allowed, but copy assignment is not? @@@ SwFormatField( const SwFormatField& rAttr ); virtual ~SwFormatField() override; /// "Pure virtual methods" of SfxPoolItem. virtual bool operator==( const SfxPoolItem& ) const override; virtual SfxPoolItem* Clone( SfxItemPool* pPool = nullptr ) const override; virtual bool GetInfo( SfxPoolItem& rInfo ) const override; void InvalidateField(); const SwField* GetField() const { return mpField; } SwField* GetField() { return mpField; } /** Sets current field. @param pField new field @attention The current field will be destroyed before setting the new field. */ void SetField( SwField * pField ); const SwTextField* GetTextField() const { return mpTextField; } SwTextField* GetTextField() { return mpTextField; } void SetTextField( SwTextField& rTextField ); void ClearTextField(); void RegisterToFieldType( SwFieldType& ); bool IsFieldInDoc() const; bool IsProtect() const; SAL_DLLPRIVATE css::uno::WeakReference const& GetXTextField() const { return m_wXTextField; } SAL_DLLPRIVATE void SetXTextField(css::uno::Reference const& xTextField) { m_wXTextField = xTextField; } void dumpAsXml(struct _xmlTextWriter* pWriter) const override; }; enum class SwFormatFieldHintWhich { INSERTED = 1, REMOVED = 2, FOCUS = 3, CHANGED = 4, LANGUAGE = 5 }; class SW_DLLPUBLIC SwFormatFieldHint : public SfxHint { const SwFormatField* pField; SwFormatFieldHintWhich nWhich; const SwView* pView; public: SwFormatFieldHint( const SwFormatField* p, SwFormatFieldHintWhich n, const SwView* pV = nullptr) : pField(p) , nWhich(n) , pView(pV) {} const SwFormatField* GetField() const { return pField; } SwFormatFieldHintWhich Which() const { return nWhich; } const SwView* GetView() const { return pView; } }; #endif /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ on value='distro/collabora/cp-6.0-29'>distro/collabora/cp-6.0-29 LibreOffice 核心代码仓库文档基金会
summaryrefslogtreecommitdiff
AgeCommit message (Collapse)Author
2023-04-21loplugin:unnecessarygetstr extend to checking std::string::c_strNoel Grandin
Change-Id: I17398e2a6a31a2c98ba8e54b5c8045f22aee8759 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/150749 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2023-04-09new loplugin:unnecessarygetstrNoel Grandin
which prevents constructing unnecessary temporaries via getStr() Change-Id: I9ca70893a10e954b5ee0e6ad6098660ee24c2bef Reviewed-on: https://gerrit.libreoffice.org/c/core/+/150170 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2023-01-26Upgrade mdds and orcus to 2.1.0 and 0.18.0, respectivelyKohei Yoshida
Change-Id: I288b5b54bd07d951bcc68afda7514bde730193dc Reviewed-on: https://gerrit.libreoffice.org/c/core/+/146107 Tested-by: Jenkins Reviewed-by: Kohei Yoshida <kohei@libreoffice.org>
2022-08-07clang-tidy modernize-pass-by-value in scNoel Grandin
Change-Id: Ia7ff651d1cbc119b36a9f8052594d03650988f59 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/137848 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2022-02-04add toId/fromId to tidy up some ugly castingCaolán McNamara
Change-Id: I70f34ac5e9b5d2f2d6c0375e823908eaa2e540b2 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/129487 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com>
2021-11-03Upgrade mdds and liborcus to 2.0.0 and 0.17.0, respectively.Kohei Yoshida
Change-Id: I9e856fc2d61f1789a6f1702514837860539a0f49 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/124573 Tested-by: Jenkins Tested-by: René Engelhard <rene@debian.org> Reviewed-by: Kohei Yoshida <kohei@libreoffice.org>
2020-09-12Upgrade liborcus to 0.16.0.Kohei Yoshida
Change-Id: Iae29fb26417dfc161698a81bee84e81545969065 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/102502 Tested-by: Jenkins Reviewed-by: Kohei Yoshida <kohei@libreoffice.org>
2020-06-05have just one way to set expander imageCaolán McNamara
Change-Id: Ic07709a864620c6146616c8e0a1417343c0937de Reviewed-on: https://gerrit.libreoffice.org/c/core/+/95590 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com>