PageNumberField.java (eba4d44a) | PageNumberField.java (3ecf08d2) |
---|---|
1/************************************************************** 2 * 3 * Licensed to the Apache Software Foundation (ASF) under one 4 * or more contributor license agreements. See the NOTICE file 5 * distributed with this work for additional information 6 * regarding copyright ownership. The ASF licenses this file 7 * to you under the Apache License, Version 2.0 (the 8 * "License"); you may not use this file except in compliance --- 147 unchanged lines hidden (view full) --- 156 /** 157 * Get the page number by getText 158 * This page number is at end of this document 159 * @param document 160 * @return 161 */ 162 private int getPageNumber(XTextDocument document) { 163 try { | 1/************************************************************** 2 * 3 * Licensed to the Apache Software Foundation (ASF) under one 4 * or more contributor license agreements. See the NOTICE file 5 * distributed with this work for additional information 6 * regarding copyright ownership. The ASF licenses this file 7 * to you under the Apache License, Version 2.0 (the 8 * "License"); you may not use this file except in compliance --- 147 unchanged lines hidden (view full) --- 156 /** 157 * Get the page number by getText 158 * This page number is at end of this document 159 * @param document 160 * @return 161 */ 162 private int getPageNumber(XTextDocument document) { 163 try { |
164 Thread.sleep(1000); //sleep before get page number field, there is a bug:120625 | 164 Thread.sleep(5*1000); //sleep before get page number field, there is a bug:120625 |
165 } catch (InterruptedException e) { 166 e.printStackTrace(); 167 } 168 String documentString = document.getText().getString().trim(); 169 int length = documentString.length(); 170 String strNum = String.valueOf(documentString.charAt(length -1)); 171 int number = Integer.valueOf(strNum); 172 return number; --- 23 unchanged lines hidden --- | 165 } catch (InterruptedException e) { 166 e.printStackTrace(); 167 } 168 String documentString = document.getText().getString().trim(); 169 int length = documentString.length(); 170 String strNum = String.valueOf(documentString.charAt(length -1)); 171 int number = Integer.valueOf(strNum); 172 return number; --- 23 unchanged lines hidden --- |