[Libreoffice-commits] core.git: Branch 'libreoffice-5-1' - sc/source

Stephan Bergmann sbergman at redhat.com
Tue Apr 26 19:34:07 UTC 2016


 sc/source/ui/app/scmod.cxx |    5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

New commits:
commit 52bfe2cffb71ee83bab4b56d3f950721f7104ca6
Author: Stephan Bergmann <sbergman at redhat.com>
Date:   Tue Jan 19 10:53:27 2016 +0100

    -Werror=address (GCC 6)
    
    "the compiler can assume that the address of ‘rItem’ will never be NULL"
    
    Change-Id: I90a8a3074c2dab427b4bc6345ec4a824eb2ac249
    (cherry picked from commit 8404dc3c76babbc9d0a165f4046a6e5e1be35fe5)
    Signed-off-by: David Tardon <dtardon at redhat.com>
    Reviewed-on: https://gerrit.libreoffice.org/24411
    Tested-by: Jenkins <ci at libreoffice.org>

diff --git a/sc/source/ui/app/scmod.cxx b/sc/source/ui/app/scmod.cxx
index 8a376e7..9bdaacb 100644
--- a/sc/source/ui/app/scmod.cxx
+++ b/sc/source/ui/app/scmod.cxx
@@ -471,8 +471,9 @@ void ScModule::Execute( SfxRequest& rReq )
         case SID_PSZ_FUNCTION:
             if (pReqArgs)
             {
-                const SfxUInt16Item& rItem = static_cast<const SfxUInt16Item&>(pReqArgs->Get(SID_PSZ_FUNCTION));
-                OSL_ENSURE(dynamic_cast<const SfxUInt16Item*>( &rItem) !=  nullptr,"wrong Parameter");
+                auto const & p = pReqArgs->Get(SID_PSZ_FUNCTION);
+                OSL_ENSURE(dynamic_cast<const SfxUInt16Item*>(&p) !=  nullptr,"wrong Parameter");
+                const SfxUInt16Item& rItem = static_cast<const SfxUInt16Item&>(p);
 
                 ScAppOptions aNewOpts( GetAppOptions() );
                 aNewOpts.SetStatusFunc( rItem.GetValue() );


More information about the Libreoffice-commits mailing list