loplugin:checkunusedparams in toolkit..vbahelper

the extra argument on the runtimeexception method was only ever passed
an "OUString()"

Change-Id: I0ea19ae9328760918f1267f27ba103432fff0b47
Reviewed-on: https://gerrit.libreoffice.org/37274
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
This commit is contained in:
Noel Grandin 2017-05-05 09:04:23 +02:00
parent 9ffba2ea6c
commit e3a44cbb1d
26 changed files with 48 additions and 50 deletions

View file

@ -81,7 +81,7 @@ namespace toolkit
void MakeRMItemValidation( sal_Int32 Index, const css::uno::Reference< XInterface >& xRoadmapItem );
css::container::ContainerEvent GetContainerEvent(sal_Int32 Index, const css::uno::Reference< XInterface >& );
void SetRMItemDefaultProperties( const sal_Int32 Index, const css::uno::Reference< XInterface >& );
void SetRMItemDefaultProperties( const css::uno::Reference< XInterface >& );
static sal_Int16 GetCurrentItemID( const css::uno::Reference< css::beans::XPropertySet >& xPropertySet );
sal_Int32 GetUniqueID();

View file

@ -271,7 +271,7 @@ public:
static void basicexception( const css::uno::Exception& ex );
/// @throws css::script::BasicErrorException
static void runtimeexception( int err, const OUString& additionalArgument );
static void runtimeexception( int err );
};
} // vba

View file

@ -72,7 +72,7 @@ protected:
/// @throws css::uno::RuntimeException
css::uno::Any AddEllipse( sal_Int32 startX, sal_Int32 startY, sal_Int32 nLineWidth, sal_Int32 nLineHeight, const css::uno::Any& rRange );
/// @throws css::uno::RuntimeException
css::uno::Any AddTextboxInWriter( sal_Int32 _nOrientation, sal_Int32 _nLeft, sal_Int32 _nTop, sal_Int32 _nWidth, sal_Int32 _nHeight );
css::uno::Any AddTextboxInWriter( sal_Int32 _nLeft, sal_Int32 _nTop, sal_Int32 _nWidth, sal_Int32 _nHeight );
OUString createName( const OUString& sName );
//TODO helperapi using a writer document
//css::awt::Point calculateTopLeftMargin( css::uno::Reference< ov::XHelperInterface > xDocument );

View file

@ -878,7 +878,7 @@ OUString ScVbaApplication::getOfficePath( const OUString& _sPathType )
}
catch (const uno::Exception&)
{
DebugHelper::runtimeexception(ERRCODE_BASIC_METHOD_FAILED, OUString());
DebugHelper::runtimeexception(ERRCODE_BASIC_METHOD_FAILED);
}
return sRetPath;
}

View file

@ -72,11 +72,11 @@ ScVbaAxes::createAxis( const uno::Reference< excel::XChart >& xChart, const uno:
if (((nType == xlCategory) || (nType == xlSeriesAxis) || (nType == xlValue)))
{
if ((nAxisGroup != xlPrimary) && (nAxisGroup != xlSecondary))
DebugHelper::runtimeexception(ERRCODE_BASIC_METHOD_FAILED, OUString());
DebugHelper::runtimeexception(ERRCODE_BASIC_METHOD_FAILED);
xAxisPropertySet.set( pChart->getAxisPropertySet(nType, nAxisGroup), uno::UNO_QUERY_THROW );
}
else
DebugHelper::runtimeexception(ERRCODE_BASIC_METHOD_FAILED, OUString());
DebugHelper::runtimeexception(ERRCODE_BASIC_METHOD_FAILED);
uno::Reference< XHelperInterface > xParent( xChart, uno::UNO_QUERY_THROW );
return new ScVbaAxis( xParent, xContext, xAxisPropertySet, nType, nAxisGroup);
}

View file

@ -57,7 +57,7 @@ void ScVbaPageBreak< Ifc... >::setType(sal_Int32 type)
(type != excel::XlPageBreak::xlPageBreakManual) &&
(type != excel::XlPageBreak::xlPageBreakAutomatic) )
{
DebugHelper::runtimeexception(ERRCODE_BASIC_BAD_PARAMETER, OUString() );
DebugHelper::runtimeexception(ERRCODE_BASIC_BAD_PARAMETER);
}
if( type == excel::XlPageBreak::xlPageBreakNone )

View file

