Bug 120158 - Impossible to paste special in Writer from Calc in Libreoffice 6.1.x in some UI languages - the dialogue caption says "unknown source"
Summary: Impossible to paste special in Writer from Calc in Libreoffice 6.1.x in some ...
Status: RESOLVED FIXED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Localization (show other bugs)
Version:
(earliest affected)
6.1.1.2 release
Hardware: All All
: medium normal
Assignee: Julien Nabet
URL:
Whiteboard: target:6.2.0 target:6.1.3
Keywords: regression
: 120159 (view as bug list)
Depends on:
Blocks:
 
Reported: 2018-09-27 15:00 UTC by solino
Modified: 2018-10-19 09:35 UTC (History)
5 users (show)

See Also:
Crash report or crash signature:


Attachments
Image without the bug when you choose english language in settings for interface (230.22 KB, image/png)
2018-09-28 15:37 UTC, solino
Details
In dialog paste speciaal with spanish language appears like unknown source (186.71 KB, image/png)
2018-09-28 21:05 UTC, solino
Details
bt with debug symbols from the exception throw (10.66 KB, text/plain)
2018-10-09 05:16 UTC, Julien Nabet
Details

Note You need to log in before you can comment on or make changes to this bug.
Description solino 2018-09-27 15:00:17 UTC
Description:
This happens in Debian Stretch with Gnome 3.22 when I upgrade Libreoffice from 6.0.6 to 6.1.1. It's the same with Debian buster in Gnome 3.30 or Xfce 4.12

Actual Results:
Upgrade Libreoffice from 6.0.6 to 6.1.1

Expected Results:
Paste an object bfrom Calc


Reproducible: Always


User Profile Reset: No



Additional Info:
Comment 1 Oliver Brinzing 2018-09-27 16:34:40 UTC
*** Bug 120159 has been marked as a duplicate of this bug. ***
Comment 2 Roman Kuznetsov 2018-09-28 08:31:22 UTC
please write more clear steps for repro your problem
Comment 3 solino 2018-09-28 15:35:21 UTC
I've found that this behaviour only happens when I put the language of user interface in spanish, when I put it in English the dialog "paste special" works well
Comment 4 solino 2018-09-28 15:37:24 UTC
Created attachment 145251 [details]
Image without the bug when you choose english language in settings for interface
Comment 5 solino 2018-09-28 21:05:52 UTC
Created attachment 145257 [details]
In dialog paste speciaal with spanish language appears like unknown source
Comment 6 Xisco Faulí 2018-10-08 15:39:39 UTC
Reproduced in

Versión: 6.1.2.1
Id. de compilación: 65905a128db06ba48db947242809d14d3f9a93fe
Subprocs. CPU: 1; SO: Windows 6.1; Repres. IU: predet.; 
Configuración regional: es-ES (es_ES); Calc: group threaded
Comment 7 Julien Nabet 2018-10-08 20:38:53 UTC
On pc Debian x86-64 with master sources updated today, I could reproduce this with Spanish and keyId UI, not with French, Italian and English US UI.
Comment 8 Julien Nabet 2018-10-08 20:40:50 UTC
"Unknown origin" comes from cui/source/dialogs/pastedlg.cxx#168
So start point for the investigation.
Comment 9 Julien Nabet 2018-10-08 22:34:08 UTC
We got in catch of https://opengrok.libreoffice.org/xref/core/svtools/source/misc/transfer.cxx#1205

The pb happens when typename contains other things than ascii.
Spanish (KO):
rFlavor.MimeType=application/x-openoffice-objectdescriptor-xml;windows_formatname="Star Object Descriptor (XML)";classname="47BBB4CB-CE4C-4E80-a591-42d9ae74950f";typename="Hoja de cálculo de LibreOfficeDev 6.2";viewaspect="1";width="2258";height="453";posx="0";posy="0"

Italian (OK):
rFlavor.MimeType=application/x-openoffice-objectdescriptor-xml;windows_formatname="Star Object Descriptor (XML)";classname="47BBB4CB-CE4C-4E80-a591-42d9ae74950f";typename="LibreOfficeDev 6.2 - Foglio elettronico";viewaspect="1";width="2259";height="452";posx="0";posy="0"

French (OK):
rFlavor.MimeType=application/x-openoffice-objectdescriptor-xml;windows_formatname="Star Object Descriptor (XML)";classname="47BBB4CB-CE4C-4E80-a591-42d9ae74950f";typename="Classeur LibreOfficeDev 6.2";viewaspect="1";width="2258";height="452";posx="0";posy="0"

