Extend loplugin:salbool to loplugin:fakebool

...checking for unnecessary uses of more "fake bool" types.

In the past, some of the checks involving the types of variables or data
members, or the return types of functions, issued warnings that required
surrounding code to be changed too (e.g., when changing the signature of a
function whose address was taken).  These checks have been tightened now to not
warn in such cases (which avoids warnings that require changes to additional
code, or changes that might even be impossible to make, at the cost of being
less aggressive about removing all unnecessary uses of those "fake bool" types).

Change-Id: I70eb75039817cda34ed611387ee27dc5f36a3e2e
Reviewed-on: https://gerrit.libreoffice.org/82554
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
This commit is contained in:
Stephan Bergmann
2019-11-13 15:06:42 +01:00
parent eea0879cdf
commit 913d34ec6b
26 changed files with 555 additions and 327 deletions
+1 -1
View File
@@ -414,7 +414,7 @@ void Player::processMessage( GstMessage *message )
#define LCL_WAYLAND_DISPLAY_HANDLE_CONTEXT_TYPE "GstWaylandDisplayHandleContextType"
static gboolean lcl_is_wayland_display_handle_need_context_message(GstMessage* msg)
static bool lcl_is_wayland_display_handle_need_context_message(GstMessage* msg)
{
g_return_val_if_fail(GST_IS_MESSAGE(msg), false);
File diff suppressed because it is too large Load Diff
@@ -11,8 +11,12 @@
#include <sal/types.h>
namespace {
struct S {
sal_Bool b; // expected-error {{FieldDecl, use "bool" instead of "sal_Bool" [loplugin:salbool]}}
sal_Bool b; // expected-error {{FieldDecl, use "bool" instead of 'sal_Bool' (aka 'unsigned char') [loplugin:fakebool]}}
};
}
/* vim:set shiftwidth=4 softtabstop=4 expandtab cinoptions=b1,g0,N-s cinkeys+=0=break: */
@@ -255,7 +255,7 @@ getValue( EContact* pContact, sal_Int32 nColumnNum, GType nType, GValue* pStackV
return false;
GParamSpec* pSpec = pSpecs->pField;
gboolean bIsSplittedColumn = pSpecs->bIsSplittedValue;
bool bIsSplittedColumn = pSpecs->bIsSplittedValue;
_out_rWasNull = true;
if ( !pSpec || !pContact)
@@ -536,7 +536,7 @@ Reference< XResultSet > SAL_CALL java_sql_DatabaseMetaData::getCrossReference(
bool java_sql_DatabaseMetaData::impl_callBooleanMethod( const char* _pMethodName, jmethodID& _inout_MethodID )
{
m_aLogger.log( LogLevel::FINEST, STR_LOG_META_DATA_METHOD, _pMethodName );
jboolean out( java_lang_Object::callBooleanMethod(_pMethodName,_inout_MethodID) );
bool out( java_lang_Object::callBooleanMethod(_pMethodName,_inout_MethodID) );
m_aLogger.log< const sal_Char*, bool>( LogLevel::FINEST, STR_LOG_META_DATA_RESULT, _pMethodName, out );
return out;
}
@@ -578,7 +578,7 @@ bool java_sql_DatabaseMetaData::impl_callBooleanMethodWithIntArg( const char* _p
{
m_aLogger.log( LogLevel::FINEST, STR_LOG_META_DATA_METHOD_ARG1, _pMethodName, _nArgument );
jboolean out( callBooleanMethodWithIntArg(_pMethodName,_inout_MethodID,_nArgument) );
bool out( callBooleanMethodWithIntArg(_pMethodName,_inout_MethodID,_nArgument) );
m_aLogger.log< const sal_Char*, bool >( LogLevel::FINEST, STR_LOG_META_DATA_RESULT, _pMethodName, out );
return out;
@@ -990,7 +990,7 @@ sal_Bool SAL_CALL java_sql_DatabaseMetaData::supportsConvert( sal_Int32 fromType
static const char* const pMethodName = "supportsConvert";
m_aLogger.log( LogLevel::FINEST, STR_LOG_META_DATA_METHOD_ARG2, pMethodName, fromType, toType );
jboolean out( false );
bool out( false );
SDBThreadAttach t;
{
@@ -1332,7 +1332,7 @@ sal_Bool SAL_CALL java_sql_DatabaseMetaData::supportsResultSetConcurrency( sal_I
static const char* const pMethodName = "supportsResultSetConcurrency";
m_aLogger.log( LogLevel::FINEST, STR_LOG_META_DATA_METHOD_ARG2, pMethodName, setType, concurrency );
jboolean out( false );
bool out( false );
SDBThreadAttach t;
{
@@ -213,7 +213,7 @@ sal_Bool SAL_CALL java_sql_Statement_Base::execute( const OUString& sql )
::osl::MutexGuard aGuard( m_aMutex );
checkDisposed(java_sql_Statement_BASE::rBHelper.bDisposed);
jboolean out(false);
bool out(false);
SDBThreadAttach t; OSL_ENSURE(t.pEnv,"Java environment has been deleted!");
{
createStatement(t.pEnv);
+2 -2
View File
@@ -255,7 +255,7 @@ void java_lang_Object::obtainMethodId_throwRuntime(JNIEnv* _pEnv,const char* _pM
bool java_lang_Object::callBooleanMethod( const char* _pMethodName, jmethodID& _inout_MethodID ) const
{
jboolean out( false );
bool out( false );
SDBThreadAttach t;
OSL_ENSURE( t.pEnv, "java_lang_Object::callBooleanMethod: no Java environment anymore!" );
@@ -269,7 +269,7 @@ bool java_lang_Object::callBooleanMethod( const char* _pMethodName, jmethodID& _
bool java_lang_Object::callBooleanMethodWithIntArg( const char* _pMethodName, jmethodID& _inout_MethodID, sal_Int32 _nArgument ) const
{
jboolean out( false );
bool out( false );
SDBThreadAttach t;
OSL_ENSURE( t.pEnv, "java_lang_Object::callBooleanMethodWithIntArg: no Java environment anymore!" );
obtainMethodId_throwSQL(t.pEnv, _pMethodName,"(I)Z", _inout_MethodID);
+1 -1
View File
@@ -78,7 +78,7 @@ sal_Int32 SAL_CALL java_io_Reader::available( )
{
if(m_buf)
return 1;
jboolean out;
bool out;
SDBThreadAttach t; OSL_ENSURE(t.pEnv,"Java environment has been deleted!");
{
@@ -111,9 +111,9 @@ bool OPreparedResultSet::fetchResult()
}
for (sal_Int32 i = 0; i < m_nColumnCount; ++i)
{
m_aMetaData[i].is_null = 0;
m_aMetaData[i].is_null = false;
m_aMetaData[i].length = 0l;
m_aMetaData[i].error = 0;
m_aMetaData[i].error = false;
m_aData[i].is_null = &m_aMetaData[i].is_null;
m_aData[i].buffer_length = m_aFields[i].type == MYSQL_TYPE_BLOB ? 0 : m_aFields[i].length;
@@ -182,7 +182,7 @@ void SAL_CALL OPreparedStatement::setString(sal_Int32 parameter, const OUString&
m_binds[nIndex].buffer_type = MYSQL_TYPE_STRING;
mysqlc_sdbc_driver::resetSqlVar(&m_binds[nIndex].buffer, stringie.getStr(), MYSQL_TYPE_STRING,
stringie.getLength());
m_bindMetas[nIndex].is_null = 0;
m_bindMetas[nIndex].is_null = false;
m_bindMetas[nIndex].length = stringie.getLength();
}
@@ -228,7 +228,7 @@ void SAL_CALL OPreparedStatement::setBoolean(sal_Int32 parameter, sal_Bool x)
const sal_Int32 nIndex = parameter - 1;
m_binds[nIndex].buffer_type = MYSQL_TYPE_TINY;
mysqlc_sdbc_driver::resetSqlVar(&m_binds[nIndex].buffer, &x, MYSQL_TYPE_TINY);
m_bindMetas[nIndex].is_null = 0;
m_bindMetas[nIndex].is_null = false;
}
void SAL_CALL OPreparedStatement::setByte(sal_Int32 parameter, sal_Int8 x)
@@ -240,7 +240,7 @@ void SAL_CALL OPreparedStatement::setByte(sal_Int32 parameter, sal_Int8 x)
const sal_Int32 nIndex = parameter - 1;
m_binds[nIndex].buffer_type = MYSQL_TYPE_TINY;
mysqlc_sdbc_driver::resetSqlVar(&m_binds[nIndex].buffer, &x, MYSQL_TYPE_TINY);
m_bindMetas[nIndex].is_null = 0;
m_bindMetas[nIndex].is_null = false;
}
void SAL_CALL OPreparedStatement::setDate(sal_Int32 parameter, const Date& aData)
@@ -258,7 +258,7 @@ void SAL_CALL OPreparedStatement::setDate(sal_Int32 parameter, const Date& aData
const sal_Int32 nIndex = parameter - 1;
m_binds[nIndex].buffer_type = MYSQL_TYPE_DATE;
mysqlc_sdbc_driver::resetSqlVar(&m_binds[nIndex].buffer, &my_time, MYSQL_TYPE_DATE);
m_bindMetas[nIndex].is_null = 0;
m_bindMetas[nIndex].is_null = false;
}
void SAL_CALL OPreparedStatement::setTime(sal_Int32 parameter, const Time& aVal)
@@ -276,7 +276,7 @@ void SAL_CALL OPreparedStatement::setTime(sal_Int32 parameter, const Time& aVal)
const sal_Int32 nIndex = parameter - 1;
m_binds[nIndex].buffer_type = MYSQL_TYPE_TIME;
mysqlc_sdbc_driver::resetSqlVar(&m_binds[nIndex].buffer, &my_time, MYSQL_TYPE_TIME);
m_bindMetas[nIndex].is_null = 0;
m_bindMetas[nIndex].is_null = false;
}
void SAL_CALL OPreparedStatement::setTimestamp(sal_Int32 parameter, const DateTime& aVal)
@@ -297,7 +297,7 @@ void SAL_CALL OPreparedStatement::setTimestamp(sal_Int32 parameter, const DateTi
const sal_Int32 nIndex = parameter - 1;
m_binds[nIndex].buffer_type = MYSQL_TYPE_DATETIME;
mysqlc_sdbc_driver::resetSqlVar(&m_binds[nIndex].buffer, &my_time, MYSQL_TYPE_DATETIME);
m_bindMetas[nIndex].is_null = 0;
m_bindMetas[nIndex].is_null = false;
}
void SAL_CALL OPreparedStatement::setDouble(sal_Int32 parameter, double x)
@@ -309,7 +309,7 @@ void SAL_CALL OPreparedStatement::setDouble(sal_Int32 parameter, double x)
const sal_Int32 nIndex = parameter - 1;
m_binds[nIndex].buffer_type = MYSQL_TYPE_DOUBLE;
mysqlc_sdbc_driver::resetSqlVar(&m_binds[nIndex].buffer, &x, MYSQL_TYPE_DOUBLE);
m_bindMetas[nIndex].is_null = 0;
m_bindMetas[nIndex].is_null = false;
}
void SAL_CALL OPreparedStatement::setFloat(sal_Int32 parameter, float x)
@@ -321,7 +321,7 @@ void SAL_CALL OPreparedStatement::setFloat(sal_Int32 parameter, float x)
const sal_Int32 nIndex = parameter - 1;
m_binds[nIndex].buffer_type = MYSQL_TYPE_FLOAT;
mysqlc_sdbc_driver::resetSqlVar(&m_binds[nIndex].buffer, &x, MYSQL_TYPE_FLOAT);
m_bindMetas[nIndex].is_null = 0;
m_bindMetas[nIndex].is_null = false;
}
void SAL_CALL OPreparedStatement::setInt(sal_Int32 parameter, sal_Int32 x)
@@ -333,7 +333,7 @@ void SAL_CALL OPreparedStatement::setInt(sal_Int32 parameter, sal_Int32 x)
const sal_Int32 nIndex = parameter - 1;
m_binds[nIndex].buffer_type = MYSQL_TYPE_LONG;
mysqlc_sdbc_driver::resetSqlVar(&m_binds[nIndex].buffer, &x, MYSQL_TYPE_LONG);
m_bindMetas[nIndex].is_null = 0;
m_bindMetas[nIndex].is_null = false;
}
void SAL_CALL OPreparedStatement::setLong(sal_Int32 parameter, sal_Int64 aVal)
@@ -345,7 +345,7 @@ void SAL_CALL OPreparedStatement::setLong(sal_Int32 parameter, sal_Int64 aVal)
const sal_Int32 nIndex = parameter - 1;
m_binds[nIndex].buffer_type = MYSQL_TYPE_LONGLONG;
mysqlc_sdbc_driver::resetSqlVar(&m_binds[nIndex].buffer, &aVal, MYSQL_TYPE_LONGLONG);
m_bindMetas[nIndex].is_null = 0;
m_bindMetas[nIndex].is_null = false;
}
void SAL_CALL OPreparedStatement::setNull(sal_Int32 parameter, sal_Int32 /*sqlType*/)
@@ -355,7 +355,7 @@ void SAL_CALL OPreparedStatement::setNull(sal_Int32 parameter, sal_Int32 /*sqlTy
checkParameterIndex(parameter);
const sal_Int32 nIndex = parameter - 1;
m_bindMetas[nIndex].is_null = 1;
m_bindMetas[nIndex].is_null = true;
free(m_binds[nIndex].buffer);
m_binds[nIndex].buffer = nullptr;
}
@@ -408,7 +408,7 @@ void SAL_CALL OPreparedStatement::setObjectWithInfo(sal_Int32 parameterIndex, co
{
free(m_binds[nIndex].buffer);
m_binds[nIndex].buffer = nullptr;
m_bindMetas[parameterIndex - 1].is_null = 1;
m_bindMetas[parameterIndex - 1].is_null = true;
return;
}
@@ -433,7 +433,7 @@ void SAL_CALL OPreparedStatement::setObjectWithInfo(sal_Int32 parameterIndex, co
m_binds[nIndex].buffer_type = MYSQL_TYPE_DOUBLE;
mysqlc_sdbc_driver::resetSqlVar(&m_binds[nIndex].buffer, &nValue, MYSQL_TYPE_DOUBLE,
sValue.getLength());
m_bindMetas[nIndex].is_null = 0;
m_bindMetas[nIndex].is_null = false;
break;
}
@@ -478,7 +478,7 @@ void SAL_CALL OPreparedStatement::setShort(sal_Int32 parameter, sal_Int16 x)
const sal_Int32 nIndex = parameter - 1;
m_binds[nIndex].buffer_type = MYSQL_TYPE_SHORT;
mysqlc_sdbc_driver::resetSqlVar(&m_binds[nIndex].buffer, &x, MYSQL_TYPE_SHORT);
m_bindMetas[nIndex].is_null = 0;
m_bindMetas[nIndex].is_null = false;
}
void SAL_CALL OPreparedStatement::setBytes(sal_Int32 parameter, const Sequence<sal_Int8>& x)
@@ -490,7 +490,7 @@ void SAL_CALL OPreparedStatement::setBytes(sal_Int32 parameter, const Sequence<s
const sal_Int32 nIndex = parameter - 1;
m_binds[nIndex].buffer_type = MYSQL_TYPE_BLOB; // FIXME
mysqlc_sdbc_driver::resetSqlVar(&m_binds[nIndex].buffer, &x, MYSQL_TYPE_BLOB);
m_bindMetas[nIndex].is_null = 0;
m_bindMetas[nIndex].is_null = false;
}
void SAL_CALL OPreparedStatement::setCharacterStream(sal_Int32 parameter,
@@ -524,7 +524,7 @@ void SAL_CALL OPreparedStatement::clearParameters()
for (size_t i = 0; i < m_binds.size(); ++i)
{
m_bindMetas[i].is_null = 1;
m_bindMetas[i].is_null = true;
free(m_binds[i].buffer);
m_binds[i].buffer = nullptr;
}
@@ -47,9 +47,9 @@ using my_bool = char;
struct BindMetaData
{
my_bool is_null = 0;
my_bool is_null = false;
unsigned long length = 0;
my_bool error = 0;
my_bool error = false;
};
typedef ::cppu::ImplHelper5<css::sdbc::XPreparedStatement, css::sdbc::XParameters,
+1 -1
View File
@@ -124,7 +124,7 @@ jboolean Java_com_sun_star_comp_helper_SharedLibraryLoader_component_1writeInfo(
lib.release();
}
#endif
return bRet ? JNI_TRUE : JNI_FALSE;
return bRet;
}
/*
@@ -101,7 +101,7 @@ static void gtv_calc_header_bar_draw_text(cairo_t* pCairo, const GdkRectangle& r
cairo_show_text(pCairo, rText.c_str());
}
static gboolean gtv_calc_header_bar_draw_impl(GtkWidget* pWidget, cairo_t* pCairo)
static bool gtv_calc_header_bar_draw_impl(GtkWidget* pWidget, cairo_t* pCairo)
{
GtvCalcHeaderBar* self = GTV_CALC_HEADER_BAR(pWidget);
GtvCalcHeaderBarPrivate& priv = getPrivate(GTV_CALC_HEADER_BAR(self));
@@ -43,7 +43,7 @@ static gboolean destroyLokDialog(GtkWidget* pWidget, gpointer userdata)
void LOKDocViewSigHandlers::editChanged(LOKDocView* pDocView, gboolean bWasEdit, gpointer)
{
GtvApplicationWindow* window = GTV_APPLICATION_WINDOW(gtk_widget_get_toplevel(GTK_WIDGET(pDocView)));
gboolean bEdit = lok_doc_view_get_edit(LOK_DOC_VIEW(window->lokdocview));
bool bEdit = lok_doc_view_get_edit(LOK_DOC_VIEW(window->lokdocview));
g_info("signalEdit: %d -> %d", bWasEdit, bEdit);
// Let the main toolbar know, so that it can enable disable the button
@@ -64,8 +64,8 @@ void LOKDocViewSigHandlers::commandChanged(LOKDocView* pDocView, char* pPayload,
if (pItem != nullptr)
{
if (aValue == "true" || aValue == "false") {
gboolean bEdit = aValue == "true";
if (gtk_toggle_tool_button_get_active(GTK_TOGGLE_TOOL_BUTTON(pItem)) != bEdit)
bool bEdit = aValue == "true";
if (bool(gtk_toggle_tool_button_get_active(GTK_TOGGLE_TOOL_BUTTON(pItem))) != bEdit)
{
// Avoid invoking lok_doc_view_post_command().
// FIXME: maybe block/unblock the signal (see
@@ -76,7 +76,7 @@ void LOKDocViewSigHandlers::commandChanged(LOKDocView* pDocView, char* pPayload,
}
} else if (aValue == "enabled" || aValue == "disabled") {
gboolean bSensitive = aValue == "enabled";
bool bSensitive = aValue == "enabled";
gtk_widget_set_sensitive(GTK_WIDGET(pItem), bSensitive);
// Remember state, so in case edit is disable and enabled
+16 -16
View File
@@ -359,7 +359,7 @@ static void
LOKPostCommand (LOKDocView* pDocView,
const gchar* pCommand,
const gchar* pArguments,
gboolean bNotifyWhenFinished)
bool bNotifyWhenFinished)
{
LOKDocViewPrivate& priv = getPrivate(pDocView);
GTask* task = g_task_new(pDocView, nullptr, nullptr, nullptr);
@@ -903,7 +903,7 @@ globalCallback (gpointer pData)
{
CallbackData* pCallback = static_cast<CallbackData*>(pData);
LOKDocViewPrivate& priv = getPrivate(pCallback->m_pDocView);
gboolean bModify = false;
bool bModify = false;
switch (pCallback->m_nType)
{
@@ -1111,7 +1111,7 @@ callback (gpointer pData)
case LOK_CALLBACK_TEXT_SELECTION:
{
priv->m_aTextSelectionRectangles = payloadToRectangles(pDocView, pCallback->m_aPayload.c_str());
gboolean bIsTextSelected = !priv->m_aTextSelectionRectangles.empty();
bool bIsTextSelected = !priv->m_aTextSelectionRectangles.empty();
// In case the selection is empty, then we get no LOK_CALLBACK_TEXT_SELECTION_START/END events.
if (!bIsTextSelected)
{
@@ -1545,7 +1545,7 @@ paintTileCallback(GObject* sourceObject, GAsyncResult* res, gpointer userData)
}
static gboolean
static bool
renderDocument(LOKDocView* pDocView, cairo_t* pCairo)
{
LOKDocViewPrivate& priv = getPrivate(pDocView);
@@ -1665,7 +1665,7 @@ static const GdkRGBA& getDarkColor(int nViewId, LOKDocViewPrivate& priv)
return aColorMap[nViewId];
}
static gboolean
static bool
renderOverlay(LOKDocView* pDocView, cairo_t* pCairo)
{
LOKDocViewPrivate& priv = getPrivate(pDocView);
@@ -2267,8 +2267,8 @@ setEditInThread(gpointer data)
LOKDocView* pDocView = LOK_DOC_VIEW(g_task_get_source_object(task));
LOKDocViewPrivate& priv = getPrivate(pDocView);
LOEvent* pLOEvent = static_cast<LOEvent*>(g_task_get_task_data(task));
gboolean bWasEdit = priv->m_bEdit;
gboolean bEdit = pLOEvent->m_bEdit;
bool bWasEdit = priv->m_bEdit;
bool bEdit = pLOEvent->m_bEdit;
if (!priv->m_bEdit && bEdit)
g_info("lok_doc_view_set_edit: entering edit mode");
@@ -2463,9 +2463,9 @@ static void lok_doc_view_set_property (GObject* object, guint propId, const GVal
{
LOKDocView* pDocView = LOK_DOC_VIEW (object);
LOKDocViewPrivate& priv = getPrivate(pDocView);
gboolean bDocPasswordEnabled = priv->m_nLOKFeatures & LOK_FEATURE_DOCUMENT_PASSWORD;
gboolean bDocPasswordToModifyEnabled = priv->m_nLOKFeatures & LOK_FEATURE_DOCUMENT_PASSWORD_TO_MODIFY;
gboolean bTiledAnnotationsEnabled = !(priv->m_nLOKFeatures & LOK_FEATURE_NO_TILED_ANNOTATIONS);
bool bDocPasswordEnabled = priv->m_nLOKFeatures & LOK_FEATURE_DOCUMENT_PASSWORD;
bool bDocPasswordToModifyEnabled = priv->m_nLOKFeatures & LOK_FEATURE_DOCUMENT_PASSWORD_TO_MODIFY;
bool bTiledAnnotationsEnabled = !(priv->m_nLOKFeatures & LOK_FEATURE_NO_TILED_ANNOTATIONS);
switch (propId)
{
@@ -2502,21 +2502,21 @@ static void lok_doc_view_set_property (GObject* object, guint propId, const GVal
priv->m_nDocumentHeightTwips = g_value_get_long (value);
break;
case PROP_DOC_PASSWORD:
if (g_value_get_boolean (value) != bDocPasswordEnabled)
if (bool(g_value_get_boolean (value)) != bDocPasswordEnabled)
{
priv->m_nLOKFeatures = priv->m_nLOKFeatures ^ LOK_FEATURE_DOCUMENT_PASSWORD;
priv->m_pOffice->pClass->setOptionalFeatures(priv->m_pOffice, priv->m_nLOKFeatures);
}
break;
case PROP_DOC_PASSWORD_TO_MODIFY:
if ( g_value_get_boolean (value) != bDocPasswordToModifyEnabled)
if ( bool(g_value_get_boolean (value)) != bDocPasswordToModifyEnabled)
{
priv->m_nLOKFeatures = priv->m_nLOKFeatures ^ LOK_FEATURE_DOCUMENT_PASSWORD_TO_MODIFY;
priv->m_pOffice->pClass->setOptionalFeatures(priv->m_pOffice, priv->m_nLOKFeatures);
}
break;
case PROP_TILED_ANNOTATIONS:
if ( g_value_get_boolean (value) != bTiledAnnotationsEnabled)
if ( bool(g_value_get_boolean (value)) != bTiledAnnotationsEnabled)
{
priv->m_nLOKFeatures = priv->m_nLOKFeatures ^ LOK_FEATURE_NO_TILED_ANNOTATIONS;
priv->m_pOffice->pClass->setOptionalFeatures(priv->m_pOffice, priv->m_nLOKFeatures);
@@ -2580,10 +2580,10 @@ static void lok_doc_view_get_property (GObject* object, guint propId, GValue *va
g_value_set_boolean (value, priv->m_bCanZoomOut);
break;
case PROP_DOC_PASSWORD:
g_value_set_boolean (value, priv->m_nLOKFeatures & LOK_FEATURE_DOCUMENT_PASSWORD);
g_value_set_boolean (value, (priv->m_nLOKFeatures & LOK_FEATURE_DOCUMENT_PASSWORD) != 0);
break;
case PROP_DOC_PASSWORD_TO_MODIFY:
g_value_set_boolean (value, priv->m_nLOKFeatures & LOK_FEATURE_DOCUMENT_PASSWORD_TO_MODIFY);
g_value_set_boolean (value, (priv->m_nLOKFeatures & LOK_FEATURE_DOCUMENT_PASSWORD_TO_MODIFY) != 0);
break;
case PROP_TILED_ANNOTATIONS:
g_value_set_boolean (value, !(priv->m_nLOKFeatures & LOK_FEATURE_NO_TILED_ANNOTATIONS));
@@ -3780,7 +3780,7 @@ lok_doc_view_paste (LOKDocView* pDocView,
{
LOKDocViewPrivate& priv = getPrivate(pDocView);
LibreOfficeKitDocument* pDocument = priv->m_pDocument;
gboolean ret = 0;
bool ret = 0;
if (!pDocument)
return false;
+1 -1
View File
@@ -36,6 +36,7 @@ $(eval $(call gb_CompilerTest_add_exception_objects,compilerplugins_clang, \
compilerplugins/clang/test/expressionalwayszero \
compilerplugins/clang/test/intvsfloat \
compilerplugins/clang/test/faileddyncast \
compilerplugins/clang/test/fakebool \
compilerplugins/clang/test/finalprotected \
compilerplugins/clang/test/flatten \
compilerplugins/clang/test/fragiledestructor \
@@ -60,7 +61,6 @@ $(eval $(call gb_CompilerTest_add_exception_objects,compilerplugins_clang, \
compilerplugins/clang/test/refcounting \
compilerplugins/clang/test/referencecasting \
compilerplugins/clang/test/returnconstval \
compilerplugins/clang/test/salbool \
compilerplugins/clang/test/salcall \
compilerplugins/clang/test/sallogareas \
compilerplugins/clang/test/salunicodeliteral \
+2 -2
View File
@@ -1679,6 +1679,7 @@ compilerplugins/clang/expressionalwayszero.cxx
compilerplugins/clang/externandnotdefined.cxx
compilerplugins/clang/externvar.cxx
compilerplugins/clang/faileddyncast.cxx
compilerplugins/clang/fakebool.cxx
compilerplugins/clang/finalclasses.cxx
compilerplugins/clang/finalprotected.cxx
compilerplugins/clang/flatten.cxx
@@ -1714,7 +1715,6 @@ compilerplugins/clang/redundantpointerops.cxx
compilerplugins/clang/refcounting.cxx
compilerplugins/clang/rendercontext.cxx
compilerplugins/clang/reservedid.cxx
compilerplugins/clang/salbool.cxx
compilerplugins/clang/sallogareas.cxx
compilerplugins/clang/salunicodeliteral.cxx
compilerplugins/clang/sfxpoolitem.cxx
@@ -1787,6 +1787,7 @@ compilerplugins/clang/test/expressionalwayszero.cxx
compilerplugins/clang/test/externvar.cxx
compilerplugins/clang/test/externvar.hxx
compilerplugins/clang/test/faileddyncast.cxx
compilerplugins/clang/test/fakebool.cxx
compilerplugins/clang/test/finalprotected.cxx
compilerplugins/clang/test/flatten.cxx
compilerplugins/clang/test/indentation.cxx
@@ -1803,7 +1804,6 @@ compilerplugins/clang/test/redundantinline.cxx
compilerplugins/clang/test/redundantinline.hxx
compilerplugins/clang/test/redundantpointerops.cxx
compilerplugins/clang/test/refcounting.cxx
compilerplugins/clang/test/salbool.cxx
compilerplugins/clang/test/salunicodeliteral.cxx
compilerplugins/clang/test/salunicodeliteral.hxx
compilerplugins/clang/test/stringconcatauto.cxx
+1 -1
View File
@@ -1084,7 +1084,7 @@ void Content::transfer( const css::ucb::TransferInfo& aTransferInfo, const css::
GFile *pDest = g_file_new_for_uri(OUStringToOString(sDest, RTL_TEXTENCODING_UTF8).getStr());
GFile *pSource = g_file_new_for_uri(OUStringToOString(aTransferInfo.SourceURL, RTL_TEXTENCODING_UTF8).getStr());
gboolean bSuccess = false;
bool bSuccess = false;
GError *pError = nullptr;
if (aTransferInfo.MoveData)
bSuccess = g_file_move(pSource, pDest, G_FILE_COPY_OVERWRITE, nullptr, nullptr, nullptr, &pError);
+1 -1
View File
@@ -137,7 +137,7 @@ namespace vcl {
const char ScriptRun::fgClassID=0;
static UBool sameScript(int32_t scriptOne, int32_t scriptTwo)
static bool sameScript(int32_t scriptOne, int32_t scriptTwo)
{
return scriptOne <= USCRIPT_INHERITED || scriptTwo <= USCRIPT_INHERITED || scriptOne == scriptTwo;
}
+1 -1
View File
@@ -468,7 +468,7 @@ void AtkListener::notifyEvent( const accessibility::AccessibleEventObject& aEven
AtkStateType eOldState = mapState( aEvent.OldValue );
AtkStateType eNewState = mapState( aEvent.NewValue );
gboolean bState = eNewState != ATK_STATE_INVALID;
bool bState = eNewState != ATK_STATE_INVALID;
AtkStateType eRealState = bState ? eNewState : eOldState;
atk_object_notify_state_change( atk_obj, eRealState, bState );
+2 -2
View File
@@ -1480,7 +1480,7 @@ void SalGtkFilePicker::selection_changed_cb( GtkFileChooser *, SalGtkFilePicker
void SalGtkFilePicker::update_preview_cb( GtkFileChooser *file_chooser, SalGtkFilePicker* pobjFP )
{
gboolean have_preview = false;
bool have_preview = false;
GtkWidget* preview = pobjFP->m_pPreview;
char* filename = gtk_file_chooser_get_preview_filename( file_chooser );
@@ -1794,7 +1794,7 @@ extern "C"
static gboolean
case_insensitive_filter (const GtkFileFilterInfo *filter_info, gpointer data)
{
gboolean bRetval = false;
bool bRetval = false;
const char *pFilter = static_cast<const char *>(data);
g_return_val_if_fail( data != nullptr, false );
+2 -2
View File
@@ -187,7 +187,7 @@ g_lo_action_group_perform_submenu_action (GLOActionGroup *group,
const gchar *action_name,
GVariant *state)
{
gboolean bState = g_variant_get_boolean (state);
bool bState = g_variant_get_boolean (state);
SAL_INFO("vcl.unity", "g_lo_action_group_perform_submenu_action on " << group << " to " << bState);
if (bState)
@@ -217,7 +217,7 @@ g_lo_action_group_change_state (GActionGroup *group,
g_lo_action_group_perform_submenu_action (lo_group, action_name, value);
else
{
gboolean is_new = FALSE;
bool is_new = FALSE;
/* If action already exists but has no state, it should be removed and added again. */
if (action->state_type == nullptr)
+1 -1
View File
@@ -52,7 +52,7 @@ g_lo_menu_struct_item_init (struct item *menu_item)
* - no consecutive '-'
* - not longer than 1024 chars
*/
static gboolean
static bool
valid_attribute_name (const gchar *name)
{
gint i;
+1 -1
View File
@@ -375,7 +375,7 @@ bool GtkSalData::Yield( bool bWait, bool bHandleAllCurrentEvents )
if( bDispatchThread )
{
int nMaxEvents = bHandleAllCurrentEvents ? 100 : 1;
gboolean wasOneEvent = TRUE;
bool wasOneEvent = TRUE;
while( nMaxEvents-- && wasOneEvent )
{
wasOneEvent = g_main_context_iteration( nullptr, bWait && !bWasEvent );
+4 -4
View File
@@ -490,7 +490,7 @@ static void hud_activated( gboolean hud_active, gpointer user_data )
}
}
static gboolean ensure_dbus_setup( gpointer data )
static bool ensure_dbus_setup( gpointer data )
{
GtkSalFrame* pSalFrame = static_cast< GtkSalFrame* >( data );
GdkWindow* gdkWindow = widget_get_window( pSalFrame->getWindow() );
@@ -3429,7 +3429,7 @@ gboolean GtkDropTarget::signalDragDrop(GtkWidget* pWidget, GdkDragContext* conte
{
// remove the deferred dragExit, as we'll do a drop
#ifndef NDEBUG
gboolean res =
bool res =
#endif
g_idle_remove_by_data(this);
assert(res);
@@ -3808,7 +3808,7 @@ bool GtkSalFrame::IMHandler::handleKeyEvent( GdkEventKey* pEvent )
if( aDel.isDeleted() )
return true;
gboolean bResult = gtk_im_context_filter_keypress( m_pIMContext, pEvent );
bool bResult = gtk_im_context_filter_keypress( m_pIMContext, pEvent );
g_object_unref( pRef );
if( aDel.isDeleted() )
@@ -3839,7 +3839,7 @@ bool GtkSalFrame::IMHandler::handleKeyEvent( GdkEventKey* pEvent )
if (pEvent->type == GDK_KEY_RELEASE)
{
GObject* pRef = G_OBJECT( g_object_ref( G_OBJECT( m_pIMContext ) ) );
gboolean bResult = gtk_im_context_filter_keypress( m_pIMContext, pEvent );
bool bResult = gtk_im_context_filter_keypress( m_pIMContext, pEvent );
g_object_unref( pRef );
if( aDel.isDeleted() )
+8 -8
View File
@@ -2521,7 +2521,7 @@ public:
{
//for toplevel windows this is sadly futile under wayland, so we can't tell where a dialog is in order to allow
//the document underneath to auto-scroll to place content in a visible location
gboolean ret = gtk_widget_translate_coordinates(m_pWidget,
bool ret = gtk_widget_translate_coordinates(m_pWidget,
dynamic_cast<GtkInstanceWidget&>(rRelative).getWidget(),
0, 0, &x, &y);
width = gtk_widget_get_allocated_width(m_pWidget);
@@ -7385,7 +7385,7 @@ private:
pThis->signal_activated();
}
gboolean signal_key_press(GdkEventKey* pEvent)
bool signal_key_press(GdkEventKey* pEvent)
{
if (pEvent->keyval == GDK_KEY_Return)
{
@@ -8101,7 +8101,7 @@ private:
bool get_bool(int pos, int col) const
{
gboolean bRet(false);
bool bRet(false);
GtkTreeModel *pModel = GTK_TREE_MODEL(m_pTreeStore);
GtkTreeIter iter;
if (gtk_tree_model_iter_nth_child(pModel, &iter, nullptr, pos))
@@ -8358,7 +8358,7 @@ private:
g_DragSource = nullptr;
}
gboolean signal_key_press(GdkEventKey* pEvent)
bool signal_key_press(GdkEventKey* pEvent)
{
if (pEvent->keyval != GDK_KEY_Left && pEvent->keyval != GDK_KEY_Right)
return false;
@@ -9322,7 +9322,7 @@ public:
GtkInstanceTreeIter& rGtkIter = static_cast<GtkInstanceTreeIter&>(rIter);
GtkTreeModel *pModel = GTK_TREE_MODEL(m_pTreeStore);
GtkTreeIter tmp;
gboolean ret = gtk_tree_model_iter_children(pModel, &tmp, &rGtkIter.iter);
bool ret = gtk_tree_model_iter_children(pModel, &tmp, &rGtkIter.iter);
rGtkIter.iter = tmp;
if (ret)
{
@@ -11094,7 +11094,7 @@ private:
std::unique_ptr<comphelper::string::NaturalStringSorter> m_xSorter;
vcl::QuickSelectionEngine m_aQuickSelectionEngine;
std::vector<int> m_aSeparatorRows;
gboolean m_bPopupActive;
bool m_bPopupActive;
bool m_bAutoComplete;
bool m_bAutoCompleteCaseSensitive;
gulong m_nToggleFocusInSignalId;
@@ -11217,7 +11217,7 @@ private:
m_aQuickSelectionEngine.Reset();
gboolean bIsShown(false);
g_object_get(m_pComboBox, "popup-shown", &bIsShown, nullptr);
if (m_bPopupActive != bIsShown)
if (m_bPopupActive != bool(bIsShown))
{
m_bPopupActive = bIsShown;
ComboBox::signal_popup_toggled();
@@ -11965,7 +11965,7 @@ private:
guint m_nAutoCompleteIdleId;
bool m_bAutoCompleteCaseSensitive;
gboolean signal_key_press(GdkEventKey* pEvent)
bool signal_key_press(GdkEventKey* pEvent)
{
if (pEvent->keyval == GDK_KEY_KP_Up || pEvent->keyval == GDK_KEY_Up || pEvent->keyval == GDK_KEY_KP_Page_Up || pEvent->keyval == GDK_KEY_Page_Up ||
pEvent->keyval == GDK_KEY_KP_Down || pEvent->keyval == GDK_KEY_Down || pEvent->keyval == GDK_KEY_KP_Page_Down || pEvent->keyval == GDK_KEY_Page_Down)