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
0557453a
Kaydet (Commit)
0557453a
authored
Nis 12, 2013
tarafından
Stephan Bergmann
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Combine getSortResolve...() into one decompose()
Change-Id: Ie1c1311d1df14d5639b7642d2b9a1588605c31fc
üst
9fb856ce
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
64 additions
and
90 deletions
+64
-90
typemanager.hxx
codemaker/inc/codemaker/typemanager.hxx
+3
-6
typemanager.cxx
codemaker/source/codemaker/typemanager.cxx
+53
-70
javatype.cxx
codemaker/source/javamaker/javatype.cxx
+8
-14
No files found.
codemaker/inc/codemaker/typemanager.hxx
Dosyayı görüntüle @
0557453a
...
...
@@ -87,12 +87,9 @@ public:
OUString
const
&
name
,
rtl
::
Reference
<
unoidl
::
Entity
>
*
entity
=
0
,
rtl
::
Reference
<
unoidl
::
MapCursor
>
*
cursor
=
0
)
const
;
codemaker
::
UnoType
::
Sort
getSortResolveOuterSequences
(
OUString
const
&
name
,
OUString
*
nucleus
,
sal_Int32
*
rank
)
const
;
codemaker
::
UnoType
::
Sort
getSortResolveAllSequencesTemplatesTypedefs
(
OUString
const
&
name
,
OUString
*
nucleus
,
sal_Int32
*
rank
,
std
::
vector
<
OUString
>
*
arguments
,
codemaker
::
UnoType
::
Sort
decompose
(
OUString
const
&
name
,
bool
resolveTypedefs
,
OUString
*
nucleus
,
sal_Int32
*
rank
,
std
::
vector
<
OUString
>
*
arguments
,
rtl
::
Reference
<
unoidl
::
Entity
>
*
entity
)
const
;
private
:
...
...
codemaker/source/codemaker/typemanager.cxx
Dosyayı görüntüle @
0557453a
...
...
@@ -445,71 +445,36 @@ codemaker::UnoType::Sort TypeManager::getSort(
}
}
codemaker
::
UnoType
::
Sort
TypeManager
::
getSortResolveOuterSequences
(
OUString
const
&
name
,
OUString
*
nucleus
,
sal_Int32
*
rank
)
const
{
assert
(
nucleus
!=
0
);
assert
(
rank
!=
0
);
*
nucleus
=
name
;
*
rank
=
0
;
while
(
nucleus
->
startsWith
(
"[]"
))
{
++
rank
;
*
nucleus
=
nucleus
->
copy
(
std
::
strlen
(
"[]"
));
}
codemaker
::
UnoType
::
Sort
s
=
getSort
(
*
nucleus
);
switch
(
s
)
{
case
codemaker
:
:
UnoType
::
SORT_BOOLEAN
:
case
codemaker
:
:
UnoType
::
SORT_BYTE
:
case
codemaker
:
:
UnoType
::
SORT_SHORT
:
case
codemaker
:
:
UnoType
::
SORT_UNSIGNED_SHORT
:
case
codemaker
:
:
UnoType
::
SORT_LONG
:
case
codemaker
:
:
UnoType
::
SORT_UNSIGNED_LONG
:
case
codemaker
:
:
UnoType
::
SORT_HYPER
:
case
codemaker
:
:
UnoType
::
SORT_UNSIGNED_HYPER
:
case
codemaker
:
:
UnoType
::
SORT_FLOAT
:
case
codemaker
:
:
UnoType
::
SORT_DOUBLE
:
case
codemaker
:
:
UnoType
::
SORT_CHAR
:
case
codemaker
:
:
UnoType
::
SORT_STRING
:
case
codemaker
:
:
UnoType
::
SORT_TYPE
:
case
codemaker
:
:
UnoType
::
SORT_ANY
:
case
codemaker
:
:
UnoType
::
SORT_ENUM_TYPE
:
case
codemaker
:
:
UnoType
::
SORT_PLAIN_STRUCT_TYPE
:
case
codemaker
:
:
UnoType
::
SORT_INTERFACE_TYPE
:
case
codemaker
:
:
UnoType
::
SORT_TYPEDEF
:
return
s
;
case
codemaker
:
:
UnoType
::
SORT_SEQUENCE_TYPE
:
assert
(
false
);
// this cannot happen
// fall through
default
:
throw
CannotDumpException
(
"unexpected
\"
"
+
*
nucleus
+
"
\"
resolved from
\"
"
+
name
+
"
\"
in call to TypeManager::getSortResolveOuterSequences"
);
}
}
codemaker
::
UnoType
::
Sort
TypeManager
::
getSortResolveAllSequencesTemplatesTypedefs
(
OUString
const
&
name
,
OUString
*
nucleus
,
sal_Int32
*
rank
,
std
::
vector
<
OUString
>
*
arguments
,
codemaker
::
UnoType
::
Sort
TypeManager
::
decompose
(
OUString
const
&
name
,
bool
resolveTypedefs
,
OUString
*
nucleus
,
sal_Int32
*
rank
,
std
::
vector
<
OUString
>
*
arguments
,
rtl
::
Reference
<
unoidl
::
Entity
>
*
entity
)
const
{
assert
(
nucleus
!=
0
);
assert
(
rank
!=
0
);
assert
(
arguments
!=
0
);
arguments
->
clear
();
sal_Int32
k
;
std
::
vector
<
OString
>
args
;
*
nucleus
=
b2u
(
codemaker
::
UnoType
::
decompose
(
u2b
(
name
),
ran
k
,
&
args
));
OUString
n
=
b2u
(
codemaker
::
UnoType
::
decompose
(
u2b
(
name
),
&
k
,
&
args
));
for
(;;)
{
rtl
::
Reference
<
unoidl
::
Entity
>
ent
;
codemaker
::
UnoType
::
Sort
s
=
getSort
(
*
nucleus
,
&
ent
);
codemaker
::
UnoType
::
Sort
s
=
getSort
(
n
,
&
ent
);
if
(
args
.
empty
()
!=
(
s
!=
codemaker
::
UnoType
::
SORT_POLYMORPHIC_STRUCT_TYPE_TEMPLATE
))
{
throw
CannotDumpException
(
"
syntax error,
\"
"
+
*
nucleus
+
"
\"
resolved from
\"
"
+
name
+
"
\"
"
);
"
template arguments mismatch for
\"
"
+
n
+
"
\"
resolved from
\"
"
+
name
+
"
\"
"
);
}
switch
(
s
)
{
case
codemaker
:
:
UnoType
::
SORT_TYPEDEF
:
if
(
resolveTypedefs
)
{
n
=
dynamic_cast
<
unoidl
::
TypedefEntity
*
>
(
ent
.
get
())
->
getType
();
while
(
n
.
startsWith
(
"[]"
))
{
++
k
;
//TODO: overflow
n
=
n
.
copy
(
std
::
strlen
(
"[]"
));
}
break
;
}
// fall through
case
codemaker
:
:
UnoType
::
SORT_VOID
:
case
codemaker
:
:
UnoType
::
SORT_BOOLEAN
:
case
codemaker
:
:
UnoType
::
SORT_BYTE
:
...
...
@@ -528,37 +493,55 @@ TypeManager::getSortResolveAllSequencesTemplatesTypedefs(
case
codemaker
:
:
UnoType
::
SORT_ENUM_TYPE
:
case
codemaker
:
:
UnoType
::
SORT_PLAIN_STRUCT_TYPE
:
case
codemaker
:
:
UnoType
::
SORT_INTERFACE_TYPE
:
if
(
nucleus
!=
0
)
{
*
nucleus
=
n
;
}
if
(
rank
!=
0
)
{
*
rank
=
k
;
}
if
(
arguments
!=
0
)
{
arguments
->
clear
();
}
if
(
entity
!=
0
)
{
*
entity
=
ent
;
}
return
s
;
case
codemaker
:
:
UnoType
::
SORT_POLYMORPHIC_STRUCT_TYPE_TEMPLATE
:
if
(
args
.
size
()
!=
(
dynamic_cast
<
unoidl
::
PolymorphicStructTypeTemplateEntity
*
>
(
ent
.
get
())
->
getTypeParameters
().
size
()))
{
throw
CannotDumpException
(
"bad number of template arguments for
\"
"
+
n
+
"
\"
resolved from
\"
"
+
name
+
"
\"
"
);
}
if
(
nucleus
!=
0
)
{
*
nucleus
=
n
;
}
if
(
rank
!=
0
)
{
*
rank
=
k
;
}
if
(
arguments
!=
0
)
{
arguments
->
clear
();
for
(
std
::
vector
<
OString
>::
iterator
i
(
args
.
begin
());
i
!=
args
.
end
();
++
i
)
{
arguments
->
push_back
(
b2u
(
*
i
));
}
}
if
(
entity
!=
0
)
{
*
entity
=
ent
;
}
for
(
std
::
vector
<
OString
>::
iterator
i
(
args
.
begin
());
i
!=
args
.
end
();
++
i
)
{
arguments
->
push_back
(
b2u
(
*
i
));
}
return
codemaker
::
UnoType
::
SORT_INSTANTIATED_POLYMORPHIC_STRUCT_TYPE
;
case
codemaker
:
:
UnoType
::
SORT_TYPEDEF
:
*
nucleus
=
dynamic_cast
<
unoidl
::
TypedefEntity
*
>
(
ent
.
get
())
->
getType
();
while
(
nucleus
->
startsWith
(
"[]"
))
{
++*
rank
;
//TODO: overflow
*
nucleus
=
nucleus
->
copy
(
std
::
strlen
(
"[]"
));
}
break
;
case
codemaker
:
:
UnoType
::
SORT_SEQUENCE_TYPE
:
assert
(
false
);
// this cannot happen
// fall through
default
:
throw
CannotDumpException
(
"unexpected
\"
"
+
*
nucleus
+
"
\"
resolved from
\"
"
+
name
+
(
"
\"
in call to TypeManager::"
"getSortResolveAllSequencesTemplatesTypedefs"
));
"unexpected
\"
"
+
n
+
"
\"
resolved from
\"
"
+
name
+
(
"
\"
in call to TypeManager::decompose"
));
}
}
}
...
...
codemaker/source/javamaker/javatype.cxx
Dosyayı görüntüle @
0557453a
...
...
@@ -74,8 +74,7 @@ void appendUnoName(
OUString
n
;
sal_Int32
k
;
std
::
vector
<
OUString
>
args
;
manager
->
getSortResolveAllSequencesTemplatesTypedefs
(
*
i
,
&
n
,
&
k
,
&
args
,
0
);
manager
->
decompose
(
*
i
,
false
,
&
n
,
&
k
,
&
args
,
0
);
appendUnoName
(
manager
,
n
,
k
,
args
,
buffer
);
}
buffer
->
append
(
'>'
);
...
...
@@ -284,9 +283,8 @@ SpecialType translateUnoTypeToDescriptor(
OUString
nucleus
;
sal_Int32
rank
;
std
::
vector
<
OUString
>
args
;
codemaker
::
UnoType
::
Sort
sort
=
manager
->
getSortResolveAllSequencesTemplatesTypedefs
(
type
,
&
nucleus
,
&
rank
,
&
args
,
0
);
codemaker
::
UnoType
::
Sort
sort
=
manager
->
decompose
(
type
,
true
,
&
nucleus
,
&
rank
,
&
args
,
0
);
return
translateUnoTypeToDescriptor
(
manager
,
sort
,
nucleus
,
rank
,
args
,
array
,
classType
,
dependencies
,
descriptor
,
signature
,
needsSignature
,
polymorphicUnoType
);
...
...
@@ -897,9 +895,8 @@ sal_uInt16 addFieldInit(
sal_Int32
rank
;
std
::
vector
<
rtl
::
OUString
>
args
;
rtl
::
Reference
<
unoidl
::
Entity
>
ent
;
codemaker
::
UnoType
::
Sort
sort
=
manager
->
getSortResolveAllSequencesTemplatesTypedefs
(
fieldType
,
&
nucleus
,
&
rank
,
&
args
,
&
ent
);
codemaker
::
UnoType
::
Sort
sort
=
manager
->
decompose
(
fieldType
,
true
,
&
nucleus
,
&
rank
,
&
args
,
&
ent
);
if
(
rank
==
0
)
{
switch
(
sort
)
{
case
codemaker
:
:
UnoType
::
SORT_BOOLEAN
:
...
...
@@ -1023,9 +1020,8 @@ sal_uInt16 addLoadLocal(
OUString
nucleus
;
sal_Int32
rank
;
std
::
vector
<
OUString
>
args
;
codemaker
::
UnoType
::
Sort
sort
=
manager
->
getSortResolveAllSequencesTemplatesTypedefs
(
type
,
&
nucleus
,
&
rank
,
&
args
,
0
);
codemaker
::
UnoType
::
Sort
sort
=
manager
->
decompose
(
type
,
true
,
&
nucleus
,
&
rank
,
&
args
,
0
);
if
(
rank
==
0
)
{
switch
(
sort
)
{
case
codemaker
:
:
UnoType
::
SORT_BOOLEAN
:
...
...
@@ -1928,9 +1924,7 @@ void handleTypedef(
assert
(
manager
.
is
());
assert
(
dependencies
!=
0
);
OUString
nucleus
;
sal_Int32
rank
;
switch
(
manager
->
getSortResolveOuterSequences
(
entity
->
getType
(),
&
nucleus
,
&
rank
))
switch
(
manager
->
decompose
(
entity
->
getType
(),
false
,
&
nucleus
,
0
,
0
,
0
))
{
case
codemaker
:
:
UnoType
::
SORT_BOOLEAN
:
case
codemaker
:
:
UnoType
::
SORT_BYTE
:
...
...
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