@@ -177,36 +177,24 @@ internal ITextPointer GetNextSpellingErrorPosition(ITextPointer position, Logica
177177 // for an error range.
178178 // This method actually runs the speller on the specified text,
179179 // re-evaluating the error from scratch.
180- internal IList GetSuggestionsForError ( SpellingError error )
180+ internal List < string > GetSuggestionsForError ( SpellingError error )
181181 {
182- ITextPointer contextStart ;
183- ITextPointer contextEnd ;
184- ITextPointer contentStart ;
185- ITextPointer contentEnd ;
186- TextMap textMap ;
187- ArrayList suggestions ;
188-
189- suggestions = new ArrayList ( 1 ) ;
190-
191182 //
192183 // IMPORTANT!!
193184 //
194185 // This logic here must match ScanRange, or else we might not
195186 // calculate the exact same error. Keep the two methods in sync!
196187 //
197188
198- XmlLanguage language ;
199- CultureInfo culture = GetCurrentCultureAndLanguage ( error . Start , out language ) ;
200- if ( culture == null || ! _spellerInterop . CanSpellCheck ( culture ) )
201- {
202- // Return an empty list.
203- }
204- else
189+ List < string > suggestions = new ( 4 ) ;
190+ CultureInfo culture = GetCurrentCultureAndLanguage ( error . Start , out XmlLanguage language ) ;
191+
192+ if ( culture is not null && _spellerInterop . CanSpellCheck ( culture ) )
205193 {
206- ExpandToWordBreakAndContext ( error . Start , LogicalDirection . Backward , language , out contentStart , out contextStart ) ;
207- ExpandToWordBreakAndContext ( error . End , LogicalDirection . Forward , language , out contentEnd , out contextEnd ) ;
194+ ExpandToWordBreakAndContext ( error . Start , LogicalDirection . Backward , language , out ITextPointer contentStart , out ITextPointer contextStart ) ;
195+ ExpandToWordBreakAndContext ( error . End , LogicalDirection . Forward , language , out ITextPointer contentEnd , out ITextPointer contextEnd ) ;
208196
209- textMap = new TextMap ( contextStart , contextEnd , contentStart , contentEnd ) ;
197+ TextMap textMap = new ( contextStart , contextEnd , contentStart , contentEnd ) ;
210198
211199 SetCulture ( culture ) ;
212200
@@ -915,7 +903,7 @@ private bool ScanErrorTextSegment(SpellerInteropBase.ISpellerSegment textSegment
915903 {
916904 if ( textSegment . SubSegments . Count == 0 )
917905 {
918- ArrayList suggestions = ( ArrayList ) data . Data ;
906+ List < string > suggestions = ( List < string > ) data . Data ;
919907 if ( textSegment . Suggestions . Count > 0 )
920908 {
921909 foreach ( string suggestion in textSegment . Suggestions )
0 commit comments