Kaydet (Commit) 587ac01f authored tarafından Noel Grandin's avatar Noel Grandin

loplugin:indentation in basctl..bridges

Change-Id: Ie4e27466c4258c6f774a3ebb82ec3a88c28fd753
Reviewed-on: https://gerrit.libreoffice.org/67525
Tested-by: Jenkins
Reviewed-by: 's avatarNoel Grandin <noel.grandin@collabora.co.uk>
üst bd824be5
......@@ -978,9 +978,9 @@ SbModule* createModImpl(weld::Window* pWin, const ScriptDocument& rDocument,
rDocument.createModule( aLibName, aModName, bMain, sModuleCode );
BasicManager* pBasMgr = rDocument.getBasicManager();
StarBASIC* pBasic = pBasMgr? pBasMgr->GetLib( aLibName ) : nullptr;
if ( pBasic )
pModule = pBasic->FindModule( aModName );
SbxItem aSbxItem( SID_BASICIDE_ARG_SBX, rDocument, aLibName, aModName, TYPE_MODULE );
if ( pBasic )
pModule = pBasic->FindModule( aModName );
SbxItem aSbxItem( SID_BASICIDE_ARG_SBX, rDocument, aLibName, aModName, TYPE_MODULE );
if (SfxDispatcher* pDispatcher = GetDispatcher())
{
pDispatcher->ExecuteList( SID_BASICIDE_SBXINSERTED,
......@@ -1074,9 +1074,9 @@ SbModule* createModImpl(weld::Window* pWin, const ScriptDocument& rDocument,
rDocument.createModule( aLibName, aModName, bMain, sModuleCode );
BasicManager* pBasMgr = rDocument.getBasicManager();
StarBASIC* pBasic = pBasMgr? pBasMgr->GetLib( aLibName ) : nullptr;
if ( pBasic )
pModule = pBasic->FindModule( aModName );
SbxItem aSbxItem( SID_BASICIDE_ARG_SBX, rDocument, aLibName, aModName, TYPE_MODULE );
if ( pBasic )
pModule = pBasic->FindModule( aModName );
SbxItem aSbxItem( SID_BASICIDE_ARG_SBX, rDocument, aLibName, aModName, TYPE_MODULE );
if (SfxDispatcher* pDispatcher = GetDispatcher())
{
pDispatcher->ExecuteList( SID_BASICIDE_SBXINSERTED,
......
......@@ -378,7 +378,7 @@ void DlgEditor::SetDialog( const uno::Reference< container::XNameContainer >& xU
sal_Int16 nTabIndex = -1;
Any aCtrl = xNameAcc->getByName( aName );
Reference< css::beans::XPropertySet > xPSet;
aCtrl >>= xPSet;
aCtrl >>= xPSet;
if ( xPSet.is() )
xPSet->getPropertyValue( DLGED_PROP_TABINDEX ) >>= nTabIndex;
......@@ -680,8 +680,8 @@ void DlgEditor::Copy()
Reference< container::XNameAccess > xNAcc( xClipDialogModel, UNO_QUERY );
if ( xNAcc.is() )
{
Sequence< OUString > aNames = xNAcc->getElementNames();
const OUString* pNames = aNames.getConstArray();
Sequence< OUString > aNames = xNAcc->getElementNames();
const OUString* pNames = aNames.getConstArray();
sal_uInt32 nCtrls = aNames.getLength();
for ( sal_uInt32 n = 0; n < nCtrls; n++ )
......@@ -713,7 +713,7 @@ void DlgEditor::Copy()
// clone control model
Reference< util::XCloneable > xCtrl;
aCtrl >>= xCtrl;
aCtrl >>= xCtrl;
Reference< util::XCloneable > xNewCtrl = xCtrl->createClone();
Any aNewCtrl;
aNewCtrl <<= xNewCtrl;
......@@ -907,8 +907,8 @@ void DlgEditor::Paste()
Reference< css::container::XNameAccess > xNameAcc( xClipDialogModel, UNO_QUERY );
if ( xNameAcc.is() )
{
Sequence< OUString > aNames = xNameAcc->getElementNames();
const OUString* pNames = aNames.getConstArray();
Sequence< OUString > aNames = xNameAcc->getElementNames();
const OUString* pNames = aNames.getConstArray();
sal_uInt32 nCtrls = aNames.getLength();
Reference< resource::XStringResourcePersistence > xStringResourcePersistence;
......@@ -919,9 +919,9 @@ void DlgEditor::Paste()
}
for( sal_uInt32 n = 0; n < nCtrls; n++ )
{
Any aA = xNameAcc->getByName( pNames[n] );
Any aA = xNameAcc->getByName( pNames[n] );
Reference< css::awt::XControlModel > xCM;
aA >>= xCM;
aA >>= xCM;
// clone the control model
Reference< util::XCloneable > xClone( xCM, uno::UNO_QUERY );
......@@ -939,7 +939,7 @@ void DlgEditor::Paste()
// set tabindex
Reference< container::XNameAccess > xNA( m_xUnoControlDialogModel , UNO_QUERY );
Sequence< OUString > aNames_ = xNA->getElementNames();
Sequence< OUString > aNames_ = xNA->getElementNames();
xPSet->setPropertyValue( DLGED_PROP_TABINDEX, Any(static_cast<sal_Int16>(aNames_.getLength())) );
if( bLocalized )
......
......@@ -556,7 +556,7 @@ void DlgEdObj::TabIndexChange( const beans::PropertyChangeEvent& evt )
sal_Int16 nTabIndex = -1;
Any aCtrl = xNameAcc->getByName( aName );
Reference< beans::XPropertySet > xPSet;
aCtrl >>= xPSet;
aCtrl >>= xPSet;
if ( xPSet.is() && xPSet == Reference< beans::XPropertySet >( evt.Source, UNO_QUERY ) )
evt.OldValue >>= nTabIndex;
else if ( xPSet.is() )
......@@ -594,7 +594,7 @@ void DlgEdObj::TabIndexChange( const beans::PropertyChangeEvent& evt )
{
Any aCtrl = xNameAcc->getByName( aNameList[i] );
Reference< beans::XPropertySet > xPSet;
aCtrl >>= xPSet;
aCtrl >>= xPSet;
if ( xPSet.is() )
{
assert(i >= SAL_MIN_INT16);
......@@ -873,7 +873,7 @@ void DlgEdObj::clonedFrom(const DlgEdObj* _pSource)
if ( xCont.is() )
{
// set tabindex
Sequence< OUString > aNames = xCont->getElementNames();
Sequence< OUString > aNames = xCont->getElementNames();
xPSet->setPropertyValue( DLGED_PROP_TABINDEX, Any(static_cast<sal_Int16>(aNames.getLength())) );
// insert control model in dialog model
......@@ -1013,7 +1013,7 @@ void DlgEdObj::SetDefaults()
if ( xCont.is() )
{
// set tabindex
Sequence< OUString > aNames = xCont->getElementNames();
Sequence< OUString > aNames = xCont->getElementNames();
uno::Any aTabIndex;
aTabIndex <<= static_cast<sal_Int16>(aNames.getLength());
xPSet->setPropertyValue( DLGED_PROP_TABINDEX, aTabIndex );
......@@ -1436,7 +1436,7 @@ void DlgEdForm::UpdateTabIndices()
sal_Int16 nTabIndex = -1;
Any aCtrl = xNameAcc->getByName( aName );
Reference< css::beans::XPropertySet > xPSet;
aCtrl >>= xPSet;
aCtrl >>= xPSet;
if ( xPSet.is() )
xPSet->getPropertyValue( DLGED_PROP_TABINDEX ) >>= nTabIndex;
......@@ -1450,7 +1450,7 @@ void DlgEdForm::UpdateTabIndices()
{
Any aCtrl = xNameAcc->getByName( indexToName.second );
Reference< beans::XPropertySet > xPSet;
aCtrl >>= xPSet;
aCtrl >>= xPSet;
if ( xPSet.is() )
{
xPSet->setPropertyValue( DLGED_PROP_TABINDEX, Any(nNewTabIndex) );
......
......@@ -390,7 +390,7 @@ namespace basegfx
for(sal_uInt16 a(0); a < RowSize; a++)
{
// prepare line
sal_uInt16 b;
sal_uInt16 b;
for( b = 0; b < RowSize; b++)
{
fArray[b] = implGetDefaultValue(a, b);
......
......@@ -1137,7 +1137,7 @@ namespace basegfx
if(aSource.areControlPointsUsed())
{
const double fPrecisionFactor = 0.25;
const double fPrecisionFactor = 0.25;
aSource = adaptiveSubdivideByDistance( aSource, fLineWidth * fPrecisionFactor );
}
......
......@@ -1443,7 +1443,7 @@ bool BasicManager::LegacyPsswdBinaryLimitExceeded( std::vector< OUString >& _out
if ( nBigModules )
{
_out_rModuleNames.swap(aBigModules);
_out_rModuleNames.swap(aBigModules);
return true;
}
}
......
......@@ -515,7 +515,7 @@ bool SbiImage::Save( SvStream& r, sal_uInt32 nVer )
}
}
SbiCloseRecord( r, nPos );
SbiCloseRecord( r, nPos );
}
}
// Set overall length
......
......@@ -4810,7 +4810,7 @@ void SbUnoStructRefObject::Notify( SfxBroadcaster& rBC, const SfxHint& rHint )
SbUnoProperty* pProp = dynamic_cast<SbUnoProperty*>( pVar );
if( pProp )
{
StructFieldInfo::iterator it = maFields.find( pProp->GetName() );
StructFieldInfo::iterator it = maFields.find( pProp->GetName() );
// handle get/set of members of struct
if( pHint->GetId() == SfxHintId::BasicDataWanted )
{
......
......@@ -160,7 +160,7 @@ DocObjectWrapper::DocObjectWrapper( SbModule* pVar ) : m_pMod( pVar )
m_xAggProxy->setDelegator( static_cast< cppu::OWeakObject * >( this ) );
}
osl_atomic_decrement( &m_refCount );
osl_atomic_decrement( &m_refCount );
}
}
}
......@@ -1202,7 +1202,7 @@ void SbModule::Run( SbMethod* pMeth )
}
if ( pBasic && pBasic->IsDocBasic() && pBasic->IsQuitApplication() && !GetSbData()->pInst )
bQuit = true;
if ( bQuit )
if ( bQuit )
{
Application::PostUserEvent( LINK( &AsyncQuitHandler::instance(), AsyncQuitHandler, OnAsyncQuit ) );
}
......@@ -1932,7 +1932,7 @@ SbMethod::SbMethod( const SbMethod& r )
nDebugFlags = r.nDebugFlags;
nLine1 = r.nLine1;
nLine2 = r.nLine2;
refStatics = r.refStatics;
refStatics = r.refStatics;
mCaller = r.mCaller;
SetFlag( SbxFlagBits::NoModify );
}
......
......@@ -132,7 +132,7 @@ void SbiBuffer::Chain( sal_uInt32 off )
{
ip = reinterpret_cast<sal_uInt8*>(pBuf.get()) + i;
sal_uInt8* pTmp = ip;
i = *pTmp++; i |= *pTmp++ << 8; i |= *pTmp++ << 16; i |= *pTmp++ << 24;
i = *pTmp++; i |= *pTmp++ << 8; i |= *pTmp++ << 16; i |= *pTmp++ << 24;
if( i >= nOff )
{
......
......@@ -216,7 +216,7 @@ void SbiParser::DefVar( SbiOpcode eOp, bool bStatic )
}
// behavior in VBA is that a module scope variable's lifetime is
// tied to the document. e.g. a module scope variable is global
if( GetBasic()->IsDocBasic() && bVBASupportOn && !pProc )
if( GetBasic()->IsDocBasic() && bVBASupportOn && !pProc )
bPersistentGlobal = true;
// PRIVATE is a synonymous for DIM
// _CONST_?
......
......@@ -398,7 +398,7 @@ bool SbiParser::Parse()
Next();
Push( eCurTok );
aGen.Statement();
Symbol(nullptr);
Symbol(nullptr);
}
}
else
......
......@@ -433,8 +433,7 @@ start:
nRes = 0;
else
{
::OString aOStr = OUStringToOString
( *p->pOUString, RTL_TEXTENCODING_ASCII_US );
::OString aOStr = OUStringToOString( *p->pOUString, RTL_TEXTENCODING_ASCII_US );
nRes = aOStr.toInt64();
if( nRes == 0 )
{
......@@ -544,8 +543,7 @@ start:
p->pOUString = new OUString;
::OString aOStr = OString::number( n );
(*p->pOUString) = ::OStringToOUString
( aOStr, RTL_TEXTENCODING_ASCII_US );
(*p->pOUString) = ::OStringToOUString( aOStr, RTL_TEXTENCODING_ASCII_US );
break;
}
case SbxOBJECT:
......@@ -695,7 +693,7 @@ start:
nRes = 0;
else
{
::OString aOStr = OUStringToOString
::OString aOStr = OUStringToOString
( *p->pOUString, RTL_TEXTENCODING_ASCII_US );
sal_Int64 n64 = aOStr.toInt64();
if( n64 == 0 )
......@@ -823,8 +821,7 @@ start:
else
{
::OString aOStr = OString::number( n );
(*p->pOUString) = ::OStringToOUString
( aOStr, RTL_TEXTENCODING_ASCII_US );
(*p->pOUString) = ::OStringToOUString( aOStr, RTL_TEXTENCODING_ASCII_US );
}
break;
case SbxOBJECT:
......
......@@ -573,7 +573,7 @@ bool SbxValue::PutBool( bool b )
bool SbxValue::PutEmpty()
{
bool bRet = SetType( SbxEMPTY );
SetModified( true );
SetModified( true );
return bRet;
}
......@@ -1549,60 +1549,60 @@ bool SbxValue::LoadData( SvStream& r, sal_uInt16 )
write_uInt16_lenPrefixed_uInt8s_FromOUString(r, OUString(), RTL_TEXTENCODING_ASCII_US);
}
break;
case SbxERROR:
case SbxUSHORT:
r.WriteUInt16( aData.nUShort ); break;
case SbxOBJECT:
// to save itself as Objectptr does not work!
if( aData.pObj )
{
if( dynamic_cast<SbxValue*>( aData.pObj) != this )
case SbxERROR:
case SbxUSHORT:
r.WriteUInt16( aData.nUShort ); break;
case SbxOBJECT:
// to save itself as Objectptr does not work!
if( aData.pObj )
{
r.WriteUChar( 1 );
return aData.pObj->Store( r );
if( dynamic_cast<SbxValue*>( aData.pObj) != this )
{
r.WriteUChar( 1 );
return aData.pObj->Store( r );
}
else
r.WriteUChar( 2 );
}
else
r.WriteUChar( 2 );
r.WriteUChar( 0 );
break;
case SbxCHAR:
{
char c = sal::static_int_cast< char >(aData.nChar);
r.WriteChar( c );
break;
}
else
r.WriteUChar( 0 );
break;
case SbxCHAR:
{
char c = sal::static_int_cast< char >(aData.nChar);
r.WriteChar( c );
break;
}
case SbxBYTE:
r.WriteUChar( aData.nByte ); break;
case SbxULONG:
r.WriteUInt32( aData.nULong ); break;
case SbxINT:
{
r.WriteUChar( SAL_TYPES_SIZEOFINT ).WriteInt32( aData.nInt );
break;
}
case SbxUINT:
{
r.WriteUChar( SAL_TYPES_SIZEOFINT ).WriteUInt32( aData.nUInt );
break;
case SbxBYTE:
r.WriteUChar( aData.nByte ); break;
case SbxULONG:
r.WriteUInt32( aData.nULong ); break;
case SbxINT:
{
r.WriteUChar( SAL_TYPES_SIZEOFINT ).WriteInt32( aData.nInt );
break;
}
case SbxUINT:
{
r.WriteUChar( SAL_TYPES_SIZEOFINT ).WriteUInt32( aData.nUInt );
break;
}
case SbxEMPTY:
case SbxNULL:
case SbxVOID:
break;
case SbxDATAOBJECT:
r.WriteInt32( aData.nLong );
break;
// #78919 For backwards compatibility
case SbxWSTRING:
case SbxWCHAR:
break;
default:
SAL_WARN( "basic.sbx", "Saving a non-supported data type" );
return false;
}
case SbxEMPTY:
case SbxNULL:
case SbxVOID:
break;
case SbxDATAOBJECT:
r.WriteInt32( aData.nLong );
break;
// #78919 For backwards compatibility
case SbxWSTRING:
case SbxWCHAR:
break;
default:
SAL_WARN( "basic.sbx", "Saving a non-supported data type" );
return false;
return true;
}
return true;
}
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
......@@ -1159,7 +1159,7 @@ void SfxLibraryContainer::init_Impl( const OUString& rInitialDocumentURL,
// Create library
Reference< XNameContainer > xLib = createLibrary( aLibName );
SfxLibrary* pNewLib = static_cast< SfxLibrary* >( xLib.get() );
SfxLibrary* pNewLib = static_cast< SfxLibrary* >( xLib.get() );
pNewLib->mbLoaded = false;
pNewLib->implSetModified( false );
checkStorageURL( aLibFolder, pNewLib->maLibInfoFileURL,
......
......@@ -625,7 +625,7 @@ bool SfxScriptLibraryContainer::implStorePasswordLibrary( SfxLibrary* pLib, cons
sal_Int8* pData = aBinSeq.getArray();
memcpy( pData, aMemStream.GetData(), nSize );
Reference< XOutputStream > xOut = xCodeStream->getOutputStream();
Reference< XOutputStream > xOut = xCodeStream->getOutputStream();
if ( !xOut.is() )
{
throw io::IOException(); // access denied because the stream is readonly
......
......@@ -106,8 +106,8 @@ static void cpp_call(
{
// Maximum space for [complex ret ptr], values | ptr ...
// (but will be used less - some of the values will be in pGPR and pFPR)
sal_uInt64 *pStack = static_cast<sal_uInt64 *>(__builtin_alloca( (nParams + 3) * sizeof(sal_uInt64) ));
sal_uInt64 *pStackStart = pStack;
sal_uInt64 *pStack = static_cast<sal_uInt64 *>(__builtin_alloca( (nParams + 3) * sizeof(sal_uInt64) ));
sal_uInt64 *pStackStart = pStack;
sal_uInt64 pGPR[x86_64::MAX_GPR_REGS];
sal_uInt32 nGPR = 0;
......@@ -282,8 +282,8 @@ static void cpp_call(
}
catch (...)
{
// fill uno exception
CPPU_CURRENT_NAMESPACE::fillUnoException(*ppUnoExc, pThis->getBridge()->getCpp2Uno());
// fill uno exception
CPPU_CURRENT_NAMESPACE::fillUnoException(*ppUnoExc, pThis->getBridge()->getCpp2Uno());
// temporary params
for ( ; nTempIndices--; )
......
......@@ -49,10 +49,11 @@ namespace basegfx
const Rect& rR )
{
// maxY | minY | maxX | minX
sal_uInt32 clip = (rP.getX() < rR.getMinX()) << 0;
clip |= (rP.getX() > rR.getMaxX()) << 1;
clip |= (rP.getY() < rR.getMinY()) << 2;
clip |= (rP.getY() > rR.getMaxY()) << 3;
sal_uInt32 clip;
clip = (rP.getX() < rR.getMinX()) << 0;
clip |= (rP.getX() > rR.getMaxX()) << 1;
clip |= (rP.getY() < rR.getMinY()) << 2;
clip |= (rP.getY() > rR.getMaxY()) << 3;
return clip;
}
......@@ -62,10 +63,11 @@ namespace basegfx
const B2IBox& rB )
{
// maxY | minY | maxX | minX
sal_uInt32 clip = (rP.getX() < rB.getMinX()) << 0;
clip |= (rP.getX() >= rB.getMaxX()) << 1;
clip |= (rP.getY() < rB.getMinY()) << 2;
clip |= (rP.getY() >= rB.getMaxY()) << 3;
sal_uInt32 clip;
clip = (rP.getX() < rB.getMinX()) << 0;
clip |= (rP.getX() >= rB.getMaxX()) << 1;
clip |= (rP.getY() < rB.getMinY()) << 2;
clip |= (rP.getY() >= rB.getMaxY()) << 3;
return clip;
}
......
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