~ubuntu-branches/ubuntu/lucid/libopenoffice-oodoc-perl/lucid

« back to all changes in this revision

Viewing changes to OODoc/Text.pm

  • Committer: Bazaar Package Importer
  • Author(s): Damyan Ivanov, Franck Joncourt
  • Date: 2009-05-28 08:42:06 UTC
  • mfrom: (1.1.2 upstream)
  • Revision ID: james.westby@ubuntu.com-20090528084206-oka569vsrwxhp038
Tags: 2.108-1
[ Franck Joncourt ]
* New upstream release
* d/control:
  + Bumped up Standards-Version to 3.8.1 (no changes).
  + Updated BDI from perl (>= 5.6.10-12) to perl.
  + Add /me to Uploaders.
* d/copyright: Updated copyright years for upstream
* Do not install scripts both in /usr/share/doc/$pkg/examples and /usr/bin.
* d/clean: Added both OODoc/config.xml and odftest.odt to remove them during
  the clean stage rather than *rm* them through d.rules.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
#----------------------------------------------------------------------------
2
2
#
3
 
#       $Id : Text.pm 2.235 2008-12-07 JMG$
 
3
#       $Id : Text.pm 2.236 2009-02-18 JMG$
4
4
#
5
5
#       Created and maintained by Jean-Marie Gouarne
6
 
#       Copyright 2008 by Genicorp, S.A. (www.genicorp.com)
 
6
#       Copyright 2009 by Genicorp, S.A. (www.genicorp.com)
7
7
#
8
8
#-----------------------------------------------------------------------------
9
9
 
10
10
package OpenOffice::OODoc::Text;
11
11
use     5.008_000;
12
 
use     OpenOffice::OODoc::XPath        2.228;
 
12
use     OpenOffice::OODoc::XPath        2.229;
13
13
our     @ISA            = qw ( OpenOffice::OODoc::XPath );
14
 
our     $VERSION        = 2.235;
 
14
our     $VERSION        = 2.236;
15
15
 
16
16
#-----------------------------------------------------------------------------
17
17
# synonyms
67
67
        *cellType                       = *fieldType;
68
68
        *cellValueAttributeName         = *fieldValueAttributeName;
69
69
        *cellCurrency                   = *fieldCurrency;
 
70
        *getStyle                       = *textStyle;
 
71
        *setStyle                       = *textStyle;
70
72
        }
71
73
 
72
74
#-----------------------------------------------------------------------------
2477
2479
 
2478
2480
#-----------------------------------------------------------------------------
2479
2481
# increases the size of an existing table
 
2482
# improved by Barry Slaymaker [rt.cpan.org #41975]
2480
2483
 
2481
2484
sub     expandTable
2482
2485
        {
2496
2499
                }
2497
2500
        my $last_col    = $self->getTableColumn($table, -1);
2498
2501
        my $last_row    = $self->getRow($table, -1);
2499
 
        my $last_cell   = $self->getCell($last_row, -1);
2500
2502
        my $i           = 0;
2501
 
        for ($i = $old_width; $i < $width; $i++)
2502
 
                {
2503
 
                $last_col       = $last_col->replicateNode;
2504
 
                $last_cell      = $last_cell->replicateNode;
2505
 
                }
 
2503
        my $j           = 0;
 
2504
 
 
2505
        # expand column declarations
 
2506
        for ($i = $old_width ; $i < $width ; $i++)
 
2507
                {
 
2508
                $last_col = $last_col->replicateNode;
 
2509
                }
 
2510
 
 
2511
        # expand existing rows
 
2512
        for ($i = 0 ; $i < $old_length ; $i++)
 
2513
                {
 
2514
                my $row         = $self->getTableRow($table,  $i);
 
2515
                my $last_cell   = $self->getTableCell($row, -1);
 
2516
                for ($j = $old_width ; $j < $width ; $j++)
 
2517
                        {
 
2518
                        $last_cell = $last_cell->replicateNode;
 
2519
                        }
 
2520
                }
 
2521
 
 
2522
        # append new rows
2506
2523
        for ($i = $old_length; $i < $length; $i++)
2507
2524
                {
2508
2525
                $last_row = $last_row->replicateNode;
3127
3144
                        return undef;
3128
3145
                        }
3129
3146
                }
3130
 
        elsif (($table =~ /^\d*$/) || ($table =~ /^[\d+-]\d+$/))
3131
 
                {
3132
 
                $t = $self->getElement('//table:table', $table, $context);
3133
 
                }
3134
 
        else
3135
 
                {
3136
 
                my $n = $self->inputTextConversion($table);
3137
 
                $t = $self->getNodeByXPath
 
3147
        else    # retrieve table by number or name
 
3148
                {
 
3149
                if (($table =~ /^\d*$/) || ($table =~ /^[\d+-]\d+$/))
 
3150
                        {
 
3151
                        $t = $self->getElement
 
3152
                                ('//table:table', $table, $context);
 
3153
                        }
 
3154
                unless ($t)
 
3155
                        {
 
3156
                        my $n = $self->inputTextConversion($table);
 
3157
                        $t = $self->getNodeByXPath
3138
3158
                                (
3139
3159
                                "//table:table[\@table:name=\"$n\"]"
3140
3160
                                );
 
3161
                        }
3141
3162
                }
3142
3163
        return undef    unless $t;
3143
3164
        if      (
3958
3979
        }
3959
3980
 
3960
3981
#-----------------------------------------------------------------------------
3961
 
# deprecated methods, maintained for compatibility reasons only
3962
 
 
3963
 
sub     getStyle
3964
 
        {
3965
 
        my $self        = shift;
3966
 
        my $path        = shift;
3967
 
        my $pos         = (ref $path) ? undef : shift;
3968
 
        my $element     = $self->getElement($path, $pos) or return undef;
3969
 
        return  $self->textStyle($element);
3970
 
        }
3971
 
 
3972
 
sub     setStyle
3973
 
        {
3974
 
        my $self        = shift;
3975
 
        return  $self->textStyle(@_);
3976
 
        }
3977
 
 
3978
 
#-----------------------------------------------------------------------------
3979
3982
package OpenOffice::OODoc::Element;
3980
3983
#-----------------------------------------------------------------------------
3981
3984
# text element type detection (add-in for OpenOffice::OODoc::Element)