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