[Libreoffice-commits] core.git: scripting/java

Andreas Heinisch (via logerrit) logerrit at kemper.freedesktop.org
Tue May 21 10:40:51 UTC 2019


 scripting/java/com/sun/star/script/framework/provider/beanshell/PlainSourceView.java |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

New commits:
commit d7f1ca82198e1cc73fe4bb38f3034c6dc110af83
Author:     Andreas Heinisch <andreas.heinisch at yahoo.de>
AuthorDate: Tue May 21 11:14:04 2019 +0200
Commit:     Samuel Mehrbrodt <Samuel.Mehrbrodt at cib.de>
CommitDate: Tue May 21 12:39:43 2019 +0200

    tdf#97635 Added unindentation using shift-tab (mimicked eclipse behavior)
    
    Restored java 6 compatibility
    
    Change-Id: I550920457874b9261bdde07040aad8f7b67773d8
    Reviewed-on: https://gerrit.libreoffice.org/72671
    Reviewed-by: Samuel Mehrbrodt <Samuel.Mehrbrodt at cib.de>
    Tested-by: Samuel Mehrbrodt <Samuel.Mehrbrodt at cib.de>

diff --git a/scripting/java/com/sun/star/script/framework/provider/beanshell/PlainSourceView.java b/scripting/java/com/sun/star/script/framework/provider/beanshell/PlainSourceView.java
index cc1e22ee21e7..b2a4dd61c243 100644
--- a/scripting/java/com/sun/star/script/framework/provider/beanshell/PlainSourceView.java
+++ b/scripting/java/com/sun/star/script/framework/provider/beanshell/PlainSourceView.java
@@ -63,7 +63,7 @@ public class PlainSourceView extends JScrollPane implements
     UndoManager undoManager;
     private List<UnsavedChangesListener> unsavedListener = new ArrayList<UnsavedChangesListener>();
 
-    private static final Pattern tabPattern = Pattern.compile("^ *(?<tab>\\t)");
+    private static final Pattern tabPattern = Pattern.compile("^ *(\\t)");
 
     public PlainSourceView(ScriptSourceModel model) {
         this.model = model;
@@ -186,7 +186,7 @@ public class PlainSourceView extends JScrollPane implements
 
                         Matcher matcher = tabPattern.matcher(ta.getText(startOffset, endOffset - startOffset));
                         if (matcher.find()) {
-                            ta.replaceRange(null, startOffset + matcher.start("tab"), startOffset + matcher.end("tab"));
+                            ta.replaceRange(null, startOffset + matcher.start(1), startOffset + matcher.end(1));
                         }
                     } catch (BadLocationException e) {
                         // could not find correct location of the tab


More information about the Libreoffice-commits mailing list