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
f0c41307
Kaydet (Commit)
f0c41307
authored
Tem 08, 2015
tarafından
Stephan Bergmann
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Use OUString::starts/endsWith
Change-Id: I88effbf6f88dfb286f85f8fbd06bab8033aca6b0
üst
4ec7f1d7
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
16 additions
and
42 deletions
+16
-42
introspection.cxx
stoc/source/inspect/introspection.cxx
+16
-42
No files found.
stoc/source/inspect/introspection.cxx
Dosyayı görüntüle @
f0c41307
...
@@ -1972,12 +1972,9 @@ css::uno::Reference<css::beans::XIntrospectionAccess> Implementation::inspect(
...
@@ -1972,12 +1972,9 @@ css::uno::Reference<css::beans::XIntrospectionAccess> Implementation::inspect(
continue
;
continue
;
// Ist es eine get-Methode?
// Ist es eine get-Methode?
OUString
a
StartStr
=
aMethName
.
copy
(
0
,
3
)
;
OUString
a
PropName
;
if
(
a
StartStr
==
"get"
)
if
(
a
MethName
.
startsWith
(
"get"
,
&
aPropName
)
)
{
{
// Namen der potentiellen Property
OUString
aPropName
=
aMethName
.
copy
(
3
);
// get-Methode darf keinen Parameter haben
// get-Methode darf keinen Parameter haben
Sequence
<
Reference
<
XIdlClass
>
>
getParams
=
rxMethod_i
->
getParameterTypes
();
Sequence
<
Reference
<
XIdlClass
>
>
getParams
=
rxMethod_i
->
getParameterTypes
();
if
(
getParams
.
getLength
()
>
0
)
if
(
getParams
.
getLength
()
>
0
)
...
@@ -2044,13 +2041,9 @@ css::uno::Reference<css::beans::XIntrospectionAccess> Implementation::inspect(
...
@@ -2044,13 +2041,9 @@ css::uno::Reference<css::beans::XIntrospectionAccess> Implementation::inspect(
// Name holen und auswerten
// Name holen und auswerten
OUString
aMethName2
=
rxMethod_k
->
getName
();
OUString
aMethName2
=
rxMethod_k
->
getName
();
OUString
aStartStr2
=
aMethName2
.
copy
(
0
,
3
);
OUString
aPropName2
;
if
(
aStartStr2
!=
"set"
)
if
(
!
(
aMethName2
.
startsWith
(
"set"
,
&
aPropName2
)
continue
;
&&
aPropName2
==
aPropName
))
// Ist es denn der gleiche Name?
OUString
aPropName2
=
aMethName2
.
copy
(
3
);
if
(
aPropName
!=
aPropName2
)
continue
;
continue
;
// set-Methode muss void returnen
// set-Methode muss void returnen
...
@@ -2092,22 +2085,13 @@ css::uno::Reference<css::beans::XIntrospectionAccess> Implementation::inspect(
...
@@ -2092,22 +2085,13 @@ css::uno::Reference<css::beans::XIntrospectionAccess> Implementation::inspect(
}
}
// Ist es eine addListener-Methode?
// Ist es eine addListener-Methode?
else
if
(
a
StartStr
==
"add"
)
else
if
(
a
MethName
.
startsWith
(
"add"
,
&
aPropName
)
)
{
{
OUString
aListenerStr
(
"Listener"
);
// Namen der potentiellen Property
sal_Int32
nStrLen
=
aMethName
.
getLength
();
sal_Int32
nCopyLen
=
nStrLen
-
aListenerStr
.
getLength
();
OUString
aEndStr
=
aMethName
.
copy
(
nCopyLen
>
0
?
nCopyLen
:
0
);
// Endet das Teil auf Listener?
// Endet das Teil auf Listener?
if
(
aEndStr
!=
aListenerStr
)
OUString
aListenerName
;
if
(
!
aPropName
.
endsWith
(
"Listener"
,
&
aListenerName
)
)
continue
;
continue
;
// Welcher Listener?
OUString
aListenerName
=
aMethName
.
copy
(
3
,
nStrLen
-
aListenerStr
.
getLength
()
-
3
);
// TODO: Hier koennten noch genauere Pruefungen vorgenommen werden
// TODO: Hier koennten noch genauere Pruefungen vorgenommen werden
// - Rueckgabe-Typ
// - Rueckgabe-Typ
// - Anzahl und Art der Parameter
// - Anzahl und Art der Parameter
...
@@ -2126,19 +2110,12 @@ css::uno::Reference<css::beans::XIntrospectionAccess> Implementation::inspect(
...
@@ -2126,19 +2110,12 @@ css::uno::Reference<css::beans::XIntrospectionAccess> Implementation::inspect(
// Name holen und auswerten
// Name holen und auswerten
OUString
aMethName2
=
rxMethod_k
->
getName
();
OUString
aMethName2
=
rxMethod_k
->
getName
();
sal_Int32
nNameLen
=
aMethName2
.
getLength
();
OUString
aListenerName2
;
sal_Int32
nCopyLen2
=
(
nNameLen
<
6
)
?
nNameLen
:
6
;
if
(
!
(
aMethName2
.
startsWith
(
OUString
aStartStr2
=
aMethName2
.
copy
(
0
,
nCopyLen2
);
"remove"
,
&
aPropName
)
OUString
aRemoveStr
(
"remove"
);
&&
aPropName
.
endsWith
(
if
(
aStartStr2
!=
aRemoveStr
)
"Listener"
,
&
aListenerName2
)
continue
;
&&
aListenerName2
==
aListenerName
))
// Ist es denn der gleiche Listener?
if
(
aMethName2
.
getLength
()
-
aRemoveStr
.
getLength
()
<=
aListenerStr
.
getLength
()
)
continue
;
OUString
aListenerName2
=
aMethName2
.
copy
(
6
,
aMethName2
.
getLength
()
-
aRemoveStr
.
getLength
()
-
aListenerStr
.
getLength
()
);
if
(
aListenerName
!=
aListenerName2
)
continue
;
continue
;
// TODO: Hier koennten noch genauere Pruefungen vorgenommen werden
// TODO: Hier koennten noch genauere Pruefungen vorgenommen werden
...
@@ -2177,12 +2154,9 @@ css::uno::Reference<css::beans::XIntrospectionAccess> Implementation::inspect(
...
@@ -2177,12 +2154,9 @@ css::uno::Reference<css::beans::XIntrospectionAccess> Implementation::inspect(
continue
;
continue
;
// Ist es eine set-Methode ohne zugehoerige get-Methode?
// Ist es eine set-Methode ohne zugehoerige get-Methode?
OUString
a
StartStr
=
aMethName
.
copy
(
0
,
3
)
;
OUString
a
PropName
;
if
(
a
StartStr
==
"set"
)
if
(
a
MethName
.
startsWith
(
"set"
,
&
aPropName
)
)
{
{
// Namen der potentiellen Property
OUString
aPropName
=
aMethName
.
copy
(
3
);
// set-Methode muss void returnen
// set-Methode muss void returnen
Reference
<
XIdlClass
>
xSetRetType
=
rxMethod_i
->
getReturnType
();
Reference
<
XIdlClass
>
xSetRetType
=
rxMethod_i
->
getReturnType
();
if
(
xSetRetType
->
getTypeClass
()
!=
TypeClass_VOID
)
if
(
xSetRetType
->
getTypeClass
()
!=
TypeClass_VOID
)
...
...
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