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
fb39e719
Kaydet (Commit)
fb39e719
authored
Nis 25, 2013
tarafından
Noel Grandin
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Java cleanup, call static methods statically
Change-Id: Ibe0454d490153f723a58c3c619be7f8d443639c8
üst
d2d3e5d2
Hide whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
65 additions
and
72 deletions
+65
-72
BooleanValidator.java
forms/qa/integration/forms/BooleanValidator.java
+4
-4
ConfigExamples.java
odk/examples/DevelopersGuide/Config/ConfigExamples.java
+6
-8
BooleanValidator.java
odk/examples/DevelopersGuide/Forms/BooleanValidator.java
+4
-4
SpreadsheetSample.java
...amples/DevelopersGuide/Spreadsheet/SpreadsheetSample.java
+5
-7
InspectorPane.java
odk/examples/java/Inspector/InspectorPane.java
+24
-24
SourceCodeGenerator.java
odk/examples/java/Inspector/SourceCodeGenerator.java
+12
-12
UnoNode.java
odk/examples/java/Inspector/UnoNode.java
+1
-1
EuroAdaption.java
odk/examples/java/Spreadsheet/EuroAdaption.java
+8
-11
StyleInitialization.java
odk/examples/java/Text/StyleInitialization.java
+1
-1
No files found.
forms/qa/integration/forms/BooleanValidator.java
Dosyayı görüntüle @
fb39e719
...
@@ -24,23 +24,23 @@
...
@@ -24,23 +24,23 @@
package
integration
.
forms
;
package
integration
.
forms
;
import
com.sun.star.uno.AnyConverter
;
public
class
BooleanValidator
extends
integration
.
forms
.
ControlValidator
public
class
BooleanValidator
extends
integration
.
forms
.
ControlValidator
{
{
private
boolean
m_preventChecked
;
private
boolean
m_preventChecked
;
private
com
.
sun
.
star
.
uno
.
AnyConverter
m_converter
;
/** Creates a new instance of BooleanValidator */
/** Creates a new instance of BooleanValidator */
public
BooleanValidator
(
boolean
preventChecked
)
public
BooleanValidator
(
boolean
preventChecked
)
{
{
m_preventChecked
=
preventChecked
;
m_preventChecked
=
preventChecked
;
m_converter
=
new
com
.
sun
.
star
.
uno
.
AnyConverter
();
}
}
public
String
explainInvalid
(
Object
Value
)
public
String
explainInvalid
(
Object
Value
)
{
{
try
try
{
{
if
(
m_c
onverter
.
isVoid
(
Value
)
)
if
(
AnyC
onverter
.
isVoid
(
Value
)
)
return
"'indetermined' is not an allowed state"
;
return
"'indetermined' is not an allowed state"
;
boolean
value
=
((
Boolean
)
Value
).
booleanValue
();
boolean
value
=
((
Boolean
)
Value
).
booleanValue
();
if
(
m_preventChecked
&&
(
value
==
true
)
)
if
(
m_preventChecked
&&
(
value
==
true
)
)
...
@@ -57,7 +57,7 @@ public class BooleanValidator extends integration.forms.ControlValidator
...
@@ -57,7 +57,7 @@ public class BooleanValidator extends integration.forms.ControlValidator
{
{
try
try
{
{
if
(
m_c
onverter
.
isVoid
(
Value
)
)
if
(
AnyC
onverter
.
isVoid
(
Value
)
)
return
false
;
return
false
;
boolean
value
=
((
Boolean
)
Value
).
booleanValue
();
boolean
value
=
((
Boolean
)
Value
).
booleanValue
();
...
...
odk/examples/DevelopersGuide/Config/ConfigExamples.java
Dosyayı görüntüle @
fb39e719
...
@@ -465,9 +465,8 @@ public class ConfigExamples
...
@@ -465,9 +465,8 @@ public class ConfigExamples
for
(
int
i
=
0
;
i
<
aElementNames
.
length
;
++
i
)
for
(
int
i
=
0
;
i
<
aElementNames
.
length
;
++
i
)
{
{
Object
aChild
=
xChildAccess
.
getByName
(
aElementNames
[
i
]
);
Object
aChild
=
xChildAccess
.
getByName
(
aElementNames
[
i
]
);
AnyConverter
aAnyConv
=
new
AnyConverter
();
// is it a structural element (object) ...
// is it a structural element (object) ...
if
(
aAnyConv
.
isObject
(
aChild
)
&&
!
aAnyConv
.
isArray
(
aChild
)
)
if
(
AnyConverter
.
isObject
(
aChild
)
&&
!
AnyConverter
.
isArray
(
aChild
)
)
{
{
// then get an interface
// then get an interface
XInterface
xChildElement
=
UnoRuntime
.
queryInterface
(
XInterface
.
class
,
aChild
);
XInterface
xChildElement
=
UnoRuntime
.
queryInterface
(
XInterface
.
class
,
aChild
);
...
@@ -527,7 +526,7 @@ public class ConfigExamples
...
@@ -527,7 +526,7 @@ public class ConfigExamples
new
IConfigurationProcessor
()
{
new
IConfigurationProcessor
()
{
/// prints Path and Value of properties
/// prints Path and Value of properties
public
void
processValueElement
(
String
sPath_
,
Object
aValue_
)
{
public
void
processValueElement
(
String
sPath_
,
Object
aValue_
)
{
if
(
new
AnyConverter
()
.
isArray
(
aValue_
))
if
(
AnyConverter
.
isArray
(
aValue_
))
{
{
final
Object
[]
aArray
=
(
Object
[])
aValue_
;
final
Object
[]
aArray
=
(
Object
[])
aValue_
;
...
@@ -751,11 +750,10 @@ public class ConfigExamples
...
@@ -751,11 +750,10 @@ public class ConfigExamples
String
aItemNames
[]
=
aReplace
.
getElementNames
();
String
aItemNames
[]
=
aReplace
.
getElementNames
();
for
(
int
i
=
0
;
i
<
aItemNames
.
length
;
++
i
)
{
for
(
int
i
=
0
;
i
<
aItemNames
.
length
;
++
i
)
{
Object
aItem
=
aReplace
.
getByName
(
aItemNames
[
i
]
);
Object
aItem
=
aReplace
.
getByName
(
aItemNames
[
i
]
);
AnyConverter
aAnyConv
=
new
AnyConverter
();
// replace integers by a 'complement' value
// replace integers by a 'complement' value
if
(
aAnyConv
.
isInt
(
aItem
)
)
if
(
AnyConverter
.
isInt
(
aItem
)
)
{
{
int
nOld
=
aAnyConv
.
toInt
(
aItem
);
int
nOld
=
AnyConverter
.
toInt
(
aItem
);
int
nNew
=
9999
-
nOld
;
int
nNew
=
9999
-
nOld
;
System
.
out
.
println
(
"Replacing integer value: "
+
aItemNames
[
i
]);
System
.
out
.
println
(
"Replacing integer value: "
+
aItemNames
[
i
]);
...
@@ -763,9 +761,9 @@ public class ConfigExamples
...
@@ -763,9 +761,9 @@ public class ConfigExamples
}
}
// and booleans by their negated value
// and booleans by their negated value
else
if
(
aAnyConv
.
isBoolean
(
aItem
)
)
else
if
(
AnyConverter
.
isBoolean
(
aItem
)
)
{
{
boolean
bOld
=
aAnyConv
.
toBoolean
(
aItem
);
boolean
bOld
=
AnyConverter
.
toBoolean
(
aItem
);
boolean
bNew
=
!
bOld
;
boolean
bNew
=
!
bOld
;
System
.
out
.
println
(
"Replacing boolean value: "
+
aItemNames
[
i
]);
System
.
out
.
println
(
"Replacing boolean value: "
+
aItemNames
[
i
]);
...
...
odk/examples/DevelopersGuide/Forms/BooleanValidator.java
Dosyayı görüntüle @
fb39e719
import
com.sun.star.uno.AnyConverter
;
/*************************************************************************
/*************************************************************************
*
*
* The Contents of this file are made available subject to the terms of
* The Contents of this file are made available subject to the terms of
...
@@ -35,20 +37,18 @@
...
@@ -35,20 +37,18 @@
public
class
BooleanValidator
extends
ControlValidator
public
class
BooleanValidator
extends
ControlValidator
{
{
private
boolean
m_preventChecked
;
private
boolean
m_preventChecked
;
private
com
.
sun
.
star
.
uno
.
AnyConverter
m_converter
;
/** Creates a new instance of BooleanValidator */
/** Creates a new instance of BooleanValidator */
public
BooleanValidator
(
boolean
preventChecked
)
public
BooleanValidator
(
boolean
preventChecked
)
{
{
m_preventChecked
=
preventChecked
;
m_preventChecked
=
preventChecked
;
m_converter
=
new
com
.
sun
.
star
.
uno
.
AnyConverter
();
}
}
public
String
explainInvalid
(
Object
Value
)
public
String
explainInvalid
(
Object
Value
)
{
{
try
try
{
{
if
(
m_c
onverter
.
isVoid
(
Value
)
)
if
(
AnyC
onverter
.
isVoid
(
Value
)
)
return
"'indetermined' is not an allowed state"
;
return
"'indetermined' is not an allowed state"
;
boolean
value
=
((
Boolean
)
Value
).
booleanValue
();
boolean
value
=
((
Boolean
)
Value
).
booleanValue
();
if
(
m_preventChecked
&&
(
value
==
true
)
)
if
(
m_preventChecked
&&
(
value
==
true
)
)
...
@@ -65,7 +65,7 @@ public class BooleanValidator extends ControlValidator
...
@@ -65,7 +65,7 @@ public class BooleanValidator extends ControlValidator
{
{
try
try
{
{
if
(
m_c
onverter
.
isVoid
(
Value
)
)
if
(
AnyC
onverter
.
isVoid
(
Value
)
)
return
false
;
return
false
;
boolean
value
=
((
Boolean
)
Value
).
booleanValue
();
boolean
value
=
((
Boolean
)
Value
).
booleanValue
();
...
...
odk/examples/DevelopersGuide/Spreadsheet/SpreadsheetSample.java
Dosyayı görüntüle @
fb39e719
...
@@ -830,16 +830,15 @@ public class SpreadsheetSample extends SpreadsheetDocHelper
...
@@ -830,16 +830,15 @@ public class SpreadsheetSample extends SpreadsheetDocHelper
// --- Document properties ---
// --- Document properties ---
com
.
sun
.
star
.
beans
.
XPropertySet
xPropSet
=
UnoRuntime
.
queryInterface
(
com
.
sun
.
star
.
beans
.
XPropertySet
.
class
,
getDocument
()
);
com
.
sun
.
star
.
beans
.
XPropertySet
xPropSet
=
UnoRuntime
.
queryInterface
(
com
.
sun
.
star
.
beans
.
XPropertySet
.
class
,
getDocument
()
);
AnyConverter
aAnyConv
=
new
AnyConverter
();
String
aText
=
"Value of property IsIterationEnabled: "
;
String
aText
=
"Value of property IsIterationEnabled: "
;
aText
+=
aAnyConv
.
toBoolean
(
xPropSet
.
getPropertyValue
(
"IsIterationEnabled"
));
aText
+=
AnyConverter
.
toBoolean
(
xPropSet
.
getPropertyValue
(
"IsIterationEnabled"
));
System
.
out
.
println
(
aText
);
System
.
out
.
println
(
aText
);
aText
=
"Value of property IterationCount: "
;
aText
=
"Value of property IterationCount: "
;
aText
+=
aAnyConv
.
toInt
(
xPropSet
.
getPropertyValue
(
"IterationCount"
));
aText
+=
AnyConverter
.
toInt
(
xPropSet
.
getPropertyValue
(
"IterationCount"
));
System
.
out
.
println
(
aText
);
System
.
out
.
println
(
aText
);
aText
=
"Value of property NullDate: "
;
aText
=
"Value of property NullDate: "
;
com
.
sun
.
star
.
util
.
Date
aDate
=
(
com
.
sun
.
star
.
util
.
Date
)
com
.
sun
.
star
.
util
.
Date
aDate
=
(
com
.
sun
.
star
.
util
.
Date
)
aAnyConv
.
toObject
(
com
.
sun
.
star
.
util
.
Date
.
class
,
xPropSet
.
getPropertyValue
(
"NullDate"
));
AnyConverter
.
toObject
(
com
.
sun
.
star
.
util
.
Date
.
class
,
xPropSet
.
getPropertyValue
(
"NullDate"
));
aText
+=
aDate
.
Year
+
"-"
+
aDate
.
Month
+
"-"
+
aDate
.
Day
;
aText
+=
aDate
.
Year
+
"-"
+
aDate
.
Month
+
"-"
+
aDate
.
Day
;
System
.
out
.
println
(
aText
);
System
.
out
.
println
(
aText
);
...
@@ -1202,12 +1201,11 @@ public class SpreadsheetSample extends SpreadsheetDocHelper
...
@@ -1202,12 +1201,11 @@ public class SpreadsheetSample extends SpreadsheetDocHelper
UnoRuntime
.
queryInterface
(
UnoRuntime
.
queryInterface
(
com
.
sun
.
star
.
container
.
XNameAccess
.
class
,
aRangesObj
);
com
.
sun
.
star
.
container
.
XNameAccess
.
class
,
aRangesObj
);
String
[]
aNames
=
xRanges
.
getElementNames
();
String
[]
aNames
=
xRanges
.
getElementNames
();
AnyConverter
aAnyConv
=
new
AnyConverter
();
for
(
int
i
=
0
;
i
<
aNames
.
length
;
i
++
)
for
(
int
i
=
0
;
i
<
aNames
.
length
;
i
++
)
{
{
Object
aRangeObj
=
xRanges
.
getByName
(
aNames
[
i
]
);
Object
aRangeObj
=
xRanges
.
getByName
(
aNames
[
i
]
);
com
.
sun
.
star
.
beans
.
XPropertySet
xRangeProp
=
UnoRuntime
.
queryInterface
(
com
.
sun
.
star
.
beans
.
XPropertySet
.
class
,
aRangeObj
);
com
.
sun
.
star
.
beans
.
XPropertySet
xRangeProp
=
UnoRuntime
.
queryInterface
(
com
.
sun
.
star
.
beans
.
XPropertySet
.
class
,
aRangeObj
);
boolean
bUser
=
aAnyConv
.
toBoolean
(
xRangeProp
.
getPropertyValue
(
"IsUserDefined"
));
boolean
bUser
=
AnyConverter
.
toBoolean
(
xRangeProp
.
getPropertyValue
(
"IsUserDefined"
));
if
(
!
bUser
)
if
(
!
bUser
)
{
{
// this is the temporary database range - get the cell range and format it
// this is the temporary database range - get the cell range and format it
...
@@ -1340,7 +1338,7 @@ public class SpreadsheetSample extends SpreadsheetDocHelper
...
@@ -1340,7 +1338,7 @@ public class SpreadsheetSample extends SpreadsheetDocHelper
com
.
sun
.
star
.
beans
.
XPropertySet
.
class
,
aSettings
);
com
.
sun
.
star
.
beans
.
XPropertySet
.
class
,
aSettings
);
AnyConverter
aAnyConv
=
new
AnyConverter
();
AnyConverter
aAnyConv
=
new
AnyConverter
();
String
[]
aEntries
=
(
String
[])
String
[]
aEntries
=
(
String
[])
aAnyConv
.
toObject
(
String
[].
class
,
AnyConverter
.
toObject
(
String
[].
class
,
xPropSet
.
getPropertyValue
(
"UserLists"
));
xPropSet
.
getPropertyValue
(
"UserLists"
));
System
.
out
.
println
(
"User defined sort lists:"
);
System
.
out
.
println
(
"User defined sort lists:"
);
for
(
int
i
=
0
;
i
<
aEntries
.
length
;
i
++
)
for
(
int
i
=
0
;
i
<
aEntries
.
length
;
i
++
)
...
...
odk/examples/java/Inspector/InspectorPane.java
Dosyayı görüntüle @
fb39e719
...
@@ -33,19 +33,21 @@
...
@@ -33,19 +33,21 @@
*************************************************************************/
*************************************************************************/
import
org.openoffice.XInstanceInspector
;
import
com.sun.star.beans.Property
;
import
com.sun.star.beans.PropertyValue
;
import
com.sun.star.beans.XIntrospectionAccess
;
import
com.sun.star.beans.XPropertySet
;
import
com.sun.star.lang.XServiceInfo
;
import
com.sun.star.lib.uno.helper.WeakBase
;
import
com.sun.star.lib.uno.helper.WeakBase
;
import
com.sun.star.reflection.XIdlMethod
;
import
com.sun.star.uno.Any
;
import
com.sun.star.uno.Any
;
import
com.sun.star.lang.XServiceInfo
;
import
com.sun.star.uno.AnyConverter
;
import
com.sun.star.uno.Type
;
import
com.sun.star.uno.TypeClass
;
import
com.sun.star.uno.TypeClass
;
import
com.sun.star.uno.UnoRuntime
;
import
com.sun.star.uno.UnoRuntime
;
import
com.sun.star.uno.Type
;
import
com.sun.star.uno.XComponentContext
;
import
com.sun.star.uno.XComponentContext
;
import
com.sun.star.beans.XIntrospectionAccess
;
import
com.sun.star.beans.Property
;
import
com.sun.star.beans.PropertyValue
;
import
com.sun.star.beans.XPropertySet
;
import
com.sun.star.reflection.XIdlMethod
;
import
org.openoffice.XInstanceInspector
;
public
class
InspectorPane
extends
WeakBase
implements
XInstanceInspector
{
//, XServiceInfo
public
class
InspectorPane
extends
WeakBase
implements
XInstanceInspector
{
//, XServiceInfo
private
XIdlMethod
[]
xIdlMethods
;
private
XIdlMethod
[]
xIdlMethods
;
...
@@ -111,7 +113,7 @@ import org.openoffice.XInstanceInspector;
...
@@ -111,7 +113,7 @@ import org.openoffice.XInstanceInspector;
private
Type
[]
getTypes
(
Object
_oUnoObject
){
private
Type
[]
getTypes
(
Object
_oUnoObject
){
Type
[]
aTypes
=
null
;
Type
[]
aTypes
=
null
;
if
(
m_oIntrospecto
r
.
isArray
(
_oUnoObject
)){
if
(
AnyConverte
r
.
isArray
(
_oUnoObject
)){
aTypes
=
(
Type
[])
_oUnoObject
;
aTypes
=
(
Type
[])
_oUnoObject
;
}
}
else
{
else
{
...
@@ -144,17 +146,17 @@ import org.openoffice.XInstanceInspector;
...
@@ -144,17 +146,17 @@ import org.openoffice.XInstanceInspector;
}
}
else
{
else
{
Any
aReturnObject
=
Any
.
complete
(
oUnoReturnObject
);
Any
aReturnObject
=
Any
.
complete
(
oUnoReturnObject
);
String
sShortClassName
=
m_o
Introspector
.
getShortClassName
(
aReturnObject
.
getType
().
getTypeName
());
String
sShortClassName
=
Introspector
.
getShortClassName
(
aReturnObject
.
getType
().
getTypeName
());
sNodeDescription
+=
m_oSourceCodeGenerator
.
getVariableNameforUnoObject
(
sShortClassName
);
sNodeDescription
+=
m_oSourceCodeGenerator
.
getVariableNameforUnoObject
(
sShortClassName
);
}
}
if
(
m_o
Introspector
.
isArray
(
oUnoReturnObject
)){
if
(
Introspector
.
isArray
(
oUnoReturnObject
)){
if
(
m_o
Introspector
.
isUnoTypeObject
(
oUnoReturnObject
)){
if
(
Introspector
.
isUnoTypeObject
(
oUnoReturnObject
)){
oUnoNode
=
addUnoFacetteNode
(
_oUnoMethodNode
,
XUnoFacetteNode
.
SINTERFACEDESCRIPTION
,
_oUnoMethodNode
.
getUnoObject
());
oUnoNode
=
addUnoFacetteNode
(
_oUnoMethodNode
,
XUnoFacetteNode
.
SINTERFACEDESCRIPTION
,
_oUnoMethodNode
.
getUnoObject
());
}
}
else
if
(
m_o
Introspector
.
isUnoPropertyTypeObject
(
oUnoReturnObject
)){
else
if
(
Introspector
.
isUnoPropertyTypeObject
(
oUnoReturnObject
)){
oUnoNode
=
addUnoFacetteNode
(
_oUnoMethodNode
,
XUnoFacetteNode
.
SPROPERTYINFODESCRIPTION
,
oUnoReturnObject
);
oUnoNode
=
addUnoFacetteNode
(
_oUnoMethodNode
,
XUnoFacetteNode
.
SPROPERTYINFODESCRIPTION
,
oUnoReturnObject
);
}
}
else
if
(
m_o
Introspector
.
isUnoPropertyValueTypeObject
(
oUnoReturnObject
)){
else
if
(
Introspector
.
isUnoPropertyValueTypeObject
(
oUnoReturnObject
)){
oUnoNode
=
addUnoFacetteNode
(
_oUnoMethodNode
,
XUnoFacetteNode
.
SPROPERTYVALUEDESCRIPTION
,
oUnoReturnObject
);
oUnoNode
=
addUnoFacetteNode
(
_oUnoMethodNode
,
XUnoFacetteNode
.
SPROPERTYVALUEDESCRIPTION
,
oUnoReturnObject
);
}
}
}
}
...
@@ -245,7 +247,7 @@ import org.openoffice.XInstanceInspector;
...
@@ -245,7 +247,7 @@ import org.openoffice.XInstanceInspector;
public
void
addMethodsToTreeNode
(
XUnoNode
_oGrandParentNode
,
Object
_oUnoParentObject
,
XIdlMethod
[]
_xIdlMethods
){
public
void
addMethodsToTreeNode
(
XUnoNode
_oGrandParentNode
,
Object
_oUnoParentObject
,
XIdlMethod
[]
_xIdlMethods
){
if
(
this
.
m_o
Introspector
.
isValid
(
_xIdlMethods
)){
if
(
Introspector
.
isValid
(
_xIdlMethods
)){
for
(
int
n
=
0
;
n
<
_xIdlMethods
.
length
;
n
++
)
{
for
(
int
n
=
0
;
n
<
_xIdlMethods
.
length
;
n
++
)
{
XIdlMethod
xIdlMethod
=
_xIdlMethods
[
n
];
XIdlMethod
xIdlMethod
=
_xIdlMethods
[
n
];
if
(!
xIdlMethod
.
getDeclaringClass
().
getName
().
equals
(
"com.sun.star.uno.XInterface"
)){
if
(!
xIdlMethod
.
getDeclaringClass
().
getName
().
equals
(
"com.sun.star.uno.XInterface"
)){
...
@@ -347,7 +349,7 @@ import org.openoffice.XInstanceInspector;
...
@@ -347,7 +349,7 @@ import org.openoffice.XInstanceInspector;
public
void
addContainerElementsToTreeNode
(
XUnoNode
_oParentNode
,
Object
_oUnoParentObject
){
public
void
addContainerElementsToTreeNode
(
XUnoNode
_oParentNode
,
Object
_oUnoParentObject
){
Object
[]
oUnoContainerElements
=
m_oIntrospector
.
getUnoObjectsOfContainer
(
_oUnoParentObject
);
Object
[]
oUnoContainerElements
=
m_oIntrospector
.
getUnoObjectsOfContainer
(
_oUnoParentObject
);
if
(
m_o
Introspector
.
isValid
(
oUnoContainerElements
)){
if
(
Introspector
.
isValid
(
oUnoContainerElements
)){
if
(
oUnoContainerElements
.
length
>
0
){
if
(
oUnoContainerElements
.
length
>
0
){
for
(
int
i
=
0
;
i
<
oUnoContainerElements
.
length
;
i
++){
for
(
int
i
=
0
;
i
<
oUnoContainerElements
.
length
;
i
++){
XUnoNode
oChildNode
=
addUnoNode
(
_oParentNode
,
oUnoContainerElements
[
i
],
UnoNode
.
getNodeDescription
(
oUnoContainerElements
[
i
]));
XUnoNode
oChildNode
=
addUnoNode
(
_oParentNode
,
oUnoContainerElements
[
i
],
UnoNode
.
getNodeDescription
(
oUnoContainerElements
[
i
]));
...
@@ -371,7 +373,7 @@ import org.openoffice.XInstanceInspector;
...
@@ -371,7 +373,7 @@ import org.openoffice.XInstanceInspector;
private
void
setNodeFoldable
(
XUnoNode
_oUnoNode
,
Object
_oUnoObject
){
private
void
setNodeFoldable
(
XUnoNode
_oUnoNode
,
Object
_oUnoObject
){
if
(
_oUnoObject
!=
null
){
if
(
_oUnoObject
!=
null
){
if
(!
m_o
Introspector
.
isObjectPrimitive
(
_oUnoObject
)){
if
(!
Introspector
.
isObjectPrimitive
(
_oUnoObject
)){
_oUnoNode
.
setFoldable
(
true
);
_oUnoNode
.
setFoldable
(
true
);
}
}
}
}
...
@@ -406,7 +408,7 @@ import org.openoffice.XInstanceInspector;
...
@@ -406,7 +408,7 @@ import org.openoffice.XInstanceInspector;
if
(!
_oUnoObject
.
getClass
().
getComponentType
().
isPrimitive
()){
if
(!
_oUnoObject
.
getClass
().
getComponentType
().
isPrimitive
()){
Object
[]
object
=
(
Object
[]
)
_oUnoObject
;
Object
[]
object
=
(
Object
[]
)
_oUnoObject
;
for
(
int
i
=
0
;
i
<
object
.
length
;
i
++
)
{
for
(
int
i
=
0
;
i
<
object
.
length
;
i
++
)
{
if
(
m_o
Introspector
.
isObjectPrimitive
(
object
[
i
])){
if
(
Introspector
.
isObjectPrimitive
(
object
[
i
])){
XUnoNode
oChildNode
=
addUnoNode
(
_oUnoNode
,
null
,
UnoNode
.
getNodeDescription
(
object
[
i
]));
XUnoNode
oChildNode
=
addUnoNode
(
_oUnoNode
,
null
,
UnoNode
.
getNodeDescription
(
object
[
i
]));
}
}
}
}
...
@@ -431,14 +433,14 @@ import org.openoffice.XInstanceInspector;
...
@@ -431,14 +433,14 @@ import org.openoffice.XInstanceInspector;
private
void
addPropertyValueSubNodes
(
XUnoFacetteNode
_oUnoFacetteNode
,
Object
_oUnoObject
){
private
void
addPropertyValueSubNodes
(
XUnoFacetteNode
_oUnoFacetteNode
,
Object
_oUnoObject
){
if
(
m_o
Introspector
.
isUnoPropertyValueTypeObject
(
_oUnoObject
)){
if
(
Introspector
.
isUnoPropertyValueTypeObject
(
_oUnoObject
)){
Object
[]
object
=
(
Object
[]
)
_oUnoObject
;
Object
[]
object
=
(
Object
[]
)
_oUnoObject
;
for
(
int
i
=
0
;
i
<
object
.
length
;
i
++
)
{
for
(
int
i
=
0
;
i
<
object
.
length
;
i
++
)
{
String
sObjectClassName
=
object
[
i
].
getClass
().
getName
();
String
sObjectClassName
=
object
[
i
].
getClass
().
getName
();
if
(
sObjectClassName
.
equals
(
"com.sun.star.beans.PropertyValue"
)){
if
(
sObjectClassName
.
equals
(
"com.sun.star.beans.PropertyValue"
)){
XUnoNode
oChildNode
=
null
;
XUnoNode
oChildNode
=
null
;
PropertyValue
aPropertyValue
=
(
PropertyValue
)
object
[
i
];
PropertyValue
aPropertyValue
=
(
PropertyValue
)
object
[
i
];
if
(!
m_o
Introspector
.
isObjectPrimitive
(
aPropertyValue
.
Value
)){
if
(!
Introspector
.
isObjectPrimitive
(
aPropertyValue
.
Value
)){
oChildNode
=
m_xTreeControlProvider
.
addUnoPropertyNode
(
_oUnoObject
,
aPropertyValue
,
_oUnoObject
);
oChildNode
=
m_xTreeControlProvider
.
addUnoPropertyNode
(
_oUnoObject
,
aPropertyValue
,
_oUnoObject
);
}
}
else
{
else
{
...
@@ -491,7 +493,7 @@ import org.openoffice.XInstanceInspector;
...
@@ -491,7 +493,7 @@ import org.openoffice.XInstanceInspector;
}
}
if
(
oUnoFacetteNode
.
isPropertyNode
()){
if
(
oUnoFacetteNode
.
isPropertyNode
()){
String
sNodeDescription
=
oUnoFacetteNode
.
getLabel
();
String
sNodeDescription
=
oUnoFacetteNode
.
getLabel
();
// TODO: it's very dangerous to distinguish
e the different UnoFacetteNodes only by the node
description
// TODO: it's very dangerous to distinguish
the different UnoFacetteNodes only by the node
description
if
(
sNodeDescription
.
startsWith
(
XUnoFacetteNode
.
SPROPERTYINFODESCRIPTION
)){
if
(
sNodeDescription
.
startsWith
(
XUnoFacetteNode
.
SPROPERTYINFODESCRIPTION
)){
addPropertySetInfoNodesToTreeNode
(
oUnoFacetteNode
,
oUnoObject
);
addPropertySetInfoNodesToTreeNode
(
oUnoFacetteNode
,
oUnoObject
);
}
}
...
@@ -597,7 +599,7 @@ import org.openoffice.XInstanceInspector;
...
@@ -597,7 +599,7 @@ import org.openoffice.XInstanceInspector;
if
(
oUnoObject
instanceof
String
){
if
(
oUnoObject
instanceof
String
){
}
}
else
{
else
{
if
(!
m_o
Introspector
.
isUnoTypeObject
(
oUnoObject
)){
if
(!
Introspector
.
isUnoTypeObject
(
oUnoObject
)){
return
oUnoObject
;
return
oUnoObject
;
}
}
}
}
...
@@ -622,4 +624,3 @@ import org.openoffice.XInstanceInspector;
...
@@ -622,4 +624,3 @@ import org.openoffice.XInstanceInspector;
m_xDialogProvider
.
showPopUpMenu
(
_invoker
,
x
,
y
);
m_xDialogProvider
.
showPopUpMenu
(
_invoker
,
x
,
y
);
}
}
}
}
\ No newline at end of file
odk/examples/java/Inspector/SourceCodeGenerator.java
Dosyayı görüntüle @
fb39e719
...
@@ -394,10 +394,10 @@ public class SourceCodeGenerator {
...
@@ -394,10 +394,10 @@ public class SourceCodeGenerator {
bisDeclared
=
aVariables
.
containsKey
(
sVariableStemName
);
bisDeclared
=
aVariables
.
containsKey
(
sVariableStemName
);
if
(
bisDeclared
){
if
(
bisDeclared
){
Object
oUnoObject
=
_oUnoObjectDefinition
.
getUnoObject
();
Object
oUnoObject
=
_oUnoObjectDefinition
.
getUnoObject
();
if
(
m_o
Introspector
.
isObjectPrimitive
(
oUnoObject
)){
if
(
Introspector
.
isObjectPrimitive
(
oUnoObject
)){
bisDeclared
=
false
;
bisDeclared
=
false
;
}
}
else
if
(
m_o
Introspector
.
isObjectSequence
(
oUnoObject
)){
else
if
(
Introspector
.
isObjectSequence
(
oUnoObject
)){
bisDeclared
=
false
;
bisDeclared
=
false
;
}
}
else
{
else
{
...
@@ -513,7 +513,7 @@ public class SourceCodeGenerator {
...
@@ -513,7 +513,7 @@ public class SourceCodeGenerator {
TypeClass
aLocTypeClass
=
aTypeClass
;
TypeClass
aLocTypeClass
=
aTypeClass
;
boolean
bIsArray
=
false
;
boolean
bIsArray
=
false
;
if
(
_oUnoObjectDefinition
.
getUnoObject
()
!=
null
){
if
(
_oUnoObjectDefinition
.
getUnoObject
()
!=
null
){
bIsArray
=
m_o
Introspector
.
isObjectSequence
(
_oUnoObjectDefinition
.
getUnoObject
());
bIsArray
=
Introspector
.
isObjectSequence
(
_oUnoObjectDefinition
.
getUnoObject
());
}
}
else
{
else
{
bIsArray
=
_oUnoObjectDefinition
.
getTypeClass
().
getValue
()
==
TypeClass
.
SEQUENCE_value
;
bIsArray
=
_oUnoObjectDefinition
.
getTypeClass
().
getValue
()
==
TypeClass
.
SEQUENCE_value
;
...
@@ -756,8 +756,8 @@ class UnoObjectDefinition{
...
@@ -756,8 +756,8 @@ class UnoObjectDefinition{
if
(
aVariables
.
containsKey
(
sVariableName
)){
if
(
aVariables
.
containsKey
(
sVariableName
)){
String
sUnoObjectIdentity
=
aVariables
.
get
(
sVariableName
).
getUnoObject
().
toString
();
String
sUnoObjectIdentity
=
aVariables
.
get
(
sVariableName
).
getUnoObject
().
toString
();
if
(
m_oUnoObject
!=
null
){
if
(
m_oUnoObject
!=
null
){
if
((
sUnoObjectIdentity
.
equals
(
m_oUnoObject
.
toString
())
&&
(!
m_o
Introspector
.
isPrimitive
(
this
.
getTypeClass
()))
&&
if
((
sUnoObjectIdentity
.
equals
(
m_oUnoObject
.
toString
())
&&
(!
Introspector
.
isPrimitive
(
this
.
getTypeClass
()))
&&
(!
m_o
Introspector
.
isObjectSequence
(
m_oUnoObject
)))){
(!
Introspector
.
isObjectSequence
(
m_oUnoObject
)))){
bleaveloop
=
true
;
bleaveloop
=
true
;
}
}
else
{
else
{
...
@@ -871,11 +871,11 @@ class UnoObjectDefinition{
...
@@ -871,11 +871,11 @@ class UnoObjectDefinition{
String
sClassName
=
_sClassName
;
String
sClassName
=
_sClassName
;
String
sHeaderStatement
=
""
;
String
sHeaderStatement
=
""
;
if
(
_oUnoObject
!=
null
){
if
(
_oUnoObject
!=
null
){
if
(!
m_o
Introspector
.
isObjectPrimitive
(
_oUnoObject
)){
if
(!
Introspector
.
isObjectPrimitive
(
_oUnoObject
)){
if
(
m_o
Introspector
.
isObjectSequence
(
_oUnoObject
)){
if
(
Introspector
.
isObjectSequence
(
_oUnoObject
)){
XTypeDescription
xTypeDescription
=
m_oIntrospector
.
getReferencedType
(
sClassName
);
XTypeDescription
xTypeDescription
=
m_oIntrospector
.
getReferencedType
(
sClassName
);
if
(
xTypeDescription
!=
null
){
if
(
xTypeDescription
!=
null
){
if
(!
m_o
Introspector
.
isPrimitive
(
xTypeDescription
.
getTypeClass
())){
if
(!
Introspector
.
isPrimitive
(
xTypeDescription
.
getTypeClass
())){
sClassName
=
getTypeString
(
xTypeDescription
.
getName
(),
xTypeDescription
.
getTypeClass
(),
true
);
sClassName
=
getTypeString
(
xTypeDescription
.
getName
(),
xTypeDescription
.
getTypeClass
(),
true
);
}
}
// primitive Types are not supposed to turn up in the import section...
// primitive Types are not supposed to turn up in the import section...
...
@@ -1428,11 +1428,11 @@ class UnoObjectDefinition{
...
@@ -1428,11 +1428,11 @@ class UnoObjectDefinition{
String
sClassName
=
_sClassName
;
String
sClassName
=
_sClassName
;
String
sHeaderStatement
=
""
;
String
sHeaderStatement
=
""
;
if
(
_oUnoObject
!=
null
){
if
(
_oUnoObject
!=
null
){
if
(!
m_o
Introspector
.
isObjectPrimitive
(
_oUnoObject
)){
if
(!
Introspector
.
isObjectPrimitive
(
_oUnoObject
)){
if
(
m_o
Introspector
.
isObjectSequence
(
_oUnoObject
)){
if
(
Introspector
.
isObjectSequence
(
_oUnoObject
)){
XTypeDescription
xTypeDescription
=
m_oIntrospector
.
getReferencedType
(
sClassName
);
XTypeDescription
xTypeDescription
=
m_oIntrospector
.
getReferencedType
(
sClassName
);
if
(
xTypeDescription
!=
null
){
if
(
xTypeDescription
!=
null
){
if
(!
m_o
Introspector
.
isPrimitive
(
xTypeDescription
.
getTypeClass
())){
if
(!
Introspector
.
isPrimitive
(
xTypeDescription
.
getTypeClass
())){
sClassName
=
getTypeString
(
xTypeDescription
.
getName
(),
xTypeDescription
.
getTypeClass
(),
true
);
sClassName
=
getTypeString
(
xTypeDescription
.
getName
(),
xTypeDescription
.
getTypeClass
(),
true
);
}
}
// primitive Types are not supposed to turn up in the import section...
// primitive Types are not supposed to turn up in the import section...
...
@@ -1682,7 +1682,7 @@ class UnoObjectDefinition{
...
@@ -1682,7 +1682,7 @@ class UnoObjectDefinition{
public
String
getVariableDeclaration
(
String
_sTypeString
,
String
_sVariableName
,
boolean
bIsArray
,
TypeClass
_aTypeClass
,
boolean
_bInitialize
){
public
String
getVariableDeclaration
(
String
_sTypeString
,
String
_sVariableName
,
boolean
bIsArray
,
TypeClass
_aTypeClass
,
boolean
_bInitialize
){
boolean
bIsPrimitive
=
m_o
Introspector
.
isPrimitive
(
_aTypeClass
);
boolean
bIsPrimitive
=
Introspector
.
isPrimitive
(
_aTypeClass
);
// uno::Reference< frame::XDispatch > m_xDispatch
// uno::Reference< frame::XDispatch > m_xDispatch
String
sReturn
=
""
;
String
sReturn
=
""
;
...
...
odk/examples/java/Inspector/UnoNode.java
Dosyayı görüntüle @
fb39e719
...
@@ -419,7 +419,7 @@ public class UnoNode{
...
@@ -419,7 +419,7 @@ public class UnoNode{
return
xServiceInfo
.
getImplementationName
();
return
xServiceInfo
.
getImplementationName
();
}
}
String
sClassName
=
_oUnoObject
.
getClass
().
getName
();
String
sClassName
=
_oUnoObject
.
getClass
().
getName
();
if
(
Introspector
.
getIntrospector
().
isObjectPrimitive
(
_oUnoObject
)){
//super.isO{sObjectClassName.equals("java.lang.String"))issClassName.equals("java.lang.String"))
if
(
Introspector
.
isObjectPrimitive
(
_oUnoObject
)){
//super.isO{sObjectClassName.equals("java.lang.String"))issClassName.equals("java.lang.String"))
return
_oUnoObject
.
toString
();
return
_oUnoObject
.
toString
();
}
}
else
{
else
{
...
...
odk/examples/java/Spreadsheet/EuroAdaption.java
Dosyayı görüntüle @
fb39e719
...
@@ -165,9 +165,6 @@ public class EuroAdaption {
...
@@ -165,9 +165,6 @@ public class EuroAdaption {
XEnumeration
xRanges
=
xEnumerationAccess
.
createEnumeration
();
XEnumeration
xRanges
=
xEnumerationAccess
.
createEnumeration
();
// create an AnyConverter for later use
AnyConverter
aAnyConv
=
new
AnyConverter
();
while
(
xRanges
.
hasMoreElements
()
)
{
while
(
xRanges
.
hasMoreElements
()
)
{
// the enumeration returns a cellrange
// the enumeration returns a cellrange
XCellRange
xCellRange
=
UnoRuntime
.
queryInterface
(
XCellRange
xCellRange
=
UnoRuntime
.
queryInterface
(
...
@@ -180,28 +177,28 @@ public class EuroAdaption {
...
@@ -180,28 +177,28 @@ public class EuroAdaption {
// getPropertyValue returns an Object, you have to cast it to
// getPropertyValue returns an Object, you have to cast it to
// type that you need
// type that you need
Object
oNumberObject
=
xCellProp
.
getPropertyValue
(
"NumberFormat"
);
Object
oNumberObject
=
xCellProp
.
getPropertyValue
(
"NumberFormat"
);
int
iNumberFormat
=
aAnyConv
.
toInt
(
oNumberObject
);
int
iNumberFormat
=
AnyConverter
.
toInt
(
oNumberObject
);
// get the properties from the cellrange numberformat
// get the properties from the cellrange numberformat
XPropertySet
xFormat
=
xNumberFormats
.
getByKey
(
iNumberFormat
);
XPropertySet
xFormat
=
xNumberFormats
.
getByKey
(
iNumberFormat
);
short
fType
=
aAnyConv
.
toShort
(
xFormat
.
getPropertyValue
(
"Type"
));
short
fType
=
AnyConverter
.
toShort
(
xFormat
.
getPropertyValue
(
"Type"
));
String
sCurrencySymbol
=
aAnyConv
.
toString
(
String
sCurrencySymbol
=
AnyConverter
.
toString
(
xFormat
.
getPropertyValue
(
"CurrencySymbol"
));
xFormat
.
getPropertyValue
(
"CurrencySymbol"
));
// change the numberformat only on cellranges with a
// change the numberformat only on cellranges with a
// currency numberformat
// currency numberformat
if
(
(
(
fType
&
com
.
sun
.
star
.
util
.
NumberFormat
.
CURRENCY
)
>
0
)
&&
if
(
(
(
fType
&
com
.
sun
.
star
.
util
.
NumberFormat
.
CURRENCY
)
>
0
)
&&
(
sCurrencySymbol
.
compareTo
(
sOldSymbol
)
==
0
)
)
{
(
sCurrencySymbol
.
compareTo
(
sOldSymbol
)
==
0
)
)
{
boolean
bThousandSep
=
aAnyConv
.
toBoolean
(
boolean
bThousandSep
=
AnyConverter
.
toBoolean
(
xFormat
.
getPropertyValue
(
"ThousandsSeparator"
));
xFormat
.
getPropertyValue
(
"ThousandsSeparator"
));
boolean
bNegativeRed
=
aAnyConv
.
toBoolean
(
boolean
bNegativeRed
=
AnyConverter
.
toBoolean
(
xFormat
.
getPropertyValue
(
"NegativeRed"
));
xFormat
.
getPropertyValue
(
"NegativeRed"
));
short
fDecimals
=
aAnyConv
.
toShort
(
short
fDecimals
=
AnyConverter
.
toShort
(
xFormat
.
getPropertyValue
(
"Decimals"
));
xFormat
.
getPropertyValue
(
"Decimals"
));
short
fLeadingZeros
=
aAnyConv
.
toShort
(
short
fLeadingZeros
=
AnyConverter
.
toShort
(
xFormat
.
getPropertyValue
(
"LeadingZeros"
));
xFormat
.
getPropertyValue
(
"LeadingZeros"
));
Locale
oLocale
=
(
Locale
)
aAnyConv
.
toObject
(
Locale
oLocale
=
(
Locale
)
AnyConverter
.
toObject
(
new
com
.
sun
.
star
.
uno
.
Type
(
Locale
.
class
),
new
com
.
sun
.
star
.
uno
.
Type
(
Locale
.
class
),
xFormat
.
getPropertyValue
(
"Locale"
));
xFormat
.
getPropertyValue
(
"Locale"
));
...
...
odk/examples/java/Text/StyleInitialization.java
Dosyayı görüntüle @
fb39e719
...
@@ -202,7 +202,7 @@ public class StyleInitialization {
...
@@ -202,7 +202,7 @@ public class StyleInitialization {
com
.
sun
.
star
.
beans
.
XPropertySet
.
class
,
xStyle
);
com
.
sun
.
star
.
beans
.
XPropertySet
.
class
,
xStyle
);
AnyConverter
aAnyConv
=
new
AnyConverter
();
AnyConverter
aAnyConv
=
new
AnyConverter
();
String
sFontname
=
aAnyConv
.
toString
(
xPropertySet
.
getPropertyValue
(
"CharFontName"
));
String
sFontname
=
AnyConverter
.
toString
(
xPropertySet
.
getPropertyValue
(
"CharFontName"
));
sFontname
=
sFontname
.
toLowerCase
();
sFontname
=
sFontname
.
toLowerCase
();
// if the style use the font 'Albany', apply it to the current paragraph
// if the style use the font 'Albany', apply it to the current paragraph
...
...
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