loplugin:stringview: Flag empty string converted to string view

Change-Id: Idf412dc5f235230512160cb4fb7e1a00baa1cfa7
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/106085
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
This commit is contained in:
Stephan Bergmann 2020-11-18 23:30:24 +01:00
parent 8f79f59066
commit 19926ed35e
26 changed files with 156 additions and 114 deletions

View File

@ -52,6 +52,7 @@ public:
bool VisitCXXConstructExpr(CXXConstructExpr const*);
bool VisitFunctionDecl(FunctionDecl const*);
bool VisitCXXOperatorCallExpr(CXXOperatorCallExpr const*);
bool VisitImplicitCastExpr(ImplicitCastExpr const*);
};
bool StringView::VisitCallExpr(CallExpr const* callExpr)
@ -180,6 +181,39 @@ bool StringView::VisitCXXConstructExpr(CXXConstructExpr const* constructExpr)
return true;
}
bool StringView::VisitImplicitCastExpr(ImplicitCastExpr const* expr)
{
if (ignoreLocation(expr))
{
return true;
}
if (!loplugin::TypeCheck(expr->getType()).ClassOrStruct("basic_string_view").StdNamespace())
{
return true;
}
auto const e = dyn_cast<CXXConstructExpr>(expr->getSubExprAsWritten()->IgnoreParens());
if (e == nullptr)
{
return true;
}
if (e->getNumArgs() != 0)
{
return true;
}
auto const tc = loplugin::TypeCheck(e->getType());
if (!(tc.Class("OString").Namespace("rtl").GlobalNamespace()
|| tc.Class("OUString").Namespace("rtl").GlobalNamespace()))
{
return true;
}
report(DiagnosticsEngine::Warning,
"instead of an empty %0, pass an empty '%select{std::string_view|std::u16string_view}1'",
e->getLocation())
<< e->getType() << (tc.Class("OString").Namespace("rtl").GlobalNamespace() ? 0 : 1)
<< e->getSourceRange();
return true;
}
loplugin::Plugin::Registration<StringView> stringview("stringview");
}

View File

@ -93,4 +93,12 @@ void f4(OUString s1, OUString s2)
}
}
void f5()
{
// expected-error@+1 {{instead of an empty 'rtl::OString', pass an empty 'std::string_view' [loplugin:stringview]}}
call_view(OString());
// expected-error@+1 {{instead of an empty 'rtl::OUString', pass an empty 'std::u16string_view' [loplugin:stringview]}}
call_view(OUString());
}
/* vim:set shiftwidth=4 softtabstop=4 expandtab cinoptions=b1,g0,N-s cinkeys+=0=break: */

View File

@ -380,7 +380,7 @@ OUString createStandardKeyStatement(const Reference< XPropertySet >& descriptor,
OUString createSqlCreateTableStatement( const Reference< XPropertySet >& descriptor,
const Reference< XConnection>& _xConnection)
{
OUString aSql = ::dbtools::createStandardCreateStatement(descriptor,_xConnection,nullptr,OUString());
OUString aSql = ::dbtools::createStandardCreateStatement(descriptor,_xConnection,nullptr,{});
const OUString sKeyStmt = ::dbtools::createStandardKeyStatement(descriptor,_xConnection);
if ( !sKeyStmt.isEmpty() )
aSql += sKeyStmt;

View File

@ -987,7 +987,7 @@ void SAL_CALL ODatabaseDocument::store( )
// allowed to leave
throw;
}
impl_throwIOExceptionCausedBySave_throw( aError, OUString() );
impl_throwIOExceptionCausedBySave_throw( aError, {} );
}
}

View File

