[Libreoffice-commits] core.git: 4 commits - apple_remote/source editeng/source framework/source include/apple_remote svx/source vcl/inc vcl/osx

Caolán McNamara caolanm at redhat.com
Mon Feb 10 04:16:02 PST 2014


 apple_remote/source/RemoteMainController.m  |    6 +++---
 editeng/source/editeng/impedit2.cxx         |    2 +-
 framework/source/services/pathsettings.cxx  |    2 +-
 include/apple_remote/RemoteMainController.h |    2 +-
 svx/source/svdraw/svdibrow.cxx              |    1 -
 vcl/inc/osx/saldata.hxx                     |    2 +-
 vcl/osx/saldata.cxx                         |    6 +++---
 vcl/osx/salinst.cxx                         |    2 +-
 vcl/osx/vclnsapp.mm                         |   14 ++++++++------
 9 files changed, 19 insertions(+), 18 deletions(-)

New commits:
commit d46d063f7ecf87af2c3bb7885e3cacf322e004c6
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Mon Feb 10 12:02:38 2014 +0000

    coverity#705995 Unintended sign extension
    
    Change-Id: I7f14257317c0c09737ad9aed78b39efff1062265

diff --git a/editeng/source/editeng/impedit2.cxx b/editeng/source/editeng/impedit2.cxx
index 514668c..eab034b 100644
--- a/editeng/source/editeng/impedit2.cxx
+++ b/editeng/source/editeng/impedit2.cxx
@@ -4039,7 +4039,7 @@ void ImpEditEngine::CalcHeight( ParaPortion* pPortion )
         {
             const SvxULSpaceItem& rULItem = (const SvxULSpaceItem&)pPortion->GetNode()->GetContentAttribs().GetItem( EE_PARA_ULSPACE );
             const SvxLineSpacingItem& rLSItem = (const SvxLineSpacingItem&)pPortion->GetNode()->GetContentAttribs().GetItem( EE_PARA_SBL );
-            sal_uInt16 nSBL = ( rLSItem.GetInterLineSpaceRule() == SVX_INTER_LINE_SPACE_FIX ) ? GetYValue( rLSItem.GetInterLineSpace() ) : 0;
+            sal_Int32 nSBL = ( rLSItem.GetInterLineSpaceRule() == SVX_INTER_LINE_SPACE_FIX ) ? GetYValue( rLSItem.GetInterLineSpace() ) : 0;
 
             if ( nSBL )
             {
commit 5e40fcc0cf2147c31028a411e1977394d09c6e7b
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Mon Feb 10 12:00:17 2014 +0000

    coverity#1169847 Uncaught exception
    
    Change-Id: I8adf5d175798c4b820cd7cac2a927aa0f7de718d

diff --git a/framework/source/services/pathsettings.cxx b/framework/source/services/pathsettings.cxx
index c4665fb..d7e1f6f 100644
--- a/framework/source/services/pathsettings.cxx
+++ b/framework/source/services/pathsettings.cxx
@@ -1151,7 +1151,7 @@ css::uno::Any PathSettings::impl_getPathValue(sal_Int32 nID) const
 {
     const PathSettings::PathInfo* pPath = impl_getPathAccessConst(nID);
     if (! pPath)
-        throw css::container::NoSuchElementException();
+        throw css::lang::IllegalArgumentException();
 
     css::uno::Any aVal;
     switch(impl_getPropGroup(nID))
commit 87f52352614aed918501e8a7df8e8a61499efc5b
Author: Herbert Dürr <hdu at apache.org>
Date:   Mon Feb 10 09:36:08 2014 +0000

    Resolves: #i124201# rename apple_remote's MainController...
    
    to AppleRemoteController
    
    having a MainController class in the global namespace of an application with
    gazillions of MVC patterns is not a good idea. Renaming it to better match
    its scope (i.e. the Apple Remote) cleans this up.
    
    (cherry picked from commit 8ef3836059ca613d125f66e6bad21c83200dadad)
    
    Conflicts:
    	apple_remote/source/RemoteMainController.m
    	include/apple_remote/RemoteMainController.h
    	vcl/inc/osx/saldata.hxx
    	vcl/osx/saldata.cxx
    	vcl/osx/salinst.cxx
    	vcl/osx/vclnsapp.mm
    
    Change-Id: I1f252ac51ef65966a48ee03b2cd3519f98d57383

diff --git a/apple_remote/source/RemoteMainController.m b/apple_remote/source/RemoteMainController.m
index 790c520..caf145e 100644
--- a/apple_remote/source/RemoteMainController.m
+++ b/apple_remote/source/RemoteMainController.m
@@ -39,7 +39,7 @@
 // Sample Code 3: Multi Click Behavior and Hold Event Simulation
 // -------------------------------------------------------------------------------------------
 
- at implementation MainController
+ at implementation AppleRemoteMainController
 
 - (id) init {
     self = [super init];  // because we redefined our own init instead of use the fu..nny awakeFromNib
@@ -75,11 +75,11 @@
         // to give the binding mechanism a chance to see the change of the attribute
         [self setValue: container forKey: @"remoteControl"];
 #ifdef DEBUG
-            NSLog(@"MainController init done");
+            NSLog(@"AppleRemoteMainController init done");
 #endif
     }
     else
-        NSLog(@"MainController init failed");
+        NSLog(@"AppleRemoteMainController init failed");
     return self;
 }
 
diff --git a/include/apple_remote/RemoteMainController.h b/include/apple_remote/RemoteMainController.h
index 60cd4fb..c4ee0ac 100644
--- a/include/apple_remote/RemoteMainController.h
+++ b/include/apple_remote/RemoteMainController.h
@@ -42,7 +42,7 @@
 
 //static void sendTheEvent( unichar, int );
 
-SAL_DLLPUBLIC_EXPORT @interface MainController : NSObject {
+SAL_DLLPUBLIC_EXPORT @interface AppleRemoteMainController : NSObject {
 @public // else remoteControl is not reachable from GetSalData()->mpMainController
     RemoteControl* remoteControl;
 @private
diff --git a/vcl/inc/osx/saldata.hxx b/vcl/inc/osx/saldata.hxx
index b125caa..8ee0b41 100644
--- a/vcl/inc/osx/saldata.hxx
+++ b/vcl/inc/osx/saldata.hxx
@@ -89,7 +89,7 @@ public:
 
     bool                                          mbIsScrollbarDoubleMax;   // TODO: support DoubleMin and DoubleBoth too
 #if !HAVE_FEATURE_MACOSX_SANDBOX
-    MainController*                               mpMainController;         // Apple Remote
+    AppleRemoteMainController*                    mpAppleRemoteMainController;
 #endif
     NSObject*                                     mpDockIconClickHandler;
     long                                          mnDPIX;           // #i100617# read DPI only once per office life
diff --git a/vcl/osx/saldata.cxx b/vcl/osx/saldata.cxx
index 2bf2d8c..f4dc179 100644
--- a/vcl/osx/saldata.cxx
+++ b/vcl/osx/saldata.cxx
@@ -47,7 +47,7 @@ SalData::SalData()
     maCursors( POINTER_COUNT, INVALID_CURSOR_PTR ),
     mbIsScrollbarDoubleMax( false ),
 #if !HAVE_FEATURE_MACOSX_SANDBOX
-    mpMainController( NULL ),
+    mpAppleRemoteMainController( NULL ),
 #endif
     mpDockIconClickHandler( nil ),
     mnDPIX( 0 ),
@@ -82,8 +82,8 @@ SalData::~SalData()
         s_aAutoReleaseKey = 0;
     }
 #if !HAVE_FEATURE_MACOSX_SANDBOX
-    if ( mpMainController )
-        [mpMainController release];
+    if ( mpAppleRemoteMainController )
+        [mpAppleRemoteMainController release];
 #endif
 }
 
diff --git a/vcl/osx/salinst.cxx b/vcl/osx/salinst.cxx
index 723ad00..3d16998 100644
--- a/vcl/osx/salinst.cxx
+++ b/vcl/osx/salinst.cxx
@@ -170,7 +170,7 @@ static void initNSApp()
                                           object: nil ];
 #if !HAVE_FEATURE_MACOSX_SANDBOX
     // Initialize Apple Remote
-    GetSalData()->mpMainController = [[MainController alloc] init];
+    GetSalData()->mpAppleRemoteMainController = [[AppleRemoteMainController alloc] init];
 
     [[NSDistributedNotificationCenter defaultCenter] addObserver: NSApp
                                            selector: @selector(applicationWillBecomeActive:)
diff --git a/vcl/osx/vclnsapp.mm b/vcl/osx/vclnsapp.mm
index 0c0fe69..bd85aa7 100644
--- a/vcl/osx/vclnsapp.mm
+++ b/vcl/osx/vclnsapp.mm
@@ -434,15 +434,16 @@
 {
     (void)pNotification;
     SalData* pSalData = GetSalData();
-    if( pSalData->mpMainController && pSalData->mpMainController->remoteControl)
+    AppleRemoteMainController* pAppleRemoteCtrl = pSalData->mpAppleRemoteMainController;
+    if( pAppleRemoteCtrl && pAppleRemoteCtrl->remoteControl)
     {
         // [remoteControl startListening: self];
         // does crash because the right thing to do is
-        // [GetSalData()->mpMainController->remoteControl startListening: self];
+        // [pAppleRemoteCtrl->remoteControl startListening: self];
         // but the instance variable 'remoteControl' is declared protected
         // workaround : declare remoteControl instance variable as public in RemoteMainController.m
 
-        [pSalData->mpMainController->remoteControl startListening: self];
+        [pAppleRemoteCtrl->remoteControl startListening: self];
 #ifdef DEBUG
         NSLog(@"Apple Remote will become active - Using remote controls");
 #endif
@@ -461,15 +462,16 @@
 {
     (void)pNotification;
     SalData* pSalData = GetSalData();
-    if( pSalData->mpMainController && pSalData->mpMainController->remoteControl)
+    AppleRemoteMainController* pAppleRemoteCtrl = pSalData->mpAppleRemoteMainController;
+    if( pAppleRemoteCtrl && pAppleRemoteCtrl->remoteControl)
     {
         // [remoteControl stopListening: self];
         // does crash because the right thing to do is
-        // [GetSalData()->mpMainController->remoteControl stopListening: self];
+        // [pAppleRemoteCtrl->remoteControl stopListening: self];
         // but the instance variable 'remoteControl' is declared protected
         // workaround : declare remoteControl instance variable as public in RemoteMainController.m
 
-        [pSalData->mpMainController->remoteControl stopListening: self];
+        [pAppleRemoteCtrl->remoteControl stopListening: self];
 #ifdef DEBUG
         NSLog(@"Apple Remote will resign active - Releasing remote controls");
 #endif
commit c7e0bfd18eaba685d9f8ef8fdeb9fa45ae2e132d
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Mon Feb 10 11:57:46 2014 +0000

    coverity#735512 Logically dead code
    
    Change-Id: I026bb291d8d0c87ef8166331a7e084fa339052f6

diff --git a/svx/source/svdraw/svdibrow.cxx b/svx/source/svdraw/svdibrow.cxx
index 8b3364a..149d017 100644
--- a/svx/source/svdraw/svdibrow.cxx
+++ b/svx/source/svdraw/svdibrow.cxx
@@ -838,7 +838,6 @@ bool IsItemIneffective(sal_uInt16 nWhich, const SfxItemSet* pSet, sal_uInt16& rI
                 if (nAnz==0) return true;
                 if (nAnz==1 && nWhich>SDRATTR_EDGELINE1DELTA) return true;
                 if (nAnz==2 && nWhich>SDRATTR_EDGELINE2DELTA) return true;
-                if (nAnz==3 && nWhich>SDRATTR_EDGELINE3DELTA) return true;
             }
         } break;
 


More information about the Libreoffice-commits mailing list