32#include <rtl/math.hxx>
55#include <document.hxx>
60#include <com/sun/star/embed/Aspects.hpp>
61#include <com/sun/star/chart/XChartDocument.hpp>
62#include <com/sun/star/chart2/XCoordinateSystemContainer.hpp>
63#include <com/sun/star/chart2/XChartTypeContainer.hpp>
64#include <com/sun/star/chart2/XChartDocument.hpp>
67#include <oox/token/tokens.hxx>
68#include <oox/token/namespaces.hxx>
78using ::com::sun::star::uno::Reference;
79using ::com::sun::star::uno::UNO_QUERY;
80using ::com::sun::star::beans::XPropertySet;
81using ::com::sun::star::drawing::XShape;
82using ::oox::drawingml::ShapeExport;
83using ::oox::vml::VMLExport;
88 mnScTab( rRoot.GetCurrScTab() ),
89 mrEscherEx( rEscherEx )
108 OSL_ENSURE(
maObjs.size() < 0xFFFF,
"XclExpObjList::Add: too much for Xcl" );
110 size_t nSize =
maObjs.size();
112 if ( nSize < 0xFFFF )
114 pObj->SetId( nSize+1 );
116 maObjs.push_back(std::move(pObj));
129 auto ret = std::move(
maObjs.back());
149 for (
const auto& rxObj :
maObjs )
150 rxObj->Save(
rStrm );
158bool IsFormControlObject(
const XclObj *rObj )
170bool IsVmlObject(
const XclObj *rObj )
183 return static_cast<sal_Int32
>(std::count_if(rList.
begin(), rList.
end(),
184 [](
const std::unique_ptr<XclObj>& rxObj) { return IsVmlObject( rxObj.get() ) || IsFormControlObject( rxObj.get() ); }));
187bool IsValidObject(
const XclObj& rObj )
196 uno::Reference<chart2::XChartDocument> xChartDoc(rChartObj.
GetChartDoc(), uno::UNO_QUERY);
200 uno::Reference<chart2::XDiagram> xDiagram = xChartDoc->getFirstDiagram();
204 uno::Reference<chart2::XCoordinateSystemContainer> xCooSysContainer(xDiagram, uno::UNO_QUERY);
205 if (!xCooSysContainer.is())
208 const uno::Sequence<uno::Reference<chart2::XCoordinateSystem>> xCooSysSeq = xCooSysContainer->getCoordinateSystems();
209 for (
const auto& rCooSys : xCooSysSeq)
211 Reference<chart2::XChartTypeContainer> xChartTypeCont(rCooSys, uno::UNO_QUERY);
212 if (!xChartTypeCont.is())
215 uno::Sequence<uno::Reference<chart2::XChartType>> xChartTypeSeq = xChartTypeCont->getChartTypes();
216 if (!xChartTypeSeq.hasElements())
227 std::vector<XclObj*> aList;
233 for (
const auto& rxObj : rList)
236 if (IsVmlObject(rxObj.get()) || !IsValidObject(*rxObj))
240 aList.push_back(rxObj.get());
245 if (rxObj->GetObjType() == 0)
246 pObj =
dynamic_cast<XclObjAny*
>(rxObj.get());
249 css::uno::Reference<css::drawing::XShapes> xShapes(pObj->
GetShape(), UNO_QUERY);
253 nSkipObj += xShapes->getCount();
261 sal_Int32 nDrawing = drawingml::DrawingML::getNewDrawingUniqueId();
266 rStrm.GetCurrentStream()->getOutputStream(),
267 "application/vnd.openxmlformats-officedocument.drawing+xml",
271 rStrm.GetCurrentStream()->singleElement(XML_drawing,
FSNS(XML_r, XML_id),
sId.toUtf8());
273 rStrm.PushStream( pDrawing );
274 pDrawing->startElement(
FSNS( XML_xdr, XML_wsDr ),
275 FSNS(XML_xmlns, XML_xdr),
rStrm.getNamespaceURL(OOX_NS(dmlSpreadDr)).toUtf8(),
276 FSNS(XML_xmlns, XML_a),
rStrm.getNamespaceURL(OOX_NS(dml)).toUtf8(),
277 FSNS(XML_xmlns, XML_r),
rStrm.getNamespaceURL(OOX_NS(officeRel)).toUtf8() );
279 sal_Int32 nShapeId = 1000;
280 for (
const auto& rpObj : aList)
283 if ( IsFormControlObject( rpObj ) )
286 if (pXclExpTbxControlObj)
292 rpObj->SaveXml(rStrm);
295 pDrawing->endElement(
FSNS( XML_xdr, XML_wsDr ) );
302 bool hasControls =
false;
303 for (
const auto& rxObj : rList)
305 if (IsFormControlObject(rxObj.get()))
319 rWorksheet->startElement(
FSNS(XML_mc, XML_AlternateContent),
320 FSNS(XML_xmlns, XML_mc),
rStrm.getNamespaceURL(OOX_NS(mce)).toUtf8());
321 rWorksheet->startElement(
FSNS(XML_mc, XML_Choice), XML_Requires,
"x14");
322 rWorksheet->startElement(XML_controls);
324 for (
const auto& rxObj : rList)
326 if (IsFormControlObject(rxObj.get()))
329 if (pXclExpTbxControlObj)
332 pXclExpTbxControlObj->
SaveSheetXml(rStrm, aIdFormControlPr);
337 rWorksheet->endElement(XML_controls);
338 rWorksheet->endElement(
FSNS(XML_mc, XML_Choice));
339 rWorksheet->endElement(
FSNS(XML_mc, XML_AlternateContent));
344 if( GetVmlObjectCount( rList ) == 0 )
347 sal_Int32 nDrawing = drawingml::DrawingML::getNewVMLUniqueId();
352 rStrm.GetCurrentStream()->getOutputStream(),
353 "application/vnd.openxmlformats-officedocument.vmlDrawing",
357 rStrm.GetCurrentStream()->singleElement(XML_legacyDrawing,
FSNS(XML_r, XML_id),
sId.toUtf8());
359 rStrm.PushStream( pVmlDrawing );
360 pVmlDrawing->write(
"<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"yes\"?>\n");
361 pVmlDrawing->startElement( XML_xml,
362 FSNS(XML_xmlns, XML_v),
rStrm.getNamespaceURL(OOX_NS(vml)).toUtf8(),
363 FSNS(XML_xmlns, XML_o),
rStrm.getNamespaceURL(OOX_NS(vmlOffice)).toUtf8(),
364 FSNS(XML_xmlns, XML_x),
rStrm.getNamespaceURL(OOX_NS(vmlExcel)).toUtf8(),
365 FSNS(XML_xmlns, XML_w10),
rStrm.getNamespaceURL(OOX_NS(vmlWord)).toUtf8() );
367 for (
const auto& rxObj : rList )
369 if (IsFormControlObject(rxObj.get()))
372 if (pFormControlObject)
374 pFormControlObject->
SaveVml(rStrm);
378 if( !IsVmlObject( rxObj.get() ) )
380 rxObj->SaveXml( rStrm );
383 pVmlDrawing->endElement( XML_xml );
398 SaveDrawingMLObjects( *
this,
rStrm );
399 SaveVmlObjects( *
this,
rStrm );
400 SaveFormControlObjects( *
this,
rStrm );
407 mrEscherEx( rObjMgr.GetEscherEx() ),
408 mnObjType( nObjType ),
412 bFirstOnSheet( !rObjMgr.HasObj() ),
413 mbOwnEscher( bOwnEscher )
491 std::optional< XclExpStream > pXclStrm( std::in_place, aMemStrm,
rStrm.GetRoot() );
496 pXclStrm->WriteZeroBytes( 12 );
497 pXclStrm->EndRecord();
504 pXclStrm->EndRecord();
509 rStrm.CopyFromStream( aMemStrm );
535 rtl_createUuid( aGUID,
nullptr,
false );
537 rStrm.SetSliceSize( 16 );
538 for(
int i = 0;
i < 16;
i++ )
540 rStrm.SetSliceSize( 0 );
542 rStrm << sal_uInt16(0);
544 rStrm.WriteZeroBytes( 4 );
562 if(
nullptr != pSdrCaptionObj)
570 , maScPos( rAddress )
571 , mpCaption( pCaption )
593 Reference< XPropertySet > aXPropSet( aXShape, UNO_QUERY );
599 rPropOpt.
AddOpt( 0x0158, 0x00000000 );
620 sal_uInt32 nFlags = 0x000A0000;
663class VmlCommentExporter :
public VMLExport
675 using VMLExport::StartShape;
676 virtual sal_Int32 StartShape()
override;
677 using VMLExport::EndShape;
678 virtual void EndShape( sal_Int32 nShapeElement )
override;
687 , mpCaption( pCaption )
697 rProps.
AddOpt( ESCHER_Prop_fHidden, sal_uInt32(mbVisible) );
710 rProps.
AddOpt( ESCHER_Prop_fshadowObscured, 0x00030003 );
712 VMLExport::Commit( rProps, rRect );
715sal_Int32 VmlCommentExporter::StartShape()
717 AddShapeAttribute( XML_type,
"#_x0000_t202" );
719 sal_Int32
nId = VMLExport::StartShape();
728 case SvxAdjust::Center:
730 case SvxAdjust::Right:
732 case SvxAdjust::Block:
755void VmlCommentExporter::EndShape( sal_Int32 nShapeElement )
759 snprintf( pAnchor, 100,
"%" SAL_PRIdINT64
", %" SAL_PRIdINT64
", %" SAL_PRIdINT64
", %" SAL_PRIdINT64
", %" SAL_PRIdINT64
", %" SAL_PRIdINT64
", %" SAL_PRIdINT64
", %" SAL_PRIdINT64,
761 sal_Int64(
maTo.Left()), sal_Int64(
maTo.Top()), sal_Int64(
maTo.Right()), sal_Int64(
maTo.Bottom()) );
767 pVmlDrawing->startElement(
FSNS(XML_x, XML_ClientData), XML_ObjectType,
"Note");
768 pVmlDrawing->singleElement(
FSNS(XML_x, XML_MoveWithCells));
769 pVmlDrawing->singleElement(
FSNS(XML_x, XML_SizeWithCells));
777 pVmlDrawing->singleElement(
FSNS(XML_x, XML_Visible));
778 pVmlDrawing->endElement(
FSNS( XML_x, XML_ClientData ) );
780 VMLExport::EndShape( nShapeElement );
786 aCommentExporter.AddSdrObject( *
mpCaption );
828 rStrm.WriteZeroBytes( 20 );
832 sal_uInt16 nDropDownFlags = 0;
836 rStrm << sal_uInt32(0) << sal_uInt16(0) << sal_uInt16(0x0301) << sal_uInt16(0)
837 << nDropDownFlags << sal_uInt16( 20 ) << sal_uInt16( 130 );
882 mpString->AppendFormat( 0, nFontIx );
904 if( (4500_deg100 < nAngle) && (nAngle < 13500_deg100) )
906 else if( (22500_deg100 < nAngle) && (nAngle < 31500_deg100) )
924 OUString aParaText( rEditObj.
GetText( 0 ) );
925 if( !aParaText.isEmpty() )
944 if( rItem.
GetValue() == css::text::WritingMode_TB_RL )
950 OSL_ENSURE(
mpString,
"XclTxo::SaveCont - missing string" );
953 sal_uInt16 nRunLen =
mpString->IsEmpty() ? 0 : (8 *
mpString->GetFormatsCount());
955 sal_uInt16 nFlags = 0;
960 rStrm.WriteZeroBytes( 6 );
982 for(
const auto& rFormat : rFormats )
983 rStrm << rFormat.mnChar << rFormat.mnFontIdx << sal_uInt32( 0 );
1002 pRootStorage( rObjMgr.GetRoot().GetRootStorage().
get() )
1013 OUString aStorageName(
"MBD" );
1014 char aBuf[
sizeof(sal_uInt32) * 2 + 1 ];
1016 sal_uInt32 nPictureId = sal_uInt32(
reinterpret_cast<sal_uIntPtr
>(
this) >> 2);
1018 aStorageName += OUString::createFromAscii(
aBuf);
1023 uno::Reference < embed::XEmbeddedObject > xObj(
static_cast<const SdrOle2Obj&
>(
rOleObj).GetObjRef() );
1048 rStrm << sal_uInt16(0x0002);
1060 sal_uInt16 nPadLen =
static_cast<sal_uInt16
>(
aName.GetSize() & 0x01);
1061 sal_uInt16 nFmlaLen =
static_cast< sal_uInt16
>( 12 +
aName.GetSize() + nPadLen );
1062 sal_uInt16 nSubRecLen = nFmlaLen + 6;
1066 << sal_uInt16( 5 ) << sal_uInt32( 0 ) <<
sal_uInt8( 2 )
1071 rStrm << nPictureId;
1124 awt::Point aTopLeft = rShape->getPosition();
1125 awt::Size aSize = rShape->getSize();
1138 sal_Int16 nHalfWidth = aSize.Width / 2;
1139 sal_Int16 nHalfHeight = aSize.Height / 2;
1143 aTopLeft.X = aSnapRectCenter.X() - nHalfWidth;
1144 aTopLeft.Y = aSnapRectCenter.Y() - nHalfHeight;
1149 if ((nRotation > 4500_deg100 && nRotation <= 13500_deg100) || (nRotation > 22500_deg100 && nRotation <= 31500_deg100))
1151 aTopLeft.X = aTopLeft.X - nHalfHeight + nHalfWidth;
1152 aTopLeft.Y = aTopLeft.Y - nHalfWidth + nHalfHeight;
1154 std::swap(aSize.Width, aSize.Height);
1159 tools::Rectangle aLocation( aTopLeft.X, aTopLeft.Y, aTopLeft.X + aSize.Width, aTopLeft.Y + aSize.Height );
1160 ScRange aRange =
rStrm.GetRoot().GetDoc().GetRange( nTab, aLocation );
1165 pDrawing->startElement(
FSNS(XML_xdr, XML_from));
1172 pDrawing->endElement(
FSNS( XML_xdr, XML_from ) );
1174 pDrawing->startElement(
FSNS(XML_xdr, XML_to));
1181 pDrawing->endElement(
FSNS( XML_xdr, XML_to ) );
1219 nResult = rRange.
Parse(rString, rDoc);
1241 nResult = rAddress.
Parse(rString, rDoc);
1254void transformURL(
const OUString& rOldURL, OUString& rNewURL,
const ScDocument& rDoc)
1256 if (rOldURL.startsWith(
"#"))
1261 OUString aAddressString =
aURL.copy(1);
1264 ScRefFlags nResult = parseRange(aAddressString, aRange, rDoc);
1268 rNewURL =
"#" + aString;
1274 nResult = parseAddress(aAddressString, aAddress, rDoc);
1278 rNewURL =
"#" + aString;
1297 transformURL(rURL, aNewURL,
mrDoc);
1303 return !rURL.startsWith(
"#");
1326 ShapeExport aDML(XML_xdr, pDrawing,
nullptr, &
rStrm, drawingml::DOCUMENT_XLSX);
1327 auto pURLTransformer = std::make_shared<ScURLTransformer>(*
mpDoc);
1328 aDML.SetURLTranslator(pURLTransformer);
1330 pDrawing->startElement(
FSNS( XML_xdr, XML_twoCellAnchor ),
1332 Reference< XPropertySet > xPropSet(
mxShape, UNO_QUERY );
1339 pDrawing->singleElement(
FSNS( XML_xdr, XML_clientData)
1343 pDrawing->endElement(
FSNS( XML_xdr, XML_twoCellAnchor ) );
1348 rStrm.DisableEncryption();
1351 << sal_uInt32(0x06) ;
1382 sUnicodeName( rRootData.pER->GetTabInfo().GetScTabName( _nTab ) )
1387 sUnicodeName(
std::move( aString ))
1395 rStrm.DisableEncryption();
1396 rStrm << sal_uInt32(0);
1397 rStrm.EnableEncryption();
1409 rStrm.CreateOutputStream(
1412 rStrm.GetCurrentStream()->getOutputStream(),
1413 "application/vnd.openxmlformats-officedocument.spreadsheetml.worksheet+xml",
1417 rStrm.GetCurrentStream()->singleElement( XML_sheet,
1419 XML_sheetId, OString::number(
nTab+1 ),
1420 XML_state,
nGrbit == 0x0000 ?
"visible" :
"hidden",
1421 FSNS( XML_r, XML_id ),
sId.toUtf8() );
1478 rStrm.GetCurrentStream()->singleElement( XML_inputCells,
1514 bool bContLoop =
true;
1520 for(
size_t nRange = 0; (nRange < pRList->
size()) && bContLoop; nRange++ )
1522 const ScRange & rRange = (*pRList)[nRange];
1523 for( nRow = rRange.
aStart.
Row(); (nRow <= rRange.
aEnd.
Row()) && bContLoop; nRow++ )
1524 for( nCol = rRange.
aStart.
Col(); (nCol <= rRange.
aEnd.
Col()) && bContLoop; nCol++ )
1528 fVal = rDoc.
GetValue( nCol, nRow, nTab );
1529 sText = ::rtl::math::doubleToUString( fVal,
1530 rtl_math_StringFormat_Automatic,
1531 rtl_math_DecimalPlaces_Max,
1536 sText = rDoc.
GetString(nCol, nRow, nTab);
1537 bContLoop =
Append(
static_cast<sal_uInt16
>(nCol),
1538 static_cast<sal_uInt16
>(nRow), sText );
1572 for(
const auto& rCell :
aCells )
1573 rCell.WriteAddress(
rStrm );
1574 for(
const auto& rCell :
aCells )
1575 rCell.WriteText(
rStrm );
1576 rStrm.SetSliceSize( 2 );
1593 rWorkbook->startElement( XML_scenario,
1597 XML_count, OString::number(
aCells.size() ),
1601 for(
const auto& rCell :
aCells )
1602 rCell.SaveXml(
rStrm );
1604 rWorkbook->endElement( XML_scenario );
1614 SCTAB nFirstTab = nTab + 1;
1615 SCTAB nNewTab = nFirstTab;
1619 aScenes.emplace_back( rRoot, nNewTab );
1622 nActive =
static_cast<sal_uInt16
>(nNewTab - nFirstTab);
1633 rStrm << static_cast<sal_uInt16>(
aScenes.size())
1645 rScenario.Save(
rStrm );
1654 rWorkbook->startElement( XML_scenarios,
1655 XML_current, OString::number(
nActive ),
1656 XML_show, OString::number(
nActive )
1661 rScenario.SaveXml(
rStrm );
1663 rWorkbook->endElement( XML_scenarios );
1678struct XclExpTabProtectOption
1689 static const XclExpTabProtectOption aTable[] =
1716 for (
int i = 0; aTable[
i].nMask != 0x0000; ++
i)
1725 sal_uInt16 nBytes = 0x0867;
1728 for (
int i = 0;
i < 9; ++
i)
1729 rStrm <<
static_cast<unsigned char>(0);
1736 rStrm << nBytes << nBytes;
1747 maEnhancedProtection(
std::move( aProt ))
1753 sal_uInt16
const nRecordType = 0x0868;
1754 rStrm << nRecordType;
1755 rStrm.WriteZeroBytesToRecord(10);
1757 rStrm.WriteZeroBytesToRecord(5);
1762 sal_uInt16 nCref = ulimit_cast<sal_uInt16>(aRefs.
size());
1764 rStrm.WriteZeroBytesToRecord(6);
1773 SAL_WARN_IF( bSDContainer && nCbSD < 20,
"sc.filter",
1774 "XclExpSheetEnhancedProtection A flag indicates container but cbSD < 20");
1775 SAL_WARN_IF( !bSDContainer && nCbSD > 0,
"sc.filter",
1776 "XclExpSheetEnhancedProtection A flag indicates no container but cbSD > 0");
1806 rStrm.WriteAttributes(XML_iterateCount, OUString::number(
nCount));
1831 rStrm.WriteAttributes(XML_iterate, ToPsz(
nIter == 1));
1856 rStrm.WriteAttributes(XML_iterateDelta, OUString::number(
fDelta));
1873 rStrm << static_cast<sal_uInt16>(0x0001);
1877 sal_uInt16 nStdEnc = 0x0001;
1878 rStrm << nStdEnc << nStdEnc;
1884 xEnc->GetDocId(pnDocId);
1885 xEnc->GetSalt(pnSalt);
1886 xEnc->GetSaltDigest(pnSaltHash);
1888 rStrm.Write(pnDocId, 16);
1889 rStrm.Write(pnSalt, 16);
1890 rStrm.Write(pnSaltHash, 16);
1892 rStrm.SetEncrypter(xEnc);
1902 rStrm.DisableEncryption();
1914 rStrm.EnableEncryption();
1929 0x04, 0x00, 0x00,
'C',
'a',
'l',
'c', 0x20,
1930 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20,
1931 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20,
1932 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20,
1933 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20,
1934 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20,
1935 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20,
1936 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20,
1937 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20,
1938 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20,
1939 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20,
1940 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20,
1941 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20,
1942 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20 };
1944 for (std::size_t
i = 0;
i <
sizeof(
aData); ++
i)
1950 mnPasswordHash( nPasswordHash ),
1951 mbRecommendReadOnly( bRecommendReadOnly )
1981 rStrm << static_cast<sal_uInt16>(0x0000);
1995 rStrm << static_cast<sal_uInt16>(0x0000);
1999 0xC1, 0x01, 0x00, 0x00, 0x54, 0x8D, 0x01, 0x00
2008 0x63, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
2009 0x00, 0x00, 0x15, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
2025 rStrm.WriteAttributes(XML_refMode,
GetBool() ?
"A1" :
"R1C1");
const OptionalValueType maFrom
const OptionalValueType maTo
virtual OUString GetText(sal_Int32 nPara) const=0
virtual const SfxItemSet & GetParaAttribs(sal_Int32 nPara) const=0
virtual sal_uInt32 EnterGroup(const OUString &rShapeName, const tools::Rectangle *pBoundRect)
virtual void AddShape(sal_uInt32 nShpInstance, ShapeFlag nFlagIds, sal_uInt32 nShapeID=0)
void AddAtom(sal_uInt32 nAtomSitze, sal_uInt16 nRecType, int nRecVersion=0, int nRecInstance=0)
void AddChildAnchor(const tools::Rectangle &rRectangle)
virtual void OpenContainer(sal_uInt16 nEscherContainer, int nRecInstance=0)
static const SdrObject * GetSdrObject(const css::uno::Reference< css::drawing::XShape > &rXShape)
SvStream & GetStream() const
virtual void CloseContainer()
void AddOpt(sal_uInt16 nPropID, bool bBlib, sal_uInt32 nSizeReduction, SvMemoryStream &rStream)
bool GetOpt(sal_uInt16 nPropertyID, sal_uInt32 &rPropValue) const
void CreateFillProperties(const css::uno::Reference< css::beans::XPropertySet > &, bool bEdge, bool bTransparentGradient=false)
void Commit(SvStream &rSt, sal_uInt16 nVersion=3, sal_uInt16 nRecType=ESCHER_OPT)
virtual std::size_t GetLen() const override
virtual sal_uInt16 GetNum() const override
virtual void SaveCont(XclExpStream &rStrm) override
virtual void SaveXml(XclExpXmlStream &rStrm) override
virtual std::size_t GetLen() const override
XclExpString GetName() const
virtual void SaveCont(XclExpStream &rStrm) override
ExcBundlesheet8(const RootData &rRootData, SCTAB nTab)
std::size_t GetStringBytes() const
void SaveXml(XclExpXmlStream &rStrm) const
void WriteText(XclExpStream &rStrm) const
void WriteAddress(XclExpStream &rStrm) const
ExcEScenarioCell(sal_uInt16 nC, sal_uInt16 nR, const OUString &rTxt)
ExcEScenarioManager(const XclExpRoot &rRoot, SCTAB nTab)
std::vector< ExcEScenario > aScenes
virtual ~ExcEScenarioManager() override
virtual sal_uInt16 GetNum() const override
virtual void SaveXml(XclExpXmlStream &rStrm) override
virtual void SaveCont(XclExpStream &rStrm) override
virtual void Save(XclExpStream &rStrm) override
Writes the record header and calls WriteBody().
virtual std::size_t GetLen() const override
ExcEScenario(const XclExpRoot &rRoot, SCTAB nTab)
virtual std::size_t GetLen() const override
bool Append(sal_uInt16 nCol, sal_uInt16 nRow, const OUString &rTxt)
virtual sal_uInt16 GetNum() const override
std::vector< ExcEScenarioCell > aCells
virtual void SaveXml(XclExpXmlStream &rStrm) override
virtual void SaveCont(XclExpStream &rStrm) override
virtual void Save(XclExpStream &rStrm) override
Writes the record header and calls WriteBody().
static OUString decode(std::u16string_view rText, DecodeMechanism eMechanism, rtl_TextEncoding eCharset=RTL_TEXTENCODING_UTF8)
SC_DLLPUBLIC void Format(OStringBuffer &r, ScRefFlags nFlags, const ScDocument *pDocument=nullptr, const Details &rDetails=detailsOOOa1) const
SC_DLLPUBLIC ScRefFlags Parse(const OUString &, const ScDocument &, const Details &rDetails=detailsOOOa1, ExternalInfo *pExtInfo=nullptr, const css::uno::Sequence< css::sheet::ExternalLinkInfo > *pExternalLinks=nullptr, sal_Int32 *pSheetEndPos=nullptr, const OUString *pErrRef=nullptr)
ScDetectiveObjType GetDetectiveObjectType(SdrObject *pObject, SCTAB nObjTab, ScAddress &rPosition, ScRange &rSource, bool &rRedLine)
sal_uInt16 GetIterCount() const
double GetIterEps() const
SC_DLLPUBLIC bool IsScenario(SCTAB nTab) const
SC_DLLPUBLIC const ScTableProtection * GetTabProtection(SCTAB nTab) const
SC_DLLPUBLIC formula::FormulaGrammar::AddressConvention GetAddressConvention() const
SC_DLLPUBLIC double GetValue(const ScAddress &rPos) const
SC_DLLPUBLIC void GetScenarioData(SCTAB nTab, OUString &rComment, Color &rColor, ScScenarioFlags &rFlags) const
SC_DLLPUBLIC const ScRangeList * GetScenarioRanges(SCTAB nTab) const
SC_DLLPUBLIC bool HasValueData(SCCOL nCol, SCROW nRow, SCTAB nTab) const
SC_DLLPUBLIC OUString GetString(SCCOL nCol, SCROW nRow, SCTAB nTab, const ScInterpreterContext *pContext=nullptr) const
SC_DLLPUBLIC bool GetName(SCTAB nTab, OUString &rName) const
SC_DLLPUBLIC const ScDocOptions & GetDocOptions() const
SC_DLLPUBLIC bool IsActiveScenario(SCTAB nTab) const
static ScAnchorType GetAnchorType(const SdrObject &)
static SC_DLLPUBLIC const LocaleDataWrapper & getLocaleData()
OUString Format(const ScDocument &rDocument, ScRefFlags nFlags=ScRefFlags::ZERO, const ScAddress::Details &rDetails=ScAddress::detailsOOOa1, bool bFullAddressNotation=false) const
Returns string with formatted cell range from aStart to aEnd, according to provided address conventio...
ScRefFlags Parse(const OUString &, const ScDocument &, const ScAddress::Details &rDetails=ScAddress::detailsOOOa1, ScAddress::ExternalInfo *pExtInfo=nullptr, const css::uno::Sequence< css::sheet::ExternalLinkInfo > *pExternalLinks=nullptr, const OUString *pErrRef=nullptr)
sheet protection state container
@ NONE
last item - used to resize the vector
bool isOptionEnabled(Option eOption) const
void setSuppressGetBitmap(bool bNew)
static SdrObject * getSdrObjectFromXShape(const css::uno::Reference< css::uno::XInterface > &xInt)
virtual Degree100 GetRotateAngle() const
virtual const tools::Rectangle & GetSnapRect() const
virtual SdrObjKind GetObjIdentifier() const
const SfxItemSet & GetMergedItemSet() const
void SetMergedItem(const SfxPoolItem &rItem)
virtual Degree100 GetRotateAngle() const override
const T * GetItemIfSet(TypedWhichId< T > nWhich, bool bSrchInParent=true) const
const SfxPoolItem & Get(sal_uInt16 nWhich, bool bSrchInParent=true) const
SotStorage * OpenSotStorage(const OUString &rEleName, StreamMode=StreamMode::STD_READWRITE, bool transacted=true)
sal_uInt64 Seek(sal_uInt64 nPos)
bool IsCalc2Excel() const
static SvtFilterOptions & Get()
bool IsImpress2PowerPoint() const
bool IsWriter2WinWord() const
bool IsMath2MathType() const
void ExportOLEObject(svt::EmbeddedObjectRef const &rObj, SotStorage &rDestStg)
css::text::WritingMode GetValue() const
XclCalccount(const ScDocument &)
virtual sal_uInt16 GetNum() const override
virtual void SaveCont(XclExpStream &rStrm) override
virtual std::size_t GetLen() const override
virtual void SaveXml(XclExpXmlStream &rStrm) override
virtual std::size_t GetLen() const override
virtual sal_uInt16 GetNum() const override
virtual void SaveCont(XclExpStream &rStrm) override
XclCodename(const OUString &)
virtual void SaveCont(XclExpStream &rStrm) override
virtual std::size_t GetLen() const override
virtual sal_uInt16 GetNum() const override
XclDelta(const ScDocument &)
virtual void SaveXml(XclExpXmlStream &rStrm) override
bool HasPendingDffData()
Returns true, if there is more data left in the DFF stream than owned by the last MSODRAWING record.
void UpdateDffFragmentEnd()
Called after some data has been written to the DFF stream, to update the end position of the DFF frag...
XclExpDffAnchorBase * CreateDffAnchor(const SdrObject &rSdrObj) const
Creates a new DFF client anchor object and calculates the anchor position of the passed object.
void ConvertRangeList(XclRangeList &rXclRanges, const ScRangeList &rScRanges, bool bWarn)
Converts the passed Calc cell range list to an Excel cell range list.
Record which contains a Boolean value.
bool GetBool() const
Returns the Boolean value of the record.
css::uno::Reference< css::chart::XChartDocument > GetChartDoc() const
void WriteDffData(EscherEx &rEscherEx) const
Writes the DFF client anchor structure with the current anchor position.
Represents the position (anchor) of a cell dropdown object.
Represents the position (anchor) of a note object.
Record which exports a memory data array.
const XclExpRoot & mrRoot
virtual void WriteBody(XclExpStream &rStrm) override
Writes the body of the record (without record header).
XclExpFileEncryption(const XclExpRoot &rRoot)
virtual ~XclExpFileEncryption() override
XclExpFileSharing(const XclExpRoot &rRoot, sal_uInt16 nPasswordHash, bool bRecommendReadOnly)
sal_uInt16 mnPasswordHash
virtual void Save(XclExpStream &rStrm) override
Writes the record header and calls WriteBody().
virtual void WriteBody(XclExpStream &rStrm) override
Writes the body of the record (without record header).
virtual void WriteBody(XclExpStream &rStrm) override
Writes the body of the record (without record header).
virtual ~XclExpInterfaceEnd() override
XclExpInterfaceHdr(sal_uInt16 nCodePage)
virtual void WriteBody(XclExpStream &rStrm) override
Writes the body of the record.
One or more MSODRAWING records contain the DFF stream data for a drawing shape.
void EndSheet()
close groups and DgContainer opened in ctor
sal_uInt16 Add(std::unique_ptr< XclObj >)
return: 1-based ObjId count>=0xFFFF: Obj will be deleted, return 0
virtual void SaveXml(XclExpXmlStream &rStrm) override
std::unique_ptr< XclExpMsoDrawing > pSolverContainer
std::unique_ptr< XclObj > pop_back()
Remove last element in the list.
std::unique_ptr< XclExpMsoDrawing > pMsodrawingPerSheet
virtual ~XclExpObjList() override
virtual void Save(XclExpStream &rStrm) override
Writes the record header and calls WriteBody().
std::vector< std::unique_ptr< XclObj > > maObjs
XclExpObjList(const XclExpRoot &rRoot, XclEscherEx &rEscherEx)
XclExpMsoDrawing * GetMsodrawingPerSheet()
virtual void WriteBody(XclExpStream &rStrm) override
Writes the body of the record (without record header).
virtual ~XclExpProt4RevPass() override
virtual void WriteBody(XclExpStream &rStrm) override
Writes the body of the record (without record header).
virtual ~XclExpProt4Rev() override
Base class for single records with any content.
virtual void Save(XclExpStream &rStrm) override
Writes the record header and calls WriteBody().
void AddRecSize(std::size_t nRecSize)
Adds a size value to the record size prediction.
Access to global data from other classes.
XclExpAddressConverter & GetAddressConverter() const
Returns the address converter.
const XclExpRoot & GetRoot() const
Returns this root instance - for code readability in derived classes.
virtual void WriteBody(XclExpStream &rStrm) override
Writes the body of the record (without record header).
ScEnhancedProtection maEnhancedProtection
XclExpSheetEnhancedProtection(const XclExpRoot &rRoot, ScEnhancedProtection aProt)
const XclExpRoot & mrRoot
XclExpSheetProtectOptions(const XclExpRoot &rRoot, SCTAB nTab)
virtual void WriteBody(XclExpStream &rStrm) override
Writes the body of the record (without record header).
This class is used to export Excel record streams.
This class provides methods to create an XclExpString.
This class stores an unformatted or formatted string for Excel export.
void WriteFlagField(XclExpStream &rStrm) const
Writes the string flags field (1 byte).
void AssignByte(std::u16string_view rString, rtl_TextEncoding eTextEnc, XclStrFlags nFlags=XclStrFlags::NONE, sal_uInt16 nMaxLen=EXC_STR_MAXLEN)
Assigns an unformatted string, converts this object to a BIFF2-BIFF7 byte string.
void Assign(const OUString &rString, XclStrFlags nFlags=XclStrFlags::NONE, sal_uInt16 nMaxLen=EXC_STR_MAXLEN)
Assigns an unformatted string, converts this object to a BIFF8 Unicode string.
std::size_t GetSize() const
Returns the byte count the whole string will take on export.
std::size_t GetBufferSize() const
Returns the byte count the character buffer will take on export.
void WriteBuffer(XclExpStream &rStrm) const
Writes the raw character buffer.
sal_uInt16 Len() const
Returns the character count of the string.
Represents an OBJ record for a TBX form control.
void SaveVml(XclExpXmlStream &rStrm)
Save into xl/drawings/vmlDrawing1.vml.
OUString SaveControlPropertiesXml(XclExpXmlStream &rStrm) const
void setShapeId(sal_Int32 aShapeId)
void SaveSheetXml(XclExpXmlStream &rStrm, const OUString &aIdFormControlPr) const
A record with a single value of type Type.
const Type & GetValue() const
Returns the value of the record.
virtual void WriteBody(XclExpStream &rStrm) override
Writes the body of the record (without record header).
virtual ~XclExpWriteAccess() override
virtual std::size_t GetLen() const override
virtual void SaveCont(XclExpStream &rStrm) override
XclIteration(const ScDocument &)
virtual void SaveXml(XclExpXmlStream &rStrm) override
virtual sal_uInt16 GetNum() const override
XclObjAny(XclExpObjectManager &rObjMgr, const css::uno::Reference< css::drawing::XShape > &rShape, ScDocument *pDoc)
css::uno::Reference< css::drawing::XShape > mxShape
const css::uno::Reference< css::drawing::XShape > & GetShape() const
virtual void Save(XclExpStream &rStrm) override
Writes the record header and calls WriteBody().
static void WriteFromTo(XclExpXmlStream &rStrm, const XclObjAny &rObj)
virtual ~XclObjAny() override
virtual void WriteSubRecs(XclExpStream &rStrm) override
virtual void SaveXml(XclExpXmlStream &rStrm) override
virtual void WriteSubRecs(XclExpStream &rStrm) override
virtual ~XclObjDropDown() override
XclObjDropDown(XclExpObjectManager &rObjMgr, const ScAddress &rPos, bool bFilt)
virtual ~XclObjOle() override
XclObjOle(XclExpObjectManager &rObjMgr, const SdrObject &rObj)
const SdrObject & rOleObj
SotStorage * pRootStorage
virtual void WriteSubRecs(XclExpStream &rStrm) override
virtual void Save(XclExpStream &rStrm) override
Writes the record header and calls WriteBody().
void SaveTextRecs(XclExpStream &rStrm)
sal_uInt16 GetObjType() const
XclExpMsoDrawing * pMsodrawing
void ImplWriteAnchor(const SdrObject *pSdrObj, const tools::Rectangle *pChildAnchor)
void SetEscherShapeType(sal_uInt16 nType)
virtual void WriteSubRecs(XclExpStream &rStrm)
void SetPrintable(bool b)
virtual void Save(XclExpStream &rStrm) override
Writes the record header and calls WriteBody().
std::unique_ptr< XclExpMsoDrawing > pClientTextbox
XclObj(XclExpObjectManager &rObjMgr, sal_uInt16 nObjType, bool bOwnEscher=false)
true = Escher part created on the fly.
std::unique_ptr< XclTxo > pTxo
virtual ~XclObj() override
virtual void WriteBody(XclExpStream &rStrm) override
Writes the body of the record (without record header).
void SetText(const XclExpRoot &rRoot, const SdrTextObj &rObj)
actually writes ESCHER_ClientTextbox
virtual sal_uInt16 GetNum() const override
virtual std::size_t GetLen() const override
A 2D cell range address list with Excel column and row indexes.
void Write(XclExpStream &rStrm, bool bCol16Bit=true, sal_uInt16 nCountInStream=0) const
XclRefmode(const ScDocument &)
virtual void SaveXml(XclExpXmlStream &rStrm) override
rtl_TextEncoding GetTextEncoding() const
Returns the text encoding to import/export byte strings.
const OUString & GetUserName() const
Returns the current user name.
XclBiff GetBiff() const
Returns the current BIFF version of the importer/exporter.
ScDocument & GetDoc() const
Returns reference to the destination document (import) or source document (export).
XclTxo(const OUString &rString, sal_uInt16 nFontIx)
sal_uInt16 mnRotation
Text and formatting data.
sal_uInt8 mnVerAlign
Horizontal alignment.
virtual std::size_t GetLen() const override
void SetHorAlign(sal_uInt8 nHorAlign)
virtual sal_uInt16 GetNum() const override
virtual void Save(XclExpStream &rStrm) override
Writes the record header and calls WriteBody().
void SetVerAlign(sal_uInt8 nVerAlign)
virtual void SaveCont(XclExpStream &rStrm) override
sal_uInt8 mnHorAlign
Text rotation.
static OString ToOString(const Color &rColor)
static sax_fastparser::FSHelperPtr WriteElement(sax_fastparser::FSHelperPtr pStream, sal_Int32 nElement, const T &value)
static OUString GetStreamName(const char *sStreamDir, const char *sStream, sal_Int32 nId)
constexpr TypedWhichId< SvxAdjustItem > EE_PARA_JUST(EE_PARA_START+16)
EmbeddedObjectRef * pObject
#define ESCHER_ShpInst_RoundRectangle
#define ESCHER_Prop_LockAgainstGrouping
#define ESCHER_Prop_fNoFillHitTest
#define ESCHER_ClientData
#define ESCHER_ShpInst_HostControl
#define ESCHER_Prop_fshadowObscured
#define ESCHER_Prop_FitTextToShape
#define ESCHER_Prop_fNoLineDrawDash
#define ESCHER_Prop_shadowColor
#define ESCHER_ShpInst_TextBox
#define ESCHER_DgContainer
#define ESCHER_Prop_fillBackColor
#define ESCHER_ShpInst_Ellipse
#define ESCHER_ShpInst_Arc
#define ESCHER_Prop_fPrint
#define ESCHER_Prop_lTxid
#define ESCHER_ShpInst_Rectangle
#define ESCHER_SpContainer
#define ESCHER_ClientTextbox
#define ESCHER_Prop_fillColor
#define ESCHER_ShpInst_Line
#define ESCHER_ShpInst_PictureFrame
constexpr sal_Int32 FSNS(sal_Int32 namespc, sal_Int32 element)
#define SAL_WARN_IF(condition, area, stream)
#define OLE_STARIMPRESS_2_POWERPOINT
#define OLE_STARWRITER_2_WINWORD
#define OLE_STARCALC_2_EXCEL
#define OLE_STARMATH_2_MATHTYPE
constexpr OUStringLiteral aData
std::shared_ptr< T > make_shared(Args &&... args)
int sprintf(char(&s)[N], char const *format, T &&... arguments)
sal_Int64 convertHmmToEmu(sal_Int32 nValue)
OUString getRelationship(Relationship eRelationship)
std::shared_ptr< FastSerializerHelper > FSHelperPtr
css::uno::Reference< css::linguistic2::XProofreadingIterator > get(css::uno::Reference< css::uno::XComponentContext > const &context)
uno::Reference< drawing::XShape > const mxShape
Container for the Excel EnhancedProtection feature.
sal_uInt32 mnPasswordVerifier
::std::vector< sal_uInt8 > maSecurityDescriptor
ScRangeListRef maRangeList
constexpr TypedWhichId< SdrTextVertAdjustItem > SDRATTR_TEXT_VERTADJUST(SDRATTR_MISC_FIRST+8)
constexpr TypedWhichId< SvxWritingModeItem > SDRATTR_TEXTDIRECTION(SDRATTR_NOTPERSIST_FIRST+34)
SVXCORE_DLLPUBLIC Degree100 NormAngle36000(Degree100 a)
SVXCORE_DLLPUBLIC css::uno::Reference< css::drawing::XShape > GetXShapeForSdrObject(SdrObject *pObj) noexcept
static void lcl_FillProps(EscherPropertyContainer &rPropOpt, SdrObject *pCaption, bool bVisible)
static const char * lcl_GetVertAlignFromItemSetChar(const SfxItemSet &rItemSet)
const sal_uInt8 nDataBookExt[]
static const char * GetEditAs(const XclObjAny &rObj)
static sal_uInt8 lcl_GetHorAlignFromItemSet(const SfxItemSet &rItemSet)
static sal_uInt8 lcl_GetVerAlignFromItemSet(const SfxItemSet &rItemSet)
const sal_uInt8 nDataRecalcId[]
void setSuppressGetBitmapFromXclObjComment(SdrCaptionObj *pSdrCaptionObj, bool bValue)
static const char * lcl_GetHorizAlignFromItemSetChar(const SfxItemSet &rItemSet)
std::shared_ptr< XclExpBiff8Encrypter > XclExpEncrypterRef
#define XESTRING_TO_PSZ(s)
const sal_uInt16 EXC_ISFPROTECTION
const sal_uInt16 EXC_ID_INTERFACEHDR
const sal_uInt16 EXC_ID_FILESHARING
const sal_uInt16 EXC_OBJ_PIC_MANUALSIZE
const sal_uInt16 EXC_ID_OBJPICTFMLA
Option flags.
const sal_uInt16 EXC_OBJ_DROPDOWN_SIMPLE
Dropdown listbox with editable text.
const sal_uInt16 EXC_OBJTYPE_NOTE
const sal_uInt8 EXC_OBJ_VER_CENTER
const sal_uInt16 EXC_OBJTYPE_DRAWING
const sal_uInt16 EXC_OBJTYPE_CHART
const sal_uInt16 EXC_ID_OBJCMO
Check box/radio button cell link.
const sal_uInt8 EXC_OBJ_VER_JUSTIFY
const sal_uInt8 EXC_OBJ_VER_BOTTOM
const sal_uInt16 EXC_ID_OBJGMO
Button data.
const sal_uInt16 EXC_OBJ_PIC_SYMBOL
const sal_uInt16 EXC_OBJTYPE_UNKNOWN
const sal_uInt8 EXC_OBJ_VER_TOP
const sal_uInt16 EXC_OBJTYPE_ARC
const sal_uInt16 EXC_OBJTYPE_DROPDOWN
const sal_uInt16 EXC_ID_OBJSBS
Radio button group data.
const sal_uInt16 EXC_ID_OBJNTS
Scroll bar data.
const sal_uInt16 EXC_OBJTYPE_BUTTON
const sal_uInt16 EXC_OBJ_ORIENT_90CCW
Stacked top to bottom.
const sal_uInt16 EXC_OBJTYPE_GROUP
const sal_uInt8 EXC_OBJ_HOR_CENTER
const sal_uInt16 EXC_OBJ_ORIENT_NONE
const sal_uInt16 EXC_OBJTYPE_RECTANGLE
const sal_uInt16 EXC_ID_OBJFLAGS
Clipboard format.
const sal_uInt8 EXC_OBJ_HOR_LEFT
const sal_uInt16 EXC_ID_OBJ
const sal_uInt16 EXC_OBJTYPE_LINE
const sal_uInt16 EXC_OBJTYPE_TEXT
const sal_uInt16 EXC_OBJ_DROPDOWN_FILTERED
const sal_uInt8 EXC_OBJ_HOR_RIGHT
const sal_uInt16 EXC_ID_TXO
const sal_uInt16 EXC_OBJTYPE_OVAL
const sal_uInt16 EXC_ID_OBJLBSDATA
Check box/radio button data.
const sal_uInt8 EXC_OBJ_HOR_JUSTIFY
const sal_uInt16 EXC_ID_OBJCF
Group marker.
const sal_uInt16 EXC_OBJTYPE_CHECKBOX
const sal_uInt16 EXC_ID_OBJEND
const sal_uInt16 EXC_OBJ_ORIENT_90CW
90 degr. counterclockwise.
const sal_uInt16 EXC_OBJTYPE_PICTURE
const sal_uInt16 EXC_ID_CONT
::std::vector< XclFormatRun > XclFormatRunVec
A vector with all formatting runs for a rich-string.
XclStrFlags
Flags used to specify import/export mode of strings.
@ EightBitLength
Always use UCS-2 characters (default: try to compress). BIFF8 only.
const sal_uInt8 EXC_STRF_16BIT
const sal_uInt16 EXC_FONT_APP