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
0f2414d8
Kaydet (Commit)
0f2414d8
authored
Mar 21, 2014
tarafından
Eike Rathke
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
refactored to use XclRangeList and XclImpAddressConverter
Change-Id: If0455f0243aace784c704e234469709e6da4542f
üst
5ff0e274
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
21 additions
and
83 deletions
+21
-83
excimp8.cxx
sc/source/filter/excel/excimp8.cxx
+9
-5
xicontent.cxx
sc/source/filter/excel/xicontent.cxx
+3
-48
xladdress.cxx
sc/source/filter/excel/xladdress.cxx
+5
-2
xicontent.hxx
sc/source/filter/inc/xicontent.hxx
+3
-27
xladdress.hxx
sc/source/filter/inc/xladdress.hxx
+1
-1
No files found.
sc/source/filter/excel/excimp8.cxx
Dosyayı görüntüle @
0f2414d8
...
...
@@ -354,12 +354,16 @@ void ImportExcel8::Feat( void )
aIn
.
Ignore
(
4
);
// size if EXC_ISFFEC2, else 0 and to be ignored
aIn
.
Ignore
(
2
);
// reserved3 (2 bytes)
XclEnhancedProtection
aProt
;
aProt
.
maRefs
.
reserve
(
nCref
);
XclRef8U
aRef
;
for
(
sal_uInt16
i
=
0
;
i
<
nCref
&&
aIn
.
IsValid
();
++
i
)
ScEnhancedProtection
aProt
;
if
(
nCref
)
{
aProt
.
maRefs
.
push_back
(
aRef
.
read
(
aIn
));
XclRangeList
aRefs
;
aRefs
.
Read
(
aIn
,
true
,
nCref
);
if
(
!
aRefs
.
empty
())
{
aProt
.
maRangeList
=
new
ScRangeList
;
GetAddressConverter
().
ConvertRangeList
(
*
aProt
.
maRangeList
,
aRefs
,
GetCurrScTab
(),
false
);
}
}
// FeatProtection structure follows in record.
...
...
sc/source/filter/excel/xicontent.cxx
Dosyayı görüntüle @
0f2414d8
...
...
@@ -65,39 +65,6 @@ using ::com::sun::star::uno::Sequence;
using
::
std
::
auto_ptr
;
const
XclRef8U
&
XclRef8U
::
read
(
XclImpStream
&
rStrm
)
{
mnRow1
=
rStrm
.
ReaduInt16
();
mnRow2
=
rStrm
.
ReaduInt16
();
mnCol1
=
rStrm
.
ReaduInt16
();
mnCol2
=
rStrm
.
ReaduInt16
();
return
*
this
;
}
ScRange
XclRef8U
::
convertToScRange
(
SCTAB
nTab
)
const
{
return
ScRange
(
mnCol1
,
mnRow1
,
nTab
,
mnCol2
,
mnRow2
,
nTab
);
}
ScEnhancedProtection
XclEnhancedProtection
::
convertToScEnhancedProtection
(
SCTAB
nTab
)
const
{
ScEnhancedProtection
aProt
;
if
(
!
maRefs
.
empty
())
{
aProt
.
maRangeList
=
new
ScRangeList
;
for
(
::
std
::
vector
<
XclRef8U
>::
const_iterator
it
(
maRefs
.
begin
()),
itEnd
(
maRefs
.
end
());
it
!=
itEnd
;
++
it
)
{
aProt
.
maRangeList
->
Append
(
it
->
convertToScRange
(
nTab
));
}
}
aProt
.
mnAreserved
=
mnAreserved
;
aProt
.
mnPasswordVerifier
=
mnPasswordVerifier
;
aProt
.
maTitle
=
maTitle
;
aProt
.
maSecurityDescriptor
=
maSecurityDescriptor
;
return
aProt
;
}
// Shared string table ========================================================
XclImpSst
::
XclImpSst
(
const
XclImpRoot
&
rRoot
)
:
...
...
@@ -1280,7 +1247,7 @@ void XclImpSheetProtectBuffer::ReadOptions( XclImpStream& rStrm, SCTAB nTab )
pSheet
->
mnOptions
=
nOptions
;
}
void
XclImpSheetProtectBuffer
::
AppendEnhancedProtection
(
const
Xcl
EnhancedProtection
&
rProt
,
SCTAB
nTab
)
void
XclImpSheetProtectBuffer
::
AppendEnhancedProtection
(
const
Sc
EnhancedProtection
&
rProt
,
SCTAB
nTab
)
{
Sheet
*
pSheet
=
GetSheetItem
(
nTab
);
if
(
pSheet
)
...
...
@@ -1338,23 +1305,11 @@ void XclImpSheetProtectBuffer::Apply() const
pProtect
->
setOption
(
ScTableProtection
::
PIVOT_TABLES
,
(
nOptions
&
0x2000
)
);
pProtect
->
setOption
(
ScTableProtection
::
SELECT_UNLOCKED_CELLS
,
(
nOptions
&
0x4000
)
);
SCTAB
nTab
=
itr
->
first
;
// Enhanced protection containing editable ranges and permissions.
if
(
!
itr
->
second
.
maEnhancedProtections
.
empty
())
{
::
std
::
vector
<
ScEnhancedProtection
>
aProtections
;
for
(
::
std
::
vector
<
XclEnhancedProtection
>::
const_iterator
it
(
itr
->
second
.
maEnhancedProtections
.
begin
()),
itEnd
(
itr
->
second
.
maEnhancedProtections
.
end
());
it
!=
itEnd
;
++
it
)
{
aProtections
.
push_back
(
it
->
convertToScEnhancedProtection
(
nTab
));
}
pProtect
->
setEnhancedProtection
(
aProtections
);
}
pProtect
->
setEnhancedProtection
(
itr
->
second
.
maEnhancedProtections
);
// all done. now commit.
GetDoc
().
SetTabProtection
(
nTab
,
pProtect
.
get
());
GetDoc
().
SetTabProtection
(
itr
->
first
,
pProtect
.
get
());
}
}
...
...
sc/source/filter/excel/xladdress.cxx
Dosyayı görüntüle @
0f2414d8
...
...
@@ -93,10 +93,13 @@ XclRange XclRangeList::GetEnclosingRange() const
return
aXclRange
;
}
void
XclRangeList
::
Read
(
XclImpStream
&
rStrm
,
bool
bCol16Bit
)
void
XclRangeList
::
Read
(
XclImpStream
&
rStrm
,
bool
bCol16Bit
,
sal_uInt16
nRefs
)
{
sal_uInt16
nCount
;
rStrm
>>
nCount
;
if
(
nRefs
)
nCount
=
nRefs
;
else
rStrm
>>
nCount
;
size_t
nOldSize
=
size
();
resize
(
nOldSize
+
nCount
);
for
(
iterator
aIt
=
begin
()
+
nOldSize
;
rStrm
.
IsValid
()
&&
(
nCount
>
0
);
--
nCount
,
++
aIt
)
...
...
sc/source/filter/inc/xicontent.hxx
Dosyayı görüntüle @
0f2414d8
...
...
@@ -26,13 +26,12 @@
#include "xistring.hxx"
#include "xiroot.hxx"
#include "validat.hxx"
#include "tabprotection.hxx"
#include <map>
#include <boost/ptr_container/ptr_vector.hpp>
#include <boost/noncopyable.hpp>
struct
ScEnhancedProtection
;
/* ============================================================================
Classes to import the big Excel document contents (related to several cells or
globals for the document).
...
...
@@ -46,29 +45,6 @@ globals for the document).
- Stream decryption
============================================================================ */
struct
XclRef8U
{
sal_uInt16
mnRow1
;
sal_uInt16
mnRow2
;
sal_uInt16
mnCol1
;
sal_uInt16
mnCol2
;
const
XclRef8U
&
read
(
XclImpStream
&
rStrm
);
ScRange
convertToScRange
(
SCTAB
nTab
)
const
;
};
/** Feat ISFPROTECTION refs plus FeatProtection */
struct
XclEnhancedProtection
{
::
std
::
vector
<
XclRef8U
>
maRefs
;
sal_uInt32
mnAreserved
;
sal_uInt32
mnPasswordVerifier
;
OUString
maTitle
;
::
std
::
vector
<
sal_uInt8
>
maSecurityDescriptor
;
// raw data
ScEnhancedProtection
convertToScEnhancedProtection
(
SCTAB
nTab
)
const
;
};
// Shared string table ========================================================
/** The SST (shared string table) contains all strings used in a BIFF8 file.
...
...
@@ -330,7 +306,7 @@ public:
void
ReadOptions
(
XclImpStream
&
rStrm
,
SCTAB
nTab
);
void
AppendEnhancedProtection
(
const
Xcl
EnhancedProtection
&
rProt
,
SCTAB
nTab
);
void
AppendEnhancedProtection
(
const
Sc
EnhancedProtection
&
rProt
,
SCTAB
nTab
);
void
ReadPasswordHash
(
XclImpStream
&
rStrm
,
SCTAB
nTab
);
...
...
@@ -342,7 +318,7 @@ private:
bool
mbProtected
;
sal_uInt16
mnPasswordHash
;
sal_uInt16
mnOptions
;
::
std
::
vector
<
Xcl
EnhancedProtection
>
maEnhancedProtections
;
::
std
::
vector
<
Sc
EnhancedProtection
>
maEnhancedProtections
;
Sheet
();
Sheet
(
const
Sheet
&
r
);
...
...
sc/source/filter/inc/xladdress.hxx
Dosyayı görüntüle @
0f2414d8
...
...
@@ -126,7 +126,7 @@ public:
XclRange
GetEnclosingRange
()
const
;
void
Read
(
XclImpStream
&
rStrm
,
bool
bCol16Bit
=
true
);
void
Read
(
XclImpStream
&
rStrm
,
bool
bCol16Bit
=
true
,
sal_uInt16
nRefs
=
0
);
void
Write
(
XclExpStream
&
rStrm
,
bool
bCol16Bit
=
true
)
const
;
void
WriteSubList
(
XclExpStream
&
rStrm
,
size_t
nBegin
,
size_t
nCount
,
bool
bCol16Bit
=
true
)
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