Kaydet (Commit) 0e335af4 authored tarafından Stephan Bergmann's avatar Stephan Bergmann

Fix uses of variables before their lifetimes begin

All of those have been broken with recent loplugin:sequentialassign changes (and
have been found with a new plugin to be commited).

The code in SbUnoClass::Find (basic/source/classes/sbunoobj.cxx) looks
suspicious, but has been effectively like that ever since at least
c25ec060 "initial import", so just marked it
with a TODO comment for now.

Change-Id: I0d691cb55ef317cf2b16b0490169de7ec97375cf
Reviewed-on: https://gerrit.libreoffice.org/70874
Tested-by: Jenkins
Reviewed-by: 's avatarStephan Bergmann <sbergman@redhat.com>
üst aba66a99
...@@ -3328,7 +3328,7 @@ SbxVariable* SbUnoClass::Find( const OUString& rName, SbxClassType ) ...@@ -3328,7 +3328,7 @@ SbxVariable* SbUnoClass::Find( const OUString& rName, SbxClassType )
{ {
try try
{ {
Any aAny = xField->get( aAny ); Any aAny = xField->get( {} ); //TODO: does this make sense?
// Convert to Sbx // Convert to Sbx
pRes = new SbxVariable( SbxVARIANT ); pRes = new SbxVariable( SbxVARIANT );
......
...@@ -255,7 +255,7 @@ void ChartController::executeDispatch_Paste() ...@@ -255,7 +255,7 @@ void ChartController::executeDispatch_Paste()
{ {
Graphic aGraphic; Graphic aGraphic;
// paste location: center of window // paste location: center of window
Point aPos = pChartWindow->PixelToLogic( tools::Rectangle( aPos, pChartWindow->GetSizePixel()).Center()); Point aPos = pChartWindow->PixelToLogic( tools::Rectangle( {}, pChartWindow->GetSizePixel()).Center());
// handle different formats // handle different formats
TransferableDataHelper aDataHelper( TransferableDataHelper::CreateFromSystemClipboard( pChartWindow )); TransferableDataHelper aDataHelper( TransferableDataHelper::CreateFromSystemClipboard( pChartWindow ));
......
...@@ -1054,7 +1054,7 @@ void UnoFrameControl::ImplSetPosSize( Reference< XControl >& rxCtrl ) ...@@ -1054,7 +1054,7 @@ void UnoFrameControl::ImplSetPosSize( Reference< XControl >& rxCtrl )
if ( pOutDev ) if ( pOutDev )
{ {
// Adjust Y based on height of Title // Adjust Y based on height of Title
::tools::Rectangle aRect = pOutDev->GetTextRect( aRect, sTitle ); ::tools::Rectangle aRect = pOutDev->GetTextRect( {}, sTitle );
nY = nY + ( aRect.GetHeight() / 2 ); nY = nY + ( aRect.GetHeight() / 2 );
} }
else else
......
...@@ -449,7 +449,7 @@ void B3dCamera::CalcFocalLength() ...@@ -449,7 +449,7 @@ void B3dCamera::CalcFocalLength()
double fWidth = GetDeviceRectangleWidth(); double fWidth = GetDeviceRectangleWidth();
// Adjust focal length based on given position // Adjust focal length based on given position
basegfx::B3DPoint aOldPosition = WorldToEyeCoor(aOldPosition); basegfx::B3DPoint aOldPosition = WorldToEyeCoor({});
if(fWidth != 0.0) if(fWidth != 0.0)
fFocalLength = aOldPosition.getZ() / fWidth * 35.0; fFocalLength = aOldPosition.getZ() / fWidth * 35.0;
if(fFocalLength < 5.0) if(fFocalLength < 5.0)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment