Skip Menu |

This queue is for tickets about the OpenOffice-OODoc CPAN distribution.

Report information
The Basics
Id: 17543
Status: resolved
Priority: 0/
Queue: OpenOffice-OODoc

People
Owner: jmgdoc [...] cpan.org
Requestors: no_mayl [...] hotmail.com
Cc:
AdminCc:

Bug Information
Severity: Important
Broken in:
  • 2.016
  • 2.017
  • 2.018
  • 2.019
  • 2.021
  • 2.022
Fixed in: 2.023



Subject: styleName() fails when calling getStyleElement() when $p1 is not ref.
Can't call method "getStyleElement" on an undefined value at .../5.8.7/OpenOffice/OODoc/Styles.pm line 634. That is because the $style is not initialized. Looking at the code a few lines above one can see the idea... <patch> =================================================================== RCS file: /import/tools/freeware/perl/5.8.7/x86_64/lib/site_perl/5.8.7/OpenOffice/OODoc/RCS/Styles.pm,v retrieving revision 1.1 diff -u -r1.1 /import/tools/freeware/perl/5.8.7/x86_64/lib/site_perl/5.8.7/OpenOffice/OODoc/Styles.pm --- /import/tools/freeware/perl/5.8.7/x86_64/lib/site_perl/5.8.7/OpenOffice/OODoc/Styles.pm 2006/02/07 22:12:07 1.1 +++ /import/tools/freeware/perl/5.8.7/x86_64/lib/site_perl/5.8.7/OpenOffice/OODoc/Styles.pm 2006/02/07 22:12:26 @@ -631,7 +631,7 @@ else { my %opt = @_; - $style->getStyleElement($p1, %opt) or return undef; + $style = $self->getStyleElement($p1, %opt) or return undef; $newname = $opt{'newname'}; } $self->setAttribute($style, 'style:name', $newname) if $newname; </patch> <call_stack> Can't call method "getStyleElement" on an undefined value at /import/tools/freeware/perl/5.8.7/x86_64/lib/site_perl/5.8.7/OpenOffice/OODoc/Styles.pm line 634. at /import/tools/freeware/perl/5.8.7/x86_64/lib/site_perl/5.8.7/OpenOffice/OODoc/Styles.pm line 634 OpenOffice::OODoc::Styles::styleName('OpenOffice::OODoc::Styles=HASH(0xa5b690)', 'P1') called at ./too.pl line 23 main::IsElementOfCorrectStyle('MyTestStyleName', 'OpenOffice::OODoc::Element=HASH(0x2c2a2f0)', 'Test Document') called at /import/tools/freeware/perl/5.8.7/x86_64/lib/site_perl/5.8.7/OpenOffice/OODoc/XPath.pm line 140 OpenOffice::OODoc::XPath::_find_text('OpenOffice::OODoc::Text=HASH(0x1e5aba0)', 'Test Document', '.+', 'CODE(0x1c0fb90)', 'MyTestStyleName', 'OpenOffice::OODoc::Element=HASH(0x2c2a2f0)') called at /import/tools/freeware/perl/5.8.7/x86_64/lib/site_perl/5.8.7/OpenOffice/OODoc/XPath.pm line 183 OpenOffice::OODoc::XPath::_search_content('OpenOffice::OODoc::Text=HASH(0x1e5aba0)', 'OpenOffice::OODoc::Element=HASH(0x2c2a2f0)', '.+', 'CODE(0x1c0fb90)', 'MyTestStyleName', 'OpenOffice::OODoc::Element=HASH(0x2c2a2f0)') called at /import/tools/freeware/perl/5.8.7/x86_64/lib/site_perl/5.8.7/OpenOffice/OODoc/Text.pm line 263 OpenOffice::OODoc::Text::selectElementsByContent('OpenOffice::OODoc::Text=HASH(0x1e5aba0)', '.+', 'CODE(0x1c0fb90)', 'MyTestStyleName') called at ./too.pl line 35 </call_stack> <sysinfo> $ uname -a Linux blabla 2.4.21-37.ELsmp #1 SMP Wed Sep 7 13:32:18 EDT 2005 x86_64 x86_64 x86_64 GNU/Linux $ perl -v This is perl, v5.8.7 built for x86_64-linux-thread-multi </sysinfo> -- jpa
OK, the bug is now fixed in 2.023 (to be released in the next week) Those who need an immediate fix can 1) either edit Styles.pm and change the line 634 as shown below: - $style->getStyleElement($p1, %opt) or return undef; + $style = $self->getStyleElement($p1, %opt) or return undef; 2) or download/install the development version, available at http://jean.marie.gouarne.online.fr/tech/oodoc/OpenOffice-OODoc-2.023-testing.tar.gz
The bug is fixed in release 2.023, uploaded today.