Skip to content
Projeler
Gruplar
Parçacıklar
Yardım
Yükleniyor...
Oturum aç / Kaydol
Gezinmeyi değiştir
C
core
Proje
Proje
Ayrıntılar
Etkinlik
Cycle Analytics
Depo (repository)
Depo (repository)
Dosyalar
Kayıtlar (commit)
Dallar (branch)
Etiketler
Katkıda bulunanlar
Grafik
Karşılaştır
Grafikler
Konular (issue)
0
Konular (issue)
0
Liste
Pano
Etiketler
Kilometre Taşları
Birleştirme (merge) Talepleri
0
Birleştirme (merge) Talepleri
0
CI / CD
CI / CD
İş akışları (pipeline)
İşler
Zamanlamalar
Grafikler
Paketler
Paketler
Wiki
Wiki
Parçacıklar
Parçacıklar
Üyeler
Üyeler
Collapse sidebar
Close sidebar
Etkinlik
Grafik
Grafikler
Yeni bir konu (issue) oluştur
İşler
Kayıtlar (commit)
Konu (issue) Panoları
Kenar çubuğunu aç
LibreOffice
core
Commits
c7e4e197
Kaydet (Commit)
c7e4e197
authored
Eki 08, 2015
tarafından
Miklos Vajna
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
sot: prefix members of StgHeader
Change-Id: I4885ae825484afd53d7026a8d55a0ec8eddf4d86
üst
7ca450cb
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
112 additions
and
112 deletions
+112
-112
stgelem.cxx
sot/source/sdstor/stgelem.cxx
+86
-86
stgelem.hxx
sot/source/sdstor/stgelem.hxx
+26
-26
No files found.
sot/source/sdstor/stgelem.cxx
Dosyayı görüntüle @
c7e4e197
...
@@ -70,43 +70,43 @@ SvStream& WriteClsId( SvStream& r, const ClsId& rId )
...
@@ -70,43 +70,43 @@ SvStream& WriteClsId( SvStream& r, const ClsId& rId )
///////////////////////////// class StgHeader
///////////////////////////// class StgHeader
StgHeader
::
StgHeader
()
StgHeader
::
StgHeader
()
:
nVersion
(
0
)
:
m_
nVersion
(
0
)
,
nByteOrder
(
0
)
,
m_
nByteOrder
(
0
)
,
nPageSize
(
0
)
,
m_
nPageSize
(
0
)
,
nDataPageSize
(
0
)
,
m_
nDataPageSize
(
0
)
,
bDirty
(
sal_uInt8
(
false
)
)
,
m_
bDirty
(
sal_uInt8
(
false
)
)
,
nFATSize
(
0
)
,
m_
nFATSize
(
0
)
,
nTOCstrm
(
0
)
,
m_
nTOCstrm
(
0
)
,
nReserved
(
0
)
,
m_
nReserved
(
0
)
,
nThreshold
(
0
)
,
m_
nThreshold
(
0
)
,
nDataFAT
(
0
)
,
m_
nDataFAT
(
0
)
,
nDataFATSize
(
0
)
,
m_
nDataFATSize
(
0
)
,
nMasterChain
(
0
)
,
m_
nMasterChain
(
0
)
,
nMaster
(
0
)
,
m_
nMaster
(
0
)
{
{
memset
(
cSignature
,
0
,
sizeof
(
cSignature
)
);
memset
(
m_cSignature
,
0
,
sizeof
(
m_
cSignature
)
);
memset
(
&
aClsId
,
0
,
sizeof
(
ClsId
)
);
memset
(
&
m_
aClsId
,
0
,
sizeof
(
ClsId
)
);
memset
(
cReserved
,
0
,
sizeof
(
cReserved
)
);
memset
(
m_cReserved
,
0
,
sizeof
(
m_
cReserved
)
);
memset
(
nMasterFAT
,
0
,
sizeof
(
nMasterFAT
)
);
memset
(
m_nMasterFAT
,
0
,
sizeof
(
m_
nMasterFAT
)
);
}
}
void
StgHeader
::
Init
()
void
StgHeader
::
Init
()
{
{
memcpy
(
cSignature
,
cStgSignature
,
8
);
memcpy
(
m_
cSignature
,
cStgSignature
,
8
);
memset
(
&
aClsId
,
0
,
sizeof
(
ClsId
)
);
memset
(
&
m_
aClsId
,
0
,
sizeof
(
ClsId
)
);
nVersion
=
0x0003003B
;
m_
nVersion
=
0x0003003B
;
nByteOrder
=
0xFFFE
;
m_
nByteOrder
=
0xFFFE
;
nPageSize
=
9
;
// 512 bytes
m_
nPageSize
=
9
;
// 512 bytes
nDataPageSize
=
6
;
// 64 bytes
m_
nDataPageSize
=
6
;
// 64 bytes
bDirty
=
sal_uInt8
(
false
);
m_
bDirty
=
sal_uInt8
(
false
);
memset
(
cReserved
,
0
,
sizeof
(
cReserved
)
);
memset
(
m_cReserved
,
0
,
sizeof
(
m_
cReserved
)
);
nFATSize
=
0
;
m_
nFATSize
=
0
;
nTOCstrm
=
0
;
m_
nTOCstrm
=
0
;
nReserved
=
0
;
m_
nReserved
=
0
;
nThreshold
=
4096
;
m_
nThreshold
=
4096
;
nDataFAT
=
0
;
m_
nDataFAT
=
0
;
nDataFATSize
=
0
;
m_
nDataFATSize
=
0
;
nMasterChain
=
STG_EOF
;
m_
nMasterChain
=
STG_EOF
;
SetTOCStart
(
STG_EOF
);
SetTOCStart
(
STG_EOF
);
SetDataFATStart
(
STG_EOF
);
SetDataFATStart
(
STG_EOF
);
...
@@ -130,53 +130,53 @@ bool StgHeader::Load( StgIo& rIo )
...
@@ -130,53 +130,53 @@ bool StgHeader::Load( StgIo& rIo )
bool
StgHeader
::
Load
(
SvStream
&
r
)
bool
StgHeader
::
Load
(
SvStream
&
r
)
{
{
r
.
Seek
(
0L
);
r
.
Seek
(
0L
);
r
.
Read
(
cSignature
,
8
);
r
.
Read
(
m_
cSignature
,
8
);
ReadClsId
(
r
,
aClsId
);
// 08 Class ID
ReadClsId
(
r
,
m_
aClsId
);
// 08 Class ID
r
.
ReadInt32
(
nVersion
)
// 1A version number
r
.
ReadInt32
(
m_
nVersion
)
// 1A version number
.
ReadUInt16
(
nByteOrder
)
// 1C Unicode byte order indicator
.
ReadUInt16
(
m_
nByteOrder
)
// 1C Unicode byte order indicator
.
ReadInt16
(
nPageSize
)
// 1E 1 << nPageSize = block size
.
ReadInt16
(
m_
nPageSize
)
// 1E 1 << nPageSize = block size
.
ReadInt16
(
nDataPageSize
);
// 20 1 << this size == data block size
.
ReadInt16
(
m_
nDataPageSize
);
// 20 1 << this size == data block size
r
.
SeekRel
(
10
);
r
.
SeekRel
(
10
);
r
.
ReadInt32
(
nFATSize
)
// 2C total number of FAT pages
r
.
ReadInt32
(
m_
nFATSize
)
// 2C total number of FAT pages
.
ReadInt32
(
nTOCstrm
)
// 30 starting page for the TOC stream
.
ReadInt32
(
m_
nTOCstrm
)
// 30 starting page for the TOC stream
.
ReadInt32
(
nReserved
)
// 34
.
ReadInt32
(
m_
nReserved
)
// 34
.
ReadInt32
(
nThreshold
)
// 38 minimum file size for big data
.
ReadInt32
(
m_
nThreshold
)
// 38 minimum file size for big data
.
ReadInt32
(
nDataFAT
)
// 3C page # of 1st data FAT block
.
ReadInt32
(
m_
nDataFAT
)
// 3C page # of 1st data FAT block
.
ReadInt32
(
nDataFATSize
)
// 40 # of data FATpages
.
ReadInt32
(
m_
nDataFATSize
)
// 40 # of data FATpages
.
ReadInt32
(
nMasterChain
)
// 44 chain to the next master block
.
ReadInt32
(
m_
nMasterChain
)
// 44 chain to the next master block
.
ReadInt32
(
nMaster
);
// 48 # of additional master blocks
.
ReadInt32
(
m_
nMaster
);
// 48 # of additional master blocks
for
(
short
i
=
0
;
i
<
cFATPagesInHeader
;
i
++
)
for
(
short
i
=
0
;
i
<
cFATPagesInHeader
;
i
++
)
r
.
ReadInt32
(
nMasterFAT
[
i
]
);
r
.
ReadInt32
(
m_
nMasterFAT
[
i
]
);
return
(
r
.
GetErrorCode
()
==
ERRCODE_NONE
)
&&
Check
();
return
(
r
.
GetErrorCode
()
==
ERRCODE_NONE
)
&&
Check
();
}
}
bool
StgHeader
::
Store
(
StgIo
&
rIo
)
bool
StgHeader
::
Store
(
StgIo
&
rIo
)
{
{
if
(
!
bDirty
)
if
(
!
m_
bDirty
)
return
true
;
return
true
;
SvStream
&
r
=
*
rIo
.
GetStrm
();
SvStream
&
r
=
*
rIo
.
GetStrm
();
r
.
Seek
(
0L
);
r
.
Seek
(
0L
);
r
.
Write
(
cSignature
,
8
);
r
.
Write
(
m_
cSignature
,
8
);
WriteClsId
(
r
,
aClsId
);
// 08 Class ID
WriteClsId
(
r
,
m_
aClsId
);
// 08 Class ID
r
.
WriteInt32
(
nVersion
)
// 1A version number
r
.
WriteInt32
(
m_
nVersion
)
// 1A version number
.
WriteUInt16
(
nByteOrder
)
// 1C Unicode byte order indicator
.
WriteUInt16
(
m_
nByteOrder
)
// 1C Unicode byte order indicator
.
WriteInt16
(
nPageSize
)
// 1E 1 << nPageSize = block size
.
WriteInt16
(
m_
nPageSize
)
// 1E 1 << nPageSize = block size
.
WriteInt16
(
nDataPageSize
)
// 20 1 << this size == data block size
.
WriteInt16
(
m_
nDataPageSize
)
// 20 1 << this size == data block size
.
WriteInt32
(
0
).
WriteInt32
(
0
).
WriteInt16
(
0
)
.
WriteInt32
(
0
).
WriteInt32
(
0
).
WriteInt16
(
0
)
.
WriteInt32
(
nFATSize
)
// 2C total number of FAT pages
.
WriteInt32
(
m_
nFATSize
)
// 2C total number of FAT pages
.
WriteInt32
(
nTOCstrm
)
// 30 starting page for the TOC stream
.
WriteInt32
(
m_
nTOCstrm
)
// 30 starting page for the TOC stream
.
WriteInt32
(
nReserved
)
// 34
.
WriteInt32
(
m_
nReserved
)
// 34
.
WriteInt32
(
nThreshold
)
// 38 minimum file size for big data
.
WriteInt32
(
m_
nThreshold
)
// 38 minimum file size for big data
.
WriteInt32
(
nDataFAT
)
// 3C page # of 1st data FAT block
.
WriteInt32
(
m_
nDataFAT
)
// 3C page # of 1st data FAT block
.
WriteInt32
(
nDataFATSize
)
// 40 # of data FAT pages
.
WriteInt32
(
m_
nDataFATSize
)
// 40 # of data FAT pages
.
WriteInt32
(
nMasterChain
)
// 44 chain to the next master block
.
WriteInt32
(
m_
nMasterChain
)
// 44 chain to the next master block
.
WriteInt32
(
nMaster
);
// 48 # of additional master blocks
.
WriteInt32
(
m_
nMaster
);
// 48 # of additional master blocks
for
(
short
i
=
0
;
i
<
cFATPagesInHeader
;
i
++
)
for
(
short
i
=
0
;
i
<
cFATPagesInHeader
;
i
++
)
r
.
WriteInt32
(
nMasterFAT
[
i
]
);
r
.
WriteInt32
(
m_
nMasterFAT
[
i
]
);
bDirty
=
sal_uInt8
(
!
rIo
.
Good
());
m_
bDirty
=
sal_uInt8
(
!
rIo
.
Good
());
return
!
bDirty
;
return
!
m_
bDirty
;
}
}
static
bool
lcl_wontoverflow
(
short
shift
)
static
bool
lcl_wontoverflow
(
short
shift
)
...
@@ -195,23 +195,23 @@ static bool isKnownSpecial(sal_Int32 nLocation)
...
@@ -195,23 +195,23 @@ static bool isKnownSpecial(sal_Int32 nLocation)
// Perform thorough checks also on unknown variables
// Perform thorough checks also on unknown variables
bool
StgHeader
::
Check
()
bool
StgHeader
::
Check
()
{
{
return
memcmp
(
cSignature
,
cStgSignature
,
8
)
==
0
return
memcmp
(
m_
cSignature
,
cStgSignature
,
8
)
==
0
&&
(
short
)
(
nVersion
>>
16
)
==
3
&&
(
short
)
(
m_
nVersion
>>
16
)
==
3
&&
nPageSize
==
9
&&
m_
nPageSize
==
9
&&
lcl_wontoverflow
(
nPageSize
)
&&
lcl_wontoverflow
(
m_
nPageSize
)
&&
lcl_wontoverflow
(
nDataPageSize
)
&&
lcl_wontoverflow
(
m_
nDataPageSize
)
&&
nFATSize
>
0
&&
m_
nFATSize
>
0
&&
nTOCstrm
>=
0
&&
m_
nTOCstrm
>=
0
&&
nThreshold
>
0
&&
m_
nThreshold
>
0
&&
(
isKnownSpecial
(
nDataFAT
)
||
(
nDataFAT
>=
0
&&
nDataFATSize
>
0
)
)
&&
(
isKnownSpecial
(
m_nDataFAT
)
||
(
m_nDataFAT
>=
0
&&
m_
nDataFATSize
>
0
)
)
&&
(
isKnownSpecial
(
nMasterChain
)
||
nMasterChain
>=
0
)
&&
(
isKnownSpecial
(
m_nMasterChain
)
||
m_
nMasterChain
>=
0
)
&&
nMaster
>=
0
;
&&
m_
nMaster
>=
0
;
}
}
sal_Int32
StgHeader
::
GetFATPage
(
short
n
)
const
sal_Int32
StgHeader
::
GetFATPage
(
short
n
)
const
{
{
if
(
n
>=
0
&&
n
<
cFATPagesInHeader
)
if
(
n
>=
0
&&
n
<
cFATPagesInHeader
)
return
nMasterFAT
[
n
];
return
m_
nMasterFAT
[
n
];
else
else
return
STG_EOF
;
return
STG_EOF
;
}
}
...
@@ -220,40 +220,40 @@ void StgHeader::SetFATPage( short n, sal_Int32 nb )
...
@@ -220,40 +220,40 @@ void StgHeader::SetFATPage( short n, sal_Int32 nb )
{
{
if
(
n
>=
0
&&
n
<
cFATPagesInHeader
)
if
(
n
>=
0
&&
n
<
cFATPagesInHeader
)
{
{
if
(
nMasterFAT
[
n
]
!=
nb
)
if
(
m_
nMasterFAT
[
n
]
!=
nb
)
bDirty
=
sal_uInt8
(
true
),
nMasterFAT
[
n
]
=
nb
;
m_bDirty
=
sal_uInt8
(
true
),
m_
nMasterFAT
[
n
]
=
nb
;
}
}
}
}
void
StgHeader
::
SetTOCStart
(
sal_Int32
n
)
void
StgHeader
::
SetTOCStart
(
sal_Int32
n
)
{
{
if
(
n
!=
nTOCstrm
)
bDirty
=
sal_uInt8
(
true
),
nTOCstrm
=
n
;
if
(
n
!=
m_nTOCstrm
)
m_bDirty
=
sal_uInt8
(
true
),
m_
nTOCstrm
=
n
;
}
}
void
StgHeader
::
SetDataFATStart
(
sal_Int32
n
)
void
StgHeader
::
SetDataFATStart
(
sal_Int32
n
)
{
{
if
(
n
!=
nDataFAT
)
bDirty
=
sal_uInt8
(
true
),
nDataFAT
=
n
;
if
(
n
!=
m_nDataFAT
)
m_bDirty
=
sal_uInt8
(
true
),
m_
nDataFAT
=
n
;
}
}
void
StgHeader
::
SetDataFATSize
(
sal_Int32
n
)
void
StgHeader
::
SetDataFATSize
(
sal_Int32
n
)
{
{
if
(
n
!=
nDataFATSize
)
bDirty
=
sal_uInt8
(
true
),
nDataFATSize
=
n
;
if
(
n
!=
m_nDataFATSize
)
m_bDirty
=
sal_uInt8
(
true
),
m_
nDataFATSize
=
n
;
}
}
void
StgHeader
::
SetFATSize
(
sal_Int32
n
)
void
StgHeader
::
SetFATSize
(
sal_Int32
n
)
{
{
if
(
n
!=
nFATSize
)
bDirty
=
sal_uInt8
(
true
),
nFATSize
=
n
;
if
(
n
!=
m_nFATSize
)
m_bDirty
=
sal_uInt8
(
true
),
m_
nFATSize
=
n
;
}
}
void
StgHeader
::
SetFATChain
(
sal_Int32
n
)
void
StgHeader
::
SetFATChain
(
sal_Int32
n
)
{
{
if
(
n
!=
nMasterChain
)
if
(
n
!=
m_
nMasterChain
)
bDirty
=
sal_uInt8
(
true
),
nMasterChain
=
n
;
m_bDirty
=
sal_uInt8
(
true
),
m_
nMasterChain
=
n
;
}
}
void
StgHeader
::
SetMasters
(
sal_Int32
n
)
void
StgHeader
::
SetMasters
(
sal_Int32
n
)
{
{
if
(
n
!=
nMaster
)
bDirty
=
sal_uInt8
(
true
),
nMaster
=
n
;
if
(
n
!=
m_nMaster
)
m_bDirty
=
sal_uInt8
(
true
),
m_
nMaster
=
n
;
}
}
///////////////////////////// class StgEntry
///////////////////////////// class StgEntry
...
...
sot/source/sdstor/stgelem.hxx
Dosyayı görüntüle @
c7e4e197
...
@@ -35,25 +35,25 @@ class StgHeader
...
@@ -35,25 +35,25 @@ class StgHeader
{
{
static
const
sal_uInt8
cFATPagesInHeader
=
109
;
static
const
sal_uInt8
cFATPagesInHeader
=
109
;
sal_uInt8
cSignature
[
8
];
// 00 signature (see below)
sal_uInt8
m_
cSignature
[
8
];
// 00 signature (see below)
ClsId
aClsId
;
// 08 Class ID
ClsId
m_
aClsId
;
// 08 Class ID
sal_Int32
nVersion
;
// 18 version number
sal_Int32
m_
nVersion
;
// 18 version number
sal_uInt16
nByteOrder
;
// 1C Unicode byte order indicator
sal_uInt16
m_
nByteOrder
;
// 1C Unicode byte order indicator
sal_Int16
nPageSize
;
// 1E 1 << nPageSize = block size
sal_Int16
m_
nPageSize
;
// 1E 1 << nPageSize = block size
sal_Int16
nDataPageSize
;
// 20 1 << this size == data block size
sal_Int16
m_
nDataPageSize
;
// 20 1 << this size == data block size
sal_uInt8
bDirty
;
// 22 internal dirty flag (should be
sal_uInt8
m_
bDirty
;
// 22 internal dirty flag (should be
// bool, but probably required to
// bool, but probably required to
// be exactly one byte)
// be exactly one byte)
sal_uInt8
cReserved
[
9
];
// 23
sal_uInt8
m_
cReserved
[
9
];
// 23
sal_Int32
nFATSize
;
// 2C total number of FAT pages
sal_Int32
m_
nFATSize
;
// 2C total number of FAT pages
sal_Int32
nTOCstrm
;
// 30 starting page for the TOC stream
sal_Int32
m_
nTOCstrm
;
// 30 starting page for the TOC stream
sal_Int32
nReserved
;
// 34
sal_Int32
m_
nReserved
;
// 34
sal_Int32
nThreshold
;
// 38 minimum file size for big data
sal_Int32
m_
nThreshold
;
// 38 minimum file size for big data
sal_Int32
nDataFAT
;
// 3C page # of 1st data FAT block
sal_Int32
m_
nDataFAT
;
// 3C page # of 1st data FAT block
sal_Int32
nDataFATSize
;
// 40 # of data fat blocks
sal_Int32
m_
nDataFATSize
;
// 40 # of data fat blocks
sal_Int32
nMasterChain
;
// 44 chain to the next master block
sal_Int32
m_
nMasterChain
;
// 44 chain to the next master block
sal_Int32
nMaster
;
// 48 # of additional master blocks
sal_Int32
m_
nMaster
;
// 48 # of additional master blocks
sal_Int32
nMasterFAT
[
cFATPagesInHeader
];
// 4C first [cFATPagesInHeader] master FAT pages
sal_Int32
m_
nMasterFAT
[
cFATPagesInHeader
];
// 4C first [cFATPagesInHeader] master FAT pages
public
:
public
:
StgHeader
();
StgHeader
();
...
@@ -62,20 +62,20 @@ public:
...
@@ -62,20 +62,20 @@ public:
bool
Load
(
SvStream
&
);
bool
Load
(
SvStream
&
);
bool
Store
(
StgIo
&
);
bool
Store
(
StgIo
&
);
bool
Check
();
// check the signature and version
bool
Check
();
// check the signature and version
sal_Int32
GetTOCStart
()
const
{
return
nTOCstrm
;
}
sal_Int32
GetTOCStart
()
const
{
return
m_
nTOCstrm
;
}
void
SetTOCStart
(
sal_Int32
n
);
void
SetTOCStart
(
sal_Int32
n
);
sal_Int32
GetDataFATStart
()
const
{
return
nDataFAT
;
}
sal_Int32
GetDataFATStart
()
const
{
return
m_
nDataFAT
;
}
void
SetDataFATStart
(
sal_Int32
n
);
void
SetDataFATStart
(
sal_Int32
n
);
sal_Int32
GetDataFATSize
()
const
{
return
nDataFATSize
;
}
sal_Int32
GetDataFATSize
()
const
{
return
m_
nDataFATSize
;
}
void
SetDataFATSize
(
sal_Int32
n
);
void
SetDataFATSize
(
sal_Int32
n
);
sal_Int32
GetThreshold
()
const
{
return
nThreshold
;
}
sal_Int32
GetThreshold
()
const
{
return
m_
nThreshold
;
}
short
GetPageSize
()
const
{
return
nPageSize
;
}
short
GetPageSize
()
const
{
return
m_
nPageSize
;
}
short
GetDataPageSize
()
const
{
return
nDataPageSize
;
}
short
GetDataPageSize
()
const
{
return
m_
nDataPageSize
;
}
sal_Int32
GetFATSize
()
const
{
return
nFATSize
;
}
sal_Int32
GetFATSize
()
const
{
return
m_
nFATSize
;
}
void
SetFATSize
(
sal_Int32
n
);
void
SetFATSize
(
sal_Int32
n
);
sal_Int32
GetFATChain
()
const
{
return
nMasterChain
;
}
sal_Int32
GetFATChain
()
const
{
return
m_
nMasterChain
;
}
void
SetFATChain
(
sal_Int32
n
);
void
SetFATChain
(
sal_Int32
n
);
sal_Int32
GetMasters
()
const
{
return
nMaster
;
}
sal_Int32
GetMasters
()
const
{
return
m_
nMaster
;
}
void
SetMasters
(
sal_Int32
n
);
void
SetMasters
(
sal_Int32
n
);
static
short
GetFAT1Size
()
{
return
cFATPagesInHeader
;
}
static
short
GetFAT1Size
()
{
return
cFATPagesInHeader
;
}
sal_Int32
GetFATPage
(
short
)
const
;
sal_Int32
GetFATPage
(
short
)
const
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment