[Libreoffice-commits] core.git: 3 commits - cui/source sd/source sfx2/source

Julien Nabet serval2412 at yahoo.fr
Sun Nov 3 22:47:07 CET 2013


 cui/source/tabpages/backgrnd.cxx                   |    2 +-
 sd/source/ui/remotecontrol/AvahiNetworkService.cxx |   11 +++++++----
 sfx2/source/toolbox/tbxitem.cxx                    |    4 ++--
 3 files changed, 10 insertions(+), 7 deletions(-)

New commits:
commit c7349a21fff996ddee5977941a5e73669dc77bb2
Author: Julien Nabet <serval2412 at yahoo.fr>
Date:   Sun Nov 3 22:41:44 2013 +0100

    cppcheck: Clarify expression with parenthesis
    
    boolean result used in bitwise operation
    
    Change-Id: I581b681a6f3ba682c7b743928d1b6f397ecf960c

diff --git a/cui/source/tabpages/backgrnd.cxx b/cui/source/tabpages/backgrnd.cxx
index cd82984..e1e598d 100644
--- a/cui/source/tabpages/backgrnd.cxx
+++ b/cui/source/tabpages/backgrnd.cxx
@@ -1243,7 +1243,7 @@ void SvxBackgroundTabPage::ShowBitmapUI_Impl()
         m_pBitmapContainer->Show();
 
         m_pFileFrame->Show();
-        m_pBtnLink->Show(!bLinkOnly && ! nHtmlMode & HTMLMODE_ON);
+        m_pBtnLink->Show(!bLinkOnly && !(nHtmlMode & HTMLMODE_ON));
 
         m_pTypeFrame->Show();
 
commit 465f876f35fcdbf773523a216c0025a29b784c0c
Author: Julien Nabet <serval2412 at yahoo.fr>
Date:   Sun Nov 3 22:28:17 2013 +0100

    cppcheck: reduce scope in AvahiNetworkService
    
    Change-Id: Ida14cc278187fdc7519137829a920273ed4910b3

diff --git a/sd/source/ui/remotecontrol/AvahiNetworkService.cxx b/sd/source/ui/remotecontrol/AvahiNetworkService.cxx
index 34b94a3..04d8e57 100644
--- a/sd/source/ui/remotecontrol/AvahiNetworkService.cxx
+++ b/sd/source/ui/remotecontrol/AvahiNetworkService.cxx
@@ -79,8 +79,6 @@ static void entry_group_callback(AvahiEntryGroup *g, AvahiEntryGroupState state,
 }
 
 static void create_services(AvahiClient *c) {
-    char *n, r[128];
-    int ret;
     assert(c);
 
     /* If this is the first time we're called, let's create a new
@@ -97,13 +95,18 @@ static void create_services(AvahiClient *c) {
 
     if (avahi_entry_group_is_empty(group)) {
         fprintf(stderr, "Adding service '%s'\n", avahiService->getName().c_str());
+        char r[128];
         snprintf(r, sizeof(r), "random=%i", rand());
-        if ((ret = avahi_entry_group_add_service(group, AVAHI_IF_UNSPEC, AVAHI_PROTO_UNSPEC, static_cast<AvahiPublishFlags>(0), avahiService->getName().c_str(), kREG_TYPE, NULL, NULL, 1599, "local", r, NULL)) < 0) {
+        int ret = avahi_entry_group_add_service(
+            group, AVAHI_IF_UNSPEC, AVAHI_PROTO_UNSPEC, static_cast<AvahiPublishFlags>(0),
+            avahiService->getName().c_str(), kREG_TYPE, NULL, NULL, 1599, "local", r, NULL
+        );
+        if (ret < 0) {
 
             if (ret == AVAHI_ERR_COLLISION){
                 /* A service name collision with a local service happened. Let's
                  * pick a new name */
-                n = avahi_alternative_service_name(avahiService->getName().c_str());
+                char *n = avahi_alternative_service_name(avahiService->getName().c_str());
                 avahiService->setName(n);
 
                 fprintf(stderr, "Service name collision, renaming service to '%s'\n", avahiService->getName().c_str());
commit 8378d3a7da3de3459870f10612e75f11915aa023
Author: Julien Nabet <serval2412 at yahoo.fr>
Date:   Sun Nov 3 22:03:47 2013 +0100

    cppcheck: Reduce scope
    
    Change-Id: I341c2b7112f32a0ab0e1a6dfac0ab4679310202c

diff --git a/sfx2/source/toolbox/tbxitem.cxx b/sfx2/source/toolbox/tbxitem.cxx
index 1ac1784..f712e14 100644
--- a/sfx2/source/toolbox/tbxitem.cxx
+++ b/sfx2/source/toolbox/tbxitem.cxx
@@ -313,7 +313,6 @@ SfxToolBoxControl* SfxToolBoxControl::CreateControl( sal_uInt16 nSlotId, sal_uIn
 {
     SolarMutexGuard aGuard;
 
-    SfxToolBoxControl *pCtrl;
     SfxApplication *pApp = SFX_APP();
 
     SfxSlotPool *pSlotPool;
@@ -324,6 +323,7 @@ SfxToolBoxControl* SfxToolBoxControl::CreateControl( sal_uInt16 nSlotId, sal_uIn
     TypeId aSlotType = pSlotPool->GetSlotType( nSlotId );
     if ( aSlotType )
     {
+        SfxToolBoxControl *pCtrl;
         if ( pMod )
         {
             SfxTbxCtrlFactArr_Impl *pFactories = pMod->GetTbxCtrlFactories_Impl();
@@ -841,7 +841,6 @@ void SfxToolBoxControl::createAndPositionSubToolBar( const OUString& rSubToolBar
                 }
                 pImpl->mxUIElement = xUIElement;
 
-                Window*  pParentTbxWindow( pImpl->pBox );
                 Window*  pTbxWindow = VCLUnoHelper::GetWindow( xSubToolBar );
                 ToolBox* pToolBar( 0 );
                 if ( pTbxWindow && pTbxWindow->GetType() == WINDOW_TOOLBOX )
@@ -849,6 +848,7 @@ void SfxToolBoxControl::createAndPositionSubToolBar( const OUString& rSubToolBar
 
                 if ( pToolBar )
                 {
+                    Window*  pParentTbxWindow( pImpl->pBox );
                     pToolBar->SetParent( pParentTbxWindow );
                     ::Size aSize = getPersistentFloatingSize( xFrame, rSubToolBarResName );
                     if ( aSize.Width() == 0 || aSize.Height() == 0 )


More information about the Libreoffice-commits mailing list