sw/source/ui/vba/vbacontentcontrol.cxx | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-)
New commits: commit 28ff4647e9dac8eebe3a169e828bacc8dc78e363 Author: Justin Luth <justin.l...@collabora.com> AuthorDate: Tue Dec 13 12:15:22 2022 -0500 Commit: Justin Luth <jl...@mail.com> CommitDate: Thu Dec 15 02:02:36 2022 +0000 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 <jl...@mail.com> 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"); }