Apache OpenOffice (AOO) Bugzilla – Issue 103918
file path(japanese) in the function is url encoded(binary hex).
Last modified: 2013-08-07 15:15:15 UTC
Upper filepath is replaced as under filepath. ='file:///d:/リンクテストフォルダ/リンクテストシート.ods'#$Sheet1.a1 ='file:///d:/%E3%83%AA%E3%83%B3%E3%82%AF%E3%83%86%E3%82%B9%E3%83%88%E3%83%95%E3%82%A9%E3%83%AB%E3%83%80/%E3%83%AA%E3%83%B3%E3%82%AF%E3%83%86%E3%82%B9%E3%83%88%E3%82%B7%E3%83%BC%E3%83%88.ods'#$Sheet1.A1 It is too long and it makes so many error cell Sometime.
Created attachment 63874 [details] filepath_sample(japanese directry)
I can confirm that the URL is represented in the encoded form, but I cannot see a problem with it. Yes, it is longer, but that by itself doesn't make any calculations fail. Do you have an example where there's a problem because of this? Using the decoded URL for display would be an RFE, not a defect. (note: the files are not utf-8 encoded in the zip)
In OOo3.0.0-OOo3.0.1, the URLencode problem doesn't happen. The problem is only OOo3.1 have. *Upper formula become lower formula.(after reopen.) The last part of file path is deleted. =VLOOKUP("リンクテスト文字列";'D:\リンクテストフォルダ\長い事業名のフォルダ:あ ああああああああああああああああああああああああ\コピー ~ 長い事業名のフォル ダ:あああああああああああああああああああああああああ\コピー ~ コピー ~ 長い 事業名のフォルダ:あああああああああああああああああああああああああ\コピー ~ コピー ~ コピー ~ 長い事業名のフォルダ:あああああああああああああああああああ ああああああ\リンクテストシート.ods'#$Sheet1.A1:A1;1) =VLOOKUP("リンクテスト文字列";'file:///D:/%E3%83%AA%E3%83%B3%E3%82%AF%E3%83%86 %E3%82%B9%E3%83%88%E3%83%95%E3%82%A9%E3%83%AB%E3%83%80/%E9%95%B7%E3%81%84%E4%BA%8B%E6%A5%AD%E5%90%8D%E3%81%AE%E3%83%95%E3%82%A9%E3%83%AB%E3%83%80%EF%BC%9A%E3%81%82%E3%81%82%E3%81%82%E3%81%82%E3%81%82%E3%81%8;1) and...It is difficult for me to make zip of UTF8.
Yup, I can confirm this. External ref URI's are not decoded when displayed.
Created attachment 63978 [details] patch to fix this
This patch probably fixes it. All file URIs are internally stored hex-encoded, and we just forgot to decode them when displaying them.
patch doesn't need needmoreinfo, removing keyword (thanks for the patch)
Is it the same as http://qa.openoffice.org/issues/show_bug.cgi?id=102868 ?
*** Issue 102868 has been marked as a duplicate of this issue. ***
as mentioned by kpalagin: regression (was already fixed in the past with issue 75893) - adding dr (author of fix of the old issue), fst from the other issue to cc
set target
What about patch for Windows?
Created attachment 64039 [details] revised patch
The revised patch is safer in that the decoding of URI's is only done when displaying formulas while in the .ods files all instances of external ref URI's remain encoded. This is the current behavior as of 3.1, so there is a lesser chance of introducing a regression with this change.
Created attachment 64058 [details] revised patch
further revised the patch, to leave the document URL hex-encoded while the sheet names are left raw-unicode. This is the behavior of DEV300_m37; the milestone before the external ref re-work was integrated. I've also tested range names' ODF export. Range names use ODF's bracket notation, and the external doc URIs are always encoded. I made sure that my patch didn't change that behavior. This patch also fixes one regression I just happened to discover during my investigation, where updating the external document upon file load failed to update the chart objects that reference it. This was unintentionally introduced by the fix for issue 103317.
>further revised the patch, to leave the document URL hex-encoded while the sheet names are left raw-unicode. This is the behavior of DEV300_m37; the milestone before the external ref re-work was integrated. I forgot to say that this is for chart objects.
Grabbing issue.
Created attachment 64067 [details] another revised patch, to fix incorrect encoding for Excel A1 and R1C1 syntax
@er: my last patch didn't decode URIs when the formula syntax is set to Excel A1 or R1C1. Other than that, this patch is identical to the last one.
perhaps issue 103918 is of interest.
>perhaps issue 103918 is of interest. I meant, issue 104166. A circular reference here. ;-)
changed target milestone
@kohei: The last patch clashes with the changes of the previous patch in both sections. It would decode the name unconditionally and ignore the bEncodeUrl argument for both, ConventionXL::makeExternalDocStr() and ConventionOOO_A1::makeExternalSingleRefStr(). What was the intention?
@er: looks like I've attached the wrong version of the patch. Let me attach the correct patch.
Created attachment 64093 [details] this is the patch I meant to attach
@er: yeah, sorry about the hiccup. ;-) Please ignore the patch I attached in desc20. The patch I just attached should be identical to the one in desc16, except for the four hunks within ConventionXL_A1 and ConventionXL_R1C1.
removed me from CC
Yep, better ;-) In cws calcextref311: revision 274897 sc/inc/compiler.hxx sc/inc/externalrefmgr.hxx sc/source/core/data/cell2.cxx sc/source/core/tool/compiler.cxx sc/source/core/tool/rangeutl.cxx sc/source/core/tool/reftokenhelper.cxx sc/source/core/tool/token.cxx sc/source/ui/docshell/externalrefmgr.cxx Changed a use of MAXSTRLEN in sc/source/core/data/cell2.cxx ScEditCell::GetString() to the value 256 it previously had, used in caching raw strings of rich text for formulas.
Actually the change is in revision 274901, r274897 was a bad commit to tags/OOO310_m18 ...
Created attachment 64101 [details] testcase, referring doc
Created attachment 64102 [details] testcase, referred doc
The attached filepath_sample.zip may not work, depending on the encoding the target system uses. Attached referring.ods and "referred with spaces.ods" as another testcase. Open referring.ods, with OOO310_m18 the references in B3:B6 contain referred%20with%20spaces.ods, updating the link refreshes the data, but not the chart. Double clicking the chart makes it lose its data range. These issues are fixed with the change, the name is displayed as "referred with spaces.ods"
Reassigning to QA for verification.
verified in internal build cws_calcextref311
Merged to cws dr69 as dr68ooo311 was not cloned (issue 104156) revision 275847 sc/inc/compiler.hxx sc/inc/externalrefmgr.hxx sc/source/core/data/cell2.cxx sc/source/core/tool/compiler.cxx sc/source/core/tool/rangeutl.cxx sc/source/core/tool/reftokenhelper.cxx sc/source/core/tool/token.cxx sc/source/ui/docshell/externalrefmgr.cxx
also verified in internal build cws_dr69
This issue is closed automatically. It is in state 'verified/fixed' since 2 releases (OOo 3.1.1 and OOo 3.2). The policy [1] indicates that such older issues should be closed. If this issue still occur in a current build (OOo 3.2.1 or >DEV300m80) please reopen the issue and set the target accordingly. [1] : http://wiki.services.openoffice.org/wiki/Handle_fixed_verified_issues