diff options
author | Miklos Vajna <vmiklos@collabora.com> | 2022-04-06 08:40:31 +0200 |
---|---|---|
committer | Miklos Vajna <vmiklos@collabora.com> | 2022-04-06 09:49:36 +0200 |
commit | c2999f9f3e0efa04f89055399f2d176c9c95e92d (patch) | |
tree | 0818dc1b03391fd5c4b285f99b01caba6cbc2514 /sw/inc | |
parent | c9b69e412b9646f7d49f500d47a078c2ea155c8c (diff) |
sw content controls: add overlay to render a border around the text portions
- introduce SwSelPaintRects::HighlightContentControl() to create the
overlay
- use GetTextAttrAt() to enable this when we're inside a content control
(not only when the cursor is exactly at the dummy char of the content
control, which is at the start)
- tested that this works correctly even if the portions inside the
content control don't have the same height (similar to the selection
overlay)
Change-Id: I1db51cdb1ddc87c45740cd8677de645dc8906697
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/132618
Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
Tested-by: Jenkins
Diffstat (limited to 'sw/inc')
-rw-r--r-- | sw/inc/viscrs.hxx | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/sw/inc/viscrs.hxx b/sw/inc/viscrs.hxx index 6755b548e8a0..2eb2f787fbc7 100644 --- a/sw/inc/viscrs.hxx +++ b/sw/inc/viscrs.hxx @@ -84,8 +84,11 @@ class SwSelPaintRects : public SwRects bool m_bShowTextInputFieldOverlay; std::unique_ptr<sw::overlay::OverlayRangesOutline> m_pTextInputFieldOverlay; + bool m_bShowContentControlOverlay; + std::unique_ptr<sw::overlay::OverlayRangesOutline> m_pContentControlOverlay; void HighlightInputField(); + void HighlightContentControl(); public: SwSelPaintRects( const SwCursorShell& rCSh ); @@ -108,6 +111,8 @@ public: m_bShowTextInputFieldOverlay = bShow; } + void SetShowContentControlOverlay(const bool bShow) { m_bShowContentControlOverlay = bShow; } + const SwCursorShell* GetShell() const { return m_pCursorShell; } // check current MapMode of the shell and set possibly the static members. // Optional set the parameters pX, pY |