@ -30,20 +30,20 @@ namespace xforms
OUString getResource(const char* pResourceId)
{
return getResource(pResourceId, OUString(), OUString(), OUString());
return getResource(pResourceId, {}, {}, {});
}
OUString getResource(const char* pResourceId,
std::u16string_view rInfo1)
{
return getResource(pResourceId, rInfo1, OUString(), OUString());
return getResource(pResourceId, rInfo1, {}, {});
}
OUString getResource(const char* pResourceId,
std::u16string_view rInfo1,
std::u16string_view rInfo2)
{
return getResource(pResourceId, rInfo1, rInfo2, OUString());
return getResource(pResourceId, rInfo1, rInfo2, {});
}
OUString getResource(const char* pResourceId,

View File

@ -2124,7 +2124,7 @@ void GeometryHandler::impl_setCounterFunction_throw()
const OUString sQuotedFunctionName = lcl_getQuotedFunctionName(sFunctionName);
OUString sScope;
if ( !(!sFunctionName.isEmpty() && m_aFunctionNames.find(sQuotedFunctionName) != m_aFunctionNames.end() && impl_isCounterFunction_throw(sQuotedFunctionName,sScope)) )
impl_createFunction(sFunctionName,OUString(),m_aCounterFunction);
impl_createFunction(sFunctionName,{},m_aCounterFunction);
OBlocker aBlocker(m_bIn);
m_xReportComponent->setPropertyValue(PROPERTY_DATAFIELD,uno::makeAny(impl_convertToFormula( uno::makeAny(sQuotedFunctionName))));

View File

@ -1177,7 +1177,7 @@ uno::Reference< excel::XRange > SAL_CALL ScVbaApplication::Intersect(
const uno::Any& rArg27, const uno::Any& rArg28, const uno::Any& rArg29, const uno::Any& rArg30 )
{
if( !rArg1.is() || !rArg2.is() )
DebugHelper::basicexception( ERRCODE_BASIC_BAD_PARAMETER, OUString() );
DebugHelper::basicexception( ERRCODE_BASIC_BAD_PARAMETER, {} );
// initialize the result list with 1st parameter, join its ranges together
ListOfScRange aList;
@ -1230,7 +1230,7 @@ uno::Reference< excel::XRange > SAL_CALL ScVbaApplication::Union(
const uno::Any& rArg27, const uno::Any& rArg28, const uno::Any& rArg29, const uno::Any& rArg30 )
{
if( !rArg1.is() || !rArg2.is() )
DebugHelper::basicexception( ERRCODE_BASIC_BAD_PARAMETER, OUString() );
DebugHelper::basicexception( ERRCODE_BASIC_BAD_PARAMETER, {} );
ListOfScRange aList;
lclAddToListOfScRange( aList, uno::Any( rArg1 ) );

View File

@ -47,7 +47,7 @@ ScVbaAxis::isValueAxis()
{
if ( getType() == xlCategory )
{
DebugHelper::basicexception(ERRCODE_BASIC_METHOD_FAILED, OUString());
DebugHelper::basicexception(ERRCODE_BASIC_METHOD_FAILED, {});
}
return true;
}
@ -103,13 +103,13 @@ ScVbaAxis::getAxisTitle( )
void SAL_CALL
ScVbaAxis::setDisplayUnit( ::sal_Int32 /*DisplayUnit*/ )
{
DebugHelper::basicexception(ERRCODE_BASIC_NOT_IMPLEMENTED, OUString());
DebugHelper::basicexception(ERRCODE_BASIC_NOT_IMPLEMENTED, {});
}
::sal_Int32 SAL_CALL
ScVbaAxis::getDisplayUnit( )
{
DebugHelper::basicexception(ERRCODE_BASIC_NOT_IMPLEMENTED, OUString());
DebugHelper::basicexception(ERRCODE_BASIC_NOT_IMPLEMENTED, {});
return -1;
}
@ -143,7 +143,7 @@ ScVbaAxis::setCrosses( ::sal_Int32 _nCrosses )
}
catch (const uno::Exception&)
{
DebugHelper::basicexception(ERRCODE_BASIC_METHOD_FAILED, OUString());
DebugHelper::basicexception(ERRCODE_BASIC_METHOD_FAILED, {});
}
}
::sal_Int32 SAL_CALL
@ -175,7 +175,7 @@ ScVbaAxis::getCrosses( )
}
catch (uno::Exception& )
{
DebugHelper::basicexception(ERRCODE_BASIC_METHOD_FAILED, OUString() );
DebugHelper::basicexception(ERRCODE_BASIC_METHOD_FAILED, {} );
}
return nCrosses;
}
@ -205,7 +205,7 @@ ScVbaAxis::getCrossesAt( )
}
catch (uno::Exception& )
{
DebugHelper::basicexception(ERRCODE_BASIC_METHOD_FAILED, OUString());
DebugHelper::basicexception(ERRCODE_BASIC_METHOD_FAILED, {});
}
return fCrosses;
}
@ -285,7 +285,7 @@ ScVbaAxis::setMinorUnit( double _fMinorUnit )
}
catch (uno::Exception& )
{
DebugHelper::basicexception(ERRCODE_BASIC_METHOD_FAILED, OUString());
DebugHelper::basicexception(ERRCODE_BASIC_METHOD_FAILED, {});
}
}
@ -300,7 +300,7 @@ ScVbaAxis::getMinorUnit( )
}
catch (uno::Exception& )
{
DebugHelper::basicexception(ERRCODE_BASIC_METHOD_FAILED, OUString());
DebugHelper::basicexception(ERRCODE_BASIC_METHOD_FAILED, {});
}
return fMinor;
}
@ -315,7 +315,7 @@ ScVbaAxis::setMinorUnitIsAuto( sal_Bool _bMinorUnitIsAuto )
}
catch (uno::Exception& )
{
DebugHelper::basicexception(ERRCODE_BASIC_METHOD_FAILED, OUString() );
DebugHelper::basicexception(ERRCODE_BASIC_METHOD_FAILED, {} );
}
}
@ -332,7 +332,7 @@ ScVbaAxis::getMinorUnitIsAuto( )
}
catch (const uno::Exception&)
{
DebugHelper::basicexception(ERRCODE_BASIC_METHOD_FAILED, OUString());
DebugHelper::basicexception(ERRCODE_BASIC_METHOD_FAILED, {});
}
return bIsAuto;
}
@ -340,13 +340,13 @@ ScVbaAxis::getMinorUnitIsAuto( )
void SAL_CALL
ScVbaAxis::setReversePlotOrder( sal_Bool /*ReversePlotOrder*/ )
{
DebugHelper::basicexception(ERRCODE_BASIC_NOT_IMPLEMENTED, OUString());
DebugHelper::basicexception(ERRCODE_BASIC_NOT_IMPLEMENTED, {});
}
sal_Bool SAL_CALL
ScVbaAxis::getReversePlotOrder( )
{
DebugHelper::basicexception(ERRCODE_BASIC_NOT_IMPLEMENTED, OUString());
DebugHelper::basicexception(ERRCODE_BASIC_NOT_IMPLEMENTED, {});
return false;
}
@ -362,7 +362,7 @@ ScVbaAxis::setMajorUnit( double _fMajorUnit )
}
catch (const uno::Exception&)
{
DebugHelper::basicexception(ERRCODE_BASIC_METHOD_FAILED, OUString());
DebugHelper::basicexception(ERRCODE_BASIC_METHOD_FAILED, {});
}
}
@ -377,7 +377,7 @@ ScVbaAxis::getMajorUnit( )
}
catch (const uno::Exception&)
{
DebugHelper::basicexception(ERRCODE_BASIC_METHOD_FAILED, OUString() );
DebugHelper::basicexception(ERRCODE_BASIC_METHOD_FAILED, {} );
}
return fMax;
}
@ -394,7 +394,7 @@ ScVbaAxis::setMajorUnitIsAuto( sal_Bool _bMajorUnitIsAuto )
}
catch (const uno::Exception&)
{
DebugHelper::basicexception(ERRCODE_BASIC_METHOD_FAILED, OUString());
DebugHelper::basicexception(ERRCODE_BASIC_METHOD_FAILED, {});
}
}
@ -411,7 +411,7 @@ ScVbaAxis::getMajorUnitIsAuto( )
}
catch (const uno::Exception&)
{
DebugHelper::basicexception(ERRCODE_BASIC_METHOD_FAILED, OUString());
DebugHelper::basicexception(ERRCODE_BASIC_METHOD_FAILED, {});
}
return bIsAuto;
}
@ -428,7 +428,7 @@ ScVbaAxis::setMaximumScale( double _fMaximumScale )
}
catch (const uno::Exception&)
{
DebugHelper::basicexception(ERRCODE_BASIC_METHOD_FAILED, OUString());
DebugHelper::basicexception(ERRCODE_BASIC_METHOD_FAILED, {});
}
}
@ -445,7 +445,7 @@ ScVbaAxis::getMaximumScale( )
}
catch (const uno::Exception&)
{
DebugHelper::basicexception(ERRCODE_BASIC_METHOD_FAILED, OUString());
DebugHelper::basicexception(ERRCODE_BASIC_METHOD_FAILED, {});
}
return fMax;
@ -462,7 +462,7 @@ ScVbaAxis::setMaximumScaleIsAuto( sal_Bool _bMaximumScaleIsAuto )
}
catch (const uno::Exception&)
{
DebugHelper::basicexception(ERRCODE_BASIC_METHOD_FAILED, OUString());
DebugHelper::basicexception(ERRCODE_BASIC_METHOD_FAILED, {});
}
}
@ -477,7 +477,7 @@ ScVbaAxis::getMaximumScaleIsAuto( )
}
catch (const uno::Exception&)
{
DebugHelper::basicexception( ERRCODE_BASIC_METHOD_FAILED, OUString() );
DebugHelper::basicexception( ERRCODE_BASIC_METHOD_FAILED, {} );
}
return bIsAuto;
}
@ -492,7 +492,7 @@ ScVbaAxis::setMinimumScale( double _fMinimumScale )
}
catch ( uno::Exception& )
{
DebugHelper::basicexception(ERRCODE_BASIC_METHOD_FAILED, OUString() );
DebugHelper::basicexception(ERRCODE_BASIC_METHOD_FAILED, {} );
}
}
@ -524,7 +524,7 @@ ScVbaAxis::setMinimumScaleIsAuto( sal_Bool _bMinimumScaleIsAuto )
}
catch (const uno::Exception&)
{
DebugHelper::basicexception(ERRCODE_BASIC_METHOD_FAILED, OUString());
DebugHelper::basicexception(ERRCODE_BASIC_METHOD_FAILED, {});
}
}
@ -541,7 +541,7 @@ ScVbaAxis::getMinimumScaleIsAuto( )
}
catch (const uno::Exception&)
{
DebugHelper::basicexception(ERRCODE_BASIC_METHOD_FAILED, OUString());
DebugHelper::basicexception(ERRCODE_BASIC_METHOD_FAILED, {});
}
return bIsAuto;
}
@ -575,7 +575,7 @@ ScVbaAxis::setScaleType( ::sal_Int32 _nScaleType )
}
catch (const uno::Exception&)
{
DebugHelper::basicexception(ERRCODE_BASIC_METHOD_FAILED, OUString());
DebugHelper::basicexception(ERRCODE_BASIC_METHOD_FAILED, {});
}
}
@ -597,7 +597,7 @@ ScVbaAxis::getScaleType( )
}
catch (const uno::Exception&)
{
DebugHelper::basicexception(ERRCODE_BASIC_METHOD_FAILED, OUString());
DebugHelper::basicexception(ERRCODE_BASIC_METHOD_FAILED, {});
}
return nScaleType;
}

