android: fewer exceptions, and more debug output on null renderables

cleanup some library mentions
This commit is contained in:
Michael Meeks
2012-08-03 21:07:43 +01:00
parent 69207d1f69
commit 5f09718dba
4 changed files with 46 additions and 27 deletions

View File

@@ -21,11 +21,9 @@ copy-stuff:
#
for F in $(strip \
analysislo \
avmedialo \
basebmplo \
basegfxlo \
bootstrap.uno \
canvastoolslo \
chartcontrollerlo \
chartcorelo \
comphelpgcc3 \
@@ -34,7 +32,6 @@ copy-stuff:
datelo \
dbaxmllo \
dbtoolslo \
drawinglayerlo \
embobj \
evtattlo \
expwrap.uno \

View File

@@ -279,6 +279,12 @@ public class DocumentLoader
// Use dummySmallDevice with no scale of offset just to find out
// the paper size of this page.
Log.i( TAG , "Render( " + Integer.toString( number ) + " )");
if (renderable == null) {
Log.i( TAG , "no renderable");
return null;
}
PropertyValue renderProps[] = new PropertyValue[3];
renderProps[0] = new PropertyValue();
renderProps[0].Name = "IsPrinter";
@@ -363,6 +369,11 @@ public class DocumentLoader
// Use dummySmallDevice with no scale of offset just to find out
// the paper size of this page.
if (renderable == null) {
Log.i( TAG , "no renderable to render page ( " + Integer.toString(number) + " )" );
return null;
}
PropertyValue renderProps[] = new PropertyValue[3];
renderProps[0] = new PropertyValue();
renderProps[0].Name = "IsPrinter";
@@ -686,7 +697,8 @@ public class DocumentLoader
doc = componentLoader.loadComponentFromURL(url, "_blank", 0, loadProps);
publishProgress( new Integer( 33 ));
long t1 = System.currentTimeMillis();
Log.i(TAG, "Loading took " + ((t1-t0)-timingOverhead) + " ms");
Log.i(TAG, "Loading took " + ((t1-t0)-timingOverhead) + " ms => " +
(doc == null ? "null" : "have") + "document");
Object toolkitService = mcf.createInstanceWithContext
("com.sun.star.awt.Toolkit", context);
@@ -711,11 +723,19 @@ public class DocumentLoader
renderProps[2].Name = "View";
renderProps[2].Value = new MyXController();
if (renderable != null)
{
t0 = System.currentTimeMillis();
pageCount = renderable.getRendererCount(doc, renderProps);
t1 = System.currentTimeMillis();
Log.i(TAG, "getRendererCount: " + pageCount + ", took " + ((t1-t0)-timingOverhead) + " ms");
}
else
{
pageCount = 1; // hack
Log.i(TAG, "no / null renderable interface!");
}
}
catch (Exception e) {
e.printStackTrace(System.err);
finish();

View File

@@ -71,6 +71,8 @@ public class FileUtilities {
private static final String getExtension(String filename)
{
if (filename == null)
return "";
int nExt = filename.lastIndexOf('.');
if (nExt < 0)
return "";
@@ -96,6 +98,9 @@ public class FileUtilities {
static private boolean doAccept(String filename, int byMode, String byFilename)
{
android.util.Log.d("debug", "doAccept : " + filename + " mode " + byMode + " byFilename " + byFilename);
if (filename == null)
return false;
if (byMode == ALL && byFilename == "") {
if( filename.startsWith(".")) {//ignore hidden files
return false;

View File

@@ -93,14 +93,11 @@ copy-stuff: buildrcs
#
for F in $(strip \
analysislo \
avmedialo \
basebmplo \
basegfxlo \
bootstrap.uno \
canvastoolslo \
comphelpgcc3 \
cppcanvaslo \
drawinglayerlo \
embobj \
expwrap.uno \
fileacc \