LibreOffice Module sc (master) 1
xcl97esc.cxx
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
20#include <memory>
21#include <com/sun/star/awt/XControlModel.hpp>
22#include <com/sun/star/embed/XClassifiedObject.hpp>
23#include <com/sun/star/embed/XEmbeddedObject.hpp>
24#include <com/sun/star/form/XFormsSupplier.hpp>
25#include <com/sun/star/script/XEventAttacherManager.hpp>
26#include <com/sun/star/beans/XPropertySet.hpp>
27
28#include <svx/svdpage.hxx>
29#include <svx/svdotext.hxx>
30#include <svx/svdobj.hxx>
31#include <svx/svdoole2.hxx>
32#include <unotools/tempfile.hxx>
34#include <svx/sdasitm.hxx>
35#include <sfx2/docfile.hxx>
36#include <sal/log.hxx>
37
38#include <sot/exchange.hxx>
39#include <sot/storage.hxx>
40#include <xeescher.hxx>
41
42#include <drwlayer.hxx>
43#include <xecontent.hxx>
44#include <editeng/flditem.hxx>
45#include <userdat.hxx>
46#include <xcl97rec.hxx>
47#include <xcl97esc.hxx>
49#include <oox/ole/olehelper.hxx>
50#include <sfx2/objsh.hxx>
51
52using ::com::sun::star::uno::Any;
53using ::com::sun::star::uno::Exception;
54using ::com::sun::star::uno::Reference;
55using ::com::sun::star::uno::Sequence;
56using ::com::sun::star::uno::UNO_QUERY;
57using ::com::sun::star::uno::UNO_QUERY_THROW;
58using ::com::sun::star::container::XIndexAccess;
59using ::com::sun::star::embed::XClassifiedObject;
60using ::com::sun::star::drawing::XShape;
61using ::com::sun::star::awt::XControlModel;
62using ::com::sun::star::beans::XPropertySet;
63using ::com::sun::star::uno::Any;
64using ::com::sun::star::form::XFormsSupplier;
65using ::com::sun::star::io::XOutputStream;
66using ::com::sun::star::script::ScriptEventDescriptor;
67using ::com::sun::star::script::XEventAttacherManager;
68
70 : XclExpRoot(rRoot)
71 , mpPicStrm(nullptr)
72{
73 SetBaseURI( GetMedium().GetBaseURL( true ) );
74}
75
77{
78 moPicTempFile.emplace();
79 mpPicStrm = moPicTempFile->GetStream( StreamMode::READWRITE );
80 mpPicStrm->SetEndian( SvStreamEndian::LITTLE );
81 return mpPicStrm;
82}
83
84XclEscherEx::XclEscherEx( const XclExpRoot& rRoot, XclExpObjectManager& rObjMgr, SvStream& rStrm, const XclEscherEx* pParent ) :
85 EscherEx( pParent ? pParent->mxGlobal : std::make_shared<XclEscherExGlobal>( rRoot ), &rStrm ),
86 XclExpRoot( rRoot ),
87 mrObjMgr( rObjMgr ),
88 pCurrXclObj( nullptr ),
89 pTheClientData( new XclEscherClientData ),
90 pAdditionalText( nullptr ),
91 nAdditionalText( 0 ),
92 mnNextKey( 0 ),
93 mbIsRootDff( pParent == nullptr )
94{
96}
97
99{
100 OSL_ENSURE( aStack.empty(), "~XclEscherEx: stack not empty" );
102 pTheClientData.reset();
103}
104
106{
107 /* Current value of mnNextKey will be used by caller to refer to the
108 starting point of the DFF fragment. The key exists already in the
109 PersistTable (has been inserted by c'tor of previous call of
110 InitNextDffFragment(), has been updated by UpdateDffFragmentEnd(). */
111 sal_uInt32 nPersistKey = mnNextKey;
112
113 /* Prepare the next key that is used by caller as end point of the DFF
114 fragment. Will be updated by caller when writing to the DFF stream,
115 using the UpdateDffFragmentEnd() function. This is needed to find DFF
116 data written by the SVX base class implementation without interaction,
117 e.g. the solver container that will be written after the last shape. */
118 ++mnNextKey;
120
121 return nPersistKey;
122}
123
125{
126 // update existing fragment key with new stream position
128}
129
130sal_uInt32 XclEscherEx::GetDffFragmentPos( sal_uInt32 nFragmentKey )
131{
132 /* TODO: this function is non-const because PersistTable::PtGetOffsetByID()
133 is non-const due to tools/List usage. */
134 return GetPersistOffset( nFragmentKey );
135}
136
137sal_uInt32 XclEscherEx::GetDffFragmentSize( sal_uInt32 nFragmentKey )
138{
139 /* TODO: this function is non-const because PersistTable::PtGetOffsetByID()
140 is non-const due to tools/List usage. */
141 return GetDffFragmentPos( nFragmentKey + 1 ) - GetDffFragmentPos( nFragmentKey );
142}
143
145{
146 /* TODO: this function is non-const because PersistTable::PtGetOffsetByID()
147 is non-const due to tools/List usage. */
149}
150
152{
153 // the object manager creates the correct anchor type according to context
155 // pass the drawing object, that will calculate the anchor position
156 pAnchor->SetSdrObject( rSdrObj );
157 return pAnchor;
158}
159
160namespace {
161
162bool lcl_IsFontwork( const SdrObject* pObj )
163{
164 bool bIsFontwork = false;
165 if( pObj->GetObjIdentifier() == SdrObjKind::CustomShape )
166 {
167 static constexpr OUStringLiteral aTextPath = u"TextPath";
168 const SdrCustomShapeGeometryItem& rGeometryItem =
169 pObj->GetMergedItem( SDRATTR_CUSTOMSHAPE_GEOMETRY );
170 if( const Any* pAny = rGeometryItem.GetPropertyValueByName( aTextPath, aTextPath ) )
171 *pAny >>= bIsFontwork;
172 }
173 return bIsFontwork;
174}
175
176} // namespace
177
178EscherExHostAppData* XclEscherEx::StartShape( const Reference< XShape >& rxShape, const tools::Rectangle* pChildAnchor )
179{
180 if ( nAdditionalText )
182 bool bInGroup = ( pCurrXclObj != nullptr );
183 if ( bInGroup )
184 { // stacked recursive group object
185 if ( !pCurrAppData->IsStackedGroup() )
186 {
187 pCurrAppData->SetStackedGroup( true );
189 }
190 }
191 aStack.push( std::make_pair( pCurrXclObj, std::move(pCurrAppData) ) );
194 //added for exporting OCX control
195 sal_Int16 nMsCtlType = 0;
196 if ( !pObj )
197 pCurrXclObj = new XclObjAny( mrObjMgr, rxShape, &GetDoc() ); // just what is it?!?
198 else
199 {
200 pCurrXclObj = nullptr;
201 SdrObjKind nObjType = pObj->GetObjIdentifier();
202
203 if( nObjType == SdrObjKind::OLE2 )
204 {
205 // no OLE objects in embedded drawings (chart shapes)
206 if( mbIsRootDff )
207 {
209 Reference < XClassifiedObject > xObj( static_cast<SdrOle2Obj*>(pObj)->GetObjRef() );
210 if ( xObj.is() )
211 {
212 SvGlobalName aObjClsId( xObj->getClassID() );
213 if ( SotExchange::IsChart( aObjClsId ) )
214 { // yes, it's a chart diagram
215 mrObjMgr.AddObj( std::make_unique<XclExpChartObj>( mrObjMgr, rxShape, pChildAnchor, &GetDoc() ) );
216 pCurrXclObj = nullptr; // no metafile or whatsoever
217 }
218 else // metafile and OLE object
219 pCurrXclObj = new XclObjOle( mrObjMgr, *pObj );
220 }
221 else // just a metafile
222 pCurrXclObj = new XclObjAny( mrObjMgr, rxShape, &GetDoc() );
223 }
224 else
225 pCurrXclObj = new XclObjAny( mrObjMgr, rxShape, &GetDoc() );
226 }
227 else if( nObjType == SdrObjKind::UNO )
228 {
229 //added for exporting OCX control
230 Reference< XPropertySet > xPropSet( rxShape, UNO_QUERY );
231 Any aAny;
232 try
233 {
234 aAny = xPropSet->getPropertyValue("ControlTypeinMSO");
235 aAny >>= nMsCtlType;
236 }
237 catch(const Exception&)
238 {
239 SAL_WARN("sc", "XclEscherEx::StartShape, this control can't get the property ControlTypeinMSO!");
240 }
241 if( nMsCtlType == 2 ) //OCX Form Control
242 pCurrXclObj = CreateOCXCtrlObj( rxShape, pChildAnchor ).release();
243 else //TBX Form Control
244 pCurrXclObj = CreateTBXCtrlObj( rxShape, pChildAnchor ).release();
245 if( !pCurrXclObj )
246 pCurrXclObj = new XclObjAny( mrObjMgr, rxShape, &GetDoc() ); // just a metafile
247 }
248 else if( !ScDrawLayer::IsNoteCaption( pObj ) )
249 {
250 // ignore permanent note shapes
251 // #i12190# do not ignore callouts (do not filter by object type ID)
254 }
255 }
256 if ( pCurrXclObj )
257 {
258 if ( !mrObjMgr.AddObj( std::unique_ptr<XclObj>(pCurrXclObj) ) )
259 { // maximum count reached, object got deleted
260 pCurrXclObj = nullptr;
261 }
262 else
263 {
264 pCurrAppData->SetClientData( pTheClientData.get() );
265 if ( nAdditionalText == 0 )
266 {
267 if ( pObj )
268 {
269 if ( !bInGroup )
270 {
271 /* Create a dummy anchor carrying the flags. Real
272 coordinates are calculated later in virtual call of
273 WriteData(EscherEx&,const Rectangle&). */
275 pAnchor->SetFlags( *pObj );
276 pCurrAppData->SetClientAnchor( pAnchor );
277 }
278 const SdrTextObj* pTextObj = DynCastSdrTextObj( pObj );
279 if( pTextObj && !lcl_IsFontwork( pTextObj ) && (pObj->GetObjIdentifier() != SdrObjKind::Caption) )
280 {
281 const OutlinerParaObject* pParaObj = pTextObj->GetOutlinerParaObject();
282 if( pParaObj )
283 pCurrAppData->SetClientTextbox(
284 new XclEscherClientTextbox( GetRoot(), *pTextObj, pCurrXclObj ) );
285 }
286 }
287 else
288 {
289 if ( !bInGroup )
290 pCurrAppData->SetClientAnchor( mrObjMgr.CreateDffAnchor() );
291 }
292 }
293 else if ( nAdditionalText == 3 )
294 {
295 if ( pAdditionalText )
296 {
298 pCurrAppData->SetClientTextbox( pAdditionalText );
299 }
300 }
301 }
302 }
303 if(pObj)
304 {
305 //add for exporting OCX control
306 //for OCX control import from MS office file,we need keep the id value as MS office file.
307 //GetOldRoot().pObjRecs->Add( pCurrXclObj ) statement has generated the id value as obj id rule;
308 //but we trick it here.
309 SdrObjKind nObjType = pObj->GetObjIdentifier();
310 if( nObjType == SdrObjKind::UNO && pCurrXclObj )
311 {
312 Reference< XPropertySet > xPropSet( rxShape, UNO_QUERY );
313 Any aAny;
314 try
315 {
316 aAny = xPropSet->getPropertyValue("ObjIDinMSO");
317 }
318 catch(const Exception&)
319 {
320 SAL_WARN("sc", "XclEscherEx::StartShape, this control can't get the property ObjIDinMSO!");
321 }
322 sal_uInt16 nObjIDinMSO = 0xFFFF;
323 aAny >>= nObjIDinMSO;
324 if( nObjIDinMSO != 0xFFFF && nMsCtlType == 2) //OCX
325 {
326 pCurrXclObj->SetId(nObjIDinMSO);
327 }
328 }
329 }
330 if ( !pCurrXclObj )
331 pCurrAppData->SetDontWriteShape( true );
332 return pCurrAppData.get();
333}
334
335void XclEscherEx::EndShape( sal_uInt16 nShapeType, sal_uInt32 nShapeID )
336{
337 // own escher data created? -> never delete such objects
338 bool bOwnEscher = pCurrXclObj && pCurrXclObj->IsOwnEscher();
339
340 // post process the current object - not for objects with own escher data
341 if( pCurrXclObj && !bOwnEscher )
342 {
343 // escher data of last shape not written? -> delete it from object list
344 if( nShapeID == 0 )
345 {
346 std::unique_ptr<XclObj> pLastObj = mrObjMgr.RemoveLastObj();
347 OSL_ENSURE( pLastObj.get() == pCurrXclObj, "XclEscherEx::EndShape - wrong object" );
348 pCurrXclObj = nullptr;
349 }
350
351 if( pCurrXclObj )
352 {
353 // set shape type
354 if ( pCurrAppData->IsStackedGroup() )
356 else
357 {
358 pCurrXclObj->SetEscherShapeType( nShapeType );
360 }
361 }
362 }
363
364 // get next object from stack
366 if (aStack.empty())
367 {
368 pCurrXclObj = nullptr;
369 pCurrAppData = nullptr;
370 }
371 else
372 {
373 pCurrXclObj = aStack.top().first;
374 pCurrAppData = std::move(aStack.top().second);
375 aStack.pop();
376 }
377 if( nAdditionalText == 3 )
378 nAdditionalText = 0;
379}
380
382{
383 nAdditionalText = 1;
384 pAdditionalText = static_cast<XclEscherClientTextbox*>( pCurrAppData->GetClientTextbox() );
385 pCurrAppData->SetClientTextbox( nullptr );
386 return pCurrAppData.get();
387}
388
390{
391 if( mbIsRootDff )
392 Flush( static_cast< XclEscherExGlobal& >( *mxGlobal ).GetPictureStream() );
393
394 // seek back DFF stream to prepare saving the MSODRAWING[GROUP] records
395 mpOutStrm->Seek( 0 );
396}
397
398std::unique_ptr<XclExpOcxControlObj> XclEscherEx::CreateOCXCtrlObj( Reference< XShape > const & xShape, const tools::Rectangle* pChildAnchor )
399{
400 ::std::unique_ptr< XclExpOcxControlObj > xOcxCtrl;
401
402 Reference< XControlModel > xCtrlModel = XclControlHelper::GetControlModel( xShape );
403 if( xCtrlModel.is() )
404 {
405 // output stream
406 if( !mxCtlsStrm.is() )
408 if( mxCtlsStrm.is() )
409 {
410 OUString aClassName;
411 sal_uInt32 nStrmStart = static_cast< sal_uInt32 >( mxCtlsStrm->Tell() );
412
413 // writes from xCtrlModel into mxCtlsStrm, raw class name returned in aClassName
414 Reference< XOutputStream > xOut( new utl::OSeekableOutputStreamWrapper( *mxCtlsStrm ) );
415 Reference< css::frame::XModel > xModel( GetDocShell() ? GetDocShell()->GetModel() : nullptr );
416 if( xModel.is() && xOut.is() && oox::ole::MSConvertOCXControls::WriteOCXExcelKludgeStream( xModel, xOut, xCtrlModel, xShape->getSize(), aClassName ) )
417 {
418 sal_uInt32 nStrmSize = static_cast< sal_uInt32 >( mxCtlsStrm->Tell() - nStrmStart );
419 // adjust the class name to "Forms.***.1"
420 aClassName = "Forms." + aClassName + ".1";
421 xOcxCtrl.reset( new XclExpOcxControlObj( mrObjMgr, xShape, pChildAnchor, aClassName, nStrmStart, nStrmSize ) );
422 }
423 }
424 }
425 return xOcxCtrl;
426}
427
428std::unique_ptr<XclExpTbxControlObj> XclEscherEx::CreateTBXCtrlObj( Reference< XShape > const & xShape, const tools::Rectangle* pChildAnchor )
429{
430 ::std::unique_ptr< XclExpTbxControlObj > xTbxCtrl( new XclExpTbxControlObj( mrObjMgr, xShape, pChildAnchor ) );
431 if( xTbxCtrl->GetObjType() == EXC_OBJTYPE_UNKNOWN )
432 xTbxCtrl.reset();
433 else
434 {
435 // find attached macro
436 Reference< XControlModel > xCtrlModel = XclControlHelper::GetControlModel( xShape );
437 ConvertTbxMacro( *xTbxCtrl, xCtrlModel );
438 }
439 return xTbxCtrl;
440}
441
442void XclEscherEx::ConvertTbxMacro( XclExpTbxControlObj& rTbxCtrlObj, Reference< XControlModel > const & xCtrlModel )
443{
444 SdrPage* pSdrPage = GetSdrPage( GetCurrScTab() );
445 if( !(xCtrlModel.is() && GetDocShell() && pSdrPage) )
446 return;
447
448 try
449 {
450 Reference< XFormsSupplier > xFormsSupplier( pSdrPage->getUnoPage(), UNO_QUERY_THROW );
451 Reference< XIndexAccess > xFormsIA( xFormsSupplier->getForms(), UNO_QUERY_THROW );
452
453 // 1) try to find the index of the processed control in the form
454
455 Reference< XIndexAccess > xFormIA; // needed in step 2) below
456 sal_Int32 nFoundIdx = -1;
457
458 // search all existing forms in the draw page
459 for( sal_Int32 nFormIdx = 0, nFormCount = xFormsIA->getCount();
460 (nFoundIdx < 0) && (nFormIdx < nFormCount); ++nFormIdx )
461 {
462 // get the XIndexAccess interface of the form with index nFormIdx
463 if( xFormIA.set( xFormsIA->getByIndex( nFormIdx ), UNO_QUERY ) )
464 {
465 // search all elements (controls) of the current form by index
466 for( sal_Int32 nCtrlIdx = 0, nCtrlCount = xFormIA->getCount();
467 (nFoundIdx < 0) && (nCtrlIdx < nCtrlCount); ++nCtrlIdx )
468 {
469 // compare implementation pointers of the control models
470 Reference< XControlModel > xCurrModel( xFormIA->getByIndex( nCtrlIdx ), UNO_QUERY );
471 if( xCtrlModel.get() == xCurrModel.get() )
472 nFoundIdx = nCtrlIdx;
473 }
474 }
475 }
476
477 // 2) try to find an attached macro
478
479 if( xFormIA.is() && (nFoundIdx >= 0) )
480 {
481 Reference< XEventAttacherManager > xEventMgr( xFormIA, UNO_QUERY_THROW );
482 // loop over all events attached to the found control
483 const Sequence< ScriptEventDescriptor > aEventSeq( xEventMgr->getScriptEvents( nFoundIdx ) );
484 for( const auto& rEvent : aEventSeq )
485 {
486 // try to set the event data at the Excel control object, returns true on success
487 if (rTbxCtrlObj.SetMacroLink( rEvent ))
488 break;
489 }
490 }
491 }
492 catch( Exception& )
493 {
494 }
495}
496
498{
499 if ( pCurrAppData )
500 {
501 delete pCurrAppData->GetClientAnchor();
502 delete pCurrAppData->GetClientTextbox();
503 delete pCurrAppData->GetInteractionInfo();
504 pCurrAppData.reset();
505 }
506}
507
508// --- class XclEscherClientData -------------------------------------
509
511{ // actual data is in the following OBJ record
512 rEx.AddAtom( 0, ESCHER_ClientData );
513}
514
515// --- class XclEscherClientTextbox -------------------------------------
516
518 const SdrTextObj& rObj, XclObj* pObj )
519 :
520 XclExpRoot( rRoot ),
521 rTextObj( rObj ),
522 pXclObj( pObj )
523{
524}
525
527{
529}
530
532ShapeInteractionHelper::CreateShapeObj( XclExpObjectManager& rObjMgr, const Reference< XShape >& xShape, ScDocument* pDoc )
533{
534 return new XclExpShapeObj( rObjMgr, xShape, pDoc );
535}
536
538 const Reference<XShape>& xShape,
539 EscherExHostAppData& rHostAppData)
540{
541 try
542 {
543 SvMemoryStream* pMemStrm = nullptr;
544 OUString sHyperLink;
545 OUString sMacro;
547 if (pObj)
548 sHyperLink = pObj->getHyperlink();
549 if (ScMacroInfo* pInfo = ScDrawLayer::GetMacroInfo(pObj))
550 {
551 sMacro = pInfo->GetMacro();
552 }
553 if (!sHyperLink.isEmpty())
554 {
555 pMemStrm = new SvMemoryStream();
556 XclExpStream tmpStream(*pMemStrm, rObjMgr.GetRoot());
557 ScAddress dummyAddress;
558 SvxURLField aUrlField;
559 aUrlField.SetURL(sHyperLink);
560 XclExpHyperlink hExpHlink(rObjMgr.GetRoot(), aUrlField, dummyAddress);
561 hExpHlink.WriteEmbeddedData(tmpStream);
562 }
563 if (!sHyperLink.isEmpty() || !sMacro.isEmpty())
564 rHostAppData.SetInteractionInfo(new InteractionInfo(pMemStrm));
565 }
566 catch (Exception&)
567 {
568 }
569}
570
571/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
SvStream * GetPictureStream()
void SetInteractionInfo(InteractionInfo *p)
sal_uInt32 GetPersistOffset(sal_uInt32 nKey)
void AddAtom(sal_uInt32 nAtomSitze, sal_uInt16 nRecType, int nRecVersion=0, int nRecInstance=0)
SvStream * mpOutStrm
void Flush(SvStream *pPicStreamMergeBSE=nullptr)
sal_uInt64 GetStreamPos() const
void ReplacePersistOffset(sal_uInt32 nKey, sal_uInt32 nOffset)
void InsertPersistOffset(sal_uInt32 nKey, sal_uInt32 nOffset)
void SetBaseURI(const OUString &rBaseURI)
static bool IsNoteCaption(SdrObject *pObj)
Returns true, if the passed object is the caption of a cell note.
Definition: drwlayer.cxx:2901
static ScMacroInfo * GetMacroInfo(SdrObject *pObj, bool bCreate=false)
Definition: drwlayer.cxx:2913
css::uno::Any * GetPropertyValueByName(const OUString &rPropName)
static SdrObject * getSdrObjectFromXShape(const css::uno::Reference< css::uno::XInterface > &xInt)
const SfxPoolItem & GetMergedItem(const sal_uInt16 nWhich) const
const OUString & getHyperlink() const
virtual SdrObjKind GetObjIdentifier() const
css::uno::Reference< css::uno::XInterface > const & getUnoPage()
virtual OutlinerParaObject * GetOutlinerParaObject() const override
static void PopulateShapeInteractionInfo(const XclExpObjectManager &rObjMgr, const css::uno::Reference< css::drawing::XShape > &xShape, EscherExHostAppData &rHostAppData)
Definition: xcl97esc.cxx:537
static XclExpShapeObj * CreateShapeObj(XclExpObjectManager &rObjMgr, const css::uno::Reference< css::drawing::XShape > &xShape, ScDocument *pDoc)
Definition: xcl97esc.cxx:532
static sal_uInt16 IsChart(const SvGlobalName &rName)
sal_uInt64 Tell() const
void SetEndian(SvStreamEndian SvStreamEndian)
sal_uInt64 Seek(sal_uInt64 nPos)
void SetURL(const OUString &rURL)
static css::uno::Reference< css::awt::XControlModel > GetControlModel(css::uno::Reference< css::drawing::XShape > const &xShape)
Returns the API control model from the passed API shape object.
Definition: xlescher.cxx:282
virtual void WriteData(EscherEx &rEx) const override
Definition: xcl97esc.cxx:510
virtual void WriteData(EscherEx &rEx) const override
Definition: xcl97esc.cxx:526
void SetXclObj(XclObj *p)
ONLY for the AdditionalText mimic.
Definition: xcl97esc.hxx:171
XclEscherClientTextbox(const XclExpRoot &rRoot, const SdrTextObj &rObj, XclObj *pObj)
Definition: xcl97esc.cxx:517
const SdrTextObj & rTextObj
Definition: xcl97esc.hxx:161
virtual SvStream * ImplQueryPictureStream() override
Override to create a new temporary file and return its stream.
Definition: xcl97esc.cxx:76
::std::optional< ::utl::TempFileFast > moPicTempFile
Definition: xcl97esc.hxx:41
SvStream * mpPicStrm
Definition: xcl97esc.hxx:42
XclEscherExGlobal(const XclExpRoot &rRoot)
Definition: xcl97esc.cxx:69
bool HasPendingDffData()
Returns true, if there is more data left in the DFF stream than owned by the last MSODRAWING record.
Definition: xcl97esc.cxx:144
std::unique_ptr< XclEscherClientData > pTheClientData
Definition: xcl97esc.hxx:124
virtual void EndShape(sal_uInt16 nShapeType, sal_uInt32 nShapeID) override
Definition: xcl97esc.cxx:335
XclEscherEx(const XclExpRoot &rRoot, XclExpObjectManager &rObjMgr, SvStream &rStrm, const XclEscherEx *pParent=nullptr)
Definition: xcl97esc.cxx:84
sal_uInt32 InitNextDffFragment()
Called by MSODRAWING record constructors to initialize the DFF stream fragment they will own.
Definition: xcl97esc.cxx:105
std::unique_ptr< XclEscherHostAppData > pCurrAppData
Definition: xcl97esc.hxx:123
std::unique_ptr< XclExpOcxControlObj > CreateOCXCtrlObj(css::uno::Reference< css::drawing::XShape > const &xShape, const tools::Rectangle *pChildAnchor)
Creates an OCX form control OBJ record from the passed form control.
Definition: xcl97esc.cxx:398
virtual ~XclEscherEx() override
Definition: xcl97esc.cxx:98
sal_uInt32 GetDffFragmentPos(sal_uInt32 nFragmentKey)
Returns the position of the specified DFF stream fragment.
Definition: xcl97esc.cxx:130
XclObj * pCurrXclObj
Definition: xcl97esc.hxx:122
std::stack< std::pair< XclObj *, std::unique_ptr< XclEscherHostAppData > > > aStack
Definition: xcl97esc.hxx:121
sal_uInt32 GetDffFragmentSize(sal_uInt32 nFragmentKey)
Returns the size of the specified DFF stream fragment.
Definition: xcl97esc.cxx:137
virtual EscherExHostAppData * StartShape(const css::uno::Reference< css::drawing::XShape > &rxShape, const tools::Rectangle *pChildAnchor) override
Definition: xcl97esc.cxx:178
void EndDocument()
Flush and merge PicStream into EscherStream.
Definition: xcl97esc.cxx:389
void DeleteCurrAppData()
Definition: xcl97esc.cxx:497
void UpdateDffFragmentEnd()
Called after some data has been written to the DFF stream, to update the end position of the DFF frag...
Definition: xcl97esc.cxx:124
sal_uInt32 mnNextKey
Definition: xcl97esc.hxx:127
bool mbIsRootDff
Definition: xcl97esc.hxx:128
std::unique_ptr< XclExpTbxControlObj > CreateTBXCtrlObj(css::uno::Reference< css::drawing::XShape > const &xShape, const tools::Rectangle *pChildAnchor)
The 'Ctls' stream.
Definition: xcl97esc.cxx:428
XclExpObjectManager & mrObjMgr
Definition: xcl97esc.hxx:120
sal_uInt16 nAdditionalText
Definition: xcl97esc.hxx:126
XclEscherClientTextbox * pAdditionalText
Definition: xcl97esc.hxx:125
void ConvertTbxMacro(XclExpTbxControlObj &rTbxCtrlObj, css::uno::Reference< css::awt::XControlModel > const &xCtrlModel)
Tries to get the name of a Basic macro from a control.
Definition: xcl97esc.cxx:442
XclExpDffAnchorBase * CreateDffAnchor(const SdrObject &rSdrObj) const
Creates a new DFF client anchor object and calculates the anchor position of the passed object.
Definition: xcl97esc.cxx:151
tools::SvRef< SotStorageStream > mxCtlsStrm
Definition: xcl97esc.hxx:105
virtual EscherExHostAppData * EnterAdditionalTextGroup() override
Definition: xcl97esc.cxx:381
Base class for DFF client anchor atoms used in spreadsheets.
Definition: xeescher.hxx:43
void SetFlags(const SdrObject &rSdrObj)
Sets the flags according to the passed SdrObject.
Definition: xeescher.cxx:247
void SetSdrObject(const SdrObject &rSdrObj)
Sets the anchor position and flags according to the passed SdrObject.
Definition: xeescher.cxx:252
virtual XclExpDffAnchorBase * CreateDffAnchor() const
Creates a new DFF client anchor object.
Definition: xeescher.cxx:1972
sal_uInt16 AddObj(std::unique_ptr< XclObj > pObjRec)
Definition: xeescher.cxx:2026
std::unique_ptr< XclObj > RemoveLastObj()
Definition: xeescher.cxx:2031
Represents an OBJ record for an OCX form control.
Definition: xeescher.hxx:229
Access to global data from other classes.
Definition: xeroot.hxx:113
const XclExpRoot & GetRoot() const
Returns this root instance - for code readability in derived classes.
Definition: xeroot.hxx:118
This class is used to export Excel record streams.
Definition: xestream.hxx:73
Represents an OBJ record for a TBX form control.
Definition: xeescher.hxx:251
bool SetMacroLink(const css::script::ScriptEventDescriptor &rEvent)
Sets the name of a macro attached to this control.
Definition: xeescher.cxx:915
void SetEscherShapeTypeGroup()
Definition: xcl97rec.hxx:146
void SetId(sal_uInt16 nId)
Definition: xcl97rec.hxx:127
void SetEscherShapeType(sal_uInt16 nType)
Definition: xcl97rec.cxx:443
bool IsOwnEscher() const
If set to true, this object has created its own escher data.
Definition: xcl97rec.hxx:157
void SetText(const XclExpRoot &rRoot, const SdrTextObj &rObj)
actually writes ESCHER_ClientTextbox
Definition: xcl97rec.cxx:472
SfxObjectShell * GetDocShell() const
Returns the object shell of the Calc document.
Definition: xlroot.cxx:290
SfxMedium & GetMedium() const
Returns the medium to import from.
Definition: xlroot.hxx:170
tools::SvRef< SotStorageStream > OpenStream(tools::SvRef< SotStorage > const &xStrg, const OUString &rStrmName) const
Tries to open a new stream in the specified storage for reading or writing.
Definition: xlroot.cxx:273
SCTAB GetCurrScTab() const
Returns the current Calc sheet index.
Definition: xlroot.hxx:162
ScDocument & GetDoc() const
Returns reference to the destination document (import) or source document (export).
Definition: xlroot.cxx:285
SdrPage * GetSdrPage(SCTAB nScTab) const
Returns the drawing layer page of the passed sheet, if present.
Definition: xlroot.cxx:316
static bool WriteOCXExcelKludgeStream(const css::uno::Reference< css::frame::XModel > &rxModel, const css::uno::Reference< css::io::XOutputStream > &xOutStrm, const css::uno::Reference< css::awt::XControlModel > &rControlModel, const css::awt::Size &rSize, OUString &rName)
bool is() const
float u
#define ESCHER_ClientData
#define SAL_WARN(area, stream)
@ Exception
void SvStream & rStrm
std::shared_ptr< T > make_shared(Args &&... args)
Reference< XModel > xModel
SVXCORE_DLLPUBLIC SdrTextObj * DynCastSdrTextObj(SdrObject *)
SdrObjKind
constexpr OUStringLiteral EXC_STREAM_CTLS
Definition: xlconst.hxx:84
const sal_uInt16 EXC_OBJTYPE_UNKNOWN
Definition: xlescher.hxx:71