From f27e700c945473012127ad5ee92f0c233e5039ba Mon Sep 17 00:00:00 2001 From: Samuel Mehrbrodt Date: Fri, 13 Apr 2018 15:38:41 +0200 Subject: tdf#83877 Also hide label when user can't add coment Change-Id: Ie9407c2bb32dd190df84b04495f6e2a27885e0a8 Reviewed-on: https://gerrit.libreoffice.org/52838 Tested-by: Jenkins Reviewed-by: Samuel Mehrbrodt --- cui/source/dialogs/SignSignatureLineDialog.cxx | 24 +++++++++++++++--------- cui/source/inc/SignSignatureLineDialog.hxx | 1 + 2 files changed, 16 insertions(+), 9 deletions(-) diff --git a/cui/source/dialogs/SignSignatureLineDialog.cxx b/cui/source/dialogs/SignSignatureLineDialog.cxx index 1b39b1f8e61b..7c3d6a6f4eef 100644 --- a/cui/source/dialogs/SignSignatureLineDialog.cxx +++ b/cui/source/dialogs/SignSignatureLineDialog.cxx @@ -55,6 +55,7 @@ SignSignatureLineDialog::SignSignatureLineDialog(weld::Widget* pParent, Referenc , m_xBtnSign(m_xBuilder->weld_button("ok")) , m_xLabelHint(m_xBuilder->weld_label("label_hint")) , m_xLabelHintText(m_xBuilder->weld_label("label_hint_text")) + , m_xLabelAddComment(m_xBuilder->weld_label("label_add_comment")) { Reference xIndexAccess(m_xModel->getCurrentSelection(), UNO_QUERY_THROW); @@ -71,15 +72,6 @@ SignSignatureLineDialog::SignSignatureLineDialog(weld::Widget* pParent, Referenc m_xBtnChooseCertificate->connect_clicked( LINK(this, SignSignatureLineDialog, chooseCertificate)); - bool bCanAddComment; - m_xShapeProperties->getPropertyValue("SignatureLineCanAddComment") >>= bCanAddComment; - m_xEditComment->show(bCanAddComment); - if (bCanAddComment) - m_xEditComment->set_size_request(m_xEditComment->get_approximate_digit_width() * 48, - m_xEditComment->get_text_height() * 5); - else - m_xEditComment->set_size_request(0, 0); - // Read properties from selected signature line m_xShapeProperties->getPropertyValue("SignatureLineId") >>= m_aSignatureLineId; m_xShapeProperties->getPropertyValue("SignatureLineSuggestedSignerName") @@ -90,6 +82,8 @@ SignSignatureLineDialog::SignSignatureLineDialog(weld::Widget* pParent, Referenc m_xShapeProperties->getPropertyValue("SignatureLineSigningInstructions") >>= aSigningInstructions; m_xShapeProperties->getPropertyValue("SignatureLineShowSignDate") >>= m_bShowSignDate; + bool bCanAddComment; + m_xShapeProperties->getPropertyValue("SignatureLineCanAddComment") >>= bCanAddComment; if (aSigningInstructions.isEmpty()) { @@ -101,6 +95,18 @@ SignSignatureLineDialog::SignSignatureLineDialog(weld::Widget* pParent, Referenc m_xLabelHintText->set_label(aSigningInstructions); } + if (bCanAddComment) + { + m_xEditComment->set_size_request(m_xEditComment->get_approximate_digit_width() * 48, + m_xEditComment->get_text_height() * 5); + } + else + { + m_xLabelAddComment->hide(); + m_xEditComment->hide(); + m_xEditComment->set_size_request(0, 0); + } + ValidateFields(); } diff --git a/cui/source/inc/SignSignatureLineDialog.hxx b/cui/source/inc/SignSignatureLineDialog.hxx index fb9c1c1ca2d0..926f2ba76d3c 100644 --- a/cui/source/inc/SignSignatureLineDialog.hxx +++ b/cui/source/inc/SignSignatureLineDialog.hxx @@ -27,6 +27,7 @@ private: std::unique_ptr m_xBtnSign; std::unique_ptr m_xLabelHint; std::unique_ptr m_xLabelHintText; + std::unique_ptr m_xLabelAddComment; css::uno::Reference m_xShapeProperties; css::uno::Reference m_xSelectedCertifate; -- cgit