diff options
author | Matteo Casalin <matteo.casalin@yahoo.com> | 2018-08-12 21:59:56 +0200 |
---|---|---|
committer | Matteo Casalin <matteo.casalin@yahoo.com> | 2018-09-09 21:07:49 +0200 |
commit | 7224b69bd52bc3544e2b4d36ccf36965d3c3c45e (patch) | |
tree | 20f2595c161c514c6c5bdfa32e54d04afef9dcf8 /sc | |
parent | e3f3ce96d000c86d8f79d64ef99f07b2a60aa7ee (diff) |
Early bailout
Change-Id: I34cb0f151b35fe775008d449bf7efb72ae81f29d
Diffstat (limited to 'sc')
-rw-r--r-- | sc/source/ui/miscdlgs/anyrefdg.cxx | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/sc/source/ui/miscdlgs/anyrefdg.cxx b/sc/source/ui/miscdlgs/anyrefdg.cxx index cc98f3d8d11e..6de58331021f 100644 --- a/sc/source/ui/miscdlgs/anyrefdg.cxx +++ b/sc/source/ui/miscdlgs/anyrefdg.cxx @@ -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 |