Kaydet (Commit) 3b9dcfee authored tarafından Noel Grandin's avatar Noel Grandin

loplugin:indentation in codemaker..comphelper

Change-Id: I8dee6245cfa1f7998591b31a3752bbbae13f499d
Reviewed-on: https://gerrit.libreoffice.org/67527
Tested-by: Jenkins
Reviewed-by: 's avatarNoel Grandin <noel.grandin@collabora.co.uk>
üst 21b22421
......@@ -86,8 +86,7 @@ bool JavaOptions::initOptions(int ac, char* av[], bool bCmdFile)
case 'n':
if (av[i][2] != 'D' || av[i][3] != '\0')
{
OString tmp("'-nD', please check");
tmp += " your input '" + OString(av[i]) + "'";
OString tmp("'-nD', please check your input '" + OString(av[i]) + "'");
throw IllegalArgument(tmp);
}
......@@ -189,8 +188,8 @@ bool JavaOptions::initOptions(int ac, char* av[], bool bCmdFile)
if (av[i][0] == '@')
{
FILE* cmdFile = fopen(av[i]+1, "r");
if( cmdFile == nullptr )
{
if( cmdFile == nullptr )
{
fprintf(stderr, "%s", prepareHelp().getStr());
ret = false;
} else
......
......@@ -614,7 +614,7 @@ uno::Reference < embed::XEmbeddedObject > EmbeddedObjectContainer::InsertEmbedde
pImpl->mxStorage, rNewName, aMedium, aObjDescr ), uno::UNO_QUERY );
uno::Reference < embed::XEmbedPersist > xPersist( xObj, uno::UNO_QUERY );
OSL_ENSURE( !xObj.is() || xObj->getCurrentState() != embed::EmbedStates::LOADED,
OSL_ENSURE( !xObj.is() || xObj->getCurrentState() != embed::EmbedStates::LOADED,
"A freshly create object should be running always!" );
// possible optimization: store later!
......@@ -646,7 +646,7 @@ uno::Reference < embed::XEmbeddedObject > EmbeddedObjectContainer::InsertEmbedde
uno::Reference < embed::XEmbedPersist > xPersist( xObj, uno::UNO_QUERY );
OSL_ENSURE( !xObj.is() || xObj->getCurrentState() != embed::EmbedStates::LOADED,
OSL_ENSURE( !xObj.is() || xObj->getCurrentState() != embed::EmbedStates::LOADED,
"A freshly create object should be running always!" );
// possible optimization: store later!
......@@ -791,7 +791,7 @@ uno::Reference < embed::XEmbeddedObject > EmbeddedObjectContainer::CopyAndGetEmb
}
}
if ( xResult.is() )
if ( xResult.is() )
AddEmbeddedObject( xResult, rName );
}
catch (const uno::Exception&)
......
......@@ -242,7 +242,7 @@ namespace comphelper
#if OSL_DEBUG_LEVEL > 0
if ( m_aChildrenMap.end() == aDisposedPos )
{
OSL_FAIL( "OWrappedAccessibleChildrenManager::disposing: where did this come from?" );
OSL_FAIL( "OWrappedAccessibleChildrenManager::disposing: where did this come from?" );
// helper for diagnostics
Reference< XAccessible > xOwningAccessible( m_aOwningAccessible );
Reference< XAccessibleContext > xContext;
......
......@@ -68,7 +68,7 @@ void SAL_CALL OInstanceLocker::dispose()
if ( m_bDisposed )
throw lang::DisposedException();
lang::EventObject aSource( static_cast< ::cppu::OWeakObject* >(this) );
lang::EventObject aSource( static_cast< ::cppu::OWeakObject* >(this) );
if ( m_pListenersContainer )
m_pListenersContainer->disposeAndClear( aSource );
......
......@@ -46,7 +46,7 @@ void NumberedCollection::setOwner(const css::uno::Reference< css::uno::XInterfac
// SYNCHRONIZED ->
::osl::ResettableMutexGuard aLock(m_aMutex);
m_xOwner = xOwner;
m_xOwner = xOwner;
// <- SYNCHRONIZED
}
......@@ -57,7 +57,7 @@ void NumberedCollection::setUntitledPrefix(const OUString& sPrefix)
// SYNCHRONIZED ->
::osl::ResettableMutexGuard aLock(m_aMutex);
m_sUntitledPrefix = sPrefix;
m_sUntitledPrefix = sPrefix;
// <- SYNCHRONIZED
}
......@@ -68,31 +68,31 @@ void NumberedCollection::setUntitledPrefix(const OUString& sPrefix)
// SYNCHRONIZED ->
::osl::ResettableMutexGuard aLock(m_aMutex);
if ( ! xComponent.is ())
throw css::lang::IllegalArgumentException(ERRMSG_INVALID_COMPONENT_PARAM, m_xOwner.get(), 1);
if ( ! xComponent.is ())
throw css::lang::IllegalArgumentException(ERRMSG_INVALID_COMPONENT_PARAM, m_xOwner.get(), 1);
sal_IntPtr pComponent = reinterpret_cast<sal_IntPtr>( xComponent.get() );
TNumberedItemHash::const_iterator pIt = m_lComponents.find (pComponent);
sal_IntPtr pComponent = reinterpret_cast<sal_IntPtr>( xComponent.get() );
TNumberedItemHash::const_iterator pIt = m_lComponents.find (pComponent);
// a) component already exists - return its number directly
if (pIt != m_lComponents.end())
return pIt->second.nNumber;
// a) component already exists - return its number directly
if (pIt != m_lComponents.end())
return pIt->second.nNumber;
// b) component must be added new to this container
// b) component must be added new to this container
// b1) collection is full - no further components possible
// -> return INVALID_NUMBER
::sal_Int32 nFreeNumber = impl_searchFreeNumber();
if (nFreeNumber == css::frame::UntitledNumbersConst::INVALID_NUMBER)
return css::frame::UntitledNumbersConst::INVALID_NUMBER;
// b1) collection is full - no further components possible
// -> return INVALID_NUMBER
::sal_Int32 nFreeNumber = impl_searchFreeNumber();
if (nFreeNumber == css::frame::UntitledNumbersConst::INVALID_NUMBER)
return css::frame::UntitledNumbersConst::INVALID_NUMBER;
// b2) add component to collection and return its number
TNumberedItem aItem;
aItem.xItem = css::uno::WeakReference< css::uno::XInterface >(xComponent);
aItem.nNumber = nFreeNumber;
m_lComponents[pComponent] = aItem;
// b2) add component to collection and return its number
TNumberedItem aItem;
aItem.xItem = css::uno::WeakReference< css::uno::XInterface >(xComponent);
aItem.nNumber = nFreeNumber;
m_lComponents[pComponent] = aItem;
return nFreeNumber;
return nFreeNumber;
// <- SYNCHRONIZED
}
......@@ -140,18 +140,18 @@ void SAL_CALL NumberedCollection::releaseNumberForComponent(const css::uno::Refe
// SYNCHRONIZED ->
::osl::ResettableMutexGuard aLock(m_aMutex);
if ( ! xComponent.is ())
throw css::lang::IllegalArgumentException(ERRMSG_INVALID_COMPONENT_PARAM, m_xOwner.get(), 1);
if ( ! xComponent.is ())
throw css::lang::IllegalArgumentException(ERRMSG_INVALID_COMPONENT_PARAM, m_xOwner.get(), 1);
sal_IntPtr pComponent = reinterpret_cast<sal_IntPtr>( xComponent.get() );
TNumberedItemHash::iterator pIt = m_lComponents.find (pComponent);
sal_IntPtr pComponent = reinterpret_cast<sal_IntPtr>( xComponent.get() );
TNumberedItemHash::iterator pIt = m_lComponents.find (pComponent);
// a) component exists and will be removed
if (pIt != m_lComponents.end())
m_lComponents.erase(pIt);
// a) component exists and will be removed
if (pIt != m_lComponents.end())
m_lComponents.erase(pIt);
// else
// b) component does not exists - nothing todo here (ignore request!)
// else
// b) component does not exists - nothing todo here (ignore request!)
// <- SYNCHRONIZED
}
......@@ -162,7 +162,7 @@ OUString SAL_CALL NumberedCollection::getUntitledPrefix()
// SYNCHRONIZED ->
::osl::ResettableMutexGuard aLock(m_aMutex);
return m_sUntitledPrefix;
return m_sUntitledPrefix;
// <- SYNCHRONIZED
}
......@@ -196,7 +196,7 @@ OUString SAL_CALL NumberedCollection::getUntitledPrefix()
// SYNCHRONIZED ->
::osl::ResettableMutexGuard aLock(m_aMutex);
{
TDeadItemList lDeadItems;
TNumberedItemHash::const_iterator pComponent;
......@@ -226,7 +226,7 @@ OUString SAL_CALL NumberedCollection::getUntitledPrefix()
// b) return first free number
return *(lPossibleNumbers.begin ());
}
// <- SYNCHRONIZED
}
......
......@@ -128,7 +128,7 @@ void SequenceAsHashMap::operator<<(const css::uno::Sequence< css::beans::Propert
{
clear();
sal_Int32 c = lSource.getLength();
sal_Int32 c = lSource.getLength();
const css::beans::PropertyValue* pSource = lSource.getConstArray();
for (sal_Int32 i=0; i<c; ++i)
......@@ -139,7 +139,7 @@ void SequenceAsHashMap::operator<<(const css::uno::Sequence< css::beans::NamedVa
{
clear();
sal_Int32 c = lSource.getLength();
sal_Int32 c = lSource.getLength();
const css::beans::NamedValue* pSource = lSource.getConstArray();
for (sal_Int32 i=0; i<c; ++i)
......@@ -210,7 +210,7 @@ bool SequenceAsHashMap::match(const SequenceAsHashMap& rCheck) const
{
const OUString& sCheckName = elem.first;
const css::uno::Any& aCheckValue = elem.second;
const_iterator pFound = find(sCheckName);
const_iterator pFound = find(sCheckName);
if (pFound == end())
return false;
......
......@@ -152,8 +152,10 @@ namespace comphelper
PropertyState OPropertyStateContainer::getPropertyStateByHandle( sal_Int32 _nHandle ) const
{
// simply compare the current and the default value
Any aCurrentValue; getFastPropertyValue( aCurrentValue, _nHandle );
Any aDefaultValue; getPropertyDefaultByHandle( _nHandle, aDefaultValue );
Any aCurrentValue;
getFastPropertyValue( aCurrentValue, _nHandle );
Any aDefaultValue;
getPropertyDefaultByHandle( _nHandle, aDefaultValue );
bool bEqual = uno_type_equalData(
const_cast< void* >( aCurrentValue.getValue() ), aCurrentValue.getValueType().getTypeLibType(),
......
......@@ -146,7 +146,8 @@ namespace comphelper
{
// simply compare the current and the default value
Any aCurrentValue = getPropertyDefaultByHandle( _nHandle );
Any aDefaultValue; getFastPropertyValue( aDefaultValue, _nHandle );
Any aDefaultValue;
getFastPropertyValue( aDefaultValue, _nHandle );
bool bEqual = uno_type_equalData(
const_cast< void* >( aCurrentValue.getValue() ), aCurrentValue.getValueType().getTypeLibType(),
......
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