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
21ea3725
Kaydet (Commit)
21ea3725
authored
Ara 07, 2012
tarafından
Stephan Bergmann
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Use XNotifyingDispatch to avoid races
Change-Id: Ia91bd08122052f5ea206eb9e6c03524e6e3ec245
üst
a6d6d1c2
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
38 additions
and
10 deletions
+38
-10
ScAccessiblePageHeaderArea.java
qadevOOo/tests/java/mod/_sc/ScAccessiblePageHeaderArea.java
+38
-10
No files found.
qadevOOo/tests/java/mod/_sc/ScAccessiblePageHeaderArea.java
Dosyayı görüntüle @
21ea3725
...
...
@@ -36,10 +36,13 @@ import com.sun.star.accessibility.XAccessibleContext;
import
com.sun.star.accessibility.XAccessibleStateSet
;
import
com.sun.star.awt.XWindow
;
import
com.sun.star.container.XIndexAccess
;
import
com.sun.star.frame.DispatchResultEvent
;
import
com.sun.star.frame.XController
;
import
com.sun.star.frame.XDispatch
;
import
com.sun.star.frame.XDispatchProvider
;
import
com.sun.star.frame.XDispatchResultListener
;
import
com.sun.star.frame.XModel
;
import
com.sun.star.frame.XNotifyingDispatch
;
import
com.sun.star.lang.EventObject
;
import
com.sun.star.lang.XMultiServiceFactory
;
import
com.sun.star.sheet.XSpreadsheet
;
import
com.sun.star.sheet.XSpreadsheetDocument
;
...
...
@@ -124,18 +127,44 @@ public class ScAccessiblePageHeaderArea extends TestCase {
aParseURL
[
0
].
Complete
=
".uno:PrintPreview"
;
xParser
.
parseStrict
(
aParseURL
);
URL
aURL
=
aParseURL
[
0
];
XDispatch
xDispatcher
=
xDispProv
.
queryDispatch
(
aURL
,
""
,
0
);
if
(
xDispatcher
!=
null
)
xDispatcher
.
dispatch
(
aURL
,
null
);
XNotifyingDispatch
xDispatcher
=
UnoRuntime
.
queryInterface
(
XNotifyingDispatch
.
class
,
xDispProv
.
queryDispatch
(
aURL
,
""
,
0
));
final
int
[]
ok
=
new
int
[]
{
0
};
XDispatchResultListener
listener
=
new
XDispatchResultListener
()
{
public
void
disposing
(
EventObject
Source
)
{
synchronized
(
ok
)
{
if
(
ok
[
0
]
==
0
)
{
ok
[
0
]
=
1
;
}
ok
.
notifyAll
();
}
}
public
void
dispatchFinished
(
DispatchResultEvent
Result
)
{
synchronized
(
ok
)
{
ok
[
0
]
=
2
;
ok
.
notifyAll
();
}
}
};
xDispatcher
.
dispatchWithNotification
(
aURL
,
null
,
listener
);
synchronized
(
ok
)
{
while
(
ok
[
0
]
==
0
)
{
try
{
ok
.
wait
();
}
catch
(
InterruptedException
e
)
{
throw
new
RuntimeException
(
e
);
}
}
if
(
ok
[
0
]
!=
2
)
{
throw
new
RuntimeException
(
"missing disptachFinished"
);
}
}
}
catch
(
com
.
sun
.
star
.
uno
.
Exception
e
)
{
log
.
println
(
"Couldn't change mode"
);
throw
new
StatusException
(
Status
.
failed
(
"Couldn't change mode"
));
}
try
{
Thread
.
sleep
(
500
);
}
catch
(
InterruptedException
ex
)
{}
AccessibilityTools
at
=
new
AccessibilityTools
();
XWindow
xWindow
=
at
.
getCurrentContainerWindow
(
(
XMultiServiceFactory
)
Param
.
getMSF
(),
aModel
);
...
...
@@ -213,4 +242,4 @@ public class ScAccessiblePageHeaderArea extends TestCase {
throw
new
StatusException
(
"Couldn't create document "
,
e
);
}
}
}
\ No newline at end of file
}
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