Clean up a usage of OUStringBuffer
Change-Id: I8435865f1a67a3a6d889c1b8a3d30e632ffc61fd
This commit is contained in:
parent
a1baba6885
commit
21033d04fd
@ -120,7 +120,7 @@ namespace dbtools
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
bool FilterManager::isThereAtMostOneComponent( OUStringBuffer& o_singleComponent ) const
|
bool FilterManager::isThereAtMostOneComponent( OUString& o_singleComponent ) const
|
||||||
{
|
{
|
||||||
if (m_bApplyPublicFilter) {
|
if (m_bApplyPublicFilter) {
|
||||||
if (!m_aPublicFilterComponent.isEmpty() && !m_aLinkFilterComponent.isEmpty())
|
if (!m_aPublicFilterComponent.isEmpty() && !m_aLinkFilterComponent.isEmpty())
|
||||||
@ -130,13 +130,13 @@ namespace dbtools
|
|||||||
else if (!m_aLinkFilterComponent.isEmpty())
|
else if (!m_aLinkFilterComponent.isEmpty())
|
||||||
o_singleComponent = m_aLinkFilterComponent;
|
o_singleComponent = m_aLinkFilterComponent;
|
||||||
else
|
else
|
||||||
o_singleComponent.setLength(0);
|
o_singleComponent.clear();
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
if (m_aLinkFilterComponent.isEmpty())
|
if (m_aLinkFilterComponent.isEmpty())
|
||||||
o_singleComponent.setLength(0);
|
o_singleComponent.clear();
|
||||||
else
|
else
|
||||||
o_singleComponent = m_aLinkFilterComponent;
|
o_singleComponent = m_aLinkFilterComponent;
|
||||||
return true;
|
return true;
|
||||||
@ -146,17 +146,17 @@ namespace dbtools
|
|||||||
|
|
||||||
OUString FilterManager::getComposedFilter( ) const
|
OUString FilterManager::getComposedFilter( ) const
|
||||||
{
|
{
|
||||||
OUStringBuffer aComposedFilter;
|
|
||||||
|
|
||||||
// if we have only one non-empty component, then there's no need to compose anything
|
// if we have only one non-empty component, then there's no need to compose anything
|
||||||
if ( !isThereAtMostOneComponent( aComposedFilter ) )
|
OUString singleComponent;
|
||||||
|
if ( isThereAtMostOneComponent( singleComponent ) )
|
||||||
{
|
{
|
||||||
// append the single components
|
return singleComponent;
|
||||||
if (m_bApplyPublicFilter)
|
|
||||||
appendFilterComponent( aComposedFilter, m_aPublicFilterComponent );
|
|
||||||
appendFilterComponent( aComposedFilter, m_aLinkFilterComponent );
|
|
||||||
}
|
}
|
||||||
|
// append the single components
|
||||||
|
OUStringBuffer aComposedFilter(singleComponent);
|
||||||
|
if (m_bApplyPublicFilter)
|
||||||
|
appendFilterComponent( aComposedFilter, m_aPublicFilterComponent );
|
||||||
|
appendFilterComponent( aComposedFilter, m_aLinkFilterComponent );
|
||||||
return aComposedFilter.makeStringAndClear();
|
return aComposedFilter.makeStringAndClear();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -97,7 +97,7 @@ namespace dbtools
|
|||||||
static void appendFilterComponent( OUStringBuffer& io_appendTo, const OUString& i_component );
|
static void appendFilterComponent( OUStringBuffer& io_appendTo, const OUString& i_component );
|
||||||
|
|
||||||
/// checks whether there is only one (or even no) non-empty filter component
|
/// checks whether there is only one (or even no) non-empty filter component
|
||||||
bool isThereAtMostOneComponent( OUStringBuffer& o_singleComponent ) const;
|
bool isThereAtMostOneComponent( OUString& o_singleComponent ) const;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user