Personal tools
You are here: Home Forum Nice Office Access (NOA) textdocument does not close

 • textdocument does not close

Replies: 0   Views: 101
Up one level

 • textdocument does not close

Posted by jstaerk at 2011-07-03 10:52:08
it seems as if textdocument's close (which would be document.close() in this example) hangs if I do some dispatches

 int additionalRowIndex = end+1;
      table.addRow(additionalRowIndex,1);
      ITextTableCell additionalRowCells = table.getRow(additionalRowIndex).getCells();
      int copyNumberRows = additionalRowIndex-start+1;
      String endColumn = TextTableCellNameHelper.getColumnCharacter(additionalRowCells.length-1);
      
      String cellRangeToCopy = "A"+(start+1)+":"+endColumn+(additionalRowIndex+1); //$NON-NLS-1$ //$NON-NLS-2$
      String cellRangeToCopyTo = "A"+(start+1+copyNumberRows)+":"+endColumn+(additionalRowIndex+copyNumberRows+1); //$NON-NLS-1$ //$NON-NLS-2$
              
      //copy line
      for(int i = 0; i < numItems-1; i++) {
        ITextTableCellRange cellRange = table.getCellRange(cellRangeToCopy);
        document.setSelection(new XInterfaceObjectSelection(cellRange.getXCellRange()));
        IFrame frame = document.getFrame();
        frame.getDispatch(GlobalCommands.COPY).dispatch();
        for(int j = 0; j < copyNumberRows; j++) {
          frame.getDispatch(GlobalCommands.INSTER_ROWS).dispatch();
          Thread.sleep(50);
        }
        frame.getDispatch(GlobalCommands.COPY).dispatch();
        ITextTableCellRange cellRange2 = table.getCellRange(cellRangeToCopyTo);
        document.setSelection(new XInterfaceObjectSelection(cellRange2.getXCellRange()));
        frame.getDispatch(GlobalCommands.PASTE).dispatch();
      }
jstaerk Member
Posts: 52

Powered by Plone, the Open Source Content Management System

This site conforms to the following standards: