summaryrefslogtreecommitdiff
path: root/cui
diff options
context:
space:
mode:
authorSamuel Mehrbrodt <Samuel.Mehrbrodt@cib.de>2018-04-13 15:38:41 +0200
committerSamuel Mehrbrodt <Samuel.Mehrbrodt@cib.de>2018-04-16 08:46:54 +0200
commitf27e700c945473012127ad5ee92f0c233e5039ba (patch)
tree6075e1aec29d2420c0354f6b7cfe432db3fe2445 /cui
parent6654e68cd596345d1b74856ef47c83efcbf503d3 (diff)
tdf#83877 Also hide label when user can't add coment
Change-Id: Ie9407c2bb32dd190df84b04495f6e2a27885e0a8 Reviewed-on: https://gerrit.libreoffice.org/52838 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Samuel Mehrbrodt <Samuel.Mehrbrodt@cib.de>
Diffstat (limited to 'cui')
-rw-r--r--cui/source/dialogs/SignSignatureLineDialog.cxx24
-rw-r--r--cui/source/inc/SignSignatureLineDialog.hxx1
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<container::XIndexAccess> 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<weld::Button> m_xBtnSign;
std::unique_ptr<weld::Label> m_xLabelHint;
std::unique_ptr<weld::Label> m_xLabelHintText;
+ std::unique_ptr<weld::Label> m_xLabelAddComment;
css::uno::Reference<css::beans::XPropertySet> m_xShapeProperties;
css::uno::Reference<css::security::XCertificate> m_xSelectedCertifate;