@ -157,7 +157,7 @@ sheet::TablePageBreakData RangePageBreaks::getTablePageBreakData( sal_Int32 nAPI
aTablePageBreakData = aTablePageBreakDataList[i];
sal_Int32 nPos = aTablePageBreakData.Position;
if( nPos > nUsedEnd + 1 )
DebugHelper::runtimeexception(ERRCODE_BASIC_METHOD_FAILED, OUString());
DebugHelper::runtimeexception(ERRCODE_BASIC_METHOD_FAILED);
index++;
if( index == nAPIItemIndex )
return aTablePageBreakData;

View file

@ -198,7 +198,7 @@ void SAL_CALL ScVbaPageSetup::setZoom( const uno::Any& zoom)
zoom >>= aValue;
if( aValue )
{
DebugHelper::runtimeexception(ERRCODE_BASIC_BAD_PARAMETER, OUString() );
DebugHelper::runtimeexception(ERRCODE_BASIC_BAD_PARAMETER);
}
}
else
@ -206,7 +206,7 @@ void SAL_CALL ScVbaPageSetup::setZoom( const uno::Any& zoom)
zoom >>= pageScale;
if(( pageScale < ZOOM_IN )||( pageScale > ZOOM_MAX ))
{
DebugHelper::runtimeexception(ERRCODE_BASIC_BAD_PARAMETER, OUString() );
DebugHelper::runtimeexception(ERRCODE_BASIC_BAD_PARAMETER);
}
}
@ -220,7 +220,7 @@ void SAL_CALL ScVbaPageSetup::setZoom( const uno::Any& zoom)
{
if( pageScale == 0 )
{
DebugHelper::runtimeexception(ERRCODE_BASIC_BAD_PARAMETER, OUString() );
DebugHelper::runtimeexception(ERRCODE_BASIC_BAD_PARAMETER);
}
}
catch (const uno::Exception&)
@ -476,7 +476,7 @@ void SAL_CALL ScVbaPageSetup::setOrder(sal_Int32 order)
bOrder = false;
break;
default:
DebugHelper::runtimeexception(ERRCODE_BASIC_BAD_PARAMETER, OUString() );
DebugHelper::runtimeexception(ERRCODE_BASIC_BAD_PARAMETER);
}
try

View file

@ -808,7 +808,7 @@ ScVbaWindow::setView( const uno::Any& _view)
nSlot = FID_PAGEBREAKMODE;
break;
default:
DebugHelper::runtimeexception(ERRCODE_BASIC_BAD_PARAMETER, OUString() );
DebugHelper::runtimeexception(ERRCODE_BASIC_BAD_PARAMETER);
}
// !! TODO !! get view shell from controller
ScTabViewShell* pViewShell = excel::getBestViewShell( m_xModel );

View file

@ -372,7 +372,7 @@ ScVbaWorksheet::setEnableSelection( sal_Int32 nSelection )
(nSelection != excel::XlEnableSelection::xlUnlockedCells) &&
(nSelection != excel::XlEnableSelection::xlNoSelection) )
{
DebugHelper::runtimeexception(ERRCODE_BASIC_BAD_PARAMETER, OUString() );
DebugHelper::runtimeexception(ERRCODE_BASIC_BAD_PARAMETER);
}
uno::Reference <sheet::XSpreadsheetDocument> xSpreadDoc( getModel(), uno::UNO_QUERY_THROW );

View file