View File

@ -78,7 +78,7 @@ ScVbaFormat< Ifc... >::ScVbaFormat( const uno::Reference< XHelperInterface >& xP
}
catch (const uno::Exception& )
{
DebugHelper::basicexception(ERRCODE_BASIC_METHOD_FAILED, OUString() );
DebugHelper::basicexception(ERRCODE_BASIC_METHOD_FAILED, {} );
}
}
@ -116,7 +116,7 @@ ScVbaFormat< Ifc... >::setVerticalAlignment( const uno::Any& _oAlignment)
}
catch (const uno::Exception&)
{
DebugHelper::basicexception(ERRCODE_BASIC_METHOD_FAILED, OUString());
DebugHelper::basicexception(ERRCODE_BASIC_METHOD_FAILED, {});
}
}
@ -152,7 +152,7 @@ ScVbaFormat< Ifc... >::getVerticalAlignment( )
}
catch (const uno::Exception& )
{
DebugHelper::basicexception(ERRCODE_BASIC_METHOD_FAILED, OUString());
DebugHelper::basicexception(ERRCODE_BASIC_METHOD_FAILED, {});
}
return aResult;
}
@ -192,7 +192,7 @@ ScVbaFormat< Ifc... >::setHorizontalAlignment( const uno::Any& HorizontalAlignme
}
catch (const uno::Exception& )
{
DebugHelper::basicexception(ERRCODE_BASIC_METHOD_FAILED, OUString() );
DebugHelper::basicexception(ERRCODE_BASIC_METHOD_FAILED, {} );
}
}
@ -233,7 +233,7 @@ ScVbaFormat< Ifc... >::getHorizontalAlignment( )
}
catch (const uno::Exception& )
{
DebugHelper::basicexception(ERRCODE_BASIC_METHOD_FAILED, OUString() );
DebugHelper::basicexception(ERRCODE_BASIC_METHOD_FAILED, {} );
}
return NRetAlignment;
}
@ -272,7 +272,7 @@ ScVbaFormat< Ifc... >::setOrientation( const uno::Any& _aOrientation )
}
catch (const uno::Exception& )
{
DebugHelper::basicexception(ERRCODE_BASIC_METHOD_FAILED, OUString() );
DebugHelper::basicexception(ERRCODE_BASIC_METHOD_FAILED, {} );
}
}
template< typename... Ifc >
@ -309,7 +309,7 @@ ScVbaFormat< Ifc... >::getOrientation( )
}
catch (const uno::Exception& )
{
DebugHelper::basicexception(ERRCODE_BASIC_METHOD_FAILED, OUString());
DebugHelper::basicexception(ERRCODE_BASIC_METHOD_FAILED, {});
}
return NRetOrientation;
}
@ -324,7 +324,7 @@ ScVbaFormat< Ifc... >::setWrapText( const uno::Any& _aWrapText )
}
catch (const uno::Exception& )
{
DebugHelper::basicexception(ERRCODE_BASIC_METHOD_FAILED, OUString() );
DebugHelper::basicexception(ERRCODE_BASIC_METHOD_FAILED, {} );
}
}
@ -343,7 +343,7 @@ ScVbaFormat< Ifc... >::getWrapText( )
}
catch (const uno::Exception&)
{
DebugHelper::basicexception(ERRCODE_BASIC_METHOD_FAILED, OUString() );
DebugHelper::basicexception(ERRCODE_BASIC_METHOD_FAILED, {} );
}
return aWrap;
}
@ -402,7 +402,7 @@ ScVbaFormat< Ifc... >::getNumberFormatLocal( )
}
catch (const uno::Exception&)
{
DebugHelper::basicexception(ERRCODE_BASIC_METHOD_FAILED, OUString());
DebugHelper::basicexception(ERRCODE_BASIC_METHOD_FAILED, {});
}
return aRet;
@ -433,7 +433,7 @@ ScVbaFormat< Ifc... >::setNumberFormatLocal( const uno::Any& _oLocalFormatString
}
catch (const uno::Exception& )
{
DebugHelper::basicexception(ERRCODE_BASIC_METHOD_FAILED, OUString() );
DebugHelper::basicexception(ERRCODE_BASIC_METHOD_FAILED, {} );
}
}
@ -463,7 +463,7 @@ ScVbaFormat< Ifc... >::setNumberFormat( const uno::Any& _oFormatString )
}
catch (const uno::Exception& )
{
DebugHelper::basicexception(ERRCODE_BASIC_METHOD_FAILED, OUString());
DebugHelper::basicexception(ERRCODE_BASIC_METHOD_FAILED, {});
}
}
@ -488,7 +488,7 @@ ScVbaFormat< Ifc... >::setIndentLevel( const uno::Any& _aLevel )
}
catch (const uno::Exception&)
{
DebugHelper::basicexception(ERRCODE_BASIC_METHOD_FAILED, OUString());
DebugHelper::basicexception(ERRCODE_BASIC_METHOD_FAILED, {});
}
}
@ -511,7 +511,7 @@ ScVbaFormat< Ifc... >::getIndentLevel( )
}
catch (const uno::Exception&)
{
DebugHelper::basicexception(ERRCODE_BASIC_METHOD_FAILED, OUString());
DebugHelper::basicexception(ERRCODE_BASIC_METHOD_FAILED, {});
}
return NRetIndentLevel;
}
@ -533,7 +533,7 @@ ScVbaFormat< Ifc... >::setLocked( const uno::Any& _aLocked )
}
catch (const uno::Exception&)
{
DebugHelper::basicexception(ERRCODE_BASIC_METHOD_FAILED, OUString() );
DebugHelper::basicexception(ERRCODE_BASIC_METHOD_FAILED, {} );
}
}
@ -553,7 +553,7 @@ ScVbaFormat< Ifc... >::setFormulaHidden( const uno::Any& FormulaHidden )
}
catch (const uno::Exception&)
{
DebugHelper::basicexception( ERRCODE_BASIC_METHOD_FAILED, OUString() );
DebugHelper::basicexception( ERRCODE_BASIC_METHOD_FAILED, {} );
}
}
@ -586,7 +586,7 @@ ScVbaFormat< Ifc... >::getLocked( )
}
catch (const uno::Exception&)
{
DebugHelper::basicexception(ERRCODE_BASIC_METHOD_FAILED, OUString());
DebugHelper::basicexception(ERRCODE_BASIC_METHOD_FAILED, {});
}
return aCellProtection;
}
@ -619,7 +619,7 @@ ScVbaFormat< Ifc... >::getFormulaHidden( )
}
catch (const uno::Exception&)
{
DebugHelper::basicexception(ERRCODE_BASIC_METHOD_FAILED, OUString());
DebugHelper::basicexception(ERRCODE_BASIC_METHOD_FAILED, {});
}
return aBoolRet;
}
@ -634,7 +634,7 @@ ScVbaFormat< Ifc... >::setShrinkToFit( const uno::Any& ShrinkToFit )
}
catch (const uno::Exception& )
{
DebugHelper::basicexception(ERRCODE_BASIC_NOT_IMPLEMENTED, OUString() );
DebugHelper::basicexception(ERRCODE_BASIC_NOT_IMPLEMENTED, {} );
}
}
@ -652,7 +652,7 @@ ScVbaFormat< Ifc... >::getShrinkToFit( )
}
catch (const uno::Exception& )
{
DebugHelper::basicexception(ERRCODE_BASIC_NOT_IMPLEMENTED, OUString());
DebugHelper::basicexception(ERRCODE_BASIC_NOT_IMPLEMENTED, {});
}
return aRet;
}
@ -682,13 +682,13 @@ ScVbaFormat< Ifc... >::setReadingOrder( const uno::Any& ReadingOrder )
aVal <<= sal_Int16(text::WritingMode_LR_TB);
break;
default:
DebugHelper::basicexception(ERRCODE_BASIC_METHOD_FAILED, OUString());
DebugHelper::basicexception(ERRCODE_BASIC_METHOD_FAILED, {});
}
mxPropertySet->setPropertyValue( SC_UNONAME_WRITING, aVal );
}
catch (const uno::Exception& )
{
DebugHelper::basicexception(ERRCODE_BASIC_METHOD_FAILED, OUString());
DebugHelper::basicexception(ERRCODE_BASIC_METHOD_FAILED, {});
}
}
@ -720,7 +720,7 @@ ScVbaFormat< Ifc... >::getReadingOrder( )
}
catch (const uno::Exception& )
{
DebugHelper::basicexception(ERRCODE_BASIC_NOT_IMPLEMENTED, OUString());
DebugHelper::basicexception(ERRCODE_BASIC_NOT_IMPLEMENTED, {});
}
return NRetReadingOrder;
@ -748,7 +748,7 @@ ScVbaFormat< Ifc... >::getNumberFormat( )
}
catch (const uno::Exception& )
{
DebugHelper::basicexception(ERRCODE_BASIC_METHOD_FAILED, OUString());
DebugHelper::basicexception(ERRCODE_BASIC_METHOD_FAILED, {});
}
return aFormat;
}
@ -765,7 +765,7 @@ ScVbaFormat< Ifc... >::isAmbiguous(const OUString& _sPropertyName)
}
catch (const uno::Exception& )
{
DebugHelper::basicexception(ERRCODE_BASIC_METHOD_FAILED, OUString());
DebugHelper::basicexception(ERRCODE_BASIC_METHOD_FAILED, {});
}
return bResult;
}

