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
8970e14d
Kaydet (Commit)
8970e14d
authored
Şub 21, 2013
tarafından
Eike Rathke
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
resolved fdo#57841 ignore embedded NULL characters in CSV import
Change-Id: Ib0eb044f009227c0aa6e1bc520905d605323c3db
üst
30fee57e
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
23 additions
and
0 deletions
+23
-0
scuiasciiopt.cxx
sc/source/ui/dbgui/scuiasciiopt.cxx
+2
-0
impex.cxx
sc/source/ui/docshell/impex.cxx
+19
-0
impex.hxx
sc/source/ui/inc/impex.hxx
+2
-0
No files found.
sc/source/ui/dbgui/scuiasciiopt.cxx
Dosyayı görüntüle @
8970e14d
...
@@ -540,6 +540,8 @@ bool ScImportAsciiDlg::GetLine( sal_uLong nLine, rtl::OUString &rText )
...
@@ -540,6 +540,8 @@ bool ScImportAsciiDlg::GetLine( sal_uLong nLine, rtl::OUString &rText )
if
(
mpDatStream
->
GetError
()
==
ERRCODE_IO_CANTSEEK
)
if
(
mpDatStream
->
GetError
()
==
ERRCODE_IO_CANTSEEK
)
mpDatStream
->
ResetError
();
mpDatStream
->
ResetError
();
ScImportExport
::
EmbeddedNullTreatment
(
rText
);
return
bRet
;
return
bRet
;
}
}
...
...
sc/source/ui/docshell/impex.cxx
Dosyayı görüntüle @
8970e14d
...
@@ -1335,6 +1335,8 @@ bool ScImportExport::ExtText2Doc( SvStream& rStrm )
...
@@ -1335,6 +1335,8 @@ bool ScImportExport::ExtText2Doc( SvStream& rStrm )
if
(
rStrm
.
IsEof
()
&&
aLine
.
isEmpty
()
)
if
(
rStrm
.
IsEof
()
&&
aLine
.
isEmpty
()
)
break
;
break
;
EmbeddedNullTreatment
(
aLine
);
sal_Int32
nLineLen
=
aLine
.
getLength
();
sal_Int32
nLineLen
=
aLine
.
getLength
();
SCCOL
nCol
=
nStartCol
;
SCCOL
nCol
=
nStartCol
;
bool
bMultiLine
=
false
;
bool
bMultiLine
=
false
;
...
@@ -1473,6 +1475,23 @@ bool ScImportExport::ExtText2Doc( SvStream& rStrm )
...
@@ -1473,6 +1475,23 @@ bool ScImportExport::ExtText2Doc( SvStream& rStrm )
}
}
void
ScImportExport
::
EmbeddedNullTreatment
(
OUString
&
rStr
)
{
// A nasty workaround for data with embedded NULL characters. As long as we
// can't handle them properly as cell content (things assume 0-terminated
// strings at too many places) simply strip all NULL characters from raw
// data. Excel does the same. See fdo#57841 for sample data.
// The normal case is no embedded NULL, check first before de-/allocating
// ustring stuff.
sal_Unicode
cNull
=
0
;
if
(
rStr
.
indexOf
(
cNull
)
>=
0
)
{
rStr
=
rStr
.
replaceAll
(
OUString
(
&
cNull
,
1
),
OUString
());
}
}
const
sal_Unicode
*
ScImportExport
::
ScanNextFieldFromString
(
const
sal_Unicode
*
p
,
const
sal_Unicode
*
ScImportExport
::
ScanNextFieldFromString
(
const
sal_Unicode
*
p
,
String
&
rField
,
sal_Unicode
cStr
,
const
sal_Unicode
*
pSeps
,
bool
bMergeSeps
,
bool
&
rbIsQuoted
,
String
&
rField
,
sal_Unicode
cStr
,
const
sal_Unicode
*
pSeps
,
bool
bMergeSeps
,
bool
&
rbIsQuoted
,
bool
&
rbOverflowCell
)
bool
&
rbOverflowCell
)
...
...
sc/source/ui/inc/impex.hxx
Dosyayı görüntüle @
8970e14d
...
@@ -102,6 +102,8 @@ public:
...
@@ -102,6 +102,8 @@ public:
bool
IsUndo
()
const
{
return
bUndo
;
}
bool
IsUndo
()
const
{
return
bUndo
;
}
void
SetUndo
(
bool
b
)
{
bUndo
=
b
;
}
void
SetUndo
(
bool
b
)
{
bUndo
=
b
;
}
SC_DLLPUBLIC
static
void
EmbeddedNullTreatment
(
OUString
&
rStr
);
static
bool
IsFormatSupported
(
sal_uLong
nFormat
);
static
bool
IsFormatSupported
(
sal_uLong
nFormat
);
static
const
sal_Unicode
*
ScanNextFieldFromString
(
const
sal_Unicode
*
p
,
static
const
sal_Unicode
*
ScanNextFieldFromString
(
const
sal_Unicode
*
p
,
String
&
rField
,
sal_Unicode
cStr
,
const
sal_Unicode
*
pSeps
,
String
&
rField
,
sal_Unicode
cStr
,
const
sal_Unicode
*
pSeps
,
...
...
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