@ -87,7 +87,7 @@ void SAL_CALL SwVbaParagraphFormat::setKeepTogether( const uno::Any& _keeptogeth
}
else
{
DebugHelper::runtimeexception( ERRCODE_BASIC_BAD_PARAMETER, OUString() );
DebugHelper::runtimeexception( ERRCODE_BASIC_BAD_PARAMETER );
}
}
@ -107,7 +107,7 @@ void SAL_CALL SwVbaParagraphFormat::setKeepWithNext( const uno::Any& _keepwithne
}
else
{
DebugHelper::runtimeexception( ERRCODE_BASIC_BAD_PARAMETER, OUString() );
DebugHelper::runtimeexception( ERRCODE_BASIC_BAD_PARAMETER );
}
}
@ -127,7 +127,7 @@ void SAL_CALL SwVbaParagraphFormat::setHyphenation( const uno::Any& _hyphenation
}
else
{
DebugHelper::runtimeexception( ERRCODE_BASIC_BAD_PARAMETER, OUString() );
DebugHelper::runtimeexception( ERRCODE_BASIC_BAD_PARAMETER );
}
}
@ -175,7 +175,7 @@ void SAL_CALL SwVbaParagraphFormat::setNoLineNumber( const uno::Any& _nolinenumb
}
else
{
DebugHelper::runtimeexception( ERRCODE_BASIC_BAD_PARAMETER, OUString() );
DebugHelper::runtimeexception( ERRCODE_BASIC_BAD_PARAMETER );
}
}
@ -234,7 +234,7 @@ void SAL_CALL SwVbaParagraphFormat::setPageBreakBefore( const uno::Any& _breakbe
}
else
{
DebugHelper::runtimeexception( ERRCODE_BASIC_BAD_PARAMETER, OUString() );
DebugHelper::runtimeexception( ERRCODE_BASIC_BAD_PARAMETER );
}
}
@ -325,7 +325,7 @@ void SAL_CALL SwVbaParagraphFormat::setWidowControl( const uno::Any& _widowcontr
}
else
{
DebugHelper::runtimeexception( ERRCODE_BASIC_BAD_PARAMETER, OUString() );
DebugHelper::runtimeexception( ERRCODE_BASIC_BAD_PARAMETER );
}
}
@ -403,7 +403,7 @@ style::LineSpacing SwVbaParagraphFormat::getOOoLineSpacingFromRule( sal_Int32 _l
}
default:
{
DebugHelper::runtimeexception( ERRCODE_BASIC_BAD_PARAMETER, OUString() );
DebugHelper::runtimeexception( ERRCODE_BASIC_BAD_PARAMETER );
break;
}
}
@ -468,7 +468,7 @@ sal_Int32 SwVbaParagraphFormat::getMSWordLineSpacingRule( style::LineSpacing& rL
}
default:
{
DebugHelper::runtimeexception( ERRCODE_BASIC_BAD_PARAMETER, OUString() );
DebugHelper::runtimeexception( ERRCODE_BASIC_BAD_PARAMETER );
}
}
return wdLineSpacing;
@ -508,7 +508,7 @@ style::ParagraphAdjust SwVbaParagraphFormat::getOOoAlignment( sal_Int32 _alignme
}
default:
{
DebugHelper::runtimeexception( ERRCODE_BASIC_BAD_PARAMETER, OUString() );
DebugHelper::runtimeexception( ERRCODE_BASIC_BAD_PARAMETER );
}
}
return nParaAjust;

View file

@ -270,7 +270,7 @@ void SwVbaRange::GetStyleInfo(OUString& aStyleName, OUString& aStyleType )
}
if( aStyleType.isEmpty() )
{
DebugHelper::runtimeexception( ERRCODE_BASIC_INTERNAL_ERROR, OUString() );
DebugHelper::runtimeexception( ERRCODE_BASIC_INTERNAL_ERROR );
}
}

View file

@ -223,7 +223,7 @@ void SAL_CALL SwVbaRows::SetLeftIndent( float LeftIndent, ::sal_Int32 RulerStyle
}
default:
{
DebugHelper::runtimeexception(ERRCODE_BASIC_BAD_ARGUMENT, OUString());
DebugHelper::runtimeexception(ERRCODE_BASIC_BAD_ARGUMENT);
}
}
}

View file

@ -149,7 +149,7 @@ SwVbaView::setSeekView( ::sal_Int32 _seekview )
}
else
{
DebugHelper::runtimeexception( ERRCODE_BASIC_NO_ACTIVE_OBJECT, OUString() );
DebugHelper::runtimeexception( ERRCODE_BASIC_NO_ACTIVE_OBJECT );
}
break;
}
@ -164,7 +164,7 @@ SwVbaView::setSeekView( ::sal_Int32 _seekview )
}
else
{
DebugHelper::runtimeexception( ERRCODE_BASIC_NO_ACTIVE_OBJECT, OUString() );
DebugHelper::runtimeexception( ERRCODE_BASIC_NO_ACTIVE_OBJECT );
}
break;
}
@ -236,7 +236,7 @@ SwVbaView::setType( ::sal_Int32 _type )
break;
}
default:
DebugHelper::runtimeexception( ERRCODE_BASIC_NOT_IMPLEMENTED, OUString() );
DebugHelper::runtimeexception( ERRCODE_BASIC_NOT_IMPLEMENTED );
}
}

View file