View File

@ -31,7 +31,7 @@ lcl_getScVbaFormatConditionsPtr( const uno::Reference< excel::XFormatConditions
{
ScVbaFormatConditions* pFormatConditions = static_cast< ScVbaFormatConditions* >( xFormatConditions.get() );
if ( !pFormatConditions )
DebugHelper::basicexception(ERRCODE_BASIC_METHOD_FAILED, OUString() );
DebugHelper::basicexception(ERRCODE_BASIC_METHOD_FAILED, {} );
return pFormatConditions;
}
@ -69,7 +69,7 @@ ScVbaFormatCondition::Modify( ::sal_Int32 _nType, const uno::Any& _aOperator, co
}
catch (const uno::Exception&)
{
DebugHelper::basicexception(ERRCODE_BASIC_METHOD_FAILED, OUString() );
DebugHelper::basicexception(ERRCODE_BASIC_METHOD_FAILED, {} );
}
}
@ -103,7 +103,7 @@ ScVbaFormatCondition::retrieveAPIType(sal_Int32 _nVBAType, const uno::Reference<
aAPIType = sheet::ConditionOperator_NONE;
break;
default:
DebugHelper::basicexception(ERRCODE_BASIC_METHOD_FAILED, OUString() );
DebugHelper::basicexception(ERRCODE_BASIC_METHOD_FAILED, {} );
}
return aAPIType;
}
@ -134,7 +134,7 @@ ScVbaFormatCondition::notifyRange()
}
catch (uno::Exception& )
{
DebugHelper::basicexception(ERRCODE_BASIC_METHOD_FAILED, OUString() );
DebugHelper::basicexception(ERRCODE_BASIC_METHOD_FAILED, {} );
}
}

