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
5a560e43
Kaydet (Commit)
5a560e43
authored
Nis 15, 2012
tarafından
Eike Rathke
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
resolved fdo#48731 in CSV import do not strip leading apostrophe
üst
385017e0
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
30 additions
and
9 deletions
+30
-9
stringutil.hxx
sc/inc/stringutil.hxx
+10
-0
column3.cxx
sc/source/core/data/column3.cxx
+13
-8
dpoutput.cxx
sc/source/core/data/dpoutput.cxx
+3
-0
stringutil.cxx
sc/source/core/tool/stringutil.cxx
+2
-1
eeimpars.cxx
sc/source/filter/rtf/eeimpars.cxx
+1
-0
impex.cxx
sc/source/ui/docshell/impex.cxx
+1
-0
No files found.
sc/inc/stringutil.hxx
Dosyayı görüntüle @
5a560e43
...
@@ -61,6 +61,16 @@ struct SC_DLLPUBLIC ScSetStringParam
...
@@ -61,6 +61,16 @@ struct SC_DLLPUBLIC ScSetStringParam
*/
*/
bool
mbSetTextCellFormat
;
bool
mbSetTextCellFormat
;
/**
* When true, treat input with a leading apostrophe / single quote special
* in that it escapes numeric or date/time input such that it is not
* interpreted and the input string is taken instead. This can be used
* during text file import so the leading apostrophe is not lost if it
* precedes a numeric value.
* Usually set mbHandleApostrophe = !mbSetTextCellFormat
*/
bool
mbHandleApostrophe
;
ScSetStringParam
();
ScSetStringParam
();
};
};
...
...
sc/source/core/data/column3.cxx
Dosyayı görüntüle @
5a560e43
...
@@ -1234,14 +1234,19 @@ bool ScColumn::SetString( SCROW nRow, SCTAB nTabP, const String& rString,
...
@@ -1234,14 +1234,19 @@ bool ScColumn::SetString( SCROW nRow, SCTAB nTabP, const String& rString,
}
}
else
if
(
cFirstChar
==
'\''
)
// 'Text
else
if
(
cFirstChar
==
'\''
)
// 'Text
{
{
// Cell format is not 'Text', and the first char
bool
bNumeric
=
false
;
// is an apostrophe. Check if the input is considered a number.
if
(
aParam
.
mbHandleApostrophe
)
String
aTest
=
rString
.
Copy
(
1
);
{
double
fTest
;
// Cell format is not 'Text', and the first char
if
(
aParam
.
mpNumFormatter
->
IsNumberFormat
(
aTest
,
nIndex
,
fTest
))
// is an apostrophe. Check if the input is considered a number.
// This is a number. Strip out the first char.
String
aTest
=
rString
.
Copy
(
1
);
pNewCell
=
new
ScStringCell
(
aTest
);
double
fTest
;
else
bNumeric
=
aParam
.
mpNumFormatter
->
IsNumberFormat
(
aTest
,
nIndex
,
fTest
);
if
(
bNumeric
)
// This is a number. Strip out the first char.
pNewCell
=
new
ScStringCell
(
aTest
);
}
if
(
!
bNumeric
)
// This is a normal text. Take it as-is.
// This is a normal text. Take it as-is.
pNewCell
=
new
ScStringCell
(
rString
);
pNewCell
=
new
ScStringCell
(
rString
);
}
}
...
...
sc/source/core/data/dpoutput.cxx
Dosyayı görüntüle @
5a560e43
...
@@ -794,11 +794,13 @@ void ScDPOutput::HeaderCell( SCCOL nCol, SCROW nRow, SCTAB nTab,
...
@@ -794,11 +794,13 @@ void ScDPOutput::HeaderCell( SCCOL nCol, SCROW nRow, SCTAB nTab,
{
{
aParam
.
mbDetectNumberFormat
=
true
;
aParam
.
mbDetectNumberFormat
=
true
;
aParam
.
mbSetTextCellFormat
=
false
;
aParam
.
mbSetTextCellFormat
=
false
;
aParam
.
mbHandleApostrophe
=
true
;
}
}
else
else
{
{
aParam
.
mbDetectNumberFormat
=
false
;
aParam
.
mbDetectNumberFormat
=
false
;
aParam
.
mbSetTextCellFormat
=
true
;
aParam
.
mbSetTextCellFormat
=
true
;
aParam
.
mbHandleApostrophe
=
false
;
}
}
pDoc
->
SetString
(
nCol
,
nRow
,
nTab
,
rData
.
Caption
,
&
aParam
);
pDoc
->
SetString
(
nCol
,
nRow
,
nTab
,
rData
.
Caption
,
&
aParam
);
}
}
...
@@ -836,6 +838,7 @@ void ScDPOutput::FieldCell(
...
@@ -836,6 +838,7 @@ void ScDPOutput::FieldCell(
ScSetStringParam
aParam
;
ScSetStringParam
aParam
;
aParam
.
mbDetectNumberFormat
=
false
;
aParam
.
mbDetectNumberFormat
=
false
;
aParam
.
mbSetTextCellFormat
=
true
;
aParam
.
mbSetTextCellFormat
=
true
;
aParam
.
mbHandleApostrophe
=
false
;
pDoc
->
SetString
(
nCol
,
nRow
,
nTab
,
rData
.
maCaption
,
&
aParam
);
pDoc
->
SetString
(
nCol
,
nRow
,
nTab
,
rData
.
maCaption
,
&
aParam
);
if
(
bInTable
)
if
(
bInTable
)
...
...
sc/source/core/tool/stringutil.cxx
Dosyayı görüntüle @
5a560e43
...
@@ -39,7 +39,8 @@ using ::rtl::OUStringBuffer;
...
@@ -39,7 +39,8 @@ using ::rtl::OUStringBuffer;
ScSetStringParam
::
ScSetStringParam
()
:
ScSetStringParam
::
ScSetStringParam
()
:
mpNumFormatter
(
NULL
),
mpNumFormatter
(
NULL
),
mbDetectNumberFormat
(
true
),
mbDetectNumberFormat
(
true
),
mbSetTextCellFormat
(
false
)
mbSetTextCellFormat
(
false
),
mbHandleApostrophe
(
true
)
{
{
}
}
...
...
sc/source/filter/rtf/eeimpars.cxx
Dosyayı görüntüle @
5a560e43
...
@@ -337,6 +337,7 @@ void ScEEImport::WriteToDocument( bool bSizeColsRows, double nOutputFactor, SvNu
...
@@ -337,6 +337,7 @@ void ScEEImport::WriteToDocument( bool bSizeColsRows, double nOutputFactor, SvNu
aParam
.
mpNumFormatter
=
pFormatter
;
aParam
.
mpNumFormatter
=
pFormatter
;
aParam
.
mbDetectNumberFormat
=
true
;
aParam
.
mbDetectNumberFormat
=
true
;
aParam
.
mbSetTextCellFormat
=
true
;
aParam
.
mbSetTextCellFormat
=
true
;
aParam
.
mbHandleApostrophe
=
false
;
if
(
!
aValStr
.
isEmpty
())
if
(
!
aValStr
.
isEmpty
())
mpDoc
->
SetValue
(
nCol
,
nRow
,
nTab
,
fVal
);
mpDoc
->
SetValue
(
nCol
,
nRow
,
nTab
,
fVal
);
...
...
sc/source/ui/docshell/impex.cxx
Dosyayı görüntüle @
5a560e43
...
@@ -1228,6 +1228,7 @@ static bool lcl_PutString(
...
@@ -1228,6 +1228,7 @@ static bool lcl_PutString(
aParam
.
mpNumFormatter
=
pFormatter
;
aParam
.
mpNumFormatter
=
pFormatter
;
aParam
.
mbDetectNumberFormat
=
bDetectNumFormat
;
aParam
.
mbDetectNumberFormat
=
bDetectNumFormat
;
aParam
.
mbSetTextCellFormat
=
true
;
aParam
.
mbSetTextCellFormat
=
true
;
aParam
.
mbHandleApostrophe
=
false
;
pDoc
->
SetString
(
nCol
,
nRow
,
nTab
,
rStr
,
&
aParam
);
pDoc
->
SetString
(
nCol
,
nRow
,
nTab
,
rStr
,
&
aParam
);
}
}
else
else
...
...
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