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