View File

@ -38,7 +38,7 @@ ScVbaFormatConditions::Delete( )
{
ScVbaStyles* pStyles = static_cast< ScVbaStyles* >( mxStyles.get() );
if ( !pStyles )
DebugHelper::basicexception(ERRCODE_BASIC_METHOD_FAILED, OUString() );
DebugHelper::basicexception(ERRCODE_BASIC_METHOD_FAILED, {} );
sal_Int32 nCount = mxSheetConditionalEntries->getCount();
for (sal_Int32 i = nCount - 1; i >= 0; i--)
{
@ -50,7 +50,7 @@ ScVbaFormatConditions::Delete( )
}
catch (uno::Exception& )
{
DebugHelper::basicexception(ERRCODE_BASIC_METHOD_FAILED, OUString());
DebugHelper::basicexception(ERRCODE_BASIC_METHOD_FAILED, {});
}
}
@ -198,7 +198,7 @@ ScVbaFormatConditions::Add( ::sal_Int32 _nType, const uno::Any& _aOperator, cons
catch (uno::Exception& )
{
}
DebugHelper::basicexception(ERRCODE_BASIC_METHOD_FAILED, OUString() );
DebugHelper::basicexception(ERRCODE_BASIC_METHOD_FAILED, {} );
return xFormatCondition;
}
@ -217,7 +217,7 @@ ScVbaFormatConditions::notifyRange()
}
catch (uno::Exception& )
{
DebugHelper::basicexception(ERRCODE_BASIC_METHOD_FAILED, OUString());
DebugHelper::basicexception(ERRCODE_BASIC_METHOD_FAILED, {});
}
}
@ -227,7 +227,7 @@ ScVbaFormatConditions::getA1Formula(const css::uno::Any& _aFormula)
// #TODO, #FIXME hook-in proper formula conversion detection & logic
OUString sFormula;
if ( !( _aFormula >>= sFormula ) )
DebugHelper::basicexception(ERRCODE_BASIC_BAD_PARAMETER, OUString() );
DebugHelper::basicexception(ERRCODE_BASIC_BAD_PARAMETER, {} );
return sFormula;
}
@ -236,7 +236,7 @@ ScVbaFormatConditions::getStyleName()
{
ScVbaStyles* pStyles = static_cast< ScVbaStyles* >( mxStyles.get() );
if ( !pStyles )
DebugHelper::basicexception(ERRCODE_BASIC_METHOD_FAILED, OUString() );
DebugHelper::basicexception(ERRCODE_BASIC_METHOD_FAILED, {} );
uno::Sequence< OUString > sCellStyleNames = pStyles->getStyleNames();
return ContainerUtilities::getUniqueName(sCellStyleNames, "Excel_CondFormat", "_");
}
@ -257,7 +257,7 @@ ScVbaFormatConditions::removeFormatCondition( const OUString& _sStyleName, bool
{
ScVbaStyles* pStyles = static_cast< ScVbaStyles* >( mxStyles.get() );
if ( !pStyles )
DebugHelper::basicexception(ERRCODE_BASIC_METHOD_FAILED, OUString());
DebugHelper::basicexception(ERRCODE_BASIC_METHOD_FAILED, {});
pStyles->Delete( _sStyleName );
}
return;
@ -266,7 +266,7 @@ ScVbaFormatConditions::removeFormatCondition( const OUString& _sStyleName, bool
}
catch (const uno::Exception&)
{
DebugHelper::basicexception(ERRCODE_BASIC_METHOD_FAILED, OUString());
DebugHelper::basicexception(ERRCODE_BASIC_METHOD_FAILED, {});
}
}

View File

@ -173,7 +173,7 @@ uno::Any RangePageBreaks::Add( const css::uno::Any& Before )
Before >>= xRange;
if( !xRange.is() )
{
DebugHelper::basicexception(ERRCODE_BASIC_BAD_ARGUMENT, OUString());
DebugHelper::basicexception(ERRCODE_BASIC_BAD_ARGUMENT, {});
}
sal_Int32 nAPIRowColIndex = getAPIStartofRange( xRange );

View File

