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
ca1e8922
Kaydet (Commit)
ca1e8922
authored
Şub 05, 2013
tarafından
Kohei Yoshida
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Implement detection for Excel 4.0 format.
Change-Id: Ic0f5c585386f602bd51e006770b30cbb190a531e
üst
5753df3c
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
39 additions
and
2 deletions
+39
-2
exceldetect.cxx
sc/source/ui/unoobj/exceldetect.cxx
+39
-2
No files found.
sc/source/ui/unoobj/exceldetect.cxx
Dosyayı görüntüle @
ca1e8922
...
@@ -74,6 +74,41 @@ bool hasStream(const uno::Reference<io::XInputStream>& xInStream, const OUString
...
@@ -74,6 +74,41 @@ bool hasStream(const uno::Reference<io::XInputStream>& xInStream, const OUString
return
xStorage
->
IsStream
(
rName
);
return
xStorage
->
IsStream
(
rName
);
}
}
bool
isExcel40
(
const
uno
::
Reference
<
io
::
XInputStream
>&
xInStream
)
{
SfxMedium
aMedium
;
aMedium
.
UseInteractionHandler
(
true
);
aMedium
.
setStreamToLoadFrom
(
xInStream
,
true
);
SvStream
*
pStream
=
aMedium
.
GetInStream
();
if
(
!
pStream
)
return
false
;
pStream
->
Seek
(
STREAM_SEEK_TO_END
);
sal_Size
nSize
=
pStream
->
Tell
();
pStream
->
Seek
(
0
);
if
(
nSize
<
4
)
return
false
;
sal_uInt16
nBofId
,
nBofSize
;
*
pStream
>>
nBofId
>>
nBofSize
;
if
(
nBofId
!=
0x0409
)
// This ID signifies Excel 4.0 format. It must be 0x0409.
return
false
;
if
(
nBofSize
<
4
||
16
<
nBofSize
)
// BOF record must be sized between 4 and 16 for Excel 4.0 stream.
return
false
;
sal_Size
nPos
=
pStream
->
Tell
();
if
(
nSize
-
nPos
<
nBofSize
)
// BOF record doesn't have required bytes.
return
false
;
return
true
;
}
bool
isTemplate
(
const
OUString
&
rType
)
bool
isTemplate
(
const
OUString
&
rType
)
{
{
return
rType
.
indexOf
(
"_VorlageTemplate"
)
!=
-
1
;
return
rType
.
indexOf
(
"_VorlageTemplate"
)
!=
-
1
;
...
@@ -131,9 +166,11 @@ OUString ScExcelBiffDetect::detect( uno::Sequence<beans::PropertyValue>& lDescri
...
@@ -131,9 +166,11 @@ OUString ScExcelBiffDetect::detect( uno::Sequence<beans::PropertyValue>& lDescri
if
(
aType
==
"calc_MS_Excel_40"
||
aType
==
"calc_MS_Excel_40_VorlageTemplate"
)
if
(
aType
==
"calc_MS_Excel_40"
||
aType
==
"calc_MS_Excel_40_VorlageTemplate"
)
{
{
// See if this stream is a Excel 4.0 stream.
// See if this stream is a Excel 4.0 stream.
if
(
!
isExcel40
(
xInStream
))
return
OUString
();
// TODO: Implement this.
aMediaDesc
[
MediaDescriptor
::
PROP_FILTERNAME
()]
<<=
isTemplate
(
aType
)
?
OUString
(
"MS Excel 4.0 Vorlage/Template"
)
:
OUString
(
"MS Excel 4.0"
);
return
OUString
()
;
return
aType
;
}
}
// failed!
// failed!
...
...
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