Some debug shows pb into 
CMimeContentType::subtype() from dtrans/source/cnttype/mcnttype.cxx
Comment 10 Julien Nabet 2018-10-08 23:02:14 UTC
the pb isn't subtype() but quotedPValue.
It throws here:
https://opengrok.libreoffice.org/xref/core/dtrans/source/cnttype/mcnttype.cxx#298
283      while ( !m_nxtSym.isEmpty( ) )
284      {
285          if ( bAfterQuoteSign && (
286              (m_nxtSym == SPACE) ||
287              (m_nxtSym == SEMICOLON))
288             )
289          {
290              break;
291          }
292          else if ( isInRange( m_nxtSym, OUStringLiteral(TOKEN) + TSPECIALS + SPACE ) )
293          {
294              pvalue.append(m_nxtSym);
295              bAfterQuoteSign = m_nxtSym == "\"";
296          }
297          else
298              throw IllegalArgumentException( );  <---- HERE
299          getSym( );
300      }
Comment 11 Julien Nabet 2018-10-09 05:16:30 UTC
Created attachment 145502 [details]
bt with debug symbols from the exception throw
Comment 12 Julien Nabet 2018-10-09 20:25:55 UTC
I submitted this patch to review:
https://gerrit.libreoffice.org/#/c/61601/

Let's wait feedback on it.
Comment 13 Commit Notification 2018-10-10 20:57:50 UTC
Julien Nabet committed a patch related to this issue.
It has been pushed to "master":

http://cgit.freedesktop.org/libreoffice/core/commit/?id=40e22f1e1bd44a1aa56ff77b82f1306ed1076ebf

tdf#120158: fix ImplGetParameterString for typename

It will be available in 6.2.0.

The patch should be included in the daily builds available at
http://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
http://wiki.documentfoundation.org/Testing_Daily_Builds

Affected users are encouraged to test the fix and report feedback.
Comment 14 Commit Notification 2018-10-11 07:18:09 UTC
Julien Nabet committed a patch related to this issue.
It has been pushed to "libreoffice-6-1":

http://cgit.freedesktop.org/libreoffice/core/commit/?id=c52b50a43908b22dde25cfca674001f670948c07&h=libreoffice-6-1

tdf#120158: fix ImplGetParameterString for typename

It will be available in 6.1.4.

The patch should be included in the daily builds available at
http://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
http://wiki.documentfoundation.org/Testing_Daily_Builds

