• Don Lewis's avatar
    A number of methods in main/toolkit/source/layout/vcl/* use either · 837bd0e4
    Don Lewis yazdı
    "!this" or "this" in a boolean context in order to detect being
    called with a null object and exit early.  In a valid C++ program
    "this" will never be null, so a compiler could legally optimize out
    this comparision, which could potentially result in the method
    dereferencing a null pointer later in the code.  This situation
    could only happen if the caller is using a null object pointer to
    call the method or is using a object ref to call the method that
    was generated by dereferencing a null pointer, neither of which is
    valid.  Resolve this by moving the checks out of the method and
    into the caller.
    
    Make this easier by changing the getImpl() method to return the 
    private *Impl pointer directly instead of deferencing the pointer
    and returning a ref.  The latter is invalid if the pointer is null.
    This allows GetImpl() to be called in a boolean contect to peform
    the check.  It also allows a number of instances of "&getImpl()"
    calls in a boolean context to be fixed by changing them to "getImpl()".
    The address of a ref will never be zero in a valid C++ program, so 
    the compiler could potentially optimize out those checks.
    
    There does not appear to be any need for Control and ComboBox to 
    use customized versions of GetImpl() since these appear to behave
    identically to the versions generated by the canned macro, so switch
    them back to the macro version.
    
    This commit should result in no functional changes.
    
    It seems like all of these checks for a null implementation should
    not be necessary, but that requires further investigation.
    837bd0e4
Adı
Son kayıt (commit)
Son güncelleme
..
doc/layout Loading commit data...
inc Loading commit data...
prj Loading commit data...
qa Loading commit data...
source Loading commit data...
src2xml Loading commit data...
test/accessibility Loading commit data...
uiconfig/layout Loading commit data...
util Loading commit data...
workben Loading commit data...
JunitTest_toolkit_complex.mk Loading commit data...
JunitTest_toolkit_unoapi.mk Loading commit data...
Library_tk.mk Loading commit data...
Makefile Loading commit data...
Module_toolkit.mk Loading commit data...
Package_inc.mk Loading commit data...
Package_source.mk Loading commit data...
Package_util.mk Loading commit data...