updated build.xml
[phpeclipse.git] / net.sourceforge.phpeclipse.ui / src / net / sourceforge / phpeclipse / ui / text / rules / OuterDocumentView.java
index c438031..74abf96 100644 (file)
@@ -8,7 +8,7 @@
  * Contributors:
  *     Igor Malinin - initial contribution
  * 
- * $Id: OuterDocumentView.java,v 1.1 2004-09-02 18:26:29 jsurfer Exp $
+ * $Id: OuterDocumentView.java,v 1.3 2004-09-25 22:42:52 jsurfer Exp $
  */
 
 package net.sourceforge.phpeclipse.ui.text.rules;
@@ -148,8 +148,12 @@ public class OuterDocumentView extends AbstractDocument implements
 
                setTextStore(new TextStore());
                setLineTracker(new DefaultLineTracker());
-               getTracker().set(getStore().get(0, getLength()));
-
+               int length = getLength();
+               if (length<0) {
+                 length = 0;
+               }
+               getTracker().set(getStore().get(0, length));
                completeInitialization();
        }
 
@@ -207,6 +211,8 @@ public class OuterDocumentView extends AbstractDocument implements
                        // TODO: move to a better place
                        getTracker().replace(event.getOffset(), event.getLength(),
                                        event.getText());
+               } catch (IndexOutOfBoundsException x) {
+                 
                } catch (BadLocationException x) {
                }