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
938ddf37
Kaydet (Commit)
938ddf37
authored
Şub 22, 2012
tarafından
Miklos Vajna
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
testcase for fdo#42465
üst
0915f1b3
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
35 additions
and
16 deletions
+35
-16
fdo42465.rtf
sw/qa/extras/rtftok/data/fdo42465.rtf
+4
-0
rtftok.cxx
sw/qa/extras/rtftok/rtftok.cxx
+31
-16
No files found.
sw/qa/extras/rtftok/data/fdo42465.rtf
0 → 100644
Dosyayı görüntüle @
938ddf37
{\rtf1
{\langfe1038\dbch\af14\afs24\alang1025\rtlch \ltrch\loch\fs24\lang1038\loch\f7
k\uc2 \u243\'c3\'b3d\uc1 }
\par }
sw/qa/extras/rtftok/rtftok.cxx
Dosyayı görüntüle @
938ddf37
...
...
@@ -58,6 +58,7 @@ public:
void
testN192129
();
void
testFdo45543
();
void
testN695479
();
void
testFdo42465
();
CPPUNIT_TEST_SUITE
(
RtfModelTest
);
#if !defined(MACOSX) && !defined(WNT)
...
...
@@ -65,11 +66,15 @@ public:
CPPUNIT_TEST
(
testN192129
);
CPPUNIT_TEST
(
testFdo45543
);
CPPUNIT_TEST
(
testN695479
);
CPPUNIT_TEST
(
testFdo42465
);
#endif
CPPUNIT_TEST_SUITE_END
();
private
:
/// Load an RTF file and make the document available via mxComponent.
void
load
(
const
OUString
&
rURL
);
/// Get the length of the whole document.
int
getLength
();
uno
::
Reference
<
lang
::
XComponent
>
mxComponent
;
};
...
...
@@ -78,6 +83,25 @@ void RtfModelTest::load(const OUString& rFilename)
mxComponent
=
loadFromDesktop
(
getURLFromSrc
(
"/sw/qa/extras/rtftok/data/"
)
+
rFilename
);
}
int
RtfModelTest
::
getLength
()
{
uno
::
Reference
<
text
::
XTextDocument
>
xTextDocument
(
mxComponent
,
uno
::
UNO_QUERY
);
uno
::
Reference
<
container
::
XEnumerationAccess
>
xParaEnumAccess
(
xTextDocument
->
getText
(),
uno
::
UNO_QUERY
);
uno
::
Reference
<
container
::
XEnumeration
>
xParaEnum
=
xParaEnumAccess
->
createEnumeration
();
OUStringBuffer
aBuf
;
while
(
xParaEnum
->
hasMoreElements
())
{
uno
::
Reference
<
container
::
XEnumerationAccess
>
xRangeEnumAccess
(
xParaEnum
->
nextElement
(),
uno
::
UNO_QUERY
);
uno
::
Reference
<
container
::
XEnumeration
>
xRangeEnum
=
xRangeEnumAccess
->
createEnumeration
();
while
(
xRangeEnum
->
hasMoreElements
())
{
uno
::
Reference
<
text
::
XTextRange
>
xRange
(
xRangeEnum
->
nextElement
(),
uno
::
UNO_QUERY
);
aBuf
.
append
(
xRange
->
getString
());
}
}
return
aBuf
.
getLength
();
}
void
RtfModelTest
::
setUp
()
{
test
::
BootstrapFixture
::
setUp
();
...
...
@@ -150,22 +174,7 @@ void RtfModelTest::testN192129()
void
RtfModelTest
::
testFdo45543
()
{
load
(
OUString
(
RTL_CONSTASCII_USTRINGPARAM
(
"fdo45543.rtf"
)));
uno
::
Reference
<
text
::
XTextDocument
>
xTextDocument
(
mxComponent
,
uno
::
UNO_QUERY
);
uno
::
Reference
<
container
::
XEnumerationAccess
>
xParaEnumAccess
(
xTextDocument
->
getText
(),
uno
::
UNO_QUERY
);
uno
::
Reference
<
container
::
XEnumeration
>
xParaEnum
=
xParaEnumAccess
->
createEnumeration
();
OUStringBuffer
aBuf
;
while
(
xParaEnum
->
hasMoreElements
())
{
uno
::
Reference
<
container
::
XEnumerationAccess
>
xRangeEnumAccess
(
xParaEnum
->
nextElement
(),
uno
::
UNO_QUERY
);
uno
::
Reference
<
container
::
XEnumeration
>
xRangeEnum
=
xRangeEnumAccess
->
createEnumeration
();
while
(
xRangeEnum
->
hasMoreElements
())
{
uno
::
Reference
<
text
::
XTextRange
>
xRange
(
xRangeEnum
->
nextElement
(),
uno
::
UNO_QUERY
);
aBuf
.
append
(
xRange
->
getString
());
}
}
CPPUNIT_ASSERT_EQUAL
((
sal_Int32
)
5
,
aBuf
.
getLength
());
CPPUNIT_ASSERT_EQUAL
(
5
,
getLength
());
}
void
RtfModelTest
::
testN695479
()
...
...
@@ -229,6 +238,12 @@ void RtfModelTest::testN695479()
CPPUNIT_ASSERT
(
bDrawFound
);
}
void
RtfModelTest
::
testFdo42465
()
{
load
(
OUString
(
RTL_CONSTASCII_USTRINGPARAM
(
"fdo42465.rtf"
)));
CPPUNIT_ASSERT_EQUAL
(
3
,
getLength
());
}
CPPUNIT_TEST_SUITE_REGISTRATION
(
RtfModelTest
);
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