Early bailout

Change-Id: I34cb0f151b35fe775008d449bf7efb72ae81f29d
This commit is contained in:
Matteo Casalin 2018-08-12 21:59:56 +02:00
parent e3f3ce96d0
commit 7224b69bd5

View file

@ -875,13 +875,15 @@ void ScRefHandler::SwitchToDocument()
bool ScRefHandler::IsDocAllowed(SfxObjectShell* pDocSh) const // pDocSh may be 0
{
// default: allow only same document (overridden in function dialog)
OUString aCmpName;
if ( pDocSh )
aCmpName = pDocSh->GetTitle();
// if aDocName isn't initialized, allow
return ( m_aDocName.isEmpty() || m_aDocName == aCmpName );
if ( m_aDocName.isEmpty() )
return true;
if ( !pDocSh )
return false;
// default: allow only same document (overridden in function dialog)
return m_aDocName==pDocSh->GetTitle();
}
bool ScRefHandler::IsRefInputMode() const