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
45cfdae9
Kaydet (Commit)
45cfdae9
authored
Mar 30, 2015
tarafından
László Németh
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
cleanup for SkipImages unit tests
Change-Id: I2232fda0acdc7e677e1da278405a8a4c90e00659
üst
e6958373
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
29 additions
and
22 deletions
+29
-22
globalfilter.cxx
sw/qa/extras/globalfilter/globalfilter.cxx
+29
-22
No files found.
sw/qa/extras/globalfilter/globalfilter.cxx
Dosyayı görüntüle @
45cfdae9
...
...
@@ -661,36 +661,36 @@ void Test::testSkipImages()
// during DOC and DOCX import, using the "SkipImages" FilterOptions.
const
char
*
aFilterNames
[][
2
]
=
{
{
"/sw/qa/extras/globalfilter/data/skipimages.doc"
,
""
},
{
"/sw/qa/extras/globalfilter/data/skipimages.doc"
,
NULL
},
{
"/sw/qa/extras/globalfilter/data/skipimages.doc"
,
"SkipImages"
},
{
"/sw/qa/extras/globalfilter/data/skipimages.docx"
,
""
},
{
"/sw/qa/extras/globalfilter/data/skipimages.docx"
,
NULL
},
{
"/sw/qa/extras/globalfilter/data/skipimages.docx"
,
"SkipImages"
}
};
// FilterOptions parameter (Value will be set before loadFromDesktop call)
uno
::
Sequence
<
beans
::
PropertyValue
>
args
(
1
);
args
[
0
].
Name
=
"FilterOptions"
;
args
[
0
].
Handle
=
-
1
;
args
[
0
].
State
=
beans
::
PropertyState_DIRECT_VALUE
;
for
(
size_t
nFilter
=
0
;
nFilter
<
SAL_N_ELEMENTS
(
aFilterNames
);
++
nFilter
)
{
bool
bSkipImages
=
*
(
aFilterNames
[
nFilter
][
1
])
!=
'\0'
;
bool
bSkipImages
=
aFilterNames
[
nFilter
][
1
]
!=
NULL
;
OString
sFailedMessage
=
OString
(
"Failed on filter: "
)
+
aFilterNames
[
nFilter
][
0
];
if
(
mxComponent
.
is
())
mxComponent
->
dispose
();
args
[
0
].
Value
<<=
OUString
::
createFromAscii
(
aFilterNames
[
nFilter
][
1
]);
mxComponent
=
loadFromDesktop
(
getURLFromSrc
(
aFilterNames
[
nFilter
][
0
]),
"com.sun.star.text.TextDocument"
,
args
);
// Check shapes (images, textboxes, custom shapes
if
(
bSkipImages
)
{
// FilterOptions parameter
uno
::
Sequence
<
beans
::
PropertyValue
>
args
(
1
);
args
[
0
].
Name
=
"FilterOptions"
;
args
[
0
].
Handle
=
-
1
;
args
[
0
].
Value
<<=
OUString
::
createFromAscii
(
aFilterNames
[
nFilter
][
1
]);
args
[
0
].
State
=
beans
::
PropertyState_DIRECT_VALUE
;
mxComponent
=
loadFromDesktop
(
getURLFromSrc
(
aFilterNames
[
nFilter
][
0
]),
"com.sun.star.text.TextDocument"
,
args
);
sFailedMessage
=
sFailedMessage
+
" - "
+
aFilterNames
[
nFilter
][
1
];
}
else
mxComponent
=
loadFromDesktop
(
getURLFromSrc
(
aFilterNames
[
nFilter
][
0
]),
"com.sun.star.text.TextDocument"
);
// Check shapes (images, textboxes, custom shapes)
uno
::
Reference
<
drawing
::
XDrawPageSupplier
>
xDrawPageSupplier
(
mxComponent
,
uno
::
UNO_QUERY
);
uno
::
Reference
<
container
::
XIndexAccess
>
xDraws
(
xDrawPageSupplier
->
getDrawPage
(),
uno
::
UNO_QUERY
);
const
OString
sFailedMessage
=
OString
(
"Failed on filter: "
)
+
aFilterNames
[
nFilter
][
0
]
+
" - "
+
aFilterNames
[
nFilter
][
1
];
uno
::
Reference
<
drawing
::
XShape
>
xShape
;
uno
::
Reference
<
graphic
::
XGraphic
>
xGraphic
;
uno
::
Reference
<
beans
::
XPropertySet
>
XPropSet
;
...
...
@@ -708,13 +708,20 @@ void Test::testSkipImages()
{
XPropSet
->
getPropertyValue
(
"Graphic"
)
>>=
xGraphic
;
xBitmap
.
set
(
xGraphic
,
uno
::
UNO_QUERY
);
if
(
xBitmap
.
is
())
nImageCount
++
;
if
(
xBitmap
.
is
())
nImageCount
++
;
}
catch
(
beans
::
UnknownPropertyException
&
)
{
/* ignore */
}
uno
::
Reference
<
text
::
XTextRange
>
xText
(
xShape
,
uno
::
UNO_QUERY
);
if
(
xText
.
is
())
{
uno
::
Reference
<
text
::
XTextRange
>
xText
(
xShape
,
uno
::
UNO_QUERY
);
if
(
xText
->
getString
().
startsWith
(
"Lorem ipsum"
))
bHasTextboxText
=
true
;
if
(
xText
->
getString
().
startsWith
(
"Nam pretium"
))
bHasCustomShapeText
=
true
;
OUString
shapeText
=
xText
->
getString
();
if
(
shapeText
.
startsWith
(
"Lorem ipsum"
))
bHasTextboxText
=
true
;
else
if
(
shapeText
.
startsWith
(
"Nam pretium"
))
bHasCustomShapeText
=
true
;
}
}
...
...
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