00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033
00034
00035
00036
00037 #include "precompiled_starmath.hxx"
00038
00039 #ifndef __EQNOLEFILEHDR_HXX__
00040 #include "eqnolefilehdr.hxx"
00041 #endif
00042
00043 #ifndef _SOT_STORAGE_HXX
00044 #include <sot/storage.hxx>
00045 #endif
00046
00048
00049 void EQNOLEFILEHDR::Read(SvStorageStream *pS)
00050 {
00051 *pS >> nCBHdr;
00052 *pS >> nVersion;
00053 *pS >> nCf;
00054 *pS >> nCBObject;
00055 *pS >> nReserved1;
00056 *pS >> nReserved2;
00057 *pS >> nReserved3;
00058 *pS >> nReserved4;
00059 }
00060
00061
00062 void EQNOLEFILEHDR::Write(SvStorageStream *pS)
00063 {
00064 *pS << nCBHdr;
00065 *pS << nVersion;
00066 *pS << nCf;
00067 *pS << nCBObject;
00068 *pS << nReserved1;
00069 *pS << nReserved2;
00070 *pS << nReserved3;
00071 *pS << nReserved4;
00072 }
00073
00074
00075 sal_Bool GetMathTypeVersion( SotStorage* pStor, sal_uInt8 &nVersion )
00076 {
00077 sal_uInt8 nVer = 0;
00078 sal_Bool bSuccess = sal_False;
00079
00080
00081
00082
00083 SvStorageStreamRef xSrc = pStor->OpenSotStream(
00084 String::CreateFromAscii("Equation Native"),
00085 STREAM_STD_READ | STREAM_NOCREATE);
00086 if ( (!xSrc.Is()) || (SVSTREAM_OK != xSrc->GetError()))
00087 return bSuccess;
00088 SvStorageStream *pS = &xSrc;
00089 pS->SetNumberFormatInt( NUMBERFORMAT_INT_LITTLEENDIAN );
00090
00091 EQNOLEFILEHDR aHdr;
00092 aHdr.Read(pS);
00093 *pS >> nVer;
00094
00095 if (!pS->GetError())
00096 {
00097 nVersion = nVer;
00098 bSuccess = sal_True;
00099 }
00100 return bSuccess;
00101 }
00102
00104