LibreOffice Module sw (master) 1
ndole.hxx
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#ifndef INCLUDED_SW_INC_NDOLE_HXX
20#define INCLUDED_SW_INC_NDOLE_HXX
21
22#include "ndnotxt.hxx"
23#include <svtools/embedhlp.hxx>
25#include <rtl/ref.hxx>
26
27class SwGrfFormatColl;
28class SwDoc;
29class SwOLENode;
31namespace sfx2 { class SvBaseLink; }
32class DeflateData;
33
35{
36 friend class SwOLENode;
37
40
44 OUString m_aName;
45
46 // eventually buffered data if it is a chart OLE
50 std::unique_ptr<DeflateData> m_pDeflateData;
51
52 SwOLEObj( const SwOLEObj& rObj ) = delete;
53
54 void SetNode( SwOLENode* pNode );
55
56 DECL_LINK(IsProtectedHdl, LinkParamNone*, bool);
57
58public:
59 SwOLEObj( const svt::EmbeddedObjectRef& pObj );
60 SwOLEObj( OUString aName, sal_Int64 nAspect );
61 ~SwOLEObj() COVERITY_NOEXCEPT_FALSE;
62
63 bool UnloadObject();
64 static bool UnloadObject( css::uno::Reference< css::embed::XEmbeddedObject > const & xObj,
65 const SwDoc* pDoc,
66 sal_Int64 nAspect );
67
68 OUString GetDescription();
69
70 css::uno::Reference < css::embed::XEmbeddedObject > const & GetOleRef();
71 svt::EmbeddedObjectRef& GetObject();
72 const OUString& GetCurrentPersistName() const { return m_aName; }
73 OUString GetStyleString();
74 bool IsOleRef() const;
75 bool IsProtected() const;
76
77 // try to get OLE visualization in form of a Primitive2DSequence
78 // and the corresponding B2DRange. This data may be locally buffered
79 drawinglayer::primitive2d::Primitive2DContainer const & tryToGetChartContentAsPrimitive2DSequence(
80 basegfx::B2DRange& rRange,
81 bool bSynchron);
82 void resetBufferedData();
83
84 void dumpAsXml(xmlTextWriterPtr pWriter) const;
85};
86
87// SwOLENode
88
90{
91 friend class SwNodes;
98 OUString maLinkURL;
99
100 SwOLENode( SwNode& rWhere,
102 SwGrfFormatColl *pGrfColl,
103 SwAttrSet const * pAutoAttr );
104
105 SwOLENode( SwNode& rWhere,
106 const OUString &rName,
107 sal_Int64 nAspect,
108 SwGrfFormatColl *pGrfColl,
109 SwAttrSet const * pAutoAttr );
110
111 SwOLENode( const SwOLENode & ) = delete;
112
114
115public:
116 const SwOLEObj& GetOLEObj() const { return maOLEObj; }
117 SwOLEObj& GetOLEObj() { return maOLEObj; }
118 virtual ~SwOLENode() override;
119
121 virtual SwContentNode* MakeCopy(SwDoc&, SwNode& rWhere, bool bNewFrames) const override;
122
123 virtual Size GetTwipSize() const override;
124
125 const Graphic* GetGraphic();
126
127 void GetNewReplacement();
128
129 virtual bool SavePersistentData() override;
130 virtual bool RestorePersistentData() override;
131
132 virtual void dumpAsXml(xmlTextWriterPtr pWriter) const override;
133
134 bool IsInGlobalDocSection() const;
135 bool IsOLEObjectDeleted() const;
136
137 bool IsOLESizeInvalid() const { return mbOLESizeInvalid; }
138 void SetOLESizeInvalid( bool b ){ mbOLESizeInvalid = b; }
139
140 sal_Int64 GetAspect() const { return maOLEObj.GetObject().GetViewAspect(); }
141 void SetAspect( sal_Int64 nAspect) { maOLEObj.GetObject().SetViewAspect( nAspect ); }
142
145 OUString GetDescription() const { return maOLEObj.GetDescription(); }
146
147 bool UpdateLinkURL_Impl();
148 void BreakFileLink_Impl();
149 void DisconnectFileLink_Impl();
150
151 void CheckFileLink_Impl();
152
153 // #i99665#
154 bool IsChart() const;
155
156 const OUString& GetChartTableName() const { return msChartTableName; }
157 void SetChartTableName( const OUString& rNm ) { msChartTableName = rNm; }
158
159
160 // react on visual change (invalidate)
161 void SetChanged();
162};
163
166{
167 return SwNodeType::Ole == m_nNodeType ? static_cast<SwOLENode*>(this) : nullptr;
168}
169
170inline const SwOLENode *SwNode::GetOLENode() const
171{
172 return SwNodeType::Ole == m_nNodeType ? static_cast<const SwOLENode*>(this) : nullptr;
173}
174
175namespace sw
176{
177 class DocumentSettingManager;
178}
179
181{
182private:
185public:
186 PurgeGuard(const SwDoc& rDoc);
187 ~PurgeGuard() COVERITY_NOEXCEPT_FALSE;
188};
189
190#endif // _ INCLUDED_SW_INC_NDOLE_HXX
191
192/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
Holder for local data for a parallel-executed task to load a chart model.
Definition: ndole.cxx:752
PurgeGuard(const SwDoc &rDoc)
Definition: ndole.cxx:1081
~PurgeGuard() COVERITY_NOEXCEPT_FALSE
Definition: ndole.cxx:1088
bool m_bOrigPurgeOle
Definition: ndole.hxx:184
::sw::DocumentSettingManager & m_rManager
Definition: ndole.hxx:183
Definition: doc.hxx:197
Layout frame for SwNoTextNode, i.e. graphics and OLE nodes (including charts).
Definition: ndnotxt.hxx:30
Graphic GetGraphic() const
Definition: ndnotxt.cxx:229
Base class of the Writer document model elements.
Definition: node.hxx:98
SwOLENode * GetOLENode()
Inline methods from Node.hxx.
Definition: ndole.hxx:165
SwNodeType m_nNodeType
Definition: node.hxx:101
void dumpAsXml(xmlTextWriterPtr pWriter) const
Dumps the entire nodes structure to the given destination (file nodes.xml in the current directory by...
Definition: nodes.cxx:2560
sfx2::SvBaseLink * mpObjectLink
Definition: ndole.hxx:97
virtual void dumpAsXml(xmlTextWriterPtr pWriter) const override
Dumps the node structure to the given destination (file nodes.xml in the current directory by default...
Definition: ndole.cxx:334
SwOLENode(const SwOLENode &)=delete
SwOLEObj & GetOLEObj()
Definition: ndole.hxx:117
bool IsOLESizeInvalid() const
Definition: ndole.hxx:137
OUString GetDescription() const
Remove OLE-object from "memory".
Definition: ndole.hxx:145
sal_Int64 GetAspect() const
Definition: ndole.hxx:140
const SwOLEObj & GetOLEObj() const
Definition: ndole.hxx:116
SwOLEObj maOLEObj
Definition: ndole.hxx:92
void SetChartTableName(const OUString &rNm)
Definition: ndole.hxx:157
bool mbOLESizeInvalid
Should be considered at SwDoc::PrtOLENotify (e.g.
Definition: ndole.hxx:94
void SetOLESizeInvalid(bool b)
Definition: ndole.hxx:138
const OUString & GetChartTableName() const
Definition: ndole.hxx:156
OUString msChartTableName
with chart objects: name of referenced table.
Definition: ndole.hxx:93
OUString maLinkURL
Definition: ndole.hxx:98
void SetAspect(sal_Int64 nAspect)
Definition: ndole.hxx:141
svt::EmbeddedObjectRef m_xOLERef
Either ref or name are known.
Definition: ndole.hxx:43
sal_uInt32 m_nGraphicVersion
Definition: ndole.hxx:49
svt::EmbeddedObjectRef & GetObject()
Definition: ndole.cxx:1063
std::unique_ptr< DeflateData > m_pDeflateData
Definition: ndole.hxx:50
OUString GetDescription()
Definition: ndole.cxx:1140
drawinglayer::primitive2d::Primitive2DContainer m_aPrimitive2DSequence
Definition: ndole.hxx:47
OUString m_aName
Definition: ndole.hxx:44
DECL_LINK(IsProtectedHdl, LinkParamNone *, bool)
SwOLEObj(const SwOLEObj &rObj)=delete
const SwOLENode * m_pOLENode
Definition: ndole.hxx:38
rtl::Reference< SwOLEListener_Impl > m_xListener
Definition: ndole.hxx:39
basegfx::B2DRange m_aRange
Definition: ndole.hxx:48
void SetViewAspect(sal_Int64 nAspect)
sal_Int64 GetViewAspect() const
struct _xmlTextWriter * xmlTextWriterPtr
Dialog to specify the properties of date form field.
OUString m_aName
#define SW_DLLPUBLIC
Definition: swdllapi.h:28