diff options
author | shubham goyal <22shubh22@gmail.com> | 2019-09-13 18:23:51 +0200 |
---|---|---|
committer | Samuel Mehrbrodt <Samuel.Mehrbrodt@cib.de> | 2019-12-06 08:16:40 +0100 |
commit | 704a558b8689beb1a83a3e2d21481e0ea118e134 (patch) | |
tree | 5a7fa674826df43bc09227b964c26d2cd1abcdb7 /cui/source | |
parent | 579db0d2d3d2ddf5a5f8feaa2e7cc4dde81d7701 (diff) |
tdf#127305 display selected text in URL field QR Code Dialog
Change-Id: Ic0d36225cc2c509c706a4599d45b92c6b9fea40e
Reviewed-on: https://gerrit.libreoffice.org/78879
Tested-by: Jenkins
Reviewed-by: Samuel Mehrbrodt <Samuel.Mehrbrodt@cib.de>
Diffstat (limited to 'cui/source')
-rw-r--r-- | cui/source/dialogs/QrCodeGenDialog.cxx | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/cui/source/dialogs/QrCodeGenDialog.cxx b/cui/source/dialogs/QrCodeGenDialog.cxx index 7bd72ff0fc1c..d936219f7209 100644 --- a/cui/source/dialogs/QrCodeGenDialog.cxx +++ b/cui/source/dialogs/QrCodeGenDialog.cxx @@ -73,6 +73,14 @@ QrCodeGenDialog::QrCodeGenDialog(weld::Widget* pParent, Reference<XModel> xModel { if (!bEditExisting) { + // TODO: This only works in Writer doc. Should also work in shapes + Reference<XIndexAccess> xSelections(m_xModel->getCurrentSelection(), UNO_QUERY); + if (xSelections.is()) + { + Reference<XTextRange> xSelection(xSelections->getByIndex(0), UNO_QUERY); + if (xSelection.is()) + m_xEdittext->set_text(xSelection->getString()); + } return; } |