Affected users are encouraged to test the fix and report feedback.
Comment 15 Julien Nabet 2018-10-11 07:28:00 UTC
Backport for 6.1.3 branch on review:
https://gerrit.libreoffice.org/#/c/61644/
Hope it'll be ok because 6.1.3 needs extra reviews comparing with master or 6.1 branch.
Comment 16 Stephan Bergmann 2018-10-11 13:52:20 UTC
Julien, do you know what actually caused a regression here?
Comment 17 Julien Nabet 2018-10-11 14:19:39 UTC
(In reply to Stephan Bergmann from comment #16)
> Julien, do you know what actually caused a regression here?
I searched about it but didn't find.

Do you think a bibisectrequest could be relevant?
Comment 18 Stephan Bergmann 2018-10-11 14:48:51 UTC
(In reply to Julien Nabet from comment #17)
> I searched about it but didn't find.

But you can confirm that this is indeed a regression and worked in LO 6.0?  Interesting.  (One assumption of mine was that the relevant content type's Spanish typename parameter value was different in 6.0 and happened not to contain non-ASCII characters, but greping for "Hoja de cálculo de" in translations/source/es/ of libreoffice-6-0 and master appears to turn up identical results.)
Comment 19 Julien Nabet 2018-10-11 15:07:36 UTC
(In reply to Stephan Bergmann from comment #18)
> (In reply to Julien Nabet from comment #17)
> > I searched about it but didn't find.
> 
> But you can confirm that this is indeed a regression and worked in LO 6.0? 
> Interesting.  (One assumption of mine was that the relevant content type's
> Spanish typename parameter value was different in 6.0 and happened not to
> contain non-ASCII characters, but greping for "Hoja de cálculo de" in
> translations/source/es/ of libreoffice-6-0 and master appears to turn up
> identical results.)

I didn't confirm the regression since I don't use 6.0.X version.
I can only tell that I reproduced this with recent master sources.
Comment 20 Stephan Bergmann 2018-10-11 15:13:51 UTC
Cor, what prompted you to set "regression" keyword?  (In case it isn't a verified regression from 6.0, why bother backporting a fix to 6.1.x?)
Comment 21 Cor Nouws 2018-10-11 15:18:06 UTC
(In reply to Stephan Bergmann from comment #20)
> Cor, what prompted you to set "regression" keyword?  (In case it isn't a
> verified regression from 6.0, why bother backporting a fix to 6.1.x?)

Hi Stephan,

The original description:

(In reply to solino from comment #0)
> Description:
> This happens in Debian Stretch with Gnome 3.22 when I upgrade Libreoffice
> from 6.0.6 to 6.1.1. It's the same with Debian buster in Gnome 3.30 or Xfce
> 4.12

+ which sounds plausible to me, because the problem would have been reported much earlier if it was there for a long time already.

But I didn't test.
Comment 22 Stephan Bergmann 2018-10-11 16:01:33 UTC
(In reply to Cor Nouws from comment #21)
> But I didn't test.

Testing with a recent local libreoffice-6-0 build now, the type was announced as "calc8" instead of "Hoja de cálculo de LibreOffice 6.2" in the paste special dialog.  So the corresponding media type presumably also contained just the ASCII-only "calc8" instead of the problematic Unicode typename parameter value, so happened to not run into the issue with the CMimeContentType implementation.
Comment 23 Stephan Bergmann 2018-10-11 18:35:06 UTC
(In reply to Stephan Bergmann from comment #22)
> Testing with a recent local libreoffice-6-0 build now, the type was
> announced as "calc8" instead of "Hoja de cálculo de LibreOffice 6.2" in the
> paste special dialog.

...which is caused by <https://gerrit.libreoffice.org/gitweb?p=core.git;a=blobdiff;f=sc/source/ui/docshell/docsh.cxx;h=fc84c7250148cb807c3f7ba4982cb9c19c4bf707;hp=e59ee43400e8c7fb85e6474941d5d8c81a533574;hb=a2f7eb5f8ea7f3ae50aea72de8b15c3364493285;hpb=b5ede834dece9e5ece3e525f610912984c60661b> "tdf#89453 - Improve the wording of 'Paste Special' options", present since libreoffice-6-0
Comment 24 Commit Notification 2018-10-11 18:40:13 UTC
Stephan Bergmann committed a patch related to this issue.
It has been pushed to "master":

http://cgit.freedesktop.org/libreoffice/core/commit/?id=b75e3ded1f73c943fb09f117e476e367ac0c3413

tdf#120158: Base CMimeContentType on INetMIME::scanContentType

It will be available in 6.2.0.

The patch should be included in the daily builds available at
http://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
http://wiki.documentfoundation.org/Testing_Daily_Builds

Affected users are encouraged to test the fix and report feedback.
Comment 25 Commit Notification 2018-10-11 18:40:21 UTC
Stephan Bergmann committed a patch related to this issue.
It has been pushed to "master":

http://cgit.freedesktop.org/libreoffice/core/commit/?id=3bc8e2f3ab69adb9196508688e5211dc171add95

Revert "tdf#120158: fix ImplGetParameterString for typename"

It will be available in 6.2.0.

The patch should be included in the daily builds available at
http://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
http://wiki.documentfoundation.org/Testing_Daily_Builds

Affected users are encouraged to test the fix and report feedback.
Comment 26 Cor Nouws 2018-10-12 11:36:30 UTC
(In reply to Commit Notification from comment #24)

> http://cgit.freedesktop.org/libreoffice/core/commit/
> ?id=b75e3ded1f73c943fb09f117e476e367ac0c3413
> 
> tdf#120158: Base CMimeContentType on INetMIME::scanContentType
> 
> It will be available in 6.2.0.

Thanks for diving into this, Stephan!
Comment 27 Commit Notification 2018-10-12 11:57:39 UTC
Stephan Bergmann committed a patch related to this issue.
It has been pushed to "libreoffice-6-1":

http://cgit.freedesktop.org/libreoffice/core/commit/?id=b4227a20a90a5649966a765397f70589c4919c07&h=libreoffice-6-1

Revert "tdf#120158: fix ImplGetParameterString for typename"

It will be available in 6.1.4.

The patch should be included in the daily builds available at
http://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
http://wiki.documentfoundation.org/Testing_Daily_Builds

Affected users are encouraged to test the fix and report feedback.
Comment 28 Commit Notification 2018-10-13 03:10:54 UTC
Stephan Bergmann committed a patch related to this issue.
It has been pushed to "libreoffice-6-1":

http://cgit.freedesktop.org/libreoffice/core/commit/?id=7ea7b86e7731f8cc1366ea632653fecc97267378&h=libreoffice-6-1

tdf#120158: Base CMimeContentType on INetMIME::scanContentType

It will be available in 6.1.4.

The patch should be included in the daily builds available at
http://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
http://wiki.documentfoundation.org/Testing_Daily_Builds

Affected users are encouraged to test the fix and report feedback.
Comment 29 Stephan Bergmann 2018-10-15 09:06:55 UTC
backport request to -6-1-3 still open at <https://gerrit.libreoffice.org/#/c/61702/> (reversion of prev fix not necessary there, as it hadnt hit that branch yet)
Comment 30 Commit Notification 2018-10-19 08:36:58 UTC
Stephan Bergmann committed a patch related to this issue.
It has been pushed to "libreoffice-6-1-3":

http://cgit.freedesktop.org/libreoffice/core/commit/?id=90173417577338ba837cd1ed51276b3e3c8a50df&h=libreoffice-6-1-3

tdf#120158: Base CMimeContentType on INetMIME::scanContentType

It will be available in 6.1.3.

The patch should be included in the daily builds available at
http://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
http://wiki.documentfoundation.org/Testing_Daily_Builds

Affected users are encouraged to test the fix and report feedback.
Comment 31 Julien Nabet 2018-10-19 09:35:43 UTC
Simplify targets