summaryrefslogtreecommitdiff
path: root/config_host.mk.in
diff options
context:
space:
mode:
authorMichael Stahl <Michael.Stahl@cib.de>2020-01-24 19:05:40 +0100
committerMichael Stahl <michael.stahl@cib.de>2020-01-30 14:36:32 +0100
commit4ce8120f1e53f7b81e653b01d141643013bc69ab (patch)
treeaf0373eb2c4107b776961d2236b66c87bbd3d30d /config_host.mk.in
parent8029179e35fcda5867769d4ca6f7ee32bca3e9bc (diff)
tdf#45589 sw: create and paint text portions for bookmarks
Add a new SwBookmarkPortion, derived from SwControlCharPortion. There is no character for the bookmark in the text so the portion has length of 0, which makes things quite a bit more tricky. Formatting: * SwBookmarkPortion is created last in WhichFirstPortion(). * In an empty paragraph the SwTextFrame::FormatEmpty() must be disabled. * If there's a bookmark at the end of a paragraph, SwTextFormatter::CalcAscent() must use the font of the previous character, not the paragraph font, because that could grow the line if it's higher. * The SwMultiPortion complicates matters, because it uses a nested SwTextFormatInfo and thus we need some extra steps to prevent duplicate SwBookmarkPortions; this is particluarly a problem for rotated text portions. - SwTextFormatter::BuildPortions() must advance the outer SwTextFormatInfo's bookmark position because BuildMultiPortion() has already created the SwBookmarkPortion. - If a SwBookmarkPortion is at the start of a SwMultiPortion, it will be created before the SwMultiPortion but must be painted inside the SwMultiPortion because its font is going to be initialised as inside the SwMultiPortion (e.g. it will be rotated) so its position must also be adapted to be inside, and only SwTextPainter::PaintMultiPortion() does the setup for that; add a hack to move it in SwTextFormatter::BuildMultiPortion(). Painting: * Using the original font seems rather difficult, hard to predict what some character is going to look like, and how it scales if the size is increased; use OpenSymbol instead. Unfortunately OpenSymbol doesn't have a good glyph that could be used for both the end of a bookmark and start of another bookmark at the same position. * SwLinePortion::PrePaint() wants to avoid moving the portion half-outside the frame but often it looks better that way (previously it was misaligned, now it's half-outside). * Not sure if it makes sense to draw a field shading in SwTextPaintInfo::DrawViewOpt() too; let's try it out, but dependent on the same IsViewMetaChars() setting as the bookmark character itself, not on the field shading setting. Change-Id: I1ab94afb417221e278dbb3afd6c978a05fc78497 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/87364 Reviewed-by: Michael Stahl <michael.stahl@cib.de> Tested-by: Michael Stahl <michael.stahl@cib.de>
Diffstat (limited to 'config_host.mk.in')
0 files changed, 0 insertions, 0 deletions