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
5b3166ff
Kaydet (Commit)
5b3166ff
authored
Ara 08, 2014
tarafından
Zolnai Tamás
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Test also Calc export / import of images with special ID
Change-Id: I6c47c4b78a1dcd76287cdca16265d3170d2794f5
üst
2264171e
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
74 additions
and
0 deletions
+74
-0
images_with_special_IDs.ods
sc/qa/unit/data/ods/images_with_special_IDs.ods
+0
-0
subsequent_export-test.cxx
sc/qa/unit/subsequent_export-test.cxx
+74
-0
No files found.
sc/qa/unit/data/ods/images_with_special_IDs.ods
0 → 100644
Dosyayı görüntüle @
5b3166ff
File added
sc/qa/unit/subsequent_export-test.cxx
Dosyayı görüntüle @
5b3166ff
...
@@ -133,6 +133,7 @@ public:
...
@@ -133,6 +133,7 @@ public:
void
testSwappedOutImageExport
();
void
testSwappedOutImageExport
();
void
testLinkedGraphicRT
();
void
testLinkedGraphicRT
();
void
testImageWithSpecialID
();
void
testSupBookVirtualPath
();
void
testSupBookVirtualPath
();
...
@@ -180,6 +181,7 @@ public:
...
@@ -180,6 +181,7 @@ public:
#endif
#endif
CPPUNIT_TEST
(
testSwappedOutImageExport
);
CPPUNIT_TEST
(
testSwappedOutImageExport
);
CPPUNIT_TEST
(
testLinkedGraphicRT
);
CPPUNIT_TEST
(
testLinkedGraphicRT
);
CPPUNIT_TEST
(
testImageWithSpecialID
);
CPPUNIT_TEST_SUITE_END
();
CPPUNIT_TEST_SUITE_END
();
...
@@ -2417,6 +2419,78 @@ void ScExportTest::testLinkedGraphicRT()
...
@@ -2417,6 +2419,78 @@ void ScExportTest::testLinkedGraphicRT()
}
}
}
}
void
ScExportTest
::
testImageWithSpecialID
()
{
const
char
*
aFilterNames
[]
=
{
"calc8"
,
"MS Excel 97"
,
"Calc Office Open XML"
,
"generic_HTML"
,
};
// Trigger swap out mechanism to test swapped state factor too.
boost
::
shared_ptr
<
comphelper
::
ConfigurationChanges
>
batch
(
comphelper
::
ConfigurationChanges
::
create
());
officecfg
::
Office
::
Common
::
Cache
::
GraphicManager
::
TotalCacheSize
::
set
(
sal_Int32
(
1
),
batch
);
batch
->
commit
();
for
(
size_t
nFilter
=
0
;
nFilter
<
SAL_N_ELEMENTS
(
aFilterNames
);
++
nFilter
)
{
ScDocShellRef
xDocSh
=
loadDoc
(
"images_with_special_IDs."
,
ODS
);
const
OString
sFailedMessage
=
OString
(
"Failed on filter: "
)
+
aFilterNames
[
nFilter
];
CPPUNIT_ASSERT_MESSAGE
(
sFailedMessage
.
getStr
(),
xDocSh
.
Is
());
// Export the document and import again for a check
ScDocShellRef
xDocSh2
=
saveAndReload
(
xDocSh
,
nFilter
);
xDocSh
->
DoClose
();
// Check whether graphic was exported well
uno
::
Reference
<
frame
::
XModel
>
xModel
=
xDocSh2
->
GetModel
();
uno
::
Reference
<
sheet
::
XSpreadsheetDocument
>
xDoc
(
xModel
,
UNO_QUERY_THROW
);
uno
::
Reference
<
container
::
XIndexAccess
>
xIA
(
xDoc
->
getSheets
(),
UNO_QUERY_THROW
);
uno
::
Reference
<
drawing
::
XDrawPageSupplier
>
xDrawPageSupplier
(
xIA
->
getByIndex
(
0
),
UNO_QUERY_THROW
);
uno
::
Reference
<
container
::
XIndexAccess
>
xDraws
(
xDrawPageSupplier
->
getDrawPage
(),
UNO_QUERY_THROW
);
CPPUNIT_ASSERT_EQUAL_MESSAGE
(
sFailedMessage
.
getStr
(),
static_cast
<
sal_Int32
>
(
2
),
xDraws
->
getCount
());
uno
::
Reference
<
drawing
::
XShape
>
xImage
(
xDraws
->
getByIndex
(
0
),
uno
::
UNO_QUERY
);
uno
::
Reference
<
beans
::
XPropertySet
>
XPropSet
(
xImage
,
uno
::
UNO_QUERY_THROW
);
// Check URL
{
OUString
sURL
;
XPropSet
->
getPropertyValue
(
"GraphicURL"
)
>>=
sURL
;
CPPUNIT_ASSERT_MESSAGE
(
sFailedMessage
.
getStr
(),
sURL
!=
OUString
(
"vnd.sun.star.GraphicObject:00000000000000000000000000000000"
));
}
// Check size
{
uno
::
Reference
<
graphic
::
XGraphic
>
xGraphic
;
XPropSet
->
getPropertyValue
(
"Graphic"
)
>>=
xGraphic
;
uno
::
Reference
<
awt
::
XBitmap
>
xBitmap
(
xGraphic
,
uno
::
UNO_QUERY
);
CPPUNIT_ASSERT_MESSAGE
(
sFailedMessage
.
getStr
(),
xBitmap
.
is
());
CPPUNIT_ASSERT_EQUAL_MESSAGE
(
sFailedMessage
.
getStr
(),
static_cast
<
sal_Int32
>
(
610
),
xBitmap
->
getSize
().
Width
);
CPPUNIT_ASSERT_EQUAL_MESSAGE
(
sFailedMessage
.
getStr
(),
static_cast
<
sal_Int32
>
(
381
),
xBitmap
->
getSize
().
Height
);
}
// Second Image
xImage
.
set
(
xDraws
->
getByIndex
(
1
),
uno
::
UNO_QUERY
);
XPropSet
.
set
(
xImage
,
uno
::
UNO_QUERY_THROW
);
// Check URL
{
OUString
sURL
;
XPropSet
->
getPropertyValue
(
"GraphicURL"
)
>>=
sURL
;
CPPUNIT_ASSERT_MESSAGE
(
sFailedMessage
.
getStr
(),
sURL
!=
OUString
(
"vnd.sun.star.GraphicObject:00000000000000000000000000000000"
));
}
// Check size
{
uno
::
Reference
<
graphic
::
XGraphic
>
xGraphic
;
XPropSet
->
getPropertyValue
(
"Graphic"
)
>>=
xGraphic
;
uno
::
Reference
<
awt
::
XBitmap
>
xBitmap
(
xGraphic
,
uno
::
UNO_QUERY
);
CPPUNIT_ASSERT_MESSAGE
(
sFailedMessage
.
getStr
(),
xBitmap
.
is
());
CPPUNIT_ASSERT_EQUAL_MESSAGE
(
sFailedMessage
.
getStr
(),
static_cast
<
sal_Int32
>
(
900
),
xBitmap
->
getSize
().
Width
);
CPPUNIT_ASSERT_EQUAL_MESSAGE
(
sFailedMessage
.
getStr
(),
static_cast
<
sal_Int32
>
(
600
),
xBitmap
->
getSize
().
Height
);
}
xDocSh2
->
DoClose
();
}
}
CPPUNIT_TEST_SUITE_REGISTRATION
(
ScExportTest
);
CPPUNIT_TEST_SUITE_REGISTRATION
(
ScExportTest
);
CPPUNIT_PLUGIN_IMPLEMENT
();
CPPUNIT_PLUGIN_IMPLEMENT
();
...
...
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