@ -4723,7 +4723,7 @@ ScVbaRange::Autofit()
// if the range is a not a row or column range autofit will
// throw an error
if ( !( mbIsColumns || mbIsRows ) )
DebugHelper::basicexception(ERRCODE_BASIC_METHOD_FAILED, OUString());
DebugHelper::basicexception(ERRCODE_BASIC_METHOD_FAILED, {});
ScDocShell* pDocShell = getDocShellFromRange( mxRange );
if ( !pDocShell )
return;
@ -5150,7 +5150,7 @@ ScVbaRange::Item( const uno::Any& row, const uno::Any& column )
if ( mbIsRows || mbIsColumns )
{
if ( column.hasValue() )
DebugHelper::basicexception(ERRCODE_BASIC_BAD_PARAMETER, OUString() );
DebugHelper::basicexception(ERRCODE_BASIC_BAD_PARAMETER, {} );
uno::Reference< excel::XRange > xRange;
if ( mbIsColumns )
xRange = Columns( row );
@ -5182,7 +5182,7 @@ ScVbaRange::AutoOutline( )
xSheetOutline->autoOutline( thisAddress );
}
else
DebugHelper::basicexception(ERRCODE_BASIC_METHOD_FAILED, OUString());
DebugHelper::basicexception(ERRCODE_BASIC_METHOD_FAILED, {});
}
void SAL_CALL
@ -5373,13 +5373,13 @@ ScVbaRange::SpecialCells( const uno::Any& _oType, const uno::Any& _oValue)
uno::Reference< excel::XRange > xUsedRange( getWorksheet()->getUsedRange() );
sal_Int32 nType = 0;
if ( !( _oType >>= nType ) )
DebugHelper::basicexception(ERRCODE_BASIC_BAD_PARAMETER, OUString() );
DebugHelper::basicexception(ERRCODE_BASIC_BAD_PARAMETER, {} );
switch(nType)
{
case excel::XlCellType::xlCellTypeSameFormatConditions:
case excel::XlCellType::xlCellTypeAllValidation:
case excel::XlCellType::xlCellTypeSameValidation:
DebugHelper::basicexception(ERRCODE_BASIC_NOT_IMPLEMENTED, OUString());
DebugHelper::basicexception(ERRCODE_BASIC_NOT_IMPLEMENTED, {});
break;
case excel::XlCellType::xlCellTypeBlanks:
case excel::XlCellType::xlCellTypeComments:
@ -5435,11 +5435,11 @@ ScVbaRange::SpecialCells( const uno::Any& _oType, const uno::Any& _oValue)
break;
}
default:
DebugHelper::basicexception(ERRCODE_BASIC_BAD_PARAMETER, OUString() );
DebugHelper::basicexception(ERRCODE_BASIC_BAD_PARAMETER, {} );
break;
}
if ( !pRangeToUse )
DebugHelper::basicexception(ERRCODE_BASIC_METHOD_FAILED, OUString() );
DebugHelper::basicexception(ERRCODE_BASIC_METHOD_FAILED, {} );
return pRangeToUse->SpecialCellsImpl( nType, _oValue );
}
@ -5466,7 +5466,7 @@ static sal_Int32 lcl_getFormulaResultFlags(const uno::Any& aType)
nRes = sheet::FormulaResult::STRING;
break;
default:
DebugHelper::basicexception(ERRCODE_BASIC_BAD_PARAMETER, OUString() );
DebugHelper::basicexception(ERRCODE_BASIC_BAD_PARAMETER, {} );
}
return nRes;
}
@ -5487,7 +5487,7 @@ ScVbaRange::SpecialCellsImpl( sal_Int32 nType, const uno::Any& _oValue)
case excel::XlCellType::xlCellTypeSameValidation:
// Shouldn't get here ( should be filtered out by
// ScVbaRange::SpecialCells()
DebugHelper::basicexception(ERRCODE_BASIC_NOT_IMPLEMENTED, OUString());
DebugHelper::basicexception(ERRCODE_BASIC_NOT_IMPLEMENTED, {});
break;
case excel::XlCellType::xlCellTypeBlanks:
xLocSheetCellRanges = xQuery->queryEmptyCells();
@ -5511,7 +5511,7 @@ ScVbaRange::SpecialCellsImpl( sal_Int32 nType, const uno::Any& _oValue)
xLocSheetCellRanges = xQuery->queryVisibleCells();
break;
default:
DebugHelper::basicexception(ERRCODE_BASIC_BAD_PARAMETER, OUString() );
DebugHelper::basicexception(ERRCODE_BASIC_BAD_PARAMETER, {} );
break;
}
if (xLocSheetCellRanges.is())
@ -5591,7 +5591,7 @@ ScVbaRange::Subtotal( ::sal_Int32 _nGroupBy, ::sal_Int32 _nFunction, const uno::
aColumns[i].Function = sheet::GeneralFunction_VARP;
break;
default:
DebugHelper::basicexception(ERRCODE_BASIC_BAD_PARAMETER, OUString()) ;
DebugHelper::basicexception(ERRCODE_BASIC_BAD_PARAMETER, {}) ;
return;
}
}
@ -5600,7 +5600,7 @@ ScVbaRange::Subtotal( ::sal_Int32 _nGroupBy, ::sal_Int32 _nFunction, const uno::
}
catch (const uno::Exception&)
{
DebugHelper::basicexception(ERRCODE_BASIC_METHOD_FAILED, OUString());
DebugHelper::basicexception(ERRCODE_BASIC_METHOD_FAILED, {});
}
}

View File

@ -52,7 +52,7 @@ void ScVbaStyle::initialise()
uno::Reference< lang::XServiceInfo > xServiceInfo( mxPropertySet, uno::UNO_QUERY_THROW );
if ( !xServiceInfo->supportsService("com.sun.star.style.CellStyle") )
{
DebugHelper::basicexception(ERRCODE_BASIC_METHOD_FAILED, OUString() );
DebugHelper::basicexception(ERRCODE_BASIC_METHOD_FAILED, {} );
}
mxStyle.set( mxPropertySet, uno::UNO_QUERY_THROW );
@ -72,7 +72,7 @@ ScVbaStyle::ScVbaStyle( const uno::Reference< ov::XHelperInterface >& xParent,
}
catch (const uno::Exception& )
{
DebugHelper::basicexception(ERRCODE_BASIC_METHOD_FAILED, OUString());
DebugHelper::basicexception(ERRCODE_BASIC_METHOD_FAILED, {});
}
}
@ -88,7 +88,7 @@ ScVbaStyle::ScVbaStyle( const uno::Reference< XHelperInterface >& xParent,
}
catch (const uno::Exception& )
{
DebugHelper::basicexception(ERRCODE_BASIC_METHOD_FAILED, OUString());
DebugHelper::basicexception(ERRCODE_BASIC_METHOD_FAILED, {});
}
}
@ -133,7 +133,7 @@ ScVbaStyle::getNameLocal()
}
catch (const uno::Exception& )
{
DebugHelper::basicexception(ERRCODE_BASIC_METHOD_FAILED, OUString() );
DebugHelper::basicexception(ERRCODE_BASIC_METHOD_FAILED, {} );
}
return sName;
}
@ -147,20 +147,20 @@ ScVbaStyle::Delete()
}
catch (const uno::Exception& )
{
DebugHelper::basicexception(ERRCODE_BASIC_METHOD_FAILED, OUString());
DebugHelper::basicexception(ERRCODE_BASIC_METHOD_FAILED, {});
}
}
void SAL_CALL
ScVbaStyle::setMergeCells( const uno::Any& /*MergeCells*/ )
{
DebugHelper::basicexception(ERRCODE_BASIC_NOT_IMPLEMENTED, OUString());
DebugHelper::basicexception(ERRCODE_BASIC_NOT_IMPLEMENTED, {});
}
uno::Any SAL_CALL
ScVbaStyle::getMergeCells( )
{
DebugHelper::basicexception(ERRCODE_BASIC_NOT_IMPLEMENTED, OUString());
DebugHelper::basicexception(ERRCODE_BASIC_NOT_IMPLEMENTED, {});
return uno::Any();
}

