Bug 69988 - Number Copied and Pasted via Macro Changed to Text with Leading '
Summary: Number Copied and Pasted via Macro Changed to Text with Leading '
Status: RESOLVED NOTABUG
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Calc (show other bugs)
Version:
(earliest affected)
4.0.4.2 release
Hardware: All All
: medium normal
Assignee: Not Assigned
URL:
Whiteboard:
Keywords: regression
Depends on:
Blocks:
 
Reported: 2013-10-01 01:41 UTC by Joel Madero
Modified: 2014-05-17 05:26 UTC (History)
4 users (show)

See Also:
Crash report or crash signature:


Attachments
Spreadsheet with Macro (33.73 KB, application/vnd.oasis.opendocument.spreadsheet)
2013-10-01 01:41 UTC, Joel Madero
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Joel Madero 2013-10-01 01:41:53 UTC
Created attachment 86887 [details]
Spreadsheet with Macro

I have made a macro that I've used for some time to convert QIF files from finance programs to spreadsheet format so that I can use the power of Calcs graphs and what not to analyze my finances. Since release of 4.1 something has changed in which numbers copied are being turned into text with a leading apostrophe (') so balances and analysis is impossible unless I use the third party extension to convert text to number. 

I have included the macro, to reproduce:
Open attachment
Enable macros (tools -> options -> security -> macro settings -> medium or low)
Click on "Sheet 1" (sheet on attached spreadsheet)
Click "Create Ledger" button
Once it's done go to "Ledger" sheet

Expected: 
Column C should be currency but it's not, worked in 3.6 and 4.0. Does not work in 4.1 or 4.2


LibreOffice version 4.1.1.2 release
Bodhi Linux & Ubuntu 13.04

Last worked on: 4.0.3.3 release


Noel - not sure if this is yours or not. Cc'ed you to see if this is some expected change or if this is a regression, if it's a regression I'll get a bibisect together.
Comment 1 Markus Mohrhard 2013-10-03 16:23:53 UTC
It is a regression and more likely my fault.
Comment 2 Julien Nabet 2013-10-03 19:49:22 UTC
Except if I understood wrongly, we can put this one as NEW
Comment 3 Joel Madero 2013-10-03 21:44:47 UTC
Markus, you want a bibisect of this?
Comment 4 Markus Mohrhard 2013-10-04 07:01:30 UTC
Don't worry about a bibisect. I know when I broke stuff ;), the problem is more finding time to fix it.
Comment 5 Robinson Tryon (qubit) 2013-10-29 03:19:27 UTC
Use standardized whiteboard tag: bibisectrequested -> bibisectrequest
Comment 6 Joel Madero 2013-10-29 15:13:35 UTC
Per Markus' comment - removing bibisectrequest
Comment 7 Joel Madero 2014-02-05 02:03:44 UTC
Apparently existed on 4.0.4.2
Comment 8 Kohei Yoshida 2014-05-17 04:47:52 UTC
Changing Line 311 from

            pasteSheet.getCellByPosition(2,pasteRow).String = pasteValue
to

            pasteSheet.getCellByPosition(2,pasteRow).Formula = pasteValue

and values get set correctly.  I'd rather think that this behavior is correct.  When you set value to a cell via its String property, it forces the value to become text which in this case is achieved by prepending value with an apostrophe.

Is this good enough answer, Joel?
Comment 9 Joel Madero 2014-05-17 05:26:02 UTC
Yup makes sense. Closing as NOTABUG. Thanks Kohei