/* -*- 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_NDOLE_HXX #define INCLUDED_SW_INC_NDOLE_HXX #include #include #include class SwGrfFormatColl; class SwDoc; class SwOLENode; class SwOLEListener_Impl; class SwEmbedObjectLink; class DeflateData; class SW_DLLPUBLIC SwOLEObj { friend class SwOLENode; const SwOLENode* pOLENd; SwOLEListener_Impl* pListener; /** Either ref or name are known. If only name is known, ref is obtained on demand by GetOleRef() from Sfx. */ svt::EmbeddedObjectRef xOLERef; OUString aName; // eventually buffered data if it is a chart OLE drawinglayer::primitive2d::Primitive2DContainer m_aPrimitive2DSequence; basegfx::B2DRange m_aRange; class DeflateData* m_pDeflateData; SwOLEObj( const SwOLEObj& rObj ) = delete; void SetNode( SwOLENode* pNode ); public: SwOLEObj( const svt::EmbeddedObjectRef& pObj ); SwOLEObj( const OUString &rName, sal_Int64 nAspect ); ~SwOLEObj(); bool UnloadObject(); static bool UnloadObject( css::uno::Reference< css::embed::XEmbeddedObject > const & xObj, const SwDoc* pDoc, sal_Int64 nAspect ); OUString GetDescription(); const css::uno::Reference < css::embed::XEmbeddedObject > GetOleRef(); svt::EmbeddedObjectRef& GetObject(); const OUString& GetCurrentPersistName() const { return aName; } OUString GetStyleString(); bool IsOleRef() const; ///< To avoid unnecessary loading of object. // try to get OLE visualization in form of a Primitive2DSequence // and the corresponding B2DRange. This data may be locally buffered drawinglayer::primitive2d::Primitive2DContainer const & tryToGetChartContentAsPrimitive2DSequence( basegfx::B2DRange& rRange, bool bSynchron); void resetBufferedData(); }; // SwOLENode class SW_DLLPUBLIC SwOLENode: public SwNoTextNode { friend class SwNodes; mutable SwOLEObj aOLEObj; OUString sChartTableName; ///< with chart objects: name of referenced table. bool bOLESizeInvalid; /**< Should be considered at SwDoc::PrtOLENotify (e.g. copied). Is not persistent. */ SwEmbedObjectLink* mpObjectLink; OUString maLinkURL; SwOLENode( const SwNodeIndex &rWhere, const svt::EmbeddedObjectRef&, SwGrfFormatColl *pGrfColl, SwAttrSet* pAutoAttr ); SwOLENode( const SwNodeIndex &rWhere, const OUString &rName, sal_Int64 nAspect, SwGrfFormatColl *pGrfColl, SwAttrSet* pAutoAttr ); SwOLENode( const SwOLENode & ) = delete; using SwNoTextNode::GetGraphic; public: const SwOLEObj& GetOLEObj() const { return aOLEObj; } SwOLEObj& GetOLEObj() { return aOLEObj; } virtual ~SwOLENode() override; virtual SwContentNode *SplitContentNode( const SwPosition & ) override; /// Is in ndcopy.cxx. virtual SwContentNode* MakeCopy( SwDoc*, const SwNodeIndex& ) const override; virtual Size GetTwipSize() const override; const Graphic* GetGraphic(); void GetNewReplacement(); virtual bool SavePersistentData() override; virtual bool RestorePersistentData() override; bool IsInGlobalDocSection() const; bool IsOLEObjectDeleted() const; bool IsOLESizeInvalid() const { return bOLESizeInvalid; } void SetOLESizeInvalid( bool b ){ bOLESizeInvalid = b; } sal_Int64 GetAspect() const { return aOLEObj.GetObject().GetViewAspect(); } void SetAspect( sal_Int64 nAspect) { aOLEObj.GetObject().SetViewAspect( nAspect ); } /** Remove OLE-object from "memory". inline void Unload() { aOLEObj.Unload(); } */ OUString GetDescription() const { return aOLEObj.GetDescription(); } bool UpdateLinkURL_Impl(); void BreakFileLink_Impl(); void DisconnectFileLink_Impl(); void CheckFileLink_Impl(); // #i99665# bool IsChart() const; const OUString& GetChartTableName() const { return sChartTableName; } void SetChartTableName( const OUString& rNm ) { sChartTableName = rNm; } }; /// Inline methods from Node.hxx inline SwOLENode *SwNode::GetOLENode() { return SwNodeType::Ole == m_nNodeType ? static_cast(this) : nullptr; } inline const SwOLENode *SwNode::GetOLENode() const { return SwNodeType::Ole == m_nNodeType ? static_cast(this) : nullptr; } #endif // _ INCLUDED_SW_INC_NDOLE_HXX /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ /option> LibreOffice 核心代码仓库文档基金会
summaryrefslogtreecommitdiff
AgeCommit message (Collapse)Author
2019-11-26tdf#126043 fetch the command properties just onceCaolán McNamara
Change-Id: Iaf343e9858be36ca8772d9c12eee772d93b4c394 Reviewed-on: https://gerrit.libreoffice.org/83668 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com> Reviewed-on: https://gerrit.libreoffice.org/83763
2019-08-15loplugin:sequenceloop in svtools..svxNoel Grandin
Change-Id: I81b54f6db69491492b2bc16f48b2296ad96e137d Reviewed-on: https://gerrit.libreoffice.org/77529 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2019-07-31Improved loplugin:stringconstant (now that GCC 7 supports it): svxStephan Bergmann
Change-Id: Idbdee862f96a3d9e6baaa7203528a423c017eb80 Reviewed-on: https://gerrit.libreoffice.org/76640 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2019-06-17Add comphelper::getUnoTunnelImplementation templateArkadiy Illarionov
Use it instead of classname::getImplementation from UNO3_GETIMPLEMENTATION_* Change-Id: Ifcc8cfcd6369c576250008c76ce31ba79ea3a596 Reviewed-on: https://gerrit.libreoffice.org/74107 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2019-06-04tdf#39593 remove IMPL_XUNOTUNNEL* macrosArkadiy Illarionov
Replace with UNO3_GETIMPLEMENTATION* macros. Replace single usage of IMPL_XUNOTUNNEL_MINIMAL with it's body. Change-Id: I7d4ad76399b999ebb2178ecf57edcf6bd2aa6c3e Reviewed-on: https://gerrit.libreoffice.org/73424 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2019-05-03Use hasElements to check Sequence emptiness in sfx2..svxArkadiy Illarionov
Similar to clang-tidy readability-container-size-empty Change-Id: Icabd773f3b924d465b33e8581175f1fcf70c282e Reviewed-on: https://gerrit.libreoffice.org/71704 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2019-02-05tdf#42949 Fix IWYU warnings in include/svtools/*Gabor Kelemen
Found with bin/find-unneeded-includes Only removal proposals are dealt with here. Change-Id: I937ed12f2a96943664087ddcdd035f1347e84a57 Reviewed-on: https://gerrit.libreoffice.org/67102 Tested-by: Jenkins Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
2018-10-08loplugin:constfields in svxNoel Grandin
Change-Id: I643e8686e015ca85dd96221f1c93038f4fddf27b Reviewed-on: https://gerrit.libreoffice.org/61182 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2017-12-11loplugin:salcall fix functionsNoel Grandin
since cdecl is the default calling convention on Windows for such functions, the annotation is redundant. Change-Id: I1a85fa27e5ac65ce0e04a19bde74c90800ffaa2d Reviewed-on: https://gerrit.libreoffice.org/46164 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2017-11-22loplugin:flatten in svxNoel Grandin
Change-Id: Idc4d0186ecc6f0722c2b1358486a2430f037ae29 Reviewed-on: https://gerrit.libreoffice.org/45036 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2017-04-25tools: svstream.hxx needs only errcode.hxx & not errinf.hxxChris Sherlock
Change-Id: Ia28e35ae5af4f601e9a586a3deffbcd61702b0ca Reviewed-on: https://gerrit.libreoffice.org/36896 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Chris Sherlock <chris.sherlock79@gmail.com>
2017-03-06tdf#88205 Remove 'css::uno::Sequence' in svxFakabbir Amin
Change-Id: Iaee597fea9840ddd428dbf37d3bdcab9a9ecef9b Reviewed-on: https://gerrit.libreoffice.org/34885 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2017-02-21Use module name when getting labelsMaxim Monastirsky
Change-Id: I1d5196e1ca888dfb11d5bd6ef4676937dce49fdc
2017-02-21tdf#95844 Refactor CommandInfoProviderRohan Kumar
Instead of a singleton, CommandInfoProvider should just be a set of static methods. Change-Id: I16d4406e361a72f013d78f18d6bd0ae20c0cc5e9
2017-01-26Remove dynamic exception specificationsStephan Bergmann
...(for now, from LIBO_INTERNAL_CODE only). See the mail thread starting at <https://lists.freedesktop.org/archives/libreoffice/2017-January/076665.html> "Dynamic Exception Specifications" for details. Most changes have been done automatically by the rewriting loplugin:dynexcspec (after enabling the rewriting mode, to be committed shortly). The way it only removes exception specs from declarations if it also sees a definition, it identified some dead declarations-w/o-definitions (that have been removed manually) and some cases where a definition appeared in multiple include files (which have also been cleaned up manually). There's also been cases of macro paramters (that were used to abstract over exception specs) that have become unused now (and been removed). Furthermore, some code needed to be cleaned up manually (avmedia/source/quicktime/ and connectivity/source/drivers/kab/), as I had no configurations available that would actually build that code. Missing @throws documentation has not been applied in such manual clean-up. Change-Id: I3408691256c9b0c12bc5332de976743626e13960 Reviewed-on: https://gerrit.libreoffice.org/33574 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2016-12-02loplugin:unnecessaryoverride (dtors) in svxStephan Bergmann
Change-Id: Icc4d9919cedadc00f1420939564dd095fab74cca
2016-10-27MenuItemData now properly disposes the submenuMaxim Monastirsky
At least since: commit ee79a2dd7ea60e902cab3a9203e307b8a78fee23 Author: Caolán McNamara <caolanm@redhat.com> Date: Fri Jul 29 14:33:22 2016 +0100 Resolves: tdf#101169 crash using column menu in base Change-Id: Ib1bc70e8e66f2be123d8a3e5d5e213775e9a5762
2016-10-05Remove _TYPED suffix from tools/link.hxx macrosStephan Bergmann
...which was introduced with 3ead3ad52f9bb2f9d1d6cf8dfc73a0a25e6778ed "Gradually typed Link" to distinguish the new, typed versions from the old, untyped ones, but is no longer necessary since 382eb1a23c390154619c385414bdbe6f6e461173 "remove untyped Link<>" removed the old versions. Change-Id: I494025df486a16a45861fcd8192dfe0275b1103c
2016-09-13loplugin:override: No more need for the "MSVC dtor override" workaroundStephan Bergmann
The issue of 362d4f0cd4e50111edfae9d30c90602c37ed65a2 "Explicitly mark overriding destructors as 'virtual'" appears to no longer be a problem with MSVC 2013. (The little change in the rewriting code of compilerplugins/clang/override.cxx was necessary to prevent an endless loop when adding "override" to OOO_DLLPUBLIC_CHARTTOOLS virtual ~CloseableLifeTimeManager(); in chart2/source/inc/LifeTime.hxx, getting stuck in the leading OOO_DLLPUBLIC_CHARTTOOLS macro. Can't remember what that isAtEndOfImmediateMacroExpansion thing was originally necessary for, anyway.) Change-Id: I534c634504d7216b9bb632c2775c04eaf27e927e
2016-07-07loplugin:passstuffbyref also for {css::uno,rtl}::ReferenceStephan Bergmann
Change-Id: Ie219b6b6cc876cb46faadd7aa9c4f997702781bb
2016-06-23tdf#97527 - vcl: reference-count MenuNoel Grandin
some places are marked with "dodgy"- need to check those to see what is going on, because they are leaving dangling pointers behind in the Menu class Change-Id: I41d5c7c0fec2f70ce9e3ffdc48cd03d26c0a869b Reviewed-on: https://gerrit.libreoffice.org/26516 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noelgrandin@gmail.com>
2015-11-26tdf#93837 Add UNO-based SmartTag menu controllerMaxim Monastirsky
... and use it for the standalone context menu. The sfx2 controller (SvxSmartTagsControl) is still used for the submenu variation, and is due to be removed after the new context menu implementation is in place. Change-Id: I2f889428eb777149f43d74cf3d081e19ab0ebb4a Reviewed-on: https://gerrit.libreoffice.org/20169 Reviewed-by: Maxim Monastirsky <momonasmon@gmail.com> Tested-by: Maxim Monastirsky <momonasmon@gmail.com>