MIME-Version: | 1.0 |
X-Spam-Status: | No, score=-1.334 tagged_above=-99.9 required=10 tests=[BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, FREEMAIL_FROM=0.001, SPF_SOFTFAIL=0.665] autolearn=no |
X-Cpan.org: | This message routed through the cpan.org mail forwarding service. Please use PAUSE pause.perl.org to configure your delivery settings. |
X-Spam-Flag: | NO |
Content-Language: | en-US |
content-type: | text/plain; charset="utf-8"; format="flowed" |
Message-ID: | <bbcc70be-58ce-6243-3c27-c36da5a87aa2@gmail.com> |
X-Received: | by 2002:a63:d904:: with SMTP id r4mr11585177pgg.323.1587767877481; Fri, 24 Apr 2020 15:37:57 -0700 (PDT) |
X-Virus-Scanned: | Debian amavisd-new at bestpractical.com |
X-Spam-Score: | -1.334 |
Received: | from localhost (localhost [127.0.0.1]) by hipster.bestpractical.com (Postfix) with ESMTP id 6425524033C for <cpan-bug+Spreadsheet-XLSX@hipster.bestpractical.com>; Fri, 24 Apr 2020 18:38:05 -0400 (EDT) |
Received: | from hipster.bestpractical.com ([127.0.0.1]) by localhost (hipster.bestpractical.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id A+WarvzgsxiR for <cpan-bug+Spreadsheet-XLSX@hipster.bestpractical.com>; Fri, 24 Apr 2020 18:38:04 -0400 (EDT) |
Received: | from xx1.develooper.com (xx1.develooper.com [147.75.38.233]) by hipster.bestpractical.com (Postfix) with ESMTPS id 0EE10240108 for <bug-Spreadsheet-XLSX@rt.cpan.org>; Fri, 24 Apr 2020 18:38:03 -0400 (EDT) |
Received: | from localhost (xx1.develooper.com [127.0.0.1]) by localhost (Postfix) with ESMTP id 66FD47C0F3 for <bug-Spreadsheet-XLSX@rt.cpan.org>; Fri, 24 Apr 2020 15:38:03 -0700 (PDT) |
Received: | from xx1.develooper.com (xx1.develooper.com [127.0.0.1]) by localhost (Postfix) with SMTP id BC6097CF41 for <bug-Spreadsheet-XLSX@rt.cpan.org>; Fri, 24 Apr 2020 15:37:59 -0700 (PDT) |
Received: | from mail-pf1-f179.google.com (mail-pf1-f179.google.com [209.85.210.179]) (using TLSv1 with cipher AES128-SHA (128/128 bits)) (No client certificate requested) by xx1.develooper.com (Postfix) with ESMTPS id 2ACDC7C0F3 for <bug-Spreadsheet-XLSX@rt.cpan.org>; Fri, 24 Apr 2020 15:37:58 -0700 (PDT) |
Received: | by mail-pf1-f179.google.com with SMTP id y25so5508647pfn.5 for <bug-Spreadsheet-XLSX@rt.cpan.org>; Fri, 24 Apr 2020 15:37:58 -0700 (PDT) |
Received: | from marcus-doemlings-imac.local (c-69-181-215-146.hsd1.ca.comcast.net. [69.181.215.146]) by smtp.googlemail.com with ESMTPSA id h5sm5523062pjv.4.2020.04.24.15.37.56 for <bug-Spreadsheet-XLSX@rt.cpan.org> (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Fri, 24 Apr 2020 15:37:56 -0700 (PDT) |
Authentication-Results: | hipster.bestpractical.com (amavisd-new); dkim=pass header.i=@gmail.com |
X-Google-SMTP-Source: | APiQypIkxTkhFe5/O2StEhhnC/rRYKdkSTAtG/MhtZU+W6Rcno9KMinxkUzVfNXtfpJNmlXHuKXbFA== |
Delivered-To: | cpan-bug+Spreadsheet-XLSX@hipster.bestpractical.com |
User-Agent: | Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:68.0) Gecko/20100101 Thunderbird/68.7.0 |
Subject: | Fix for formatCode being lost |
Return-Path: | <mdoemling@gmail.com> |
X-RT-Mail-Extension: | spreadsheet-xlsx |
X-Original-To: | cpan-bug+Spreadsheet-XLSX@hipster.bestpractical.com |
Dkim-Signature: | v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=to:from:subject:message-id:date:user-agent:mime-version :content-transfer-encoding:content-language; bh=zmu6DjkRYLPz7Sqq8QsLguR0uAHsDnIoBmnOnmEGxLo=; b=lxxz9gPcxOGcuH/yV951HPenRuJaWp8Dx3fweLnUTNREDpkpS5iZCP+/pQ4L81BG6V OP4HU1A7O5sLUo7st19Z4BqGTJEuGQkjWBlCKKjV4GTYrsyGK+FoxlMatxlTDwPlFJGd 157qStUSs5wuJwPPjJi9aLTH75IDhQGL+4Ku6cpm6M8kWVCxXHRyY9A5VkfrHgTtw1U8 XzPmlMKZ0M+wjcSON++fUv0IKPNQ6Y+gLNFHG770ht52WA+CC6csB85zf1mXNGfXzrBw ro37fAqQe8yY+pXCuhyd9/VVdh5WZqJAnBAkp4HDlJN/uwSZ6ZGPYH/ms+AefOxsYHii RQ+w== |
X-Google-Dkim-Signature: | v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:to:from:subject:message-id:date:user-agent :mime-version:content-transfer-encoding:content-language; bh=zmu6DjkRYLPz7Sqq8QsLguR0uAHsDnIoBmnOnmEGxLo=; b=KxeaxzkMoj+qeRpjD/z7YtBYfevObPlwuxtzp5K3YnF8YguQa+cC+rK4XsjTgKSRcQ 6Dz9Cx7fONMuAfaso9siKW0QRXC+4MWArUv/QnvY3PnhDpWD4Cdw5eiTyS5dY2j6Zysr yivdyZDKWw2UA1cPTRNDaJ0IfeRn9FMZaYe9nWwdKFziHxKcaxvcYJM0uvG9Sx+vfTz7 yBooL4CQlPOZyEnqVFngprnGst5YFih1iKKPJnGvp5lKzkDQSONzm+RVGtEROhCI4i0y wAk93rl5yxqEG6uxSMpIuLMBcXZZ2I8tgPnsbQ+ZRpYQYiMy1GQmJsxcW+uVBDvExfUp 4TTg== |
X-PMX-Spam: | Gauge=IIIIIIII, Probability=8%, Report=' HTML_00_01 0.05, HTML_00_10 0.05, BODYTEXTP_SIZE_3000_LESS 0, BODY_SIZE_1800_1899 0, BODY_SIZE_2000_LESS 0, BODY_SIZE_5000_LESS 0, BODY_SIZE_7000_LESS 0, DATE_TZ_NA 0, DKIM_ALIGNS 0, DKIM_SIGNATURE 0, KNOWN_MTA_TFX 0, NO_CTA_FOUND 0, NO_URI_HTTPS 0, SPF_PASS 0, SXL_IP_TFX_WM 0, WEBMAIL_SOURCE 0, __ANY_URI 0, __BODY_NO_MAILTO 0, __CT 0, __CTE 0, __CT_TEXT_PLAIN 0, __DKIM_ALIGNS_1 0, __DKIM_ALIGNS_2 0, __DQ_NEG_HEUR 0, __DQ_NEG_IP 0, __FRAUD_MONEY_CURRENCY 0, __FRAUD_MONEY_CURRENCY_DOLLAR 0, __FRAUD_WEBMAIL 0, __FRAUD_WEBMAIL_FROM 0, __FROM_GMAIL 0, __FUR_RDNS_GMAIL 0, __HAS_FROM 0, __HAS_MSGID 0, __HELO_GMAIL 0, __HIGHBITS 0, __INVOICE_MULTILINGUAL 0, __MIME_TEXT_ONLY 0, __MIME_TEXT_P 0, __MIME_TEXT_P1 0, __MIME_VERSION 0, __MOZILLA_USER_AGENT 0, __NO_HTML_TAG_RAW 0, __OEM_PRICE 0, __PHISH_SPEAR_STRUCTURE_1 0, __RDNS_WEBMAIL 0, __SANE_MSGID 0, __STOCK_PHRASE_7 0, __SUBJ_ALPHA_END 0, __TO_MALFORMED_2 0, __TO_NO_NAME 0, __URI_NO_MAILTO 0, __URI_NO_WWW 0, __USER_AGENT 0, __X_GOOGLE_DKIM_SIGNATURE 0, __YOUTUBE_RCVD 0, __blackholes.mail-abuse.org_ERROR , __zen.spamhaus.org_ERROR ' |
X-PMX-Perl: | Suspicious Attachment |
Date: | Fri, 24 Apr 2020 15:37:55 -0700 |
X-Spam-Level: | |
X-PMX-Version: | 5.6.1.2065439, Antispam-Engine: 2.7.2.376379, Antispam-Data: 2019.11.28.70017 |
To: | bug-Spreadsheet-XLSX@rt.cpan.org |
Content-Transfer-Encoding: | 8bit |
From: | Marcus Doemling <mdoemling@gmail.com> |
X-GM-Message-State: | AGi0PubnQq15wUwJ2ZDek3Lkex2Kcg1GZ2inzs/7fGyO+ADltWu/bKtr scA13mGctuapWMCSKgMByPs2wCkr |
X-RT-Original-Encoding: | utf-8 |
X-RT-Interface: | |
Content-Length: | 1832 |
I ran into an issue where the formatCode was overwritten with an empty
value in XLSX.pm.
The fix was in __load_styles to add an existence check into the loop
over @styles:
--- XLSX.pm.orig 2020-04-24 21:07:50.027756593 +0000
+++ XLSX.pm 2020-04-24 22:31:25.438635988 +0000
@@ -225,6 +225,7 @@ sub __load_styles {
my $default = $1 || '';
foreach my $t1 (@styles) {
+ if (!exists($style_info{$t1})) {
$member_styles->contents =~ /numFmtId="$t1"
formatCode="([^"]*)/;
my $formatCode = $1 || '';
if ($formatCode eq $default || not($formatCode)) {
@@ -240,6 +241,7 @@ sub __load_styles {
$style_info{$t1} = $formatCode;
$default = $1 || '';
}
+ }
}
return (\@styles, \%style_info);
The issue occurred with an .xlsx file with the following definitions:
<numFmts count="1">
<numFmt numFmtId="164" formatCode="00000" />
</numFmts>
<cellXfs count="14">
<xf numFmtId="0" fontId="0" fillId="0" borderId="0" xfId="0" />
<xf numFmtId="164" fontId="16" fillId="0" borderId="0" xfId="0"
applyNumberFormat="1" applyFont="1" />
<xf numFmtId="164" fontId="0" fillId="0" borderId="0" xfId="0"
applyNumberFormat="1" />
<xf numFmtId="164" fontId="0" fillId="0" borderId="0" xfId="0"
applyNumberFormat="1" applyAlignment="1">
...
</cellXfs>
Ultimately the $formatCode was being overwritten due to $default being
set. I was unsure what the purpose of $default was so my fix was to use
the existence check.
Hopefully you can apply this fix.
Best,
Marcus