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
973eb2f6
Kaydet (Commit)
973eb2f6
authored
Eki 15, 2014
tarafından
Noel Grandin
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
java: reduce the depth of some deeply nested if blocks
Change-Id: I3c0c7f08d4d8ea594e72fc0d9b93d085d4ab4bf5
üst
fa652cdd
Hide whitespace changes
Inline
Side-by-side
Showing
12 changed files
with
374 additions
and
371 deletions
+374
-371
InterfaceContainer.java
...elper/com/sun/star/lib/uno/helper/InterfaceContainer.java
+67
-62
JavaLoader.java
jurt/com/sun/star/comp/loader/JavaLoader.java
+40
-40
NativeLibraryLoader.java
jurt/com/sun/star/lib/util/NativeLibraryLoader.java
+20
-19
InstallationFinder.java
odk/source/com/sun/star/lib/loader/InstallationFinder.java
+39
-34
TestParameters.java
qadevOOo/runner/lib/TestParameters.java
+15
-14
ChartRawReportTarget.java
...ice/report/pentaho/output/chart/ChartRawReportTarget.java
+24
-24
Helper.java
swext/mediawiki/src/com/sun/star/wiki/Helper.java
+25
-25
AccessibilityTree.java
toolkit/test/accessibility/AccessibilityTree.java
+43
-43
AccessibleCellHandler.java
toolkit/test/accessibility/AccessibleCellHandler.java
+10
-11
AccessibleSelectionHandler.java
toolkit/test/accessibility/AccessibleSelectionHandler.java
+48
-49
CommandName.java
wizards/com/sun/star/wizards/db/CommandName.java
+30
-30
Record.java
...rge/java/org/openoffice/xmerge/converter/palm/Record.java
+13
-20
No files found.
javaunohelper/com/sun/star/lib/uno/helper/InterfaceContainer.java
Dosyayı görüntüle @
973eb2f6
...
...
@@ -352,27 +352,29 @@ public class InterfaceContainer implements Cloneable
*/
synchronized
public
int
indexOf
(
Object
elem
)
{
if
(
elementData
==
null
||
elem
==
null
)
{
return
-
1
;
}
int
index
=
-
1
;
if
(
elementData
!=
null
&&
elem
!=
null
)
for
(
int
i
=
0
;
i
<
size
;
i
++)
{
for
(
int
i
=
0
;
i
<
size
;
i
++
)
if
(
elem
==
elementData
[
i
]
)
{
if
(
elem
==
elementData
[
i
])
{
index
=
i
;
break
;
}
index
=
i
;
break
;
}
}
if
(
index
==
-
1
)
if
(
index
==
-
1
)
{
for
(
int
i
=
0
;
i
<
size
;
i
++)
{
for
(
int
i
=
0
;
i
<
size
;
i
++
)
if
(
UnoRuntime
.
areSame
(
elem
,
elementData
[
i
])
)
{
if
(
UnoRuntime
.
areSame
(
elem
,
elementData
[
i
]))
{
index
=
i
;
break
;
}
index
=
i
;
break
;
}
}
}
...
...
@@ -408,28 +410,30 @@ public class InterfaceContainer implements Cloneable
*/
synchronized
public
int
lastIndexOf
(
Object
elem
)
{
if
(
elementData
==
null
||
elem
==
null
)
{
return
-
1
;
}
int
index
=
-
1
;
if
(
elementData
!=
null
&&
elem
!=
null
)
for
(
int
i
=
size
-
1
;
i
>=
0
;
i
--)
{
if
(
elem
==
elementData
[
i
])
{
index
=
i
;
break
;
}
}
if
(
index
==
-
1
)
{
for
(
int
i
=
size
-
1
;
i
>=
0
;
i
--)
{
if
(
elem
==
elementData
[
i
]
)
if
(
UnoRuntime
.
areSame
(
elem
,
elementData
[
i
])
)
{
index
=
i
;
break
;
}
}
if
(
index
==
-
1
)
{
for
(
int
i
=
size
-
1
;
i
>=
0
;
i
--)
{
if
(
UnoRuntime
.
areSame
(
elem
,
elementData
[
i
]))
{
index
=
i
;
break
;
}
}
}
}
return
index
;
}
...
...
@@ -535,52 +539,53 @@ public class InterfaceContainer implements Cloneable
synchronized
public
boolean
retainAll
(
Collection
collection
)
{
if
(
elementData
==
null
||
collection
==
null
)
{
return
false
;
}
boolean
retVal
=
false
;
if
(
elementData
!=
null
&&
collection
!=
null
)
{
// iterate over data
Object
[]
arRetained
=
new
Object
[
size
];
int
indexRetained
=
0
;
for
(
int
i
=
0
;
i
<
size
;
i
++)
// iterate over data
Object
[]
arRetained
=
new
Object
[
size
];
int
indexRetained
=
0
;
for
(
int
i
=
0
;
i
<
size
;
i
++)
{
Object
curElem
=
elementData
[
i
];
// try to find the element in collection
Iterator
itColl
=
collection
.
iterator
();
boolean
bExists
=
false
;
while
(
itColl
.
hasNext
())
{
Object
curElem
=
elementData
[
i
];
// try to find the element in collection
Iterator
itColl
=
collection
.
iterator
();
boolean
bExists
=
false
;
while
(
itColl
.
hasNext
())
if
(
curElem
==
itColl
.
next
())
{
if
(
curElem
==
itColl
.
next
())
{
// current element is in collection
bExists
=
true
;
break
;
}
// current element is in collection
bExists
=
true
;
break
;
}
if
(!
bExists
)
}
if
(!
bExists
)
{
itColl
=
collection
.
iterator
();
while
(
itColl
.
hasNext
())
{
itColl
=
collection
.
iterator
();
while
(
itColl
.
hasNext
()
)
Object
o
=
itColl
.
next
();
if
(
o
!=
null
)
{
Object
o
=
itColl
.
next
();
if
(
o
!=
null
)
if
(
UnoRuntime
.
areSame
(
o
,
curElem
))
{
if
(
UnoRuntime
.
areSame
(
o
,
curElem
))
{
bExists
=
true
;
break
;
}
bExists
=
true
;
break
;
}
}
}
if
(
bExists
)
arRetained
[
indexRetained
++]=
curElem
;
}
retVal
=
size
!=
indexRetained
;
if
(
indexRetained
>
0
)
{
elementData
=
arRetained
;
size
=
indexRetained
;
}
if
(
bExists
)
arRetained
[
indexRetained
++]=
curElem
;
}
retVal
=
size
!=
indexRetained
;
if
(
indexRetained
>
0
)
{
elementData
=
arRetained
;
size
=
indexRetained
;
}
return
retVal
;
}
...
...
jurt/com/sun/star/comp/loader/JavaLoader.java
Dosyayı görüntüle @
973eb2f6
...
...
@@ -84,49 +84,49 @@ public class JavaLoader implements XImplementationLoader,
*/
private
String
expand_url
(
String
url
)
throws
RuntimeException
{
if
(
url
!=
null
&&
url
.
startsWith
(
EXPAND_PROTOCOL_PREFIX
))
{
try
{
if
(
m_xMacroExpander
==
null
)
{
XPropertySet
xProps
=
UnoRuntime
.
queryInterface
(
XPropertySet
.
class
,
multiServiceFactory
);
if
(
xProps
==
null
)
{
throw
new
com
.
sun
.
star
.
uno
.
RuntimeException
(
"service manager does not support XPropertySet!"
,
this
);
}
XComponentContext
xContext
=
(
XComponentContext
)
AnyConverter
.
toObject
(
new
Type
(
XComponentContext
.
class
),
xProps
.
getPropertyValue
(
"DefaultContext"
)
);
m_xMacroExpander
=
(
XMacroExpander
)
AnyConverter
.
toObject
(
new
Type
(
XMacroExpander
.
class
),
xContext
.
getValueByName
(
"/singletons/com.sun.star.util.theMacroExpander"
)
);
}
// decode uric class chars
String
macro
=
URLDecoder
.
decode
(
StringHelper
.
replace
(
url
.
substring
(
EXPAND_PROTOCOL_PREFIX
.
length
()
),
'+'
,
"%2B"
),
"UTF-8"
);
// expand macro string
String
ret
=
m_xMacroExpander
.
expandMacros
(
macro
);
if
(
DEBUG
)
{
System
.
err
.
println
(
"JavaLoader.expand_url(): "
+
url
+
" => "
+
macro
+
" => "
+
ret
);
if
(
url
==
null
||
!
url
.
startsWith
(
EXPAND_PROTOCOL_PREFIX
))
{
return
url
;
}
try
{
if
(
m_xMacroExpander
==
null
)
{
XPropertySet
xProps
=
UnoRuntime
.
queryInterface
(
XPropertySet
.
class
,
multiServiceFactory
);
if
(
xProps
==
null
)
{
throw
new
com
.
sun
.
star
.
uno
.
RuntimeException
(
"service manager does not support XPropertySet!"
,
this
);
}
return
ret
;
}
catch
(
com
.
sun
.
star
.
uno
.
Exception
exc
)
{
throw
new
com
.
sun
.
star
.
uno
.
RuntimeException
(
exc
.
getMessage
(),
this
);
}
catch
(
java
.
lang
.
Exception
exc
)
{
throw
new
com
.
sun
.
star
.
uno
.
RuntimeException
(
exc
.
getMessage
(),
this
);
XComponentContext
xContext
=
(
XComponentContext
)
AnyConverter
.
toObject
(
new
Type
(
XComponentContext
.
class
),
xProps
.
getPropertyValue
(
"DefaultContext"
)
);
m_xMacroExpander
=
(
XMacroExpander
)
AnyConverter
.
toObject
(
new
Type
(
XMacroExpander
.
class
),
xContext
.
getValueByName
(
"/singletons/com.sun.star.util.theMacroExpander"
)
);
}
// decode uric class chars
String
macro
=
URLDecoder
.
decode
(
StringHelper
.
replace
(
url
.
substring
(
EXPAND_PROTOCOL_PREFIX
.
length
()
),
'+'
,
"%2B"
),
"UTF-8"
);
// expand macro string
String
ret
=
m_xMacroExpander
.
expandMacros
(
macro
);
if
(
DEBUG
)
{
System
.
err
.
println
(
"JavaLoader.expand_url(): "
+
url
+
" => "
+
macro
+
" => "
+
ret
);
}
return
ret
;
}
catch
(
com
.
sun
.
star
.
uno
.
Exception
exc
)
{
throw
new
com
.
sun
.
star
.
uno
.
RuntimeException
(
exc
.
getMessage
(),
this
);
}
catch
(
java
.
lang
.
Exception
exc
)
{
throw
new
com
.
sun
.
star
.
uno
.
RuntimeException
(
exc
.
getMessage
(),
this
);
}
return
url
;
}
/**
...
...
jurt/com/sun/star/lib/util/NativeLibraryLoader.java
Dosyayı görüntüle @
973eb2f6
...
...
@@ -89,33 +89,34 @@ public final class NativeLibraryLoader {
// (scheme://auth/dir1/name). The second step is important in a typical
// OOo installation, where the JAR files are in the program/classes
// directory while the shared libraries are in the program directory.
if
(
loader
instanceof
URLClassLoader
)
{
URL
[]
urls
=
((
URLClassLoader
)
loader
).
getURLs
();
for
(
int
i
=
0
;
i
<
urls
.
length
;
++
i
)
{
File
path
=
UrlToFileMapper
.
mapUrlToFile
(
urls
[
i
]);
if
(
path
!=
null
)
{
File
dir
=
path
.
isDirectory
()
?
path
:
path
.
getParentFile
();
if
(!(
loader
instanceof
URLClassLoader
))
{
return
null
;
}
URL
[]
urls
=
((
URLClassLoader
)
loader
).
getURLs
();
for
(
int
i
=
0
;
i
<
urls
.
length
;
++
i
)
{
File
path
=
UrlToFileMapper
.
mapUrlToFile
(
urls
[
i
]);
if
(
path
!=
null
)
{
File
dir
=
path
.
isDirectory
()
?
path
:
path
.
getParentFile
();
if
(
dir
!=
null
)
{
path
=
new
File
(
dir
,
name
);
if
(
path
.
exists
())
{
return
path
;
}
dir
=
dir
.
getParentFile
();
if
(
dir
!=
null
)
{
path
=
new
File
(
dir
,
name
);
if
(
path
.
exists
())
{
return
path
;
}
dir
=
dir
.
getParentFile
();
if
(
dir
!=
null
)
{
path
=
new
File
(
dir
,
name
);
// On OS X, dir is now the Resources dir,
// we want to look in Frameworks
if
(
System
.
getProperty
(
"os.name"
).
startsWith
(
"Mac"
)
&&
dir
.
getName
().
equals
(
"Resources"
))
{
dir
=
dir
.
getParentFile
();
path
=
new
File
(
dir
,
"Frameworks/"
+
name
);
if
(
path
.
exists
())
{
return
path
;
}
// On OS X, dir is now the Resources dir,
// we want to look in Frameworks
if
(
System
.
getProperty
(
"os.name"
).
startsWith
(
"Mac"
)
&&
dir
.
getName
().
equals
(
"Resources"
))
{
dir
=
dir
.
getParentFile
();
path
=
new
File
(
dir
,
"Frameworks/"
+
name
);
if
(
path
.
exists
())
{
return
path
;
}
}
}
}
}
...
...
odk/source/com/sun/star/lib/loader/InstallationFinder.java
Dosyayı görüntüle @
973eb2f6
...
...
@@ -80,41 +80,46 @@ final class InstallationFinder {
// com.sun.star.lib.loader.unopath
// (all platforms)
path
=
getPathFromProperty
(
SYSPROP_NAME
);
if
(
path
==
null
)
{
// get the installation path from the UNO_PATH environment variable
// (all platforms, not working for Java 1.3.1 and Java 1.4)
path
=
getPathFromEnvVar
(
ENVVAR_NAME
);
if
(
path
!=
null
)
{
return
path
;
}
// get the installation path from the UNO_PATH environment variable
// (all platforms, not working for Java 1.3.1 and Java 1.4)
path
=
getPathFromEnvVar
(
ENVVAR_NAME
);
if
(
path
!=
null
)
{
return
path
;
}
String
osname
=
null
;
try
{
osname
=
System
.
getProperty
(
"os.name"
);
}
catch
(
SecurityException
e
)
{
// if a SecurityException was thrown,
// return <code>null</code>
return
null
;
}
if
(
osname
==
null
)
{
return
null
;
}
if
(
osname
.
startsWith
(
"Windows"
)
)
{
// get the installation path from the Windows Registry
// (Windows platform only)
path
=
getPathFromWindowsRegistry
();
}
else
{
// get the installation path from the PATH environment
// variable (Unix/Linux platforms only, not working for
// Java 1.3.1 and Java 1.4)
path
=
getPathFromPathEnvVar
();
if
(
path
==
null
)
{
String
osname
=
null
;
try
{
osname
=
System
.
getProperty
(
"os.name"
);
}
catch
(
SecurityException
e
)
{
// if a SecurityException was thrown,
// return <code>null</code>
return
null
;
}
if
(
osname
!=
null
)
{
if
(
osname
.
startsWith
(
"Windows"
)
)
{
// get the installation path from the Windows Registry
// (Windows platform only)
path
=
getPathFromWindowsRegistry
();
}
else
{
// get the installation path from the PATH environment
// variable (Unix/Linux platforms only, not working for
// Java 1.3.1 and Java 1.4)
path
=
getPathFromPathEnvVar
();
if
(
path
==
null
)
{
// get the installation path from the 'which'
// command (Unix/Linux platforms only)
path
=
getPathFromWhich
();
if
(
path
==
null
)
{
// get the installation path from the
// .sversionrc file (Unix/Linux platforms only,
// for older versions than OOo 2.0)
path
=
getPathFromSVersionFile
();
}
}
}
// get the installation path from the 'which'
// command (Unix/Linux platforms only)
path
=
getPathFromWhich
();
if
(
path
==
null
)
{
// get the installation path from the
// .sversionrc file (Unix/Linux platforms only,
// for older versions than OOo 2.0)
path
=
getPathFromSVersionFile
();
}
}
}
...
...
qadevOOo/runner/lib/TestParameters.java
Dosyayı görüntüle @
973eb2f6
...
...
@@ -76,22 +76,23 @@ public class TestParameters extends HashMap<String,Object> {
* @return The value of this key, cast to a boolean type.
*/
public
boolean
getBool
(
Object
key
)
{
Object
val
=
super
.
get
(
key
);
if
(
val
!=
null
)
{
if
(
val
instanceof
String
)
{
String
sVal
=
(
String
)
val
;
if
(
sVal
.
equalsIgnoreCase
(
"true"
)
||
sVal
.
equalsIgnoreCase
(
"yes"
))
{
return
true
;
}
else
if
(
sVal
.
equalsIgnoreCase
(
"false"
)
||
sVal
.
equalsIgnoreCase
(
"no"
))
{
return
false
;
}
final
Object
val
=
super
.
get
(
key
);
if
(
val
==
null
)
{
return
false
;
}
if
(
val
instanceof
String
)
{
String
sVal
=
(
String
)
val
;
if
(
sVal
.
equalsIgnoreCase
(
"true"
)
||
sVal
.
equalsIgnoreCase
(
"yes"
))
{
return
true
;
}
else
if
(
sVal
.
equalsIgnoreCase
(
"false"
)
||
sVal
.
equalsIgnoreCase
(
"no"
))
{
return
false
;
}
if
(
val
instanceof
Boolean
)
return
((
Boolean
)
val
).
booleanValue
();
}
else
if
(
val
instanceof
Boolean
)
return
((
Boolean
)
val
).
booleanValue
();
return
false
;
}
...
...
reportbuilder/java/org/libreoffice/report/pentaho/output/chart/ChartRawReportTarget.java
Dosyayı görüntüle @
973eb2f6
...
...
@@ -143,37 +143,37 @@ public class ChartRawReportTarget extends OfficeDocumentReportTarget
return
;
}
final
String
namespace
=
ReportTargetUtil
.
getNamespaceFromAttribute
(
attrs
);
if
(!
isFilteredNamespace
(
namespace
))
if
(
isFilteredNamespace
(
namespace
))
return
;
final
String
elementType
=
ReportTargetUtil
.
getElemenTypeFromAttribute
(
attrs
);
// if this is the report namespace, write out a table definition ..
if
(
OfficeNamespaces
.
TABLE_NS
.
equals
(
namespace
))
{
final
String
elementType
=
ReportTargetUtil
.
getElemenTypeFromAttribute
(
attrs
);
// if this is the report namespace, write out a table definition ..
if
(
OfficeNamespaces
.
TABLE_NS
.
equals
(
namespace
))
{
if
(
OfficeToken
.
TABLE
.
equals
(
elementType
)
||
OfficeToken
.
TABLE_ROWS
.
equals
(
elementType
))
{
return
;
}
else
if
(
isFiltered
(
elementType
))
{
inFilterElements
=
false
;
if
(
tableCount
>
1
)
{
return
;
}
}
}
else
if
(
OfficeNamespaces
.
CHART_NS
.
equals
(
namespace
)
&&
"chart"
.
equals
(
elementType
))
if
(
OfficeToken
.
TABLE
.
equals
(
elementType
)
||
OfficeToken
.
TABLE_ROWS
.
equals
(
elementType
))
{
return
;
}
if
(
inFilterElements
&&
tableCount
>
1
)
else
if
(
isFiltered
(
elementType
)
)
{
return
;
inFilterElements
=
false
;
if
(
tableCount
>
1
)
{
return
;
}
}
final
XmlWriter
xmlWriter
=
getXmlWriter
();
xmlWriter
.
writeCloseTag
();
--
closeTags
;
}
else
if
(
OfficeNamespaces
.
CHART_NS
.
equals
(
namespace
)
&&
"chart"
.
equals
(
elementType
))
{
return
;
}
if
(
inFilterElements
&&
tableCount
>
1
)
{
return
;
}
final
XmlWriter
xmlWriter
=
getXmlWriter
();
xmlWriter
.
writeCloseTag
();
--
closeTags
;
}
@Override
...
...
swext/mediawiki/src/com/sun/star/wiki/Helper.java
Dosyayı görüntüle @
973eb2f6
...
...
@@ -331,39 +331,39 @@ public class Helper
//scrape the HTML source and find the EditURL
// TODO/LATER: Use parser in future
String
sResultURL
=
""
;
int
nInd
=
sWebPage
.
indexOf
(
"http-equiv=\"refresh\""
);
if
(
nInd
!=
-
1
)
if
(
nInd
==
-
1
)
return
""
;
String
sResultURL
=
""
;
int
nContent
=
sWebPage
.
indexOf
(
"content="
,
nInd
);
if
(
nContent
>
0
)
{
int
n
Content
=
sWebPage
.
indexOf
(
"content="
,
nInd
);
if
(
n
Content
>
0
)
int
n
URL
=
sWebPage
.
indexOf
(
"URL="
,
nContent
);
if
(
n
URL
>
0
)
{
int
nURL
=
sWebPage
.
indexOf
(
"URL="
,
nContent
);
if
(
nURL
>
0
)
{
int
nEndURL
=
sWebPage
.
indexOf
(
'"'
,
nURL
);
if
(
nEndURL
>
0
)
sResultURL
=
sWebPage
.
substring
(
nURL
+
4
,
nEndURL
);
}
int
nEndURL
=
sWebPage
.
indexOf
(
'"'
,
nURL
);
if
(
nEndURL
>
0
)
sResultURL
=
sWebPage
.
substring
(
nURL
+
4
,
nEndURL
);
}
}
try
{
URL
aURL
=
new
URL
(
sURL
);
if
(
!
sResultURL
.
startsWith
(
aURL
.
getProtocol
()
))
{
//if the url is only relative then complete it
if
(
sResultURL
.
startsWith
(
"/"
)
)
sResultURL
=
aURL
.
getProtocol
()
+
"://"
+
aURL
.
getHost
()
+
sResultURL
;
else
sResultURL
=
aURL
.
getProtocol
()
+
"://"
+
aURL
.
getHost
()
+
aURL
.
getPath
()
+
sResultURL
;
}
}
catch
(
MalformedURLException
ex
)
try
{
URL
aURL
=
new
URL
(
sURL
);
if
(
!
sResultURL
.
startsWith
(
aURL
.
getProtocol
()
))
{
ex
.
printStackTrace
();
//if the url is only relative then complete it
if
(
sResultURL
.
startsWith
(
"/"
)
)
sResultURL
=
aURL
.
getProtocol
()
+
"://"
+
aURL
.
getHost
()
+
sResultURL
;
else
sResultURL
=
aURL
.
getProtocol
()
+
"://"
+
aURL
.
getHost
()
+
aURL
.
getPath
()
+
sResultURL
;
}
}
catch
(
MalformedURLException
ex
)
{
ex
.
printStackTrace
();
}
return
sResultURL
;
...
...
toolkit/test/accessibility/AccessibilityTree.java
Dosyayı görüntüle @
973eb2f6
...
...
@@ -243,53 +243,53 @@ public class AccessibilityTree
public
boolean
popupTrigger
(
MouseEvent
e
)
{
boolean
bIsPopup
=
e
.
isPopupTrigger
();
if
(
bIsPopup
)
if
(
!
bIsPopup
)
return
false
;
int
selRow
=
maTree
.
getComponent
().
getRowForLocation
(
e
.
getX
(),
e
.
getY
());
if
(
selRow
==
-
1
)
return
bIsPopup
;
TreePath
aPath
=
maTree
.
getComponent
().
getPathForLocation
(
e
.
getX
(),
e
.
getY
());
// check for actions
Object
aObject
=
aPath
.
getLastPathComponent
();
JPopupMenu
aMenu
=
new
JPopupMenu
();
if
(
aObject
instanceof
AccTreeNode
)
{
AccTreeNode
aNode
=
(
AccTreeNode
)
aObject
;
ArrayList
<
String
>
aActions
=
new
ArrayList
<
String
>();
aMenu
.
add
(
new
AccessibilityTree
.
ShapeExpandAction
(
maTree
,
aNode
));
aMenu
.
add
(
new
AccessibilityTree
.
SubtreeExpandAction
(
maTree
,
aNode
));
aNode
.
getActions
(
aActions
);
for
(
int
i
=
0
;
i
<
aActions
.
size
();
i
++
)
{
aMenu
.
add
(
new
NodeAction
(
aActions
.
get
(
i
),
aNode
,
i
)
);
}
}
else
if
(
aObject
instanceof
AccessibleTreeNode
)
{
int
selRow
=
maTree
.
getComponent
().
getRowForLocation
(
e
.
getX
(),
e
.
getY
());
if
(
selRow
!=
-
1
)
AccessibleTreeNode
aNode
=
(
AccessibleTreeNode
)
aObject
;
String
[]
aActionNames
=
aNode
.
getActions
();
int
nCount
=
aActionNames
.
length
;
if
(
nCount
>
0
)
{
TreePath
aPath
=
maTree
.
getComponent
().
getPathForLocation
(
e
.
getX
(),
e
.
getY
());
// check for actions
Object
aObject
=
aPath
.
getLastPathComponent
();
JPopupMenu
aMenu
=
new
JPopupMenu
();
if
(
aObject
instanceof
AccTreeNode
)
{
AccTreeNode
aNode
=
(
AccTreeNode
)
aObject
;
ArrayList
<
String
>
aActions
=
new
ArrayList
<
String
>();
aMenu
.
add
(
new
AccessibilityTree
.
ShapeExpandAction
(
maTree
,
aNode
));
aMenu
.
add
(
new
AccessibilityTree
.
SubtreeExpandAction
(
maTree
,
aNode
));
aNode
.
getActions
(
aActions
);
for
(
int
i
=
0
;
i
<
aActions
.
size
();
i
++
)
{
aMenu
.
add
(
new
NodeAction
(
aActions
.
get
(
i
),
aNode
,
i
)
);
}
}
else
if
(
aObject
instanceof
AccessibleTreeNode
)
{
AccessibleTreeNode
aNode
=
(
AccessibleTreeNode
)
aObject
;
String
[]
aActionNames
=
aNode
.
getActions
();
int
nCount
=
aActionNames
.
length
;
if
(
nCount
>
0
)
{
for
(
int
i
=
0
;
i
<
nCount
;
i
++)
aMenu
.
add
(
new
NodeAction
(
aActionNames
[
i
],
aNode
,
i
));
}
else
aMenu
=
null
;
}
if
(
aMenu
!=
null
)
aMenu
.
show
(
maTree
.
getComponent
(),
e
.
getX
(),
e
.
getY
());
for
(
int
i
=
0
;
i
<
nCount
;
i
++)
aMenu
.
add
(
new
NodeAction
(
aActionNames
[
i
],
aNode
,
i
));
}
else
aMenu
=
null
;
}
if
(
aMenu
!=
null
)
aMenu
.
show
(
maTree
.
getComponent
(),
e
.
getX
(),
e
.
getY
());
return
bIsPopup
;
}
...
...
toolkit/test/accessibility/AccessibleCellHandler.java
Dosyayı görüntüle @
973eb2f6
...
...
@@ -27,21 +27,20 @@ class AccessibleCellHandler extends NodeHandler
@Override
public
NodeHandler
createHandler
(
XAccessibleContext
xContext
)
{
if
(
xContext
==
null
)
return
null
;
AccessibleCellHandler
aCellHandler
=
null
;
if
(
xContext
!=
null
)
XAccessible
xParent
=
xContext
.
getAccessibleParent
();
if
(
xParent
!=
null
)
{
XAccessible
xParent
=
xContext
.
getAccessibleParent
();
if
(
xParent
!=
null
)
{
XAccessibleTable
xTable
=
UnoRuntime
.
queryInterface
(
XAccessibleTable
.
class
,
xParent
.
getAccessibleContext
());
if
(
xTable
!=
null
)
aCellHandler
=
new
AccessibleCellHandler
(
xTable
);
}
XAccessibleTable
xTable
=
UnoRuntime
.
queryInterface
(
XAccessibleTable
.
class
,
xParent
.
getAccessibleContext
());
if
(
xTable
!=
null
)
aCellHandler
=
new
AccessibleCellHandler
(
xTable
);
}
return
aCellHandler
;
}
public
AccessibleCellHandler
()
...
...
toolkit/test/accessibility/AccessibleSelectionHandler.java
Dosyayı görüntüle @
973eb2f6
...
...
@@ -51,71 +51,70 @@ class AccessibleSelectionHandler
public
AccessibleTreeNode
createChild
(
AccessibleTreeNode
aParent
,
int
nIndex
)
{
if
(
!(
aParent
instanceof
AccTreeNode
)
)
return
null
;
XAccessibleSelection
xSelection
=
((
AccTreeNode
)
aParent
).
getSelection
();
if
(
xSelection
==
null
)
return
null
;
AccessibleTreeNode
aChild
=
null
;
if
(
aParent
instanceof
AccTreeNode
)
switch
(
nIndex
)
{
XAccessibleSelection
xSelection
=
((
AccTreeNode
)
aParent
).
getSelection
();
if
(
xSelection
!=
null
)
case
0
:
aChild
=
new
StringNode
(
"getSelectedAccessibleChildCount: "
+
xSelection
.
getSelectedAccessibleChildCount
(),
aParent
);
break
;
case
1
:
{
switch
(
nIndex
)
VectorNode
aVNode
=
new
VectorNode
(
"Selected Children"
,
aParent
);
int
nSelected
=
0
;
int
nCount
=
((
AccTreeNode
)
aParent
).
getContext
().
getAccessibleChildCount
();
try
{
case
0
:
aChild
=
new
StringNode
(
"getSelectedAccessibleChildCount: "
+
xSelection
.
getSelectedAccessibleChildCount
(),
aParent
);
break
;
case
1
:
for
(
int
i
=
0
;
i
<
nCount
;
i
++
)
{
VectorNode
aVNode
=
new
VectorNode
(
"Selected Children"
,
aParent
);
int
nSelected
=
0
;
int
nCount
=
((
AccTreeNode
)
aParent
).
getContext
().
getAccessibleChildCount
();
try
{
for
(
int
i
=
0
;
i
<
nCount
;
i
++
)
if
(
xSelection
.
isAccessibleChildSelected
(
i
)
)
{
try
{
if
(
xSelection
.
isAccessibleChildSelected
(
i
)
)
{
XAccessible
xSelChild
=
xSelection
.
getSelectedAccessibleChild
(
nSelected
);
XAccessible
xNChild
=
((
AccTreeNode
)
aParent
).
getContext
().
getAccessibleChild
(
i
);
aVNode
.
addChild
(
new
StringNode
(
i
+
": "
+
xNChild
.
getAccessibleContext
().
getAccessibleDescription
()
+
" ("
+
(
xSelChild
.
equals
(
xNChild
)
?
"OK"
:
"XXX"
)
+
")"
,
aParent
)
);
}
}
catch
(
com
.
sun
.
star
.
lang
.
DisposedException
e
)
{
aVNode
.
addChild
(
new
StringNode
(
i
+
": caught DisposedException while creating"
,
aParent
));
}
XAccessible
xSelChild
=
xSelection
.
getSelectedAccessibleChild
(
nSelected
);
XAccessible
xNChild
=
((
AccTreeNode
)
aParent
).
getContext
().
getAccessibleChild
(
i
);
aVNode
.
addChild
(
new
StringNode
(
i
+
": "
+
xNChild
.
getAccessibleContext
().
getAccessibleDescription
()
+
" ("
+
(
xSelChild
.
equals
(
xNChild
)
?
"OK"
:
"XXX"
)
+
")"
,
aParent
)
);
}
aChild
=
aVNode
;
}
catch
(
IndexOutOfBoundsException
e
)
catch
(
com
.
sun
.
star
.
lang
.
DisposedException
e
)
{
aChild
=
new
StringNode
(
"IndexOutOfBounds"
,
aParent
);
aVNode
.
addChild
(
new
StringNode
(
i
+
": caught DisposedException while creating"
,
aParent
));
}
}
break
;
default
:
aChild
=
new
StringNode
(
"ERROR"
,
aParent
);
break
;
aChild
=
aVNode
;
}
catch
(
IndexOutOfBoundsException
e
)
{
aChild
=
new
StringNode
(
"IndexOutOfBounds"
,
aParent
);
}
}
break
;
default
:
aChild
=
new
StringNode
(
"ERROR"
,
aParent
);
break
;
}
return
aChild
;
...
...
wizards/com/sun/star/wizards/db/CommandName.java
Dosyayı görüntüle @
973eb2f6
...
...
@@ -82,48 +82,48 @@ public class CommandName
{
try
{
if
(
this
.
setMetaDataAttributes
())
{
this
.
DisplayName
=
_DisplayName
;
int
iIndex
;
if
(
oCommandMetaData
.
xDBMetaData
.
supportsCatalogsInDataManipulation
())
{
// ...dann Catalog mit in TableName
iIndex
=
_DisplayName
.
indexOf
(
sCatalogSep
);
if
(
iIndex
>=
0
)
{
if
(
bCatalogAtStart
)
{
CatalogName
=
_DisplayName
.
substring
(
0
,
iIndex
);
_DisplayName
=
_DisplayName
.
substring
(
iIndex
+
1
,
_DisplayName
.
length
());
}
else
{
CatalogName
=
_DisplayName
.
substring
(
iIndex
+
1
,
_DisplayName
.
length
());
_DisplayName
=
_DisplayName
.
substring
(
0
,
iIndex
);
}
}
}
if
(
oCommandMetaData
.
xDBMetaData
.
supportsSchemasInDataManipulation
())
if
(!
setMetaDataAttributes
())
return
;
this
.
DisplayName
=
_DisplayName
;
int
iIndex
;
if
(
oCommandMetaData
.
xDBMetaData
.
supportsCatalogsInDataManipulation
())
{
// ...dann Catalog mit in TableName
iIndex
=
_DisplayName
.
indexOf
(
sCatalogSep
);
if
(
iIndex
>=
0
)
{
String
[]
NameList
;
NameList
=
new
String
[
0
];
NameList
=
JavaTools
.
ArrayoutofString
(
_DisplayName
,
"."
);
if
(
NameList
.
length
>
1
)
if
(
bCatalogAtStart
)
{
SchemaName
=
NameList
[
0
]
;
TableName
=
NameList
[
1
]
;
CatalogName
=
_DisplayName
.
substring
(
0
,
iIndex
)
;
_DisplayName
=
_DisplayName
.
substring
(
iIndex
+
1
,
_DisplayName
.
length
())
;
}
else
{
TableName
=
_DisplayName
;
CatalogName
=
_DisplayName
.
substring
(
iIndex
+
1
,
_DisplayName
.
length
());
_DisplayName
=
_DisplayName
.
substring
(
0
,
iIndex
);
}
}
}
if
(
oCommandMetaData
.
xDBMetaData
.
supportsSchemasInDataManipulation
())
{
String
[]
NameList
;
NameList
=
new
String
[
0
];
NameList
=
JavaTools
.
ArrayoutofString
(
_DisplayName
,
"."
);
if
(
NameList
.
length
>
1
)
{
SchemaName
=
NameList
[
0
];
TableName
=
NameList
[
1
];
}
else
{
TableName
=
_DisplayName
;
}
setComposedCommandName
();
}
else
{
TableName
=
_DisplayName
;
}
setComposedCommandName
();
}
catch
(
Exception
exception
)
{
...
...
xmerge/source/xmerge/java/org/openoffice/xmerge/converter/palm/Record.java
Dosyayı görüntüle @
973eb2f6
...
...
@@ -151,28 +151,20 @@ public final class Record {
*/
@Override
public
boolean
equals
(
Object
obj
)
{
boolean
bool
=
false
;
if
(
obj
instanceof
Record
)
{
Record
rec
=
(
Record
)
obj
;
checkLabel:
{
if
(
rec
.
getAttributes
()
!=
attributes
)
{
break
checkLabel
;
}
if
(
rec
.
getSize
()
==
data
.
length
)
{
for
(
int
i
=
0
;
i
<
data
.
length
;
i
++)
{
if
(
data
[
i
]
!=
rec
.
data
[
i
])
{
break
checkLabel
;
}
}
bool
=
true
;
if
(!(
obj
instanceof
Record
))
{
return
false
;
}
Record
rec
=
(
Record
)
obj
;
if
(
rec
.
getAttributes
()
!=
attributes
)
{
return
false
;
}
if
(
rec
.
getSize
()
==
data
.
length
)
{
for
(
int
i
=
0
;
i
<
data
.
length
;
i
++)
{
if
(
data
[
i
]
!=
rec
.
data
[
i
])
{
return
false
;
}
}
}
return
bool
;
return
false
;
}
}
\ 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