summaryrefslogtreecommitdiff
path: root/connectivity/source/drivers/evoab2
diff options
context:
space:
mode:
authorNoel Grandin <noel.grandin@collabora.co.uk>2020-04-18 10:51:27 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2020-04-18 20:35:49 +0200
commit2d0bdcc586af71dae665646b37177fa104c50906 (patch)
treea4c0fafefd366b2840365a3e0ee83ed0ad314bbd /connectivity/source/drivers/evoab2
parent02f7d20f14dffcb3832264eeab5bb97acc4977f3 (diff)
loplugin:flatten connectivity
Change-Id: Ic1d9eb84b64ebde99e15704a10b27f21447df4d5 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/92469 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'connectivity/source/drivers/evoab2')
-rw-r--r--connectivity/source/drivers/evoab2/NDatabaseMetaData.cxx72
1 files changed, 36 insertions, 36 deletions
diff --git a/connectivity/source/drivers/evoab2/NDatabaseMetaData.cxx b/connectivity/source/drivers/evoab2/NDatabaseMetaData.cxx
index a5efdd2a0e6a..9eb6f1d34862 100644
--- a/connectivity/source/drivers/evoab2/NDatabaseMetaData.cxx
+++ b/connectivity/source/drivers/evoab2/NDatabaseMetaData.cxx
@@ -90,53 +90,53 @@ namespace connectivity::evoab
static void
initFields()
{
- if( !pFields )
+ if( pFields )
+ return;
+
+ ::osl::MutexGuard aGuard( ::osl::Mutex::getGlobalMutex() );
+ if( pFields )
+ return;
+
+ guint nProps;
+ ColumnProperty **pToBeFields;
+ GParamSpec **pProps;
+ nFields = 0;
+ pProps = g_object_class_list_properties
+ ( static_cast<GObjectClass *>(g_type_class_ref( E_TYPE_CONTACT )),
+ &nProps );
+ pToBeFields = g_new0(ColumnProperty *, (nProps + OTHER_ZIP)/* new column(s)*/ );
+ for ( guint i = 0; i < nProps; i++ )
{
- ::osl::MutexGuard aGuard( ::osl::Mutex::getGlobalMutex() );
- if( !pFields )
+ switch (pProps[i]->value_type)
{
- guint nProps;
- ColumnProperty **pToBeFields;
- GParamSpec **pProps;
- nFields = 0;
- pProps = g_object_class_list_properties
- ( static_cast<GObjectClass *>(g_type_class_ref( E_TYPE_CONTACT )),
- &nProps );
- pToBeFields = g_new0(ColumnProperty *, (nProps + OTHER_ZIP)/* new column(s)*/ );
- for ( guint i = 0; i < nProps; i++ )
+ case G_TYPE_STRING:
+ case G_TYPE_BOOLEAN:
{
- switch (pProps[i]->value_type)
+ bool bAdd = true;
+ const char *pName = g_param_spec_get_name( pProps[i] );
+ for (unsigned int j = 0; j < G_N_ELEMENTS( pBlackList ); j++ )
{
- case G_TYPE_STRING:
- case G_TYPE_BOOLEAN:
+ if( !strcmp( pBlackList[j], pName ) )
{
- bool bAdd = true;
- const char *pName = g_param_spec_get_name( pProps[i] );
- for (unsigned int j = 0; j < G_N_ELEMENTS( pBlackList ); j++ )
- {
- if( !strcmp( pBlackList[j], pName ) )
- {
- bAdd = false;
- break;
- }
- }
- if( bAdd )
- {
- pToBeFields[nFields]= g_new0(ColumnProperty,1);
- pToBeFields[nFields]->bIsSplittedValue=false;
- pToBeFields[ nFields++ ]->pField = g_param_spec_ref( pProps[i] );
- }
+ bAdd = false;
break;
}
- default:
- break;
}
+ if( bAdd )
+ {
+ pToBeFields[nFields]= g_new0(ColumnProperty,1);
+ pToBeFields[nFields]->bIsSplittedValue=false;
+ pToBeFields[ nFields++ ]->pField = g_param_spec_ref( pProps[i] );
+ }
+ break;
}
-
- splitColumn(pToBeFields);
- pFields = pToBeFields;
+ default:
+ break;
}
}
+
+ splitColumn(pToBeFields);
+ pFields = pToBeFields;
}