convert EESpellState to scoped enum
and drop unused EE_SPELL_NOLANGUAGE enumerator Change-Id: I74a5f89335883a13d77b39f78b7de55bddb1f107
This commit is contained in:
parent
4e19742382
commit
fd2ffceefc
@ -169,6 +169,7 @@ for d in definitionSet:
|
||||
"dbaccess/source/inc/dsntypes.hxx", # dbaccess::DATASOURCE_TYPE (from UI)
|
||||
"cui/source/tabpages/tparea.cxx", # FillType (from UI)
|
||||
"include/editeng/svxenum.hxx", # css::style::NumberingType
|
||||
"include/editeng/bulletitem.hxx", # css::style::NumberingType
|
||||
# represents constants from an external API
|
||||
"opencl/inc/opencl_device_selection.h",
|
||||
"vcl/inc/sft.hxx",
|
||||
|
@ -2168,7 +2168,7 @@ bool EditEngine::SpellNextDocument()
|
||||
EESpellState EditEngine::HasSpellErrors()
|
||||
{
|
||||
if ( !pImpEditEngine->GetSpeller().is() )
|
||||
return EE_SPELL_NOSPELLER;
|
||||
return EESpellState::NoSpeller;
|
||||
|
||||
return pImpEditEngine->HasSpellErrors();
|
||||
}
|
||||
|
@ -763,7 +763,7 @@ void EditView::CompleteAutoCorrect( vcl::Window* pFrameWin )
|
||||
EESpellState EditView::StartSpeller( bool bMultipleDoc )
|
||||
{
|
||||
if ( !pImpEditView->pEditEngine->pImpEditEngine->GetSpeller().is() )
|
||||
return EE_SPELL_NOSPELLER;
|
||||
return EESpellState::NoSpeller;
|
||||
|
||||
return pImpEditView->pEditEngine->pImpEditEngine->Spell( this, bMultipleDoc );
|
||||
}
|
||||
@ -771,7 +771,7 @@ EESpellState EditView::StartSpeller( bool bMultipleDoc )
|
||||
EESpellState EditView::StartThesaurus()
|
||||
{
|
||||
if ( !pImpEditView->pEditEngine->pImpEditEngine->GetSpeller().is() )
|
||||
return EE_SPELL_NOSPELLER;
|
||||
return EESpellState::NoSpeller;
|
||||
|
||||
return pImpEditView->pEditEngine->pImpEditEngine->StartThesaurus( this );
|
||||
}
|
||||
|
@ -172,7 +172,7 @@ struct SpellInfo
|
||||
svx::SpellPortions aLastSpellPortions;
|
||||
SpellContentSelections aLastSpellContentSelections;
|
||||
SpellInfo()
|
||||
{ bSpellToEnd = true; eState = EE_SPELL_OK; bMultipleDoc = false; }
|
||||
{ bSpellToEnd = true; eState = EESpellState::Ok; bMultipleDoc = false; }
|
||||
};
|
||||
|
||||
// used for text conversion
|
||||
|
@ -1477,7 +1477,7 @@ EESpellState ImpEditEngine::Spell( EditView* pEditView, bool bMultipleDoc )
|
||||
SAL_WARN_IF( !xSpeller.is(), "editeng", "No Spell checker set!" );
|
||||
|
||||
if ( !xSpeller.is() )
|
||||
return EE_SPELL_NOSPELLER;
|
||||
return EESpellState::NoSpeller;
|
||||
|
||||
aOnlineSpellTimer.Stop();
|
||||
|
||||
@ -1898,7 +1898,7 @@ Reference< XSpellAlternatives > ImpEditEngine::ImpSpell( EditView* pEditView )
|
||||
if ( !xSpellAlt.is() )
|
||||
aCurSel = WordRight( aCurSel.Min(), css::i18n::WordType::DICTIONARY_WORD );
|
||||
else
|
||||
pSpellInfo->eState = EE_SPELL_ERRORFOUND;
|
||||
pSpellInfo->eState = EESpellState::ErrorFound;
|
||||
}
|
||||
|
||||
pEditView->pImpEditView->DrawSelection();
|
||||
@ -1946,7 +1946,7 @@ Reference< XSpellAlternatives > ImpEditEngine::ImpFindNextError(EditSelection& r
|
||||
aCurSel = WordRight( aCurSel.Min(), css::i18n::WordType::DICTIONARY_WORD );
|
||||
else
|
||||
{
|
||||
pSpellInfo->eState = EE_SPELL_ERRORFOUND;
|
||||
pSpellInfo->eState = EESpellState::ErrorFound;
|
||||
rSelection = aCurSel;
|
||||
}
|
||||
}
|
||||
@ -2456,7 +2456,7 @@ EESpellState ImpEditEngine::HasSpellErrors()
|
||||
if ( ( aCurSel.Max().GetNode() == pLastNode ) &&
|
||||
( aCurSel.Max().GetIndex() >= pLastNode->Len() ) )
|
||||
{
|
||||
return EE_SPELL_OK;
|
||||
return EESpellState::Ok;
|
||||
}
|
||||
|
||||
aCurSel = SelectWord( aCurSel, css::i18n::WordType::DICTIONARY_WORD );
|
||||
@ -2470,7 +2470,7 @@ EESpellState ImpEditEngine::HasSpellErrors()
|
||||
aCurSel = WordRight( aCurSel.Max(), css::i18n::WordType::DICTIONARY_WORD );
|
||||
}
|
||||
|
||||
return EE_SPELL_ERRORFOUND;
|
||||
return EESpellState::ErrorFound;
|
||||
}
|
||||
|
||||
void ImpEditEngine::ClearSpellErrors()
|
||||
@ -2487,7 +2487,7 @@ EESpellState ImpEditEngine::StartThesaurus( EditView* pEditView )
|
||||
|
||||
Reference< XThesaurus > xThes( LinguMgr::GetThesaurus() );
|
||||
if (!xThes.is())
|
||||
return EE_SPELL_ERRORFOUND;
|
||||
return EESpellState::ErrorFound;
|
||||
|
||||
EditAbstractDialogFactory* pFact = EditAbstractDialogFactory::Create();
|
||||
ScopedVclPtr<AbstractThesaurusDialog> xDlg(pFact->CreateThesaurusDialog( pEditView->GetWindow(), xThes, aWord, GetLanguage( aCurSel.Max() ) ));
|
||||
@ -2501,7 +2501,7 @@ EESpellState ImpEditEngine::StartThesaurus( EditView* pEditView )
|
||||
pEditView->ShowCursor(true, false);
|
||||
}
|
||||
|
||||
return EE_SPELL_OK;
|
||||
return EESpellState::Ok;
|
||||
}
|
||||
|
||||
sal_Int32 ImpEditEngine::StartSearchAndReplace( EditView* pEditView, const SvxSearchItem& rSearchItem )
|
||||
|
@ -35,7 +35,7 @@ enum EEHorizontalTextDirection { EE_HTEXTDIR_DEFAULT, EE_HTEXTDIR_L2R, EE_HTEXTD
|
||||
enum EESelectionMode { EE_SELMODE_STD, EE_SELMODE_TXTONLY, EE_SELMODE_HIDDEN };
|
||||
// EE_SELMODE_HIDDEN can be used to completely hide the selection. This is useful e.g. when you want show the selection
|
||||
// only as long as your window (which the edit view works on) has the focus
|
||||
enum EESpellState { EE_SPELL_OK, EE_SPELL_NOLANGUAGE, EE_SPELL_LANGUAGENOTINSTALLED, EE_SPELL_NOSPELLER, EE_SPELL_ERRORFOUND };
|
||||
enum class EESpellState { Ok, LanguageNotInstalled, NoSpeller, ErrorFound };
|
||||
enum EVAnchorMode {
|
||||
ANCHOR_TOP_LEFT, ANCHOR_VCENTER_LEFT, ANCHOR_BOTTOM_LEFT,
|
||||
ANCHOR_TOP_HCENTER, ANCHOR_VCENTER_HCENTER, ANCHOR_BOTTOM_HCENTER,
|
||||
|
@ -273,7 +273,7 @@
|
||||
|
||||
#define STR_UNDO_GRAFEDIT 199
|
||||
|
||||
#define STR_NOLANGERR 200
|
||||
// empty
|
||||
|
||||
#define STR_UNDO_INSERT_TAB 201
|
||||
#define STR_UNDO_DELETE_TAB 202
|
||||
|
@ -1059,10 +1059,6 @@ String STR_SPELLING_STOP_OK+RID_GLOBSTR_OFFSET
|
||||
{
|
||||
Text [ en-US ] = "The spellcheck of this sheet has been completed." ;
|
||||
};
|
||||
String STR_NOLANGERR+RID_GLOBSTR_OFFSET
|
||||
{
|
||||
Text [ en-US ] = "No language set" ;
|
||||
};
|
||||
String STR_UNDO_INSERT_TAB+RID_GLOBSTR_OFFSET
|
||||
{
|
||||
Text [ en-US ] = "Insert Sheet" ;
|
||||
|
@ -285,17 +285,11 @@ ScSpellingEngine::ScSpellingEngine(
|
||||
|
||||
void ScSpellingEngine::ConvertAll( EditView& rEditView )
|
||||
{
|
||||
EESpellState eState = EE_SPELL_OK;
|
||||
EESpellState eState = EESpellState::Ok;
|
||||
if( FindNextConversionCell() )
|
||||
eState = rEditView.StartSpeller( true );
|
||||
|
||||
OSL_ENSURE( eState != EE_SPELL_NOSPELLER, "ScSpellingEngine::Convert - no spell checker" );
|
||||
if( eState == EE_SPELL_NOLANGUAGE )
|
||||
{
|
||||
vcl::Window* pParent = GetDialogParent();
|
||||
ScWaitCursorOff aWaitOff( pParent );
|
||||
ScopedVclPtrInstance<InfoBox>( pParent, ScGlobal::GetRscString( STR_NOLANGERR ) )->Execute();
|
||||
}
|
||||
OSL_ENSURE( eState != EESpellState::NoSpeller, "ScSpellingEngine::Convert - no spell checker" );
|
||||
}
|
||||
|
||||
bool ScSpellingEngine::SpellNextDocument()
|
||||
@ -305,7 +299,7 @@ bool ScSpellingEngine::SpellNextDocument()
|
||||
|
||||
bool ScSpellingEngine::NeedsConversion()
|
||||
{
|
||||
return HasSpellErrors() != EE_SPELL_OK;
|
||||
return HasSpellErrors() != EESpellState::Ok;
|
||||
}
|
||||
|
||||
bool ScSpellingEngine::ShowTableWrapDialog()
|
||||
|
@ -382,9 +382,9 @@ void ScViewFunc::DoThesaurus()
|
||||
// language is now in EditEngine attributes -> no longer passed to StartThesaurus
|
||||
|
||||
eState = pEditView->StartThesaurus();
|
||||
OSL_ENSURE(eState != EE_SPELL_NOSPELLER, "No SpellChecker");
|
||||
OSL_ENSURE(eState != EESpellState::NoSpeller, "No SpellChecker");
|
||||
|
||||
if (eState == EE_SPELL_ERRORFOUND) // should happen later through Wrapper!
|
||||
if (eState == EESpellState::ErrorFound) // should happen later through Wrapper!
|
||||
{
|
||||
LanguageType eLnge = ScViewUtil::GetEffLanguage( &rDoc, ScAddress( nCol, nRow, nTab ) );
|
||||
OUString aErr = SvtLanguageTable::GetLanguageString(eLnge);
|
||||
|
@ -482,10 +482,6 @@ String STR_END_SPELLING_OBJ
|
||||
{
|
||||
Text [ en-US ] = "The spellcheck for the selected objects has been completed." ;
|
||||
};
|
||||
String STR_NOLANGUAGE
|
||||
{
|
||||
Text [ en-US ] = "The selected language is not available." ;
|
||||
};
|
||||
String STR_ASK_FOR_CONVERT_TO_BEZIER
|
||||
{
|
||||
Text [ en-US ] = "Convert selected object to curve?" ;
|
||||
|
@ -108,12 +108,7 @@ void FuThesaurus::DoExecute( SfxRequest& )
|
||||
}
|
||||
|
||||
EESpellState eState = const_cast<OutlinerView*>(pOutlView)->StartThesaurus();
|
||||
DBG_ASSERT(eState != EE_SPELL_NOSPELLER, "No SpellChecker");
|
||||
|
||||
if (eState == EE_SPELL_NOLANGUAGE)
|
||||
{
|
||||
ScopedVclPtrInstance<MessageDialog>(mpWindow, SD_RESSTR(STR_NOLANGUAGE))->Execute();
|
||||
}
|
||||
DBG_ASSERT(eState != EESpellState::NoSpeller, "No SpellChecker");
|
||||
}
|
||||
}
|
||||
else if (mpViewShell && dynamic_cast< OutlineViewShell *>( mpViewShell ) != nullptr)
|
||||
@ -135,12 +130,7 @@ void FuThesaurus::DoExecute( SfxRequest& )
|
||||
}
|
||||
|
||||
EESpellState eState = pOutlView->StartThesaurus();
|
||||
DBG_ASSERT(eState != EE_SPELL_NOSPELLER, "No SpellChecker");
|
||||
|
||||
if (eState == EE_SPELL_NOLANGUAGE)
|
||||
{
|
||||
ScopedVclPtrInstance<MessageDialog>(mpWindow, SD_RESSTR(STR_NOLANGUAGE))->Execute();
|
||||
}
|
||||
DBG_ASSERT(eState != EESpellState::NoSpeller, "No SpellChecker");
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -206,7 +206,7 @@
|
||||
|
||||
#define STR_OBJECTS (RID_APP_START+341)
|
||||
#define STR_END_SPELLING (RID_APP_START+343)
|
||||
#define STR_NOLANGUAGE (RID_APP_START+344)
|
||||
// empty
|
||||
#define STR_ASK_FOR_CONVERT_TO_BEZIER (RID_APP_START+347)
|
||||
#define STR_UNDO_CHANGE_PRES_OBJECT (RID_APP_START+349)
|
||||
#define STR_UNDO_MODIFY_PAGE (RID_APP_START+350)
|
||||
|
@ -1273,17 +1273,9 @@ void SdOutliner::PutTextIntoOutliner()
|
||||
void SdOutliner::PrepareSpellCheck()
|
||||
{
|
||||
EESpellState eState = HasSpellErrors();
|
||||
DBG_ASSERT(eState != EE_SPELL_NOSPELLER, "No SpellChecker");
|
||||
DBG_ASSERT(eState != EESpellState::NoSpeller, "No SpellChecker");
|
||||
|
||||
if (eState == EE_SPELL_NOLANGUAGE)
|
||||
{
|
||||
mbError = true;
|
||||
mbEndOfSearch = true;
|
||||
ScopedVclPtrInstance<MessageDialog> aErrorBox (
|
||||
nullptr, SD_RESSTR(STR_NOLANGUAGE));
|
||||
ShowModalMessageBox (*aErrorBox.get());
|
||||
}
|
||||
else if (eState != EE_SPELL_OK)
|
||||
if (eState != EESpellState::Ok)
|
||||
{
|
||||
// When spell checking we have to test whether we have processed the
|
||||
// whole document and have reached the start page again.
|
||||
|
@ -780,7 +780,7 @@ bool SwSpellDialogChildWindow::FindNextDrawTextError_Impl(SwWrtShell& rSh)
|
||||
pOutlView->SetOutputArea( aRect );
|
||||
aTmpOutliner.SetText( *pParaObj );
|
||||
aTmpOutliner.ClearModifyFlag();
|
||||
bHasSpellError = EE_SPELL_OK != aTmpOutliner.HasSpellErrors();
|
||||
bHasSpellError = EESpellState::Ok != aTmpOutliner.HasSpellErrors();
|
||||
aTmpOutliner.RemoveView( pOutlView.get() );
|
||||
}
|
||||
if(bHasSpellError)
|
||||
|
Loading…
x
Reference in New Issue
Block a user