• Tor Lillqvist's avatar
    Re-think cppu::throwException() and the C++/UNO bridge on iOS · 7d6be61a
    Tor Lillqvist yazdı
    It seems that on iOS, where we don't have any Java, Python, BASIC, or
    other scripting, the only thing that would use the C++/UNO bridge
    functionality that invokes codeSnippet() was cppu::throwException().
    
    codeSnippet() is part of what corresponds to the code that uses
    run-time-generated machine code on other platforms. We can't generate
    code at run-time on iOS, that has been known forever. Instead we have
    used some manually written assembler to handle it instead. We used to
    have a Perl script to generate a set of code snippets for different
    cases, different numbers of parameters of the called function and
    whatnot, but that went away at some stage some year ago. (It is
    unclear whether that broke the C++/UNO bridge on iOS, or whether the
    stuff continued to work even after that.)
    
    Anyway, this handwritten assembly, or the manual construction of
    internal data structures for exceptions, or something else, seemed to
    have bit-rotten. Exceptions thrown with cppu::throwException() were
    not catchable properly any longer.
    
    Instead of digging in and trying to understand what is wrong, I chose
    another solution. It turns out that the number of types of exception
    objects thrown by cppu::throwException() is fairly small. During
    startup of the LibreOffice code, and loading of an .odt document, only
    one kind of exception is thrown this way... (The lovely
    css::ucb:InteractiveAugmentedIOException.)
    
    So we can simply have code that checks what the type of object being
    thrown is, and explicitgly throws such an object then with a normal
    C++ throw statement. Seems to work.
    
    Sadly the cppu::getCaughtException() API still needs some inline
    assembly in the C++/UNO brige. That seems to work though, knock on
    wood.
    
    This commit also adds a small "unit test" for iOS, copied from
    cppuhelperm to ImplSVMain(). Ideally we should not copy code around of
    course, but have a separate unit test app for iOS that would somehow
    include relevant unit tests from source files all over the place.
    Later.
    
    Change-Id: Ib6d9d5b6fb8cc684ec15c97a312ca2f720e87069
    Reviewed-on: https://gerrit.libreoffice.org/60506
    Tested-by: Jenkins
    Reviewed-by: 's avatarTor Lillqvist <tml@collabora.com>
    7d6be61a
Adı
Son kayıt (commit)
Son güncelleme
..
LibreOfficeKit Loading commit data...
android Loading commit data...
animations Loading commit data...
apple_remote Loading commit data...
avmedia Loading commit data...
basegfx Loading commit data...
basic Loading commit data...
canvas Loading commit data...
codemaker Loading commit data...
com/sun/star/uno Loading commit data...
comphelper Loading commit data...
connectivity Loading commit data...
cppcanvas Loading commit data...
cppu Loading commit data...
cppuhelper Loading commit data...
cppunittester Loading commit data...
dbaccess Loading commit data...
desktop Loading commit data...
drawinglayer Loading commit data...
editeng Loading commit data...
filter Loading commit data...
formula Loading commit data...
fpicker Loading commit data...
framework Loading commit data...
helpcompiler Loading commit data...
i18nlangtag Loading commit data...
i18nutil Loading commit data...
ios Loading commit data...
jvmaccess Loading commit data...
jvmfwk Loading commit data...
linguistic Loading commit data...
o3tl Loading commit data...
onlineupdate Loading commit data...
oox Loading commit data...
opencl Loading commit data...
osl Loading commit data...
package Loading commit data...
registry Loading commit data...
rtl Loading commit data...
sal Loading commit data...
salhelper Loading commit data...
sax Loading commit data...
sfx2 Loading commit data...
sot Loading commit data...
store Loading commit data...
svl Loading commit data...
svtools Loading commit data...
svx Loading commit data...
systools/win32 Loading commit data...
test Loading commit data...
toolkit Loading commit data...
tools Loading commit data...
typelib Loading commit data...
ucbhelper Loading commit data...
uno Loading commit data...
unoidl Loading commit data...
unotest Loading commit data...
unotools Loading commit data...
vbahelper Loading commit data...
vcl Loading commit data...
xmloff Loading commit data...
xmlreader Loading commit data...
xmlscript Loading commit data...
IwyuFilter_include.yaml Loading commit data...
default.rc Loading commit data...
postmac.h Loading commit data...
postwin.h Loading commit data...
premac.h Loading commit data...
prewin.h Loading commit data...
version.hrc Loading commit data...