diff options
author | Justin Luth <justin.luth@collabora.com> | 2022-12-13 12:15:22 -0500 |
---|---|---|
committer | Justin Luth <jluth@mail.com> | 2022-12-15 02:02:36 +0000 |
commit | 28ff4647e9dac8eebe3a169e828bacc8dc78e363 (patch) | |
tree | 9da2d14e56d5775275ba4967e6668449b94e3562 /sw/source/ui | |
parent | bef199febca711c9aa3fd199e8ca525b7d97a04f (diff) |
tdf#151548 vba ContentControls: showingPlaceholder improvements
I reviewed the effect of the recent change to how showingPlaceholder
status was reset. It really didn't have any effect that I could find,
but the code review resulted in these minor improvements.
Change-Id: I4ba8da694c1dd4a4e7c77fe0cf20e5a5082564df
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/144134
Tested-by: Jenkins
Reviewed-by: Justin Luth <jluth@mail.com>
Diffstat (limited to 'sw/source/ui')
-rw-r--r-- | sw/source/ui/vba/vbacontentcontrol.cxx | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/sw/source/ui/vba/vbacontentcontrol.cxx b/sw/source/ui/vba/vbacontentcontrol.cxx index e53ad6c51d31..775e7fbbdea3 100644 --- a/sw/source/ui/vba/vbacontentcontrol.cxx +++ b/sw/source/ui/vba/vbacontentcontrol.cxx @@ -719,7 +719,7 @@ void SwVbaContentControl::SetCheckedSymbol(sal_Int32 Character, const uno::Any& std::shared_ptr<SwContentControl> pCC = m_rCC.GetContentControl().GetContentControl(); pCC->SetCheckedState(OUString(static_cast<sal_Unicode>(Character))); - if (pCC->GetCheckbox() && pCC->GetChecked()) + if (pCC->GetCheckbox() && pCC->GetChecked() && !pCC->GetShowingPlaceHolder()) m_rCC.Invalidate(); } @@ -732,7 +732,7 @@ void SwVbaContentControl::SetUnCheckedSymbol(sal_Int32 Character, const uno::Any std::shared_ptr<SwContentControl> pCC = m_rCC.GetContentControl().GetContentControl(); pCC->SetUncheckedState(OUString(static_cast<sal_Unicode>(Character))); - if (pCC->GetCheckbox() && !pCC->GetChecked()) + if (pCC->GetCheckbox() && !pCC->GetChecked() && !pCC->GetShowingPlaceHolder()) m_rCC.Invalidate(); } @@ -758,7 +758,10 @@ void SwVbaContentControl::SetPlaceholderText(const uno::Any& BuildingBlock, cons // Remove placeholder text. pCC->SetPlaceholderDocPart(""); } - m_rCC.Invalidate(); + if (pCC->GetShowingPlaceHolder() && !getLockContents()) + { + //replace the text and ensure showing placeholder is still set + } } void SwVbaContentControl::Ungroup() { SAL_INFO("sw.vba", "SwVbaContentControl::UnGroup stub"); } |