EditView, EditEngine

Caolán McNamara caolanm at redhat.com
Fri Jan 15 09:20:44 UTC 2021


On Fri, 2021-01-15 at 00:02 +0100, Dante Doménech wrote:
> Hello.
> LO math uses EditView, EditEngine for the editing box (that box where
> you write the formula). The questions are:
> - How can I change the text color of a substr?
> - How can I change the text background color of a substr?
> - How can I change the text size of a substr?

You can do this through the EditEngine, e.g.

// setting the text color for a range in EditEngine
ESelection aSel(nStartPara, nStartChar, nEndPara, nEndChar);
SfxItemSet aSet(mpEditEngine->GetEmptyItemSet());
aSet.Put(SvxColorItem(nColor, EE_CHAR_COLOR));
pEditEngine->QuickSetAttribs(aSet, aSel);

// for background color
SvxBackgroundColorItem(..., EE_CHAR_BKGCOLOR);

// for the three font category sizes
SvxFontHeightItem(..., EE_CHAR_FONTHEIGHT));
SvxFontHeightItem(..., EE_CHAR_FONTHEIGHT_CJK));
SvxFontHeightItem(..., EE_CHAR_FONTHEIGHT_CTL));




More information about the LibreOffice mailing list