[Libreoffice-commits] core.git: starmath/source

Marcos Paulo de Souza marcos.souza.org at gmail.com
Thu Dec 24 11:35:11 PST 2015


 starmath/source/edit.cxx |    5 +++++
 1 file changed, 5 insertions(+)

New commits:
commit fc47ee6fbf67781acd07549c40a75c9272572085
Author: Marcos Paulo de Souza <marcos.souza.org at gmail.com>
Date:   Tue Dec 15 18:37:04 2015 -0200

    Fix tdf#32062: Math overwrites selected area when click on element
    
    Change-Id: I42ce83d1647d054419dbf664dfbfb2bc1cd01338
    Reviewed-on: https://gerrit.libreoffice.org/20729
    Tested-by: Jenkins <ci at libreoffice.org>
    Reviewed-by: jan iversen <jani at documentfoundation.org>

diff --git a/starmath/source/edit.cxx b/starmath/source/edit.cxx
index f156ee6..11f0227 100644
--- a/starmath/source/edit.cxx
+++ b/starmath/source/edit.cxx
@@ -1026,6 +1026,11 @@ void SmEditWindow::InsertText(const OUString& rText)
         // callers
         OUString string(rText);
 
+        OUString selected(pEditView->GetSelected());
+        // if we have text selected, use it in the first placeholder
+        if (!selected.isEmpty())
+            string = string.replaceFirst("<?>", selected);
+
         // put a space before a new command if not in the beginning of a line
         if (aSelection.nStartPos > 0 && aCurrentFormula[nStartIndex - 1] != ' ')
             string = " " + string;


More information about the Libreoffice-commits mailing list