summaryrefslogtreecommitdiff
path: root/cui
diff options
context:
space:
mode:
authorshubham goyal <22shubh22@gmail.com>2019-09-13 18:23:51 +0200
committerThorsten Behrens <Thorsten.Behrens@CIB.de>2019-12-07 23:14:42 +0100
commit06b6879dbc93479a22163cadd3c91cf265a29781 (patch)
tree0de1b7269eb8ece77c734cb4e8b49afe8ed459c8 /cui
parent2d5b0b03f77bc43c8c6ac0b46e8f2e20c32dd3f2 (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> (cherry picked from commit 704a558b8689beb1a83a3e2d21481e0ea118e134) Reviewed-on: https://gerrit.libreoffice.org/84613 Reviewed-by: Thorsten Behrens <Thorsten.Behrens@CIB.de>
Diffstat (limited to 'cui')
-rw-r--r--cui/source/dialogs/QrCodeGenDialog.cxx8
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;
}