View File

@ -50,7 +50,7 @@ ScVbaStyles::ScVbaStyles( const uno::Reference< XHelperInterface >& xParent,
}
catch (uno::Exception& )
{
DebugHelper::basicexception(ERRCODE_BASIC_METHOD_FAILED, OUString());
DebugHelper::basicexception(ERRCODE_BASIC_METHOD_FAILED, {});
}
}
@ -143,7 +143,7 @@ ScVbaStyles::Add( const OUString& _sName, const uno::Any& _aBasedOn )
}
else
{
DebugHelper::basicexception(ERRCODE_BASIC_BAD_ARGUMENT, OUString());
DebugHelper::basicexception(ERRCODE_BASIC_BAD_ARGUMENT, {});
}
}
@ -161,7 +161,7 @@ ScVbaStyles::Add( const OUString& _sName, const uno::Any& _aBasedOn )
}
catch (const uno::Exception&)
{
DebugHelper::basicexception(ERRCODE_BASIC_METHOD_FAILED, OUString());
DebugHelper::basicexception(ERRCODE_BASIC_METHOD_FAILED, {});
}
return aRet;
}
@ -176,7 +176,7 @@ ScVbaStyles::Delete(const OUString& _sStyleName)
}
catch (const uno::Exception&)
{
DebugHelper::basicexception(ERRCODE_BASIC_METHOD_FAILED, OUString());
DebugHelper::basicexception(ERRCODE_BASIC_METHOD_FAILED, {});
}
}

View File

@ -3959,7 +3959,7 @@ void SwHTMLParser::NewPara()
// parse styles (Don't consider class. This is only possible as long as none of
// the CSS1 properties of the class must be formatted hard!!!)
if (HasStyleOptions(aStyle, aId, OUString(), &aLang, &aDir))
if (HasStyleOptions(aStyle, aId, {}, &aLang, &aDir))
{
SfxItemSet aItemSet( m_xDoc->GetAttrPool(), m_pCSS1Parser->GetWhichMap() );
SvxCSS1PropertyInfo aPropInfo;
@ -4093,7 +4093,7 @@ void SwHTMLParser::NewHeading( HtmlTokenId nToken )
std::unique_ptr<HTMLAttrContext> xCntxt(new HTMLAttrContext(nToken, nTextColl, aClass));
// parse styles (regarding class see also NewPara)
if (HasStyleOptions(aStyle, aId, OUString(), &aLang, &aDir))
if (HasStyleOptions(aStyle, aId, {}, &aLang, &aDir))
{
SfxItemSet aItemSet( m_xDoc->GetAttrPool(), m_pCSS1Parser->GetWhichMap() );
SvxCSS1PropertyInfo aPropInfo;
@ -4229,7 +4229,7 @@ void SwHTMLParser::NewTextFormatColl( HtmlTokenId nToken, sal_uInt16 nColl )
std::unique_ptr<HTMLAttrContext> xCntxt(new HTMLAttrContext(nToken, nColl, aClass));
// parse styles (regarding class see also NewPara)
if (HasStyleOptions(aStyle, aId, OUString(), &aLang, &aDir))
if (HasStyleOptions(aStyle, aId, {}, &aLang, &aDir))
{
SfxItemSet aItemSet( m_xDoc->GetAttrPool(), m_pCSS1Parser->GetWhichMap() );
SvxCSS1PropertyInfo aPropInfo;
@ -4833,7 +4833,7 @@ void SwHTMLParser::NewCharFormat( HtmlTokenId nToken )
OSL_ENSURE( pCFormat, "No character format found for token" );
// parse styles (regarding class see also NewPara)
if (HasStyleOptions(aStyle, aId, OUString(), &aLang, &aDir))
if (HasStyleOptions(aStyle, aId, {}, &aLang, &aDir))
{
SfxItemSet aItemSet( m_xDoc->GetAttrPool(), m_pCSS1Parser->GetWhichMap() );
SvxCSS1PropertyInfo aPropInfo;

View File

@ -163,7 +163,7 @@ SwVbaDocument::Range( const uno::Any& rStart, const uno::Any& rEnd )
}
catch(const uno::Exception&)
{
DebugHelper::basicexception(ERRCODE_BASIC_METHOD_FAILED, OUString());
DebugHelper::basicexception(ERRCODE_BASIC_METHOD_FAILED, {});
}
}
return uno::Reference< word::XRange >( new SwVbaRange( this, mxContext, mxTextDocument, xStart, xEnd ) );

View File

@ -366,7 +366,7 @@ uno::Reference< text::XTextField > SwVbaFields::Create_Field_FileName( const OUS
aReadParam.SkipToNextToken();
break;
default:
DebugHelper::basicexception(ERRCODE_BASIC_BAD_ARGUMENT, OUString());
DebugHelper::basicexception(ERRCODE_BASIC_BAD_ARGUMENT, {});
break;
}
}

View File

@ -82,7 +82,7 @@ SwVbaOptions::DefaultFilePath( sal_Int32 _path )
}
default:
{
DebugHelper::basicexception( ERRCODE_BASIC_NOT_IMPLEMENTED, OUString() );
DebugHelper::basicexception( ERRCODE_BASIC_NOT_IMPLEMENTED, {} );
break;
}
}

View File

