summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGustavo Buzzatti Pacheco <gbpacheco@gmail.com>2011-12-26 15:08:46 -0200
committerJan Holesovsky <kendy@suse.cz>2011-12-30 11:36:01 +0100
commit6cfae09e5dafa477db210272949e253d4fb24349 (patch)
tree04f24fc194e1f711228296f7f3f16b98fd489637
parent60b7f09ed5980248c8f3088adf80380d02d66358 (diff)
Fix for fdo43460 Part XVIII getLength() to isEmpty()
Part XVIII module form
-rw-r--r--forms/source/component/CheckBox.cxx2
-rw-r--r--forms/source/component/Columns.cxx4
-rw-r--r--forms/source/component/ComboBox.cxx16
-rw-r--r--forms/source/component/Currency.cxx2
-rw-r--r--forms/source/component/DatabaseForm.cxx24
-rw-r--r--forms/source/component/Edit.cxx8
-rw-r--r--forms/source/component/EditBase.cxx2
-rw-r--r--forms/source/component/Filter.cxx10
-rw-r--r--forms/source/component/FormComponent.cxx32
-rw-r--r--forms/source/component/FormattedField.cxx6
-rw-r--r--forms/source/component/GroupManager.cxx6
-rw-r--r--forms/source/component/ImageControl.cxx12
-rw-r--r--forms/source/component/ListBox.cxx12
-rw-r--r--forms/source/component/Pattern.cxx4
-rw-r--r--forms/source/component/RadioButton.cxx8
-rw-r--r--forms/source/component/clickableimage.cxx8
-rw-r--r--forms/source/component/errorbroadcaster.cxx2
-rw-r--r--forms/source/component/imgprod.cxx2
-rw-r--r--forms/source/component/refvaluecomponent.cxx2
-rw-r--r--forms/source/inc/forms_module_impl.hxx2
-rw-r--r--forms/source/runtime/formoperations.cxx8
-rw-r--r--forms/source/xforms/binding.cxx16
-rw-r--r--forms/source/xforms/convert.cxx2
-rw-r--r--forms/source/xforms/datatypes.cxx6
-rw-r--r--forms/source/xforms/model.cxx2
-rw-r--r--forms/source/xforms/model_ui.cxx12
-rw-r--r--forms/source/xforms/pathexpression.cxx2
-rw-r--r--forms/source/xforms/resourcehelper.cxx2
-rw-r--r--forms/source/xforms/submission.cxx8
29 files changed, 111 insertions, 111 deletions
diff --git a/forms/source/component/CheckBox.cxx b/forms/source/component/CheckBox.cxx
index b0dd35f947d4..3a622e2f4fe3 100644
--- a/forms/source/component/CheckBox.cxx
+++ b/forms/source/component/CheckBox.cxx
@@ -206,7 +206,7 @@ void SAL_CALL OCheckBoxModel::read(const Reference<stario::XObjectInputStream>&
setDefaultChecked( static_cast< ToggleState >( nDefaultChecked ) );
// Nach dem Lesen die Defaultwerte anzeigen
- if ( getControlSource().getLength() )
+ if ( !getControlSource().isEmpty() )
// (not if we don't have a control source - the "State" property acts like it is persistent, then
resetNoBroadcast();
}
diff --git a/forms/source/component/Columns.cxx b/forms/source/component/Columns.cxx
index 72a53440232c..d65eac43f700 100644
--- a/forms/source/component/Columns.cxx
+++ b/forms/source/component/Columns.cxx
@@ -75,7 +75,7 @@ const sal_uInt16 COMPATIBLE_HIDDEN = 0x0008;
const StringSequence& getColumnTypes()
{
static StringSequence aColumnTypes(10);
- if (!aColumnTypes.getConstArray()[0].getLength())
+ if (aColumnTypes.getConstArray()[0].isEmpty())
{
::rtl::OUString* pNames = aColumnTypes.getArray();
pNames[TYPE_CHECKBOX] = ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "CheckBox" ) );
@@ -218,7 +218,7 @@ OGridColumn::OGridColumn( const comphelper::ComponentContext& _rContext, const :
DBG_CTOR(OGridColumn,NULL);
// Anlegen des UnoControlModels
- if ( m_aModelName.getLength() ) // is there a to-be-aggregated model?
+ if ( !m_aModelName.isEmpty() ) // is there a to-be-aggregated model?
{
increment( m_refCount );
diff --git a/forms/source/component/ComboBox.cxx b/forms/source/component/ComboBox.cxx
index 6224c5b6f831..e16a4521d30e 100644
--- a/forms/source/component/ComboBox.cxx
+++ b/forms/source/component/ComboBox.cxx
@@ -455,7 +455,7 @@ void SAL_CALL OComboBoxModel::read(const Reference<stario::XObjectInputStream>&
// Stringliste muss geleert werden, wenn eine Listenquelle gesetzt ist
// dieses kann der Fall sein wenn im alive modus gespeichert wird
- if ( m_aListSource.getLength()
+ if ( !m_aListSource.isEmpty()
&& !hasExternalListSource()
)
{
@@ -469,7 +469,7 @@ void SAL_CALL OComboBoxModel::read(const Reference<stario::XObjectInputStream>&
readCommonProperties(_rxInStream);
// Nach dem Lesen die Defaultwerte anzeigen
- if ( getControlSource().getLength() )
+ if ( !getControlSource().isEmpty() )
{
// (not if we don't have a control source - the "State" property acts like it is persistent, then
resetNoBroadcast();
@@ -500,7 +500,7 @@ void OComboBoxModel::loadData( bool _bForce )
return;
}
- if (!m_aListSource.getLength() || m_eListSourceType == ListSourceType_VALUELIST)
+ if (m_aListSource.isEmpty() || m_eListSourceType == ListSourceType_VALUELIST)
return;
::utl::SharedUNOComponent< XResultSet > xListCursor;
@@ -548,7 +548,7 @@ void OComboBoxModel::loadData( bool _bForce )
}
}
- if (!aFieldName.getLength())
+ if (aFieldName.isEmpty())
break;
Reference<XDatabaseMetaData> xMeta = xConnection->getMetaData();
@@ -700,7 +700,7 @@ void OComboBoxModel::onConnectedDbColumn( const Reference< XInterface >& _rxForm
getPropertyValue( PROPERTY_STRINGITEMLIST ) >>= m_aDesignModeStringItems;
// Daten nur laden, wenn eine Listenquelle angegeben wurde
- if ( m_aListSource.getLength() && m_xCursor.is() && !hasExternalListSource() )
+ if ( !m_aListSource.isEmpty() && m_xCursor.is() && !hasExternalListSource() )
loadData( false );
}
@@ -722,7 +722,7 @@ void SAL_CALL OComboBoxModel::reloaded( const EventObject& aEvent ) throw(Runtim
OBoundControlModel::reloaded(aEvent);
// reload data if we have a list source
- if ( m_aListSource.getLength() && m_xCursor.is() && !hasExternalListSource() )
+ if ( !m_aListSource.isEmpty() && m_xCursor.is() && !hasExternalListSource() )
loadData( false );
}
@@ -745,7 +745,7 @@ sal_Bool OComboBoxModel::commitControlValueToDbColumn( bool _bPostReset )
if ( bModified )
{
if ( !aNewValue.hasValue()
- || ( !sNewValue.getLength() // an empty string
+ || ( sNewValue.isEmpty() // an empty string
&& m_bEmptyIsNull // which should be interpreted as NULL
)
)
@@ -814,7 +814,7 @@ Any OComboBoxModel::translateDbColumnToControlValue()
if ( m_pValueFormatter.get() )
{
::rtl::OUString sValue( m_pValueFormatter->getFormattedValue() );
- if ( !sValue.getLength()
+ if ( sValue.isEmpty()
&& m_pValueFormatter->getColumn().is()
&& m_pValueFormatter->getColumn()->wasNull()
)
diff --git a/forms/source/component/Currency.cxx b/forms/source/component/Currency.cxx
index 180c98556abe..08df529e57f5 100644
--- a/forms/source/component/Currency.cxx
+++ b/forms/source/component/Currency.cxx
@@ -127,7 +127,7 @@ void OCurrencyModel::implConstruct()
bPrependCurrencySymbol = sal_False;
break;
}
- if (sCurrencySymbol.getLength())
+ if (!sCurrencySymbol.isEmpty())
{
m_xAggregateSet->setPropertyValue(PROPERTY_CURRENCYSYMBOL, makeAny(sCurrencySymbol));
m_xAggregateSet->setPropertyValue(PROPERTY_CURRSYM_POSITION, makeAny(bPrependCurrencySymbol));
diff --git a/forms/source/component/DatabaseForm.cxx b/forms/source/component/DatabaseForm.cxx
index 9a4943fc23eb..5caf83a9f56b 100644
--- a/forms/source/component/DatabaseForm.cxx
+++ b/forms/source/component/DatabaseForm.cxx
@@ -510,7 +510,7 @@ ODatabaseForm::~ODatabaseForm()
{
aName = pSuccObj->aName;
aValue = pSuccObj->aValue;
- if( pSuccObj->nRepresentation == SUCCESSFUL_REPRESENT_FILE && aValue.getLength() )
+ if( pSuccObj->nRepresentation == SUCCESSFUL_REPRESENT_FILE && !aValue.isEmpty() )
{
// Bei File-URLs wird der Dateiname und keine URL uebertragen,
// weil Netscape dies so macht.
@@ -635,7 +635,7 @@ void ODatabaseForm::AppendComponent(HtmlSuccessfulObjList& rList, const Referenc
xComponentSet->getPropertyValue(PROPERTY_CLASSID) >>= nClassId;
::rtl::OUString aName;
xComponentSet->getPropertyValue( PROPERTY_NAME ) >>= aName;
- if( !aName.getLength() && nClassId != FormComponentType::IMAGEBUTTON)
+ if( aName.isEmpty() && nClassId != FormComponentType::IMAGEBUTTON)
return;
else // Name um den Prefix erweitern
aName = rNamePrefix + aName;
@@ -675,12 +675,12 @@ void ODatabaseForm::AppendComponent(HtmlSuccessfulObjList& rList, const Referenc
::rtl::OUString aRhs = ::rtl::OUString::valueOf( MouseEvt.X );
// nur wenn ein Name vorhanden ist, kann ein name.x
- aLhs += aName.getLength() ? UniString::CreateFromAscii(".x") : UniString::CreateFromAscii("x");
+ aLhs += !aName.isEmpty() ? UniString::CreateFromAscii(".x") : UniString::CreateFromAscii("x");
rList.push_back( HtmlSuccessfulObj(aLhs, aRhs) );
aLhs = aName;
aRhs = ::rtl::OUString::valueOf( MouseEvt.Y );
- aLhs += aName.getLength() ? UniString::CreateFromAscii(".y") : UniString::CreateFromAscii("y");
+ aLhs += !aName.isEmpty() ? UniString::CreateFromAscii(".y") : UniString::CreateFromAscii("y");
rList.push_back( HtmlSuccessfulObj(aLhs, aRhs) );
}
@@ -907,7 +907,7 @@ void ODatabaseForm::AppendComponent(HtmlSuccessfulObjList& rList, const Referenc
for(i=0; i<nCurCnt; ++i )
{
sal_Int16 nSelPos = pSels[i];
- if (nSelPos < nValCnt && pVals[nSelPos].getLength())
+ if (nSelPos < nValCnt && !pVals[nSelPos].isEmpty())
{
aSubValue = pVals[nSelPos];
}
@@ -1261,7 +1261,7 @@ sal_Bool ODatabaseForm::executeRowSet(::osl::ResettableMutexGuard& _rClearForNot
catch(const SQLException& eDb)
{
_rClearForNotifies.clear();
- if (m_sCurrentErrorContext.getLength())
+ if (!m_sCurrentErrorContext.isEmpty())
onError(eDb, m_sCurrentErrorContext);
else
onError(eDb, FRM_RES_STRING(RID_STR_READERROR));
@@ -1303,7 +1303,7 @@ sal_Bool ODatabaseForm::executeRowSet(::osl::ResettableMutexGuard& _rClearForNot
catch(const SQLException& eDB)
{
_rClearForNotifies.clear();
- if (m_sCurrentErrorContext.getLength())
+ if (!m_sCurrentErrorContext.isEmpty())
onError(eDB, m_sCurrentErrorContext);
else
onError(eDB, FRM_RES_STRING(RID_STR_READERROR));
@@ -1864,7 +1864,7 @@ PropertyState ODatabaseForm::getPropertyStateByHandle(sal_Int32 nHandle)
break;
case PROPERTY_ID_FILTER:
- if ( !m_aFilterManager.getFilterComponent( FilterManager::fcPublicFilter ).getLength() )
+ if ( m_aFilterManager.getFilterComponent( FilterManager::fcPublicFilter ).isEmpty() )
eState = PropertyState_DEFAULT_VALUE;
else
eState = PropertyState_DIRECT_VALUE;
@@ -2140,7 +2140,7 @@ void SAL_CALL ODatabaseForm::submit( const Reference<XControl>& Control,
{
::osl::MutexGuard aGuard(m_aMutex);
// Sind Controls und eine Submit-URL vorhanden?
- if( !getCount() || !m_aTargetURL.getLength() )
+ if( !getCount() || m_aTargetURL.isEmpty() )
return;
}
@@ -2541,7 +2541,7 @@ void SAL_CALL ODatabaseForm::setGroup( const Sequence<Reference<XControlModel> >
continue;
}
- if (!sGroupName.getLength())
+ if (sGroupName.isEmpty())
xSet->getPropertyValue(PROPERTY_NAME) >>= sGroupName;
else
xSet->setPropertyValue(PROPERTY_NAME, makeAny(sGroupName));
@@ -2715,7 +2715,7 @@ sal_Bool ODatabaseForm::canShareConnection( const Reference< XPropertySet >& _rx
// both rowsets share are connected to the same data source
if ( sParentDataSource == sOwnDatasource )
{
- if ( 0 != sParentDataSource.getLength() )
+ if ( !sParentDataSource.isEmpty() )
// and it's really a data source name (not empty)
bCanShareConnection = sal_True;
else
@@ -2894,7 +2894,7 @@ void ODatabaseForm::load_impl(sal_Bool bCausedByParentForm, sal_Bool bMoveToFirs
sal_Bool bConnected = implEnsureConnection();
// we don't have to execute if we do not have a command to execute
- sal_Bool bExecute = bConnected && m_xAggregateSet.is() && getString(m_xAggregateSet->getPropertyValue(PROPERTY_COMMAND)).getLength();
+ sal_Bool bExecute = bConnected && m_xAggregateSet.is() && !getString(m_xAggregateSet->getPropertyValue(PROPERTY_COMMAND)).isEmpty();
// a database form always uses caching
// we use starting fetchsize with at least 10 rows
diff --git a/forms/source/component/Edit.cxx b/forms/source/component/Edit.cxx
index ee9f50ceb2ed..8199fbb469cb 100644
--- a/forms/source/component/Edit.cxx
+++ b/forms/source/component/Edit.cxx
@@ -227,7 +227,7 @@ void OEditControl::keyPressed(const ::com::sun::star::awt::KeyEvent& e) throw (
aTmp = xFormSet->getPropertyValue( PROPERTY_TARGET_URL );
if (!aTmp.getValueType().equals(::getCppuType((const ::rtl::OUString*)NULL)) ||
- !getString(aTmp).getLength() )
+ getString(aTmp).isEmpty() )
return;
Reference<XIndexAccess> xElements(xParent, UNO_QUERY);
@@ -489,7 +489,7 @@ namespace
::rtl::OString sMessage( "could not transfer the property named '" );
sMessage += ::rtl::OString( pSourceProps->Name.getStr(), pSourceProps->Name.getLength(), RTL_TEXTENCODING_ASCII_US );
sMessage += ::rtl::OString( "'." );
- if ( e.Message.getLength() )
+ if ( !e.Message.isEmpty() )
{
sMessage += ::rtl::OString( "\n\nMessage:\n" );
sMessage += ::rtl::OString( e.Message.getStr(), e.Message.getLength(), RTL_TEXTENCODING_ASCII_US );
@@ -686,7 +686,7 @@ sal_Bool OEditModel::commitControlValueToDbColumn( bool /*_bPostReset*/ )
aNewValue >>= sNewValue;
if ( !aNewValue.hasValue()
- || ( !sNewValue.getLength() // an empty string
+ || ( sNewValue.isEmpty() // an empty string
&& m_bEmptyIsNull // which should be interpreted as NULL
)
)
@@ -723,7 +723,7 @@ Any OEditModel::translateDbColumnToControlValue()
if ( m_pValueFormatter.get() )
{
::rtl::OUString sValue( m_pValueFormatter->getFormattedValue() );
- if ( !sValue.getLength()
+ if ( sValue.isEmpty()
&& m_pValueFormatter->getColumn().is()
&& m_pValueFormatter->getColumn()->wasNull()
)
diff --git a/forms/source/component/EditBase.cxx b/forms/source/component/EditBase.cxx
index 82788f9135ac..4b61b5560c94 100644
--- a/forms/source/component/EditBase.cxx
+++ b/forms/source/component/EditBase.cxx
@@ -190,7 +190,7 @@ void OEditBaseModel::read(const Reference<XObjectInputStream>& _rxInStream) thro
readCommonEditProperties(_rxInStream);
// Nach dem Lesen die Defaultwerte anzeigen
- if ( getControlSource().getLength() )
+ if ( !getControlSource().isEmpty() )
// (not if we don't have a control source - the "State" property acts like it is persistent, then)
resetNoBroadcast();
};
diff --git a/forms/source/component/Filter.cxx b/forms/source/component/Filter.cxx
index 3e1225657348..900e5c87fedb 100644
--- a/forms/source/component/Filter.cxx
+++ b/forms/source/component/Filter.cxx
@@ -350,7 +350,7 @@ namespace frm
if ( itemPos != m_aDisplayItemToValueItem.end() )
{
sItemText = itemPos->second;
- if ( sItemText.getLength() )
+ if ( !sItemText.isEmpty() )
{
::dbtools::OPredicateInputController aPredicateInput( maContext.getLegacyServiceFactory(), m_xConnection, getParseContext() );
::rtl::OUString sErrorMessage;
@@ -443,7 +443,7 @@ namespace frm
aStatement.append( sQuoteChar );
// if the field had an alias in our form's statement, give it this alias in the new statement, too
- if ( sFieldName.getLength() && ( sFieldName != sRealFieldName ) )
+ if ( !sFieldName.isEmpty() && ( sFieldName != sRealFieldName ) )
{
aStatement.appendAscii(" AS ");
aStatement.append( sQuoteChar );
@@ -535,7 +535,7 @@ namespace frm
// check the text with the SQL-Parser
::rtl::OUString aNewText(aText);
aNewText.trim();
- if ( aNewText.getLength() )
+ if ( !aNewText.isEmpty() )
{
::dbtools::OPredicateInputController aPredicateInput( maContext.getLegacyServiceFactory(), m_xConnection, getParseContext() );
::rtl::OUString sErrorMessage;
@@ -642,12 +642,12 @@ namespace frm
}
}
- OSL_ENSURE( ( itemPos != m_aDisplayItemToValueItem.end() ) || ( m_aText.getLength() == 0 ),
+ OSL_ENSURE( ( itemPos != m_aDisplayItemToValueItem.end() ) || m_aText.isEmpty(),
"OFilterControl::setText: this text is not in my display list!" );
if ( itemPos == m_aDisplayItemToValueItem.end() )
m_aText = ::rtl::OUString();
- if ( m_aText.getLength() == 0)
+ if ( m_aText.isEmpty() )
{
while ( xListBox->getSelectedItemPos() >= 0 )
{
diff --git a/forms/source/component/FormComponent.cxx b/forms/source/component/FormComponent.cxx
index 3c3e13b00c9e..291384948ebe 100644
--- a/forms/source/component/FormComponent.cxx
+++ b/forms/source/component/FormComponent.cxx
@@ -601,7 +601,7 @@ OControlModel::OControlModel(
// #i37342#
{
DBG_CTOR(OControlModel, NULL);
- if (_rUnoControlModelTypeName.getLength()) // the is a model we have to aggregate
+ if (!_rUnoControlModelTypeName.isEmpty()) // the is a model we have to aggregate
{
increment(m_refCount);
@@ -613,7 +613,7 @@ OControlModel::OControlModel(
{
try
{
- if ( rDefault.getLength() )
+ if ( !rDefault.isEmpty() )
m_xAggregateSet->setPropertyValue( PROPERTY_DEFAULTCONTROL, makeAny( rDefault ) );
}
catch( const Exception& )
@@ -1392,7 +1392,7 @@ void OBoundControlModel::implInitValuePropertyListening( ) const
if ( m_bSupportsExternalBinding || m_bSupportsValidation || !m_bCommitable )
{
OSL_ENSURE( m_pAggPropMultiplexer, "OBoundControlModel::implInitValuePropertyListening: no multiplexer!" );
- if ( m_pAggPropMultiplexer && m_sValuePropertyName.getLength() )
+ if ( m_pAggPropMultiplexer && !m_sValuePropertyName.isEmpty() )
m_pAggPropMultiplexer->addProperty( m_sValuePropertyName );
}
}
@@ -1400,18 +1400,18 @@ void OBoundControlModel::implInitValuePropertyListening( ) const
//-----------------------------------------------------------------------------
void OBoundControlModel::initOwnValueProperty( const ::rtl::OUString& i_rValuePropertyName )
{
- OSL_PRECOND( !m_sValuePropertyName.getLength() && -1 == m_nValuePropertyAggregateHandle,
+ OSL_PRECOND( m_sValuePropertyName.isEmpty() && -1 == m_nValuePropertyAggregateHandle,
"OBoundControlModel::initOwnValueProperty: value property is already initialized!" );
- OSL_ENSURE( i_rValuePropertyName.getLength(), "OBoundControlModel::initOwnValueProperty: invalid property name!" );
+ OSL_ENSURE( !i_rValuePropertyName.isEmpty(), "OBoundControlModel::initOwnValueProperty: invalid property name!" );
m_sValuePropertyName = i_rValuePropertyName;
}
//-----------------------------------------------------------------------------
void OBoundControlModel::initValueProperty( const ::rtl::OUString& _rValuePropertyName, sal_Int32 _nValuePropertyExternalHandle )
{
- OSL_PRECOND( !m_sValuePropertyName.getLength() && -1 == m_nValuePropertyAggregateHandle,
+ OSL_PRECOND( m_sValuePropertyName.isEmpty() && -1 == m_nValuePropertyAggregateHandle,
"OBoundControlModel::initValueProperty: value property is already initialized!" );
- OSL_ENSURE( _rValuePropertyName.getLength(), "OBoundControlModel::initValueProperty: invalid property name!" );
+ OSL_ENSURE( !_rValuePropertyName.isEmpty(), "OBoundControlModel::initValueProperty: invalid property name!" );
OSL_ENSURE( _nValuePropertyExternalHandle != -1, "OBoundControlModel::initValueProperty: invalid property handle!" );
m_sValuePropertyName = _rValuePropertyName;
@@ -1433,7 +1433,7 @@ void OBoundControlModel::initValueProperty( const ::rtl::OUString& _rValueProper
//-----------------------------------------------------------------------------
void OBoundControlModel::suspendValueListening( )
{
- OSL_PRECOND( m_sValuePropertyName.getLength(), "OBoundControlModel::suspendValueListening: don't have a value property!" );
+ OSL_PRECOND( !m_sValuePropertyName.isEmpty(), "OBoundControlModel::suspendValueListening: don't have a value property!" );
OSL_PRECOND( m_pAggPropMultiplexer, "OBoundControlModel::suspendValueListening: I *am* not listening!" );
if ( m_pAggPropMultiplexer )
@@ -1443,7 +1443,7 @@ void OBoundControlModel::suspendValueListening( )
//-----------------------------------------------------------------------------
void OBoundControlModel::resumeValueListening( )
{
- OSL_PRECOND( m_sValuePropertyName.getLength(), "OBoundControlModel::resumeValueListening: don't have a value property!" );
+ OSL_PRECOND( !m_sValuePropertyName.isEmpty(), "OBoundControlModel::resumeValueListening: don't have a value property!" );
OSL_PRECOND( m_pAggPropMultiplexer, "OBoundControlModel::resumeValueListening: I *am* not listening at all!" );
OSL_PRECOND( !m_pAggPropMultiplexer || m_pAggPropMultiplexer->locked(), "OBoundControlModel::resumeValueListening: listening not suspended currently!" );
@@ -1554,9 +1554,9 @@ void OBoundControlModel::_propertyChanged( const PropertyChangeEvent& _rEvt ) th
void OBoundControlModel::startAggregatePropertyListening( const ::rtl::OUString& _rPropertyName )
{
OSL_PRECOND( m_pAggPropMultiplexer, "OBoundControlModel::startAggregatePropertyListening: no multiplexer!" );
- OSL_ENSURE( _rPropertyName.getLength(), "OBoundControlModel::startAggregatePropertyListening: invalid property name!" );
+ OSL_ENSURE( !_rPropertyName.isEmpty(), "OBoundControlModel::startAggregatePropertyListening: invalid property name!" );
- if ( m_pAggPropMultiplexer && _rPropertyName.getLength() )
+ if ( m_pAggPropMultiplexer && !_rPropertyName.isEmpty() )
{
m_pAggPropMultiplexer->addProperty( _rPropertyName );
}
@@ -2036,7 +2036,7 @@ sal_Bool SAL_CALL OBoundControlModel::commit() throw(RuntimeException)
// in most cases, no action is required: For most derivees, we know the value property of
// our control (see initValueProperty), and when an external binding is active, we
// instantly forward all changes in this property to the external binding.
- if ( !m_sValuePropertyName.getLength() )
+ if ( m_sValuePropertyName.isEmpty() )
// but for those derivees which did not use this feature, we need an
// explicit transfer
transferControlValueToExternal( aLock );
@@ -2337,7 +2337,7 @@ void OBoundControlModel::doSetControlValue( const Any& _rValue )
{
OSL_PRECOND( m_xAggregateFastSet.is() && m_xAggregateSet.is(),
"OBoundControlModel::doSetControlValue: invalid aggregate !" );
- OSL_PRECOND( m_sValuePropertyName.getLength() || ( m_nValuePropertyAggregateHandle != -1 ),
+ OSL_PRECOND( !m_sValuePropertyName.isEmpty() || ( m_nValuePropertyAggregateHandle != -1 ),
"OBoundControlModel::doSetControlValue: please override if you have own value property handling!" );
try
@@ -2350,7 +2350,7 @@ void OBoundControlModel::doSetControlValue( const Any& _rValue )
{
m_xAggregateFastSet->setFastPropertyValue( m_nValuePropertyAggregateHandle, _rValue );
}
- else if ( m_sValuePropertyName.getLength() && m_xAggregateSet.is() )
+ else if ( !m_sValuePropertyName.isEmpty() && m_xAggregateSet.is() )
{
m_xAggregateSet->setPropertyValue( m_sValuePropertyName, _rValue );
}
@@ -2895,7 +2895,7 @@ Any OBoundControlModel::getControlValue( ) const
{
OSL_PRECOND( m_xAggregateFastSet.is() && m_xAggregateSet.is(),
"OBoundControlModel::getControlValue: invalid aggregate !" );
- OSL_PRECOND( m_sValuePropertyName.getLength() || ( m_nValuePropertyAggregateHandle != -1 ),
+ OSL_PRECOND( !m_sValuePropertyName.isEmpty() || ( m_nValuePropertyAggregateHandle != -1 ),
"OBoundControlModel::getControlValue: please override if you have own value property handling!" );
// determine the current control value
@@ -2904,7 +2904,7 @@ Any OBoundControlModel::getControlValue( ) const
{
aControlValue = m_xAggregateFastSet->getFastPropertyValue( m_nValuePropertyAggregateHandle );
}
- else if ( m_sValuePropertyName.getLength() && m_xAggregateSet.is() )
+ else if ( !m_sValuePropertyName.isEmpty() && m_xAggregateSet.is() )
{
aControlValue = m_xAggregateSet->getPropertyValue( m_sValuePropertyName );
}
diff --git a/forms/source/component/FormattedField.cxx b/forms/source/component/FormattedField.cxx
index 5a572cb1041d..aabe3592bc93 100644
--- a/forms/source/component/FormattedField.cxx
+++ b/forms/source/component/FormattedField.cxx
@@ -278,7 +278,7 @@ void OFormattedControl::keyPressed(const ::com::sun::star::awt::KeyEvent& e) thr
Any aTmp(xFormSet->getPropertyValue( PROPERTY_TARGET_URL ));
if (!isA(aTmp, static_cast< ::rtl::OUString* >(NULL)) ||
- !getString(aTmp).getLength() )
+ getString(aTmp).isEmpty() )
return;
Reference<XIndexAccess> xElements(xParent, UNO_QUERY);
@@ -981,7 +981,7 @@ void OFormattedModel::read(const Reference<XObjectInputStream>& _rxInStream) thr
// this property is only to be set if we have no control source : in all other cases the base class did a
// reset after it's read and this set the effective value to a default value
- if ( m_xAggregateSet.is() && ( getControlSource().getLength() == 0 ) )
+ if ( m_xAggregateSet.is() && getControlSource().isEmpty() )
{
try
{
@@ -1029,7 +1029,7 @@ sal_Bool OFormattedModel::commitControlValueToDbColumn( bool /*_bPostReset*/ )
// Leerstring + EmptyIsNull = void
if ( !aControlValue.hasValue()
|| ( ( aControlValue.getValueType().getTypeClass() == TypeClass_STRING )
- && ( getString( aControlValue ).getLength() == 0 )
+ && getString( aControlValue ).isEmpty()
&& m_bEmptyIsNull
)
)
diff --git a/forms/source/component/GroupManager.cxx b/forms/source/component/GroupManager.cxx
index 59321ba7af22..873a77058763 100644
--- a/forms/source/component/GroupManager.cxx
+++ b/forms/source/component/GroupManager.cxx
@@ -352,14 +352,14 @@ void SAL_CALL OGroupManager::propertyChange(const PropertyChangeEvent& evt) thro
if (hasProperty( PROPERTY_GROUP_NAME, xSet ))
xSet->getPropertyValue( PROPERTY_GROUP_NAME ) >>= sGroupName;
if (evt.PropertyName == PROPERTY_NAME) {
- if (sGroupName.getLength() > 0)
+ if (!sGroupName.isEmpty())
return; // group hasn't changed; ignore this name change.
// no GroupName; use Name as GroupNme
evt.OldValue >>= sGroupName;
}
else if (evt.PropertyName == PROPERTY_GROUP_NAME) {
evt.OldValue >>= sGroupName;
- if (sGroupName.getLength() == 0) {
+ if (sGroupName.isEmpty()) {
// No prior GroupName; fallback to Nme
xSet->getPropertyValue( PROPERTY_NAME ) >>= sGroupName;
}
@@ -516,7 +516,7 @@ void OGroupManager::RemoveElement( const Reference<XPropertySet>& xSet )
::rtl::OUString sGroupName;
if (hasProperty( PROPERTY_GROUP_NAME, xComponent )) {
xComponent->getPropertyValue( PROPERTY_GROUP_NAME ) >>= sGroupName;
- if (sGroupName.getLength() == 0)
+ if (sGroupName.isEmpty())
xComponent->getPropertyValue( PROPERTY_NAME ) >>= sGroupName;
}
else
diff --git a/forms/source/component/ImageControl.cxx b/forms/source/component/ImageControl.cxx
index 611527690671..fc2503ab307d 100644
--- a/forms/source/component/ImageControl.cxx
+++ b/forms/source/component/ImageControl.cxx
@@ -412,7 +412,7 @@ void OImageControlModel::read(const Reference<XObjectInputStream>& _rxInStream)
break;
}
// Nach dem Lesen die Defaultwerte anzeigen
- if ( getControlSource().getLength() )
+ if ( !getControlSource().isEmpty() )
{ // (not if we don't have a control source - the "State" property acts like it is persistent, then
::osl::MutexGuard aGuard(m_aMutex); // resetNoBroadcast expects this mutex guarding
resetNoBroadcast();
@@ -474,7 +474,7 @@ sal_Bool OImageControlModel::impl_handleNewImageURL_lck( ValueChangeInstigator _
case ImageStoreLink:
{
::rtl::OUString sCommitURL( m_sImageURL );
- if ( m_sDocumentURL.getLength() )
+ if ( !m_sDocumentURL.isEmpty() )
sCommitURL = URIHelper::simpleNormalizedMakeRelative( m_sDocumentURL, sCommitURL );
OSL_ENSURE( m_xColumnUpdate.is(), "OImageControlModel::impl_handleNewImageURL_lck: no bound field, but ImageStoreLink?!" );
if ( m_xColumnUpdate.is() )
@@ -524,7 +524,7 @@ namespace
{
bool lcl_isValidDocumentURL( const ::rtl::OUString& _rDocURL )
{
- return ( _rDocURL.getLength() && !_rDocURL.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "private:object" ) ) );
+ return ( !_rDocURL.isEmpty() && !_rDocURL.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "private:object" ) ) );
}
}
@@ -581,7 +581,7 @@ Any OImageControlModel::translateDbColumnToControlValue()
case ImageStoreLink:
{
::rtl::OUString sImageLink( m_xColumn->getString() );
- if ( m_sDocumentURL.getLength() )
+ if ( !m_sDocumentURL.isEmpty() )
sImageLink = INetURLObject::GetAbsURL( m_sDocumentURL, sImageLink );
return makeAny( sImageLink );
}
@@ -800,7 +800,7 @@ void OImageControlControl::implClearGraphics( sal_Bool _bForce )
::rtl::OUString sOldImageURL;
xSet->getPropertyValue( PROPERTY_IMAGE_URL ) >>= sOldImageURL;
- if ( !sOldImageURL.getLength() )
+ if ( sOldImageURL.isEmpty() )
// the ImageURL is already empty, so simply setting a new empty one would not suffice
// (since it would be ignored)
xSet->setPropertyValue( PROPERTY_IMAGE_URL, makeAny( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "private:emptyImage" ) ) ) );
@@ -976,7 +976,7 @@ void OImageControlControl::mousePressed(const ::com::sun::star::awt::MouseEvent&
{
// but only if our IMAGE_URL property is handled as if it is transient, which is equivalent to
// an empty control source
- if (!hasProperty(PROPERTY_CONTROLSOURCE, xSet) || (::comphelper::getString(xSet->getPropertyValue(PROPERTY_CONTROLSOURCE)).getLength() != 0))
+ if ( !hasProperty(PROPERTY_CONTROLSOURCE, xSet) || !::comphelper::getString(xSet->getPropertyValue(PROPERTY_CONTROLSOURCE)).isEmpty() )
return;
}
diff --git a/forms/source/component/ListBox.cxx b/forms/source/component/ListBox.cxx
index c0b00a1bd49b..b12d95b982d3 100644
--- a/forms/source/component/ListBox.cxx
+++ b/forms/source/component/ListBox.cxx
@@ -636,7 +636,7 @@ namespace frm
readCommonProperties(_rxInStream);
// Nach dem Lesen die Defaultwerte anzeigen
- if ( getControlSource().getLength() )
+ if ( !getControlSource().isEmpty() )
// (not if we don't have a control source - the "State" property acts like it is persistent, then
resetNoBroadcast();
}
@@ -672,7 +672,7 @@ namespace frm
);
// outta here if we don't have all pre-requisites
- if ( !xConnection.is() || !sListSource.getLength() )
+ if ( !xConnection.is() || sListSource.isEmpty() )
{
ValueList().swap(m_aBoundValues);
return;
@@ -743,17 +743,17 @@ namespace frm
}
}
}
- if (!aFieldName.getLength())
+ if (aFieldName.isEmpty())
break;
Reference<XDatabaseMetaData> xMeta = xConnection->getMetaData();
::rtl::OUString aQuote = xMeta->getIdentifierQuoteString();
::rtl::OUString aStatement(RTL_CONSTASCII_USTRINGPARAM("SELECT "));
- if (!aBoundFieldName.getLength()) // act like a combobox
+ if (aBoundFieldName.isEmpty()) // act like a combobox
aStatement += ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("DISTINCT ") );
aStatement += quoteName(aQuote,aFieldName);
- if (aBoundFieldName.getLength())
+ if (!aBoundFieldName.isEmpty())
{
aStatement += ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(", ") );
aStatement += quoteName(aQuote, aBoundFieldName);
@@ -877,7 +877,7 @@ namespace frm
aValueList.push_back( aBoundValue );
}
- if ( bUseNULL && ( m_nNULLPos == -1 ) && !aStr.getLength() )
+ if ( bUseNULL && ( m_nNULLPos == -1 ) && aStr.isEmpty() )
m_nNULLPos = sal_Int16( aDisplayList.size() - 1 );
}
}
diff --git a/forms/source/component/Pattern.cxx b/forms/source/component/Pattern.cxx
index 50c621ab042b..55aea67e95c9 100644
--- a/forms/source/component/Pattern.cxx
+++ b/forms/source/component/Pattern.cxx
@@ -171,7 +171,7 @@ sal_Bool OPatternModel::commitControlValueToDbColumn( bool /*_bPostReset*/ )
aNewValue >>= sNewValue;
if ( !aNewValue.hasValue()
- || ( !sNewValue.getLength() // an empty string
+ || ( sNewValue.isEmpty() // an empty string
&& m_bEmptyIsNull // which should be interpreted as NULL
)
)
@@ -222,7 +222,7 @@ Any OPatternModel::translateDbColumnToControlValue()
if ( m_pFormattedValue.get() )
{
::rtl::OUString sValue( m_pFormattedValue->getFormattedValue() );
- if ( !sValue.getLength()
+ if ( sValue.isEmpty()
&& m_pFormattedValue->getColumn().is()
&& m_pFormattedValue->getColumn()->wasNull()
)
diff --git a/forms/source/component/RadioButton.cxx b/forms/source/component/RadioButton.cxx
index 77c0ee6a1c05..4160d8ba6c4d 100644
--- a/forms/source/component/RadioButton.cxx
+++ b/forms/source/component/RadioButton.cxx
@@ -168,7 +168,7 @@ void ORadioButtonModel::SetSiblingPropsTo(const ::rtl::OUString& rPropName, cons
::rtl::OUString sMyGroup;
if (hasProperty(PROPERTY_GROUP_NAME, this))
this->getPropertyValue(PROPERTY_GROUP_NAME) >>= sMyGroup;
- if (sMyGroup.getLength() == 0)
+ if (sMyGroup.isEmpty())
sMyGroup = m_aName;
// meine Siblings durchiterieren
@@ -276,9 +276,9 @@ void ORadioButtonModel::setControlSource()
xSiblingProperties->getPropertyValue(PROPERTY_GROUP_NAME) >>= sSiblingGroupName;
xSiblingProperties->getPropertyValue(PROPERTY_NAME) >>= sSiblingName;
- if ((sGroupName.getLength() == 0 && sSiblingGroupName.getLength() == 0 && // (no group name
+ if ((sGroupName.isEmpty() && sSiblingGroupName.isEmpty() && // (no group name
sName == sSiblingName) || // names match) or
- (sGroupName.getLength() != 0 && sSiblingGroupName.getLength() != 0 && // (have group name
+ (!sGroupName.isEmpty() && !sSiblingGroupName.isEmpty() && // (have group name
sGroupName == sSiblingGroupName)) // they match)
{
setPropertyValue(PROPERTY_CONTROLSOURCE, xSiblingProperties->getPropertyValue(PROPERTY_CONTROLSOURCE));
@@ -358,7 +358,7 @@ void SAL_CALL ORadioButtonModel::read(const Reference<XObjectInputStream>& _rxIn
setDefaultChecked( (ToggleState)nDefaultChecked );
// Nach dem Lesen die Defaultwerte anzeigen
- if ( getControlSource().getLength() )
+ if ( !getControlSource().isEmpty() )
// (not if we don't have a control source - the "State" property acts like it is persistent, then
resetNoBroadcast();
}
diff --git a/forms/source/component/clickableimage.cxx b/forms/source/component/clickableimage.cxx
index 0fcbe3e4e3fe..d57c80a9ea1b 100644
--- a/forms/source/component/clickableimage.cxx
+++ b/forms/source/component/clickableimage.cxx
@@ -279,7 +279,7 @@ namespace frm
aURL.Complete =
getString(xSet->getPropertyValue(PROPERTY_TARGET_URL));
- if (aURL.Complete.getLength() && (LOCAL_URL_PREFIX == aURL.Complete.getStr()[0]))
+ if (!aURL.Complete.isEmpty() && (LOCAL_URL_PREFIX == aURL.Complete.getStr()[0]))
{ // the URL contains a local URL only. Since the URLTransformer does not handle this case correctly
// (it can't: it does not know the document URL), we have to take care for this ourself.
// The real solution would be to not allow such relative URLs (there is a rule that at runtime, all
@@ -719,7 +719,7 @@ namespace frm
//------------------------------------------------------------------------------
void OClickableImageBaseModel::SetURL( const ::rtl::OUString& rURL )
{
- if (m_pMedium || !rURL.getLength())
+ if (m_pMedium || rURL.isEmpty())
{
// Den Stream am Producer freigeben, bevor das Medium geloscht wird.
GetImageProducer()->SetImage(String());
@@ -733,7 +733,7 @@ namespace frm
// we treat an invalid URL like we would treat no URL
return;
- if (rURL.getLength() && !::svt::GraphicAccess::isSupportedURL( rURL ) )
+ if (!rURL.isEmpty() && !::svt::GraphicAccess::isSupportedURL( rURL ) )
{
if (m_pMedium)
delete m_pMedium;
@@ -823,7 +823,7 @@ namespace frm
if( xModel.is() )
{
::rtl::OUString sReferer( xModel->getURL() );
- if( sReferer.getLength() )
+ if( !sReferer.isEmpty() )
m_pMedium->SetReferer( sReferer );
}
#endif
diff --git a/forms/source/component/errorbroadcaster.cxx b/forms/source/component/errorbroadcaster.cxx
index b0ab6a5c47cb..c9648ddd91f6 100644
--- a/forms/source/component/errorbroadcaster.cxx
+++ b/forms/source/component/errorbroadcaster.cxx
@@ -74,7 +74,7 @@ namespace frm
void SAL_CALL OErrorBroadcaster::onError( const SQLException& _rException, const ::rtl::OUString& _rContextDescription )
{
Any aError;
- if ( _rContextDescription.getLength() )
+ if ( !_rContextDescription.isEmpty() )
aError = makeAny( prependErrorInfo( _rException, static_cast< XSQLErrorBroadcaster* >( this ), _rContextDescription ) );
else
aError = makeAny( _rException );
diff --git a/forms/source/component/imgprod.cxx b/forms/source/component/imgprod.cxx
index f77e9b5a352e..674dbec55590 100644
--- a/forms/source/component/imgprod.cxx
+++ b/forms/source/component/imgprod.cxx
@@ -247,7 +247,7 @@ void ImageProducer::SetImage( const ::rtl::OUString& rPath )
{
mpStm = ::svt::GraphicAccess::getImageStream( ::comphelper::getProcessServiceFactory(), maURL );
}
- else if( maURL.getLength() )
+ else if( !maURL.isEmpty() )
{
SvStream* pIStm = ::utl::UcbStreamHelper::CreateStream( maURL, STREAM_STD_READ );
mpStm = pIStm ? new SvStream( new ImgProdLockBytes( pIStm, sal_True ) ) : NULL;
diff --git a/forms/source/component/refvaluecomponent.cxx b/forms/source/component/refvaluecomponent.cxx
index f9103a2f411b..5950a854e4ff 100644
--- a/forms/source/component/refvaluecomponent.cxx
+++ b/forms/source/component/refvaluecomponent.cxx
@@ -178,7 +178,7 @@ namespace frm
::std::list< Type > aTypes;
aTypes.push_back( ::getCppuType( static_cast< sal_Bool* >( NULL ) ) );
- if ( m_sReferenceValue.getLength() )
+ if ( !m_sReferenceValue.isEmpty() )
aTypes.push_front( ::getCppuType( static_cast< ::rtl::OUString* >( NULL ) ) );
// push_front, because this is the preferred type
diff --git a/forms/source/inc/forms_module_impl.hxx b/forms/source/inc/forms_module_impl.hxx
index d2bb8f3a8c62..6c7dd8fbc0d7 100644
--- a/forms/source/inc/forms_module_impl.hxx
+++ b/forms/source/inc/forms_module_impl.hxx
@@ -113,7 +113,7 @@ namespace FORMS_MODULE_NAMESPACE
const Reference< XMultiServiceFactory >& _rxServiceManager)
{
OSL_ENSURE(_rxServiceManager.is(), "OFormsModule::getComponentFactory : invalid argument (service manager) !");
- OSL_ENSURE(_rImplementationName.getLength(), "OFormsModule::getComponentFactory : invalid argument (implementation name) !");
+ OSL_ENSURE(!_rImplementationName.isEmpty(), "OFormsModule::getComponentFactory : invalid argument (implementation name) !");
if (!s_pImplementationNames)
{
diff --git a/forms/source/runtime/formoperations.cxx b/forms/source/runtime/formoperations.cxx
index aa0297a62cf3..7d01dbf13274 100644
--- a/forms/source/runtime/formoperations.cxx
+++ b/forms/source/runtime/formoperations.cxx
@@ -310,7 +310,7 @@ namespace frm
// and an active command
::rtl::OUString sActiveCommand;
m_xCursorProperties->getPropertyValue( PROPERTY_ACTIVECOMMAND ) >>= sActiveCommand;
- aState.Enabled &= sActiveCommand.getLength() > 0;
+ aState.Enabled &= !sActiveCommand.isEmpty();
}
break;
@@ -357,7 +357,7 @@ namespace frm
{
::rtl::OUString sFilter;
m_xCursorProperties->getPropertyValue( PROPERTY_FILTER ) >>= sFilter;
- if ( sFilter.getLength() )
+ if ( !sFilter.isEmpty() )
{
aState.State = m_xCursorProperties->getPropertyValue( PROPERTY_APPLYFILTER );
aState.Enabled = !impl_isInsertOnlyForm_throw();
@@ -1283,13 +1283,13 @@ namespace frm
bool FormOperations::impl_isParseable_throw() const
{
const_cast< FormOperations* >( this )->impl_ensureInitializedParser_nothrow();
- return m_xParser.is() && m_xParser->getQuery().getLength();
+ return m_xParser.is() && !m_xParser->getQuery().isEmpty();
}
//--------------------------------------------------------------------
bool FormOperations::impl_hasFilterOrOrder_throw() const
{
- return impl_isParseable_throw() && ( m_xParser->getFilter().getLength() || m_xParser->getOrder().getLength() );
+ return impl_isParseable_throw() && ( !m_xParser->getFilter().isEmpty() || !m_xParser->getOrder().isEmpty() );
}
//--------------------------------------------------------------------
diff --git a/forms/source/xforms/binding.cxx b/forms/source/xforms/binding.cxx
index af894207a92a..ae5c11e943fc 100644
--- a/forms/source/xforms/binding.cxx
+++ b/forms/source/xforms/binding.cxx
@@ -247,7 +247,7 @@ bool Binding::isValid()
maMIP.isConstraint() &&
( ! maMIP.isRequired() ||
( maBindingExpression.hasValue() &&
- maBindingExpression.getString().getLength() > 0 ) );
+ !maBindingExpression.getString().isEmpty() ) );
}
bool Binding::isUseful()
@@ -262,7 +262,7 @@ bool Binding::isUseful()
bool bUseful =
getModelImpl() == NULL
// || msBindingID.getLength() > 0
- || msTypeName.getLength() > 0
+ || ! msTypeName.isEmpty()
|| ! maReadonly.isEmptyExpression()
|| ! maRelevant.isEmptyExpression()
|| ! maRequired.isEmptyExpression()
@@ -280,14 +280,14 @@ OUString Binding::explainInvalid()
OUString sReason;
if( ! maBindingExpression.getNode().is() )
{
- sReason = ( maBindingExpression.getExpression().getLength() == 0 )
+ sReason = ( maBindingExpression.getExpression().isEmpty() )
? getResource( RID_STR_XFORMS_NO_BINDING_EXPRESSION )
: getResource( RID_STR_XFORMS_INVALID_BINDING_EXPRESSION );
}
else if( ! isValid_DataType() )
{
sReason = explainInvalid_DataType();
- if( sReason.getLength() == 0 )
+ if( sReason.isEmpty() )
{
// no explanation given by data type? Then give generic message
sReason = getResource( RID_STR_XFORMS_INVALID_VALUE,
@@ -299,13 +299,13 @@ OUString Binding::explainInvalid()
sReason = maMIP.getConstraintExplanation();
}
else if( maMIP.isRequired() && maBindingExpression.hasValue() &&
- ( maBindingExpression.getString().getLength() == 0 ) )
+ maBindingExpression.getString().isEmpty() )
{
sReason = getResource( RID_STR_XFORMS_REQUIRED );
}
// else: no explanation given; should only happen if data is valid
- OSL_ENSURE( ( sReason.getLength() == 0 ) == isValid(),
+ OSL_ENSURE( sReason.isEmpty() == isValid(),
"invalid data should have an explanation!" );
return sReason;
@@ -821,7 +821,7 @@ MIP Binding::getLocalMIP() const
if( ! aMIP.isConstraint() )
aMIP.setConstraintExplanation( msExplainConstraint );
}
- if( msTypeName.getLength() > 0 )
+ if( !msTypeName.isEmpty() )
aMIP.setTypeName( msTypeName );
// calculate: only handle presence of calculate; value set elsewhere
@@ -1024,7 +1024,7 @@ void Binding::_checkBindingID()
if( getModel().is() )
{
Reference<XNameAccess> xBindings( getModel()->getBindings(), UNO_QUERY_THROW );
- if( msBindingID.getLength() == 0 )
+ if( msBindingID.isEmpty() )
{
// no binding ID? then make one up!
OUString sIDPrefix = getResource( RID_STR_XFORMS_BINDING_UI_NAME );
diff --git a/forms/source/xforms/convert.cxx b/forms/source/xforms/convert.cxx
index 72ade2591603..2f11d39aaa12 100644
--- a/forms/source/xforms/convert.cxx
+++ b/forms/source/xforms/convert.cxx
@@ -386,7 +386,7 @@ namespace
if ( sFractional.getLength() > 2 )
// our precision is HundrethSeconds - it's all a css.util.Time can hold
sFractional = sFractional.copy( 0, 2 );
- if ( sFractional.getLength() )
+ if ( !sFractional.isEmpty() )
{
sal_Int32 nFractional = 0;
if ( StringTokenizer( sFractional, 0 ).getNextToken().toInt32( nFractional ) )
diff --git a/forms/source/xforms/datatypes.cxx b/forms/source/xforms/datatypes.cxx
index 74ebdc7d3db8..a5802d0f9b81 100644
--- a/forms/source/xforms/datatypes.cxx
+++ b/forms/source/xforms/datatypes.cxx
@@ -197,7 +197,7 @@ namespace xforms
{
if ( RID_STR_XFORMS_PATTERN_DOESNT_MATCH == nReason )
{
- OSL_ENSURE( m_sPattern.getLength(), "OXSDDataType::_explainInvalid: how can this error occur without a regular expression?" );
+ OSL_ENSURE( !m_sPattern.isEmpty(), "OXSDDataType::_explainInvalid: how can this error occur without a regular expression?" );
return m_sPattern;
}
return ::rtl::OUString();
@@ -241,7 +241,7 @@ namespace xforms
::rtl::OUString sConverted = Convert::convertWhitespace( _rValue, m_nWST );
// care for the regular expression
- if ( m_sPattern.getLength() )
+ if ( !m_sPattern.isEmpty() )
{
// ensure our pattern matcher is up to date
if ( m_bPatternMatcherDirty )
@@ -563,7 +563,7 @@ namespace xforms
break;
}
- return _rErrorMessage.getLength() == 0;
+ return _rErrorMessage.isEmpty();
}
//--------------------------------------------------------------------
diff --git a/forms/source/xforms/model.cxx b/forms/source/xforms/model.cxx
index 02b47256c341..91863d357877 100644
--- a/forms/source/xforms/model.cxx
+++ b/forms/source/xforms/model.cxx
@@ -402,7 +402,7 @@ void Model::loadInstance( sal_Int32 nInstance )
getInstanceData( aSequence, NULL, NULL, &sURL, &bOnce );
// if we have a URL, load the document and set it into the instance
- if( sURL.getLength() > 0 )
+ if( !sURL.isEmpty() )
{
try
{
diff --git a/forms/source/xforms/model_ui.cxx b/forms/source/xforms/model_ui.cxx
index 3acbe30a969a..ed830954d7a0 100644
--- a/forms/source/xforms/model_ui.cxx
+++ b/forms/source/xforms/model_ui.cxx
@@ -172,7 +172,7 @@ void lcl_OutName( OUStringBuffer& rBuffer,
{
rBuffer.insert( 0, xNode->getNodeName() );
OUString sPrefix = xNode->getPrefix();
- if( sPrefix.getLength() > 0 )
+ if( !sPrefix.isEmpty() )
{
rBuffer.insert( 0, sal_Unicode(':') );
rBuffer.insert( 0, sPrefix );
@@ -193,7 +193,7 @@ void lcl_OutInstance( OUStringBuffer& rBuffer,
OUString sInstanceName;
Reference<XEnumeration> xEnum =
pModel->getInstances()->createEnumeration();
- while( ( sInstanceName.getLength() == 0 ) && xEnum->hasMoreElements() )
+ while( sInstanceName.isEmpty() && xEnum->hasMoreElements() )
{
Sequence<PropertyValue> aValues;
xEnum->nextElement() >>= aValues;
@@ -370,7 +370,7 @@ OUString Model::getBindingName( const XPropertySet_t& xBinding,
xBinding->getPropertyValue( OUSTRING("BindingExpression" ) ) >>= sExpression;
OUStringBuffer aBuffer;
- if( sID.getLength() > 0 )
+ if( !sID.isEmpty() )
{
aBuffer.append( sID );
aBuffer.append( OUSTRING(" (" ));
@@ -867,7 +867,7 @@ OUString lcl_serializeForDisplay( const Reference<XNodeList>& xNodes )
while( ! xTextInputStream->isEOF() )
{
OUString sLine = xTextInputStream->readLine();
- if( sLine.getLength() > 0
+ if( !sLine.isEmpty()
&& sLine.compareToAscii( "<?xml", 5 ) != 0 )
{
aBuffer.append( sLine );
@@ -1024,9 +1024,9 @@ void xforms::setInstanceData(
OUString sURL;
bool bURLOnce = false;
getInstanceData( aSequence, &sID, &xInstance, &sURL, &bURLOnce );
- const OUString* pID = ( sID.getLength() > 0 ) ? &sID : NULL;
+ const OUString* pID = !sID.isEmpty() ? &sID : NULL;
const Reference<XDocument>* pInstance = xInstance.is() ? &xInstance : NULL;
- const OUString* pURL = ( sURL.getLength() > 0 ) ? &sURL : NULL;
+ const OUString* pURL = !sURL.isEmpty() ? &sURL : NULL;
const bool* pURLOnce = ( bURLOnce && pURL != NULL ) ? &bURLOnce : NULL;
// determine new instance data
diff --git a/forms/source/xforms/pathexpression.cxx b/forms/source/xforms/pathexpression.cxx
index 532f7316a528..6cd45a82263f 100644
--- a/forms/source/xforms/pathexpression.cxx
+++ b/forms/source/xforms/pathexpression.cxx
@@ -101,7 +101,7 @@ void PathExpression::setExpression( const OUString& rExpression )
const rtl::OUString PathExpression::_getExpressionForEvaluation() const
{
OUString sExpr = ComputedExpression::_getExpressionForEvaluation();
- if( sExpr.getLength() == 0 )
+ if( sExpr.isEmpty())
sExpr = OUSTRING(".");
return sExpr;
}
diff --git a/forms/source/xforms/resourcehelper.cxx b/forms/source/xforms/resourcehelper.cxx
index 867f2d31c861..9a43959639ea 100644
--- a/forms/source/xforms/resourcehelper.cxx
+++ b/forms/source/xforms/resourcehelper.cxx
@@ -64,7 +64,7 @@ OUString getResource( sal_uInt16 nResourceId,
const OUString& rInfo3 )
{
OUString sResource = frm::ResourceManager::loadString( nResourceId );
- OSL_ENSURE( sResource.getLength() > 0, "resource not found?" );
+ OSL_ENSURE( !sResource.isEmpty(), "resource not found?" );
// use old style String class for search and replace, so we don't have to
// code this again.
diff --git a/forms/source/xforms/submission.cxx b/forms/source/xforms/submission.cxx
index 72c6187ba6dd..8c58b85e4513 100644
--- a/forms/source/xforms/submission.cxx
+++ b/forms/source/xforms/submission.cxx
@@ -285,7 +285,7 @@ bool Submission::doSubmit( const Reference< XInteractionHandler >& xHandler )
// construct XXPathObject for submission doc; use bind in preference of ref
EvaluationContext aEvalContext;
ComputedExpression aExpression;
- if( msBind.getLength() != 0 )
+ if( !msBind.isEmpty() )
{
Binding* pBinding = Binding::getBinding( mxModel->getBinding(msBind) );
if( pBinding != NULL )
@@ -295,7 +295,7 @@ bool Submission::doSubmit( const Reference< XInteractionHandler >& xHandler )
}
// TODO: else: illegal binding name -> raise error
}
- else if( maRef.getExpression().getLength() != 0 )
+ else if( !maRef.getExpression().isEmpty() )
{
aExpression.setExpression( maRef.getExpression() );
aEvalContext = Model::getModel( mxModel )->getEvaluationContext();
@@ -510,7 +510,7 @@ void SAL_CALL Submission::submitWithInteraction(
Reference< XModel > xModel( mxModel );
::rtl::OUString sID( msID );
- if ( !xModel.is() || !msID.getLength() )
+ if ( !xModel.is() || msID.isEmpty() )
throw RuntimeException(
::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "This is not a valid submission object." ) ),
*this
@@ -615,7 +615,7 @@ static sal_Bool _isIgnorable(const Reference< XNode >& aNode)
if (aNode->getNodeType() == NodeType_TEXT_NODE)
{
OUString aTrimmedValue = aNode->getNodeValue().trim();
- if (aTrimmedValue.getLength() == 0) return sal_True;
+ if (aTrimmedValue.isEmpty()) return sal_True;
}
return sal_False;