Revision 42293 trunk/org.gvsig.desktop/org.gvsig.desktop.plugin/org.gvsig.app/org.gvsig.app.mainplugin/src/main/java/org/gvsig/app/project/DefaultProject.java

View differences:

DefaultProject.java
464 464
     * @return Documento
465 465
     */
466 466
    public Document getDocument(String name, String type) {
467
        if (type != null) {
467
        if (type == null) {
468 468
            for (int i = 0; i < documents.size(); i++) {
469 469
                Document document = documents.get(i);
470
                if ( name.equalsIgnoreCase(document.getName())) {
471
                    return document;
472
                }
473
            }
474
        } else {
475
            for (int i = 0; i < documents.size(); i++) {
476
                Document document = documents.get(i);
470 477
                if (type.equalsIgnoreCase(document.getTypeName())
471 478
                        && name.equalsIgnoreCase(document.getName())) {
472 479
                    return document;
......
475 482
        }
476 483
        return null;
477 484
    }
485
    
486
    public Document getDocument(String name) {
487
        return this.getDocument(name, null);
488
    }    
478 489

  
479 490
    public String getUniqueNameForDocument(String type, String name) {
480 491
        Document document = getDocument(name, type);

Also available in: Unified diff