LibreOffice Module sc (master) 1
xcl97rec.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 <o3tl/sprintf.hxx>
21#include <svx/sdtaitm.hxx>
22#include <svx/svdotext.hxx>
23#include <editeng/editobj.hxx>
24#include <svx/svdoole2.hxx>
25#include <sot/storage.hxx>
26#include <svl/itemset.hxx>
27#include <svx/svdocapt.hxx>
28#include <svx/unoapi.hxx>
30#include <tools/urlobj.hxx>
31
32#include <rtl/math.hxx>
33#include <rtl/uuid.h>
34#include <sal/log.hxx>
35#include <drwlayer.hxx>
36
37#include <root.hxx>
38#include <utility>
39#include <xcl97rec.hxx>
40#include <xcl97esc.hxx>
41#include <xeescher.hxx>
42#include <xehelper.hxx>
43#include <xelink.hxx>
44#include <xlcontent.hxx>
45
46#include <unotools/fltrcfg.hxx>
48#include <editeng/eeitem.hxx>
50
52
53#include <stdio.h>
54
55#include <document.hxx>
56#include <rangelst.hxx>
57#include <docoptio.hxx>
58#include <tabprotection.hxx>
59
60#include <com/sun/star/embed/Aspects.hpp>
61#include <com/sun/star/chart/XChartDocument.hpp>
62#include <com/sun/star/chart2/XCoordinateSystemContainer.hpp>
63#include <com/sun/star/chart2/XChartTypeContainer.hpp>
64#include <com/sun/star/chart2/XChartDocument.hpp>
65
66#include <sax/fastattribs.hxx>
67#include <oox/token/tokens.hxx>
68#include <oox/token/namespaces.hxx>
70#include <oox/export/shapes.hxx>
71#include <oox/export/utils.hxx>
73#include <detfunc.hxx>
74
75#include <memory>
76
77using namespace ::com::sun::star;
78using ::com::sun::star::uno::Reference;
79using ::com::sun::star::uno::UNO_QUERY;
80using ::com::sun::star::beans::XPropertySet;
81using ::com::sun::star::drawing::XShape;
82using ::oox::drawingml::ShapeExport;
83using ::oox::vml::VMLExport;
84using namespace oox;
85
87 XclExpRoot( rRoot ),
88 mnScTab( rRoot.GetCurrScTab() ),
89 mrEscherEx( rEscherEx )
90{
91 pMsodrawingPerSheet.reset( new XclExpMsoDrawing( rEscherEx ) );
92 // open the DGCONTAINER and the patriarch group shape
94 tools::Rectangle aRect( 0, 0, 0, 0 );
95 mrEscherEx.EnterGroup( &aRect );
97}
98
100{
101 maObjs.clear();
102 pMsodrawingPerSheet.reset();
103 pSolverContainer.reset();
104}
105
106sal_uInt16 XclExpObjList::Add( std::unique_ptr<XclObj> pObj )
107{
108 OSL_ENSURE( maObjs.size() < 0xFFFF, "XclExpObjList::Add: too much for Xcl" );
109
110 size_t nSize = maObjs.size();
111
112 if ( nSize < 0xFFFF )
113 {
114 pObj->SetId( nSize+1 );
115 pObj->SetTab( mnScTab );
116 maObjs.push_back(std::move(pObj));
117 ++nSize;
118 }
119 else
120 {
121 nSize = 0;
122 }
123
124 return nSize;
125}
126
127std::unique_ptr<XclObj> XclExpObjList::pop_back ()
128{
129 auto ret = std::move(maObjs.back());
130 maObjs.pop_back();
131 return ret;
132}
133
135{
136 // Is there still something in the stream? -> The solver container
139
140 // close the DGCONTAINER created by XclExpObjList ctor MSODRAWING
142}
143
145{
147 pMsodrawingPerSheet->Save( rStrm );
148
149 for ( const auto& rxObj : maObjs )
150 rxObj->Save( rStrm );
151
152 if( pSolverContainer )
153 pSolverContainer->Save( rStrm );
154}
155
156namespace {
157
158bool IsFormControlObject( const XclObj *rObj )
159{
160 switch( rObj->GetObjType() )
161 {
164 return true;
165 default:
166 return false;
167 }
168}
169
170bool IsVmlObject( const XclObj *rObj )
171{
172 switch( rObj->GetObjType() )
173 {
174 case EXC_OBJTYPE_NOTE:
175 return true;
176 default:
177 return false;
178 }
179}
180
181sal_Int32 GetVmlObjectCount( XclExpObjList& rList )
182{
183 return static_cast<sal_Int32>(std::count_if(rList.begin(), rList.end(),
184 [](const std::unique_ptr<XclObj>& rxObj) { return IsVmlObject( rxObj.get() ) || IsFormControlObject( rxObj.get() ); }));
185}
186
187bool IsValidObject( const XclObj& rObj )
188{
189 if (rObj.GetObjType() == EXC_OBJTYPE_CHART)
190 {
191 // Chart object. Make sure it's a valid chart object. We skip
192 // invalid chart objects from exporting to prevent Excel from
193 // complaining on load.
194
195 const XclExpChartObj& rChartObj = static_cast<const XclExpChartObj&>(rObj);
196 uno::Reference<chart2::XChartDocument> xChartDoc(rChartObj.GetChartDoc(), uno::UNO_QUERY);
197 if (!xChartDoc.is())
198 return false;
199
200 uno::Reference<chart2::XDiagram> xDiagram = xChartDoc->getFirstDiagram();
201 if (!xDiagram.is())
202 return false;
203
204 uno::Reference<chart2::XCoordinateSystemContainer> xCooSysContainer(xDiagram, uno::UNO_QUERY);
205 if (!xCooSysContainer.is())
206 return false;
207
208 const uno::Sequence<uno::Reference<chart2::XCoordinateSystem>> xCooSysSeq = xCooSysContainer->getCoordinateSystems();
209 for (const auto& rCooSys : xCooSysSeq)
210 {
211 Reference<chart2::XChartTypeContainer> xChartTypeCont(rCooSys, uno::UNO_QUERY);
212 if (!xChartTypeCont.is())
213 return false;
214
215 uno::Sequence<uno::Reference<chart2::XChartType>> xChartTypeSeq = xChartTypeCont->getChartTypes();
216 if (!xChartTypeSeq.hasElements())
217 // No chart type. Not good.
218 return false;
219 }
220 }
221
222 return true;
223}
224
225void SaveDrawingMLObjects( XclExpObjList& rList, XclExpXmlStream& rStrm )
226{
227 std::vector<XclObj*> aList;
228 // do not add objects to the list that are in the group,
229 // because the group already contains them. For this, count
230 // the next skipped objects, i.e. objects of a group,
231 // including objects of its subgroups
232 size_t nSkipObj = 0;
233 for (const auto& rxObj : rList)
234 {
235 // FIXME: Can DrawingML objects be grouped with VML or not valid objects?
236 if (IsVmlObject(rxObj.get()) || !IsValidObject(*rxObj))
237 continue;
238
239 if (nSkipObj == 0)
240 aList.push_back(rxObj.get());
241 else
242 --nSkipObj;
243
244 XclObjAny* pObj = nullptr;
245 if (rxObj->GetObjType() == 0) // group (it can be a subgroup)
246 pObj = dynamic_cast<XclObjAny*>(rxObj.get());
247 if (pObj)
248 {
249 css::uno::Reference<css::drawing::XShapes> xShapes(pObj->GetShape(), UNO_QUERY);
250 if (xShapes)
251 {
252 // skip (also) the objects of this group
253 nSkipObj += xShapes->getCount();
254 }
255 }
256 }
257
258 if (aList.empty())
259 return;
260
261 sal_Int32 nDrawing = drawingml::DrawingML::getNewDrawingUniqueId();
262 OUString sId;
263 sax_fastparser::FSHelperPtr pDrawing = rStrm.CreateOutputStream(
264 XclXmlUtils::GetStreamName( "xl/", "drawings/drawing", nDrawing ),
265 XclXmlUtils::GetStreamName( "../", "drawings/drawing", nDrawing ),
266 rStrm.GetCurrentStream()->getOutputStream(),
267 "application/vnd.openxmlformats-officedocument.drawing+xml",
268 oox::getRelationship(Relationship::DRAWING),
269 &sId );
270
271 rStrm.GetCurrentStream()->singleElement(XML_drawing, FSNS(XML_r, XML_id), sId.toUtf8());
272
273 rStrm.PushStream( pDrawing );
274 pDrawing->startElement( FSNS( XML_xdr, XML_wsDr ),
275 FSNS(XML_xmlns, XML_xdr), rStrm.getNamespaceURL(OOX_NS(dmlSpreadDr)).toUtf8(),
276 FSNS(XML_xmlns, XML_a), rStrm.getNamespaceURL(OOX_NS(dml)).toUtf8(),
277 FSNS(XML_xmlns, XML_r), rStrm.getNamespaceURL(OOX_NS(officeRel)).toUtf8() );
278
279 sal_Int32 nShapeId = 1000; // unique id of the shape inside one worksheet (not the whole document)
280 for (const auto& rpObj : aList)
281 {
282 // validate shapeId
283 if ( IsFormControlObject( rpObj ) )
284 {
285 XclExpTbxControlObj* pXclExpTbxControlObj = dynamic_cast<XclExpTbxControlObj*>(rpObj);
286 if (pXclExpTbxControlObj)
287 {
288 pXclExpTbxControlObj->setShapeId(++nShapeId);
289 }
290 }
291
292 rpObj->SaveXml(rStrm);
293 }
294
295 pDrawing->endElement( FSNS( XML_xdr, XML_wsDr ) );
296
297 rStrm.PopStream();
298}
299
300void SaveFormControlObjects(XclExpObjList& rList, XclExpXmlStream& rStrm)
301{
302 bool hasControls = false;
303 for (const auto& rxObj : rList)
304 {
305 if (IsFormControlObject(rxObj.get()))
306 {
307 hasControls = true;
308 break;
309 }
310 }
311
312 if (!hasControls)
313 {
314 return;
315 }
316
317 sax_fastparser::FSHelperPtr& rWorksheet = rStrm.GetCurrentStream();
318
319 rWorksheet->startElement(FSNS(XML_mc, XML_AlternateContent),
320 FSNS(XML_xmlns, XML_mc), rStrm.getNamespaceURL(OOX_NS(mce)).toUtf8());
321 rWorksheet->startElement(FSNS(XML_mc, XML_Choice), XML_Requires, "x14");
322 rWorksheet->startElement(XML_controls);
323
324 for (const auto& rxObj : rList)
325 {
326 if (IsFormControlObject(rxObj.get()))
327 {
328 XclExpTbxControlObj* pXclExpTbxControlObj = dynamic_cast<XclExpTbxControlObj*>(rxObj.get());
329 if (pXclExpTbxControlObj)
330 {
331 const OUString aIdFormControlPr = pXclExpTbxControlObj->SaveControlPropertiesXml(rStrm);
332 pXclExpTbxControlObj->SaveSheetXml(rStrm, aIdFormControlPr);
333 }
334 }
335 }
336
337 rWorksheet->endElement(XML_controls);
338 rWorksheet->endElement(FSNS(XML_mc, XML_Choice));
339 rWorksheet->endElement(FSNS(XML_mc, XML_AlternateContent));
340}
341
342void SaveVmlObjects( XclExpObjList& rList, XclExpXmlStream& rStrm )
343{
344 if( GetVmlObjectCount( rList ) == 0 )
345 return;
346
347 sal_Int32 nDrawing = drawingml::DrawingML::getNewVMLUniqueId();
348 OUString sId;
349 sax_fastparser::FSHelperPtr pVmlDrawing = rStrm.CreateOutputStream(
350 XclXmlUtils::GetStreamName( "xl/", "drawings/vmlDrawing", nDrawing ),
351 XclXmlUtils::GetStreamName( "../", "drawings/vmlDrawing", nDrawing ),
352 rStrm.GetCurrentStream()->getOutputStream(),
353 "application/vnd.openxmlformats-officedocument.vmlDrawing",
354 oox::getRelationship(Relationship::VMLDRAWING),
355 &sId );
356
357 rStrm.GetCurrentStream()->singleElement(XML_legacyDrawing, FSNS(XML_r, XML_id), sId.toUtf8());
358
359 rStrm.PushStream( pVmlDrawing );
360 pVmlDrawing->write("<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"yes\"?>\n");
361 pVmlDrawing->startElement( XML_xml,
362 FSNS(XML_xmlns, XML_v), rStrm.getNamespaceURL(OOX_NS(vml)).toUtf8(),
363 FSNS(XML_xmlns, XML_o), rStrm.getNamespaceURL(OOX_NS(vmlOffice)).toUtf8(),
364 FSNS(XML_xmlns, XML_x), rStrm.getNamespaceURL(OOX_NS(vmlExcel)).toUtf8(),
365 FSNS(XML_xmlns, XML_w10), rStrm.getNamespaceURL(OOX_NS(vmlWord)).toUtf8() );
366
367 for ( const auto& rxObj : rList )
368 {
369 if (IsFormControlObject(rxObj.get()))
370 {
371 auto pFormControlObject = dynamic_cast<XclExpTbxControlObj*>(rxObj.get());
372 if (pFormControlObject)
373 {
374 pFormControlObject->SaveVml(rStrm);
375 }
376 }
377
378 if( !IsVmlObject( rxObj.get() ) )
379 continue;
380 rxObj->SaveXml( rStrm );
381 }
382
383 pVmlDrawing->endElement( XML_xml );
384
385 rStrm.PopStream();
386}
387
388}
389
391{
392 if( pSolverContainer )
393 pSolverContainer->SaveXml( rStrm );
394
395 if( maObjs.empty())
396 return;
397
398 SaveDrawingMLObjects( *this, rStrm );
399 SaveVmlObjects( *this, rStrm );
400 SaveFormControlObjects( *this, rStrm );
401}
402
403// --- class XclObj --------------------------------------------------
404
405XclObj::XclObj( XclExpObjectManager& rObjMgr, sal_uInt16 nObjType, bool bOwnEscher ) :
407 mrEscherEx( rObjMgr.GetEscherEx() ),
408 mnObjType( nObjType ),
409 nObjId(0),
410 nGrbit( 0x6011 ), // AutoLine, AutoFill, Printable, Locked
411 mnScTab(0),
412 bFirstOnSheet( !rObjMgr.HasObj() ),
413 mbOwnEscher( bOwnEscher )
414{
416 if ( bFirstOnSheet )
418 else
420}
421
423{
424 if ( !bFirstOnSheet )
425 delete pMsodrawing;
426 pClientTextbox.reset();
427 pTxo.reset();
428}
429
430void XclObj::ImplWriteAnchor( const SdrObject* pSdrObj, const tools::Rectangle* pChildAnchor )
431{
432 if( pChildAnchor )
433 {
434 mrEscherEx.AddChildAnchor( *pChildAnchor );
435 }
436 else if( pSdrObj )
437 {
438 std::unique_ptr< XclExpDffAnchorBase > xDffAnchor( mrEscherEx.CreateDffAnchor( *pSdrObj ) );
439 xDffAnchor->WriteDffData( mrEscherEx );
440 }
441}
442
444{
445//ToDo: what about the other defined or... types?
446 switch ( nType )
447 {
450 break;
454 break;
457 break;
458 case ESCHER_ShpInst_Arc :
460 break;
463 break;
466 break;
467 default:
469 }
470}
471
472void XclObj::SetText( const XclExpRoot& rRoot, const SdrTextObj& rObj )
473{
474 OSL_ENSURE( !pClientTextbox, "XclObj::SetText: already set" );
475 if ( !pClientTextbox )
476 {
479 mrEscherEx.AddAtom( 0, ESCHER_ClientTextbox ); // TXO record
481 pTxo.reset( new XclTxo( rRoot, rObj ) );
482 }
483}
484
486{
487 OSL_ENSURE( mnObjType != EXC_OBJTYPE_UNKNOWN, "XclObj::WriteBody - unknown type" );
488
489 // create a substream to be able to create subrecords
490 SvMemoryStream aMemStrm;
491 std::optional< XclExpStream > pXclStrm( std::in_place, aMemStrm, rStrm.GetRoot() );
492
493 // write the ftCmo subrecord
494 pXclStrm->StartRecord( EXC_ID_OBJCMO, 18 );
495 *pXclStrm << mnObjType << nObjId << nGrbit;
496 pXclStrm->WriteZeroBytes( 12 );
497 pXclStrm->EndRecord();
498
499 // write other subrecords
500 WriteSubRecs( *pXclStrm );
501
502 // write the ftEnd subrecord
503 pXclStrm->StartRecord( EXC_ID_OBJEND, 0 );
504 pXclStrm->EndRecord();
505
506 // copy the data to the OBJ record
507 pXclStrm.reset();
508 aMemStrm.Seek( 0 );
509 rStrm.CopyFromStream( aMemStrm );
510}
511
513{
514 // MSODRAWING record (msofbtSpContainer)
515 if ( !bFirstOnSheet )
517
518 // OBJ
520
521 // second MSODRAWING record and TXO and CONTINUE records
523}
524
526{
528 return;
529
530 // FtNts subrecord
531 AddRecSize( 26 );
532 // ft, cb
533 rStrm << EXC_ID_OBJNTS << sal_uInt16(0x0016);
534 sal_uInt8 aGUID[16];
535 rtl_createUuid( aGUID, nullptr, false );
536 // guid
537 rStrm.SetSliceSize( 16 );
538 for( int i = 0; i < 16; i++ )
539 rStrm << aGUID[i];
540 rStrm.SetSliceSize( 0 );
541 // fSharedNote
542 rStrm << sal_uInt16(0);
543 // unused
544 rStrm.WriteZeroBytes( 4 );
545}
546
548{
549 // MSODRAWING record (msofbtClientTextbox)
550 if ( pClientTextbox )
551 pClientTextbox->Save( rStrm );
552 // TXO and CONTINUE records
553 if ( pTxo )
554 pTxo->Save( rStrm );
555}
556
557// --- class XclObjComment ------------------------------------------
558
559// tdf#118662 static helper to allow single function access as friend in SdrCaptionObj
560void setSuppressGetBitmapFromXclObjComment(SdrCaptionObj* pSdrCaptionObj, bool bValue)
561{
562 if(nullptr != pSdrCaptionObj)
563 {
564 pSdrCaptionObj->setSuppressGetBitmap(bValue);
565 }
566}
567
568XclObjComment::XclObjComment( XclExpObjectManager& rObjMgr, const tools::Rectangle& rRect, const EditTextObject& rEditObj, SdrCaptionObj* pCaption, bool bVisible, const ScAddress& rAddress, const tools::Rectangle &rFrom, const tools::Rectangle &rTo ) :
569 XclObj( rObjMgr, EXC_OBJTYPE_NOTE, true )
570 , maScPos( rAddress )
571 , mpCaption( pCaption )
573 , maFrom ( rFrom )
574 , maTo ( rTo )
575{
576 // tdf#118662 due to no longer cloning the SdrCaptionObj an old 'hack' using the
577 // fact that no Graphics gets created when a SdrObject is not inserted in a SdrPage
578 // does not work anymore. In SvxShape::GetBitmap that info was used, and here the
579 // SdrCaptionObj was cloned for the only reason to have one not added to a SdrPage.
580 // To emulate old behaviour, use a boolean flag at the SdrCaptionObj.
582
583 ProcessEscherObj( rObjMgr.GetRoot(), rRect, pCaption, bVisible);
584 // TXO
585 pTxo .reset(new XclTxo( rObjMgr.GetRoot(), rEditObj, pCaption ));
586}
587
588static void lcl_FillProps( EscherPropertyContainer& rPropOpt, SdrObject* pCaption, bool bVisible )
589{
590 if( pCaption )
591 {
592 Reference< XShape > aXShape = GetXShapeForSdrObject( pCaption );
593 Reference< XPropertySet > aXPropSet( aXShape, UNO_QUERY );
594 if( aXPropSet.is() )
595 {
596 rPropOpt.CreateFillProperties( aXPropSet, true);
597
598 rPropOpt.AddOpt( ESCHER_Prop_lTxid, 0 ); // undocumented
599 rPropOpt.AddOpt( 0x0158, 0x00000000 ); // undocumented
600
601 sal_uInt32 nValue = 0;
602 if( !rPropOpt.GetOpt( ESCHER_Prop_FitTextToShape, nValue ) )
603 rPropOpt.AddOpt( ESCHER_Prop_FitTextToShape, 0x00080008 ); // bool field
604
605 // Maybe the colour is the same as the 'ToolTip' System colour, but the tooltip
606 // colour shouldn't have influence on the fill colour of the exported shape
607 if( !rPropOpt.GetOpt( ESCHER_Prop_fillColor, nValue ) )
608 rPropOpt.AddOpt( ESCHER_Prop_fillColor, 0x08000050 );
609 if( !rPropOpt.GetOpt( ESCHER_Prop_fillBackColor, nValue ) )
610 rPropOpt.AddOpt( ESCHER_Prop_fillBackColor, 0x08000050 );
611 if( !rPropOpt.GetOpt( ESCHER_Prop_fNoFillHitTest, nValue ) )
612 rPropOpt.AddOpt( ESCHER_Prop_fNoFillHitTest, 0x00110010 ); // bool field
613 if( !rPropOpt.GetOpt( ESCHER_Prop_shadowColor, nValue ) )
614 rPropOpt.AddOpt( ESCHER_Prop_shadowColor, 0x00000000 );
615 if( !rPropOpt.GetOpt( ESCHER_Prop_fshadowObscured, nValue ) ) // bool field
616 rPropOpt.AddOpt( ESCHER_Prop_fshadowObscured, 0x00030003 ); // bool field
617 }
618 }
619
620 sal_uInt32 nFlags = 0x000A0000;
621 ::set_flag( nFlags, sal_uInt32(2), !bVisible );
622 rPropOpt.AddOpt( ESCHER_Prop_fPrint, nFlags ); // bool field
623}
624
625void XclObjComment::ProcessEscherObj( const XclExpRoot& rRoot, const tools::Rectangle& rRect, SdrObject* pCaption, const bool bVisible )
626{
628
629 lcl_FillProps( aPropOpt, pCaption, bVisible );
630
631 nGrbit = 0; // all off: AutoLine, AutoFill, Printable, Locked
633 mrEscherEx.AddShape( ESCHER_ShpInst_TextBox, ShapeFlag::HaveAnchor | ShapeFlag::HaveShapeProperty );
634 aPropOpt.Commit( mrEscherEx.GetStream() );
635
637
638 mrEscherEx.AddAtom( 0, ESCHER_ClientData ); // OBJ record
640
644 mrEscherEx.AddAtom( 0, ESCHER_ClientTextbox ); // TXO record
646 mrEscherEx.CloseContainer(); // ESCHER_SpContainer
647}
648
650{
651 // tdf#118662 reset flag
653}
654
656{
657 // content of this record
659}
660
661namespace {
662
663class VmlCommentExporter : public VMLExport
664{
665 ScAddress maScPos;
666 SdrCaptionObj* mpCaption;
667 bool mbVisible;
670
671public:
672 VmlCommentExporter ( const sax_fastparser::FSHelperPtr& p, const ScAddress& aScPos, SdrCaptionObj* pCaption, bool bVisible, const tools::Rectangle &aFrom, const tools::Rectangle &aTo );
673protected:
674 virtual void Commit( EscherPropertyContainer& rProps, const tools::Rectangle& rRect ) override;
675 using VMLExport::StartShape;
676 virtual sal_Int32 StartShape() override;
677 using VMLExport::EndShape;
678 virtual void EndShape( sal_Int32 nShapeElement ) override;
679};
680
681}
682
683VmlCommentExporter::VmlCommentExporter( const sax_fastparser::FSHelperPtr& p, const ScAddress& aScPos, SdrCaptionObj* pCaption,
684 bool bVisible, const tools::Rectangle &aFrom, const tools::Rectangle &aTo )
685 : VMLExport( p )
686 , maScPos( aScPos )
687 , mpCaption( pCaption )
689 , maFrom ( aFrom )
690 , maTo ( aTo )
691{
692}
693
694void VmlCommentExporter::Commit( EscherPropertyContainer& rProps, const tools::Rectangle& rRect )
695{
696 lcl_FillProps( rProps, mpCaption, mbVisible );
697 rProps.AddOpt( ESCHER_Prop_fHidden, sal_uInt32(mbVisible) ); // bool field
698
699 // shadow property value for comment ( set in lcl_FillProps [*] ) has been
700 // overwritten by new value ( 0x20000 ) in the generic part of the export
701 // ( see EscherPropertyContainer::CreateShadowProperties )
702 // Safer option here is to just force the needed value here for oox vml
703 // export alone ( and avoid potential problems with binary export )
704 // #TODO investigate value of ESCHER_Prop_fshadowObscured generally
705 // in binary export ( if indeed this value is good for binary export )
706 // we can change the heuristics and/or initialisation path and get
707 // rid of line below.
708 // [*] lcl_FillProps seems to be called twice when exporting to xlsx
709 // once from XclObjComment::ProcessEscherObj #TODO look into that also
710 rProps.AddOpt( ESCHER_Prop_fshadowObscured, 0x00030003 ); // force value for comments
711
712 VMLExport::Commit( rProps, rRect );
713}
714
715sal_Int32 VmlCommentExporter::StartShape()
716{
717 AddShapeAttribute( XML_type, "#_x0000_t202" );
718
719 sal_Int32 nId = VMLExport::StartShape();
720
721 return nId;
722}
723
724static const char* lcl_GetHorizAlignFromItemSetChar(const SfxItemSet& rItemSet)
725{
726 switch (rItemSet.Get(EE_PARA_JUST).GetAdjust())
727 {
728 case SvxAdjust::Center:
729 return "Center";
730 case SvxAdjust::Right:
731 return "Right";
732 case SvxAdjust::Block:
733 return "Justify";
734 default:
735 return "Left";
736 }
737}
738
739static const char* lcl_GetVertAlignFromItemSetChar( const SfxItemSet& rItemSet )
740{
741 switch( rItemSet.Get( SDRATTR_TEXT_VERTADJUST ).GetValue() )
742 {
744 return "Center";
746 return "Bottom";
748 return "Justify";
750 default:
751 return "Top";
752 }
753}
754
755void VmlCommentExporter::EndShape( sal_Int32 nShapeElement )
756{
757 char pAnchor[100];
758 sax_fastparser::FSHelperPtr pVmlDrawing = GetFS();
759 snprintf( pAnchor, 100, "%" SAL_PRIdINT64 ", %" SAL_PRIdINT64 ", %" SAL_PRIdINT64 ", %" SAL_PRIdINT64 ", %" SAL_PRIdINT64 ", %" SAL_PRIdINT64 ", %" SAL_PRIdINT64 ", %" SAL_PRIdINT64,
760 sal_Int64(maFrom.Left()), sal_Int64(maFrom.Top()), sal_Int64(maFrom.Right()), sal_Int64(maFrom.Bottom()),
761 sal_Int64(maTo.Left()), sal_Int64(maTo.Top()), sal_Int64(maTo.Right()), sal_Int64(maTo.Bottom()) );
762
763 // Getting comment text alignments
764 const char* pVertAlign = lcl_GetVertAlignFromItemSetChar(mpCaption->GetMergedItemSet());
765 const char* pHorizAlign = lcl_GetHorizAlignFromItemSetChar(mpCaption->GetMergedItemSet());
766
767 pVmlDrawing->startElement(FSNS(XML_x, XML_ClientData), XML_ObjectType, "Note");
768 pVmlDrawing->singleElement(FSNS(XML_x, XML_MoveWithCells));
769 pVmlDrawing->singleElement(FSNS(XML_x, XML_SizeWithCells));
770 XclXmlUtils::WriteElement( pVmlDrawing, FSNS( XML_x, XML_Anchor ), pAnchor );
771 XclXmlUtils::WriteElement( pVmlDrawing, FSNS( XML_x, XML_AutoFill ), "False" );
772 XclXmlUtils::WriteElement( pVmlDrawing, FSNS( XML_x, XML_TextVAlign ), pVertAlign );
773 XclXmlUtils::WriteElement( pVmlDrawing, FSNS( XML_x, XML_TextHAlign ), pHorizAlign );
774 XclXmlUtils::WriteElement( pVmlDrawing, FSNS( XML_x, XML_Row ), maScPos.Row() );
775 XclXmlUtils::WriteElement( pVmlDrawing, FSNS(XML_x, XML_Column), sal_Int32(maScPos.Col()));
776 if(mbVisible)
777 pVmlDrawing->singleElement(FSNS(XML_x, XML_Visible));
778 pVmlDrawing->endElement( FSNS( XML_x, XML_ClientData ) );
779
780 VMLExport::EndShape( nShapeElement );
781}
782
784{
785 VmlCommentExporter aCommentExporter( rStrm.GetCurrentStream(), maScPos, mpCaption, mbVisible, maFrom, maTo );
786 aCommentExporter.AddSdrObject( *mpCaption );
787}
788
789// --- class XclObjDropDown ------------------------------------------
790
792 XclObj( rObjMgr, EXC_OBJTYPE_DROPDOWN, true ),
793 bIsFiltered( bFilt )
794{
795 SetLocked( true );
796 SetPrintable( false );
797 SetAutoFill( true );
798 SetAutoLine( false );
799 nGrbit |= 0x0100; // undocumented
801 mrEscherEx.AddShape( ESCHER_ShpInst_HostControl, ShapeFlag::HaveAnchor | ShapeFlag::HaveShapeProperty );
803 aPropOpt.AddOpt( ESCHER_Prop_LockAgainstGrouping, 0x01040104 ); // bool field
804 aPropOpt.AddOpt( ESCHER_Prop_FitTextToShape, 0x00080008 ); // bool field
805 aPropOpt.AddOpt( ESCHER_Prop_fNoFillHitTest, 0x00010000 ); // bool field
806 aPropOpt.AddOpt( ESCHER_Prop_fNoLineDrawDash, 0x00080000 ); // bool field
807 aPropOpt.AddOpt( ESCHER_Prop_fPrint, 0x000A0000 ); // bool field
808 aPropOpt.Commit( mrEscherEx.GetStream() );
809
811
812 mrEscherEx.AddAtom( 0, ESCHER_ClientData ); // OBJ record
814 mrEscherEx.CloseContainer(); // ESCHER_SpContainer
815
816 // old size + ftSbs + ftLbsData
817 AddRecSize( 24 + 20 );
818}
819
821{
822}
823
825{
826 // ftSbs subrecord - Scroll bars (dummy)
827 rStrm.StartRecord( EXC_ID_OBJSBS, 20 );
828 rStrm.WriteZeroBytes( 20 );
829 rStrm.EndRecord();
830
831 // ftLbsData subrecord - Listbox data
832 sal_uInt16 nDropDownFlags = 0;
833 ::insert_value( nDropDownFlags, EXC_OBJ_DROPDOWN_SIMPLE, 0, 2 );
835 rStrm.StartRecord( EXC_ID_OBJLBSDATA, 16 );
836 rStrm << sal_uInt32(0) << sal_uInt16(0) << sal_uInt16(0x0301) << sal_uInt16(0)
837 << nDropDownFlags << sal_uInt16( 20 ) << sal_uInt16( 130 );
838 rStrm.EndRecord();
839}
840
841// --- class XclTxo --------------------------------------------------
842
844{
845 sal_uInt8 nHorAlign = EXC_OBJ_HOR_LEFT;
846
847 switch( rItemSet.Get( EE_PARA_JUST ).GetAdjust() )
848 {
849 case SvxAdjust::Left: nHorAlign = EXC_OBJ_HOR_LEFT; break;
850 case SvxAdjust::Center: nHorAlign = EXC_OBJ_HOR_CENTER; break;
851 case SvxAdjust::Right: nHorAlign = EXC_OBJ_HOR_RIGHT; break;
852 case SvxAdjust::Block: nHorAlign = EXC_OBJ_HOR_JUSTIFY; break;
853 default:;
854 }
855 return nHorAlign;
856}
857
859{
860 sal_uInt8 nVerAlign = EXC_OBJ_VER_TOP;
861
862 switch( rItemSet.Get( SDRATTR_TEXT_VERTADJUST ).GetValue() )
863 {
864 case SDRTEXTVERTADJUST_TOP: nVerAlign = EXC_OBJ_VER_TOP; break;
865 case SDRTEXTVERTADJUST_CENTER: nVerAlign = EXC_OBJ_VER_CENTER; break;
866 case SDRTEXTVERTADJUST_BOTTOM: nVerAlign = EXC_OBJ_VER_BOTTOM; break;
867 case SDRTEXTVERTADJUST_BLOCK: nVerAlign = EXC_OBJ_VER_JUSTIFY; break;
868 default:;
869 }
870 return nVerAlign;
871}
872
873XclTxo::XclTxo( const OUString& rString, sal_uInt16 nFontIx ) :
874 mpString( std::make_shared<XclExpString>( rString ) ),
875 mnRotation( EXC_OBJ_ORIENT_NONE ),
876 mnHorAlign( EXC_OBJ_HOR_LEFT ),
877 mnVerAlign( EXC_OBJ_VER_TOP )
878{
879 if( mpString->Len() )
880 {
881 // If there is text, Excel *needs* the 2nd CONTINUE record with at least two format runs
882 mpString->AppendFormat( 0, nFontIx );
883 mpString->AppendFormat( mpString->Len(), EXC_FONT_APP );
884 }
885}
886
887XclTxo::XclTxo( const XclExpRoot& rRoot, const SdrTextObj& rTextObj ) :
888 mpString( XclExpStringHelper::CreateString( rRoot, rTextObj ) ),
889 mnRotation( EXC_OBJ_ORIENT_NONE ),
890 mnHorAlign( EXC_OBJ_HOR_LEFT ),
891 mnVerAlign( EXC_OBJ_VER_TOP )
892{
893 // additional alignment and orientation items
894 const SfxItemSet& rItemSet = rTextObj.GetMergedItemSet();
895
896 // horizontal alignment
898
899 // vertical alignment
901
902 // rotation
903 Degree100 nAngle = rTextObj.GetRotateAngle();
904 if( (4500_deg100 < nAngle) && (nAngle < 13500_deg100) )
906 else if( (22500_deg100 < nAngle) && (nAngle < 31500_deg100) )
908 else
910}
911
912XclTxo::XclTxo( const XclExpRoot& rRoot, const EditTextObject& rEditObj, SdrObject* pCaption ) :
913 mpString( XclExpStringHelper::CreateString( rRoot, rEditObj ) ),
914 mnRotation( EXC_OBJ_ORIENT_NONE ),
915 mnHorAlign( EXC_OBJ_HOR_LEFT ),
916 mnVerAlign( EXC_OBJ_VER_TOP )
917{
918 if(!pCaption)
919 return;
920
921 // Excel has one alignment per NoteObject while Calc supports
922 // one alignment per paragraph - use the first paragraph
923 // alignment (if set) as our overall alignment.
924 OUString aParaText( rEditObj.GetText( 0 ) );
925 if( !aParaText.isEmpty() )
926 {
927 const SfxItemSet& aSet( rEditObj.GetParaAttribs( 0));
928 if( const SvxAdjustItem* pItem = aSet.GetItemIfSet( EE_PARA_JUST ) )
929 {
930 SvxAdjust eEEAlign = pItem->GetAdjust();
931 pCaption->SetMergedItem( SvxAdjustItem( eEEAlign, EE_PARA_JUST ) );
932 }
933 }
934 const SfxItemSet& rItemSet = pCaption->GetMergedItemSet();
935
936 // horizontal alignment
938
939 // vertical alignment
941
942 // orientation alignment
943 const SvxWritingModeItem& rItem = rItemSet.Get( SDRATTR_TEXTDIRECTION );
944 if( rItem.GetValue() == css::text::WritingMode_TB_RL )
946}
947
949{
950 OSL_ENSURE( mpString, "XclTxo::SaveCont - missing string" );
951
952 // #i96858# do not save existing string formatting if text is empty
953 sal_uInt16 nRunLen = mpString->IsEmpty() ? 0 : (8 * mpString->GetFormatsCount());
954 // alignment
955 sal_uInt16 nFlags = 0;
956 ::insert_value( nFlags, mnHorAlign, 1, 3 );
957 ::insert_value( nFlags, mnVerAlign, 4, 3 );
958
959 rStrm << nFlags << mnRotation;
960 rStrm.WriteZeroBytes( 6 );
961 rStrm << mpString->Len() << nRunLen << sal_uInt32( 0 );
962}
963
965{
966 // Write the TXO part
968
969 // CONTINUE records are only written if there is some text
970 if( mpString->IsEmpty() )
971 return;
972
973 // CONTINUE for character array
974 rStrm.StartRecord( EXC_ID_CONT, mpString->GetBufferSize() + 1 );
975 rStrm << static_cast< sal_uInt8 >( mpString->GetFlagField() & EXC_STRF_16BIT ); // only Unicode flag
976 mpString->WriteBuffer( rStrm );
977 rStrm.EndRecord();
978
979 // CONTINUE for formatting runs
980 rStrm.StartRecord( EXC_ID_CONT, 8 * mpString->GetFormatsCount() );
981 const XclFormatRunVec& rFormats = mpString->GetFormats();
982 for( const auto& rFormat : rFormats )
983 rStrm << rFormat.mnChar << rFormat.mnFontIdx << sal_uInt32( 0 );
984 rStrm.EndRecord();
985}
986
987sal_uInt16 XclTxo::GetNum() const
988{
989 return EXC_ID_TXO;
990}
991
992std::size_t XclTxo::GetLen() const
993{
994 return 18;
995}
996
997// --- class XclObjOle -------------------------------------------
998
1000 XclObj( rObjMgr, EXC_OBJTYPE_PICTURE ),
1001 rOleObj( rObj ),
1002 pRootStorage( rObjMgr.GetRoot().GetRootStorage().get() )
1003{
1004}
1005
1007{
1008}
1009
1011{
1012 // write only as embedded, not linked
1013 OUString aStorageName( "MBD" );
1014 char aBuf[ sizeof(sal_uInt32) * 2 + 1 ];
1015 // FIXME Eeek! Is this just a way to get a unique id?
1016 sal_uInt32 nPictureId = sal_uInt32(reinterpret_cast<sal_uIntPtr>(this) >> 2);
1017 o3tl::sprintf( aBuf, "%08X", static_cast< unsigned int >( nPictureId ) );
1018 aStorageName += OUString::createFromAscii(aBuf);
1019 tools::SvRef<SotStorage> xOleStg = pRootStorage->OpenSotStorage( aStorageName );
1020 if( !xOleStg.is() )
1021 return;
1022
1023 uno::Reference < embed::XEmbeddedObject > xObj( static_cast<const SdrOle2Obj&>(rOleObj).GetObjRef() );
1024 if ( !xObj.is() )
1025 return;
1026
1027 // set version to "old" version, because it must be
1028 // saved in MS notation.
1029 sal_uInt32 nFl = 0;
1030 const SvtFilterOptions& rFltOpts = SvtFilterOptions::Get();
1031 if( rFltOpts.IsMath2MathType() )
1033
1034 if( rFltOpts.IsWriter2WinWord() )
1036
1037 if( rFltOpts.IsCalc2Excel() )
1038 nFl |= OLE_STARCALC_2_EXCEL;
1039
1040 if( rFltOpts.IsImpress2PowerPoint() )
1042
1043 SvxMSExportOLEObjects aOLEExpFilt( nFl );
1044 aOLEExpFilt.ExportOLEObject( xObj, *xOleStg );
1045
1046 // OBJCF subrecord, undocumented as usual
1047 rStrm.StartRecord( EXC_ID_OBJCF, 2 );
1048 rStrm << sal_uInt16(0x0002);
1049 rStrm.EndRecord();
1050
1051 // OBJFLAGS subrecord, undocumented as usual
1052 rStrm.StartRecord( EXC_ID_OBJFLAGS, 2 );
1053 sal_uInt16 nFlags = EXC_OBJ_PIC_MANUALSIZE;
1054 ::set_flag( nFlags, EXC_OBJ_PIC_SYMBOL, static_cast<const SdrOle2Obj&>(rOleObj).GetAspect() == embed::Aspects::MSOLE_ICON );
1055 rStrm << nFlags;
1056 rStrm.EndRecord();
1057
1058 // OBJPICTFMLA subrecord, undocumented as usual
1059 XclExpString aName( xOleStg->GetUserName() );
1060 sal_uInt16 nPadLen = static_cast<sal_uInt16>(aName.GetSize() & 0x01);
1061 sal_uInt16 nFmlaLen = static_cast< sal_uInt16 >( 12 + aName.GetSize() + nPadLen );
1062 sal_uInt16 nSubRecLen = nFmlaLen + 6;
1063
1064 rStrm.StartRecord( EXC_ID_OBJPICTFMLA, nSubRecLen );
1065 rStrm << nFmlaLen
1066 << sal_uInt16( 5 ) << sal_uInt32( 0 ) << sal_uInt8( 2 )
1067 << sal_uInt32( 0 ) << sal_uInt8( 3 )
1068 << aName;
1069 if( nPadLen )
1070 rStrm << sal_uInt8( 0 ); // pad byte
1071 rStrm << nPictureId;
1072 rStrm.EndRecord();
1073}
1074
1076{
1077 // content of this record
1079}
1080
1081// --- class XclObjAny -------------------------------------------
1082
1083XclObjAny::XclObjAny( XclExpObjectManager& rObjMgr, const Reference< XShape >& rShape, ScDocument* pDoc )
1084 : XclObj( rObjMgr, EXC_OBJTYPE_UNKNOWN )
1085 , mxShape( rShape )
1086 , mpDoc(pDoc)
1087{
1088}
1089
1091{
1092}
1093
1095{
1097 // ftGmo subrecord
1098 rStrm << EXC_ID_OBJGMO << sal_uInt16(2) << sal_uInt16(0);
1099}
1100
1102{
1104 // old size + ftGmo
1105 AddRecSize( 6 );
1106
1107 // content of this record
1109}
1110
1111// --- class ExcBof8_Base --------------------------------------------
1112
1114{
1115 nVers = 0x0600;
1116 nRupBuild = 0x0dbb;
1117 nRupYear = 0x07cc;
1118}
1119
1120void XclObjAny::WriteFromTo( XclExpXmlStream& rStrm, const Reference< XShape >& rShape, SCTAB nTab )
1121{
1122 sax_fastparser::FSHelperPtr pDrawing = rStrm.GetCurrentStream();
1123
1124 awt::Point aTopLeft = rShape->getPosition();
1125 awt::Size aSize = rShape->getSize();
1126
1127 // There are a few cases where we must adjust these values
1128 // Do not adjust objects, which have rotation incorporated into their points
1129 // but report a rotation angle nevertheless.
1131 if (pObj && pObj->GetObjIdentifier() != SdrObjKind::Line && pObj->GetObjIdentifier() != SdrObjKind::PolyLine
1132 && pObj->GetObjIdentifier() != SdrObjKind::PathLine && pObj->GetObjIdentifier() != SdrObjKind::FreehandLine
1133 && pObj->GetObjIdentifier() != SdrObjKind::PathPolyLine)
1134 {
1135 Degree100 nRotation = NormAngle36000(pObj->GetRotateAngle());
1136 if (nRotation)
1137 {
1138 sal_Int16 nHalfWidth = aSize.Width / 2;
1139 sal_Int16 nHalfHeight = aSize.Height / 2;
1140
1141 // Center of bounding box of the rotated shape
1142 const auto aSnapRectCenter(pObj->GetSnapRect().Center());
1143 aTopLeft.X = aSnapRectCenter.X() - nHalfWidth;
1144 aTopLeft.Y = aSnapRectCenter.Y() - nHalfHeight;
1145
1146 // MSO changes the anchor positions at these angles and that does an extra 90 degrees
1147 // rotation on our shapes, so we output it in such position that MSO
1148 // can draw this shape correctly.
1149 if ((nRotation > 4500_deg100 && nRotation <= 13500_deg100) || (nRotation > 22500_deg100 && nRotation <= 31500_deg100))
1150 {
1151 aTopLeft.X = aTopLeft.X - nHalfHeight + nHalfWidth;
1152 aTopLeft.Y = aTopLeft.Y - nHalfWidth + nHalfHeight;
1153
1154 std::swap(aSize.Width, aSize.Height);
1155 }
1156 }
1157 }
1158
1159 tools::Rectangle aLocation( aTopLeft.X, aTopLeft.Y, aTopLeft.X + aSize.Width, aTopLeft.Y + aSize.Height );
1160 ScRange aRange = rStrm.GetRoot().GetDoc().GetRange( nTab, aLocation );
1161 tools::Rectangle aRangeRect = rStrm.GetRoot().GetDoc().GetMMRect( aRange.aStart.Col(), aRange.aStart.Row(),
1162 aRange.aEnd.Col()-1, aRange.aEnd.Row()-1,
1163 nTab );
1164
1165 pDrawing->startElement(FSNS(XML_xdr, XML_from));
1166 XclXmlUtils::WriteElement( pDrawing, FSNS( XML_xdr, XML_col ), static_cast<sal_Int32>(aRange.aStart.Col()) );
1167 XclXmlUtils::WriteElement( pDrawing, FSNS( XML_xdr, XML_colOff ),
1168 oox::drawingml::convertHmmToEmu( aLocation.Left() - aRangeRect.Left() ) );
1169 XclXmlUtils::WriteElement( pDrawing, FSNS( XML_xdr, XML_row ), static_cast<sal_Int32>(aRange.aStart.Row()) );
1170 XclXmlUtils::WriteElement( pDrawing, FSNS( XML_xdr, XML_rowOff ),
1171 oox::drawingml::convertHmmToEmu( aLocation.Top() - aRangeRect.Top() ) );
1172 pDrawing->endElement( FSNS( XML_xdr, XML_from ) );
1173
1174 pDrawing->startElement(FSNS(XML_xdr, XML_to));
1175 XclXmlUtils::WriteElement( pDrawing, FSNS( XML_xdr, XML_col ), static_cast<sal_Int32>(aRange.aEnd.Col()) );
1176 XclXmlUtils::WriteElement( pDrawing, FSNS( XML_xdr, XML_colOff ),
1177 oox::drawingml::convertHmmToEmu( aLocation.Right() - aRangeRect.Right() ) );
1178 XclXmlUtils::WriteElement( pDrawing, FSNS( XML_xdr, XML_row ), static_cast<sal_Int32>(aRange.aEnd.Row()) );
1179 XclXmlUtils::WriteElement( pDrawing, FSNS( XML_xdr, XML_rowOff ),
1180 oox::drawingml::convertHmmToEmu( aLocation.Bottom() - aRangeRect.Bottom() ) );
1181 pDrawing->endElement( FSNS( XML_xdr, XML_to ) );
1182}
1183
1185{
1186 WriteFromTo( rStrm, rObj.GetShape(), rObj.GetTab() );
1187}
1188
1189static const char*
1190GetEditAs( const XclObjAny& rObj )
1191{
1192 if( const SdrObject* pShape = EscherEx::GetSdrObject( rObj.GetShape() ) )
1193 {
1194 switch( ScDrawLayer::GetAnchorType( *pShape ) )
1195 {
1196 case SCA_CELL:
1197 return "oneCell";
1198 case SCA_CELL_RESIZE:
1199 return "twoCell";
1200 default:
1201 case SCA_PAGE:
1202 break; // absolute
1203 }
1204 }
1205 return "absolute";
1206}
1207
1208namespace {
1209
1210ScRefFlags parseRange(const OUString& rString, ScRange& rRange, const ScDocument& rDoc)
1211{
1212 // start with the address convention set in the document
1214 ScRefFlags nResult = rRange.Parse(rString, rDoc, eConv);
1215 if ( nResult & ScRefFlags::VALID )
1216 return nResult;
1217
1218 // try the default calc address convention
1219 nResult = rRange.Parse(rString, rDoc);
1220 if ( nResult & ScRefFlags::VALID )
1221 return nResult;
1222
1223 // try excel a1
1224 nResult = rRange.Parse(rString, rDoc, formula::FormulaGrammar::CONV_XL_A1);
1225 if ( nResult & ScRefFlags::VALID )
1226 return nResult;
1227
1228 // try r1c1
1229 return rRange.Parse(rString, rDoc, formula::FormulaGrammar::CONV_XL_R1C1);
1230}
1231
1232ScRefFlags parseAddress(const OUString& rString, ScAddress& rAddress, const ScDocument& rDoc)
1233{
1234 // start with the address convention set in the document
1236 ScRefFlags nResult = rAddress.Parse(rString, rDoc, eConv);
1237 if ( nResult & ScRefFlags::VALID )
1238 return nResult;
1239
1240 // try the default calc address convention
1241 nResult = rAddress.Parse(rString, rDoc);
1242 if ( nResult & ScRefFlags::VALID )
1243 return nResult;
1244
1245 // try excel a1
1246 nResult = rAddress.Parse(rString, rDoc, formula::FormulaGrammar::CONV_XL_A1);
1247 if ( nResult & ScRefFlags::VALID )
1248 return nResult;
1249
1250 // try r1c1
1251 return rAddress.Parse(rString, rDoc, formula::FormulaGrammar::CONV_XL_R1C1);
1252}
1253
1254void transformURL(const OUString& rOldURL, OUString& rNewURL, const ScDocument& rDoc)
1255{
1256 if (rOldURL.startsWith("#"))
1257 {
1258 // URL has to be decoded for escaped characters (%20)
1259 OUString aURL = INetURLObject::decode( rOldURL,
1261 OUString aAddressString = aURL.copy(1);
1262
1263 ScRange aRange;
1264 ScRefFlags nResult = parseRange(aAddressString, aRange, rDoc);
1265 if ( nResult & ScRefFlags::VALID )
1266 {
1267 OUString aString = aRange.Format(rDoc, nResult, formula::FormulaGrammar::CONV_XL_OOX);
1268 rNewURL = "#" + aString;
1269 return;
1270 }
1271 else
1272 {
1273 ScAddress aAddress;
1274 nResult = parseAddress(aAddressString, aAddress, rDoc);
1275 if( nResult & ScRefFlags::VALID )
1276 {
1277 OUString aString = aAddress.Format(nResult, &rDoc, formula::FormulaGrammar::CONV_XL_OOX);
1278 rNewURL = "#" + aString;
1279 return;
1280 }
1281 }
1282 }
1283
1284 rNewURL = rOldURL;
1285}
1286
1287}
1288
1290 : mrDoc(rDoc)
1291{
1292}
1293
1294OUString ScURLTransformer::getTransformedString(const OUString& rURL) const
1295{
1296 OUString aNewURL;
1297 transformURL(rURL, aNewURL, mrDoc);
1298 return aNewURL;
1299}
1300
1301bool ScURLTransformer::isExternalURL(const OUString& rURL) const
1302{
1303 return !rURL.startsWith("#");
1304}
1305
1307{
1308 // Do not output any of the detective shapes and validation circles.
1310 if (pObject)
1311 {
1312 ScDocument& rDoc = rStrm.GetRoot().GetDoc();
1313 ScDetectiveFunc aDetFunc(rDoc, mnScTab);
1314 ScAddress aPosition;
1315 ScRange aSourceRange;
1316 bool bRedLine;
1317 ScDetectiveObjType eObjType
1318 = aDetFunc.GetDetectiveObjectType(pObject, mnScTab, aPosition, aSourceRange, bRedLine);
1319
1320 if (eObjType != SC_DETOBJ_NONE)
1321 return;
1322 }
1323
1324 sax_fastparser::FSHelperPtr pDrawing = rStrm.GetCurrentStream();
1325
1326 ShapeExport aDML(XML_xdr, pDrawing, nullptr, &rStrm, drawingml::DOCUMENT_XLSX);
1327 auto pURLTransformer = std::make_shared<ScURLTransformer>(*mpDoc);
1328 aDML.SetURLTranslator(pURLTransformer);
1329
1330 pDrawing->startElement( FSNS( XML_xdr, XML_twoCellAnchor ), // OOXTODO: oneCellAnchor, absoluteAnchor
1331 XML_editAs, GetEditAs( *this ) );
1332 Reference< XPropertySet > xPropSet( mxShape, UNO_QUERY );
1333 if (xPropSet.is())
1334 {
1335 WriteFromTo( rStrm, *this );
1336 aDML.WriteShape( mxShape );
1337 }
1338
1339 pDrawing->singleElement( FSNS( XML_xdr, XML_clientData)
1340 // OOXTODO: XML_fLocksWithSheet
1341 // OOXTODO: XML_fPrintsWithSheet
1342 );
1343 pDrawing->endElement( FSNS( XML_xdr, XML_twoCellAnchor ) );
1344}
1345
1347{
1348 rStrm.DisableEncryption();
1350 << sal_uInt32(0)/*nFileHistory*/
1351 << sal_uInt32(0x06) /*nLowestBiffVer = Biff8*/;
1352}
1353
1354sal_uInt16 ExcBof8_Base::GetNum() const
1355{
1356 return 0x0809;
1357}
1358
1359std::size_t ExcBof8_Base::GetLen() const
1360{
1361 return 16;
1362}
1363
1364// --- class ExcBof8 -------------------------------------------------
1365
1367{
1368 nDocType = 0x0010;
1369}
1370
1371// --- class ExcBofW8 ------------------------------------------------
1372
1374{
1375 nDocType = 0x0005;
1376}
1377
1378// --- class ExcBundlesheet8 -----------------------------------------
1379
1381 ExcBundlesheetBase( rRootData, static_cast<sal_uInt16>(_nTab) ),
1382 sUnicodeName( rRootData.pER->GetTabInfo().GetScTabName( _nTab ) )
1383{
1384}
1385
1387 sUnicodeName(std::move( aString ))
1388{
1389}
1390
1392{
1393 m_nOwnPos = rStrm.GetSvStreamPos();
1394 // write dummy position, real position comes later
1395 rStrm.DisableEncryption();
1396 rStrm << sal_uInt32(0);
1397 rStrm.EnableEncryption();
1398 rStrm << nGrbit << GetName();
1399}
1400
1401std::size_t ExcBundlesheet8::GetLen() const
1402{ // Text max 255 chars
1403 return 8 + GetName().GetBufferSize();
1404}
1405
1407{
1408 OUString sId;
1409 rStrm.CreateOutputStream(
1410 XclXmlUtils::GetStreamName( "xl/", "worksheets/sheet", nTab+1),
1411 XclXmlUtils::GetStreamName( nullptr, "worksheets/sheet", nTab+1),
1412 rStrm.GetCurrentStream()->getOutputStream(),
1413 "application/vnd.openxmlformats-officedocument.spreadsheetml.worksheet+xml",
1414 oox::getRelationship(Relationship::WORKSHEET),
1415 &sId );
1416
1417 rStrm.GetCurrentStream()->singleElement( XML_sheet,
1418 XML_name, sUnicodeName.toUtf8(),
1419 XML_sheetId, OString::number( nTab+1 ),
1420 XML_state, nGrbit == 0x0000 ? "visible" : "hidden",
1421 FSNS( XML_r, XML_id ), sId.toUtf8() );
1422}
1423
1424// --- class XclObproj -----------------------------------------------
1425
1426sal_uInt16 XclObproj::GetNum() const
1427{
1428 return 0x00D3;
1429}
1430
1431std::size_t XclObproj::GetLen() const
1432{
1433 return 0;
1434}
1435
1436// ---- class XclCodename --------------------------------------------
1437
1438XclCodename::XclCodename( const OUString& r ) : aName( r )
1439{
1440}
1441
1443{
1444 rStrm << aName;
1445}
1446
1447sal_uInt16 XclCodename::GetNum() const
1448{
1449 return 0x01BA;
1450}
1451
1452std::size_t XclCodename::GetLen() const
1453{
1454 return aName.GetSize();
1455}
1456
1457// ---- Scenarios ----------------------------------------------------
1458
1459ExcEScenarioCell::ExcEScenarioCell( sal_uInt16 nC, sal_uInt16 nR, const OUString& rTxt ) :
1460 nCol( nC ),
1461 nRow( nR ),
1462 sText( rTxt, XclStrFlags::NONE, 255 )
1463{
1464}
1465
1467{
1468 rStrm << nRow << nCol;
1469}
1470
1472{
1473 rStrm << sText;
1474}
1475
1477{
1478 rStrm.GetCurrentStream()->singleElement( XML_inputCells,
1479 // OOXTODO: XML_deleted,
1480 // OOXTODO: XML_numFmtId,
1481 XML_r, XclXmlUtils::ToOString( rStrm.GetRoot().GetDoc(), ScAddress( nCol, nRow, 0 ) ),
1482 // OOXTODO: XML_undone,
1483 XML_val, XclXmlUtils::ToOString( sText ) );
1484}
1485
1487{
1488 OUString sTmpName;
1489 OUString sTmpComm;
1490 OUString aTmp;
1491 Color aDummyCol;
1492 ScScenarioFlags nFlags;
1493
1494 ScDocument& rDoc = rRoot.GetDoc();
1495 rDoc.GetName(nTab, aTmp);
1496 sTmpName = aTmp;
1498 nRecLen = 8 + sName.GetBufferSize();
1499
1500 rDoc.GetScenarioData( nTab, aTmp, aDummyCol, nFlags );
1501 sTmpComm = aTmp;
1502 sComment.Assign( sTmpComm, XclStrFlags::NONE, 255 );
1503 if( sComment.Len() )
1506
1509
1510 const ScRangeList* pRList = rDoc.GetScenarioRanges( nTab );
1511 if( !pRList )
1512 return;
1513
1514 bool bContLoop = true;
1515 SCROW nRow;
1516 SCCOL nCol;
1517 OUString sText;
1518 double fVal;
1519
1520 for( size_t nRange = 0; (nRange < pRList->size()) && bContLoop; nRange++ )
1521 {
1522 const ScRange & rRange = (*pRList)[nRange];
1523 for( nRow = rRange.aStart.Row(); (nRow <= rRange.aEnd.Row()) && bContLoop; nRow++ )
1524 for( nCol = rRange.aStart.Col(); (nCol <= rRange.aEnd.Col()) && bContLoop; nCol++ )
1525 {
1526 if( rDoc.HasValueData( nCol, nRow, nTab ) )
1527 {
1528 fVal = rDoc.GetValue( nCol, nRow, nTab );
1529 sText = ::rtl::math::doubleToUString( fVal,
1530 rtl_math_StringFormat_Automatic,
1531 rtl_math_DecimalPlaces_Max,
1532 ScGlobal::getLocaleData().getNumDecimalSep()[0],
1533 true );
1534 }
1535 else
1536 sText = rDoc.GetString(nCol, nRow, nTab);
1537 bContLoop = Append( static_cast<sal_uInt16>(nCol),
1538 static_cast<sal_uInt16>(nRow), sText );
1539 }
1540 }
1541}
1542
1543bool ExcEScenario::Append( sal_uInt16 nCol, sal_uInt16 nRow, const OUString& rTxt )
1544{
1545 if( aCells.size() == EXC_SCEN_MAXCELL )
1546 return false;
1547
1548 ExcEScenarioCell aCell(nCol, nRow, rTxt);
1549 aCells.push_back(aCell);
1550 nRecLen += 6 + aCell.GetStringBytes(); // 4 bytes address, 2 bytes ifmt
1551 return true;
1552}
1553
1555{
1556 sal_uInt16 count = aCells.size();
1557
1558 rStrm << count // number of cells
1559 << sal_uInt8(bProtected) // fProtection
1560 << sal_uInt8(0) // fHidden
1561 << static_cast<sal_uInt8>(sName.Len()) // length of scen name
1562 << static_cast<sal_uInt8>(sComment.Len()) // length of comment
1563 << static_cast<sal_uInt8>(sUserName.Len()); // length of user name
1566
1567 rStrm << sUserName;
1568
1569 if( sComment.Len() )
1570 rStrm << sComment;
1571
1572 for( const auto& rCell : aCells )
1573 rCell.WriteAddress( rStrm ); // pos of cell
1574 for( const auto& rCell : aCells )
1575 rCell.WriteText( rStrm ); // string content
1576 rStrm.SetSliceSize( 2 );
1577 rStrm.WriteZeroBytes( 2 * count ); // date format
1578}
1579
1580sal_uInt16 ExcEScenario::GetNum() const
1581{
1582 return 0x00AF;
1583}
1584
1585std::size_t ExcEScenario::GetLen() const
1586{
1587 return nRecLen;
1588}
1589
1591{
1592 sax_fastparser::FSHelperPtr& rWorkbook = rStrm.GetCurrentStream();
1593 rWorkbook->startElement( XML_scenario,
1594 XML_name, XclXmlUtils::ToOString( sName ),
1595 XML_locked, ToPsz( bProtected ),
1596 // OOXTODO: XML_hidden,
1597 XML_count, OString::number( aCells.size() ),
1598 XML_user, XESTRING_TO_PSZ( sUserName ),
1599 XML_comment, XESTRING_TO_PSZ( sComment ) );
1600
1601 for( const auto& rCell : aCells )
1602 rCell.SaveXml( rStrm );
1603
1604 rWorkbook->endElement( XML_scenario );
1605}
1606
1608 nActive( 0 )
1609{
1610 ScDocument& rDoc = rRoot.GetDoc();
1611 if( rDoc.IsScenario( nTab ) )
1612 return;
1613
1614 SCTAB nFirstTab = nTab + 1;
1615 SCTAB nNewTab = nFirstTab;
1616
1617 while( rDoc.IsScenario( nNewTab ) )
1618 {
1619 aScenes.emplace_back( rRoot, nNewTab );
1620
1621 if( rDoc.IsActiveScenario( nNewTab ) )
1622 nActive = static_cast<sal_uInt16>(nNewTab - nFirstTab);
1623 nNewTab++;
1624 }
1625}
1626
1628{
1629}
1630
1632{
1633 rStrm << static_cast<sal_uInt16>(aScenes.size()) // number of scenarios
1634 << nActive // active scen
1635 << nActive // last displayed
1636 << sal_uInt16(0); // reference areas
1637}
1638
1640{
1641 if( !aScenes.empty() )
1643
1644 for( ExcEScenario& rScenario : aScenes )
1645 rScenario.Save( rStrm );
1646}
1647
1649{
1650 if( aScenes.empty() )
1651 return;
1652
1653 sax_fastparser::FSHelperPtr& rWorkbook = rStrm.GetCurrentStream();
1654 rWorkbook->startElement( XML_scenarios,
1655 XML_current, OString::number( nActive ),
1656 XML_show, OString::number( nActive )
1657 // OOXTODO: XML_sqref
1658 );
1659
1660 for( ExcEScenario& rScenario : aScenes )
1661 rScenario.SaveXml( rStrm );
1662
1663 rWorkbook->endElement( XML_scenarios );
1664}
1665
1667{
1668 return 0x00AE;
1669}
1670
1672{
1673 return 8;
1674}
1675
1676namespace {
1677
1678struct XclExpTabProtectOption
1679{
1681 sal_uInt16 nMask;
1682};
1683
1684}
1685
1687 XclExpRecord( 0x0867, 23 )
1688{
1689 static const XclExpTabProtectOption aTable[] =
1690 {
1691 { ScTableProtection::OBJECTS, 0x0001 },
1692 { ScTableProtection::SCENARIOS, 0x0002 },
1699
1703 { ScTableProtection::SORT, 0x0800 },
1707
1708 { ScTableProtection::NONE, 0x0000 }
1709 };
1710
1711 mnOptions = 0x0000;
1712 const ScTableProtection* pProtect = rRoot.GetDoc().GetTabProtection(nTab);
1713 if (!pProtect)
1714 return;
1715
1716 for (int i = 0; aTable[i].nMask != 0x0000; ++i)
1717 {
1718 if ( pProtect->isOptionEnabled(aTable[i].eOption) )
1719 mnOptions |= aTable[i].nMask;
1720 }
1721}
1722
1724{
1725 sal_uInt16 nBytes = 0x0867;
1726 rStrm << nBytes;
1727
1728 for (int i = 0; i < 9; ++i)
1729 rStrm << static_cast<unsigned char>(0);
1730
1731 nBytes = 0x0200;
1732 rStrm << nBytes;
1733 nBytes = 0x0100;
1734 rStrm << nBytes;
1735 nBytes = 0xFFFF;
1736 rStrm << nBytes << nBytes;
1737
1738 rStrm << mnOptions;
1739 nBytes = 0;
1740 rStrm << nBytes;
1741}
1742
1744 ScEnhancedProtection aProt ) :
1745 XclExpRecord( 0x0868 ),
1746 mrRoot( rRoot ),
1747 maEnhancedProtection(std::move( aProt ))
1748{
1749}
1750
1752{
1753 sal_uInt16 const nRecordType = 0x0868;
1754 rStrm << nRecordType; // frtHeader rt
1755 rStrm.WriteZeroBytesToRecord(10); // frtHeader unused
1756 rStrm << EXC_ISFPROTECTION; // isf
1757 rStrm.WriteZeroBytesToRecord(5); // reserved1 (1 bytes) and reserved2 (4 bytes)
1758
1759 XclRangeList aRefs;
1762 sal_uInt16 nCref = ulimit_cast<sal_uInt16>(aRefs.size());
1763 rStrm << nCref; // cref
1764 rStrm.WriteZeroBytesToRecord(6); // cbFeatData if EXC_ISFFEC2 (4 bytes) and reserved3 (2 bytes)
1765 aRefs.Write( rStrm, true, nCref); // refs
1766
1767 // FeatProtection structure
1768 rStrm << maEnhancedProtection.mnAreserved; // 1 bit A and 31 bits reserved
1771 bool bSDContainer = ((maEnhancedProtection.mnAreserved & 0x00000001) == 0x00000001);
1772 sal_uInt32 nCbSD = maEnhancedProtection.maSecurityDescriptor.size();
1773 SAL_WARN_IF( bSDContainer && nCbSD < 20, "sc.filter",
1774 "XclExpSheetEnhancedProtection A flag indicates container but cbSD < 20");
1775 SAL_WARN_IF( !bSDContainer && nCbSD > 0, "sc.filter",
1776 "XclExpSheetEnhancedProtection A flag indicates no container but cbSD > 0");
1777 if (bSDContainer)
1778 {
1779 rStrm << nCbSD;
1780 rStrm.Write( &maEnhancedProtection.maSecurityDescriptor.front(), nCbSD);
1781 }
1782}
1783
1785{
1786 rStrm << nCount;
1787}
1788
1790{
1792}
1793
1794sal_uInt16 XclCalccount::GetNum() const
1795{
1796 return 0x000C;
1797}
1798
1799std::size_t XclCalccount::GetLen() const
1800{
1801 return 2;
1802}
1803
1805{
1806 rStrm.WriteAttributes(XML_iterateCount, OUString::number(nCount));
1807}
1808
1810{
1811 rStrm << nIter;
1812}
1813
1815{
1816 nIter = rDoc.GetDocOptions().IsIter()? 1 : 0;
1817}
1818
1819sal_uInt16 XclIteration::GetNum() const
1820{
1821 return 0x0011;
1822}
1823
1824std::size_t XclIteration::GetLen() const
1825{
1826 return 2;
1827}
1828
1830{
1831 rStrm.WriteAttributes(XML_iterate, ToPsz(nIter == 1));
1832}
1833
1835{
1836 rStrm << fDelta;
1837}
1838
1840{
1841 fDelta = rDoc.GetDocOptions().GetIterEps();
1842}
1843
1844sal_uInt16 XclDelta::GetNum() const
1845{
1846 return 0x0010;
1847}
1848
1849std::size_t XclDelta::GetLen() const
1850{
1851 return 8;
1852}
1853
1855{
1856 rStrm.WriteAttributes(XML_iterateDelta, OUString::number(fDelta));
1857}
1858
1860 XclExpRecord(0x002F, 54),
1861 mrRoot(rRoot)
1862{
1863}
1864
1866{
1867}
1868
1870{
1871 // 0x0000 - neither standard nor strong encryption
1872 // 0x0001 - standard or strong encryption
1873 rStrm << static_cast<sal_uInt16>(0x0001);
1874
1875 // 0x0000 - non standard encryption
1876 // 0x0001 - standard encryption
1877 sal_uInt16 nStdEnc = 0x0001;
1878 rStrm << nStdEnc << nStdEnc;
1879
1880 sal_uInt8 pnDocId[16];
1881 sal_uInt8 pnSalt[16];
1882 sal_uInt8 pnSaltHash[16];
1883 XclExpEncrypterRef xEnc = std::make_shared<XclExpBiff8Encrypter>(mrRoot);
1884 xEnc->GetDocId(pnDocId);
1885 xEnc->GetSalt(pnSalt);
1886 xEnc->GetSaltDigest(pnSaltHash);
1887
1888 rStrm.Write(pnDocId, 16);
1889 rStrm.Write(pnSalt, 16);
1890 rStrm.Write(pnSaltHash, 16);
1891
1892 rStrm.SetEncrypter(xEnc);
1893}
1894
1897{
1898}
1899
1901{
1902 rStrm.DisableEncryption();
1903 rStrm << GetValue();
1904}
1905
1907 XclExpRecord(0x00E2, 0) {}
1908
1910
1912{
1913 // Don't forget to re-enable encryption.
1914 rStrm.EnableEncryption();
1915}
1916
1918 XclExpRecord(0x005C, 112)
1919{
1920}
1921
1923{
1924}
1925
1927{
1928 static const sal_uInt8 aData[] = {
1929 0x04, 0x00, 0x00, 'C', 'a', 'l', 'c', 0x20,
1930 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20,
1931 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20,
1932 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20,
1933 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20,
1934 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20,
1935 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20,
1936 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20,
1937 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20,
1938 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20,
1939 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20,
1940 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20,
1941 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20,
1942 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20 };
1943
1944 for (std::size_t i = 0; i < sizeof(aData); ++i)
1945 rStrm << aData[i];
1946}
1947
1948XclExpFileSharing::XclExpFileSharing( const XclExpRoot& rRoot, sal_uInt16 nPasswordHash, bool bRecommendReadOnly ) :
1950 mnPasswordHash( nPasswordHash ),
1951 mbRecommendReadOnly( bRecommendReadOnly )
1952{
1953 if( rRoot.GetBiff() <= EXC_BIFF5 )
1955 else
1956 maUserName.Assign( rRoot.GetUserName() );
1957}
1958
1960{
1961 if( (mnPasswordHash != 0) || mbRecommendReadOnly )
1963}
1964
1966{
1967 rStrm << sal_uInt16( mbRecommendReadOnly ? 1 : 0 ) << mnPasswordHash << maUserName;
1968}
1969
1971 XclExpRecord(0x01AF, 2)
1972{
1973}
1974
1976{
1977}
1978
1980{
1981 rStrm << static_cast<sal_uInt16>(0x0000);
1982}
1983
1985 XclExpRecord(0x01BC, 2)
1986{
1987}
1988
1990{
1991}
1992
1994{
1995 rStrm << static_cast<sal_uInt16>(0x0000);
1996}
1997
1999 0xC1, 0x01, 0x00, 0x00, 0x54, 0x8D, 0x01, 0x00
2000};
2001
2004{
2005}
2006
2008 0x63, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
2009 0x00, 0x00, 0x15, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
2010 0x02
2011};
2012
2015{
2016}
2017
2019 XclExpBoolRecord( 0x000F, rDoc.GetAddressConvention() != formula::FormulaGrammar::CONV_XL_R1C1 )
2020{
2021}
2022
2024{
2025 rStrm.WriteAttributes(XML_refMode, GetBool() ? "A1" : "R1C1");
2026}
2027
2028/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
const OptionalValueType maFrom
const OptionalValueType maTo
ScRefFlags
Definition: address.hxx:158
virtual OUString GetText(sal_Int32 nPara) const=0
virtual const SfxItemSet & GetParaAttribs(sal_Int32 nPara) const=0
virtual sal_uInt32 EnterGroup(const OUString &rShapeName, const tools::Rectangle *pBoundRect)
virtual void AddShape(sal_uInt32 nShpInstance, ShapeFlag nFlagIds, sal_uInt32 nShapeID=0)
void AddAtom(sal_uInt32 nAtomSitze, sal_uInt16 nRecType, int nRecVersion=0, int nRecInstance=0)
void AddChildAnchor(const tools::Rectangle &rRectangle)
virtual void OpenContainer(sal_uInt16 nEscherContainer, int nRecInstance=0)
static const SdrObject * GetSdrObject(const css::uno::Reference< css::drawing::XShape > &rXShape)
SvStream & GetStream() const
virtual void CloseContainer()
void AddOpt(sal_uInt16 nPropID, bool bBlib, sal_uInt32 nSizeReduction, SvMemoryStream &rStream)
bool GetOpt(sal_uInt16 nPropertyID, sal_uInt32 &rPropValue) const
void CreateFillProperties(const css::uno::Reference< css::beans::XPropertySet > &, bool bEdge, bool bTransparentGradient=false)
void Commit(SvStream &rSt, sal_uInt16 nVersion=3, sal_uInt16 nRecType=ESCHER_OPT)
virtual std::size_t GetLen() const override
Definition: xcl97rec.cxx:1359
virtual sal_uInt16 GetNum() const override
Definition: xcl97rec.cxx:1354
virtual void SaveCont(XclExpStream &rStrm) override
Definition: xcl97rec.cxx:1346
sal_uInt16 nDocType
Definition: excrecds.hxx:100
sal_uInt16 nRupBuild
Definition: excrecds.hxx:102
sal_uInt16 nRupYear
Definition: excrecds.hxx:103
sal_uInt16 nVers
Definition: excrecds.hxx:101
virtual void SaveXml(XclExpXmlStream &rStrm) override
Definition: xcl97rec.cxx:1406
virtual std::size_t GetLen() const override
Definition: xcl97rec.cxx:1401
XclExpString GetName() const
Definition: xcl97rec.hxx:317
virtual void SaveCont(XclExpStream &rStrm) override
Definition: xcl97rec.cxx:1391
OUString sUnicodeName
Definition: xcl97rec.hxx:316
ExcBundlesheet8(const RootData &rRootData, SCTAB nTab)
Definition: xcl97rec.cxx:1380
sal_uInt64 m_nOwnPos
Definition: excrecds.hxx:238
sal_uInt16 nGrbit
Definition: excrecds.hxx:239
std::size_t GetStringBytes() const
Definition: xcl97rec.hxx:369
sal_uInt16 nRow
Definition: xcl97rec.hxx:362
sal_uInt16 nCol
Definition: xcl97rec.hxx:361
void SaveXml(XclExpXmlStream &rStrm) const
Definition: xcl97rec.cxx:1476
void WriteText(XclExpStream &rStrm) const
Definition: xcl97rec.cxx:1471
void WriteAddress(XclExpStream &rStrm) const
Definition: xcl97rec.cxx:1466
XclExpString sText
Definition: xcl97rec.hxx:363
ExcEScenarioCell(sal_uInt16 nC, sal_uInt16 nR, const OUString &rTxt)
Definition: xcl97rec.cxx:1459
ExcEScenarioManager(const XclExpRoot &rRoot, SCTAB nTab)
Definition: xcl97rec.cxx:1607
std::vector< ExcEScenario > aScenes
Definition: xcl97rec.hxx:407
virtual ~ExcEScenarioManager() override
Definition: xcl97rec.cxx:1627
virtual sal_uInt16 GetNum() const override
Definition: xcl97rec.cxx:1666
virtual void SaveXml(XclExpXmlStream &rStrm) override
Definition: xcl97rec.cxx:1648
virtual void SaveCont(XclExpStream &rStrm) override
Definition: xcl97rec.cxx:1631
virtual void Save(XclExpStream &rStrm) override
Writes the record header and calls WriteBody().
Definition: xcl97rec.cxx:1639
sal_uInt16 nActive
Definition: xcl97rec.hxx:406
virtual std::size_t GetLen() const override
Definition: xcl97rec.cxx:1671
XclExpString sComment
Definition: xcl97rec.hxx:383
ExcEScenario(const XclExpRoot &rRoot, SCTAB nTab)
Definition: xcl97rec.cxx:1486
virtual std::size_t GetLen() const override
Definition: xcl97rec.cxx:1585
bool Append(sal_uInt16 nCol, sal_uInt16 nRow, const OUString &rTxt)
Definition: xcl97rec.cxx:1543
virtual sal_uInt16 GetNum() const override
Definition: xcl97rec.cxx:1580
std::vector< ExcEScenarioCell > aCells
Definition: xcl97rec.hxx:387
bool bProtected
Definition: xcl97rec.hxx:385
std::size_t nRecLen
Definition: xcl97rec.hxx:381
virtual void SaveXml(XclExpXmlStream &rStrm) override
Definition: xcl97rec.cxx:1590
XclExpString sName
Definition: xcl97rec.hxx:382
virtual void SaveCont(XclExpStream &rStrm) override
Definition: xcl97rec.cxx:1554
XclExpString sUserName
Definition: xcl97rec.hxx:384
virtual void Save(XclExpStream &rStrm) override
Writes the record header and calls WriteBody().
Definition: excrecds.cxx:93
static OUString decode(std::u16string_view rText, DecodeMechanism eMechanism, rtl_TextEncoding eCharset=RTL_TEXTENCODING_UTF8)
SC_DLLPUBLIC void Format(OStringBuffer &r, ScRefFlags nFlags, const ScDocument *pDocument=nullptr, const Details &rDetails=detailsOOOa1) const
Definition: address.cxx:2074
SC_DLLPUBLIC ScRefFlags Parse(const OUString &, const ScDocument &, const Details &rDetails=detailsOOOa1, ExternalInfo *pExtInfo=nullptr, const css::uno::Sequence< css::sheet::ExternalLinkInfo > *pExternalLinks=nullptr, sal_Int32 *pSheetEndPos=nullptr, const OUString *pErrRef=nullptr)
Definition: address.cxx:1537
SCROW Row() const
Definition: address.hxx:274
SCCOL Col() const
Definition: address.hxx:279
ScDetectiveObjType GetDetectiveObjectType(SdrObject *pObject, SCTAB nObjTab, ScAddress &rPosition, ScRange &rSource, bool &rRedLine)
Definition: detfunc.cxx:1516
sal_uInt16 GetIterCount() const
Definition: docoptio.hxx:61
bool IsIter() const
Definition: docoptio.hxx:59
double GetIterEps() const
Definition: docoptio.hxx:63
SC_DLLPUBLIC bool IsScenario(SCTAB nTab) const
Definition: documen3.cxx:432
SC_DLLPUBLIC const ScTableProtection * GetTabProtection(SCTAB nTab) const
Definition: documen3.cxx:1914
SC_DLLPUBLIC formula::FormulaGrammar::AddressConvention GetAddressConvention() const
Definition: documen3.cxx:492
SC_DLLPUBLIC double GetValue(const ScAddress &rPos) const
Definition: document.cxx:3626
SC_DLLPUBLIC void GetScenarioData(SCTAB nTab, OUString &rComment, Color &rColor, ScScenarioFlags &rFlags) const
Definition: documen3.cxx:469
SC_DLLPUBLIC const ScRangeList * GetScenarioRanges(SCTAB nTab) const
Definition: documen3.cxx:872
SC_DLLPUBLIC bool HasValueData(SCCOL nCol, SCROW nRow, SCTAB nTab) const
Definition: document.cxx:3750
SC_DLLPUBLIC OUString GetString(SCCOL nCol, SCROW nRow, SCTAB nTab, const ScInterpreterContext *pContext=nullptr) const
Definition: document.cxx:3505
SC_DLLPUBLIC bool GetName(SCTAB nTab, OUString &rName) const
Definition: document.cxx:204
SC_DLLPUBLIC const ScDocOptions & GetDocOptions() const
Definition: documen3.cxx:1936
SC_DLLPUBLIC bool IsActiveScenario(SCTAB nTab) const
Definition: documen3.cxx:880
static ScAnchorType GetAnchorType(const SdrObject &)
Definition: drwlayer.cxx:2724
static SC_DLLPUBLIC const LocaleDataWrapper & getLocaleData()
Definition: global.cxx:1055
size_t size() const
Definition: rangelst.hxx:89
OUString Format(const ScDocument &rDocument, ScRefFlags nFlags=ScRefFlags::ZERO, const ScAddress::Details &rDetails=ScAddress::detailsOOOa1, bool bFullAddressNotation=false) const
Returns string with formatted cell range from aStart to aEnd, according to provided address conventio...
Definition: address.cxx:2170
ScAddress aEnd
Definition: address.hxx:498
ScRefFlags Parse(const OUString &, const ScDocument &, const ScAddress::Details &rDetails=ScAddress::detailsOOOa1, ScAddress::ExternalInfo *pExtInfo=nullptr, const css::uno::Sequence< css::sheet::ExternalLinkInfo > *pExternalLinks=nullptr, const OUString *pErrRef=nullptr)
Definition: address.cxx:1700
ScAddress aStart
Definition: address.hxx:497
sheet protection state container
@ NONE
last item - used to resize the vector
bool isOptionEnabled(Option eOption) const
ScURLTransformer(ScDocument &rDoc)
Definition: xcl97rec.cxx:1289
virtual bool isExternalURL(const OUString &rURL) const override
Definition: xcl97rec.cxx:1301
virtual OUString getTransformedString(const OUString &rURL) const override
Definition: xcl97rec.cxx:1294
ScDocument & mrDoc
Definition: xcl97rec.hxx:47
void setSuppressGetBitmap(bool bNew)
static SdrObject * getSdrObjectFromXShape(const css::uno::Reference< css::uno::XInterface > &xInt)
virtual Degree100 GetRotateAngle() const
virtual const tools::Rectangle & GetSnapRect() const
virtual SdrObjKind GetObjIdentifier() const
const SfxItemSet & GetMergedItemSet() const
void SetMergedItem(const SfxPoolItem &rItem)
virtual Degree100 GetRotateAngle() const override
const T * GetItemIfSet(TypedWhichId< T > nWhich, bool bSrchInParent=true) const
const SfxPoolItem & Get(sal_uInt16 nWhich, bool bSrchInParent=true) const
SotStorage * OpenSotStorage(const OUString &rEleName, StreamMode=StreamMode::STD_READWRITE, bool transacted=true)
sal_uInt64 Seek(sal_uInt64 nPos)
bool IsCalc2Excel() const
static SvtFilterOptions & Get()
bool IsImpress2PowerPoint() const
bool IsWriter2WinWord() const
bool IsMath2MathType() const
void ExportOLEObject(svt::EmbeddedObjectRef const &rObj, SotStorage &rDestStg)
css::text::WritingMode GetValue() const
sal_uInt16 nCount
Definition: xcl97rec.hxx:456
XclCalccount(const ScDocument &)
Definition: xcl97rec.cxx:1789
virtual sal_uInt16 GetNum() const override
Definition: xcl97rec.cxx:1794
virtual void SaveCont(XclExpStream &rStrm) override
Definition: xcl97rec.cxx:1784
virtual std::size_t GetLen() const override
Definition: xcl97rec.cxx:1799
virtual void SaveXml(XclExpXmlStream &rStrm) override
Definition: xcl97rec.cxx:1804
virtual std::size_t GetLen() const override
Definition: xcl97rec.cxx:1452
virtual sal_uInt16 GetNum() const override
Definition: xcl97rec.cxx:1447
virtual void SaveCont(XclExpStream &rStrm) override
Definition: xcl97rec.cxx:1442
XclCodename(const OUString &)
Definition: xcl97rec.cxx:1438
XclExpString aName
Definition: xcl97rec.hxx:344
virtual void SaveCont(XclExpStream &rStrm) override
Definition: xcl97rec.cxx:1834
virtual std::size_t GetLen() const override
Definition: xcl97rec.cxx:1849
double fDelta
Definition: xcl97rec.hxx:486
virtual sal_uInt16 GetNum() const override
Definition: xcl97rec.cxx:1844
XclDelta(const ScDocument &)
Definition: xcl97rec.cxx:1839
virtual void SaveXml(XclExpXmlStream &rStrm) override
Definition: xcl97rec.cxx:1854
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
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
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
void ConvertRangeList(XclRangeList &rXclRanges, const ScRangeList &rScRanges, bool bWarn)
Converts the passed Calc cell range list to an Excel cell range list.
Definition: xehelper.cxx:271
Record which contains a Boolean value.
Definition: xerecord.hxx:255
bool GetBool() const
Returns the Boolean value of the record.
Definition: xerecord.hxx:263
A chart object.
Definition: xeescher.hxx:312
css::uno::Reference< css::chart::XChartDocument > GetChartDoc() const
Definition: xeescher.cxx:1618
void WriteDffData(EscherEx &rEscherEx) const
Writes the DFF client anchor structure with the current anchor position.
Definition: xeescher.cxx:258
Represents the position (anchor) of a cell dropdown object.
Definition: xeescher.hxx:109
Represents the position (anchor) of a note object.
Definition: xeescher.hxx:102
Record which exports a memory data array.
Definition: xerecord.hxx:278
const XclExpRoot & mrRoot
Definition: xcl97rec.hxx:516
virtual void WriteBody(XclExpStream &rStrm) override
Writes the body of the record (without record header).
Definition: xcl97rec.cxx:1869
XclExpFileEncryption(const XclExpRoot &rRoot)
Definition: xcl97rec.cxx:1859
virtual ~XclExpFileEncryption() override
Definition: xcl97rec.cxx:1865
XclExpString maUserName
Definition: xcl97rec.hxx:563
XclExpFileSharing(const XclExpRoot &rRoot, sal_uInt16 nPasswordHash, bool bRecommendReadOnly)
Definition: xcl97rec.cxx:1948
sal_uInt16 mnPasswordHash
Definition: xcl97rec.hxx:564
virtual void Save(XclExpStream &rStrm) override
Writes the record header and calls WriteBody().
Definition: xcl97rec.cxx:1959
virtual void WriteBody(XclExpStream &rStrm) override
Writes the body of the record (without record header).
Definition: xcl97rec.cxx:1965
bool mbRecommendReadOnly
Definition: xcl97rec.hxx:565
virtual void WriteBody(XclExpStream &rStrm) override
Writes the body of the record (without record header).
Definition: xcl97rec.cxx:1911
virtual ~XclExpInterfaceEnd() override
Definition: xcl97rec.cxx:1909
XclExpInterfaceHdr(sal_uInt16 nCodePage)
Definition: xcl97rec.cxx:1895
virtual void WriteBody(XclExpStream &rStrm) override
Writes the body of the record.
Definition: xcl97rec.cxx:1900
One or more MSODRAWING records contain the DFF stream data for a drawing shape.
Definition: xeescher.hxx:143
void EndSheet()
close groups and DgContainer opened in ctor
Definition: xcl97rec.cxx:134
sal_uInt16 Add(std::unique_ptr< XclObj >)
return: 1-based ObjId count>=0xFFFF: Obj will be deleted, return 0
Definition: xcl97rec.cxx:106
virtual void SaveXml(XclExpXmlStream &rStrm) override
Definition: xcl97rec.cxx:390
std::unique_ptr< XclExpMsoDrawing > pSolverContainer
Definition: xcl97rec.hxx:89
std::unique_ptr< XclObj > pop_back()
Remove last element in the list.
Definition: xcl97rec.cxx:127
iterator end()
Definition: xcl97rec.hxx:74
std::unique_ptr< XclExpMsoDrawing > pMsodrawingPerSheet
Definition: xcl97rec.hxx:88
XclEscherEx & mrEscherEx
Definition: xcl97rec.hxx:87
virtual ~XclExpObjList() override
Definition: xcl97rec.cxx:99
virtual void Save(XclExpStream &rStrm) override
Writes the record header and calls WriteBody().
Definition: xcl97rec.cxx:144
iterator begin()
Definition: xcl97rec.hxx:72
std::vector< std::unique_ptr< XclObj > > maObjs
Definition: xcl97rec.hxx:91
XclExpObjList(const XclExpRoot &rRoot, XclEscherEx &rEscherEx)
Definition: xcl97rec.cxx:86
SCTAB mnScTab
Definition: xcl97rec.hxx:85
XclExpMsoDrawing * GetMsodrawingPerSheet()
Definition: xeescher.cxx:2016
virtual void WriteBody(XclExpStream &rStrm) override
Writes the body of the record (without record header).
Definition: xcl97rec.cxx:1993
virtual ~XclExpProt4RevPass() override
Definition: xcl97rec.cxx:1989
virtual void WriteBody(XclExpStream &rStrm) override
Writes the body of the record (without record header).
Definition: xcl97rec.cxx:1979
virtual ~XclExpProt4Rev() override
Definition: xcl97rec.cxx:1975
Base class for single records with any content.
Definition: xerecord.hxx:143
virtual void Save(XclExpStream &rStrm) override
Writes the record header and calls WriteBody().
Definition: xerecord.cxx:150
void AddRecSize(std::size_t nRecSize)
Adds a size value to the record size prediction.
Definition: xerecord.hxx:165
Access to global data from other classes.
Definition: xeroot.hxx:113
XclExpAddressConverter & GetAddressConverter() const
Returns the address converter.
Definition: xeroot.cxx:82
const XclExpRoot & GetRoot() const
Returns this root instance - for code readability in derived classes.
Definition: xeroot.hxx:118
virtual void WriteBody(XclExpStream &rStrm) override
Writes the body of the record (without record header).
Definition: xcl97rec.cxx:1751
ScEnhancedProtection maEnhancedProtection
Definition: xcl97rec.hxx:450
XclExpSheetEnhancedProtection(const XclExpRoot &rRoot, ScEnhancedProtection aProt)
Definition: xcl97rec.cxx:1743
const XclExpRoot & mrRoot
Definition: xcl97rec.hxx:449
XclExpSheetProtectOptions(const XclExpRoot &rRoot, SCTAB nTab)
Definition: xcl97rec.cxx:1686
virtual void WriteBody(XclExpStream &rStrm) override
Writes the body of the record (without record header).
Definition: xcl97rec.cxx:1723
This class is used to export Excel record streams.
Definition: xestream.hxx:73
This class provides methods to create an XclExpString.
Definition: xehelper.hxx:215
This class stores an unformatted or formatted string for Excel export.
Definition: xestring.hxx:48
void WriteFlagField(XclExpStream &rStrm) const
Writes the string flags field (1 byte).
Definition: xestring.cxx:280
void AssignByte(std::u16string_view rString, rtl_TextEncoding eTextEnc, XclStrFlags nFlags=XclStrFlags::NONE, sal_uInt16 nMaxLen=EXC_STR_MAXLEN)
Assigns an unformatted string, converts this object to a BIFF2-BIFF7 byte string.
Definition: xestring.cxx:121
void Assign(const OUString &rString, XclStrFlags nFlags=XclStrFlags::NONE, sal_uInt16 nMaxLen=EXC_STR_MAXLEN)
Assigns an unformatted string, converts this object to a BIFF8 Unicode string.
Definition: xestring.cxx:111
std::size_t GetSize() const
Returns the byte count the whole string will take on export.
Definition: xestring.cxx:249
std::size_t GetBufferSize() const
Returns the byte count the character buffer will take on export.
Definition: xestring.cxx:244
void WriteBuffer(XclExpStream &rStrm) const
Writes the raw character buffer.
Definition: xestring.cxx:305
sal_uInt16 Len() const
Returns the character count of the string.
Definition: xestring.hxx:118
Represents an OBJ record for a TBX form control.
Definition: xeescher.hxx:251
void SaveVml(XclExpXmlStream &rStrm)
Save into xl/drawings/vmlDrawing1.vml.
Definition: xeescher.cxx:1193
OUString SaveControlPropertiesXml(XclExpXmlStream &rStrm) const
Definition: xeescher.cxx:1364
void setShapeId(sal_Int32 aShapeId)
Definition: xeescher.cxx:1082
void SaveSheetXml(XclExpXmlStream &rStrm, const OUString &aIdFormControlPr) const
Definition: xeescher.cxx:1441
A record with a single value of type Type.
Definition: xerecord.hxx:199
const Type & GetValue() const
Returns the value of the record.
Definition: xerecord.hxx:208
virtual void WriteBody(XclExpStream &rStrm) override
Writes the body of the record (without record header).
Definition: xcl97rec.cxx:1926
virtual ~XclExpWriteAccess() override
Definition: xcl97rec.cxx:1922
virtual std::size_t GetLen() const override
Definition: xcl97rec.cxx:1824
virtual void SaveCont(XclExpStream &rStrm) override
Definition: xcl97rec.cxx:1809
XclIteration(const ScDocument &)
Definition: xcl97rec.cxx:1814
virtual void SaveXml(XclExpXmlStream &rStrm) override
Definition: xcl97rec.cxx:1829
sal_uInt16 nIter
Definition: xcl97rec.hxx:471
virtual sal_uInt16 GetNum() const override
Definition: xcl97rec.cxx:1819
XclObjAny(XclExpObjectManager &rObjMgr, const css::uno::Reference< css::drawing::XShape > &rShape, ScDocument *pDoc)
Definition: xcl97rec.cxx:1083
css::uno::Reference< css::drawing::XShape > mxShape
Definition: xcl97rec.hxx:275
const css::uno::Reference< css::drawing::XShape > & GetShape() const
Definition: xcl97rec.hxx:266
virtual void Save(XclExpStream &rStrm) override
Writes the record header and calls WriteBody().
Definition: xcl97rec.cxx:1101
static void WriteFromTo(XclExpXmlStream &rStrm, const XclObjAny &rObj)
Definition: xcl97rec.cxx:1184
ScDocument * mpDoc
Definition: xcl97rec.hxx:276
virtual ~XclObjAny() override
Definition: xcl97rec.cxx:1090
virtual void WriteSubRecs(XclExpStream &rStrm) override
Definition: xcl97rec.cxx:1094
virtual void SaveXml(XclExpXmlStream &rStrm) override
Definition: xcl97rec.cxx:1306
virtual ~XclObjComment() override
Definition: xcl97rec.cxx:649
XclObjComment(XclExpObjectManager &rObjMgr, const tools::Rectangle &rRect, const EditTextObject &rEditObj, SdrCaptionObj *pCaption, bool bVisible, const ScAddress &rAddress, const tools::Rectangle &rFrom, const tools::Rectangle &To)
Definition: xcl97rec.cxx:568
void ProcessEscherObj(const XclExpRoot &rRoot, const tools::Rectangle &rRect, SdrObject *pCaption, bool bVisible)
c'tor process for formatted text objects above .
Definition: xcl97rec.cxx:625
virtual void Save(XclExpStream &rStrm) override
Writes the record header and calls WriteBody().
Definition: xcl97rec.cxx:655
tools::Rectangle maTo
Definition: xcl97rec.hxx:176
tools::Rectangle maFrom
Definition: xcl97rec.hxx:175
SdrCaptionObj * mpCaption
Definition: xcl97rec.hxx:172
virtual void SaveXml(XclExpXmlStream &rStrm) override
Definition: xcl97rec.cxx:783
ScAddress maScPos
Definition: xcl97rec.hxx:169
virtual void WriteSubRecs(XclExpStream &rStrm) override
Definition: xcl97rec.cxx:824
virtual ~XclObjDropDown() override
Definition: xcl97rec.cxx:820
XclObjDropDown(XclExpObjectManager &rObjMgr, const ScAddress &rPos, bool bFilt)
Definition: xcl97rec.cxx:791
virtual ~XclObjOle() override
Definition: xcl97rec.cxx:1006
XclObjOle(XclExpObjectManager &rObjMgr, const SdrObject &rObj)
Definition: xcl97rec.cxx:999
const SdrObject & rOleObj
Definition: xcl97rec.hxx:240
SotStorage * pRootStorage
Definition: xcl97rec.hxx:241
virtual void WriteSubRecs(XclExpStream &rStrm) override
Definition: xcl97rec.cxx:1010
virtual void Save(XclExpStream &rStrm) override
Writes the record header and calls WriteBody().
Definition: xcl97rec.cxx:1075
sal_uInt16 nObjId
Definition: xcl97rec.hxx:104
void SaveTextRecs(XclExpStream &rStrm)
Definition: xcl97rec.cxx:547
bool bFirstOnSheet
Definition: xcl97rec.hxx:107
XclEscherEx & mrEscherEx
Definition: xcl97rec.hxx:99
sal_uInt16 GetObjType() const
Definition: xcl97rec.hxx:125
SCTAB GetTab() const
Definition: xcl97rec.hxx:130
sal_uInt16 mnObjType
Definition: xcl97rec.hxx:103
XclExpMsoDrawing * pMsodrawing
Definition: xcl97rec.hxx:100
void ImplWriteAnchor(const SdrObject *pSdrObj, const tools::Rectangle *pChildAnchor)
Definition: xcl97rec.cxx:430
void SetEscherShapeType(sal_uInt16 nType)
Definition: xcl97rec.cxx:443
SCTAB mnScTab
Definition: xcl97rec.hxx:106
virtual void WriteSubRecs(XclExpStream &rStrm)
Definition: xcl97rec.cxx:525
void SetPrintable(bool b)
Definition: xcl97rec.hxx:133
virtual void Save(XclExpStream &rStrm) override
Writes the record header and calls WriteBody().
Definition: xcl97rec.cxx:512
void SetAutoLine(bool b)
Definition: xcl97rec.hxx:135
std::unique_ptr< XclExpMsoDrawing > pClientTextbox
Definition: xcl97rec.hxx:101
XclObj(XclExpObjectManager &rObjMgr, sal_uInt16 nObjType, bool bOwnEscher=false)
true = Escher part created on the fly.
Definition: xcl97rec.cxx:405
sal_uInt16 nGrbit
Definition: xcl97rec.hxx:105
std::unique_ptr< XclTxo > pTxo
Definition: xcl97rec.hxx:102
virtual ~XclObj() override
Definition: xcl97rec.cxx:422
void SetLocked(bool b)
Definition: xcl97rec.hxx:132
virtual void WriteBody(XclExpStream &rStrm) override
Writes the body of the record (without record header).
Definition: xcl97rec.cxx:485
void SetAutoFill(bool b)
Definition: xcl97rec.hxx:134
void SetText(const XclExpRoot &rRoot, const SdrTextObj &rObj)
actually writes ESCHER_ClientTextbox
Definition: xcl97rec.cxx:472
virtual sal_uInt16 GetNum() const override
Definition: xcl97rec.cxx:1426
virtual std::size_t GetLen() const override
Definition: xcl97rec.cxx:1431
A 2D cell range address list with Excel column and row indexes.
Definition: xladdress.hxx:102
void Write(XclExpStream &rStrm, bool bCol16Bit=true, sal_uInt16 nCountInStream=0) const
Definition: xladdress.cxx:114
size_t size() const
Definition: xladdress.hxx:109
XclRefmode(const ScDocument &)
Definition: xcl97rec.cxx:2018
virtual void SaveXml(XclExpXmlStream &rStrm) override
Definition: xcl97rec.cxx:2023
rtl_TextEncoding GetTextEncoding() const
Returns the text encoding to import/export byte strings.
Definition: xlroot.hxx:147
const OUString & GetUserName() const
Returns the current user name.
Definition: xlroot.hxx:176
XclBiff GetBiff() const
Returns the current BIFF version of the importer/exporter.
Definition: xlroot.hxx:141
ScDocument & GetDoc() const
Returns reference to the destination document (import) or source document (export).
Definition: xlroot.cxx:285
XclTxo(const OUString &rString, sal_uInt16 nFontIx)
Definition: xcl97rec.cxx:873
sal_uInt16 mnRotation
Text and formatting data.
Definition: xcl97rec.hxx:229
sal_uInt8 mnVerAlign
Horizontal alignment.
Definition: xcl97rec.hxx:231
XclExpStringRef mpString
Definition: xcl97rec.hxx:228
virtual std::size_t GetLen() const override
Definition: xcl97rec.cxx:992
void SetHorAlign(sal_uInt8 nHorAlign)
Definition: xcl97rec.hxx:216
virtual sal_uInt16 GetNum() const override
Definition: xcl97rec.cxx:987
virtual void Save(XclExpStream &rStrm) override
Writes the record header and calls WriteBody().
Definition: xcl97rec.cxx:964
void SetVerAlign(sal_uInt8 nVerAlign)
Definition: xcl97rec.hxx:217
virtual void SaveCont(XclExpStream &rStrm) override
Definition: xcl97rec.cxx:948
sal_uInt8 mnHorAlign
Text rotation.
Definition: xcl97rec.hxx:230
static OString ToOString(const Color &rColor)
Definition: xestream.cxx:712
static sax_fastparser::FSHelperPtr WriteElement(sax_fastparser::FSHelperPtr pStream, sal_Int32 nElement, const T &value)
Definition: xestream.hxx:273
static OUString GetStreamName(const char *sStreamDir, const char *sStream, sal_Int32 nId)
Definition: xestream.cxx:697
constexpr Point Center() const
constexpr tools::Long Top() const
constexpr tools::Long Right() const
constexpr tools::Long Left() const
constexpr tools::Long Bottom() const
bool is() const
ScDetectiveObjType
Definition: detfunc.hxx:39
@ SC_DETOBJ_NONE
Definition: detfunc.hxx:40
URL aURL
constexpr TypedWhichId< SvxAdjustItem > EE_PARA_JUST(EE_PARA_START+16)
EmbeddedObjectRef * pObject
#define ESCHER_ShpInst_RoundRectangle
#define ESCHER_Prop_LockAgainstGrouping
#define ESCHER_Prop_fNoFillHitTest
#define ESCHER_ClientData
#define ESCHER_ShpInst_HostControl
#define ESCHER_Prop_fshadowObscured
#define ESCHER_Prop_FitTextToShape
#define ESCHER_Prop_fNoLineDrawDash
#define ESCHER_Prop_shadowColor
#define ESCHER_ShpInst_TextBox
#define ESCHER_DgContainer
#define ESCHER_Prop_fillBackColor
#define ESCHER_ShpInst_Ellipse
#define ESCHER_ShpInst_Arc
#define ESCHER_Prop_fPrint
#define ESCHER_Prop_lTxid
#define ESCHER_ShpInst_Rectangle
#define ESCHER_SpContainer
#define ESCHER_ClientTextbox
#define ESCHER_Prop_fillColor
#define ESCHER_ShpInst_Line
#define ESCHER_ShpInst_PictureFrame
#define EXC_SCEN_MAXCELL
Definition: excdefs.hxx:58
sal_Int16 nValue
constexpr sal_Int32 FSNS(sal_Int32 namespc, sal_Int32 element)
void insert_value(Type &rnBitField, InsertType nValue, sal_uInt8 nStartBit, sal_uInt8 nBitCount)
Inserts a value into a bitfield.
Definition: ftools.hxx:102
void set_flag(Type &rnBitField, Type nMask, bool bSet=true)
Sets or clears (according to bSet) all set bits of nMask in rnBitField.
Definition: ftools.hxx:95
@ SCA_CELL_RESIZE
Definition: global.hxx:376
@ SCA_CELL
Definition: global.hxx:375
@ SCA_PAGE
Definition: global.hxx:377
ScScenarioFlags
Definition: global.hxx:226
OUString aName
void * p
Environment aTo
Environment aFrom
#define SAL_WARN_IF(condition, area, stream)
aBuf
#define OLE_STARIMPRESS_2_POWERPOINT
#define OLE_STARWRITER_2_WINWORD
#define OLE_STARCALC_2_EXCEL
#define OLE_STARMATH_2_MATHTYPE
constexpr OUStringLiteral aData
int i
void SvStream & rStrm
std::shared_ptr< T > make_shared(Args &&... args)
int sprintf(char(&s)[N], char const *format, T &&... arguments)
sal_Int64 convertHmmToEmu(sal_Int32 nValue)
OUString getRelationship(Relationship eRelationship)
std::shared_ptr< FastSerializerHelper > FSHelperPtr
css::uno::Reference< css::linguistic2::XProofreadingIterator > get(css::uno::Reference< css::uno::XComponentContext > const &context)
sal_Int16 nId
QPRO_FUNC_TYPE nType
Definition: qproform.cxx:398
SDRTEXTVERTADJUST_BOTTOM
SDRTEXTVERTADJUST_BLOCK
SDRTEXTVERTADJUST_CENTER
SDRTEXTVERTADJUST_TOP
uno::Reference< drawing::XShape > const mxShape
Container for the Excel EnhancedProtection feature.
sal_uInt32 mnPasswordVerifier
::std::vector< sal_uInt8 > maSecurityDescriptor
ScRangeListRef maRangeList
constexpr TypedWhichId< SdrTextVertAdjustItem > SDRATTR_TEXT_VERTADJUST(SDRATTR_MISC_FIRST+8)
constexpr TypedWhichId< SvxWritingModeItem > SDRATTR_TEXTDIRECTION(SDRATTR_NOTPERSIST_FIRST+34)
SVXCORE_DLLPUBLIC Degree100 NormAngle36000(Degree100 a)
SvxAdjust
bool mbVisible
bool bVisible
unsigned char sal_uInt8
sal_Int16 SCTAB
Definition: types.hxx:22
sal_Int16 SCCOL
Definition: types.hxx:21
sal_Int32 SCROW
Definition: types.hxx:17
SVXCORE_DLLPUBLIC css::uno::Reference< css::drawing::XShape > GetXShapeForSdrObject(SdrObject *pObj) noexcept
OUString sId
static void lcl_FillProps(EscherPropertyContainer &rPropOpt, SdrObject *pCaption, bool bVisible)
Definition: xcl97rec.cxx:588
static const char * lcl_GetVertAlignFromItemSetChar(const SfxItemSet &rItemSet)
Definition: xcl97rec.cxx:739
const sal_uInt8 nDataBookExt[]
Definition: xcl97rec.cxx:2007
static const char * GetEditAs(const XclObjAny &rObj)
Definition: xcl97rec.cxx:1190
static sal_uInt8 lcl_GetHorAlignFromItemSet(const SfxItemSet &rItemSet)
Definition: xcl97rec.cxx:843
static sal_uInt8 lcl_GetVerAlignFromItemSet(const SfxItemSet &rItemSet)
Definition: xcl97rec.cxx:858
const sal_uInt8 nDataRecalcId[]
Definition: xcl97rec.cxx:1998
void setSuppressGetBitmapFromXclObjComment(SdrCaptionObj *pSdrCaptionObj, bool bValue)
Definition: xcl97rec.cxx:560
static const char * lcl_GetHorizAlignFromItemSetChar(const SfxItemSet &rItemSet)
Definition: xcl97rec.cxx:724
std::shared_ptr< XclExpBiff8Encrypter > XclExpEncrypterRef
Definition: xestream.hxx:47
#define XESTRING_TO_PSZ(s)
Definition: xestream.hxx:232
const sal_uInt16 EXC_ISFPROTECTION
Definition: xlconst.hxx:254
const sal_uInt16 EXC_ID_INTERFACEHDR
Definition: xlconst.hxx:214
@ EXC_BIFF5
MS Excel 4.0.
Definition: xlconst.hxx:34
const sal_uInt16 EXC_ID_FILESHARING
Definition: xlcontent.hxx:29
const sal_uInt16 EXC_OBJ_PIC_MANUALSIZE
Definition: xlescher.hxx:152
const sal_uInt16 EXC_ID_OBJPICTFMLA
Option flags.
Definition: xlescher.hxx:212
const sal_uInt16 EXC_OBJ_DROPDOWN_SIMPLE
Dropdown listbox with editable text.
Definition: xlescher.hxx:198
const sal_uInt16 EXC_OBJTYPE_NOTE
Definition: xlescher.hxx:69
const sal_uInt8 EXC_OBJ_VER_CENTER
Definition: xlescher.hxx:128
const sal_uInt16 EXC_OBJTYPE_DRAWING
Definition: xlescher.hxx:70
const sal_uInt16 EXC_OBJTYPE_CHART
Definition: xlescher.hxx:54
const sal_uInt16 EXC_ID_OBJCMO
Check box/radio button cell link.
Definition: xlescher.hxx:224
const sal_uInt8 EXC_OBJ_VER_JUSTIFY
Definition: xlescher.hxx:130
const sal_uInt8 EXC_OBJ_VER_BOTTOM
Definition: xlescher.hxx:129
const sal_uInt16 EXC_ID_OBJGMO
Button data.
Definition: xlescher.hxx:209
const sal_uInt16 EXC_OBJ_PIC_SYMBOL
Definition: xlescher.hxx:154
const sal_uInt16 EXC_OBJTYPE_UNKNOWN
Definition: xlescher.hxx:71
const sal_uInt8 EXC_OBJ_VER_TOP
Definition: xlescher.hxx:127
const sal_uInt16 EXC_OBJTYPE_ARC
Definition: xlescher.hxx:53
const sal_uInt16 EXC_OBJTYPE_DROPDOWN
Definition: xlescher.hxx:68
const sal_uInt16 EXC_ID_OBJSBS
Radio button group data.
Definition: xlescher.hxx:215
const sal_uInt16 EXC_ID_OBJNTS
Scroll bar data.
Definition: xlescher.hxx:216
const sal_uInt16 EXC_OBJTYPE_BUTTON
Definition: xlescher.hxx:56
const sal_uInt16 EXC_OBJ_ORIENT_90CCW
Stacked top to bottom.
Definition: xlescher.hxx:134
const sal_uInt16 EXC_OBJTYPE_GROUP
Definition: xlescher.hxx:49
const sal_uInt8 EXC_OBJ_HOR_CENTER
Definition: xlescher.hxx:123
const sal_uInt16 EXC_OBJ_ORIENT_NONE
Definition: xlescher.hxx:132
const sal_uInt16 EXC_OBJTYPE_RECTANGLE
Definition: xlescher.hxx:51
const sal_uInt16 EXC_ID_OBJFLAGS
Clipboard format.
Definition: xlescher.hxx:211
const sal_uInt8 EXC_OBJ_HOR_LEFT
Definition: xlescher.hxx:122
const sal_uInt16 EXC_ID_OBJ
Definition: xlescher.hxx:44
const sal_uInt16 EXC_OBJTYPE_LINE
Definition: xlescher.hxx:50
const sal_uInt16 EXC_OBJTYPE_TEXT
Definition: xlescher.hxx:55
const sal_uInt16 EXC_OBJ_DROPDOWN_FILTERED
Definition: xlescher.hxx:200
const sal_uInt8 EXC_OBJ_HOR_RIGHT
Definition: xlescher.hxx:124
const sal_uInt16 EXC_ID_TXO
Definition: xlescher.hxx:276
const sal_uInt16 EXC_OBJTYPE_OVAL
Definition: xlescher.hxx:52
const sal_uInt16 EXC_ID_OBJLBSDATA
Check box/radio button data.
Definition: xlescher.hxx:222
const sal_uInt8 EXC_OBJ_HOR_JUSTIFY
Definition: xlescher.hxx:125
const sal_uInt16 EXC_ID_OBJCF
Group marker.
Definition: xlescher.hxx:210
const sal_uInt16 EXC_OBJTYPE_CHECKBOX
Definition: xlescher.hxx:59
const sal_uInt16 EXC_ID_OBJEND
Definition: xlescher.hxx:206
const sal_uInt16 EXC_OBJ_ORIENT_90CW
90 degr. counterclockwise.
Definition: xlescher.hxx:135
const sal_uInt16 EXC_OBJTYPE_PICTURE
Definition: xlescher.hxx:57
const sal_uInt16 EXC_ID_CONT
Definition: xlstream.hxx:36
::std::vector< XclFormatRun > XclFormatRunVec
A vector with all formatting runs for a rich-string.
Definition: xlstring.hxx:85
XclStrFlags
Flags used to specify import/export mode of strings.
Definition: xlstring.hxx:29
@ EightBitLength
Always use UCS-2 characters (default: try to compress). BIFF8 only.
const sal_uInt8 EXC_STRF_16BIT
Definition: xlstring.hxx:45
const sal_uInt16 EXC_FONT_APP
Definition: xlstyle.hxx:77