~ubuntu-branches/ubuntu/utopic/inkscape/utopic-proposed

« back to all changes in this revision

Viewing changes to src/sp-namedview.cpp

Tags: upstream-0.48.0
ImportĀ upstreamĀ versionĀ 0.48.0

Show diffs side-by-side

added added

removed removed

Lines of Context:
218
218
    }
219
219
 
220
220
    sp_object_read_attr(object, "inkscape:document-units");
221
 
    sp_object_read_attr(object, "units");
222
221
    sp_object_read_attr(object, "viewonly");
223
222
    sp_object_read_attr(object, "showguides");
224
223
    sp_object_read_attr(object, "showgrid");
573
572
            object->requestModified(SP_OBJECT_MODIFIED_FLAG);
574
573
            break;
575
574
    }
576
 
    case SP_ATTR_UNITS: {
577
 
            SPUnit const *new_unit = NULL;
578
 
 
579
 
            if (value) {
580
 
                SPUnit const *const req_unit = sp_unit_get_by_abbreviation(value);
581
 
                if ( req_unit == NULL ) {
582
 
                    g_warning("Unrecognized unit `%s'", value);
583
 
                    /* fixme: Document errors should be reported in the status bar or
584
 
                     * the like (e.g. as per
585
 
                     * http://www.w3.org/TR/SVG11/implnote.html#ErrorProcessing); g_log
586
 
                     * should be only for programmer errors. */
587
 
                } else if ( req_unit->base == SP_UNIT_ABSOLUTE ||
588
 
                            req_unit->base == SP_UNIT_DEVICE     ) {
589
 
                    new_unit = req_unit;
590
 
                } else {
591
 
                    g_warning("Document units must be absolute like `mm', `pt' or `px', but found `%s'",
592
 
                              value);
593
 
                    /* fixme: Don't use g_log (see above). */
594
 
                }
595
 
            }
596
 
            nv->units = new_unit;
597
 
            object->requestModified(SP_OBJECT_MODIFIED_FLAG);
598
 
            break;
599
 
    }
600
575
    default:
601
576
            if (((SPObjectClass *) (parent_class))->set) {
602
577
                ((SPObjectClass *) (parent_class))->set(object, key, value);