LibreOffice Module sc (master) 1
xeescher.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 <utility>
21#include <xeescher.hxx>
22
23#include <com/sun/star/lang/XServiceInfo.hpp>
24#include <com/sun/star/form/FormComponentType.hpp>
25#include <com/sun/star/awt/VisualEffect.hpp>
26#include <com/sun/star/awt/ScrollBarOrientation.hpp>
27#include <com/sun/star/awt/XControlModel.hpp>
28#include <com/sun/star/drawing/XShape.hpp>
29#include <com/sun/star/form/binding/XBindableValue.hpp>
30#include <com/sun/star/form/binding/XListEntrySink.hpp>
31#include <com/sun/star/awt/Size.hpp>
32#include <com/sun/star/chart/XChartDocument.hpp>
33
34#include <set>
36#include <svx/svdoole2.hxx>
37#include <svx/svdocapt.hxx>
38#include <editeng/outlobj.hxx>
39#include <unotools/tempfile.hxx>
41#include <svtools/embedhlp.hxx>
42
43#include <unonames.hxx>
44#include <convuno.hxx>
45#include <postit.hxx>
46
47#include <fapihelper.hxx>
48#include <xcl97esc.hxx>
49#include <xechart.hxx>
50#include <xeformula.hxx>
51#include <xehelper.hxx>
52#include <xelink.hxx>
53#include <xename.hxx>
54#include <xestyle.hxx>
55#include <xllink.hxx>
56#include <xltools.hxx>
57#include <userdat.hxx>
58#include <drwlayer.hxx>
59#include <svl/itemset.hxx>
60#include <svx/sdtaitm.hxx>
61#include <document.hxx>
62#include <svx/xfillit0.hxx>
63#include <svx/xflclit.hxx>
64
66#include <oox/token/tokens.hxx>
70#include <oox/export/utils.hxx>
71#include <oox/token/namespaces.hxx>
73#include <memory>
74
75using namespace com::sun::star;
76using ::com::sun::star::uno::UNO_QUERY;
77using ::com::sun::star::uno::Reference;
78using ::com::sun::star::uno::Sequence;
79using ::com::sun::star::lang::XServiceInfo;
80using ::com::sun::star::beans::XPropertySet;
81using ::com::sun::star::drawing::XShape;
82using ::com::sun::star::drawing::XShapes;
83using ::com::sun::star::frame::XModel;
84using ::com::sun::star::awt::XControlModel;
85using ::com::sun::star::form::binding::XBindableValue;
86using ::com::sun::star::form::binding::XListEntrySink;
87using ::com::sun::star::script::ScriptEventDescriptor;
88using ::com::sun::star::table::CellAddress;
89using ::com::sun::star::table::CellRangeAddress;
90using ::oox::drawingml::DrawingML;
91using ::oox::drawingml::ChartExport;
92using namespace oox;
93
94namespace
95{
96
97const char *ToHorizAlign( SdrTextHorzAdjust eAdjust )
98{
99 switch( eAdjust )
100 {
102 return "center";
104 return "right";
106 return "justify";
108 default:
109 return "left";
110 }
111}
112
113const char *ToVertAlign( SdrTextVertAdjust eAdjust )
114{
115 switch( eAdjust )
116 {
118 return "center";
120 return "bottom";
122 return "justify";
124 default:
125 return "top";
126 }
127}
128
129void lcl_WriteAnchorVertex( sax_fastparser::FSHelperPtr const & rComments, const tools::Rectangle &aRect )
130{
131 rComments->startElement(FSNS(XML_xdr, XML_col));
132 rComments->writeEscaped( OUString::number( aRect.Left() ) );
133 rComments->endElement( FSNS( XML_xdr, XML_col ) );
134 rComments->startElement(FSNS(XML_xdr, XML_colOff));
135 rComments->writeEscaped( OUString::number( aRect.Top() ) );
136 rComments->endElement( FSNS( XML_xdr, XML_colOff ) );
137 rComments->startElement(FSNS(XML_xdr, XML_row));
138 rComments->writeEscaped( OUString::number( aRect.Right() ) );
139 rComments->endElement( FSNS( XML_xdr, XML_row ) );
140 rComments->startElement(FSNS(XML_xdr, XML_rowOff));
141 rComments->writeEscaped( OUString::number( aRect.Bottom() ) );
142 rComments->endElement( FSNS( XML_xdr, XML_rowOff ) );
143}
144
145tools::Long lcl_hmm2output(tools::Long value, bool bInEMU)
146{
148}
149
150void lcl_GetFromTo( const XclExpRoot& rRoot, const tools::Rectangle &aRect, sal_Int32 nTab, tools::Rectangle &aFrom, tools::Rectangle &aTo, bool bInEMU = false )
151{
152 sal_Int32 nCol = 0, nRow = 0;
153 sal_Int32 nColOff = 0, nRowOff= 0;
154
155 const bool bRTL = rRoot.GetDoc().IsNegativePage( nTab );
156 if (!bRTL)
157 {
158 while(true)
159 {
160 tools::Rectangle r = rRoot.GetDoc().GetMMRect( nCol,nRow,nCol,nRow,nTab );
161 if( r.Left() <= aRect.Left() )
162 {
163 nCol++;
164 nColOff = aRect.Left() - r.Left();
165 }
166 if( r.Top() <= aRect.Top() )
167 {
168 nRow++;
169 nRowOff = aRect.Top() - r.Top();
170 }
171 if( r.Left() > aRect.Left() && r.Top() > aRect.Top() )
172 {
173 aFrom = tools::Rectangle( nCol-1, lcl_hmm2output( nColOff, bInEMU ),
174 nRow-1, lcl_hmm2output( nRowOff, bInEMU ) );
175 break;
176 }
177 }
178 }
179 else
180 {
181 while(true)
182 {
183 tools::Rectangle r = rRoot.GetDoc().GetMMRect( nCol,nRow,nCol,nRow,nTab );
184 if( r.Left() >= aRect.Left() )
185 {
186 nCol++;
187 nColOff = r.Left() - aRect.Left();
188 }
189 if( r.Top() <= aRect.Top() )
190 {
191 nRow++;
192 nRowOff = aRect.Top() - r.Top();
193 }
194 if( r.Left() < aRect.Left() && r.Top() > aRect.Top() )
195 {
196 aFrom = tools::Rectangle( nCol-1, lcl_hmm2output( nColOff, bInEMU ),
197 nRow-1, lcl_hmm2output( nRowOff, bInEMU ) );
198 break;
199 }
200 }
201 }
202 if (!bRTL)
203 {
204 while(true)
205 {
206 tools::Rectangle r = rRoot.GetDoc().GetMMRect( nCol,nRow,nCol,nRow,nTab );
207 if( r.Right() < aRect.Right() )
208 nCol++;
209 if( r.Bottom() < aRect.Bottom() )
210 nRow++;
211 if( r.Right() >= aRect.Right() && r.Bottom() >= aRect.Bottom() )
212 {
213 aTo = tools::Rectangle( nCol, lcl_hmm2output( aRect.Right() - r.Left(), bInEMU ),
214 nRow, lcl_hmm2output( aRect.Bottom() - r.Top(), bInEMU ));
215 break;
216 }
217 }
218 }
219 else
220 {
221 while(true)
222 {
223 tools::Rectangle r = rRoot.GetDoc().GetMMRect( nCol,nRow,nCol,nRow,nTab );
224 if( r.Right() >= aRect.Right() )
225 nCol++;
226 if( r.Bottom() < aRect.Bottom() )
227 nRow++;
228 if( r.Right() < aRect.Right() && r.Bottom() >= aRect.Bottom() )
229 {
230 aTo = tools::Rectangle( nCol, lcl_hmm2output( r.Left() - aRect.Right(), bInEMU ),
231 nRow, lcl_hmm2output( aRect.Bottom() - r.Top(), bInEMU ));
232 break;
233 }
234 }
235 }
236}
237
238} // namespace
239
240// Escher client anchor =======================================================
241
242XclExpDffAnchorBase::XclExpDffAnchorBase( const XclExpRoot& rRoot, sal_uInt16 nFlags ) :
243 XclExpRoot( rRoot ),
244 mnFlags( nFlags )
245{
246}
247
249{
250 ImplSetFlags( rSdrObj );
251}
252
254{
255 ImplSetFlags( rSdrObj );
256 ImplCalcAnchorRect( rSdrObj.GetCurrentBoundRect(), MapUnit::Map100thMM );
257}
258
260{
261 rEscherEx.AddAtom( 18, ESCHER_ClientAnchor );
262 rEscherEx.GetStream().WriteUInt16( mnFlags );
263 WriteXclObjAnchor( rEscherEx.GetStream(), maAnchor );
264}
265
267{
268 // the passed rectangle is in twips
269 ImplCalcAnchorRect( rRect, MapUnit::MapTwip );
270 WriteDffData( rEscherEx );
271}
272
274{
275 OSL_FAIL( "XclExpDffAnchorBase::ImplSetFlags - not implemented" );
276}
277
279{
280 OSL_FAIL( "XclExpDffAnchorBase::ImplCalcAnchorRect - not implemented" );
281}
282
284 XclExpDffAnchorBase( rRoot ),
285 mnScTab( rRoot.GetCurrScTab() )
286{
287}
288
290{
291 // set flags for cell/page anchoring
292 if ( ScDrawLayer::GetAnchorType( rSdrObj ) == SCA_CELL )
293 mnFlags = 0;
294 else
296}
297
299{
300 maAnchor.SetRect( GetRoot(), mnScTab, rRect, eMapUnit );
301}
302
304 const Size& rPageSize, sal_Int32 nScaleX, sal_Int32 nScaleY ) :
305 XclExpDffAnchorBase( rRoot ),
306 maPageSize( rPageSize ),
307 mnScaleX( nScaleX ),
308 mnScaleY( nScaleY )
309{
310}
311
313{
314 // TODO (unsupported feature): fixed size
315}
316
318{
319 maAnchor.SetRect( maPageSize, mnScaleX, mnScaleY, rRect, eMapUnit );
320}
321
324{
325 maAnchor.SetRect( rRoot, rRoot.GetCurrScTab(), rRect, MapUnit::Map100thMM );
326}
327
330{
335}
336
337// MSODRAWING* records ========================================================
338
340 XclExpRecord( nRecId ),
341 mrEscherEx( rEscherEx ),
342 mnFragmentKey( rEscherEx.InitNextDffFragment() )
343{
344}
345
347{
349 "XclExpMsoDrawingBase::WriteBody - DFF stream position mismatch" );
351}
352
355{
356 SvStream& rDffStrm = mrEscherEx.GetStream();
357
358 // write the DGGCONTAINER with some default settings
360
361 // TODO: stuff the OPT atom with our own document defaults?
362 static const sal_uInt8 spnDffOpt[] = {
363 0xBF, 0x00, 0x08, 0x00, 0x08, 0x00, 0x81, 0x01,
364 0x09, 0x00, 0x00, 0x08, 0xC0, 0x01, 0x40, 0x00,
365 0x00, 0x08
366 };
367 mrEscherEx.AddAtom( sizeof( spnDffOpt ), ESCHER_OPT, 3, 3 );
368 rDffStrm.WriteBytes(spnDffOpt, sizeof(spnDffOpt));
369
370 // SPLITMENUCOLORS contains colors in toolbar
371 static const sal_uInt8 spnDffSplitMenuColors[] = {
372 0x0D, 0x00, 0x00, 0x08, 0x0C, 0x00, 0x00, 0x08,
373 0x17, 0x00, 0x00, 0x08, 0xF7, 0x00, 0x00, 0x10
374 };
375 mrEscherEx.AddAtom( sizeof( spnDffSplitMenuColors ), ESCHER_SplitMenuColors, 0, 4 );
376 rDffStrm.WriteBytes(spnDffSplitMenuColors, sizeof(spnDffSplitMenuColors));
377
378 // close the DGGCONTAINER
381}
382
385{
386}
387
388XclExpImgData::XclExpImgData( Graphic aGraphic, sal_uInt16 nRecId ) :
389 maGraphic(std::move( aGraphic )),
390 mnRecId( nRecId )
391{
392}
393
395{
398 aBmp.Convert( BmpConversion::N24Bit );
399
400 Bitmap::ScopedReadAccess pAccess(aBmp);
401 if( !pAccess )
402 return;
403
404 sal_Int32 nWidth = ::std::min< sal_Int32 >( pAccess->Width(), 0xFFFF );
405 sal_Int32 nHeight = ::std::min< sal_Int32 >( pAccess->Height(), 0xFFFF );
406 if( (nWidth <= 0) || (nHeight <= 0) )
407 return;
408
409 sal_uInt8 nPadding = static_cast< sal_uInt8 >( nWidth & 0x03 );
410 sal_uInt32 nTmpSize = static_cast< sal_uInt32 >( (nWidth * 3 + nPadding) * nHeight + 12 );
411
412 rStrm.StartRecord( mnRecId, nTmpSize + 4 );
413
414 rStrm << EXC_IMGDATA_BMP // BMP format
415 << EXC_IMGDATA_WIN // Windows
416 << nTmpSize // size after _this_ field
417 << sal_uInt32( 12 ) // BITMAPCOREHEADER size
418 << static_cast< sal_uInt16 >( nWidth ) // width
419 << static_cast< sal_uInt16 >( nHeight ) // height
420 << sal_uInt16( 1 ) // planes
421 << sal_uInt16( 24 ); // bits per pixel
422
423 for( sal_Int32 nY = nHeight - 1; nY >= 0; --nY )
424 {
425 Scanline pScanline = pAccess->GetScanline( nY );
426 for( sal_Int32 nX = 0; nX < nWidth; ++nX )
427 {
428 const BitmapColor& rBmpColor = pAccess->GetPixelFromData( pScanline, nX );
429 rStrm << rBmpColor.GetBlue() << rBmpColor.GetGreen() << rBmpColor.GetRed();
430 }
431 rStrm.WriteZeroBytes( nPadding );
432 }
433
434 rStrm.EndRecord();
435}
436
438{
439 sax_fastparser::FSHelperPtr pWorksheet = rStrm.GetCurrentStream();
440
441 DrawingML aDML(pWorksheet, &rStrm, drawingml::DOCUMENT_XLSX);
442 OUString rId = aDML.WriteImage( maGraphic );
443 pWorksheet->singleElement(XML_picture, FSNS(XML_r, XML_id), rId);
444}
445
447 XclExpRoot( rRoot ),
448 mnEntryCount( 0 )
449{
450}
451
453{
454}
455
456void XclExpControlHelper::ConvertSheetLinks( Reference< XShape > const & xShape )
457{
458 mxCellLink.reset();
460 mxSrcRange.reset();
461 mnEntryCount = 0;
462
463 // get control model
464 Reference< XControlModel > xCtrlModel = XclControlHelper::GetControlModel( xShape );
465 if( !xCtrlModel.is() )
466 return;
467
468 // *** cell link *** ------------------------------------------------------
469
470 Reference< XBindableValue > xBindable( xCtrlModel, UNO_QUERY );
471 if( xBindable.is() )
472 {
473 Reference< XServiceInfo > xServInfo( xBindable->getValueBinding(), UNO_QUERY );
474 if( xServInfo.is() && xServInfo->supportsService( SC_SERVICENAME_VALBIND ) )
475 {
476 ScfPropertySet aBindProp( xServInfo );
477 CellAddress aApiAddress;
478 if( aBindProp.GetProperty( aApiAddress, SC_UNONAME_BOUNDCELL ) )
479 {
481 if( GetTabInfo().IsExportTab( mxCellLinkAddress.Tab() ) )
483 }
484 }
485 }
486
487 // *** source range *** ---------------------------------------------------
488
489 Reference< XListEntrySink > xEntrySink( xCtrlModel, UNO_QUERY );
490 if( !xEntrySink.is() )
491 return;
492
493 Reference< XServiceInfo > xServInfo( xEntrySink->getListEntrySource(), UNO_QUERY );
494 if( !(xServInfo.is() && xServInfo->supportsService( SC_SERVICENAME_LISTSOURCE )) )
495 return;
496
497 ScfPropertySet aSinkProp( xServInfo );
498 CellRangeAddress aApiRange;
499 if( aSinkProp.GetProperty( aApiRange, SC_UNONAME_CELLRANGE ) )
500 {
501 ScRange aSrcRange;
502 ScUnoConversion::FillScRange( aSrcRange, aApiRange );
503 if( (aSrcRange.aStart.Tab() == aSrcRange.aEnd.Tab()) && GetTabInfo().IsExportTab( aSrcRange.aStart.Tab() ) )
505 mnEntryCount = static_cast< sal_uInt16 >( aSrcRange.aEnd.Col() - aSrcRange.aStart.Col() + 1 );
506 }
507}
508
510{
511 sal_uInt16 nFmlaSize = rTokArr.GetSize();
512 rStrm << nFmlaSize << sal_uInt32( 0 );
513 rTokArr.WriteArray( rStrm );
514 if( nFmlaSize & 1 ) // pad to 16-bit
515 rStrm << sal_uInt8( 0 );
516}
517
518void XclExpControlHelper::WriteFormulaSubRec( XclExpStream& rStrm, sal_uInt16 nSubRecId, const XclTokenArray& rTokArr )
519{
520 rStrm.StartRecord( nSubRecId, (rTokArr.GetSize() + 5) & ~1 );
521 WriteFormula( rStrm, rTokArr );
522 rStrm.EndRecord();
523}
524
525//delete for exporting OCX
526//#if EXC_EXP_OCX_CTRL
527
528XclExpOcxControlObj::XclExpOcxControlObj( XclExpObjectManager& rObjMgr, Reference< XShape > const & xShape,
529 const tools::Rectangle* pChildAnchor, OUString aClassName, sal_uInt32 nStrmStart, sal_uInt32 nStrmSize ) :
530 XclObj( rObjMgr, EXC_OBJTYPE_PICTURE, true ),
531 XclExpControlHelper( rObjMgr.GetRoot() ),
532 maClassName(std::move( aClassName )),
533 mnStrmStart( nStrmStart ),
534 mnStrmSize( nStrmSize )
535{
537
538 // OBJ record flags
539 SetLocked( true );
540 SetPrintable( aCtrlProp.GetBoolProperty( "Printable" ) );
541 SetAutoFill( false );
542 SetAutoLine( false );
543
544 // fill DFF property set
547 ShapeFlag::HaveShapeProperty | ShapeFlag::HaveAnchor | ShapeFlag::OLEShape );
548 tools::Rectangle aDummyRect;
550 aPropOpt.AddOpt( ESCHER_Prop_FitTextToShape, 0x00080008 ); // bool field
551 aPropOpt.AddOpt( ESCHER_Prop_lineColor, 0x08000040 );
552 aPropOpt.AddOpt( ESCHER_Prop_fNoLineDrawDash, 0x00080000 ); // bool field
553
554 // #i51348# name of the control, may overwrite shape name
555 OUString aCtrlName;
556 if( aCtrlProp.GetProperty( aCtrlName, "Name" ) && !aCtrlName.isEmpty() )
557 aPropOpt.AddOpt( ESCHER_Prop_wzName, aCtrlName );
558
559 // meta file
560 //TODO - needs check
561 Reference< XPropertySet > xShapePS( xShape, UNO_QUERY );
562 if( xShapePS.is() && aPropOpt.CreateGraphicProperties( xShapePS, "MetaFile", false ) )
563 {
564 sal_uInt32 nBlipId;
565 if( aPropOpt.GetOpt( ESCHER_Prop_pib, nBlipId ) )
566 aPropOpt.AddOpt( ESCHER_Prop_pictureId, nBlipId );
567 }
568
569 // write DFF property set to stream
570 aPropOpt.Commit( mrEscherEx.GetStream() );
571
572 // anchor
573 ImplWriteAnchor( SdrObject::getSdrObjectFromXShape( xShape ), pChildAnchor );
574
575 mrEscherEx.AddAtom( 0, ESCHER_ClientData ); // OBJ record
576 mrEscherEx.CloseContainer(); // ESCHER_SpContainer
578
579 // spreadsheet links
580 ConvertSheetLinks( xShape );
581}
582
584{
585 // OBJCF - clipboard format
586 rStrm.StartRecord( EXC_ID_OBJCF, 2 );
587 rStrm << sal_uInt16( 2 );
588 rStrm.EndRecord();
589
590 // OBJFLAGS
591 rStrm.StartRecord( EXC_ID_OBJFLAGS, 2 );
592 rStrm << sal_uInt16( 0x0031 );
593 rStrm.EndRecord();
594
595 // OBJPICTFMLA
596 XclExpString aClass( maClassName );
597 sal_uInt16 nClassNameSize = static_cast< sal_uInt16 >( aClass.GetSize() );
598 sal_uInt16 nClassNamePad = nClassNameSize & 1;
599 sal_uInt16 nFirstPartSize = 12 + nClassNameSize + nClassNamePad;
600
601 const XclTokenArray* pCellLink = GetCellLinkTokArr();
602 sal_uInt16 nCellLinkSize = pCellLink ? ((pCellLink->GetSize() + 7) & 0xFFFE) : 0;
603
604 const XclTokenArray* pSrcRange = GetSourceRangeTokArr();
605 sal_uInt16 nSrcRangeSize = pSrcRange ? ((pSrcRange->GetSize() + 7) & 0xFFFE) : 0;
606
607 sal_uInt16 nPictFmlaSize = nFirstPartSize + nCellLinkSize + nSrcRangeSize + 18;
608 rStrm.StartRecord( EXC_ID_OBJPICTFMLA, nPictFmlaSize );
609
610 rStrm << nFirstPartSize // size of first part
611 << sal_uInt16( 5 ) // formula size
612 << sal_uInt32( 0 ) // unknown ID
613 << sal_uInt8( 0x02 ) << sal_uInt32( 0 ) // tTbl token with unknown ID
614 << sal_uInt8( 3 ) // pad to word
615 << aClass; // "Forms.***.1"
616 rStrm.WriteZeroBytes( nClassNamePad ); // pad to word
617 rStrm << mnStrmStart // start in 'Ctls' stream
618 << mnStrmSize // size in 'Ctls' stream
619 << sal_uInt32( 0 ); // class ID size
620 // cell link
621 rStrm << nCellLinkSize;
622 if( pCellLink )
623 WriteFormula( rStrm, *pCellLink );
624 // list source range
625 rStrm << nSrcRangeSize;
626 if( pSrcRange )
627 WriteFormula( rStrm, *pSrcRange );
628
629 rStrm.EndRecord();
630}
631
632//#else
633
634XclExpTbxControlObj::XclExpTbxControlObj( XclExpObjectManager& rRoot, Reference< XShape > const & xShape , const tools::Rectangle* pChildAnchor ) :
635 XclObj( rRoot, EXC_OBJTYPE_UNKNOWN, true ),
636 XclMacroHelper( rRoot ),
637 mxShape( xShape ),
638 meEventType( EXC_TBX_EVENT_ACTION ),
639 mnHeight( 0 ),
640 mnState( 0 ),
641 mnLineCount( 0 ),
642 mnSelEntry( 0 ),
643 mnScrollValue( 0 ),
644 mnScrollMin( 0 ),
645 mnScrollMax( 100 ),
646 mnScrollStep( 1 ),
647 mnScrollPage( 10 ),
648 mbFlatButton( false ),
649 mbFlatBorder( false ),
650 mbMultiSel( false ),
651 mbScrollHor( false ),
652 mbPrint( false ),
653 mbVisible( false ),
654 mnShapeId( 0 ),
655 mrRoot(rRoot)
656{
657 namespace FormCompType = css::form::FormComponentType;
658 namespace AwtVisualEffect = css::awt::VisualEffect;
659 namespace AwtScrollOrient = css::awt::ScrollBarOrientation;
660
662 if( !xShape.is() || !aCtrlProp.Is() )
663 return;
664
665 mnHeight = xShape->getSize().Height;
666 if( mnHeight <= 0 )
667 return;
668
669 // control type
670 sal_Int16 nClassId = 0;
671 if( aCtrlProp.GetProperty( nClassId, "ClassId" ) )
672 {
673 switch( nClassId )
674 {
675 case FormCompType::COMMANDBUTTON: mnObjType = EXC_OBJTYPE_BUTTON; meEventType = EXC_TBX_EVENT_ACTION; break;
676 case FormCompType::RADIOBUTTON: mnObjType = EXC_OBJTYPE_OPTIONBUTTON; meEventType = EXC_TBX_EVENT_ACTION; break;
677 case FormCompType::CHECKBOX: mnObjType = EXC_OBJTYPE_CHECKBOX; meEventType = EXC_TBX_EVENT_ACTION; break;
678 case FormCompType::LISTBOX: mnObjType = EXC_OBJTYPE_LISTBOX; meEventType = EXC_TBX_EVENT_CHANGE; break;
679 case FormCompType::COMBOBOX: mnObjType = EXC_OBJTYPE_DROPDOWN; meEventType = EXC_TBX_EVENT_CHANGE; break;
680 case FormCompType::GROUPBOX: mnObjType = EXC_OBJTYPE_GROUPBOX; meEventType = EXC_TBX_EVENT_MOUSE; break;
681 case FormCompType::FIXEDTEXT: mnObjType = EXC_OBJTYPE_LABEL; meEventType = EXC_TBX_EVENT_MOUSE; break;
682 case FormCompType::SCROLLBAR: mnObjType = EXC_OBJTYPE_SCROLLBAR; meEventType = EXC_TBX_EVENT_VALUE; break;
683 case FormCompType::SPINBUTTON: mnObjType = EXC_OBJTYPE_SPIN; meEventType = EXC_TBX_EVENT_VALUE; break;
684 }
685 }
687 return;
688
689 // OBJ record flags
690 SetLocked( true );
691 mbPrint = aCtrlProp.GetBoolProperty( "Printable" );
693 SetAutoFill( false );
694 SetAutoLine( false );
695
696 // fill DFF property set
698 mrEscherEx.AddShape( ESCHER_ShpInst_HostControl, ShapeFlag::HaveAnchor | ShapeFlag::HaveShapeProperty );
700 mbVisible = aCtrlProp.GetBoolProperty( "EnableVisible" );
701 aPropOpt.AddOpt( ESCHER_Prop_fPrint, mbVisible ? 0x00080000 : 0x00080002 ); // visible flag
702
703 aPropOpt.AddOpt( ESCHER_Prop_LockAgainstGrouping, 0x01000100 ); // bool field
704 aPropOpt.AddOpt( ESCHER_Prop_lTxid, 0 ); // Text ID
705 aPropOpt.AddOpt( ESCHER_Prop_WrapText, 0x00000001 );
706 aPropOpt.AddOpt( ESCHER_Prop_FitTextToShape, 0x001A0008 ); // bool field
707 aPropOpt.AddOpt( ESCHER_Prop_fNoFillHitTest, 0x00100000 ); // bool field
708 aPropOpt.AddOpt( ESCHER_Prop_fNoLineDrawDash, 0x00080000 ); // bool field
709
710 // #i51348# name of the control, may overwrite shape name
711 if( aCtrlProp.GetProperty( msCtrlName, "Name" ) && !msCtrlName.isEmpty() )
713
714 //Export description as alt text
715 if( SdrObject* pSdrObj = SdrObject::getSdrObjectFromXShape( xShape ) )
716 {
717 OUString aAltTxt;
718 OUString aDescrText = pSdrObj->GetDescription();
719 if(!aDescrText.isEmpty())
720 aAltTxt = aDescrText.copy( 0, std::min<sal_Int32>(MSPROP_DESCRIPTION_MAX_LEN, aDescrText.getLength()) );
721 aPropOpt.AddOpt( ESCHER_Prop_wzDescription, aAltTxt );
722 }
723
724 // write DFF property set to stream
725 aPropOpt.Commit( mrEscherEx.GetStream() );
726
727 // anchor
728 ImplWriteAnchor( SdrObject::getSdrObjectFromXShape( xShape ), pChildAnchor );
729
730 mrEscherEx.AddAtom( 0, ESCHER_ClientData ); // OBJ record
732
733 // control label
734 if( aCtrlProp.GetProperty( msLabel, "Label" ) )
735 {
736 /* Be sure to construct the MSODRAWING record containing the
737 ClientTextbox atom after the base OBJ's MSODRAWING record data is
738 completed. */
740 mrEscherEx.AddAtom( 0, ESCHER_ClientTextbox ); // TXO record
742
743 sal_uInt16 nXclFont = EXC_FONT_APP;
744 if( !msLabel.isEmpty() )
745 {
746 XclFontData aFontData;
748 if( (!aFontData.maName.isEmpty() ) && (aFontData.mnHeight > 0) )
749 nXclFont = GetFontBuffer().Insert( aFontData, EXC_COLOR_CTRLTEXT );
750 }
751
752 pTxo.reset( new XclTxo( msLabel, nXclFont ) );
754 pTxo->SetVerAlign( EXC_OBJ_VER_CENTER );
755 }
756
757 mrEscherEx.CloseContainer(); // ESCHER_SpContainer
758
759 // other properties
760 aCtrlProp.GetProperty( mnLineCount, "LineCount" );
761
762 // border style
763 sal_Int16 nApiButton = AwtVisualEffect::LOOK3D;
764 sal_Int16 nApiBorder = AwtVisualEffect::LOOK3D;
765 switch( nClassId )
766 {
767 case FormCompType::LISTBOX:
768 case FormCompType::COMBOBOX:
769 aCtrlProp.GetProperty( nApiBorder, "Border" );
770 break;
771 case FormCompType::CHECKBOX:
772 case FormCompType::RADIOBUTTON:
773 aCtrlProp.GetProperty( nApiButton, "VisualEffect" );
774 nApiBorder = AwtVisualEffect::NONE;
775 break;
776 // Push button cannot be set to flat in Excel
777 case FormCompType::COMMANDBUTTON:
778 nApiBorder = AwtVisualEffect::LOOK3D;
779 break;
780 // Label does not support a border in Excel
781 case FormCompType::FIXEDTEXT:
782 nApiBorder = AwtVisualEffect::NONE;
783 break;
784 /* Scroll bar and spin button have a "Border" property, but it is
785 really used for a border, and not for own 3D/flat look (#i34712#). */
786 case FormCompType::SCROLLBAR:
787 case FormCompType::SPINBUTTON:
788 nApiButton = AwtVisualEffect::LOOK3D;
789 nApiBorder = AwtVisualEffect::NONE;
790 break;
791 // Group box does not support flat style (#i34712#)
792 case FormCompType::GROUPBOX:
793 nApiBorder = AwtVisualEffect::LOOK3D;
794 break;
795 }
796 mbFlatButton = nApiButton != AwtVisualEffect::LOOK3D;
797 mbFlatBorder = nApiBorder != AwtVisualEffect::LOOK3D;
798
799 // control state
800 sal_Int16 nApiState = 0;
801 if( aCtrlProp.GetProperty( nApiState, "State" ) )
802 {
803 switch( nApiState )
804 {
805 case 0: mnState = EXC_OBJ_CHECKBOX_UNCHECKED; break;
806 case 1: mnState = EXC_OBJ_CHECKBOX_CHECKED; break;
807 case 2: mnState = EXC_OBJ_CHECKBOX_TRISTATE; break;
808 }
809 }
810
811 // special control contents
812 switch( nClassId )
813 {
814 case FormCompType::LISTBOX:
815 {
816 mbMultiSel = aCtrlProp.GetBoolProperty( "MultiSelection" );
817 Sequence< sal_Int16 > aSelection;
818 if( aCtrlProp.GetProperty( aSelection, "SelectedItems" ) )
819 {
820 if( aSelection.hasElements() )
821 {
822 mnSelEntry = aSelection[ 0 ] + 1;
824 }
825 }
826
827 // convert listbox with dropdown button to Excel dropdown
828 if( aCtrlProp.GetBoolProperty( "Dropdown" ) )
830 }
831 break;
832
833 case FormCompType::COMBOBOX:
834 {
835 Sequence< OUString > aStringList;
836 OUString aDefText;
837 if( aCtrlProp.GetProperty( aStringList, "StringItemList" ) &&
838 aCtrlProp.GetProperty( aDefText, "Text" ) &&
839 aStringList.hasElements() && !aDefText.isEmpty() )
840 {
841 auto nIndex = comphelper::findValue(aStringList, aDefText);
842 if( nIndex != -1 )
843 mnSelEntry = static_cast< sal_Int16 >( nIndex + 1 ); // 1-based
844 if( mnSelEntry > 0 )
845 maMultiSel.resize( 1, mnSelEntry - 1 );
846 }
847
848 // convert combobox without dropdown button to Excel listbox
849 if( !aCtrlProp.GetBoolProperty( "Dropdown" ) )
851 }
852 break;
853
854 case FormCompType::SCROLLBAR:
855 {
856 sal_Int32 nApiValue = 0;
857 if( aCtrlProp.GetProperty( nApiValue, "ScrollValueMin" ) )
858 mnScrollMin = limit_cast< sal_uInt16 >( nApiValue, EXC_OBJ_SCROLLBAR_MIN, EXC_OBJ_SCROLLBAR_MAX );
859 if( aCtrlProp.GetProperty( nApiValue, "ScrollValueMax" ) )
860 mnScrollMax = limit_cast< sal_uInt16 >( nApiValue, mnScrollMin, EXC_OBJ_SCROLLBAR_MAX );
861 if( aCtrlProp.GetProperty( nApiValue, "ScrollValue" ) )
862 mnScrollValue = limit_cast< sal_uInt16 >( nApiValue, mnScrollMin, mnScrollMax );
863 if( aCtrlProp.GetProperty( nApiValue, "LineIncrement" ) )
864 mnScrollStep = limit_cast< sal_uInt16 >( nApiValue, EXC_OBJ_SCROLLBAR_MIN, EXC_OBJ_SCROLLBAR_MAX );
865 if( aCtrlProp.GetProperty( nApiValue, "BlockIncrement" ) )
866 mnScrollPage = limit_cast< sal_uInt16 >( nApiValue, EXC_OBJ_SCROLLBAR_MIN, EXC_OBJ_SCROLLBAR_MAX );
867 if( aCtrlProp.GetProperty( nApiValue, "Orientation" ) )
868 mbScrollHor = nApiValue == AwtScrollOrient::HORIZONTAL;
869 }
870 break;
871
872 case FormCompType::SPINBUTTON:
873 {
874 sal_Int32 nApiValue = 0;
875 if( aCtrlProp.GetProperty( nApiValue, "SpinValueMin" ) )
876 mnScrollMin = limit_cast< sal_uInt16 >( nApiValue, EXC_OBJ_SCROLLBAR_MIN, EXC_OBJ_SCROLLBAR_MAX );
877 if( aCtrlProp.GetProperty( nApiValue, "SpinValueMax" ) )
878 mnScrollMax = limit_cast< sal_uInt16 >( nApiValue, mnScrollMin, EXC_OBJ_SCROLLBAR_MAX );
879 if( aCtrlProp.GetProperty( nApiValue, "SpinValue" ) )
880 mnScrollValue = limit_cast< sal_uInt16 >( nApiValue, mnScrollMin, mnScrollMax );
881 if( aCtrlProp.GetProperty( nApiValue, "SpinIncrement" ) )
882 mnScrollStep = limit_cast< sal_uInt16 >( nApiValue, EXC_OBJ_SCROLLBAR_MIN, EXC_OBJ_SCROLLBAR_MAX );
883 if( aCtrlProp.GetProperty( nApiValue, "Orientation" ) )
884 mbScrollHor = nApiValue == AwtScrollOrient::HORIZONTAL;
885 }
886 break;
887 }
888
889 {
890 Reference< XControlModel > xCtrlModel = XclControlHelper::GetControlModel( xShape );
891 if( xCtrlModel.is() )
892 {
893 Reference< XBindableValue > xBindable( xCtrlModel, UNO_QUERY );
894 if( xBindable.is() )
895 {
896 Reference< XServiceInfo > xServInfo( xBindable->getValueBinding(), UNO_QUERY );
897 if( xServInfo.is() && xServInfo->supportsService( SC_SERVICENAME_VALBIND ) )
898 {
899 ScfPropertySet aBindProp( xServInfo );
900 CellAddress aApiAddress;
901 if( aBindProp.GetProperty( aApiAddress, SC_UNONAME_BOUNDCELL ) )
902 {
904 if( SdrObject* pSdrObj = SdrObject::getSdrObjectFromXShape( xShape ) )
905 lcl_GetFromTo( rRoot, pSdrObj->GetLogicRect(), mxCellLinkAddress.Tab(), maAreaFrom, maAreaTo, true );
906 }
907 }
908 }
909 }
910 }
911
912 // spreadsheet links
913 ConvertSheetLinks( xShape );
914}
915
916bool XclExpTbxControlObj::SetMacroLink( const ScriptEventDescriptor& rEvent )
917{
919}
920
922{
923 switch( mnObjType )
924 {
925 // *** Push buttons, labels ***
926
929 // ftMacro - macro link
931 break;
932
933 // *** Check boxes, option buttons ***
934
937 {
938 // ftCbls - box properties
939 sal_uInt16 nStyle = 0;
941
942 rStrm.StartRecord( EXC_ID_OBJCBLS, 12 );
943 rStrm << mnState;
944 rStrm.WriteZeroBytes( 8 );
945 rStrm << nStyle;
946 rStrm.EndRecord();
947
948 // ftMacro - macro link
950 // ftCblsFmla subrecord - cell link
952
953 // ftCblsData subrecord - box properties, again
954 rStrm.StartRecord( EXC_ID_OBJCBLS, 8 );
955 rStrm << mnState;
956 rStrm.WriteZeroBytes( 4 );
957 rStrm << nStyle;
958 rStrm.EndRecord();
959 }
960 break;
961
962 // *** List boxes, combo boxes ***
963
966 {
967 sal_uInt16 nEntryCount = GetSourceEntryCount();
968
969 // ftSbs subrecord - Scroll bars
970 sal_Int32 nLineHeight = XclTools::GetHmmFromTwips( 200 ); // always 10pt
972 mnLineCount = static_cast< sal_uInt16 >( mnHeight / nLineHeight );
973 mnScrollValue = 0;
974 mnScrollMin = 0;
975 sal_uInt16 nInvisLines = (nEntryCount >= mnLineCount) ? (nEntryCount - mnLineCount) : 0;
976 mnScrollMax = limit_cast< sal_uInt16 >( nInvisLines, EXC_OBJ_SCROLLBAR_MIN, EXC_OBJ_SCROLLBAR_MAX );
977 mnScrollStep = 1;
979 mbScrollHor = false;
980 WriteSbs( rStrm );
981
982 // ftMacro - macro link
984 // ftSbsFmla subrecord - cell link
986
987 // ftLbsData - source data range and box properties
988 sal_uInt16 nStyle = 0;
991
992 rStrm.StartRecord( EXC_ID_OBJLBSDATA, 0 );
993
994 if( const XclTokenArray* pSrcRange = GetSourceRangeTokArr() )
995 {
996 rStrm << static_cast< sal_uInt16 >( (pSrcRange->GetSize() + 7) & 0xFFFE );
997 WriteFormula( rStrm, *pSrcRange );
998 }
999 else
1000 rStrm << sal_uInt16( 0 );
1001
1002 rStrm << nEntryCount << mnSelEntry << nStyle << sal_uInt16( 0 );
1004 {
1005 if( nEntryCount )
1006 {
1007 ScfUInt8Vec aSelEx( nEntryCount, 0 );
1008 for( const auto& rItem : maMultiSel )
1009 if( rItem < nEntryCount )
1010 aSelEx[ rItem ] = 1;
1011 rStrm.Write( aSelEx.data(), aSelEx.size() );
1012 }
1013 }
1014 else if( mnObjType == EXC_OBJTYPE_DROPDOWN )
1015 {
1016 rStrm << sal_uInt16( 0 ) << mnLineCount << sal_uInt16( 0 ) << sal_uInt16( 0 );
1017 }
1018
1019 rStrm.EndRecord();
1020 }
1021 break;
1022
1023 // *** Spin buttons, scrollbars ***
1024
1025 case EXC_OBJTYPE_SPIN:
1027 {
1028 // ftSbs subrecord - scroll bars
1029 WriteSbs( rStrm );
1030 // ftMacro - macro link
1032 // ftSbsFmla subrecord - cell link
1034 }
1035 break;
1036
1037 // *** Group boxes ***
1038
1040 {
1041 // ftMacro - macro link
1043
1044 // ftGboData subrecord - group box properties
1045 sal_uInt16 nStyle = 0;
1047
1048 rStrm.StartRecord( EXC_ID_OBJGBODATA, 6 );
1049 rStrm << sal_uInt32( 0 )
1050 << nStyle;
1051 rStrm.EndRecord();
1052 }
1053 break;
1054 }
1055}
1056
1057void XclExpTbxControlObj::WriteCellLinkSubRec( XclExpStream& rStrm, sal_uInt16 nSubRecId )
1058{
1059 if( const XclTokenArray* pCellLink = GetCellLinkTokArr() )
1060 WriteFormulaSubRec( rStrm, nSubRecId, *pCellLink );
1061}
1062
1064{
1065 sal_uInt16 nOrient = 0;
1067 sal_uInt16 nStyle = EXC_OBJ_SCROLLBAR_DEFFLAGS;
1069
1070 rStrm.StartRecord( EXC_ID_OBJSBS, 20 );
1071 rStrm << sal_uInt32( 0 ) // reserved
1072 << mnScrollValue // thumb position
1073 << mnScrollMin // thumb min pos
1074 << mnScrollMax // thumb max pos
1075 << mnScrollStep // line increment
1076 << mnScrollPage // page increment
1077 << nOrient // 0 = vertical, 1 = horizontal
1078 << sal_uInt16( 15 ) // thumb width
1079 << nStyle; // flags/style
1080 rStrm.EndRecord();
1081}
1082
1083void XclExpTbxControlObj::setShapeId(sal_Int32 aShapeId)
1084{
1085 mnShapeId = aShapeId;
1086}
1087
1088namespace
1089{
1091class VmlFormControlExporter : public oox::vml::VMLExport
1092{
1093 sal_uInt16 m_nObjType;
1094 tools::Rectangle m_aAreaFrom;
1095 tools::Rectangle m_aAreaTo;
1096 OUString m_sControlName;
1097 OUString m_sFmlaLink;
1098 OUString m_aLabel;
1099 OUString m_aMacroName;
1100
1101public:
1102 VmlFormControlExporter(const sax_fastparser::FSHelperPtr& p, sal_uInt16 nObjType,
1103 const tools::Rectangle& rAreaFrom, const tools::Rectangle& rAreaTo,
1104 const OUString& sControlName, const OUString& sFmlaLink,
1105 OUString aLabel, OUString aMacroName);
1106
1107protected:
1109 sal_Int32 StartShape() override;
1110 using VMLExport::EndShape;
1111 void EndShape(sal_Int32 nShapeElement) override;
1112};
1113
1114VmlFormControlExporter::VmlFormControlExporter(const sax_fastparser::FSHelperPtr& p,
1115 sal_uInt16 nObjType,
1116 const tools::Rectangle& rAreaFrom,
1117 const tools::Rectangle& rAreaTo,
1118 const OUString& sControlName,
1119 const OUString& sFmlaLink,
1120 OUString aLabel, OUString aMacroName)
1121 : VMLExport(p)
1122 , m_nObjType(nObjType)
1123 , m_aAreaFrom(rAreaFrom)
1124 , m_aAreaTo(rAreaTo)
1125 , m_sControlName(sControlName)
1126 , m_sFmlaLink(sFmlaLink)
1127 , m_aLabel(std::move(aLabel))
1128 , m_aMacroName(std::move(aMacroName))
1129{
1130}
1131
1132sal_Int32 VmlFormControlExporter::StartShape()
1133{
1134 // Host control.
1135 AddShapeAttribute(XML_type, "#_x0000_t201");
1136 if (!m_sControlName.isEmpty())
1137 AddShapeAttribute(XML_id, m_sControlName.toUtf8());
1138
1139 return VMLExport::StartShape();
1140}
1141
1142void VmlFormControlExporter::EndShape(sal_Int32 nShapeElement)
1143{
1144 sax_fastparser::FSHelperPtr pVmlDrawing = GetFS();
1145
1146 pVmlDrawing->startElement(FSNS(XML_v, XML_textbox));
1147 pVmlDrawing->startElement(XML_div);
1148 pVmlDrawing->startElement(XML_font);
1149 pVmlDrawing->write(m_aLabel);
1150 pVmlDrawing->endElement(XML_font);
1151 pVmlDrawing->endElement(XML_div);
1152 pVmlDrawing->endElement(FSNS(XML_v, XML_textbox));
1153
1154 OString aObjectType;
1155 switch (m_nObjType)
1156 {
1158 aObjectType = "Checkbox";
1159 break;
1160 case EXC_OBJTYPE_BUTTON:
1161 aObjectType = "Button";
1162 break;
1163 }
1164 pVmlDrawing->startElement(FSNS(XML_x, XML_ClientData), XML_ObjectType, aObjectType);
1165 OString aAnchor
1166 = OString::number(m_aAreaFrom.Left()) + ", " + OString::number(m_aAreaFrom.Top()) + ", "
1167 + OString::number(m_aAreaFrom.Right()) + ", " + OString::number(m_aAreaFrom.Bottom()) + ", "
1168 + OString::number(m_aAreaTo.Left()) + ", " + OString::number(m_aAreaTo.Top()) + ", "
1169 + OString::number(m_aAreaTo.Right()) + ", " + OString::number(m_aAreaTo.Bottom());
1170 XclXmlUtils::WriteElement(pVmlDrawing, FSNS(XML_x, XML_Anchor), aAnchor);
1171
1172 if (!m_aMacroName.isEmpty())
1173 {
1174 XclXmlUtils::WriteElement(pVmlDrawing, FSNS(XML_x, XML_FmlaMacro), m_aMacroName);
1175 }
1176
1177 // XclExpOcxControlObj::WriteSubRecs() has the same fixed values.
1178 if (m_nObjType == EXC_OBJTYPE_BUTTON)
1179 {
1180 XclXmlUtils::WriteElement(pVmlDrawing, FSNS(XML_x, XML_TextHAlign), "Center");
1181 }
1182 XclXmlUtils::WriteElement(pVmlDrawing, FSNS(XML_x, XML_TextVAlign), "Center");
1183
1184 if (!m_sFmlaLink.isEmpty())
1185 XclXmlUtils::WriteElement(pVmlDrawing, FSNS(XML_x, XML_FmlaLink), m_sFmlaLink);
1186
1187 pVmlDrawing->endElement(FSNS(XML_x, XML_ClientData));
1188 VMLExport::EndShape(nShapeElement);
1189}
1190
1191}
1192
1195{
1197 tools::Rectangle aAreaFrom;
1198 tools::Rectangle aAreaTo;
1199 // Unlike XclExpTbxControlObj::SaveXml(), this is not calculated in EMUs.
1200 lcl_GetFromTo(mrRoot, pObj->GetLogicRect(), GetTab(), aAreaFrom, aAreaTo);
1201
1202 const OUString sCellLink
1206 : OUString();
1207
1208 VmlFormControlExporter aFormControlExporter(rStrm.GetCurrentStream(), GetObjType(), aAreaFrom,
1209 aAreaTo, msCtrlName, sCellLink, msLabel, GetMacroName());
1210 aFormControlExporter.SetSkipwzName(true); // use XML_id for legacyid, not XML_ID
1211 aFormControlExporter.OverrideShapeIDGen(true, "_x0000_s");
1212 aFormControlExporter.AddSdrObject(*pObj, /*bIsFollowingTextFlow=*/false, /*eHOri=*/-1,
1213 /*eVOri=*/-1, /*eHRel=*/-1, /*eVRel=*/-1,
1214 /*pWrapAttrList=*/nullptr, /*bOOxmlExport=*/true, mnShapeId);
1215}
1216
1217// save into xl\drawings\drawing1.xml
1219{
1220 sax_fastparser::FSHelperPtr& pDrawing = rStrm.GetCurrentStream();
1221
1222 pDrawing->startElement(FSNS(XML_mc, XML_AlternateContent),
1223 FSNS(XML_xmlns, XML_mc), rStrm.getNamespaceURL(OOX_NS(mce)));
1224 pDrawing->startElement(FSNS(XML_mc, XML_Choice),
1225 FSNS(XML_xmlns, XML_a14), rStrm.getNamespaceURL(OOX_NS(a14)),
1226 XML_Requires, "a14");
1227
1228 pDrawing->startElement(FSNS(XML_xdr, XML_twoCellAnchor), XML_editAs, "oneCell");
1229 {
1230 pDrawing->startElement(FSNS(XML_xdr, XML_from));
1231 lcl_WriteAnchorVertex(pDrawing, maAreaFrom);
1232 pDrawing->endElement(FSNS(XML_xdr, XML_from));
1233 pDrawing->startElement(FSNS(XML_xdr, XML_to));
1234 lcl_WriteAnchorVertex(pDrawing, maAreaTo);
1235 pDrawing->endElement(FSNS(XML_xdr, XML_to));
1236
1237 pDrawing->startElement(FSNS(XML_xdr, XML_sp));
1238 {
1239 // xdr:nvSpPr
1240 pDrawing->startElement(FSNS(XML_xdr, XML_nvSpPr));
1241 {
1242 pDrawing->singleElement(FSNS(XML_xdr, XML_cNvPr),
1243 XML_id, OString::number(mnShapeId).getStr(),
1244 XML_name, msCtrlName, // control name
1245 XML_descr, msLabel, // description as alt text
1246 XML_hidden, mbVisible ? "0" : "1");
1247 pDrawing->singleElement(FSNS(XML_xdr, XML_cNvSpPr));
1248 }
1249 pDrawing->endElement(FSNS(XML_xdr, XML_nvSpPr));
1250
1251 // xdr:spPr
1252 pDrawing->startElement(FSNS(XML_xdr, XML_spPr));
1253 {
1254 // a:xfrm
1255 pDrawing->startElement(FSNS(XML_a, XML_xfrm));
1256 {
1257 pDrawing->singleElement(FSNS(XML_a, XML_off),
1258 XML_x, "0",
1259 XML_y, "0");
1260 pDrawing->singleElement(FSNS(XML_a, XML_ext),
1261 XML_cx, "0",
1262 XML_cy, "0");
1263 }
1264 pDrawing->endElement(FSNS(XML_a, XML_xfrm));
1265
1266 // a:prstGeom
1267 pDrawing->startElement(FSNS(XML_a, XML_prstGeom), XML_prst, "rect");
1268 {
1269 pDrawing->singleElement(FSNS(XML_a, XML_avLst));
1270 }
1271 pDrawing->endElement(FSNS(XML_a, XML_prstGeom));
1272 }
1273 pDrawing->endElement(FSNS(XML_xdr, XML_spPr));
1274
1275 // xdr:txBody
1276 {
1277 pDrawing->startElement(FSNS(XML_xdr, XML_txBody));
1278
1279#define DEFLRINS 254
1280#define DEFTBINS 127
1281 sal_Int32 nLeft, nRight, nTop, nBottom;
1282 nLeft = nRight = DEFLRINS;
1283 nTop = nBottom = DEFTBINS;
1284
1285 // top inset looks a bit different compared to ppt export
1286 // check if something related doesn't work as expected
1287 Reference< XPropertySet > rXPropSet(mxShape, UNO_QUERY);
1288
1289 try
1290 {
1291 css::uno::Any mAny;
1292
1293 mAny = rXPropSet->getPropertyValue("TextLeftDistance");
1294 if (mAny.hasValue())
1295 mAny >>= nLeft;
1296
1297 mAny = rXPropSet->getPropertyValue("TextRightDistance");
1298 if (mAny.hasValue())
1299 mAny >>= nRight;
1300
1301 mAny = rXPropSet->getPropertyValue("TextUpperDistance");
1302 if (mAny.hasValue())
1303 mAny >>= nTop;
1304
1305 mAny = rXPropSet->getPropertyValue("TextLowerDistance");
1306 if (mAny.hasValue())
1307 mAny >>= nBottom;
1308 }
1309 catch (...)
1310 {
1311 }
1312
1313 // Specifies the inset of the bounding rectangle.
1314 // Insets are used just as internal margins for text boxes within shapes.
1315 // If this attribute is omitted, then a value of 45720 or 0.05 inches is implied.
1316 pDrawing->startElementNS(XML_a, XML_bodyPr,
1317 XML_lIns, sax_fastparser::UseIf(OString::number(oox::drawingml::convertHmmToEmu(nLeft)), nLeft != DEFLRINS),
1318 XML_rIns, sax_fastparser::UseIf(OString::number(oox::drawingml::convertHmmToEmu(nRight)), nRight != DEFLRINS),
1319 XML_tIns, sax_fastparser::UseIf(OString::number(oox::drawingml::convertHmmToEmu(nTop)), nTop != DEFTBINS),
1320 XML_bIns, sax_fastparser::UseIf(OString::number(oox::drawingml::convertHmmToEmu(nBottom)), nBottom != DEFTBINS),
1321 XML_anchor, "ctr");
1322
1323 {
1324 bool bTextAutoGrowHeight = false;
1325
1326 try
1327 {
1328 css::uno::Any mAny;
1329
1330 mAny = rXPropSet->getPropertyValue("TextAutoGrowHeight");
1331 if (mAny.hasValue())
1332 mAny >>= bTextAutoGrowHeight;
1333 }
1334 catch (...)
1335 {
1336 }
1337
1338 pDrawing->singleElementNS(XML_a, (bTextAutoGrowHeight ? XML_spAutoFit : XML_noAutofit));
1339 }
1340
1341 pDrawing->endElementNS(XML_a, XML_bodyPr);
1342
1343 {
1344 pDrawing->startElementNS(XML_a, XML_p);
1345 pDrawing->startElementNS(XML_a, XML_r);
1346 pDrawing->startElementNS(XML_a, XML_t);
1347 pDrawing->write(msLabel);
1348 pDrawing->endElementNS(XML_a, XML_t);
1349 pDrawing->endElementNS(XML_a, XML_r);
1350 pDrawing->endElementNS(XML_a, XML_p);
1351 }
1352
1353 pDrawing->endElement(FSNS(XML_xdr, XML_txBody));
1354 }
1355 }
1356 pDrawing->endElement(FSNS(XML_xdr, XML_sp));
1357 pDrawing->singleElement(FSNS(XML_xdr, XML_clientData));
1358 }
1359 pDrawing->endElement(FSNS(XML_xdr, XML_twoCellAnchor));
1360 pDrawing->endElement( FSNS( XML_mc, XML_Choice ) );
1361 pDrawing->endElement( FSNS( XML_mc, XML_AlternateContent ) );
1362}
1363
1364// output into ctrlProp1.xml
1366{
1367 OUString sIdFormControlPr;
1368
1369 switch (mnObjType)
1370 {
1372 {
1373 const sal_Int32 nDrawing = DrawingML::getNewDrawingUniqueId();
1374 sax_fastparser::FSHelperPtr pFormControl = rStrm.CreateOutputStream(
1375 XclXmlUtils::GetStreamName( "xl/", "ctrlProps/ctrlProps", nDrawing ),
1376 XclXmlUtils::GetStreamName( "../", "ctrlProps/ctrlProps", nDrawing ),
1377 rStrm.GetCurrentStream()->getOutputStream(),
1378 "application/vnd.ms-excel.controlproperties+xml",
1379 oox::getRelationship(Relationship::CTRLPROP),
1380 &sIdFormControlPr );
1381
1382 rStrm.PushStream( pFormControl );
1383 // checkbox
1384 // <formControlPr
1385 // xmlns="http://schemas.microsoft.com/office/spreadsheetml/2009/9/main"
1386 // objectType="CheckBox" checked="Checked" lockText="1" noThreeD="1"/>
1387 //
1388 pFormControl->write("<formControlPr xmlns=\"http://schemas.microsoft.com/office/spreadsheetml/2009/9/main\" objectType=\"CheckBox\"");
1390 pFormControl->write(" checked=\"Checked\"");
1391
1392 pFormControl->write(" autoLine=\"false\"");
1393
1394 if (mbPrint)
1395 pFormControl->write(" print=\"true\"");
1396 else
1397 pFormControl->write(" print=\"false\"");
1398
1400 {
1401 OUString aCellLink = mxCellLinkAddress.Format(ScRefFlags::ADDR_ABS,
1402 &GetDoc(),
1404
1405 // "Sheet1!$C$5"
1406 pFormControl->write(" fmlaLink=\"");
1407 if (aCellLink.indexOf('!') < 0)
1408 {
1409 pFormControl->write(GetTabInfo().GetScTabName(mxCellLinkAddress.Tab()));
1410 pFormControl->write("!");
1411 }
1412 pFormControl->write(aCellLink);
1413 pFormControl->write("\"");
1414 }
1415
1416 pFormControl->write(" lockText=\"1\" noThreeD=\"1\"/>");
1417 rStrm.PopStream();
1418
1419 break;
1420 }
1421 case EXC_OBJTYPE_BUTTON:
1422 {
1423 sal_Int32 nDrawing = DrawingML::getNewDrawingUniqueId();
1424 sax_fastparser::FSHelperPtr pFormControl = rStrm.CreateOutputStream(
1425 XclXmlUtils::GetStreamName("xl/", "ctrlProps/ctrlProps", nDrawing),
1426 XclXmlUtils::GetStreamName("../", "ctrlProps/ctrlProps", nDrawing),
1427 rStrm.GetCurrentStream()->getOutputStream(),
1428 "application/vnd.ms-excel.controlproperties+xml",
1429 oox::getRelationship(Relationship::CTRLPROP), &sIdFormControlPr);
1430
1431 pFormControl->singleElement(XML_formControlPr, XML_xmlns,
1432 rStrm.getNamespaceURL(OOX_NS(xls14Lst)), XML_objectType,
1433 "Button", XML_lockText, "1");
1434 break;
1435 }
1436 }
1437
1438 return sIdFormControlPr;
1439}
1440
1441// output into sheet1.xml
1442void XclExpTbxControlObj::SaveSheetXml(XclExpXmlStream& rStrm, const OUString& aIdFormControlPr) const
1443{
1444 switch (mnObjType)
1445 {
1447 {
1448 sax_fastparser::FSHelperPtr& rWorksheet = rStrm.GetCurrentStream();
1449
1450 rWorksheet->startElement(FSNS(XML_mc, XML_AlternateContent),
1451 FSNS(XML_xmlns, XML_mc), rStrm.getNamespaceURL(OOX_NS(mce)));
1452 rWorksheet->startElement(FSNS(XML_mc, XML_Choice), XML_Requires, "x14");
1453
1454 rWorksheet->startElement(
1455 XML_control,
1456 XML_shapeId, OString::number(mnShapeId).getStr(),
1457 FSNS(XML_r, XML_id), aIdFormControlPr,
1458 XML_name, msLabel); // text to display with checkbox button
1459
1460 rWorksheet->write("<controlPr defaultSize=\"0\" locked=\"1\" autoFill=\"0\" autoLine=\"0\" autoPict=\"0\"");
1461
1462 if (mbPrint)
1463 rWorksheet->write(" print=\"true\"");
1464 else
1465 rWorksheet->write(" print=\"false\"");
1466
1467 if (!msCtrlName.isEmpty())
1468 {
1469 rWorksheet->write(" altText=\"");
1470 rWorksheet->write(msCtrlName); // alt text
1471 rWorksheet->write("\"");
1472 }
1473
1474 rWorksheet->write(">");
1475
1476 rWorksheet->startElement(XML_anchor, XML_moveWithCells, "true", XML_sizeWithCells, "false");
1477 rWorksheet->startElement(XML_from);
1478 lcl_WriteAnchorVertex(rWorksheet, maAreaFrom);
1479 rWorksheet->endElement(XML_from);
1480 rWorksheet->startElement(XML_to);
1481 lcl_WriteAnchorVertex(rWorksheet, maAreaTo);
1482 rWorksheet->endElement(XML_to);
1483 rWorksheet->endElement( XML_anchor );
1484
1485 rWorksheet->write("</controlPr>");
1486
1487 rWorksheet->endElement(XML_control);
1488 rWorksheet->endElement( FSNS( XML_mc, XML_Choice ) );
1489 rWorksheet->endElement( FSNS( XML_mc, XML_AlternateContent ) );
1490
1491 break;
1492 }
1493 case EXC_OBJTYPE_BUTTON:
1494 {
1495 sax_fastparser::FSHelperPtr& rWorksheet = rStrm.GetCurrentStream();
1496
1497 rWorksheet->startElement(FSNS(XML_mc, XML_AlternateContent), FSNS(XML_xmlns, XML_mc),
1498 rStrm.getNamespaceURL(OOX_NS(mce)));
1499 rWorksheet->startElement(FSNS(XML_mc, XML_Choice), XML_Requires, "x14");
1500
1501 rWorksheet->startElement(XML_control, XML_shapeId, OString::number(mnShapeId).getStr(),
1502 FSNS(XML_r, XML_id), aIdFormControlPr, XML_name, msCtrlName);
1503
1504 OString aMacroName = GetMacroName().toUtf8();
1505 // Omit the macro attribute if it would be empty.
1506 const char* pMacroName = aMacroName.isEmpty() ? nullptr : aMacroName.getStr();
1507 rWorksheet->startElement(XML_controlPr, XML_defaultSize, "0", XML_print,
1508 mbPrint ? "true" : "false", XML_autoFill, "0", XML_autoPict,
1509 "0", XML_macro, pMacroName);
1510
1511 rWorksheet->startElement(XML_anchor, XML_moveWithCells, "true", XML_sizeWithCells,
1512 "false");
1513
1515 tools::Rectangle aAreaFrom;
1516 tools::Rectangle aAreaTo;
1517 lcl_GetFromTo(mrRoot, pObj->GetLogicRect(), GetTab(), aAreaFrom, aAreaTo,
1518 /*bInEMU=*/true);
1519
1520 rWorksheet->startElement(XML_from);
1521 lcl_WriteAnchorVertex(rWorksheet, aAreaFrom);
1522 rWorksheet->endElement(XML_from);
1523 rWorksheet->startElement(XML_to);
1524 lcl_WriteAnchorVertex(rWorksheet, aAreaTo);
1525 rWorksheet->endElement(XML_to);
1526 rWorksheet->endElement(XML_anchor);
1527
1528 rWorksheet->endElement(XML_controlPr);
1529
1530 rWorksheet->endElement(XML_control);
1531 rWorksheet->endElement(FSNS(XML_mc, XML_Choice));
1532 rWorksheet->endElement(FSNS(XML_mc, XML_AlternateContent));
1533 break;
1534 }
1535 }
1536}
1537
1538//#endif
1539
1540XclExpChartObj::XclExpChartObj( XclExpObjectManager& rObjMgr, Reference< XShape > const & xShape, const tools::Rectangle* pChildAnchor, ScDocument* pDoc ) :
1541 XclObj( rObjMgr, EXC_OBJTYPE_CHART ),
1542 XclExpRoot( rObjMgr.GetRoot() ), mxShape( xShape ),
1543 mpDoc(pDoc)
1544{
1545 // create the MSODRAWING record contents for the chart object
1547 mrEscherEx.AddShape( ESCHER_ShpInst_HostControl, ShapeFlag::HaveAnchor | ShapeFlag::HaveShapeProperty );
1548 EscherPropertyContainer aPropOpt;
1549 aPropOpt.AddOpt( ESCHER_Prop_LockAgainstGrouping, 0x01040104 );
1550 aPropOpt.AddOpt( ESCHER_Prop_FitTextToShape, 0x00080008 );
1551 aPropOpt.AddOpt( ESCHER_Prop_fillColor, 0x0800004E );
1552 aPropOpt.AddOpt( ESCHER_Prop_fillBackColor, 0x0800004D );
1553 aPropOpt.AddOpt( ESCHER_Prop_fNoFillHitTest, 0x00110010 );
1554 aPropOpt.AddOpt( ESCHER_Prop_lineColor, 0x0800004D );
1555 aPropOpt.AddOpt( ESCHER_Prop_fNoLineDrawDash, 0x00080008 );
1556 aPropOpt.AddOpt( ESCHER_Prop_fshadowObscured, 0x00020000 );
1557 aPropOpt.AddOpt( ESCHER_Prop_fPrint, 0x00080000 );
1558 aPropOpt.Commit( mrEscherEx.GetStream() );
1559
1560 // anchor
1561 SdrObject* pSdrObj = SdrObject::getSdrObjectFromXShape( xShape );
1562 ImplWriteAnchor( pSdrObj, pChildAnchor );
1563
1564 // client data (the following OBJ record)
1566 mrEscherEx.CloseContainer(); // ESCHER_SpContainer
1568
1569 // load the chart OLE object
1570 if( SdrOle2Obj* pSdrOleObj = dynamic_cast< SdrOle2Obj* >( pSdrObj ) )
1571 svt::EmbeddedObjectRef::TryRunningState( pSdrOleObj->GetObjRef() );
1572
1573 // create the chart substream object
1574 ScfPropertySet aShapeProp( xShape );
1575 css::awt::Rectangle aBoundRect;
1576 aShapeProp.GetProperty( aBoundRect, "BoundRect" );
1577 tools::Rectangle aChartRect( Point( aBoundRect.X, aBoundRect.Y ), Size( aBoundRect.Width, aBoundRect.Height ) );
1578 mxChart = std::make_shared<XclExpChart>(GetRoot(), GetChartDoc(), aChartRect);
1579}
1580
1582{
1583}
1584
1586{
1587 // content of OBJ record
1589 // chart substream
1590 mxChart->Save( rStrm );
1591}
1592
1594{
1595 sax_fastparser::FSHelperPtr pDrawing = rStrm.GetCurrentStream();
1596
1597 // FIXME: two cell? it seems the two cell anchor is incorrect.
1598 pDrawing->startElement( FSNS( XML_xdr, XML_twoCellAnchor ), // OOXTODO: oneCellAnchor, absoluteAnchor
1599 XML_editAs, "oneCell" );
1600 Reference< XPropertySet > xPropSet( mxShape, UNO_QUERY );
1601 if (xPropSet.is())
1602 {
1604 ChartExport aChartExport(XML_xdr, pDrawing, GetChartDoc(), &rStrm, drawingml::DOCUMENT_XLSX);
1605 auto pURLTransformer = std::make_shared<ScURLTransformer>(*mpDoc);
1606 aChartExport.SetURLTranslator(pURLTransformer);
1607 static sal_Int32 nChartCount = 0;
1608 nChartCount++;
1609 sal_Int32 nID = rStrm.GetUniqueId();
1610 aChartExport.WriteChartObj( mxShape, nID, nChartCount );
1611 // TODO: get the correcto chart number
1612 }
1613
1614 pDrawing->singleElement( FSNS( XML_xdr, XML_clientData)
1615 // OOXTODO: XML_fLocksWithSheet
1616 // OOXTODO: XML_fPrintsWithSheet
1617 );
1618 pDrawing->endElement( FSNS( XML_xdr, XML_twoCellAnchor ) );
1619}
1620
1621css::uno::Reference<css::chart::XChartDocument> XclExpChartObj::GetChartDoc() const
1622{
1624 if (!pObj || pObj->GetObjIdentifier() != SdrObjKind::OLE2)
1625 return {};
1626 // May load here - makes sure that we are working with actually loaded OLE object
1627 return css::uno::Reference<css::chart::XChartDocument>(
1628 static_cast<SdrOle2Obj*>(pObj)->getXModel(), css::uno::UNO_QUERY);
1629}
1630
1631XclExpNote::XclExpNote(const XclExpRoot& rRoot, const ScAddress& rScPos,
1632 const ScPostIt* pScNote, std::u16string_view rAddText)
1634 , mrRoot(rRoot)
1635 , maScPos(rScPos)
1636 , mnObjId(EXC_OBJ_INVALID_ID)
1637 , mbVisible(pScNote && pScNote->IsCaptionShown())
1638 , meTHA(SDRTEXTHORZADJUST_LEFT)
1639 , meTVA(SDRTEXTVERTADJUST_TOP)
1640 , mbAutoScale(false)
1641 , mbLocked(false)
1642 , mbAutoFill(false)
1643 , mbColHidden(false)
1644 , mbRowHidden(false)
1645{
1646 // get the main note text
1647 OUString aNoteText;
1648 if( pScNote )
1649 {
1650 aNoteText = pScNote->GetText();
1651 const EditTextObject *pEditObj = pScNote->GetEditTextObject();
1652 if( pEditObj )
1654 }
1655 // append additional text
1656 aNoteText = ScGlobal::addToken( aNoteText, rAddText, '\n', 2 );
1657
1658 // initialize record dependent on BIFF type
1659 switch( rRoot.GetBiff() )
1660 {
1661 case EXC_BIFF5:
1662 maNoteText = OUStringToOString(aNoteText, rRoot.GetTextEncoding());
1663 break;
1664
1665 case EXC_BIFF8:
1666 {
1667 // TODO: additional text
1668 if( pScNote )
1669 {
1670 if( SdrCaptionObj* pCaption = pScNote->GetOrCreateCaption( maScPos ) )
1671 {
1672 lcl_GetFromTo( rRoot, pCaption->GetLogicRect(), maScPos.Tab(), maCommentFrom, maCommentTo );
1673 if( const OutlinerParaObject* pOPO = pCaption->GetOutlinerParaObject() )
1674 mnObjId = rRoot.GetObjectManager().AddObj( std::make_unique<XclObjComment>( rRoot.GetObjectManager(), pCaption->GetLogicRect(), pOPO->GetTextObject(), pCaption, mbVisible, maScPos, maCommentFrom, maCommentTo ) );
1675
1676 SfxItemSet aItemSet = pCaption->GetMergedItemSet();
1677 meTVA = pCaption->GetTextVerticalAdjust();
1678 meTHA = pCaption->GetTextHorizontalAdjust();
1679 mbAutoScale = pCaption->GetFitToSize() != drawing::TextFitToSizeType_NONE;
1680 mbLocked = pCaption->IsMoveProtect() || pCaption->IsResizeProtect();
1681
1682 // AutoFill style would change if Postit.cxx object creation values are changed
1683 OUString aCol(aItemSet.Get(XATTR_FILLCOLOR).GetValue());
1684 mbAutoFill = aCol.isEmpty() && (aItemSet.Get(XATTR_FILLSTYLE).GetValue() == drawing::FillStyle_SOLID);
1687 }
1688 // stAuthor (variable): An XLUnicodeString that specifies the name of the comment
1689 // author. String length MUST be greater than or equal to 1 and less than or equal
1690 // to 54.
1691 if( pScNote->GetAuthor().isEmpty() )
1692 maAuthor = XclExpString( " " );
1693 else
1694 maAuthor = XclExpString( pScNote->GetAuthor(), XclStrFlags::NONE, 54 );
1695 }
1696
1697 SetRecSize( 9 + maAuthor.GetSize() );
1698 }
1699 break;
1700
1701 default: DBG_ERROR_BIFF();
1702 }
1703}
1704
1706{
1707 switch( rStrm.GetRoot().GetBiff() )
1708 {
1709 case EXC_BIFF5:
1710 {
1711 // write the NOTE record directly, there may be the need to create more than one
1712 const char* pcBuffer = maNoteText.getStr();
1713 sal_uInt16 nCharsLeft = static_cast< sal_uInt16 >( maNoteText.getLength() );
1714
1715 while( nCharsLeft )
1716 {
1717 sal_uInt16 nWriteChars = ::std::min( nCharsLeft, EXC_NOTE5_MAXLEN );
1718
1719 rStrm.StartRecord( EXC_ID_NOTE, 6 + nWriteChars );
1720 if( pcBuffer == maNoteText.getStr() )
1721 {
1722 // first record: row, col, length of complete text
1723 rStrm << static_cast< sal_uInt16 >( maScPos.Row() )
1724 << static_cast< sal_uInt16 >( maScPos.Col() )
1725 << nCharsLeft; // still contains full length
1726 }
1727 else
1728 {
1729 // next records: -1, 0, length of current text segment
1730 rStrm << sal_uInt16( 0xFFFF )
1731 << sal_uInt16( 0 )
1732 << nWriteChars;
1733 }
1734 rStrm.Write( pcBuffer, nWriteChars );
1735 rStrm.EndRecord();
1736
1737 pcBuffer += nWriteChars;
1738 nCharsLeft = nCharsLeft - nWriteChars;
1739 }
1740 }
1741 break;
1742
1743 case EXC_BIFF8:
1746 break;
1747
1748 default: DBG_ERROR_BIFF();
1749 }
1750}
1751
1753{
1754 // BIFF5/BIFF7 is written separately
1755 OSL_ENSURE_BIFF( rStrm.GetRoot().GetBiff() == EXC_BIFF8 );
1756
1757 sal_uInt16 nFlags = 0;
1759
1760 rStrm << static_cast< sal_uInt16 >( maScPos.Row() )
1761 << static_cast< sal_uInt16 >( maScPos.Col() )
1762 << nFlags
1763 << mnObjId
1764 << maAuthor
1765 << sal_uInt8( 0 );
1766}
1767
1768void XclExpNote::WriteXml( sal_Int32 nAuthorId, XclExpXmlStream& rStrm )
1769{
1770 sax_fastparser::FSHelperPtr rComments = rStrm.GetCurrentStream();
1771
1772 rComments->startElement( XML_comment,
1774 XML_authorId, OString::number(nAuthorId)
1775 // OOXTODO: XML_guid
1776 );
1777 rComments->startElement(XML_text);
1778 // OOXTODO: phoneticPr, rPh, r
1779 if( mpNoteContents )
1780 mpNoteContents->WriteXml( rStrm );
1781 rComments->endElement( XML_text );
1782
1783/*
1784 Export of commentPr is disabled, since the current (Oct 2010)
1785 version of MSO 2010 doesn't yet support commentPr
1786 */
1787#if 1//def XLSX_OOXML_FUTURE
1788 if( rStrm.getVersion() == oox::core::ISOIEC_29500_2008 )
1789 {
1790 rComments->startElement(FSNS(XML_mc, XML_AlternateContent));
1791 rComments->startElement(FSNS(XML_mc, XML_Choice), XML_Requires, "v2");
1792 rComments->startElement( XML_commentPr,
1793 XML_autoFill, ToPsz( mbAutoFill ),
1794 XML_autoScale, ToPsz( mbAutoScale ),
1795 XML_colHidden, ToPsz( mbColHidden ),
1796 XML_locked, ToPsz( mbLocked ),
1797 XML_rowHidden, ToPsz( mbRowHidden ),
1798 XML_textHAlign, ToHorizAlign( meTHA ),
1799 XML_textVAlign, ToVertAlign( meTVA ) );
1800 rComments->startElement(XML_anchor, XML_moveWithCells, "false", XML_sizeWithCells, "false");
1801 rComments->startElement(FSNS(XML_xdr, XML_from));
1802 lcl_WriteAnchorVertex( rComments, maCommentFrom );
1803 rComments->endElement( FSNS( XML_xdr, XML_from ) );
1804 rComments->startElement(FSNS(XML_xdr, XML_to));
1805 lcl_WriteAnchorVertex( rComments, maCommentTo );
1806 rComments->endElement( FSNS( XML_xdr, XML_to ) );
1807 rComments->endElement( XML_anchor );
1808 rComments->endElement( XML_commentPr );
1809
1810 rComments->endElement( FSNS( XML_mc, XML_Choice ) );
1811 rComments->startElement(FSNS(XML_mc, XML_Fallback));
1812 // Any fallback code ?
1813 rComments->endElement( FSNS( XML_mc, XML_Fallback ) );
1814 rComments->endElement( FSNS( XML_mc, XML_AlternateContent ) );
1815 }
1816#endif
1817 rComments->endElement( XML_comment );
1818}
1819
1821 XclExpControlHelper( rRoot )
1822{
1823}
1824
1826{
1827}
1828
1830{
1831 if( mxMacroLink )
1833}
1834
1835const OUString& XclMacroHelper::GetMacroName() const { return maMacroName; }
1836
1837bool
1838XclMacroHelper::SetMacroLink( const ScriptEventDescriptor& rEvent, const XclTbxEventType& nEventType )
1839{
1841 if (!maMacroName.isEmpty())
1842 {
1843 return SetMacroLink(maMacroName);
1844 }
1845 return false;
1846}
1847
1848bool
1849XclMacroHelper::SetMacroLink( const OUString& rMacroName )
1850{
1851 // OOXML documents do not store any defined name for VBA macros (while BIFF documents do).
1852 bool bOOXML = GetOutput() == EXC_OUTPUT_XML_2007;
1853 if (!rMacroName.isEmpty() && !bOOXML)
1854 {
1855 sal_uInt16 nExtSheet = GetLocalLinkManager().FindExtSheet( EXC_EXTSH_OWNDOC );
1856 sal_uInt16 nNameIdx
1857 = GetNameManager().InsertMacroCall(rMacroName, /*bVBasic=*/true, /*bFunc=*/false);
1858 mxMacroLink = GetFormulaCompiler().CreateNameXFormula( nExtSheet, nNameIdx );
1859 return true;
1860 }
1861 return false;
1862}
1863
1864XclExpShapeObj::XclExpShapeObj( XclExpObjectManager& rRoot, css::uno::Reference< css::drawing::XShape > const & xShape, ScDocument* pDoc ) :
1865 XclObjAny( rRoot, xShape, pDoc ),
1866 XclMacroHelper( rRoot )
1867{
1868 if (SdrObject* pSdrObj = SdrObject::getSdrObjectFromXShape(xShape))
1869 {
1870 ScMacroInfo* pInfo = ScDrawLayer::GetMacroInfo( pSdrObj );
1871 if ( pInfo && !pInfo->GetMacro().isEmpty() )
1872// FIXME ooo330-m2: XclControlHelper::GetXclMacroName was removed in upstream sources; they started to call XclTools::GetXclMacroName instead; is this enough? it has only one parameter
1873// SetMacroLink( XclControlHelper::GetXclMacroName( pInfo->GetMacro(), rRoot.GetDocShell() ) );
1875 }
1876}
1877
1879{
1880}
1881
1883{
1886}
1887
1889 : mnTab( nTab ), mrNotes( rNotes )
1890{
1891}
1892
1894{
1895 if( mrNotes.IsEmpty() )
1896 return;
1897
1898 sax_fastparser::FSHelperPtr rComments = rStrm.CreateOutputStream(
1899 XclXmlUtils::GetStreamName( "xl/", "comments", mnTab + 1 ),
1900 XclXmlUtils::GetStreamName( "../", "comments", mnTab + 1 ),
1901 rStrm.GetCurrentStream()->getOutputStream(),
1902 "application/vnd.openxmlformats-officedocument.spreadsheetml.comments+xml",
1903 oox::getRelationship(Relationship::COMMENTS));
1904 rStrm.PushStream( rComments );
1905
1906 if( rStrm.getVersion() == oox::core::ISOIEC_29500_2008 )
1907 rComments->startElement( XML_comments,
1908 XML_xmlns, rStrm.getNamespaceURL(OOX_NS(xls)),
1909 FSNS(XML_xmlns, XML_mc), rStrm.getNamespaceURL(OOX_NS(mce)),
1910 FSNS(XML_xmlns, XML_xdr), rStrm.getNamespaceURL(OOX_NS(dmlSpreadDr)),
1911 FSNS(XML_xmlns, XML_v2), rStrm.getNamespaceURL(OOX_NS(mceTest)),
1912 FSNS( XML_mc, XML_Ignorable ), "v2" );
1913 else
1914 rComments->startElement( XML_comments,
1915 XML_xmlns, rStrm.getNamespaceURL(OOX_NS(xls)),
1916 FSNS(XML_xmlns, XML_xdr), rStrm.getNamespaceURL(OOX_NS(dmlSpreadDr)) );
1917
1918 rComments->startElement(XML_authors);
1919
1920 typedef std::set<OUString> Authors;
1921 Authors aAuthors;
1922
1923 size_t nNotes = mrNotes.GetSize();
1924 for( size_t i = 0; i < nNotes; ++i )
1925 {
1926 aAuthors.insert( XclXmlUtils::ToOUString( mrNotes.GetRecord( i )->GetAuthor() ) );
1927 }
1928
1929 for( const auto& rAuthor : aAuthors )
1930 {
1931 rComments->startElement(XML_author);
1932 rComments->writeEscaped( rAuthor );
1933 rComments->endElement( XML_author );
1934 }
1935
1936 rComments->endElement( XML_authors );
1937 rComments->startElement(XML_commentList);
1938
1939 Authors::const_iterator aAuthorsBegin = aAuthors.begin();
1940 for( size_t i = 0; i < nNotes; ++i )
1941 {
1943 Authors::const_iterator aAuthor = aAuthors.find(
1944 XclXmlUtils::ToOUString( xNote->GetAuthor() ) );
1945 sal_Int32 nAuthorId = distance( aAuthorsBegin, aAuthor );
1946 xNote->WriteXml( nAuthorId, rStrm );
1947 }
1948
1949 rComments->endElement( XML_commentList );
1950 rComments->endElement( XML_comments );
1951
1952 rStrm.PopStream();
1953}
1954
1955// object manager =============================================================
1956
1958 XclExpRoot( rRoot )
1959{
1960 InitStream( true );
1961 mxEscherEx = std::make_shared<XclEscherEx>( GetRoot(), *this, *mpDffStrm );
1962}
1963
1965 XclExpRoot( rParent.GetRoot() )
1966{
1967 InitStream( false );
1968 mxEscherEx = std::make_shared<XclEscherEx>( GetRoot(), *this, *mpDffStrm, rParent.mxEscherEx.get() );
1969}
1970
1972{
1973}
1974
1976{
1977 return new XclExpDffSheetAnchor( GetRoot() );
1978}
1979
1981{
1982 return new XclExpMsoDrawingGroup( *mxEscherEx );
1983}
1984
1986{
1988}
1989
1991{
1992 if( pSdrPage )
1993 mxEscherEx->AddSdrPage( *pSdrPage, GetOutput() != EXC_OUTPUT_BINARY );
1994 // the first dummy object may still be open
1995 OSL_ENSURE( mxEscherEx->GetGroupLevel() <= 1, "XclExpObjectManager::ProcessDrawing - still groups open?" );
1996 while( mxEscherEx->GetGroupLevel() )
1997 mxEscherEx->LeaveGroup();
1998 mxObjList->EndSheet();
1999 return mxObjList;
2000}
2001
2002rtl::Reference< XclExpRecordBase > XclExpObjectManager::ProcessDrawing( const Reference< XShapes >& rxShapes )
2003{
2004 if( rxShapes.is() )
2005 mxEscherEx->AddUnoShapes( rxShapes, GetOutput() != EXC_OUTPUT_BINARY );
2006 // the first dummy object may still be open
2007 OSL_ENSURE( mxEscherEx->GetGroupLevel() <= 1, "XclExpObjectManager::ProcessDrawing - still groups open?" );
2008 while( mxEscherEx->GetGroupLevel() )
2009 mxEscherEx->LeaveGroup();
2010 mxObjList->EndSheet();
2011 return mxObjList;
2012}
2013
2015{
2016 mxEscherEx->EndDocument();
2017}
2018
2020{
2021 return mxObjList->GetMsodrawingPerSheet();
2022}
2023
2025{
2026 return !mxObjList->empty();
2027}
2028
2029sal_uInt16 XclExpObjectManager::AddObj( std::unique_ptr<XclObj> pObjRec )
2030{
2031 return mxObjList->Add( std::move(pObjRec) );
2032}
2033
2034std::unique_ptr<XclObj> XclExpObjectManager::RemoveLastObj()
2035{
2036 return mxObjList->pop_back();
2037}
2038
2040{
2041 if( bTempFile )
2042 {
2043 moTempFile.emplace();
2044 mpDffStrm = moTempFile->GetStream( StreamMode::STD_READWRITE );
2045 }
2046
2047 if( !mpDffStrm )
2048 {
2049 mpBackupStrm = std::make_unique<SvMemoryStream>();
2050 mpDffStrm = mpBackupStrm.get();
2051 }
2052
2053 mpDffStrm->SetEndian( SvStreamEndian::LITTLE );
2054}
2055
2057 const XclExpObjectManager& rParent, const Size& rPageSize, sal_Int32 nScaleX, sal_Int32 nScaleY ) :
2058 XclExpObjectManager( rParent ),
2059 maPageSize( rPageSize ),
2060 mnScaleX( nScaleX ),
2061 mnScaleY( nScaleY )
2062{
2063}
2064
2066{
2068}
2069
2070/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
sal_uInt8 * Scanline
const ::basegfx::B2DSize maPageSize
Bitmap GetBitmap(Color aTransparentReplaceColor) const
bool Convert(BmpConversion eConversion)
vcl::PixelFormat getPixelFormat() const
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)
virtual void OpenContainer(sal_uInt16 nEscherContainer, int nRecInstance=0)
sal_uInt64 GetStreamPos() const
SvStream & GetStream() const
EscherGraphicProvider & GetGraphicProvider()
SvStream * QueryPictureStream()
virtual void CloseContainer()
bool CreateGraphicProperties(const css::uno::Reference< css::drawing::XShape > &rXShape, const GraphicObject &rGraphicObj)
void AddOpt(sal_uInt16 nPropID, bool bBlib, sal_uInt32 nSizeReduction, SvMemoryStream &rStream)
bool GetOpt(sal_uInt16 nPropertyID, sal_uInt32 &rPropValue) const
void Commit(SvStream &rSt, sal_uInt16 nVersion=3, sal_uInt16 nRecType=ESCHER_OPT)
BitmapEx GetBitmapEx(const GraphicConversionParameters &rParameters=GraphicConversionParameters()) const
SCTAB Tab() const
Definition: address.hxx:283
SC_DLLPUBLIC void Format(OStringBuffer &r, ScRefFlags nFlags, const ScDocument *pDocument=nullptr, const Details &rDetails=detailsOOOa1) const
Definition: address.cxx:2074
bool IsValid() const
Definition: address.hxx:305
SCROW Row() const
Definition: address.hxx:274
void SetInvalid()
Definition: address.hxx:299
SCCOL Col() const
Definition: address.hxx:279
SC_DLLPUBLIC bool IsNegativePage(SCTAB nTab) const
Definition: document.cxx:1006
SC_DLLPUBLIC bool RowHidden(SCROW nRow, SCTAB nTab, SCROW *pFirstRow=nullptr, SCROW *pLastRow=nullptr) const
Definition: document.cxx:4493
SC_DLLPUBLIC bool ColHidden(SCCOL nCol, SCTAB nTab, SCCOL *pFirstCol=nullptr, SCCOL *pLastCol=nullptr) const
Definition: document.cxx:4509
SC_DLLPUBLIC tools::Rectangle GetMMRect(SCCOL nStartCol, SCROW nStartRow, SCCOL nEndCol, SCROW nEndRow, SCTAB nTab, bool bHiddenAsZero=true) const
Definition: documen3.cxx:2002
static ScMacroInfo * GetMacroInfo(SdrObject *pObj, bool bCreate=false)
Definition: drwlayer.cxx:2642
static ScAnchorType GetAnchorType(const SdrObject &)
Definition: drwlayer.cxx:2453
static SC_DLLPUBLIC OUString addToken(std::u16string_view rTokenList, std::u16string_view rToken, sal_Unicode cSep, sal_Int32 nSepCount=1, bool bForceSep=false)
Adds the string rToken to rTokenList, using a list separator character.
Definition: global.cxx:703
const OUString & GetMacro() const
Definition: userdat.hxx:82
Additional class containing cell annotation data.
Definition: postit.hxx:58
const OUString & GetAuthor() const
Returns the author date of this note.
Definition: postit.hxx:111
const EditTextObject * GetEditTextObject() const
Returns the pointer to the current edit text object, or null.
Definition: postit.cxx:545
SdrCaptionObj * GetOrCreateCaption(const ScAddress &rPos) const
Returns the caption object of this note.
Definition: postit.cxx:588
OUString GetText() const
Returns the caption text of this note.
Definition: postit.cxx:551
ScAddress aEnd
Definition: address.hxx:498
ScAddress aStart
Definition: address.hxx:497
static void FillScAddress(ScAddress &rScAddress, const css::table::CellAddress &rApiAddress)
Definition: convuno.hxx:63
static void FillScRange(ScRange &rScRange, const css::table::CellRangeAddress &rApiRange)
Definition: convuno.hxx:79
A wrapper for a UNO property set.
Definition: fapihelper.hxx:104
bool GetBoolProperty(const OUString &rPropName) const
Gets the specified Boolean property from the property set.
Definition: fapihelper.cxx:188
bool GetProperty(Type &rValue, const OUString &rPropName) const
Gets the specified property from the property set.
Definition: fapihelper.hxx:148
bool Is() const
Returns true, if the contained XPropertySet interface is valid.
Definition: fapihelper.hxx:128
static SdrObject * getSdrObjectFromXShape(const css::uno::Reference< css::uno::XInterface > &xInt)
virtual const tools::Rectangle & GetCurrentBoundRect() const
virtual SdrObjKind GetObjIdentifier() const
virtual const tools::Rectangle & GetLogicRect() const
const SfxPoolItem & Get(sal_uInt16 nWhich, bool bSrchInParent=true) const
void SetEndian(SvStreamEndian SvStreamEndian)
std::size_t WriteBytes(const void *pData, std::size_t nSize)
SvStream & WriteUInt16(sal_uInt16 nUInt16)
static OUString ExtractFromMacroDescriptor(const css::script::ScriptEventDescriptor &rDescriptor, XclTbxEventType eEventType)
Tries to extract an Excel macro name from the passed macro descriptor.
Definition: xlescher.cxx:324
static css::uno::Reference< css::awt::XControlModel > GetControlModel(css::uno::Reference< css::drawing::XShape > const &xShape)
Returns the API control model from the passed API shape object.
Definition: xlescher.cxx:282
sal_uInt32 GetDffFragmentPos(sal_uInt32 nFragmentKey)
Returns the position of the specified DFF stream fragment.
Definition: xcl97esc.cxx:130
sal_uInt32 GetDffFragmentSize(sal_uInt32 nFragmentKey)
Returns the size of the specified DFF stream fragment.
Definition: xcl97esc.cxx:137
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
bool ConvertAddress(XclAddress &rXclPos, const ScAddress &rScPos, bool bWarn)
Converts the passed Calc cell address to an Excel cell address.
Definition: xehelper.cxx:192
ScDocument * mpDoc
Definition: xeescher.hxx:331
css::uno::Reference< css::drawing::XShape > mxShape
The chart itself (BOF/EOF substream data).
Definition: xeescher.hxx:330
css::uno::Reference< css::chart::XChartDocument > GetChartDoc() const
Definition: xeescher.cxx:1621
virtual ~XclExpChartObj() override
Definition: xeescher.cxx:1581
virtual void Save(XclExpStream &rStrm) override
Writes the OBJ record and the entire chart substream.
Definition: xeescher.cxx:1585
XclExpChartObj(XclExpObjectManager &rObjMgr, css::uno::Reference< css::drawing::XShape > const &xShape, const tools::Rectangle *pChildAnchor, ScDocument *pDoc)
Definition: xeescher.cxx:1540
virtual void SaveXml(XclExpXmlStream &rStrm) override
Definition: xeescher.cxx:1593
XclExpChartRef mxChart
Definition: xeescher.hxx:329
XclExpComments(SCTAB nTab, XclExpRecordList< XclExpNote > &rNotes)
Definition: xeescher.cxx:1888
XclExpRecordList< XclExpNote > & mrNotes
Definition: xeescher.hxx:396
virtual void SaveXml(XclExpXmlStream &rStrm) override
Definition: xeescher.cxx:1893
Helper class for form controls to manage spreadsheet links .
Definition: xeescher.hxx:165
sal_uInt16 mnEntryCount
Formula for source data range.
Definition: xeescher.hxx:190
static void WriteFormulaSubRec(XclExpStream &rStrm, sal_uInt16 nSubRecId, const XclTokenArray &rTokArr)
Writes a formula subrecord with special style only valid in OBJ records.
Definition: xeescher.cxx:518
XclExpControlHelper(const XclExpRoot &rRoot)
Definition: xeescher.cxx:446
sal_uInt16 GetSourceEntryCount() const
Returns the number of entries in the source range, or 0, if no source set.
Definition: xeescher.hxx:180
XclTokenArrayRef mxCellLink
Definition: xeescher.hxx:188
virtual ~XclExpControlHelper() override
Definition: xeescher.cxx:452
const XclTokenArray * GetCellLinkTokArr() const
Returns the Excel token array of the cell link, or 0, if no link present.
Definition: xeescher.hxx:176
XclTokenArrayRef mxSrcRange
Formula for linked cell.
Definition: xeescher.hxx:189
const XclTokenArray * GetSourceRangeTokArr() const
Returns the Excel token array of the source range, or 0, if no link present.
Definition: xeescher.hxx:178
ScAddress mxCellLinkAddress
Number of entries in source range.
Definition: xeescher.hxx:192
static void WriteFormula(XclExpStream &rStrm, const XclTokenArray &rTokArr)
Writes a formula with special style only valid in OBJ records.
Definition: xeescher.cxx:509
void ConvertSheetLinks(css::uno::Reference< css::drawing::XShape > const &xShape)
Tries to get spreadsheet cell link and source range link from the passed shape.
Definition: xeescher.cxx:456
Base class for DFF client anchor atoms used in spreadsheets.
Definition: xeescher.hxx:43
virtual void WriteData(EscherEx &rEscherEx, const tools::Rectangle &rRect) override
Called from SVX DFF converter.
Definition: xeescher.cxx:266
XclExpDffAnchorBase(const XclExpRoot &rRoot, sal_uInt16 nFlags=0)
Constructs a dummy client anchor.
Definition: xeescher.cxx:242
void SetFlags(const SdrObject &rSdrObj)
Sets the flags according to the passed SdrObject.
Definition: xeescher.cxx:248
void SetSdrObject(const SdrObject &rSdrObj)
Sets the anchor position and flags according to the passed SdrObject.
Definition: xeescher.cxx:253
virtual void ImplSetFlags(const SdrObject &rSdrObj)
Definition: xeescher.cxx:273
void WriteDffData(EscherEx &rEscherEx) const
Writes the DFF client anchor structure with the current anchor position.
Definition: xeescher.cxx:259
XclObjAnchor maAnchor
Definition: xeescher.hxx:65
sal_uInt16 mnFlags
The client anchor data.
Definition: xeescher.hxx:66
virtual void ImplCalcAnchorRect(const tools::Rectangle &rRect, MapUnit eMapUnit)
Definition: xeescher.cxx:278
XclExpDffDropDownAnchor(const XclExpRoot &rRoot, const ScAddress &rScPos)
Definition: xeescher.cxx:328
Represents the position (anchor) of a shape in an embedded draw page.
Definition: xeescher.hxx:85
virtual void ImplCalcAnchorRect(const tools::Rectangle &rRect, MapUnit eMapUnit) override
Definition: xeescher.cxx:317
XclExpDffEmbeddedAnchor(const XclExpRoot &rRoot, const Size &rPageSize, sal_Int32 nScaleX, sal_Int32 nScaleY)
Definition: xeescher.cxx:303
virtual void ImplSetFlags(const SdrObject &rSdrObj) override
Definition: xeescher.cxx:312
XclExpDffNoteAnchor(const XclExpRoot &rRoot, const tools::Rectangle &rRect)
Definition: xeescher.cxx:322
Represents the position (anchor) of an object in a Calc sheet.
Definition: xeescher.hxx:71
virtual void ImplSetFlags(const SdrObject &rSdrObj) override
Definition: xeescher.cxx:289
virtual void ImplCalcAnchorRect(const tools::Rectangle &rRect, MapUnit eMapUnit) override
Definition: xeescher.cxx:298
XclExpDffSheetAnchor(const XclExpRoot &rRoot)
Definition: xeescher.cxx:283
virtual XclExpDffAnchorBase * CreateDffAnchor() const override
Creates a new DFF client anchor object for embedded objects according to the scaling data passed to t...
Definition: xeescher.cxx:2065
XclExpEmbeddedObjectManager(const XclExpObjectManager &rParent, const Size &rPageSize, sal_Int32 nScaleX, sal_Int32 nScaleY)
Definition: xeescher.cxx:2056
sal_uInt16 Insert(const XclFontData &rFontData, XclExpColorType eColorType, bool bAppFont=false)
Inserts a new font with the passed font data into the buffer if not present.
Definition: xestyle.cxx:1193
XclTokenArrayRef CreateNameXFormula(sal_uInt16 nExtSheet, sal_uInt16 nExtName)
Creates a single tNameXR token for a reference to an external name.
Definition: xeformula.cxx:2694
XclTokenArrayRef CreateFormula(XclFormulaType eType, const ScTokenArray &rScTokArr, const ScAddress *pScBasePos=nullptr, XclExpRefLog *pRefLog=nullptr)
Creates and returns the token array of a formula.
Definition: xeformula.cxx:2644
virtual void SaveXml(XclExpXmlStream &rStrm) override
Definition: xeescher.cxx:437
XclExpImgData(Graphic aGraphic, sal_uInt16 nRecId)
Definition: xeescher.cxx:388
virtual void Save(XclExpStream &rStrm) override
Writes the BITMAP record.
Definition: xeescher.cxx:394
sal_uInt16 mnRecId
The VCL graphic.
Definition: xeescher.hxx:160
Graphic maGraphic
Definition: xeescher.hxx:159
void FindExtSheet(sal_uInt16 &rnExtSheet, sal_uInt16 &rnXclTab, SCTAB nScTab, XclExpRefLogEntry *pRefLogEntry=nullptr)
Searches for an EXTERNSHEET index for the given Calc sheet.
Definition: xelink.cxx:2579
Base class for records holding DFF stream fragments.
Definition: xeescher.hxx:118
virtual void WriteBody(XclExpStream &rStrm) override
Writes the body of the record (without record header).
Definition: xeescher.cxx:346
XclEscherEx & mrEscherEx
Definition: xeescher.hxx:126
sal_uInt32 mnFragmentKey
Reference to the DFF converter containing the DFF stream.
Definition: xeescher.hxx:127
XclExpMsoDrawingBase(XclEscherEx &rEscherEx, sal_uInt16 nRecId)
Definition: xeescher.cxx:339
The MSODRAWINGGROUP record contains the DGGCONTAINER with global DFF data such as the picture contain...
Definition: xeescher.hxx:134
XclExpMsoDrawingGroup(XclEscherEx &rEscherEx)
Definition: xeescher.cxx:353
One or more MSODRAWING records contain the DFF stream data for a drawing shape.
Definition: xeescher.hxx:143
XclExpMsoDrawing(XclEscherEx &rEscherEx)
Definition: xeescher.cxx:383
sal_uInt16 InsertMacroCall(const OUString &rMacroName, bool bVBasic, bool bFunc, bool bHidden=false)
Searches or inserts a defined name describing a macro name.
Definition: xename.cxx:837
bool mbLocked
Auto scale text.
Definition: xeescher.hxx:379
SdrTextHorzAdjust meTHA
true = permanently visible.
Definition: xeescher.hxx:376
bool mbColHidden
Auto Fill Style.
Definition: xeescher.hxx:381
tools::Rectangle maCommentTo
From and From Offset.
Definition: xeescher.hxx:384
ScAddress maScPos
Text and formatting data (OOXML)
Definition: xeescher.hxx:373
XclExpString maAuthor
Definition: xeescher.hxx:370
XclExpStringRef mpNoteContents
Main text of the note (<=BIFF7).
Definition: xeescher.hxx:372
void WriteXml(sal_Int32 nAuthorId, XclExpXmlStream &rStrm)
Definition: xeescher.cxx:1768
const XclExpRoot & mrRoot
Definition: xeescher.hxx:369
bool mbAutoScale
text vertical adjust
Definition: xeescher.hxx:378
bool mbAutoFill
Position & Size locked.
Definition: xeescher.hxx:380
const XclExpString & GetAuthor() const
Definition: xeescher.hxx:363
OString maNoteText
Name of the author.
Definition: xeescher.hxx:371
virtual void WriteBody(XclExpStream &rStrm) override
Writes the body of the NOTE record.
Definition: xeescher.cxx:1752
sal_uInt16 mnObjId
Calc cell address of the note.
Definition: xeescher.hxx:374
SdrTextVertAdjust meTVA
text horizontal adjust
Definition: xeescher.hxx:377
XclExpNote(const XclExpRoot &rRoot, const ScAddress &rScPos, const ScPostIt *pScNote, std::u16string_view rAddText)
Constructs a NOTE record from the passed note object and/or the text.
Definition: xeescher.cxx:1631
bool mbVisible
Escher object ID (BIFF8).
Definition: xeescher.hxx:375
bool mbRowHidden
Column containing the comment is hidden.
Definition: xeescher.hxx:382
tools::Rectangle maCommentFrom
Row containing the comment is hidden.
Definition: xeescher.hxx:383
virtual void Save(XclExpStream &rStrm) override
Writes the NOTE record, if the respective Escher object is present.
Definition: xeescher.cxx:1705
std::unique_ptr< SvMemoryStream > mpBackupStrm
Definition: xeescher.hxx:443
XclExpObjectManager(const XclExpRoot &rRoot)
Definition: xeescher.cxx:1957
rtl::Reference< XclExpRecordBase > CreateDrawingGroup()
Creates and returns the MSODRAWINGGROUP record containing global DFF data in the DGGCONTAINER.
Definition: xeescher.cxx:1980
bool HasObj() const
Definition: xeescher.cxx:2024
virtual XclExpDffAnchorBase * CreateDffAnchor() const
Creates a new DFF client anchor object.
Definition: xeescher.cxx:1975
void StartSheet()
Initializes the object manager for a new sheet.
Definition: xeescher.cxx:1985
rtl::Reference< XclExpRecordBase > ProcessDrawing(const SdrPage *pSdrPage)
Processes a drawing page and returns the record block containing all related records (MSODRAWING,...
Definition: xeescher.cxx:1990
void EndDocument()
Finalizes the object manager after conversion of all sheets.
Definition: xeescher.cxx:2014
std::optional< ::utl::TempFileFast > moTempFile
Definition: xeescher.hxx:441
XclExpMsoDrawing * GetMsodrawingPerSheet()
Definition: xeescher.cxx:2019
sal_uInt16 AddObj(std::unique_ptr< XclObj > pObjRec)
Definition: xeescher.cxx:2029
virtual ~XclExpObjectManager() override
Definition: xeescher.cxx:1971
void InitStream(bool bTempFile)
Definition: xeescher.cxx:2039
SvStream * mpDffStrm
Definition: xeescher.hxx:442
rtl::Reference< XclExpObjList > mxObjList
Definition: xeescher.hxx:445
std::unique_ptr< XclObj > RemoveLastObj()
Definition: xeescher.cxx:2034
std::shared_ptr< XclEscherEx > mxEscherEx
Definition: xeescher.hxx:444
XclExpOcxControlObj(XclExpObjectManager &rObjMgr, css::uno::Reference< css::drawing::XShape > const &xShape, const tools::Rectangle *pChildAnchor, OUString aClassName, sal_uInt32 nStrmStart, sal_uInt32 nStrmSize)
Definition: xeescher.cxx:528
OUString maClassName
Definition: xeescher.hxx:242
sal_uInt32 mnStrmStart
Class name of the control.
Definition: xeescher.hxx:243
sal_uInt32 mnStrmSize
Start position in 'Ctls' stream.
Definition: xeescher.hxx:244
virtual void WriteSubRecs(XclExpStream &rStrm) override
Definition: xeescher.cxx:583
size_t GetSize() const
Definition: xerecord.hxx:327
bool IsEmpty() const
Definition: xerecord.hxx:326
RecType * GetRecord(size_t nPos) const
Returns reference to an existing record or empty reference on error.
Definition: xerecord.hxx:333
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 SetRecSize(std::size_t nRecSize)
Sets a new record size prediction.
Definition: xerecord.hxx:163
Access to global data from other classes.
Definition: xeroot.hxx:113
XclExpFontBuffer & GetFontBuffer() const
Returns the font buffer.
Definition: xeroot.cxx:112
XclExpNameManager & GetNameManager() const
Returns the buffer that contains internal defined names.
Definition: xeroot.cxx:142
XclExpFormulaCompiler & GetFormulaCompiler() const
Returns the formula compiler to produce formula token arrays.
Definition: xeroot.cxx:88
XclExpObjectManager & GetObjectManager() const
Returns the drawing object manager.
Definition: xeroot.cxx:148
XclExpAddressConverter & GetAddressConverter() const
Returns the address converter.
Definition: xeroot.cxx:82
XclExpLinkManager & GetLocalLinkManager() const
Returns the local link manager for the current sheet.
Definition: xeroot.cxx:136
XclExpTabInfo & GetTabInfo() const
Returns the buffer for Calc->Excel sheet index conversion.
Definition: xeroot.cxx:76
const XclExpRoot & GetRoot() const
Returns this root instance - for code readability in derived classes.
Definition: xeroot.hxx:118
virtual ~XclExpShapeObj() override
Definition: xeescher.cxx:1878
XclExpShapeObj(XclExpObjectManager &rRoot, css::uno::Reference< css::drawing::XShape > const &xShape, ScDocument *pDoc)
Definition: xeescher.cxx:1864
virtual void WriteSubRecs(XclExpStream &rStrm) override
Definition: xeescher.cxx:1882
This class is used to export Excel record streams.
Definition: xestream.hxx:73
static XclExpStringRef CreateString(const XclExpRoot &rRoot, const OUString &rString, XclStrFlags nFlags=XclStrFlags::NONE, sal_uInt16 nMaxLen=EXC_STR_MAXLEN)
Creates a new unformatted string from the passed string.
Definition: xehelper.cxx:531
This class stores an unformatted or formatted string for Excel export.
Definition: xestring.hxx:48
std::size_t GetSize() const
Returns the byte count the whole string will take on export.
Definition: xestring.cxx:249
const css::uno::Reference< css::drawing::XShape > mxShape
Definition: xeescher.hxx:280
sal_Int16 mnSelEntry
Combobox dropdown line count.
Definition: xeescher.hxx:286
XclExpTbxControlObj(XclExpObjectManager &rObjMgr, css::uno::Reference< css::drawing::XShape > const &xShape, const tools::Rectangle *pChildAnchor)
Definition: xeescher.cxx:634
sal_Int32 mnShapeId
Definition: xeescher.hxx:300
tools::Rectangle maAreaTo
Definition: xeescher.hxx:302
bool mbFlatButton
Scrollbar: Page step.
Definition: xeescher.hxx:292
sal_uInt16 mnScrollStep
Scrollbar: Maximum value.
Definition: xeescher.hxx:290
sal_uInt16 mnScrollValue
Selected entry in combobox (1-based).
Definition: xeescher.hxx:287
void SaveVml(XclExpXmlStream &rStrm)
Save into xl/drawings/vmlDrawing1.vml.
Definition: xeescher.cxx:1194
bool mbScrollHor
true = Multi selection in listbox.
Definition: xeescher.hxx:295
OUString SaveControlPropertiesXml(XclExpXmlStream &rStrm) const
Definition: xeescher.cxx:1365
void setShapeId(sal_Int32 aShapeId)
Definition: xeescher.cxx:1083
bool mbPrint
Scrollbar: true = horizontal.
Definition: xeescher.hxx:296
bool mbMultiSel
False = 3D border style; True = Flat border style.
Definition: xeescher.hxx:294
sal_uInt16 mnScrollMax
Scrollbar: Minimum value.
Definition: xeescher.hxx:289
XclTbxEventType meEventType
Indexes of all selected entries in a multi selection.
Definition: xeescher.hxx:282
void WriteSbs(XclExpStream &rStrm)
Writes the ftSbs sub structure containing scrollbar data.
Definition: xeescher.cxx:1063
sal_uInt16 mnState
Height of the control.
Definition: xeescher.hxx:284
virtual void SaveXml(XclExpXmlStream &rStrm) override
Definition: xeescher.cxx:1218
sal_Int16 mnLineCount
Checked/unchecked state.
Definition: xeescher.hxx:285
sal_Int32 mnHeight
Type of supported macro event.
Definition: xeescher.hxx:283
sal_uInt16 mnScrollPage
Scrollbar: Single step.
Definition: xeescher.hxx:291
tools::Rectangle maAreaFrom
Definition: xeescher.hxx:301
bool SetMacroLink(const css::script::ScriptEventDescriptor &rEvent)
Sets the name of a macro attached to this control.
Definition: xeescher.cxx:916
sal_uInt16 mnScrollMin
Scrollbar: Current value.
Definition: xeescher.hxx:288
XclExpObjectManager & mrRoot
Definition: xeescher.hxx:303
virtual void WriteSubRecs(XclExpStream &rStrm) override
Definition: xeescher.cxx:921
void SaveSheetXml(XclExpXmlStream &rStrm, const OUString &aIdFormControlPr) const
Definition: xeescher.cxx:1442
void WriteCellLinkSubRec(XclExpStream &rStrm, sal_uInt16 nSubRecId)
Writes a subrecord containing a cell link, or nothing, if no link present.
Definition: xeescher.cxx:1057
ScfInt16Vec maMultiSel
Definition: xeescher.hxx:281
bool mbFlatBorder
False = 3D button style; True = Flat button style.
Definition: xeescher.hxx:293
void ReadFontProperties(XclFontData &rFontData, const ScfPropertySet &rPropSet, XclFontPropSetType eType, sal_Int16 nScript=-1)
Reads all font properties from the passed property set.
Definition: xlstyle.cxx:623
XclMacroHelper(const XclExpRoot &rRoot)
Definition: xeescher.cxx:1820
virtual ~XclMacroHelper() override
Definition: xeescher.cxx:1825
const OUString & GetMacroName() const
Definition: xeescher.cxx:1835
bool SetMacroLink(const css::script::ScriptEventDescriptor &rEvent, const XclTbxEventType &nEventType)
Sets the name of a macro for object of passed type.
void WriteMacroSubRec(XclExpStream &rStrm)
Writes an ftMacro subrecord containing a macro link, or nothing, if no macro present.
Definition: xeescher.cxx:1829
XclTokenArrayRef mxMacroLink
Definition: xeescher.hxx:197
OUString maMacroName
Token array containing a link to an attached macro.
Definition: xeescher.hxx:198
static void WriteFromTo(XclExpXmlStream &rStrm, const XclObjAny &rObj)
Definition: xcl97rec.cxx:1184
virtual void WriteSubRecs(XclExpStream &rStrm) override
Definition: xcl97rec.cxx:1094
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
void ImplWriteAnchor(const SdrObject *pSdrObj, const tools::Rectangle *pChildAnchor)
Definition: xcl97rec.cxx:430
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
std::unique_ptr< XclTxo > pTxo
Definition: xcl97rec.hxx:102
void SetLocked(bool b)
Definition: xcl97rec.hxx:132
void SetAutoFill(bool b)
Definition: xcl97rec.hxx:134
XclOutput GetOutput() const
Returns the current output format of the importer/exporter.
Definition: xlroot.hxx:143
rtl_TextEncoding GetTextEncoding() const
Returns the text encoding to import/export byte strings.
Definition: xlroot.hxx:147
SCTAB GetCurrScTab() const
Returns the current Calc sheet index.
Definition: xlroot.hxx:162
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:286
XclFontPropSetHelper & GetFontPropSetHelper() const
Returns the property set helper for fonts.
Definition: xlroot.cxx:419
Binary representation of an Excel token array.
Definition: xlformula.hxx:377
sal_uInt16 GetSize() const
Returns the size of the token array in bytes.
Definition: xlformula.cxx:735
void WriteArray(XclExpStream &rStrm) const
Writes the tokens of the token array (without size field).
Definition: xlformula.cxx:781
static sal_Int32 GetHmmFromTwips(sal_Int32 nTwips)
Returns the length in 1/100 mm calculated from a length in twips.
Definition: xltools.cxx:302
static OUString GetXclMacroName(const OUString &rSbMacroUrl)
Returns the Excel macro name from a full StarBasic macro URL.
Definition: xltools.cxx:714
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 ToOUString(const char *s)
Definition: xestream.cxx:788
static OUString GetStreamName(const char *sStreamDir, const char *sStream, sal_Int32 nId)
Definition: xestream.cxx:697
virtual void EndShape(sal_Int32 nShapeElement)
virtual sal_Int32 StartShape()
static bool TryRunningState(const css::uno::Reference< css::embed::XEmbeddedObject > &)
constexpr tools::Long Top() const
constexpr tools::Long Right() const
constexpr tools::Long Left() const
constexpr tools::Long Bottom() const
#define ESCHER_Prop_lineColor
#define ESCHER_Prop_pib
#define ESCHER_SplitMenuColors
#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_wzName
#define ESCHER_OPT
#define ESCHER_Prop_WrapText
#define ESCHER_ClientAnchor
#define ESCHER_Prop_fillBackColor
#define ESCHER_Prop_pictureId
#define ESCHER_Prop_fPrint
#define ESCHER_Prop_lTxid
#define ESCHER_SpContainer
#define ESCHER_ClientTextbox
#define ESCHER_DggContainer
#define ESCHER_Prop_fillColor
#define ESCHER_Prop_wzDescription
FuncFlags mnFlags
Information about all parameters.
constexpr sal_Int32 FSNS(sal_Int32 namespc, sal_Int32 element)
::std::vector< sal_uInt8 > ScfUInt8Vec
Definition: ftools.hxx:253
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
Definition: global.hxx:374
const Graphic maGraphic
double distance
sal_Int32 nIndex
void * p
Environment aTo
Environment aFrom
MapUnit
#define MSPROP_DESCRIPTION_MAX_LEN
sal_Int32 findValue(const css::uno::Sequence< T1 > &_rList, const T2 &_rValue)
DstType sequenceToContainer(const css::uno::Sequence< SrcType > &i_Sequence)
css::uno::Reference< css::frame::XModel > getXModel(const css::uno::Reference< css::uno::XInterface > &_rxComponent)
int i
void SvStream & rStrm
constexpr Point convert(const Point &rPoint, o3tl::Length eFrom, o3tl::Length eTo)
sal_Int64 convertHmmToEmu(sal_Int32 nValue)
OUString getRelationship(Relationship eRelationship)
OString OUStringToOString(std::u16string_view str, ConnectionSettings const *settings)
const char * UseIf(const char *s, bool bUse)
std::shared_ptr< FastSerializerHelper > FSHelperPtr
long Long
SdrTextVertAdjust
SDRTEXTVERTADJUST_BOTTOM
SDRTEXTVERTADJUST_BLOCK
SDRTEXTVERTADJUST_CENTER
SDRTEXTVERTADJUST_TOP
SdrTextHorzAdjust
SDRTEXTHORZADJUST_LEFT
SDRTEXTHORZADJUST_BLOCK
SDRTEXTHORZADJUST_CENTER
SDRTEXTHORZADJUST_RIGHT
uno::Reference< drawing::XShape > const mxShape
double mnHeight
sal_uInt16 mnCol
Definition: xladdress.hxx:31
sal_uInt32 mnRow
Definition: xladdress.hxx:32
This struct helps reading and writing Excel fonts.
Definition: xlstyle.hxx:284
sal_uInt16 mnHeight
Font color.
Definition: xlstyle.hxx:288
OUString maName
Definition: xlstyle.hxx:285
sal_uInt32 mnTY
X offset in left column (1/1024 of column width).
Definition: xlescher.hxx:286
sal_uInt32 mnBY
X offset in right column (1/1024 of column width).
Definition: xlescher.hxx:288
sal_uInt16 mnRX
Y offset in top row (1/256 of row height).
Definition: xlescher.hxx:287
void SetRect(const XclRoot &rRoot, SCTAB nScTab, const tools::Rectangle &rRect, MapUnit eMapUnit)
Initializes the anchor coordinates for a sheet.
Definition: xlescher.cxx:154
sal_uInt16 mnLX
Definition: xlescher.hxx:285
XclAddress maFirst
Definition: xladdress.hxx:60
XclAddress maLast
Definition: xladdress.hxx:61
bool mbVisible
unsigned char sal_uInt8
sal_Int16 SCTAB
Definition: types.hxx:22
OUString aLabel
constexpr OUStringLiteral SC_UNONAME_BOUNDCELL
Definition: unonames.hxx:659
constexpr OUStringLiteral SC_SERVICENAME_VALBIND
Definition: unonames.hxx:25
constexpr OUStringLiteral SC_SERVICENAME_LISTSOURCE
Definition: unonames.hxx:27
constexpr OUStringLiteral SC_UNONAME_CELLRANGE
Definition: unonames.hxx:661
const std::u16string_view aStringList[]
Definition: vbadialog.cxx:31
constexpr TypedWhichId< XFillColorItem > XATTR_FILLCOLOR(XATTR_FILL_FIRST+1)
constexpr TypedWhichId< XFillStyleItem > XATTR_FILLSTYLE(XATTR_FILL_FIRST)
#define DEFLRINS
#define DEFTBINS
@ EXC_COLOR_CTRLTEXT
Area in a chart.
Definition: xestyle.hxx:54
@ EXC_BIFF5
MS Excel 4.0.
Definition: xlconst.hxx:34
@ EXC_BIFF8
MS Excel 5.0, MS Excel 7.0 (95)
Definition: xlconst.hxx:35
@ EXC_OUTPUT_BINARY
Definition: xlconst.hxx:42
@ EXC_OUTPUT_XML_2007
MS Excel binary .xls.
Definition: xlconst.hxx:43
const sal_uInt16 EXC_ID_OBJPICTFMLA
Option flags.
Definition: xlescher.hxx:212
SvStream & WriteXclObjAnchor(SvStream &rStrm, const XclObjAnchor &rAnchor)
Definition: xlescher.hxx:341
const sal_uInt8 EXC_OBJ_VER_CENTER
Definition: xlescher.hxx:128
const sal_uInt16 EXC_OBJ_CHECKBOX_FLAT
Definition: xlescher.hxx:169
const sal_uInt16 EXC_ESC_ANCHOR_LOCKED
Definition: xlescher.hxx:268
const sal_uInt16 EXC_OBJTYPE_CHART
Definition: xlescher.hxx:54
const sal_uInt16 EXC_OBJ_CHECKBOX_CHECKED
Definition: xlescher.hxx:167
const sal_uInt16 EXC_OBJ_CHECKBOX_TRISTATE
Definition: xlescher.hxx:168
const sal_uInt16 EXC_IMGDATA_BMP
Definition: xlescher.hxx:245
const sal_uInt16 EXC_OBJ_CHECKBOX_UNCHECKED
Definition: xlescher.hxx:166
const sal_uInt16 EXC_OBJTYPE_UNKNOWN
Definition: xlescher.hxx:71
const sal_uInt16 EXC_ID_OBJCBLSFMLA
List box/combo box data.
Definition: xlescher.hxx:223
const sal_uInt16 EXC_OBJ_GROUPBOX_FLAT
Dropdown style: filtered.
Definition: xlescher.hxx:203
const sal_uInt16 EXC_ID_OBJGBODATA
Scroll bar/list box/combo box cell link.
Definition: xlescher.hxx:218
const sal_uInt16 EXC_OBJTYPE_GROUPBOX
Definition: xlescher.hxx:67
const sal_uInt16 EXC_IMGDATA_WIN
Definition: xlescher.hxx:247
const sal_uInt16 EXC_OBJ_SCROLLBAR_DEFFLAGS
Definition: xlescher.hxx:184
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_OBJTYPE_OPTIONBUTTON
Definition: xlescher.hxx:60
const sal_uInt16 EXC_OBJTYPE_BUTTON
Definition: xlescher.hxx:56
const sal_uInt16 EXC_ID_OBJCBLS
OLE link formula.
Definition: xlescher.hxx:213
const sal_uInt8 EXC_OBJ_HOR_CENTER
Definition: xlescher.hxx:123
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_OBJ_SCROLLBAR_FLAT
Definition: xlescher.hxx:185
XclTbxEventType
Definition: xlescher.hxx:406
@ EXC_TBX_EVENT_VALUE
XTextListener.textChanged.
Definition: xlescher.hxx:410
@ EXC_TBX_EVENT_MOUSE
XActionListener.actionPerformed.
Definition: xlescher.hxx:408
@ EXC_TBX_EVENT_CHANGE
XAdjustmentListener.adjustmentValueChanged.
Definition: xlescher.hxx:411
@ EXC_TBX_EVENT_ACTION
Definition: xlescher.hxx:407
const sal_uInt16 EXC_ID_OBJSBSFMLA
Note data.
Definition: xlescher.hxx:217
const sal_uInt8 EXC_OBJ_LISTBOX_SINGLE
Definition: xlescher.hxx:188
const sal_uInt16 EXC_OBJ_SCROLLBAR_MIN
Definition: xlescher.hxx:179
const sal_uInt16 EXC_NOTE5_MAXLEN
Definition: xlescher.hxx:40
const sal_uInt8 EXC_OBJ_LISTBOX_MULTI
Single selection.
Definition: xlescher.hxx:189
const sal_uInt16 EXC_OBJ_SCROLLBAR_MAX
Definition: xlescher.hxx:180
const sal_uInt16 EXC_ID_MSODRAWING
Definition: xlescher.hxx:263
const sal_uInt16 EXC_OBJTYPE_LABEL
Definition: xlescher.hxx:62
const sal_uInt16 EXC_ID_OBJLBSDATA
Check box/radio button data.
Definition: xlescher.hxx:222
const sal_uInt16 EXC_ID_OBJMACRO
End of OBJ.
Definition: xlescher.hxx:207
const sal_uInt16 EXC_OBJTYPE_SCROLLBAR
Definition: xlescher.hxx:65
const sal_uInt16 EXC_ID_OBJCF
Group marker.
Definition: xlescher.hxx:210
const sal_uInt16 EXC_OBJ_SCROLLBAR_HOR
Definition: xlescher.hxx:182
const sal_uInt16 EXC_OBJTYPE_CHECKBOX
Definition: xlescher.hxx:59
const sal_uInt16 EXC_ID_NOTE
Definition: xlescher.hxx:38
const sal_uInt16 EXC_ESC_ANCHOR_SIZELOCKED
Definition: xlescher.hxx:267
const sal_uInt16 EXC_ID_MSODRAWINGGROUP
Definition: xlescher.hxx:259
const sal_uInt16 EXC_ESC_ANCHOR_POSLOCKED
Definition: xlescher.hxx:266
const sal_uInt16 EXC_OBJTYPE_SPIN
Definition: xlescher.hxx:64
const sal_uInt16 EXC_OBJ_INVALID_ID
Definition: xlescher.hxx:46
const sal_uInt16 EXC_OBJ_LISTBOX_FLAT
Definition: xlescher.hxx:193
const sal_uInt16 EXC_NOTE_VISIBLE
Definition: xlescher.hxx:39
const sal_uInt16 EXC_OBJTYPE_PICTURE
Definition: xlescher.hxx:57
const sal_uInt16 EXC_OBJTYPE_LISTBOX
Definition: xlescher.hxx:66
@ EXC_FMLATYPE_CONTROL
Chart source ranges.
Definition: xlformula.hxx:168
const sal_uInt16 EXC_FONT_APP
Definition: xlstyle.hxx:76
@ EXC_FONTPROPSET_CONTROL
All text objects in charts.
Definition: xlstyle.hxx:396
#define OSL_ENSURE_BIFF(c)
Definition: xltools.hxx:34
#define DBG_ERROR_BIFF()
Definition: xltools.hxx:33