summaryrefslogtreecommitdiff
path: root/sw/source
diff options
context:
space:
mode:
authorJustin Luth <jluth@mail.com>2024-07-24 10:07:09 -0400
committerJustin Luth <jluth@mail.com>2024-07-24 20:01:18 +0200
commit926372b8de7f283c5fd890c23b6d0755ff6bed87 (patch)
treea6218d53b1f066a2eaaaf895a679efe8155e418a /sw/source
parent84929c43df529ad9fcb6382349015b3d9aa2e202 (diff)
tdf#157952 sw content controls, drop-down: remove when obsolete
One place that was missed was when moving from one content control to another (for example, using the tab key). Change-Id: I62a3af2a5a7036aaac605d592c244a58f5b65a12 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/170967 Reviewed-by: Justin Luth <jluth@mail.com> Tested-by: Jenkins
Diffstat (limited to 'sw/source')
-rw-r--r--sw/source/core/crsr/viscrs.cxx22
1 files changed, 7 insertions, 15 deletions
diff --git a/sw/source/core/crsr/viscrs.cxx b/sw/source/core/crsr/viscrs.cxx
index 5a67e7192d0d..64b9d3be49e1 100644
--- a/sw/source/core/crsr/viscrs.cxx
+++ b/sw/source/core/crsr/viscrs.cxx
@@ -696,6 +696,13 @@ void SwSelPaintRects::HighlightContentControl()
}
}
+ // clear an obsolete dropdown if the cursor has moved away from the content control
+ if (m_pContentControlButton
+ && (!pContentControl || m_pContentControlButton->GetContentControl() != pContentControl))
+ {
+ m_pContentControlButton.disposeAndClear();
+ }
+
auto pWrtShell = dynamic_cast<const SwWrtShell*>(GetShell());
if (!aContentControlRanges.empty())
{
@@ -756,11 +763,6 @@ void SwSelPaintRects::HighlightContentControl()
if (pWrtShell)
{
auto& rEditWin = const_cast<SwEditWin&>(pWrtShell->GetView().GetEditWin());
- if (m_pContentControlButton
- && m_pContentControlButton->GetContentControl() != pContentControl)
- {
- m_pContentControlButton.disposeAndClear();
- }
if (!m_pContentControlButton)
{
m_pContentControlButton = VclPtr<SwDropDownContentControlButton>::Create(
@@ -783,11 +785,6 @@ void SwSelPaintRects::HighlightContentControl()
if (pWrtShell)
{
auto& rEditWin = const_cast<SwEditWin&>(pWrtShell->GetView().GetEditWin());
- if (m_pContentControlButton
- && m_pContentControlButton->GetContentControl() != pContentControl)
- {
- m_pContentControlButton.disposeAndClear();
- }
if (!m_pContentControlButton)
{
m_pContentControlButton = VclPtr<SwDateContentControlButton>::Create(
@@ -824,11 +821,6 @@ void SwSelPaintRects::HighlightContentControl()
}
m_pContentControlOverlay.reset();
- if (m_pContentControlButton)
- {
- m_pContentControlButton.disposeAndClear();
- }
-
if (pWrtShell)
{
auto& rEditWin = const_cast<SwEditWin&>(pWrtShell->GetView().GetEditWin());