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
f97a3a7f
Kaydet (Commit)
f97a3a7f
authored
Agu 13, 2012
tarafından
Kohei Yoshida
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
New HTML file to test number format on import.
Change-Id: I74e831e5ede01dfe2954314be6b64b19a551dc6b
üst
582e06f7
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
43 additions
and
2 deletions
+43
-2
numberformat.html
sc/qa/unit/data/html/numberformat.html
+8
-0
subsequent_filters-test.cxx
sc/qa/unit/subsequent_filters-test.cxx
+35
-2
No files found.
sc/qa/unit/data/html/numberformat.html
0 → 100644
Dosyayı görüntüle @
f97a3a7f
<html
lang=
"en"
>
<body>
<table>
<tr><td>
Product
</td><td>
Price
</td><td>
Note
</td></tr>
<tr><td>
Google Nexus 7 (8GB)
</td><td>
199.98
</td><td>
This should be imported as a number, not text.
</td></tr>
</table>
</body>
</html>
sc/qa/unit/subsequent_filters-test.cxx
Dosyayı görüntüle @
f97a3a7f
...
@@ -60,12 +60,14 @@
...
@@ -60,12 +60,14 @@
#define ODS_FORMAT_TYPE 50331943
#define ODS_FORMAT_TYPE 50331943
#define XLS_FORMAT_TYPE 318767171
#define XLS_FORMAT_TYPE 318767171
#define XLSX_FORMAT_TYPE 268959811
#define XLSX_FORMAT_TYPE 268959811
#define CSV_FORMAT_TYPE 195
#define CSV_FORMAT_TYPE (SFX_FILTER_IMPORT | SFX_FILTER_EXPORT | SFX_FILTER_ALIEN | SFX_FILTER_USESOPTIONS)
#define HTML_FORMAT_TYPE (SFX_FILTER_IMPORT | SFX_FILTER_EXPORT | SFX_FILTER_ALIEN | SFX_FILTER_USESOPTIONS)
#define ODS 0
#define ODS 0
#define XLS 1
#define XLS 1
#define XLSX 2
#define XLSX 2
#define CSV 3
#define CSV 3
#define HTML 4
using
namespace
::
com
::
sun
::
star
;
using
namespace
::
com
::
sun
::
star
;
using
namespace
::
com
::
sun
::
star
::
uno
;
using
namespace
::
com
::
sun
::
star
::
uno
;
...
@@ -80,7 +82,8 @@ FileFormat aFileFormats[] = {
...
@@ -80,7 +82,8 @@ FileFormat aFileFormats[] = {
{
"ods"
,
"calc8"
,
""
,
ODS_FORMAT_TYPE
},
{
"ods"
,
"calc8"
,
""
,
ODS_FORMAT_TYPE
},
{
"xls"
,
"MS Excel 97"
,
"calc_MS_EXCEL_97"
,
XLS_FORMAT_TYPE
},
{
"xls"
,
"MS Excel 97"
,
"calc_MS_EXCEL_97"
,
XLS_FORMAT_TYPE
},
{
"xlsx"
,
"Calc MS Excel 2007 XML"
,
"MS Excel 2007 XML"
,
XLSX_FORMAT_TYPE
},
{
"xlsx"
,
"Calc MS Excel 2007 XML"
,
"MS Excel 2007 XML"
,
XLSX_FORMAT_TYPE
},
{
"csv"
,
"Text - txt - csv (StarCalc)"
,
"generic_Text"
,
CSV_FORMAT_TYPE
}
{
"csv"
,
"Text - txt - csv (StarCalc)"
,
"generic_Text"
,
CSV_FORMAT_TYPE
},
{
"html"
,
"calc_HTML_WebQuery"
,
"generic_HTML"
,
HTML_FORMAT_TYPE
}
};
};
}
}
...
@@ -145,6 +148,8 @@ public:
...
@@ -145,6 +148,8 @@ public:
//test shape import
//test shape import
void
testControlImport
();
void
testControlImport
();
void
testNumberFormatHTML
();
CPPUNIT_TEST_SUITE
(
ScFiltersTest
);
CPPUNIT_TEST_SUITE
(
ScFiltersTest
);
CPPUNIT_TEST
(
testRangeNameXLS
);
CPPUNIT_TEST
(
testRangeNameXLS
);
CPPUNIT_TEST
(
testRangeNameXLSX
);
CPPUNIT_TEST
(
testRangeNameXLSX
);
...
@@ -178,6 +183,8 @@ public:
...
@@ -178,6 +183,8 @@ public:
CPPUNIT_TEST
(
testDataBar
);
CPPUNIT_TEST
(
testDataBar
);
CPPUNIT_TEST
(
testCondFormat
);
CPPUNIT_TEST
(
testCondFormat
);
CPPUNIT_TEST
(
testNumberFormatHTML
);
//disable testPassword on MacOSX due to problems with libsqlite3
//disable testPassword on MacOSX due to problems with libsqlite3
//also crashes on DragonFly due to problems with nss/nspr headers
//also crashes on DragonFly due to problems with nss/nspr headers
#if !defined(MACOSX) && !defined(DRAGONFLY) && !defined(WNT)
#if !defined(MACOSX) && !defined(DRAGONFLY) && !defined(WNT)
...
@@ -1180,6 +1187,32 @@ void ScFiltersTest::testControlImport()
...
@@ -1180,6 +1187,32 @@ void ScFiltersTest::testControlImport()
xDocSh
->
DoClose
();
xDocSh
->
DoClose
();
}
}
void
ScFiltersTest
::
testNumberFormatHTML
()
{
OUString
aFileNameBase
(
"numberformat."
);
OUString
aFileExt
=
OUString
::
createFromAscii
(
aFileFormats
[
HTML
].
pName
);
OUString
aFilterName
=
OUString
::
createFromAscii
(
aFileFormats
[
HTML
].
pFilterName
);
OUString
aFilterType
=
OUString
::
createFromAscii
(
aFileFormats
[
HTML
].
pTypeName
);
rtl
::
OUString
aFileName
;
createFileURL
(
aFileNameBase
,
aFileExt
,
aFileName
);
ScDocShellRef
xDocSh
=
load
(
aFilterName
,
aFileName
,
rtl
::
OUString
(),
aFilterType
,
aFileFormats
[
HTML
].
nFormatType
);
CPPUNIT_ASSERT_MESSAGE
(
"Failed to load numberformat.html"
,
xDocSh
.
Is
());
ScDocument
*
pDoc
=
xDocSh
->
GetDocument
();
// Check the header just in case.
CPPUNIT_ASSERT_MESSAGE
(
"Cell value is not as expected"
,
pDoc
->
GetString
(
0
,
0
,
0
)
==
"Product"
);
CPPUNIT_ASSERT_MESSAGE
(
"Cell value is not as expected"
,
pDoc
->
GetString
(
1
,
0
,
0
)
==
"Price"
);
CPPUNIT_ASSERT_MESSAGE
(
"Cell value is not as expected"
,
pDoc
->
GetString
(
2
,
0
,
0
)
==
"Note"
);
// B2 should be imported as a value cell.
bool
bHasValue
=
pDoc
->
HasValueData
(
1
,
1
,
0
);
CPPUNIT_ASSERT_MESSAGE
(
"Fail to import number as a value cell."
,
bHasValue
);
xDocSh
->
DoClose
();
}
void
ScFiltersTest
::
testColorScale
()
void
ScFiltersTest
::
testColorScale
()
{
{
const
rtl
::
OUString
aFileNameBase
(
RTL_CONSTASCII_USTRINGPARAM
(
"colorScale."
));
const
rtl
::
OUString
aFileNameBase
(
RTL_CONSTASCII_USTRINGPARAM
(
"colorScale."
));
...
...
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