@ -540,7 +540,7 @@ sal_Int32 SwVbaParagraphFormat::getMSWordAlignment( style::ParagraphAdjust _alig
}
default:
{
DebugHelper::basicexception( ERRCODE_BASIC_BAD_PARAMETER, OUString() );
DebugHelper::basicexception( ERRCODE_BASIC_BAD_PARAMETER, {} );
}
}
return wdAlignment;

View File

@ -190,10 +190,10 @@ void SAL_CALL SwVbaRange::InsertBreak(const uno::Any& _breakType)
case word::WdBreakType::wdSectionBreakNextPage:
case word::WdBreakType::wdSectionBreakOddPage:
case word::WdBreakType::wdTextWrappingBreak:
DebugHelper::basicexception( ERRCODE_BASIC_NOT_IMPLEMENTED, OUString() );
DebugHelper::basicexception( ERRCODE_BASIC_NOT_IMPLEMENTED, {} );
break;
default:
DebugHelper::basicexception( ERRCODE_BASIC_BAD_PARAMETER, OUString() );
DebugHelper::basicexception( ERRCODE_BASIC_BAD_PARAMETER, {} );
}
if( eBreakType != style::BreakType_NONE )

View File

@ -243,7 +243,7 @@ SwVbaSelection::Move( const uno::Any& _unit, const uno::Any& _count, const uno::
{
if( nExtend == word::WdMovementType::wdExtend )
{
DebugHelper::basicexception(ERRCODE_BASIC_BAD_ARGUMENT, OUString());
DebugHelper::basicexception(ERRCODE_BASIC_BAD_ARGUMENT, {});
return;
}
NextCell( nCount, eDirection );
@ -352,7 +352,7 @@ void SwVbaSelection::NextCell(sal_Int32 nCount, word::E_DIRECTION eDirection)
xCursorProps->getPropertyValue("Cell") >>= xCell;
if( !xTextTable.is() || !xCell.is() )
{
DebugHelper::basicexception(ERRCODE_BASIC_BAD_ARGUMENT, OUString());
DebugHelper::basicexception(ERRCODE_BASIC_BAD_ARGUMENT, {});
return;
}
uno::Reference< beans::XPropertySet > xCellProps( xCell, uno::UNO_QUERY_THROW );
@ -384,7 +384,7 @@ void SwVbaSelection::NextCell(sal_Int32 nCount, word::E_DIRECTION eDirection)
}
default:
{
DebugHelper::basicexception(ERRCODE_BASIC_BAD_ARGUMENT, OUString());
DebugHelper::basicexception(ERRCODE_BASIC_BAD_ARGUMENT, {});
return;
}
}
@ -550,7 +550,7 @@ uno::Reference< word::XRange > SAL_CALL SwVbaSelection::GoTo( const uno::Any& _w
{
sal_Int32 nWhat = 0;
if( !( _what >>= nWhat ) )
DebugHelper::basicexception(ERRCODE_BASIC_BAD_ARGUMENT, OUString());
DebugHelper::basicexception(ERRCODE_BASIC_BAD_ARGUMENT, {});
switch( nWhat )
{
case word::WdGoToItem::wdGoToBookmark:

View File

@ -336,7 +336,7 @@ SwVbaStyles::Item( const uno::Any& Index1, const uno::Any& Index2 )
break;
}
default:
DebugHelper::basicexception( ERRCODE_BASIC_INTERNAL_ERROR, OUString() );
DebugHelper::basicexception( ERRCODE_BASIC_INTERNAL_ERROR, {} );
}
uno::Reference< style::XStyleFamiliesSupplier > xStyleSupplier( mxModel, uno::UNO_QUERY_THROW);
uno::Reference< container::XNameAccess > xStylesAccess( xStyleSupplier->getStyleFamilies()->getByName( aStyleType ), uno::UNO_QUERY_THROW );

View File

@ -149,7 +149,7 @@ uno::Reference< word::XTabStop > SAL_CALL SwVbaTabStops::Add( float Position, co
case word::WdTabAlignment::wdAlignTabBar:
case word::WdTabAlignment::wdAlignTabList:
{
DebugHelper::basicexception( ERRCODE_BASIC_NOT_IMPLEMENTED, OUString() );
DebugHelper::basicexception( ERRCODE_BASIC_NOT_IMPLEMENTED, {} );
break;
}
default:

View File

@ -313,7 +313,7 @@ uno::Reference< text::XTextRange > SwVbaView::getHFTextRange( sal_Int32 nType )
while( hasNextPage && ( xStyle == word::getCurrentPageStyle( mxModel ) ) );
if( !hasNextPage )
DebugHelper::basicexception( ERRCODE_BASIC_BAD_ACTION, OUString() );
DebugHelper::basicexception( ERRCODE_BASIC_BAD_ACTION, {} );
}
break;
}
@ -353,7 +353,7 @@ uno::Reference< text::XTextRange > SwVbaView::getHFTextRange( sal_Int32 nType )
if( nType == word::WdSeekView::wdSeekEvenPagesFooter
|| nType == word::WdSeekView::wdSeekEvenPagesHeader )
{
DebugHelper::basicexception( ERRCODE_BASIC_BAD_ACTION, OUString() );
DebugHelper::basicexception( ERRCODE_BASIC_BAD_ACTION, {} );
}
xText.set( xPageProps->getPropertyValue( aPropText ), uno::UNO_QUERY_THROW );
}
@ -361,7 +361,7 @@ uno::Reference< text::XTextRange > SwVbaView::getHFTextRange( sal_Int32 nType )
mxModel->unlockControllers();
if( !xText.is() )
{
DebugHelper::basicexception( ERRCODE_BASIC_INTERNAL_ERROR, OUString() );
DebugHelper::basicexception( ERRCODE_BASIC_INTERNAL_ERROR, {} );
}
uno::Reference< text::XTextRange > xTextRange = word::getFirstObjectPosition( xText );
return xTextRange;

View File

@ -1033,7 +1033,7 @@ void DebugHelper::basicexception( ErrCode err, std::u16string_view additionalAr
void DebugHelper::basicexception( const css::uno::Exception& ex )
{
basicexception( ex, ERRCODE_BASIC_INTERNAL_ERROR, OUString() );
basicexception( ex, ERRCODE_BASIC_INTERNAL_ERROR, {} );
}
void DebugHelper::runtimeexception( ErrCode err )