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
531a052b
Kaydet (Commit)
531a052b
authored
Haz 28, 2012
tarafından
Noel Grandin
Kaydeden (comit)
Michael Stahl
Haz 29, 2012
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Java5 update - convert to use generics
Change-Id: Ie9d9b278341132d08477d015245fedf2b66f62fd
üst
8aa97e36
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
73 additions
and
85 deletions
+73
-85
AccessibleRelationSet.java
sw/qa/complex/accessibility/AccessibleRelationSet.java
+10
-12
CheckChangeColor.java
sw/qa/complex/checkColor/CheckChangeColor.java
+3
-3
CheckIndeterminateState.java
...a/complex/indeterminateState/CheckIndeterminateState.java
+2
-4
CheckBookmarks.java
sw/qa/complex/writer/CheckBookmarks.java
+9
-9
CheckCrossReferences.java
sw/qa/complex/writer/CheckCrossReferences.java
+33
-33
CheckFields.java
sw/qa/complex/writer/CheckFields.java
+8
-15
CheckFlies.java
sw/qa/complex/writer/CheckFlies.java
+6
-6
LoadSaveTest.java
sw/qa/complex/writer/LoadSaveTest.java
+2
-3
TextPortionEnumerationTest.java
sw/qa/complex/writer/TextPortionEnumerationTest.java
+0
-0
No files found.
sw/qa/complex/accessibility/AccessibleRelationSet.java
Dosyayı görüntüle @
531a052b
...
...
@@ -61,7 +61,7 @@ public class AccessibleRelationSet {
try
{
firstrelation
=
set
.
getRelation
(
0
).
RelationType
;
Object
oTmp
=
set
.
getRelation
(
0
).
TargetSet
[
0
];
atarget
=
(
XAccessibleText
)
UnoRuntime
.
queryInterface
(
XAccessibleText
.
class
,
oTmp
);
atarget
=
UnoRuntime
.
queryInterface
(
XAccessibleText
.
class
,
oTmp
);
}
catch
(
IndexOutOfBoundsException
e
)
{
fail
(
"Exception when getting relations "
+
e
);
}
...
...
@@ -72,7 +72,7 @@ public class AccessibleRelationSet {
types
[
firstrelation
]);
XAccessibleText
paraTxt2
=
(
XAccessibleText
)
UnoRuntime
.
queryInterface
(
XAccessibleText
.
class
,
para2
);
UnoRuntime
.
queryInterface
(
XAccessibleText
.
class
,
para2
);
assertEquals
(
"didn't gain correct target paragraph"
,
atarget
.
getText
(),
paraTxt2
.
getText
());
...
...
@@ -92,13 +92,13 @@ public class AccessibleRelationSet {
if
(
tmprelation
==
1
)
{
Object
oTmp
=
set
.
getRelation
(
0
).
TargetSet
[
0
];
atargets
[
0
]
=
(
XAccessibleText
)
UnoRuntime
.
queryInterface
(
XAccessibleText
.
class
,
oTmp
);
atargets
[
0
]
=
UnoRuntime
.
queryInterface
(
XAccessibleText
.
class
,
oTmp
);
relationtypes
[
0
]
=
tmprelation
;
}
else
if
(
tmprelation
==
2
)
{
Object
oTmp
=
set
.
getRelation
(
0
).
TargetSet
[
0
];
atargets
[
1
]
=
(
XAccessibleText
)
UnoRuntime
.
queryInterface
(
XAccessibleText
.
class
,
oTmp
);
atargets
[
1
]
=
UnoRuntime
.
queryInterface
(
XAccessibleText
.
class
,
oTmp
);
relationtypes
[
1
]
=
tmprelation
;
}
else
...
...
@@ -109,13 +109,13 @@ public class AccessibleRelationSet {
if
(
tmprelation
==
1
)
{
Object
oTmp
=
set
.
getRelation
(
1
).
TargetSet
[
0
];
atargets
[
0
]
=
(
XAccessibleText
)
UnoRuntime
.
queryInterface
(
XAccessibleText
.
class
,
oTmp
);
atargets
[
0
]
=
UnoRuntime
.
queryInterface
(
XAccessibleText
.
class
,
oTmp
);
relationtypes
[
0
]
=
tmprelation
;
}
else
if
(
tmprelation
==
2
)
{
Object
oTmp
=
set
.
getRelation
(
1
).
TargetSet
[
0
];
atargets
[
1
]
=
(
XAccessibleText
)
UnoRuntime
.
queryInterface
(
XAccessibleText
.
class
,
oTmp
);
atargets
[
1
]
=
UnoRuntime
.
queryInterface
(
XAccessibleText
.
class
,
oTmp
);
relationtypes
[
1
]
=
tmprelation
;
}
else
...
...
@@ -132,7 +132,7 @@ public class AccessibleRelationSet {
types
[
relationtypes
[
0
]]);
XAccessibleText
paraTxt1
=
(
XAccessibleText
)
UnoRuntime
.
queryInterface
(
XAccessibleText
.
class
,
para1
);
UnoRuntime
.
queryInterface
(
XAccessibleText
.
class
,
para1
);
assertEquals
(
"didn't gain correct target paragraph"
,
atargets
[
0
].
getText
(),
paraTxt1
.
getText
());
...
...
@@ -142,7 +142,7 @@ public class AccessibleRelationSet {
types
[
relationtypes
[
1
]]);
XAccessibleText
paraTxt3
=
(
XAccessibleText
)
UnoRuntime
.
queryInterface
(
XAccessibleText
.
class
,
para3
);
UnoRuntime
.
queryInterface
(
XAccessibleText
.
class
,
para3
);
assertEquals
(
"didn't gain correct target paragraph"
,
atargets
[
1
].
getText
(),
paraTxt3
.
getText
());
...
...
@@ -167,8 +167,7 @@ public class AccessibleRelationSet {
oCursor
,
ControlCharacter
.
PARAGRAPH_BREAK
,
false
);
}
XModel
aModel
=
(
XModel
)
UnoRuntime
.
queryInterface
(
XModel
.
class
,
xTextDoc
);
XModel
aModel
=
UnoRuntime
.
queryInterface
(
XModel
.
class
,
xTextDoc
);
AccessibilityTools
at
=
new
AccessibilityTools
();
...
...
@@ -187,8 +186,7 @@ public class AccessibleRelationSet {
}
public
XAccessibleRelationSet
getAccessibleRelation
(
XAccessible
xAcc
)
{
XAccessibleContext
oObj
=
(
XAccessibleContext
)
UnoRuntime
.
queryInterface
(
XAccessibleContext
.
class
,
xAcc
);
XAccessibleContext
oObj
=
UnoRuntime
.
queryInterface
(
XAccessibleContext
.
class
,
xAcc
);
XAccessibleRelationSet
set
=
oObj
.
getAccessibleRelationSet
();
return
set
;
...
...
sw/qa/complex/checkColor/CheckChangeColor.java
Dosyayı görüntüle @
531a052b
...
...
@@ -49,15 +49,15 @@ public class CheckChangeColor {
*/
@Test
public
void
checkChangeColor
()
throws
Exception
{
// create a supplier to get the Style family collection
XStyleFamiliesSupplier
xSupplier
=
(
XStyleFamiliesSupplier
)
UnoRuntime
.
queryInterface
(
XStyleFamiliesSupplier
.
class
,
document
);
XStyleFamiliesSupplier
xSupplier
=
UnoRuntime
.
queryInterface
(
XStyleFamiliesSupplier
.
class
,
document
);
// get the NameAccess interface from the Style family collection
XNameAccess
xNameAccess
=
xSupplier
.
getStyleFamilies
();
XNameContainer
xPageStyleCollection
=
(
XNameContainer
)
UnoRuntime
.
queryInterface
(
XNameContainer
.
class
,
xNameAccess
.
getByName
(
"PageStyles"
));
XNameContainer
xPageStyleCollection
=
UnoRuntime
.
queryInterface
(
XNameContainer
.
class
,
xNameAccess
.
getByName
(
"PageStyles"
));
// create a PropertySet to set the properties for the new Pagestyle
XPropertySet
xPropertySet
=
(
XPropertySet
)
UnoRuntime
.
queryInterface
(
XPropertySet
.
class
,
xPageStyleCollection
.
getByName
(
"Standard"
)
);
XPropertySet
xPropertySet
=
UnoRuntime
.
queryInterface
(
XPropertySet
.
class
,
xPageStyleCollection
.
getByName
(
"Standard"
)
);
assertEquals
(
"BackColor"
,
new
Any
(
Type
.
LONG
,
0xFFFFFFFF
),
...
...
sw/qa/complex/indeterminateState/CheckIndeterminateState.java
Dosyayı görüntüle @
531a052b
...
...
@@ -54,8 +54,7 @@ public class CheckIndeterminateState {
* The used tools are in project qadevOOo/runner
*/
@Test
public
void
checkToolBoxItem
()
throws
Exception
{
XModel
aModel
=
(
XModel
)
UnoRuntime
.
queryInterface
(
XModel
.
class
,
document
);
XModel
aModel
=
UnoRuntime
.
queryInterface
(
XModel
.
class
,
document
);
XController
xController
=
aModel
.
getCurrentController
();
...
...
@@ -78,8 +77,7 @@ public class CheckIndeterminateState {
AccessibleRole
.
TOGGLE_BUTTON
,
"Bold"
);
assertNotNull
(
"Found a TOGGLE_BUTTON"
,
oObj
);
XAccessibleContext
oContext
=
(
XAccessibleContext
)
UnoRuntime
.
queryInterface
(
XAccessibleContext
.
class
,
oObj
);
XAccessibleContext
oContext
=
UnoRuntime
.
queryInterface
(
XAccessibleContext
.
class
,
oObj
);
XAccessibleStateSet
oSet
=
oContext
.
getAccessibleStateSet
();
...
...
sw/qa/complex/writer/CheckBookmarks.java
Dosyayı görüntüle @
531a052b
...
...
@@ -63,13 +63,13 @@ class BookmarkHashes {
throws
com
.
sun
.
star
.
uno
.
Exception
,
java
.
security
.
NoSuchAlgorithmException
{
StringBuffer
buffer
=
new
StringBuffer
(
""
);
XBookmarksSupplier
xBookmarksSupplier
=
(
XBookmarksSupplier
)
UnoRuntime
.
queryInterface
(
XBookmarksSupplier
xBookmarksSupplier
=
UnoRuntime
.
queryInterface
(
XBookmarksSupplier
.
class
,
xDoc
);
XNameAccess
xBookmarks
=
xBookmarksSupplier
.
getBookmarks
();
for
(
String
sBookmarkname
:
xBookmarks
.
getElementNames
())
{
Object
xBookmark
=
xBookmarks
.
getByName
(
sBookmarkname
);
XTextContent
xBookmarkAsContent
=
(
XTextContent
)
UnoRuntime
.
queryInterface
(
XTextContent
xBookmarkAsContent
=
UnoRuntime
.
queryInterface
(
XTextContent
.
class
,
xBookmark
);
buffer
.
append
(
sBookmarkname
);
...
...
@@ -152,7 +152,7 @@ public class CheckBookmarks {
throws
com
.
sun
.
star
.
uno
.
Exception
{
XText
xText
=
m_xDoc
.
getText
();
XSimpleText
xSimpleText
=
(
XSimpleText
)
UnoRuntime
.
queryInterface
(
XSimpleText
xSimpleText
=
UnoRuntime
.
queryInterface
(
XSimpleText
.
class
,
xText
);
for
(
int
nPara
=
0
;
nPara
<
10
;
++
nPara
)
{
...
...
@@ -165,7 +165,7 @@ public class CheckBookmarks {
xWordCrsr
.
setString
(
" "
);
}
XTextCursor
xParaCrsr
=
xText
.
createTextCursor
();
XTextRange
xParaCrsrAsRange
=
(
XTextRange
)
UnoRuntime
.
queryInterface
(
XTextRange
xParaCrsrAsRange
=
UnoRuntime
.
queryInterface
(
XTextRange
.
class
,
xParaCrsr
);
xText
.
insertControlCharacter
(
xParaCrsrAsRange
,
com
.
sun
.
star
.
text
.
ControlCharacter
.
PARAGRAPH_BREAK
,
false
);
...
...
@@ -203,7 +203,7 @@ public class CheckBookmarks {
XTextCursor
xCrsr
=
m_xDoc
.
getText
().
createTextCursor
();
for
(
int
i
=
0
;
i
<
30
;
i
++)
{
xCrsr
.
goRight
((
short
)
rnd
.
nextInt
(
300
),
false
);
XTextRange
xCrsrAsRange
=
(
XTextRange
)
UnoRuntime
.
queryInterface
(
XTextRange
xCrsrAsRange
=
UnoRuntime
.
queryInterface
(
XTextRange
.
class
,
xCrsr
);
xText
.
insertControlCharacter
(
xCrsrAsRange
,
com
.
sun
.
star
.
text
.
ControlCharacter
.
PARAGRAPH_BREAK
,
false
);
...
...
@@ -213,16 +213,16 @@ public class CheckBookmarks {
private
void
insertBookmark
(
XTextCursor
crsr
,
String
name
,
String
content
)
throws
com
.
sun
.
star
.
uno
.
Exception
{
XMultiServiceFactory
xDocFactory
=
(
XMultiServiceFactory
)
UnoRuntime
.
queryInterface
(
XMultiServiceFactory
xDocFactory
=
UnoRuntime
.
queryInterface
(
XMultiServiceFactory
.
class
,
m_xDoc
);
Object
xBookmark
=
xDocFactory
.
createInstance
(
"com.sun.star.text.Bookmark"
);
XTextContent
xBookmarkAsTextContent
=
(
XTextContent
)
UnoRuntime
.
queryInterface
(
XTextContent
xBookmarkAsTextContent
=
UnoRuntime
.
queryInterface
(
XTextContent
.
class
,
xBookmark
);
crsr
.
setString
(
content
);
XNamed
xBookmarkAsNamed
=
(
XNamed
)
UnoRuntime
.
queryInterface
(
XNamed
xBookmarkAsNamed
=
UnoRuntime
.
queryInterface
(
XNamed
.
class
,
xBookmark
);
xBookmarkAsNamed
.
setName
(
name
);
...
...
@@ -241,7 +241,7 @@ public class CheckBookmarks {
aStoreProperties
[
0
].
Value
=
true
;
aStoreProperties
[
1
].
Name
=
"FilterName"
;
aStoreProperties
[
1
].
Value
=
sFilter
;
XStorable
xStorable
=
(
XStorable
)
UnoRuntime
.
queryInterface
(
XStorable
xStorable
=
UnoRuntime
.
queryInterface
(
XStorable
.
class
,
m_xDoc
);
xStorable
.
storeToURL
(
sFileUrl
,
aStoreProperties
);
...
...
sw/qa/complex/writer/CheckCrossReferences.java
Dosyayı görüntüle @
531a052b
...
...
@@ -45,12 +45,12 @@ public class CheckCrossReferences {
if
(
xPortionEnum
!=
null
)
{
while
(
xPortionEnum
.
hasMoreElements
()
)
{
com
.
sun
.
star
.
beans
.
XPropertySet
xPortionProps
=
(
com
.
sun
.
star
.
beans
.
XPropertySet
)
UnoRuntime
.
queryInterface
(
com
.
sun
.
star
.
beans
.
XPropertySet
.
class
,
xPortionEnum
.
nextElement
());
UnoRuntime
.
queryInterface
(
com
.
sun
.
star
.
beans
.
XPropertySet
.
class
,
xPortionEnum
.
nextElement
());
final
String
sPortionType
=
xPortionProps
.
getPropertyValue
(
"TextPortionType"
).
toString
();
if
(
sPortionType
.
equals
(
"TextField"
)
)
{
com
.
sun
.
star
.
text
.
XTextField
xField
=
(
com
.
sun
.
star
.
text
.
XTextField
)
UnoRuntime
.
queryInterface
(
com
.
sun
.
star
.
text
.
XTextField
xField
=
UnoRuntime
.
queryInterface
(
com
.
sun
.
star
.
text
.
XTextField
.
class
,
xPortionProps
.
getPropertyValue
(
"TextField"
)
);
assertNotNull
(
"Cannot retrieve next field."
,
xField
);
...
...
@@ -61,17 +61,17 @@ public class CheckCrossReferences {
while
(
xParaEnum
.
hasMoreElements
()
)
{
com
.
sun
.
star
.
container
.
XEnumerationAccess
aPara
=
(
com
.
sun
.
star
.
container
.
XEnumerationAccess
)
UnoRuntime
.
queryInterface
(
com
.
sun
.
star
.
container
.
XEnumerationAccess
.
class
,
xParaEnum
.
nextElement
());
UnoRuntime
.
queryInterface
(
com
.
sun
.
star
.
container
.
XEnumerationAccess
.
class
,
xParaEnum
.
nextElement
());
xPortionEnum
=
aPara
.
createEnumeration
();
while
(
xPortionEnum
.
hasMoreElements
()
)
{
com
.
sun
.
star
.
beans
.
XPropertySet
xPortionProps
=
(
com
.
sun
.
star
.
beans
.
XPropertySet
)
UnoRuntime
.
queryInterface
(
com
.
sun
.
star
.
beans
.
XPropertySet
.
class
,
xPortionEnum
.
nextElement
());
UnoRuntime
.
queryInterface
(
com
.
sun
.
star
.
beans
.
XPropertySet
.
class
,
xPortionEnum
.
nextElement
());
final
String
sPortionType
=
xPortionProps
.
getPropertyValue
(
"TextPortionType"
).
toString
();
if
(
sPortionType
.
equals
(
"TextField"
)
)
{
com
.
sun
.
star
.
text
.
XTextField
xField
=
(
com
.
sun
.
star
.
text
.
XTextField
)
UnoRuntime
.
queryInterface
(
com
.
sun
.
star
.
text
.
XTextField
xField
=
UnoRuntime
.
queryInterface
(
com
.
sun
.
star
.
text
.
XTextField
.
class
,
xPortionProps
.
getPropertyValue
(
"TextField"
)
);
assertNotNull
(
"Cannot retrieve next field."
,
xField
);
...
...
@@ -87,8 +87,8 @@ public class CheckCrossReferences {
public
com
.
sun
.
star
.
beans
.
XPropertySet
getFieldProps
(
com
.
sun
.
star
.
text
.
XTextField
xField
)
{
com
.
sun
.
star
.
beans
.
XPropertySet
xProps
=
(
com
.
sun
.
star
.
beans
.
XPropertySet
)
UnoRuntime
.
queryInterface
(
com
.
sun
.
star
.
beans
.
XPropertySet
.
class
,
xField
);
UnoRuntime
.
queryInterface
(
com
.
sun
.
star
.
beans
.
XPropertySet
.
class
,
xField
);
assertNotNull
(
"Cannot retrieve field properties."
,
xProps
);
...
...
@@ -116,17 +116,17 @@ public class CheckCrossReferences {
// setup paragraph enumeration
{
com
.
sun
.
star
.
container
.
XEnumerationAccess
xParaEnumAccess
=
(
com
.
sun
.
star
.
container
.
XEnumerationAccess
)
UnoRuntime
.
queryInterface
(
com
.
sun
.
star
.
container
.
XEnumerationAccess
.
class
,
document
.
getText
());
UnoRuntime
.
queryInterface
(
com
.
sun
.
star
.
container
.
XEnumerationAccess
.
class
,
document
.
getText
());
xParaEnum
=
xParaEnumAccess
.
createEnumeration
();
}
// get field refresher
{
com
.
sun
.
star
.
text
.
XTextFieldsSupplier
xFieldSupp
=
(
com
.
sun
.
star
.
text
.
XTextFieldsSupplier
)
UnoRuntime
.
queryInterface
(
com
.
sun
.
star
.
text
.
XTextFieldsSupplier
.
class
,
document
);
xFldsRefresh
=
(
com
.
sun
.
star
.
util
.
XRefreshable
)
UnoRuntime
.
queryInterface
(
UnoRuntime
.
queryInterface
(
com
.
sun
.
star
.
text
.
XTextFieldsSupplier
.
class
,
document
);
xFldsRefresh
=
UnoRuntime
.
queryInterface
(
com
.
sun
.
star
.
util
.
XRefreshable
.
class
,
xFieldSupp
.
getTextFields
());
}
...
...
@@ -195,14 +195,14 @@ public class CheckCrossReferences {
{
// restart paragraph enumeration
com
.
sun
.
star
.
container
.
XEnumerationAccess
xParaEnumAccess
=
(
com
.
sun
.
star
.
container
.
XEnumerationAccess
)
UnoRuntime
.
queryInterface
(
com
.
sun
.
star
.
container
.
XEnumerationAccess
.
class
,
document
.
getText
());
UnoRuntime
.
queryInterface
(
com
.
sun
.
star
.
container
.
XEnumerationAccess
.
class
,
document
.
getText
());
xParaEnum
=
xParaEnumAccess
.
createEnumeration
();
// iterate on the paragraphs to find certain paragraph to insert the bookmark
com
.
sun
.
star
.
text
.
XTextRange
xParaTextRange
=
null
;
while
(
xParaEnum
.
hasMoreElements
()
)
{
xParaTextRange
=
(
com
.
sun
.
star
.
text
.
XTextRange
)
UnoRuntime
.
queryInterface
(
xParaTextRange
=
UnoRuntime
.
queryInterface
(
com
.
sun
.
star
.
text
.
XTextRange
.
class
,
xParaEnum
.
nextElement
());
if
(
xParaTextRange
.
getString
().
equals
(
"J"
)
)
{
break
;
...
...
@@ -216,44 +216,44 @@ public class CheckCrossReferences {
xParaTextRange
);
// insert bookmark
XMultiServiceFactory
xFac
=
(
XMultiServiceFactory
)
UnoRuntime
.
queryInterface
(
XMultiServiceFactory
xFac
=
UnoRuntime
.
queryInterface
(
XMultiServiceFactory
.
class
,
document
);
final
String
cBookmarkName
=
"__RefNumPara__47114711"
;
com
.
sun
.
star
.
text
.
XTextContent
xBookmark
=
(
com
.
sun
.
star
.
text
.
XTextContent
)
UnoRuntime
.
queryInterface
(
com
.
sun
.
star
.
text
.
XTextContent
.
class
,
xFac
.
createInstance
(
"com.sun.star.text.Bookmark"
)
);
UnoRuntime
.
queryInterface
(
com
.
sun
.
star
.
text
.
XTextContent
.
class
,
xFac
.
createInstance
(
"com.sun.star.text.Bookmark"
)
);
if
(
xBookmark
!=
null
)
{
com
.
sun
.
star
.
container
.
XNamed
xName
=
(
com
.
sun
.
star
.
container
.
XNamed
)
UnoRuntime
.
queryInterface
(
com
.
sun
.
star
.
container
.
XNamed
.
class
,
xBookmark
);
UnoRuntime
.
queryInterface
(
com
.
sun
.
star
.
container
.
XNamed
.
class
,
xBookmark
);
xName
.
setName
(
cBookmarkName
);
xBookmark
.
attach
(
xParaTextRange
.
getStart
());
}
// insert reference field, which references the inserted bookmark
com
.
sun
.
star
.
text
.
XTextContent
xNewField
=
(
com
.
sun
.
star
.
text
.
XTextContent
)
UnoRuntime
.
queryInterface
(
com
.
sun
.
star
.
text
.
XTextContent
.
class
,
xFac
.
createInstance
(
"com.sun.star.text.TextField.GetReference"
)
);
UnoRuntime
.
queryInterface
(
com
.
sun
.
star
.
text
.
XTextContent
.
class
,
xFac
.
createInstance
(
"com.sun.star.text.TextField.GetReference"
)
);
if
(
xNewField
!=
null
)
{
com
.
sun
.
star
.
beans
.
XPropertySet
xFieldProps
=
(
com
.
sun
.
star
.
beans
.
XPropertySet
)
UnoRuntime
.
queryInterface
(
com
.
sun
.
star
.
beans
.
XPropertySet
.
class
,
xNewField
);
UnoRuntime
.
queryInterface
(
com
.
sun
.
star
.
beans
.
XPropertySet
.
class
,
xNewField
);
xFieldProps
.
setPropertyValue
(
"ReferenceFieldPart"
,
new
Short
(
com
.
sun
.
star
.
text
.
ReferenceFieldPart
.
TEXT
)
);
xFieldProps
.
setPropertyValue
(
"ReferenceFieldSource"
,
new
Short
(
com
.
sun
.
star
.
text
.
ReferenceFieldSource
.
BOOKMARK
)
);
xFieldProps
.
setPropertyValue
(
"SourceName"
,
cBookmarkName
);
com
.
sun
.
star
.
text
.
XTextRange
xFieldTextRange
=
(
com
.
sun
.
star
.
text
.
XTextRange
)
UnoRuntime
.
queryInterface
(
com
.
sun
.
star
.
text
.
XTextRange
.
class
,
xParaEnum
.
nextElement
());
UnoRuntime
.
queryInterface
(
com
.
sun
.
star
.
text
.
XTextRange
.
class
,
xParaEnum
.
nextElement
());
xNewField
.
attach
(
xFieldTextRange
.
getEnd
());
xFldsRefresh
.
refresh
();
}
// check inserted reference field
com
.
sun
.
star
.
text
.
XTextField
xField
=
(
com
.
sun
.
star
.
text
.
XTextField
)
UnoRuntime
.
queryInterface
(
com
.
sun
.
star
.
text
.
XTextField
.
class
,
xNewField
);
UnoRuntime
.
queryInterface
(
com
.
sun
.
star
.
text
.
XTextField
.
class
,
xNewField
);
assertEquals
(
"inserted reference field doesn't has correct field result"
,
"J"
,
xField
.
getPresentation
(
false
)
);
...
...
sw/qa/complex/writer/CheckFields.java
Dosyayı görüntüle @
531a052b
...
...
@@ -105,11 +105,9 @@ public class CheckFields
String
file
=
TestDocument
.
getUrl
(
"fdo39694.ott"
);
XComponent
xComp
=
util
.
DesktopTools
.
loadDoc
(
m_xMSF
,
file
,
loadProps
);
XTextDocument
xTextDoc
=
(
XTextDocument
)
UnoRuntime
.
queryInterface
(
XTextDocument
.
class
,
xComp
);
XTextDocument
xTextDoc
=
UnoRuntime
.
queryInterface
(
XTextDocument
.
class
,
xComp
);
XTextFieldsSupplier
xTFS
=
(
XTextFieldsSupplier
)
UnoRuntime
.
queryInterface
(
XTextFieldsSupplier
.
class
,
xComp
);
XTextFieldsSupplier
xTFS
=
UnoRuntime
.
queryInterface
(
XTextFieldsSupplier
.
class
,
xComp
);
XEnumeration
xEnum
=
xTFS
.
getTextFields
().
createEnumeration
();
Set
<
String
>
placeholders
=
new
HashSet
<
String
>();
placeholders
.
add
(
"<Kadr1>"
);
...
...
@@ -123,12 +121,10 @@ public class CheckFields
while
(
xEnum
.
hasMoreElements
())
{
Object
xField
=
xEnum
.
nextElement
();
XServiceInfo
xSI
=
(
XServiceInfo
)
UnoRuntime
.
queryInterface
(
XServiceInfo
.
class
,
xField
);
XServiceInfo
xSI
=
UnoRuntime
.
queryInterface
(
XServiceInfo
.
class
,
xField
);
if
(
xSI
.
supportsService
(
"com.sun.star.text.TextField.JumpEdit"
))
{
XTextContent
xContent
=
(
XTextContent
)
UnoRuntime
.
queryInterface
(
XTextContent
.
class
,
xField
);
XTextContent
xContent
=
UnoRuntime
.
queryInterface
(
XTextContent
.
class
,
xField
);
XTextRange
xAnchor
=
xContent
.
getAnchor
();
String
readContent
=
xAnchor
.
getString
();
if
(!
placeholders
.
remove
(
readContent
))
...
...
@@ -139,7 +135,7 @@ public class CheckFields
}
}
assertTrue
(
placeholders
.
isEmpty
());
XCloseable
xClos
=
(
XCloseable
)
UnoRuntime
.
queryInterface
(
XCloseable
xClos
=
UnoRuntime
.
queryInterface
(
XCloseable
.
class
,
xComp
);
if
(
xClos
!=
null
)
{
xClos
.
close
(
true
);
...
...
@@ -149,19 +145,16 @@ public class CheckFields
@Test
public
void
test_fdo42073
()
throws
Exception
{
XMultiServiceFactory
xDocFactory
=
(
XMultiServiceFactory
)
UnoRuntime
.
queryInterface
(
XMultiServiceFactory
.
class
,
m_xDoc
);
XMultiServiceFactory
xDocFactory
=
UnoRuntime
.
queryInterface
(
XMultiServiceFactory
.
class
,
m_xDoc
);
Object
xField
=
xDocFactory
.
createInstance
(
"com.sun.star.text.TextField.Input"
);
XText
xBodyText
=
m_xDoc
.
getText
();
XTextCursor
xCursor
=
xBodyText
.
createTextCursor
();
XTextField
xTextField
=
(
XTextField
)
UnoRuntime
.
queryInterface
(
XTextField
.
class
,
xField
);
XTextField
xTextField
=
UnoRuntime
.
queryInterface
(
XTextField
.
class
,
xField
);
xBodyText
.
insertTextContent
(
xCursor
,
xTextField
,
true
);
XPropertySet
xPropSet
=
(
XPropertySet
)
UnoRuntime
.
queryInterface
(
XPropertySet
.
class
,
xField
);
XPropertySet
xPropSet
=
UnoRuntime
.
queryInterface
(
XPropertySet
.
class
,
xField
);
{
Object
readContent
=
xPropSet
.
getPropertyValue
(
"Content"
);
assertEquals
(
""
,
readContent
);
...
...
sw/qa/complex/writer/CheckFlies.java
Dosyayı görüntüle @
531a052b
...
...
@@ -41,15 +41,15 @@ public class CheckFlies {
@Test
public
void
checkFlies
()
throws
com
.
sun
.
star
.
uno
.
Exception
{
com
.
sun
.
star
.
text
.
XTextFramesSupplier
xTFS
=
(
com
.
sun
.
star
.
text
.
XTextFramesSupplier
)
UnoRuntime
.
queryInterface
(
com
.
sun
.
star
.
text
.
XTextFramesSupplier
xTFS
=
UnoRuntime
.
queryInterface
(
com
.
sun
.
star
.
text
.
XTextFramesSupplier
.
class
,
document
);
checkTextFrames
(
xTFS
);
com
.
sun
.
star
.
text
.
XTextGraphicObjectsSupplier
xTGOS
=
(
com
.
sun
.
star
.
text
.
XTextGraphicObjectsSupplier
)
UnoRuntime
.
queryInterface
(
com
.
sun
.
star
.
text
.
XTextGraphicObjectsSupplier
xTGOS
=
UnoRuntime
.
queryInterface
(
com
.
sun
.
star
.
text
.
XTextGraphicObjectsSupplier
.
class
,
document
);
checkGraphicFrames
(
xTGOS
);
com
.
sun
.
star
.
text
.
XTextEmbeddedObjectsSupplier
xTEOS
=
(
com
.
sun
.
star
.
text
.
XTextEmbeddedObjectsSupplier
)
UnoRuntime
.
queryInterface
(
com
.
sun
.
star
.
text
.
XTextEmbeddedObjectsSupplier
xTEOS
=
UnoRuntime
.
queryInterface
(
com
.
sun
.
star
.
text
.
XTextEmbeddedObjectsSupplier
.
class
,
document
);
checkEmbeddedFrames
(
xTEOS
);
...
...
@@ -86,7 +86,7 @@ public class CheckFlies {
"Has nonexisting embedded frame"
,
xEmbeddedFrames
.
hasByName
(
"Nonexisting embedded frame"
));
com
.
sun
.
star
.
container
.
XIndexAccess
xEmbeddedFramesIdx
=
(
com
.
sun
.
star
.
container
.
XIndexAccess
)
UnoRuntime
.
queryInterface
(
com
.
sun
.
star
.
container
.
XIndexAccess
xEmbeddedFramesIdx
=
UnoRuntime
.
queryInterface
(
com
.
sun
.
star
.
container
.
XIndexAccess
.
class
,
xEmbeddedFrames
);
assertEquals
(
...
...
@@ -129,7 +129,7 @@ public class CheckFlies {
"Has nonexisting graphics frame"
,
xGraphicFrames
.
hasByName
(
"Nonexisting graphics frame"
));
com
.
sun
.
star
.
container
.
XIndexAccess
xGraphicFramesIdx
=
(
com
.
sun
.
star
.
container
.
XIndexAccess
)
UnoRuntime
.
queryInterface
(
com
.
sun
.
star
.
container
.
XIndexAccess
xGraphicFramesIdx
=
UnoRuntime
.
queryInterface
(
com
.
sun
.
star
.
container
.
XIndexAccess
.
class
,
xGraphicFrames
);
assertEquals
(
...
...
@@ -173,7 +173,7 @@ public class CheckFlies {
"Has nonexisting text frame."
,
xTextFrames
.
hasByName
(
"Nonexisting text frame"
));
com
.
sun
.
star
.
container
.
XIndexAccess
xTextFramesIdx
=
(
com
.
sun
.
star
.
container
.
XIndexAccess
)
UnoRuntime
.
queryInterface
(
com
.
sun
.
star
.
container
.
XIndexAccess
xTextFramesIdx
=
UnoRuntime
.
queryInterface
(
com
.
sun
.
star
.
container
.
XIndexAccess
.
class
,
xTextFrames
);
assertEquals
(
...
...
sw/qa/complex/writer/LoadSaveTest.java
Dosyayı görüntüle @
531a052b
...
...
@@ -86,8 +86,7 @@ public class LoadSaveTest
XMultiServiceFactory
.
class
,
m_xContext
.
getServiceManager
());
Object
oGEB
=
m_xMSF
.
createInstance
(
"com.sun.star.frame.GlobalEventBroadcaster"
);
m_xGEB
=
(
XDocumentEventBroadcaster
)
UnoRuntime
.
queryInterface
(
XDocumentEventBroadcaster
.
class
,
oGEB
);
m_xGEB
=
UnoRuntime
.
queryInterface
(
XDocumentEventBroadcaster
.
class
,
oGEB
);
assertNotNull
(
"could not get global event broadcaster."
,
m_xGEB
);
m_TmpDir
=
util
.
utils
.
getOfficeTemp
/*Dir*/
(
m_xMSF
);
System
.
out
.
println
(
"tempdir: "
+
m_TmpDir
);
...
...
@@ -145,7 +144,7 @@ public class LoadSaveTest
System
.
out
.
println
(
"Storing document: "
+
fileName
+
" ..."
);
XStorable
xStor
=
(
XStorable
)
UnoRuntime
.
queryInterface
(
XStorable
xStor
=
UnoRuntime
.
queryInterface
(
XStorable
.
class
,
xDoc
);
String
targetFile
=
m_fileURL
+
m_TargetDir
+
fileName
;
...
...
sw/qa/complex/writer/TextPortionEnumerationTest.java
Dosyayı görüntüle @
531a052b
This diff is collapsed.
Click to expand it.
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