Kaydet (Commit) 209a8d4a authored tarafından Matteo Casalin's avatar Matteo Casalin

Avoid OUString temporaries and bail out early

Change-Id: Ic4c1b2ce68ba992744bd68dece0afc417c22e5cd
üst 4f03fabc
......@@ -1422,21 +1422,18 @@ OUString SAL_CALL SwXDocumentIndex::getName()
{
SolarMutexGuard g;
OUString uRet;
SwSectionFormat *const pSectionFormat( m_pImpl->GetSectionFormat() );
if (m_pImpl->m_bIsDescriptor)
{
uRet = m_pImpl->m_pProps->GetTOXBase().GetTOXName();
return m_pImpl->m_pProps->GetTOXBase().GetTOXName();
}
else if(pSectionFormat)
{
uRet = pSectionFormat->GetSection()->GetSectionName();
}
else
if(!pSectionFormat)
{
throw uno::RuntimeException();
}
return uRet;
return pSectionFormat->GetSection()->GetSectionName();
}
void SAL_CALL
......@@ -1727,21 +1724,18 @@ SwXDocumentIndexMark::getMarkEntry()
{
SolarMutexGuard aGuard;
OUString sRet;
SwTOXType *const pType = m_pImpl->GetTOXType();
if (pType && m_pImpl->m_pTOXMark)
{
sRet = m_pImpl->m_pTOXMark->GetAlternativeText();
}
else if (m_pImpl->m_bIsDescriptor)
{
sRet = m_pImpl->m_sAltText;
return m_pImpl->m_pTOXMark->GetAlternativeText();
}
else
if (!m_pImpl->m_bIsDescriptor)
{
throw uno::RuntimeException();
}
return sRet;
return m_pImpl->m_sAltText;
}
void SAL_CALL
......@@ -1932,7 +1926,7 @@ void SwXDocumentIndexMark::Impl::InsertTOXMark(
// thus use a space - is this really the ideal solution?
if (!bMark && rMark.GetAlternativeText().isEmpty())
{
rMark.SetAlternativeText( OUString(' ') );
rMark.SetAlternativeText( " " );
}
const bool bForceExpandHints( !bMark && pTextCursor && pTextCursor->IsAtEndOfMeta() );
......
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