22#include <osl/diagnose.h>
37#include <officecfg/Office/Calc.hxx>
39#include <com/sun/star/document/XDocumentPropertiesSupplier.hpp>
40#include <com/sun/star/frame/XModel.hpp>
46enum class VBAExportMode
73 OSL_ENSURE( pDocShell,
"ExportBiff5::Write - no document shell" );
76 OSL_ENSURE( xRootStrg.
is(),
"ExportBiff5::Write - no root storage" );
81 if (officecfg::Office::Calc::Filter::Import::VBA::UseExport::get())
82 eVbaExportMode = VBAExportMode::FULL_EXPORT;
87 eVbaExportMode = VBAExportMode::REEXPORT_STREAM;
91 if ( pDocShell && xRootStrg.
is() && eVbaExportMode == VBAExportMode::FULL_EXPORT)
100 else if( pDocShell && xRootStrg.
is() && eVbaExportMode == VBAExportMode::REEXPORT_STREAM )
111 if( pDocShell && xRootStrg.
is() )
114 uno::Reference<document::XDocumentPropertiesSupplier> xDPS(
115 pDocShell->
GetModel(), uno::UNO_QUERY_THROW);
116 uno::Reference<document::XDocumentProperties> xDocProps
117 = xDPS->getDocumentProperties();
120 std::shared_ptr<GDIMetaFile> xMetaFile =
122 uno::Sequence<sal_Int8> metaFile(
virtual ~ExportBiff5() override
ExportBiff5(XclExpRootData &rExpData, SvStream &rStrm)
std::unique_ptr< ExcDocument > pExcDoc
ExportBiff8(XclExpRootData &rExpData, SvStream &rStrm)
virtual ~ExportBiff8() override
void SetError(ErrCode rErr)
std::shared_ptr< GDIMetaFile > GetPreviewMetaFile(bool bFullContent=false) const
css::uno::Reference< css::frame::XModel3 > GetModel() const
bool IsLoadExcelBasicStorage() const
static SvtFilterOptions & Get()
ErrCode SaveOrDelMSVBAStorage(bool bSaveInto, const OUString &rStorageName)
bool containsVBAProject()
void exportVBA(SotStorage *pRootStorage)
bool IsRowTruncated() const
Returns whether the "some rows have been cut" warning box should be shown.
bool IsColTruncated() const
Returns whether the "some columns have been cut" warning box should be shown.
bool IsTabTruncated() const
Returns whether the "some sheets have been cut" warning box should be shown.
Provides functions to convert Calc cell addresses to Excel cell addresses.
Access to global data from other classes.
XclExpAddressConverter & GetAddressConverter() const
Returns the address converter.
SfxObjectShell * GetDocShell() const
Returns the object shell of the Calc document.
const tools::SvRef< SotStorage > & GetRootStorage() const
Returns the OLE2 root storage of the imported/exported file.
XclBiff GetBiff() const
Returns the current BIFF version of the importer/exporter.
RootData & GetOldRoot() const
Returns old RootData struct.
uno::Sequence< sal_Int8 > convertMetaFile(GDIMetaFile const *i_pThumb)
bool SaveOlePropertySet(const uno::Reference< document::XDocumentProperties > &i_xDocProps, SotStorage *i_pStorage, const uno::Sequence< sal_Int8 > *i_pThumb, const uno::Sequence< sal_Int8 > *i_pGuid, const uno::Sequence< sal_Int8 > *i_pHyperlinks)
#define SCWARN_EXPORT_MAXTAB
#define SCWARN_EXPORT_MAXCOL
#define SCWARN_EXPORT_MAXROW
Stores global buffers and data needed for Excel export filter.
@ EXC_BIFF8
MS Excel 5.0, MS Excel 7.0 (95)
constexpr OUStringLiteral EXC_STORAGE_VBA_PROJECT