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