~ubuntu-branches/ubuntu/quantal/gnumeric/quantal

« back to all changes in this revision

Viewing changes to src/expr-name.c

  • Committer: Bazaar Package Importer
  • Author(s): Gauvain Pocentek
  • Date: 2009-06-07 11:10:47 UTC
  • mfrom: (1.1.19 upstream) (2.1.2 squeeze)
  • Revision ID: james.westby@ubuntu.com-20090607111047-l3rtbzfjxvmi1kx0
Tags: 1.9.8-1ubuntu1
* Merge from debian unstable, remaining changes:
  - Promoted gnumeric-doc to Recommends in gnumeric package for help to be
    installed automatically
  - gnumeric-gtk is a transitional package
  - gnumeric conflicts with gnumeric-gtk << 1.8.3-3ubuntu1
  - call initltool-update in po*
  - remove psiconv support (psiconv is in universe):
    o debian/control: remove B-D on libpsiconv-dev
    o debian/rules: don't pass --with-psiconv to ./configure

Show diffs side-by-side

added added

removed removed

Lines of Context:
36
36
 * returns TRUE if the given name is valid, FALSE otherwise.
37
37
 */
38
38
gboolean
39
 
expr_name_validate (const char *name)
 
39
expr_name_validate (const char *name, Sheet *sheet)
40
40
{
41
41
        GnmCellPos cp;
42
42
        const char *p;
52
52
                return FALSE;
53
53
 
54
54
        /* What about R1C1?  */
55
 
        if (cellpos_parse (name, &cp, TRUE))
 
55
        if (cellpos_parse (name, gnm_sheet_get_size (sheet), &cp, TRUE))
56
56
                return FALSE;
57
57
 
58
58
        /* Hmm...   Now what?  */
297
297
        return user.res;
298
298
}
299
299
 
 
300
/* Iterate over all names, including placeholders.  */
 
301
void
 
302
gnm_named_expr_collection_foreach (GnmNamedExprCollection *names,
 
303
                                   GHFunc func,
 
304
                                   gpointer data)
 
305
{
 
306
        g_hash_table_foreach (names->names, func, data);
 
307
        g_hash_table_foreach (names->placeholders, func, data);
 
308
}
 
309
 
300
310
/******************************************************************************/
301
311
 
302
312
/**
311
321
        GSList *sheets, *ptr;
312
322
 
313
323
        sheets = gnm_expr_top_referenced_sheets (nexpr->texpr);
 
324
 
314
325
        for (ptr = sheets ; ptr != NULL ; ptr = ptr->next) {
315
326
                Sheet *sheet = ptr->data;
316
327
                GnmNamedExpr *found;
317
328
 
 
329
                /* Implicit reference.  */
 
330
                if (!sheet)
 
331
                        continue;
 
332
 
318
333
                /* No need to do anything during destruction */
319
334
                if (sheet->deps == NULL)
320
335
                        continue;
623
638
                nexpr->name->str);
624
639
}
625
640
 
 
641
const char *
 
642
expr_name_name (GnmNamedExpr const *nexpr)
 
643
{
 
644
        g_return_val_if_fail (nexpr != NULL, NULL);
 
645
        return nexpr->name->str;
 
646
}
 
647
 
626
648
/**
627
649
 * expr_name_as_string :
628
650
 * @nexpr :