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