[Libreoffice-commits] core.git: sc/source

Stephan Bergmann sbergman at redhat.com
Tue Jan 19 01:54:15 PST 2016


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

New commits:
commit 8404dc3c76babbc9d0a165f4046a6e5e1be35fe5
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

diff --git a/sc/source/ui/app/scmod.cxx b/sc/source/ui/app/scmod.cxx
index 6fbbf92..162e355 100644
--- a/sc/source/ui/app/scmod.cxx
+++ b/sc/source/ui/app/scmod.cxx
@@ -467,8 +467,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