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
03806980
Kaydet (Commit)
03806980
authored
Haz 21, 2016
tarafından
Stephan Bergmann
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Clean up uses of Any::getValue() in pyuno
Change-Id: I35c4ac0b84e439982f87420aa7587c99ee367920
üst
cc66f408
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
17 additions
and
11 deletions
+17
-11
Library_pythonloader.mk
pyuno/Library_pythonloader.mk
+1
-0
pyuno_loader.cxx
pyuno/source/loader/pyuno_loader.cxx
+4
-2
pyuno_adapter.cxx
pyuno/source/module/pyuno_adapter.cxx
+3
-1
pyuno_runtime.cxx
pyuno/source/module/pyuno_runtime.cxx
+4
-6
pyuno_type.cxx
pyuno/source/module/pyuno_type.cxx
+5
-2
No files found.
pyuno/Library_pythonloader.mk
Dosyayı görüntüle @
03806980
...
...
@@ -29,6 +29,7 @@ $(eval $(call gb_Library_use_libraries,pythonloader,\
))
$(eval $(call gb_Library_use_externals,pythonloader,\
boost_headers \
python \
))
...
...
pyuno/source/loader/pyuno_loader.cxx
Dosyayı görüntüle @
03806980
...
...
@@ -22,6 +22,8 @@
#include <pyuno.hxx>
#include <o3tl/any.hxx>
#include <osl/process.h>
#include <osl/file.hxx>
#include <osl/thread.h>
...
...
@@ -71,8 +73,8 @@ static void raiseRuntimeExceptionWhenNeeded() throw ( RuntimeException )
css
::
uno
::
Any
a
=
runtime
.
extractUnoException
(
excType
,
excValue
,
excTraceback
);
OUStringBuffer
buf
;
buf
.
append
(
"python-loader:"
);
if
(
a
.
hasValue
(
)
)
buf
.
append
(
static_cast
<
css
::
uno
::
Exception
const
*>
(
a
.
getValue
())
->
Message
);
if
(
a
uto
e
=
o3tl
::
tryAccess
<
css
::
uno
::
Exception
>
(
a
)
)
buf
.
append
(
e
->
Message
);
throw
RuntimeException
(
buf
.
makeStringAndClear
()
);
}
}
...
...
pyuno/source/module/pyuno_adapter.cxx
Dosyayı görüntüle @
03806980
...
...
@@ -18,6 +18,8 @@
*/
#include "pyuno_impl.hxx"
#include <o3tl/any.hxx>
#include <rtl/ustrbuf.hxx>
#include <rtl/strbuf.hxx>
...
...
@@ -87,7 +89,7 @@ void raiseInvocationTargetExceptionWhenNeeded( const Runtime &runtime )
PyErr_Fetch
(
reinterpret_cast
<
PyObject
**>
(
&
excType
),
reinterpret_cast
<
PyObject
**>
(
&
excValue
),
reinterpret_cast
<
PyObject
**>
(
&
excTraceback
));
Any
unoExc
(
runtime
.
extractUnoException
(
excType
,
excValue
,
excTraceback
)
);
throw
InvocationTargetException
(
static_cast
<
css
::
uno
::
Exception
const
*>
(
unoExc
.
getValue
()
)
->
Message
,
o3tl
::
doAccess
<
css
::
uno
::
Exception
>
(
unoExc
)
->
Message
,
Reference
<
XInterface
>
(),
unoExc
);
}
}
...
...
pyuno/source/module/pyuno_runtime.cxx
Dosyayı görüntüle @
03806980
...
...
@@ -22,6 +22,7 @@
#include "pyuno_impl.hxx"
#include <o3tl/any.hxx>
#include <osl/diagnose.h>
#include <osl/thread.h>
#include <osl/module.h>
...
...
@@ -378,7 +379,7 @@ PyRef Runtime::any2PyObject (const Any &a ) const
}
case
typelib_TypeClass_CHAR
:
{
sal_Unicode
c
=
*
static_cast
<
sal_Unicode
const
*>
(
a
.
getValue
()
);
sal_Unicode
c
=
*
o3tl
::
forceAccess
<
sal_Unicode
>
(
a
);
return
PyRef
(
PyUNO_char_new
(
c
,
*
this
),
SAL_NO_ACQUIRE
);
}
case
typelib_TypeClass_BOOLEAN
:
...
...
@@ -491,15 +492,12 @@ PyRef Runtime::any2PyObject (const Any &a ) const
throw
RuntimeException
(
buf
.
makeStringAndClear
()
);
}
if
(
css
::
uno
::
TypeClass_EXCEPTION
==
a
.
getValueTypeClass
(
)
)
if
(
auto
e
=
o3tl
::
tryAccess
<
css
::
uno
::
Exception
>
(
a
)
)
{
// add the message in a standard python way !
PyRef
args
(
PyTuple_New
(
1
),
SAL_NO_ACQUIRE
,
NOT_NULL
);
// assuming that the Message is always the first member, wuuuu
void
const
*
pData
=
a
.
getValue
();
OUString
message
=
*
static_cast
<
OUString
const
*>
(
pData
);
PyRef
pymsg
=
ustring2PyString
(
message
);
PyRef
pymsg
=
ustring2PyString
(
e
->
Message
);
PyTuple_SetItem
(
args
.
get
(),
0
,
pymsg
.
getAcquired
()
);
// the exception base functions want to have an "args" tuple,
// which contains the message
...
...
pyuno/source/module/pyuno_type.cxx
Dosyayı görüntüle @
03806980
...
...
@@ -18,6 +18,8 @@
*/
#include "pyuno_impl.hxx"
#include <o3tl/any.hxx>
#include <rtl/ustrbuf.hxx>
#include <rtl/strbuf.hxx>
...
...
@@ -220,13 +222,14 @@ Type PyType2Type( PyObject * o ) throw(RuntimeException )
buf
.
append
(
"type "
).
append
(
name
).
append
(
" is unknown"
);
throw
RuntimeException
(
buf
.
makeStringAndClear
()
);
}
if
(
desc
.
get
()
->
eTypeClass
!=
(
typelib_TypeClass
)
*
static_cast
<
sal_Int32
const
*>
(
enumValue
.
getValue
())
)
css
::
uno
::
TypeClass
tc
=
*
o3tl
::
doAccess
<
css
::
uno
::
TypeClass
>
(
enumValue
);
if
(
static_cast
<
css
::
uno
::
TypeClass
>
(
desc
.
get
()
->
eTypeClass
)
!=
tc
)
{
OUStringBuffer
buf
;
buf
.
append
(
"pyuno.checkType: "
).
append
(
name
).
append
(
" is a "
);
buf
.
appendAscii
(
typeClassToString
(
(
TypeClass
)
desc
.
get
()
->
eTypeClass
)
);
buf
.
append
(
", but type got construct with typeclass "
);
buf
.
appendAscii
(
typeClassToString
(
(
TypeClass
)
*
static_cast
<
sal_Int32
const
*>
(
enumValue
.
getValue
())
)
);
buf
.
appendAscii
(
typeClassToString
(
tc
)
);
throw
RuntimeException
(
buf
.
makeStringAndClear
()
);
}
return
desc
.
get
()
->
pWeakRef
;
...
...
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