tdf#86731 Don't show 'start from beginning' when dictionary is missing

Change-Id: I160e4b15e3c636be0e23dd5bbb2da62dfa6a42ef
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/82169
Tested-by: Jenkins
Reviewed-by: Michael Meeks <michael.meeks@collabora.com>
Tested-by: Michael Meeks <michael.meeks@collabora.com>
(cherry picked from commit a50a2bf8e8)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/86345
Reviewed-by: Xisco Faulí <xiscofauli@libreoffice.org>
This commit is contained in:
Szymon Kłos 2019-01-24 11:22:22 +01:00 committed by Xisco Faulí
parent 2c3f7d4ee0
commit f200dd5cb8

View file

@ -176,6 +176,8 @@ svx::SpellPortions SwSpellDialogChildWindow::GetNextWrongSentence(bool bRecheck)
SwWrtShell* pWrtShell = GetWrtShell_Impl();
if(pWrtShell)
{
bool bNoDictionaryAvailable = pWrtShell->GetDoc()->IsDictionaryMissing();
if (!bRecheck)
{
// first set continuation point for spell/grammar check to the
@ -380,7 +382,7 @@ The code below would only be part of the solution.
OSL_ENSURE(m_pSpellState->m_bDrawingsSpelled &&
m_pSpellState->m_bOtherSpelled && m_pSpellState->m_bBodySpelled,
"not all parts of the document are already spelled");
if(m_pSpellState->m_xStartRange.is())
if( m_pSpellState->m_xStartRange.is() && !bNoDictionaryAvailable )
{
LockFocusNotification( true );
std::unique_ptr<weld::MessageDialog> xBox(Application::CreateMessageDialog(GetController()->getDialog(),
@ -406,8 +408,7 @@ The code below would only be part of the solution.
bCloseMessage = false; // no closing message if a wrap around has been denied
}
}
bool bNoDictionaryAvailable = pWrtShell->GetDoc()->IsDictionaryMissing();
if( aRet.empty() && bCloseMessage )
if( aRet.empty() && bCloseMessage && !bNoDictionaryAvailable )
{
LockFocusNotification( true );
OUString sInfo( SwResId( bNoDictionaryAvailable ? STR_DICTIONARY_UNAVAILABLE : STR_SPELLING_COMPLETED ) );