Fix for fdo43460 Part III getLength to isEmpty
Part III Module basic
This commit is contained in:
committed by
Ivan Timofeev
parent
93a9f170be
commit
91d4fe75ee
@@ -223,7 +223,7 @@ void enableContainerWindowsOfAllDocuments( const uno::Reference< frame::XModel >
|
||||
|
||||
void registerCurrentDirectory( const uno::Reference< frame::XModel >& rxModel, const ::rtl::OUString& rPath )
|
||||
{
|
||||
if( rPath.getLength() > 0 )
|
||||
if( !rPath.isEmpty() )
|
||||
{
|
||||
CurrDirPool& rPool = StaticCurrDirPool::get();
|
||||
::osl::MutexGuard aGuard( rPool.maMutex );
|
||||
@@ -231,7 +231,7 @@ void registerCurrentDirectory( const uno::Reference< frame::XModel >& rxModel, c
|
||||
{
|
||||
uno::Reference< frame::XModuleManager > xModuleManager( lclCreateModuleManager(), uno::UNO_SET_THROW );
|
||||
::rtl::OUString aIdentifier = xModuleManager->identify( rxModel );
|
||||
if( aIdentifier.getLength() > 0 )
|
||||
if( !aIdentifier.isEmpty() )
|
||||
rPool.maCurrDirs[ aIdentifier ] = rPath;
|
||||
}
|
||||
catch(const uno::Exception& )
|
||||
|
||||
@@ -287,7 +287,7 @@ sal_Bool SbiImage::Save( SvStream& r, sal_uInt32 nVer )
|
||||
SbiCloseRecord( r, nPos );
|
||||
}
|
||||
// Source?
|
||||
if( aOUSource.getLength() && SbiGood( r ) )
|
||||
if( !aOUSource.isEmpty() && SbiGood( r ) )
|
||||
{
|
||||
nPos = SbiOpenRecord( r, B_SOURCE, 1 );
|
||||
String aTmp;
|
||||
|
||||
@@ -128,7 +128,7 @@ bool SbUnoObject::getDefaultPropName( SbUnoObject* pUnoObj, ::rtl::OUString& sDf
|
||||
if ( xDefaultProp.is() )
|
||||
{
|
||||
sDfltProp = xDefaultProp->getDefaultPropertyName();
|
||||
if ( sDfltProp.getLength() )
|
||||
if ( !sDfltProp.isEmpty() )
|
||||
result = true;
|
||||
}
|
||||
return result;
|
||||
@@ -344,7 +344,7 @@ void implAppendExceptionMsg( ::rtl::OUStringBuffer& _inout_rBuffer, const Except
|
||||
lcl_indent( _inout_rBuffer, _nLevel );
|
||||
_inout_rBuffer.appendAscii( "Type: " );
|
||||
|
||||
if ( _rExceptionType.getLength() == 0 )
|
||||
if ( _rExceptionType.isEmpty() )
|
||||
_inout_rBuffer.appendAscii( "Unknown" );
|
||||
else
|
||||
_inout_rBuffer.append( _rExceptionType );
|
||||
@@ -1572,7 +1572,7 @@ void processAutomationParams( SbxArray* pParams, Sequence< Any >& args, bool bOL
|
||||
bBlockConversionToSmallestType );
|
||||
|
||||
::rtl::OUString aParamName = pNames[iSbx];
|
||||
if( aParamName.getLength() )
|
||||
if( !aParamName.isEmpty() )
|
||||
{
|
||||
oleautomation::NamedArgument aNamedArgument;
|
||||
aNamedArgument.Name = aParamName;
|
||||
@@ -1687,7 +1687,7 @@ rtl::OUString Impl_GetInterfaceInfo( const Reference< XInterface >& x, const Ref
|
||||
if( pUnoObj )
|
||||
{
|
||||
aName = pUnoObj->GetClassName();
|
||||
if( !aName.getLength() )
|
||||
if( aName.isEmpty() )
|
||||
{
|
||||
Any aToInspectObj = pUnoObj->getUnoAny();
|
||||
TypeClass eType = aToInspectObj.getValueType().getTypeClass();
|
||||
@@ -1708,7 +1708,7 @@ rtl::OUString Impl_GetInterfaceInfo( const Reference< XInterface >& x, const Ref
|
||||
::rtl::OUString getDbgObjectName( SbUnoObject* pUnoObj )
|
||||
{
|
||||
::rtl::OUString aName = getDbgObjectNameImpl( pUnoObj );
|
||||
if( !aName.getLength() )
|
||||
if( aName.isEmpty() )
|
||||
aName += ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("Unknown"));
|
||||
|
||||
::rtl::OUStringBuffer aRet;
|
||||
@@ -1787,7 +1787,7 @@ bool checkUnoObjectType( SbUnoObject* pUnoObj, const ::rtl::OUString& rClass )
|
||||
{
|
||||
rtl::OUString sTypeName;
|
||||
xInv->getValue( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("$GetTypeName") ) ) >>= sTypeName;
|
||||
if ( sTypeName.getLength() == 0 || sTypeName.equals( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("IDispatch") ) ) )
|
||||
if ( sTypeName.isEmpty() || sTypeName.equals( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("IDispatch") ) ) )
|
||||
// can't check type, leave it pass
|
||||
result = true;
|
||||
else
|
||||
@@ -2404,7 +2404,7 @@ SbUnoObject::SbUnoObject( const rtl::OUString& aName_, const Any& aUnoObj_ )
|
||||
bFatalError = sal_False;
|
||||
|
||||
// insert the real name of the class
|
||||
if( aName_.getLength() == 0 )
|
||||
if( aName_.isEmpty() )
|
||||
{
|
||||
aClassName_ = aUnoObj_.getValueType().getTypeName();
|
||||
bSetClassName = sal_True;
|
||||
@@ -2655,7 +2655,7 @@ SbxVariable* SbUnoObject::Find( const String& rName, SbxClassType t )
|
||||
if( mxExactName.is() )
|
||||
{
|
||||
::rtl::OUString aUExactName = mxExactName->getExactName( aUName );
|
||||
if( aUExactName.getLength() )
|
||||
if( !aUExactName.isEmpty() )
|
||||
aUName = aUExactName;
|
||||
}
|
||||
if( mxUnoAccess->hasProperty( aUName, PropertyConcept::ALL - PropertyConcept::DANGEROUS ) )
|
||||
@@ -2731,7 +2731,7 @@ SbxVariable* SbUnoObject::Find( const String& rName, SbxClassType t )
|
||||
if( mxExactNameInvocation.is() )
|
||||
{
|
||||
::rtl::OUString aUExactName = mxExactNameInvocation->getExactName( aUName );
|
||||
if( aUExactName.getLength() )
|
||||
if( !aUExactName.isEmpty() )
|
||||
aUName = aUExactName;
|
||||
}
|
||||
|
||||
@@ -3564,13 +3564,13 @@ SbxVariable* SbUnoService::Find( const String& rName, SbxClassType )
|
||||
Reference< XServiceConstructorDescription > xCtor = pCtorSeq[i];
|
||||
|
||||
::rtl::OUString aName( xCtor->getName() );
|
||||
if( !aName.getLength() )
|
||||
if( aName.isEmpty() )
|
||||
{
|
||||
if( xCtor->isDefaultConstructor() )
|
||||
aName = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("create"));
|
||||
}
|
||||
|
||||
if( aName.getLength() )
|
||||
if( !aName.isEmpty() )
|
||||
{
|
||||
// Create and insert SbUnoServiceCtor
|
||||
SbxVariableRef xSbCtorRef = new SbUnoServiceCtor( aName, xCtor );
|
||||
@@ -4688,7 +4688,7 @@ bool SbModule::createCOMWrapperForIface( Any& o_rRetAny, SbClassModuleObject* pP
|
||||
SbxVariable* pVar = pModIfaces->Get( i );
|
||||
::rtl::OUString aIfaceName = pVar->GetName();
|
||||
|
||||
if( aIfaceName.getLength() != 0 )
|
||||
if( !aIfaceName.isEmpty() )
|
||||
{
|
||||
::rtl::OUString aPureIfaceName = aIfaceName;
|
||||
sal_Int32 indexLastDot = aIfaceName.lastIndexOf('.');
|
||||
|
||||
@@ -252,7 +252,7 @@ sal_Bool needSecurityRestrictions( void )
|
||||
const Reference< XBridge >& rxBridge = pBridges[ i ];
|
||||
::rtl::OUString aDescription = rxBridge->getDescription();
|
||||
::rtl::OUString aPortalUser = findUserInDescription( aDescription );
|
||||
if( aPortalUser.getLength() > 0 )
|
||||
if( !aPortalUser.isEmpty() )
|
||||
{
|
||||
// User Found, compare to system user
|
||||
if( aPortalUser == aSystemUser )
|
||||
|
||||
@@ -189,7 +189,7 @@ String getFullPath( const String& aRelPath )
|
||||
INetURLObject aURLObj( aRelPath );
|
||||
aFileURL = aURLObj.GetMainURL( INetURLObject::NO_DECODE );
|
||||
|
||||
if( !aFileURL.getLength() )
|
||||
if( aFileURL.isEmpty() )
|
||||
{
|
||||
File::getFileURLFromSystemPath( aRelPath, aFileURL );
|
||||
}
|
||||
@@ -280,7 +280,7 @@ RTLFUNC(Error)
|
||||
if ( bVBA && rPar.Count() > 1 )
|
||||
{
|
||||
com::sun::star::uno::Reference< ooo::vba::XErrObject > xErrObj( SbxErrObject::getUnoErrObject() );
|
||||
if ( xErrObj.is() && xErrObj->getNumber() == nCode && xErrObj->getDescription().getLength() )
|
||||
if ( xErrObj.is() && xErrObj->getNumber() == nCode && !xErrObj->getDescription().isEmpty() )
|
||||
tmpErrMsg = xErrObj->getDescription();
|
||||
}
|
||||
rPar.Get( 0 )->PutString( tmpErrMsg );
|
||||
@@ -655,12 +655,12 @@ RTLFUNC(MkDir)
|
||||
// If aPath is the folder name, not a path, then create the folder under current directory.
|
||||
INetURLObject aTryPathURL( aPath );
|
||||
::rtl::OUString sPathURL = aTryPathURL.GetMainURL( INetURLObject::NO_DECODE );
|
||||
if ( !sPathURL.getLength() )
|
||||
if ( sPathURL.isEmpty() )
|
||||
{
|
||||
File::getFileURLFromSystemPath( aPath, sPathURL );
|
||||
}
|
||||
INetURLObject aPathURL( sPathURL );
|
||||
if ( !aPathURL.GetPath().getLength() )
|
||||
if ( aPathURL.GetPath().isEmpty() )
|
||||
{
|
||||
::rtl::OUString sCurDirURL;
|
||||
SbxArrayRef pPar = new SbxArray;
|
||||
@@ -673,7 +673,7 @@ RTLFUNC(MkDir)
|
||||
INetURLObject aDirURL( sCurDirURL );
|
||||
aDirURL.Append( aPath );
|
||||
::rtl::OUString aTmpPath = aDirURL.GetMainURL( INetURLObject::NO_DECODE );
|
||||
if ( aTmpPath.getLength() > 0 )
|
||||
if ( !aTmpPath.isEmpty() )
|
||||
{
|
||||
aPath = aTmpPath;
|
||||
}
|
||||
|
||||
@@ -1568,9 +1568,9 @@ RTLFUNC(ConvertToUrl)
|
||||
String aStr = rPar.Get(1)->GetString();
|
||||
INetURLObject aURLObj( aStr, INET_PROT_FILE );
|
||||
::rtl::OUString aFileURL = aURLObj.GetMainURL( INetURLObject::NO_DECODE );
|
||||
if( !aFileURL.getLength() )
|
||||
if( aFileURL.isEmpty() )
|
||||
::osl::File::getFileURLFromSystemPath( aFileURL, aFileURL );
|
||||
if( !aFileURL.getLength() )
|
||||
if( aFileURL.isEmpty() )
|
||||
aFileURL = aStr;
|
||||
rPar.Get(0)->PutString( String(aFileURL) );
|
||||
}
|
||||
@@ -1588,7 +1588,7 @@ RTLFUNC(ConvertFromUrl)
|
||||
String aStr = rPar.Get(1)->GetString();
|
||||
::rtl::OUString aSysPath;
|
||||
::osl::File::getSystemPathFromFileURL( aStr, aSysPath );
|
||||
if( !aSysPath.getLength() )
|
||||
if( aSysPath.isEmpty() )
|
||||
aSysPath = aStr;
|
||||
rPar.Get(0)->PutString( String(aSysPath) );
|
||||
}
|
||||
|
||||
@@ -406,7 +406,7 @@ void SbiRuntime::SetupArgs( SbxVariable* p, sal_uInt32 nOp1 )
|
||||
rtl::OUString sDefaultMethod;
|
||||
if ( xDfltMethod.is() )
|
||||
sDefaultMethod = xDfltMethod->getDefaultMethodName();
|
||||
if ( sDefaultMethod.getLength() )
|
||||
if ( !sDefaultMethod.isEmpty() )
|
||||
{
|
||||
SbxVariable* meth = pUnoObj->Find( sDefaultMethod, SbxCLASS_METHOD );
|
||||
if( meth != NULL )
|
||||
@@ -572,7 +572,7 @@ SbxVariable* SbiRuntime::CheckArray( SbxVariable* pElem )
|
||||
else if( xIndexAccess.is() )
|
||||
sDefaultMethod = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "getByIndex" ) );
|
||||
|
||||
if ( sDefaultMethod.getLength() )
|
||||
if ( !sDefaultMethod.isEmpty() )
|
||||
{
|
||||
SbxVariable* meth = pUnoObj->Find( sDefaultMethod, SbxCLASS_METHOD );
|
||||
SbxVariableRef refTemp = meth;
|
||||
|
||||
@@ -755,7 +755,7 @@ void SbxObject::Dump( SvStream& rStrm, sal_Bool bFill )
|
||||
rtl::OString aClassNameStr(rtl::OUStringToOString(aClassName, RTL_TEXTENCODING_ASCII_US));
|
||||
rStrm << "Object( "
|
||||
<< rtl::OString::valueOf(reinterpret_cast<sal_Int64>(this)).getStr()<< "=='"
|
||||
<< ( aNameStr.getLength() ? aNameStr.getStr() : "<unnamed>" ) << "', "
|
||||
<< ( aNameStr.isEmpty() ? "<unnamed>" : aNameStr.getStr() ) << "', "
|
||||
<< "of class '" << aClassNameStr.getStr() << "', "
|
||||
<< "counts "
|
||||
<< rtl::OString::valueOf(static_cast<sal_Int64>(GetRefCount())).getStr()
|
||||
@@ -765,7 +765,7 @@ void SbxObject::Dump( SvStream& rStrm, sal_Bool bFill )
|
||||
rtl::OString aParentNameStr(rtl::OUStringToOString(GetName(), RTL_TEXTENCODING_ASCII_US));
|
||||
rStrm << "in parent "
|
||||
<< rtl::OString::valueOf(reinterpret_cast<sal_Int64>(GetParent())).getStr()
|
||||
<< "=='" << ( aParentNameStr.getLength() ? aParentNameStr.getStr() : "<unnamed>" ) << "'";
|
||||
<< "=='" << ( aParentNameStr.isEmpty() ? "<unnamed>" : aParentNameStr.getStr() ) << "'";
|
||||
}
|
||||
else
|
||||
rStrm << "no parent ";
|
||||
|
||||
@@ -200,7 +200,7 @@ void ImpPutString( SbxValues* p, const ::rtl::OUString* n )
|
||||
case SbxBYREF | SbxSTRING:
|
||||
case SbxSTRING:
|
||||
case SbxLPSTR:
|
||||
if( n->getLength() )
|
||||
if( !n->isEmpty() )
|
||||
{
|
||||
if( !p->pOUString )
|
||||
p->pOUString = new ::rtl::OUString( *n );
|
||||
|
||||
@@ -612,7 +612,7 @@ sal_Bool SfxLibraryContainer::init_Impl(
|
||||
meInitMode = DEFAULT;
|
||||
INetURLObject aInitUrlInetObj( maInitialDocumentURL );
|
||||
OUString aInitFileName = aInitUrlInetObj.GetMainURL( INetURLObject::NO_DECODE );
|
||||
if( aInitFileName.getLength() )
|
||||
if( !aInitFileName.isEmpty() )
|
||||
{
|
||||
// We need a BasicManager to avoid problems
|
||||
StarBASIC* pBas = new StarBASIC();
|
||||
@@ -836,7 +836,7 @@ sal_Bool SfxLibraryContainer::init_Impl(
|
||||
|
||||
// Check storage URL
|
||||
OUString aStorageURL = rLib.aStorageURL;
|
||||
if( !bStorage && !aStorageURL.getLength() && nPass == 0 )
|
||||
if( !bStorage && aStorageURL.isEmpty() && nPass == 0 )
|
||||
{
|
||||
String aLibraryPath;
|
||||
if( meInitMode == CONTAINER_INIT_FILE )
|
||||
@@ -1235,7 +1235,7 @@ void SfxLibraryContainer::implScanExtensions( void )
|
||||
rtl::OUString aLibURL;
|
||||
|
||||
bool bPureDialogLib = false;
|
||||
while( (aLibURL = aScriptIt.nextBasicOrDialogLibrary( bPureDialogLib )).getLength() > 0 )
|
||||
while ( !(aLibURL = aScriptIt.nextBasicOrDialogLibrary( bPureDialogLib )).isEmpty())
|
||||
{
|
||||
if( bPureDialogLib && maInfoFileName.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "script" ) ) )
|
||||
continue;
|
||||
@@ -1347,7 +1347,7 @@ OUString SfxLibraryContainer::createAppLibraryFolder
|
||||
( SfxLibrary* pLib, const OUString& aName )
|
||||
{
|
||||
OUString aLibDirPath = pLib->maStorageURL;
|
||||
if( !aLibDirPath.getLength() )
|
||||
if( aLibDirPath.isEmpty() )
|
||||
{
|
||||
INetURLObject aInetObj( String(maLibraryPath).GetToken(1) );
|
||||
aInetObj.insertName( aName, sal_True, INetURLObject::LAST_SEGMENT, sal_True, INetURLObject::ENCODE_ALL );
|
||||
@@ -1448,7 +1448,7 @@ void SfxLibraryContainer::implStoreLibrary( SfxLibrary* pLib,
|
||||
else
|
||||
{
|
||||
// Export?
|
||||
bool bExport = aTargetURL.getLength();
|
||||
bool bExport = !aTargetURL.isEmpty();
|
||||
try
|
||||
{
|
||||
Reference< XSimpleFileAccess > xSFI = mxSFI;
|
||||
@@ -1582,7 +1582,7 @@ void SfxLibraryContainer::implStoreLibraryIndexFile( SfxLibrary* pLib,
|
||||
else
|
||||
{
|
||||
// Export?
|
||||
bool bExport = aTargetURL.getLength();
|
||||
bool bExport = !aTargetURL.isEmpty();
|
||||
Reference< XSimpleFileAccess > xSFI = mxSFI;
|
||||
if( xToUseSFI.is() )
|
||||
xSFI = xToUseSFI;
|
||||
@@ -1948,7 +1948,7 @@ void SfxLibraryContainer::storeLibraries_Impl( const uno::Reference< embed::XSto
|
||||
|
||||
// if we did an in-place save into a storage (i.e. a save into the storage we were already based on),
|
||||
// then we need to clean up the temporary storage we used for this
|
||||
if ( bInplaceStorage && sTempTargetStorName.getLength() )
|
||||
if ( bInplaceStorage && !sTempTargetStorName.isEmpty() )
|
||||
{
|
||||
SAL_WARN_IF(
|
||||
!xSourceLibrariesStor.is(), "basic",
|
||||
@@ -3106,7 +3106,7 @@ void SfxLibrary::impl_removeWithoutChecks( const ::rtl::OUString& _rElementName
|
||||
implSetModified( sal_True );
|
||||
|
||||
// Remove element file
|
||||
if( maStorageURL.getLength() )
|
||||
if( !maStorageURL.isEmpty() )
|
||||
{
|
||||
INetURLObject aElementInetObj( maStorageURL );
|
||||
aElementInetObj.insertName( _rElementName, sal_False,
|
||||
@@ -3240,7 +3240,7 @@ rtl::OUString ScriptExtensionIterator::nextBasicOrDialogLibrary( bool& rbPureDia
|
||||
{
|
||||
rtl::OUString aRetLib;
|
||||
|
||||
while( !aRetLib.getLength() && m_eState != END_REACHED )
|
||||
while( aRetLib.isEmpty() && m_eState != END_REACHED )
|
||||
{
|
||||
switch( m_eState )
|
||||
{
|
||||
|
||||
@@ -305,7 +305,7 @@ Any SAL_CALL SfxScriptLibraryContainer::importLibraryElement
|
||||
// TODO: Check language
|
||||
// aMod.aLanguage
|
||||
// aMod.aName ignored
|
||||
if( aMod.aModuleType.getLength() > 0 )
|
||||
if( !aMod.aModuleType.isEmpty() )
|
||||
{
|
||||
/* If in VBA compatibility mode, force creation of the VBA Globals
|
||||
object. Each application will create an instance of its own
|
||||
@@ -473,8 +473,8 @@ void SAL_CALL SfxScriptLibraryContainer::changeLibraryPassword( const OUString&
|
||||
if( OldPassword == NewPassword )
|
||||
return;
|
||||
|
||||
sal_Bool bOldPassword = ( OldPassword.getLength() > 0 );
|
||||
sal_Bool bNewPassword = ( NewPassword.getLength() > 0 );
|
||||
sal_Bool bOldPassword = ( !OldPassword.isEmpty() );
|
||||
sal_Bool bNewPassword = ( !NewPassword.isEmpty() );
|
||||
sal_Bool bStorage = mxStorage.is() && !pImplLib->mbLink;
|
||||
|
||||
if( pImplLib->mbReadOnly || (bOldPassword && !pImplLib->mbPasswordProtected) )
|
||||
@@ -592,7 +592,7 @@ sal_Bool SfxScriptLibraryContainer::implStorePasswordLibrary( SfxLibrary* pLib,
|
||||
const ::com::sun::star::uno::Reference< ::com::sun::star::embed::XStorage >& xStorage,
|
||||
const ::rtl::OUString& aTargetURL, const Reference< XSimpleFileAccess > xToUseSFI, const ::com::sun::star::uno::Reference< ::com::sun::star::task::XInteractionHandler >& xHandler )
|
||||
{
|
||||
bool bExport = aTargetURL.getLength();
|
||||
bool bExport = !aTargetURL.isEmpty();
|
||||
|
||||
BasicManager* pBasicMgr = getBasicManager();
|
||||
OSL_ENSURE( pBasicMgr, "SfxScriptLibraryContainer::implStorePasswordLibrary: cannot do this without a BasicManager!" );
|
||||
@@ -1260,7 +1260,7 @@ bool SfxScriptLibrary::containsValidModule( const Any& aElement )
|
||||
{
|
||||
OUString sModuleText;
|
||||
aElement >>= sModuleText;
|
||||
return ( sModuleText.getLength() > 0 );
|
||||
return ( !sModuleText.isEmpty() );
|
||||
}
|
||||
|
||||
bool SAL_CALL SfxScriptLibrary::isLibraryElementValid( ::com::sun::star::uno::Any aElement ) const
|
||||
|
||||
Reference in New Issue
Block a user