[Libreoffice-commits] core.git: Branch 'libreoffice-6-1-0' - cui/source

Libreoffice Gerrit user logerrit at kemper.freedesktop.org
Fri Jul 27 06:23:14 UTC 2018


 cui/source/dialogs/SignatureLineDialog.cxx |    4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

New commits:
commit 63543c44f2ce1af3b8a1cb350f9d03bc75a54f7d
Author:     Michael Stahl <Michael.Stahl at cib.de>
AuthorDate: Wed Jul 25 13:14:30 2018 +0200
Commit:     Thorsten Behrens <Thorsten.Behrens at CIB.de>
CommitDate: Fri Jul 27 08:22:51 2018 +0200

    tdf#118777 cui: use right XText in SignatureLineDialog
    
    Writer has multiple nested XText and we have to call insertTextContent
    on the one that corresponds to the xCursor, so use the convenient
    getText() instead of hard-coding the body text.
    
    Change-Id: I86bce48e97730917aa8c4b093bb74c03e3f0dd36
    Reviewed-on: https://gerrit.libreoffice.org/57969
    Tested-by: Jenkins
    Reviewed-by: Michael Stahl <Michael.Stahl at cib.de>
    (cherry picked from commit 7213a583f5c1d42c05dc4f19b4d4d2f9dded7733)
    Reviewed-on: https://gerrit.libreoffice.org/57978
    Reviewed-by: Katarina Behrens <Katarina.Behrens at cib.de>
    (cherry picked from commit 8a4f07b367284e898898b1840fc22f357099aba9)
    Reviewed-on: https://gerrit.libreoffice.org/58050
    Reviewed-by: Eike Rathke <erack at redhat.com>
    Reviewed-by: Thorsten Behrens <Thorsten.Behrens at CIB.de>
    Tested-by: Thorsten Behrens <Thorsten.Behrens at CIB.de>

diff --git a/cui/source/dialogs/SignatureLineDialog.cxx b/cui/source/dialogs/SignatureLineDialog.cxx
index f2a5ec06d26e..60e8491cbff0 100644
--- a/cui/source/dialogs/SignatureLineDialog.cxx
+++ b/cui/source/dialogs/SignatureLineDialog.cxx
@@ -165,11 +165,13 @@ void SignatureLineDialog::Apply()
 
         // Insert into document
         const Reference<XTextDocument> xTextDocument(m_xModel, UNO_QUERY);
-        Reference<XText> xText = xTextDocument->getText();
         Reference<XTextContent> xTextContent(xShape, UNO_QUERY_THROW);
         Reference<XTextViewCursorSupplier> xViewCursorSupplier(m_xModel->getCurrentController(),
                                                                UNO_QUERY_THROW);
         Reference<XTextViewCursor> xCursor = xViewCursorSupplier->getViewCursor();
+        // use cursor's XText - it might be in table cell, frame, ...
+        Reference<XText> const xText(xCursor->getText());
+        assert(xText.is());
         xText->insertTextContent(xCursor, xTextContent, true);
     }
 }


More information about the Libreoffice-commits mailing list