diff options
Diffstat (limited to 'basic/source/inc/image.hxx')
-rw-r--r-- | basic/source/inc/image.hxx | 26 |
1 files changed, 12 insertions, 14 deletions
diff --git a/basic/source/inc/image.hxx b/basic/source/inc/image.hxx index ee1aaa4168b6..5a4522bd91bf 100644 --- a/basic/source/inc/image.hxx +++ b/basic/source/inc/image.hxx @@ -17,13 +17,14 @@ * the License at http://www.apache.org/licenses/LICENSE-2.0 . */ -#ifndef INCLUDED_BASIC_SOURCE_INC_IMAGE_HXX -#define INCLUDED_BASIC_SOURCE_INC_IMAGE_HXX +#pragma once #include <basic/sbx.hxx> #include <rtl/ustring.hxx> #include "filefmt.hxx" #include <o3tl/typed_flags_set.hxx> +#include <cstddef> +#include <vector> // This class reads in the image that's been produced by the compiler // and manages the access to the single elements. @@ -48,22 +49,20 @@ class SbiImage { SbxArrayRef rEnums; // Enum types std::vector<sal_uInt32> mvStringOffsets; // StringId-Offsets std::unique_ptr<sal_Unicode[]> pStrings; // StringPool - std::unique_ptr<char[]> pCode; // Code-Image - std::unique_ptr<char[]> pLegacyPCode; // Code-Image + std::vector<sal_uInt8> aCode; // Code-Image + std::vector<sal_uInt8> aLegacyPCode; // Code-Image bool bError; SbiImageFlags nFlags; sal_uInt32 nStringSize; - sal_uInt32 nCodeSize; - sal_uInt16 nLegacyCodeSize; sal_uInt16 nDimBase; // OPTION BASE value rtl_TextEncoding eCharSet; // temporary management-variable: - short nStringIdx; + std::size_t nStringIdx; sal_uInt32 nStringOff; // current Pos in the stringbuffer // routines for the compiler: void MakeStrings( short ); // establish StringPool void AddString( const OUString& ); - void AddCode( std::unique_ptr<char[]>, sal_uInt32 ); + void AddCode(std::vector<sal_uInt8>&&); void AddType(SbxObject const *); void AddEnum(SbxObject *); @@ -80,13 +79,13 @@ public: bool Load( SvStream&, sal_uInt32& nVer ); // nVer is set to version // of image - bool Save( SvStream&, sal_uInt32 = B_CURVERSION ); + bool Save( SvStream&, sal_uInt32 ); bool IsError() const { return bError; } - const char* GetCode() const { return pCode.get(); } - sal_uInt32 GetCodeSize() const { return nCodeSize; } + const sal_uInt8* GetCode() const { return aCode.data(); } + sal_uInt32 GetCodeSize() const { return aCode.size(); } sal_uInt16 GetBase() const { return nDimBase; } - OUString GetString( short nId ) const; + OUString GetString( sal_uInt32 nId, SbxDataType *eType = nullptr ) const; const SbxObject* FindType (const OUString& aTypeName) const; const SbxArrayRef& GetEnums() const { return rEnums; } @@ -97,8 +96,7 @@ public: sal_uInt32 CalcNewOffset( sal_Int16 nOffset ); void ReleaseLegacyBuffer(); bool ExceedsLegacyLimits(); + bool ExceedsImgVersion12Limits(); }; -#endif - /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ |