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
983d1c4d
Kaydet (Commit)
983d1c4d
authored
Tem 31, 2016
tarafından
Jaskaran Singh
Kaydeden (comit)
Markus Mohrhard
Eyl 17, 2016
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Add test for orcus style import
Change-Id: I4731ed1854f854651b828ae4cb27e6b040660bdf
üst
c2dfe8f2
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
61 additions
and
0 deletions
+61
-0
subsequent_filters-test.cxx
sc/qa/unit/subsequent_filters-test.cxx
+61
-0
No files found.
sc/qa/unit/subsequent_filters-test.cxx
Dosyayı görüntüle @
983d1c4d
...
...
@@ -31,6 +31,7 @@
#include <editeng/udlnitem.hxx>
#include <editeng/editobj.hxx>
#include <editeng/borderline.hxx>
#include <editeng/boxitem.hxx>
#include <editeng/fhgtitem.hxx>
#include <editeng/brushitem.hxx>
#include <editeng/fontitem.hxx>
...
...
@@ -61,6 +62,15 @@
#include <tokenstringcontext.hxx>
#include <formula/errorcodes.hxx>
#include "externalrefmgr.hxx"
#include <stlpool.hxx>
#include <config_orcus.h>
#if ENABLE_ORCUS
#include <orcusfiltersimpl.hxx>
#include "orcusfilters.hxx"
#include "filter.hxx"
#include "orcusinterface.hxx"
#endif
#include <com/sun/star/drawing/XDrawPageSupplier.hpp>
...
...
@@ -149,6 +159,10 @@ public:
void
testCondFormatParentXLSX
();
void
testColorScaleNumWithRefXLSX
();
#if ENABLE_ORCUS
void
testOrcusODSStyleInterface
();
#endif
void
testLiteralInFormulaXLS
();
//change this test file only in excel and not in calc
...
...
@@ -271,6 +285,11 @@ public:
CPPUNIT_TEST
(
testComplexIconSetsXLSX
);
CPPUNIT_TEST
(
testCondFormatParentXLSX
);
CPPUNIT_TEST
(
testColorScaleNumWithRefXLSX
);
#if ENABLE_ORCUS
CPPUNIT_TEST
(
testOrcusODSStyleInterface
);
#endif
CPPUNIT_TEST
(
testLiteralInFormulaXLS
);
CPPUNIT_TEST
(
testNumberFormatHTML
);
...
...
@@ -2646,6 +2665,48 @@ void ScFiltersTest::testColorScaleNumWithRefXLSX()
xDocSh
->
DoClose
();
}
#if ENABLE_ORCUS
void
ScFiltersTest
::
testOrcusODSStyleInterface
()
{
ScDocument
aDoc
;
OUString
aFullUrl
=
m_directories
.
getURLFromSrc
(
"sc/qa/unit/data/xml/styles.xml"
);
/* This loop below trims file:// from the start because orcus doesn't accept such a url */
OUString
aValidPath
;
osl
::
FileBase
::
getSystemPathFromFileURL
(
aFullUrl
,
aValidPath
);
ScOrcusFilters
*
pOrcus
=
ScFormatFilter
::
Get
().
GetOrcusFilters
();
CPPUNIT_ASSERT
(
pOrcus
);
pOrcus
->
importODS_Styles
(
aDoc
,
aValidPath
);
ScStyleSheetPool
*
pStyleSheetPool
=
aDoc
.
GetStyleSheetPool
();
ScStyleSheet
*
pStyleSheet
=
pStyleSheetPool
->
FindCaseIns
(
"Name1"
,
SfxStyleFamily
::
Para
);
const
SfxPoolItem
*
pItem
=
nullptr
;
CPPUNIT_ASSERT_MESSAGE
(
"Style Name1 : Doesn't have Attribute background, but it should have."
,
pStyleSheet
->
GetItemSet
().
HasItem
(
ATTR_BACKGROUND
,
&
pItem
));
const
SvxBrushItem
*
pBackground
=
static_cast
<
const
SvxBrushItem
*>
(
pItem
);
CPPUNIT_ASSERT_EQUAL
(
Color
(
254
,
255
,
204
),
pBackground
->
GetColor
());
CPPUNIT_ASSERT_MESSAGE
(
"Style Name1 : Doesn't have Attribute border, but it should have."
,
pStyleSheet
->
GetItemSet
().
HasItem
(
ATTR_BORDER
,
&
pItem
));
const
SvxBoxItem
*
pBoxItem
=
static_cast
<
const
SvxBoxItem
*>
(
pItem
);
CPPUNIT_ASSERT_EQUAL
(
Color
(
255
,
204
,
18
),
pBoxItem
->
GetLeft
()
->
GetColor
());
CPPUNIT_ASSERT_EQUAL
(
Color
(
255
,
204
,
18
),
pBoxItem
->
GetRight
()
->
GetColor
());
CPPUNIT_ASSERT_EQUAL
(
Color
(
255
,
204
,
18
),
pBoxItem
->
GetTop
()
->
GetColor
());
CPPUNIT_ASSERT_EQUAL
(
Color
(
255
,
204
,
18
),
pBoxItem
->
GetBottom
()
->
GetColor
());
CPPUNIT_ASSERT_EQUAL
(
pBoxItem
->
GetLeft
()
->
GetBorderLineStyle
(),
::
com
::
sun
::
star
::
table
::
BorderLineStyle
::
DOTTED
);
CPPUNIT_ASSERT_EQUAL
(
pBoxItem
->
GetRight
()
->
GetBorderLineStyle
(),
::
com
::
sun
::
star
::
table
::
BorderLineStyle
::
DOTTED
);
CPPUNIT_ASSERT_EQUAL
(
pBoxItem
->
GetTop
()
->
GetBorderLineStyle
(),
::
com
::
sun
::
star
::
table
::
BorderLineStyle
::
DOTTED
);
CPPUNIT_ASSERT_EQUAL
(
pBoxItem
->
GetBottom
()
->
GetBorderLineStyle
(),
::
com
::
sun
::
star
::
table
::
BorderLineStyle
::
DOTTED
);
ASSERT_DOUBLES_EQUAL_MESSAGE
(
"Error with left width"
,
1
,
pBoxItem
->
GetLeft
()
->
GetWidth
());
ASSERT_DOUBLES_EQUAL_MESSAGE
(
"Error with right width"
,
1
,
pBoxItem
->
GetRight
()
->
GetWidth
());
ASSERT_DOUBLES_EQUAL_MESSAGE
(
"Error with top width"
,
1
,
pBoxItem
->
GetTop
()
->
GetWidth
());
ASSERT_DOUBLES_EQUAL_MESSAGE
(
"Error with bottom width"
,
1
,
pBoxItem
->
GetBottom
()
->
GetWidth
());
}
#endif
void
ScFiltersTest
::
testLiteralInFormulaXLS
()
{
ScDocShellRef
xDocSh
=
loadDoc
(
"shared-string/literal-in-formula."
,
FORMAT_XLS
);
...
...
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