Increase spell-check highlight


I’d like to know if is there any way to increase the highlight effect for the automatic spell-check in Libre Writer. Sometimes it’s hard for me to notice the red line and I’d like to avoid being forced to re-read multiple times to be sure that I’ve missed nothing.

If possible, I’d like for the spell-check highlight line to be more visible, either thicker or with some additional effect.

Any help?

Best regards

I don’t know of any setting that makes that possible.

You can submit a feature request on Bugzilla.
How to Report Bugs (and feature requests) in LibreOffice

This macro isn’t ideal solution, but maybe better than nothing. It gets words without duplicities from the document (via collection), then it spellchecks ones, and then it will write all incorrect words to new document.
Set the constants cLang and cCountry in the start to your language and test it. The constant cWord is definition of word by regular expression, now there is alphanumeric characters and dot and dash.

Sub dictExample 'write all incorrect words from spellcheck to new document
	const cLang="en"
	const cCountry="US"
	const cDict="standard.dic"
	'getDictionaries 'show dictionaries for the constant cDict
	const cWord="([:alnum:]|[.-])+" 'definition of word by regular expression -> alfanumeric character or dot or dash
	dim oDoc0 as object, oDoc as object, s$, sOut$, oHledani as object, oHledaniParam as object, oNalez, oStart, oEnd, a&, b&, _
		col as new collection, sText0$, oSpeller as object, oDics as object, oDic as object, oLoc as new, i&, _
		oDlg as object, oPrubeh as object, oButton as object, iKrok%
	for i=1 to oDoc0.DrawPage.Count 'text from Text Boxes, Frames, Shapes
		sText0=sText0 & chr(13) & oDoc0.DrawPage.getByIndex(i-1).String
	next i
	sText0=sText0 & chr(13) & oDoc0.Text.String 'text from document
	with oHledaniParam 'regular expression
	  .searchString=cWord 'word
	end with
	oNalez=oHledani.searchForward(sText0, b, len(sText0)) 'search string
	oDlg=progressBarInit(0, len(sText0), oDoc0) 'progressbar
	oPrubeh=oDlg.getControl("Pprogress") : oButton=oDlg.getControl("Pbutton")
	on local error resume next
	do while oNalez.subRegExpressions>0
		a=oNalez.startOffset(0) 'start position in string
		b=oNalez.endOffset(0) 'end position in string
		s=mid(sText0, a+1, b-a)
		oNalez=oHledani.searchForward(sText0, b, len(sText0)) 'search string
		if iKrok=300 then
			oPrubeh.Value=a 'set value to progressbar
		end if
		if oButton.Model.State=1 then
			exit sub
		end if
	on local error goto 0
	oSpeller=createUnoService("") 'spellchecker
	oDics=createUnoService("") 'list of the dictionaries
	'xray oDics.Dictionaries 'list of the dictionaries
	oDic=oDics.getDictionaryByName(cDict) 'use the dictionary
	with oLoc
	end with
	for i=1 to col.Count
		if NOT oSpeller.isValid(s, oLoc, array()) then
			sOut=sOut & s & chr(13)
		end if
	next i
	if sOut<>"" then 'write incorrect words into new document
		oDoc=StarDesktop.LoadComponentFromUrl("private:factory/swriter", "_blank", 0, array())
		msgbox "No incorrect words found :-)"
	end if
End Sub

Function progressBarInit(min&, max&, optional oDoc as object) as object 'vrátí objekt dialogového okna; při chybějícím oDoc ho přichytí k Desktopu
	on local error goto chyba
	dim oDlg as object, oDlgModel as object, oButtonModel as object, oProgress as object, oWindow as Object
	dim oSize as object, oSiz as new, koef as double
	const iDlgWidth=140, iDlgHeight=45 'bacha, nejde o pixely jako kdyby se vytvářelo dialogové okno v Basic editoru a pak volalo; dále je pro vystředění okna použita metoda convertSizeToPixel a nastavena proměnná koef

	rem model dialogového okna
	with oDlgModel
	end with

	rem ukazatel průběhu
	oProgress=oDlgModel.createInstance("") 'objekt ukazatele průběhu
	with oProgress
		.Name="Pprogress" 'jméno pro makro
		.ProgressValueMin=min 'minimum
		.ProgressValueMax=max 'maximum
		.ProgressValue=0 'aktuální hodnota
		.Border=3 'rámeček
	end with
	oDlgModel.insertByName("Pprogress", oProgress) 'přidat do modelu
	rem tlačítko Zrušit
	with oButtonModel
		.Toggle=true 'aktivace detekce vlastnosti State tlačítka
	end with
	oDlgModel.insertByName("Pbutton", oButtonModel)

	rem vykreslení dialogového okna
	oDlg=CreateUnoService("") 'dialog
	oDlg.visible=false 'skrýt dialog ať neproblikává
	oDlg.setModel(oDlgModel) 'nastavit model dialogovému oknu

	rem přidat dialogové okno k oknu dokumentu nebo Desktopu
	oWindow=CreateUnoService("") 'dialogové okno
	if isMissing(oDoc) then 'přidat k Desktopu - pozor, systém může po chvíli vypsat že program neodpovídá
	else 'přidat okno k oDoc
		dim oToolkit as object
		oDlg.createPeer(oWindow,oToolkit) 'spojení
	end if

	rem propočty na vystředění dialogového okna
	with oSiz 'rozměr z kterého budu přepočítávat koeficient pro usazení dialogového okna průběhu doprostřed
	end with
	koef=iDlgWidth / oDlg.convertSizeToPixel(oSiz, 'koeficient pro korekci dialogového okna

	oSize=oDoc.CurrentController.Frame.ContainerWindow.GetPosSize 'rozměry okna Calcu
	with oDlgModel
		.positionX=fix( (koef*oSize.Width-iDlgWidth)/2 ) 'pozice X od levého horního rohu okna; šířku dialogu je třeba brát zvětšenou koef, pozici X pak zmenšenou koef
		.positionY=fix( (koef*oSize.Height-iDlgHeight)/2 ) 'pozice Y od levého horního rohu okna
	end with
	oDlg.visible=true 'zobrazit dialog
	exit function
	msgbox("Error " & Err & ": " & Error$ + chr(13) + "Line: " + Erl , 16 ,"progressBarInit")
End Function

Sub getDictionaries 'get the list of the dictionaries
	dim oDics as object, s$, i%
	oDics=createUnoService("") 'list of the dictionaries
	for i=lbound(oDics.Dictionaries) to ubound(oDics.Dictionaries)
		s=s & oDics.Dictionaries(i).Name & chr(13)
	next i
	msgbox s
End Sub
1 Like