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
3f7d7a21
Kaydet (Commit)
3f7d7a21
authored
Eki 13, 2015
tarafından
Miklos Vajna
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
sot: prefix remaining StgStrm members
Change-Id: I2a70543bf3137f8d5a76e610a2aff6a3a3fcab4e
üst
11b3555e
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
33 additions
and
33 deletions
+33
-33
stgdir.cxx
sot/source/sdstor/stgdir.cxx
+22
-22
stgstrms.cxx
sot/source/sdstor/stgstrms.cxx
+0
-0
stgstrms.hxx
sot/source/sdstor/stgstrms.hxx
+11
-11
No files found.
sot/source/sdstor/stgdir.cxx
Dosyayı görüntüle @
3f7d7a21
...
@@ -725,8 +725,8 @@ StgDirStrm::StgDirStrm( StgIo& r )
...
@@ -725,8 +725,8 @@ StgDirStrm::StgDirStrm( StgIo& r )
{
{
if
(
r
.
GetError
()
)
if
(
r
.
GetError
()
)
return
;
return
;
m_nEntries
=
nPageSize
/
STGENTRY_SIZE
;
m_nEntries
=
m_
nPageSize
/
STGENTRY_SIZE
;
if
(
nStart
==
STG_EOF
)
if
(
m_
nStart
==
STG_EOF
)
{
{
StgEntry
aRoot
;
StgEntry
aRoot
;
aRoot
.
Init
();
aRoot
.
Init
();
...
@@ -739,9 +739,9 @@ StgDirStrm::StgDirStrm( StgIo& r )
...
@@ -739,9 +739,9 @@ StgDirStrm::StgDirStrm( StgIo& r )
{
{
// temporarily use this instance as owner, so
// temporarily use this instance as owner, so
// the TOC pages can be removed.
// the TOC pages can be removed.
pEntry
=
reinterpret_cast
<
StgDirEntry
*>
(
this
);
// just for a bit pattern
m_
pEntry
=
reinterpret_cast
<
StgDirEntry
*>
(
this
);
// just for a bit pattern
SetupEntry
(
0
,
m_pRoot
);
SetupEntry
(
0
,
m_pRoot
);
pEntry
=
NULL
;
m_
pEntry
=
NULL
;
}
}
}
}
...
@@ -757,7 +757,7 @@ void StgDirStrm::SetupEntry( sal_Int32 n, StgDirEntry* pUpper )
...
@@ -757,7 +757,7 @@ void StgDirStrm::SetupEntry( sal_Int32 n, StgDirEntry* pUpper )
void
*
p
=
(
n
==
STG_FREE
)
?
NULL
:
GetEntry
(
n
);
void
*
p
=
(
n
==
STG_FREE
)
?
NULL
:
GetEntry
(
n
);
if
(
p
)
if
(
p
)
{
{
SvStream
*
pUnderlyingStream
=
rIo
.
GetStrm
();
SvStream
*
pUnderlyingStream
=
m_
rIo
.
GetStrm
();
sal_uInt64
nCur
=
pUnderlyingStream
->
Tell
();
sal_uInt64
nCur
=
pUnderlyingStream
->
Tell
();
sal_uInt64
nUnderlyingStreamSize
=
pUnderlyingStream
->
Seek
(
STREAM_SEEK_TO_END
);
sal_uInt64
nUnderlyingStreamSize
=
pUnderlyingStream
->
Seek
(
STREAM_SEEK_TO_END
);
pUnderlyingStream
->
Seek
(
nCur
);
pUnderlyingStream
->
Seek
(
nCur
);
...
@@ -768,7 +768,7 @@ void StgDirStrm::SetupEntry( sal_Int32 n, StgDirEntry* pUpper )
...
@@ -768,7 +768,7 @@ void StgDirStrm::SetupEntry( sal_Int32 n, StgDirEntry* pUpper )
if
(
!
bOk
)
if
(
!
bOk
)
{
{
delete
pCur
;
delete
pCur
;
rIo
.
SetError
(
SVSTREAM_GENERALERROR
);
m_
rIo
.
SetError
(
SVSTREAM_GENERALERROR
);
// an error occurred
// an error occurred
return
;
return
;
}
}
...
@@ -787,7 +787,7 @@ void StgDirStrm::SetupEntry( sal_Int32 n, StgDirEntry* pUpper )
...
@@ -787,7 +787,7 @@ void StgDirStrm::SetupEntry( sal_Int32 n, StgDirEntry* pUpper )
if
(
nLeaf
!=
STG_FREE
&&
nLeaf
==
n
)
if
(
nLeaf
!=
STG_FREE
&&
nLeaf
==
n
)
{
{
delete
pCur
;
delete
pCur
;
rIo
.
SetError
(
SVSTREAM_GENERALERROR
);
m_
rIo
.
SetError
(
SVSTREAM_GENERALERROR
);
return
;
return
;
}
}
}
}
...
@@ -847,7 +847,7 @@ bool StgDirStrm::SetSize( sal_Int32 nBytes )
...
@@ -847,7 +847,7 @@ bool StgDirStrm::SetSize( sal_Int32 nBytes )
if
(
nBytes
<
0
)
if
(
nBytes
<
0
)
nBytes
=
0
;
nBytes
=
0
;
nBytes
=
(
(
nBytes
+
nPageSize
-
1
)
/
nPageSize
)
*
nPageSize
;
nBytes
=
(
(
nBytes
+
m_nPageSize
-
1
)
/
m_nPageSize
)
*
m_
nPageSize
;
return
StgStrm
::
SetSize
(
nBytes
);
return
StgStrm
::
SetSize
(
nBytes
);
}
}
...
@@ -857,16 +857,16 @@ bool StgDirStrm::Store()
...
@@ -857,16 +857,16 @@ bool StgDirStrm::Store()
{
{
if
(
!
m_pRoot
||
!
m_pRoot
->
IsDirty
()
)
if
(
!
m_pRoot
||
!
m_pRoot
->
IsDirty
()
)
return
true
;
return
true
;
if
(
!
m_pRoot
->
StoreStreams
(
rIo
)
)
if
(
!
m_pRoot
->
StoreStreams
(
m_
rIo
)
)
return
false
;
return
false
;
// After writing all streams, the data FAT stream has changed,
// After writing all streams, the data FAT stream has changed,
// so we have to commit the root again
// so we have to commit the root again
m_pRoot
->
Commit
();
m_pRoot
->
Commit
();
// We want a completely new stream, so fake an empty stream
// We want a completely new stream, so fake an empty stream
sal_Int32
nOldStart
=
nStart
;
// save for later deletion
sal_Int32
nOldStart
=
m_
nStart
;
// save for later deletion
sal_Int32
nOldSize
=
nSize
;
sal_Int32
nOldSize
=
m_
nSize
;
nStart
=
nPage
=
STG_EOF
;
m_nStart
=
m_
nPage
=
STG_EOF
;
nSize
=
m_nPos
=
0
;
m_
nSize
=
m_nPos
=
0
;
m_nOffset
=
0
;
m_nOffset
=
0
;
// Delete all temporary entries
// Delete all temporary entries
m_pRoot
->
DelTemp
(
false
);
m_pRoot
->
DelTemp
(
false
);
...
@@ -875,12 +875,12 @@ bool StgDirStrm::Store()
...
@@ -875,12 +875,12 @@ bool StgDirStrm::Store()
m_pRoot
->
Enum
(
n
);
m_pRoot
->
Enum
(
n
);
if
(
!
SetSize
(
n
*
STGENTRY_SIZE
)
)
if
(
!
SetSize
(
n
*
STGENTRY_SIZE
)
)
{
{
nStart
=
nOldStart
;
nSize
=
nOldSize
;
m_nStart
=
nOldStart
;
m_
nSize
=
nOldSize
;
m_pRoot
->
RevertAll
();
m_pRoot
->
RevertAll
();
return
false
;
return
false
;
}
}
// set up the cache elements for the new stream
// set up the cache elements for the new stream
if
(
!
Copy
(
STG_FREE
,
nSize
)
)
if
(
!
Copy
(
STG_FREE
,
m_
nSize
)
)
{
{
m_pRoot
->
RevertAll
();
m_pRoot
->
RevertAll
();
return
false
;
return
false
;
...
@@ -892,7 +892,7 @@ bool StgDirStrm::Store()
...
@@ -892,7 +892,7 @@ bool StgDirStrm::Store()
return
false
;
return
false
;
}
}
// fill any remaining entries with empty data
// fill any remaining entries with empty data
sal_Int32
ne
=
nSize
/
STGENTRY_SIZE
;
sal_Int32
ne
=
m_
nSize
/
STGENTRY_SIZE
;
StgEntry
aEmpty
;
StgEntry
aEmpty
;
aEmpty
.
Init
();
aEmpty
.
Init
();
while
(
n
<
ne
)
while
(
n
<
ne
)
...
@@ -907,7 +907,7 @@ bool StgDirStrm::Store()
...
@@ -907,7 +907,7 @@ bool StgDirStrm::Store()
}
}
// Now we can release the old stream
// Now we can release the old stream
m_pFat
->
FreePages
(
nOldStart
,
true
);
m_pFat
->
FreePages
(
nOldStart
,
true
);
rIo
.
m_aHdr
.
SetTOCStart
(
nStart
);
m_rIo
.
m_aHdr
.
SetTOCStart
(
m_
nStart
);
return
true
;
return
true
;
}
}
...
@@ -915,7 +915,7 @@ bool StgDirStrm::Store()
...
@@ -915,7 +915,7 @@ bool StgDirStrm::Store()
void
*
StgDirStrm
::
GetEntry
(
sal_Int32
n
,
bool
bDirty
)
void
*
StgDirStrm
::
GetEntry
(
sal_Int32
n
,
bool
bDirty
)
{
{
return
n
<
0
||
n
>=
nSize
/
STGENTRY_SIZE
return
n
<
0
||
n
>=
m_
nSize
/
STGENTRY_SIZE
?
NULL
:
GetPtr
(
n
*
STGENTRY_SIZE
,
true
,
bDirty
);
?
NULL
:
GetPtr
(
n
*
STGENTRY_SIZE
,
true
,
bDirty
);
}
}
...
@@ -929,7 +929,7 @@ StgDirEntry* StgDirStrm::Find( StgDirEntry& rStg, const OUString& rName )
...
@@ -929,7 +929,7 @@ StgDirEntry* StgDirStrm::Find( StgDirEntry& rStg, const OUString& rName )
aEntry
.
Init
();
aEntry
.
Init
();
if
(
!
aEntry
.
SetName
(
rName
)
)
if
(
!
aEntry
.
SetName
(
rName
)
)
{
{
rIo
.
SetError
(
SVSTREAM_GENERALERROR
);
m_
rIo
.
SetError
(
SVSTREAM_GENERALERROR
);
return
NULL
;
return
NULL
;
}
}
// Look in the directory attached to the entry
// Look in the directory attached to the entry
...
@@ -949,7 +949,7 @@ StgDirEntry* StgDirStrm::Create( StgDirEntry& rStg, const OUString& rName, StgEn
...
@@ -949,7 +949,7 @@ StgDirEntry* StgDirStrm::Create( StgDirEntry& rStg, const OUString& rName, StgEn
aEntry
.
SetType
(
eType
);
aEntry
.
SetType
(
eType
);
if
(
!
aEntry
.
SetName
(
rName
)
)
if
(
!
aEntry
.
SetName
(
rName
)
)
{
{
rIo
.
SetError
(
SVSTREAM_GENERALERROR
);
m_
rIo
.
SetError
(
SVSTREAM_GENERALERROR
);
return
NULL
;
return
NULL
;
}
}
StgDirEntry
*
pRes
=
Find
(
rStg
,
rName
);
StgDirEntry
*
pRes
=
Find
(
rStg
,
rName
);
...
@@ -957,7 +957,7 @@ StgDirEntry* StgDirStrm::Create( StgDirEntry& rStg, const OUString& rName, StgEn
...
@@ -957,7 +957,7 @@ StgDirEntry* StgDirStrm::Create( StgDirEntry& rStg, const OUString& rName, StgEn
{
{
if
(
!
pRes
->
m_bInvalid
)
if
(
!
pRes
->
m_bInvalid
)
{
{
rIo
.
SetError
(
SVSTREAM_CANNOT_MAKE
);
m_
rIo
.
SetError
(
SVSTREAM_CANNOT_MAKE
);
return
NULL
;
return
NULL
;
}
}
pRes
->
m_bInvalid
=
pRes
->
m_bInvalid
=
...
@@ -978,7 +978,7 @@ StgDirEntry* StgDirStrm::Create( StgDirEntry& rStg, const OUString& rName, StgEn
...
@@ -978,7 +978,7 @@ StgDirEntry* StgDirStrm::Create( StgDirEntry& rStg, const OUString& rName, StgEn
}
}
else
else
{
{
rIo
.
SetError
(
SVSTREAM_CANNOT_MAKE
);
m_
rIo
.
SetError
(
SVSTREAM_CANNOT_MAKE
);
delete
pRes
;
pRes
=
NULL
;
delete
pRes
;
pRes
=
NULL
;
}
}
}
}
...
...
sot/source/sdstor/stgstrms.cxx
Dosyayı görüntüle @
3f7d7a21
This diff is collapsed.
Click to expand it.
sot/source/sdstor/stgstrms.hxx
Dosyayı görüntüle @
3f7d7a21
...
@@ -61,27 +61,27 @@ public:
...
@@ -61,27 +61,27 @@ public:
class
StgStrm
{
// base class for all streams
class
StgStrm
{
// base class for all streams
protected
:
protected
:
StgIo
&
rIo
;
// I/O system
StgIo
&
m_
rIo
;
// I/O system
StgFAT
*
m_pFat
;
// FAT stream for allocations
StgFAT
*
m_pFat
;
// FAT stream for allocations
StgDirEntry
*
pEntry
;
// dir entry (for ownership)
StgDirEntry
*
m_
pEntry
;
// dir entry (for ownership)
sal_Int32
nStart
;
// 1st data page
sal_Int32
m_
nStart
;
// 1st data page
sal_Int32
nSize
;
// stream size in bytes
sal_Int32
m_
nSize
;
// stream size in bytes
sal_Int32
m_nPos
;
// current byte position
sal_Int32
m_nPos
;
// current byte position
sal_Int32
nPage
;
// current logical page
sal_Int32
m_
nPage
;
// current logical page
short
m_nOffset
;
// offset into current page
short
m_nOffset
;
// offset into current page
short
nPageSize
;
// logical page size
short
m_
nPageSize
;
// logical page size
std
::
vector
<
sal_Int32
>
m_aPagesCache
;
std
::
vector
<
sal_Int32
>
m_aPagesCache
;
void
scanBuildPageChainCache
(
sal_Int32
*
pOptionalCalcSize
=
NULL
);
void
scanBuildPageChainCache
(
sal_Int32
*
pOptionalCalcSize
=
NULL
);
bool
Copy
(
sal_Int32
nFrom
,
sal_Int32
nBytes
);
bool
Copy
(
sal_Int32
nFrom
,
sal_Int32
nBytes
);
explicit
StgStrm
(
StgIo
&
);
explicit
StgStrm
(
StgIo
&
);
public
:
public
:
virtual
~
StgStrm
();
virtual
~
StgStrm
();
StgIo
&
GetIo
()
{
return
rIo
;
}
StgIo
&
GetIo
()
{
return
m_
rIo
;
}
sal_Int32
GetPos
()
const
{
return
m_nPos
;
}
sal_Int32
GetPos
()
const
{
return
m_nPos
;
}
sal_Int32
GetStart
()
const
{
return
nStart
;
}
sal_Int32
GetStart
()
const
{
return
m_
nStart
;
}
sal_Int32
GetSize
()
const
{
return
nSize
;
}
sal_Int32
GetSize
()
const
{
return
m_
nSize
;
}
sal_Int32
GetPage
()
const
{
return
nPage
;
}
sal_Int32
GetPage
()
const
{
return
m_
nPage
;
}
sal_Int32
GetPages
()
const
{
return
(
nSize
+
nPageSize
-
1
)
/
nPageSize
;}
sal_Int32
GetPages
()
const
{
return
(
m_nSize
+
m_nPageSize
-
1
)
/
m_
nPageSize
;}
short
GetOffset
()
const
{
return
m_nOffset
;}
short
GetOffset
()
const
{
return
m_nOffset
;}
void
SetEntry
(
StgDirEntry
&
);
void
SetEntry
(
StgDirEntry
&
);
virtual
bool
SetSize
(
sal_Int32
);
virtual
bool
SetSize
(
sal_Int32
);
...
...
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