@ -79,7 +79,7 @@ void SwVbaWrapFormat::makeWrap()
}
default:
{
DebugHelper::runtimeexception(ERRCODE_BASIC_BAD_ARGUMENT, OUString());
DebugHelper::runtimeexception(ERRCODE_BASIC_BAD_ARGUMENT);
}
}
}

View file

@ -203,7 +203,7 @@ static void lcl_throwIndexOutOfBoundsException( )
}
void UnoControlRoadmapModel::SetRMItemDefaultProperties( const sal_Int32 , const Reference< XInterface >& xRoadmapItem)
void UnoControlRoadmapModel::SetRMItemDefaultProperties( const Reference< XInterface >& xRoadmapItem)
{
Reference< XPropertySet > xPropertySet( xRoadmapItem, UNO_QUERY );
Reference< XPropertySet > xProps( xRoadmapItem, UNO_QUERY );
@ -277,7 +277,7 @@ static void lcl_throwIndexOutOfBoundsException( )
Reference< XInterface > xRoadmapItem;
Element >>= xRoadmapItem;
MakeRMItemValidation( Index, xRoadmapItem);
SetRMItemDefaultProperties( Index, xRoadmapItem );
SetRMItemDefaultProperties( xRoadmapItem );
maRoadmapItems.insert( maRoadmapItems.begin() + Index, xRoadmapItem);
ContainerEvent aEvent = GetContainerEvent(Index, xRoadmapItem);
maContainerListeners.elementInserted( aEvent );
@ -326,7 +326,7 @@ static void lcl_throwIndexOutOfBoundsException( )
Reference< XInterface > xRoadmapItem;
Element >>= xRoadmapItem;
MakeRMItemValidation( Index, xRoadmapItem);
SetRMItemDefaultProperties( Index, xRoadmapItem );
SetRMItemDefaultProperties( xRoadmapItem );
maRoadmapItems.erase( maRoadmapItems.begin() + Index );
maRoadmapItems.insert( maRoadmapItems.begin() + Index, xRoadmapItem); //push_back( xRoadmapItem );
ContainerEvent aEvent = GetContainerEvent(Index, xRoadmapItem);

View file

@ -379,7 +379,7 @@ void SortedDynamicResultSet::impl_notify( const ListEvent& Changes )
// XEventListener
void SortedDynamicResultSet::impl_disposing( const EventObject& )
void SortedDynamicResultSet::impl_disposing()
{
mxListener.clear();
mxOriginal.clear();
@ -527,12 +527,12 @@ SortedDynamicResultSetListener::~SortedDynamicResultSetListener()
// XEventListener ( base of XDynamicResultSetListener )
void SAL_CALL
SortedDynamicResultSetListener::disposing( const EventObject& Source )
SortedDynamicResultSetListener::disposing( const EventObject& /*Source*/ )
{
osl::Guard< osl::Mutex > aGuard( maMutex );
if ( mpOwner )
mpOwner->impl_disposing( Source );
mpOwner->impl_disposing();
}

View file

@ -109,7 +109,7 @@ public:
// own methods:
/// @throws css::uno::RuntimeException
void impl_disposing( const css::lang::EventObject& Source );
void impl_disposing();
/// @throws css::uno::RuntimeException
void impl_notify( const css::ucb::ListEvent& Changes );

View file

@ -311,7 +311,7 @@ BaseContent::execute( const Command& aCommand,
if (aCommand.Name == "getPropertySetInfo") // No exceptions
{
aAny <<= getPropertySetInfo( CommandId );
aAny <<= getPropertySetInfo();
}
else if (aCommand.Name == "getCommandInfo") // no exceptions
{
@ -713,8 +713,7 @@ BaseContent::getCommandInfo()
Reference< beans::XPropertySetInfo > SAL_CALL
BaseContent::getPropertySetInfo(
sal_Int32 )
BaseContent::getPropertySetInfo()
{
if( m_nState & Deleted )
return Reference< beans::XPropertySetInfo >();

View file

@ -245,8 +245,7 @@ namespace fileaccess {
/// @throws css::uno::RuntimeException
css::uno::Reference< css::beans::XPropertySetInfo > SAL_CALL
getPropertySetInfo(
sal_Int32 nMyCommandIdentifier );
getPropertySetInfo();
/// @throws css::uno::RuntimeException
css::uno::Reference< css::sdbc::XRow > SAL_CALL

View file

@ -1169,7 +1169,7 @@ bool FTPDirectoryParser::parseUNIX_isYearTimeField (
return false;
rDateTime.SetYear(nNumber);
rDateTime.SetTime(0);
rDateTime.SetTime();
return true;
}

View file

@ -47,7 +47,7 @@ namespace ftp {
void SetMonth(sal_uInt16 month) { Month = month; }
void SetDay(sal_uInt16 day) { Day = day; }
// Only zero allowed and used for time-argument
void SetTime(sal_uInt16) { Hours = 0; Minutes = 0; Seconds = 0; NanoSeconds = 0; }
void SetTime() { Hours = 0; Minutes = 0; Seconds = 0; NanoSeconds = 0; }
void SetHour(sal_uInt16 hours) { Hours = hours; }
void SetMin(sal_uInt16 minutes) { Minutes = minutes; }
void SetSec(sal_uInt16 seconds) { Seconds = seconds; }

View file

@ -1061,7 +1061,7 @@ void DebugHelper::basicexception( const css::uno::Exception& ex )
basicexception( OUString(), ex, ERRCODE_BASIC_INTERNAL_ERROR, OUString() );
}
void DebugHelper::runtimeexception( int err, const OUString& /*additionalArgument*/ )
void DebugHelper::runtimeexception( int err )
{
// #TODO #FIXME ( do we want to support additionalArg here )
throw css::uno::RuntimeException( css::uno::Exception().Message + " " + OUString::number(err),

View file

@ -275,7 +275,7 @@ void SAL_CALL VbaPageSetupBase::setOrientation( sal_Int32 orientation )
if( ( orientation != mnOrientPortrait ) &&
( orientation != mnOrientLandscape ) )
{
DebugHelper::runtimeexception(ERRCODE_BASIC_BAD_PARAMETER, OUString() );
DebugHelper::runtimeexception(ERRCODE_BASIC_BAD_PARAMETER );
}
try

View file

@ -602,7 +602,7 @@ ScVbaShape::setRelativeHorizontalPosition(::sal_Int32 _relativehorizontalpositio
}
default:
{
DebugHelper::runtimeexception(ERRCODE_BASIC_BAD_ARGUMENT, OUString());
DebugHelper::runtimeexception(ERRCODE_BASIC_BAD_ARGUMENT);
}
}
m_xPropertySet->setPropertyValue( "HoriOrientRelation" , uno::makeAny( nType ) );
@ -673,7 +673,7 @@ ScVbaShape::setRelativeVerticalPosition(::sal_Int32 _relativeverticalposition)
}
default:
{
DebugHelper::runtimeexception(ERRCODE_BASIC_BAD_ARGUMENT, OUString());
DebugHelper::runtimeexception(ERRCODE_BASIC_BAD_ARGUMENT);
}
}
m_xPropertySet->setPropertyValue( "VertOrientRelation" , uno::makeAny( nType ) );

View file

@ -343,18 +343,18 @@ ScVbaShapes::AddShape( sal_Int32 _nType, sal_Int32 _nLeft, sal_Int32 _nTop, sal_
}
uno::Any SAL_CALL
ScVbaShapes::AddTextbox( sal_Int32 _nOrientation, sal_Int32 _nLeft, sal_Int32 _nTop, sal_Int32 _nWidth, sal_Int32 _nHeight )
ScVbaShapes::AddTextbox( sal_Int32 /*_nOrientation*/, sal_Int32 _nLeft, sal_Int32 _nTop, sal_Int32 _nWidth, sal_Int32 _nHeight )
{
uno::Reference< lang::XServiceInfo > xServiceInfo( m_xModel, uno::UNO_QUERY_THROW );
if( xServiceInfo->supportsService( "com.sun.star.text.TextDocument" ) )
{
return AddTextboxInWriter( _nOrientation, _nLeft, _nTop, _nWidth, _nHeight );
return AddTextboxInWriter( _nLeft, _nTop, _nWidth, _nHeight );
}
throw uno::RuntimeException( "Not implemented" );
}
uno::Any
ScVbaShapes::AddTextboxInWriter( sal_Int32 /*_nOrientation*/, sal_Int32 _nLeft, sal_Int32 _nTop, sal_Int32 _nWidth, sal_Int32 _nHeight )
ScVbaShapes::AddTextboxInWriter( sal_Int32 _nLeft, sal_Int32 _nTop, sal_Int32 _nWidth, sal_Int32 _nHeight )
{
OUString sCreateShapeName( "com.sun.star.drawing.TextShape" );
sal_Int32 nXPos = Millimeter::getInHundredthsOfOneMillimeter( _nLeft );