Bug 40462 - [Pyuno] returns *some* encoded unicode data for spreadsheet cells with non-numeric data
Summary: [Pyuno] returns *some* encoded unicode data for spreadsheet cells with non-nu...
Status: RESOLVED INVALID
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: LibreOffice (show other bugs)
Version:
(earliest affected)
3.4.2 release
Hardware: Other Linux (All)
: medium major
Assignee: Not Assigned
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-08-29 11:10 UTC by Kishan
Modified: 2012-08-31 10:06 UTC (History)
1 user (show)

See Also:
Crash report or crash signature:


Attachments
libpyuno.so (179.09 KB, application/x-sharedlib)
2011-08-31 21:41 UTC, Kishan
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Kishan 2011-08-29 11:10:32 UTC
OS: Ubuntu 11.04 release 32-bit (libreoffice 3.3.2 removed fully and then LO 3.4.2 installed)
OS2: Lubuntu 11.04 (no LO, so clean install of LO 3.4.2)

1. Create/Use a xls spreadsheet file - one cell with number and other with text.

2. Start LO this way:
libreoffice3.4 --nodefault --minimized --nologo --norestore "--accept=socket,host=localhost,port=2002;urp;" &

3. Export reqd variables:
export URE_BOOTSTRAP="file:///opt/libreoffice3.4/program/fundamentalrc"
export PYTHONPATH=/opt/libreoffice3.4/basis3.4/program

4. Run this script:
import uno
ctx = uno.getComponentContext()
res = ctx.ServiceManager.createInstanceWithContext("com.sun.star.bridge.UnoUrlResolver", ctx )

cxt = res.resolve( "uno:socket,host=localhost,port=2002;urp;StarOffice.ComponentContext" )
desktop = cxt.ServiceManager.createInstance( "com.sun.star.frame.Desktop" )

def makePropertyValue(cName, uValue, nHandle, nState):
    core = cxt.ServiceManager.createInstance( "com.sun.star.reflection.CoreReflection" )
    oXIdlClass = core.forName( "com.sun.star.beans.PropertyValue" )
    oReturnValue, oStruct = oXIdlClass.createObject( None )
    oStruct.Name = cName
    oStruct.Value = uValue
    oStruct.Handle = nHandle
    oStruct.State = nState
    return oStruct

props = tuple([makePropertyValue( 'ReadOnly' , True , 0 , 0), makePropertyValue( 'Hidden' , False , 0 , 0)])
doc = desktop.loadComponentFromURL( "file:///home/ubuntu/4_April_Accounts.xls", "_blank", 0, props )

# Print sheet name
print oSheet.getName()

# Print cell at position 0,0
oSheet = doc.getSheets().getByIndex(0)
oCell = oSheet.getCellByPosition( 0, 0 )
print oCell.getValue(), oCell.getFormula()

5. It looks like the data is utf-32-le, but even then there are some extra characters at end.

Even if there was a way to get string out of every cell's value, functions like oSheet.getCellRangeByPosition( 0, 3, 0,  3 ).getDataArray() that return matrix of arrays make it difficult to apply the utf conversion.

NOTE: The same script print human readable unicdoe utf-8 encoded text in LibreOffice 3.3.2 bundled with Ubuntu 11.04. Probably that contains OOo forked code as-is.
Comment 1 Kishan 2011-08-31 21:41:20 UTC
Created attachment 50791 [details]
libpyuno.so

This bug is not seen when I replace /opt/libreoffice3.4/basis3.4/program/libpyuno.so with the libpyuno.so that comes with LibreOffice 3.3.2 package from Ubuntu 11.04 repository.

Attaching that libpyuno.so which resolves this bug for me.
Comment 2 Björn Michaelsen 2011-12-23 12:36:37 UTC
[This is an automated message.]
This bug was filed before the changes to Bugzilla on 2011-10-16. Thus it
started right out as NEW without ever being explicitly confirmed. The bug is
changed to state NEEDINFO for this reason. To move this bug from NEEDINFO back
to NEW please check if the bug still persists with the 3.5.0 beta1 or beta2 prereleases.
Details on how to test the 3.5.0 beta1 can be found at:
http://wiki.documentfoundation.org/QA/BugHunting_Session_3.5.0.-1

more detail on this bulk operation: http://nabble.documentfoundation.org/RFC-Operation-Spamzilla-tp3607474p3607474.html
Comment 3 Florian Reisinger 2012-08-14 14:03:01 UTC
Dear bug submitter!

Due to the fact, that there are a lot of NEEDINFO bugs with no answer within the last six months, we close all of these bugs.

To keep this message short, more infos are available @ https://wiki.documentfoundation.org/QA/NeedinfoClosure#Statement

Thanks for understanding and hopefully updating your bug, so that everything is prepared for developers to fix your problem.

Yours!

Florian
Comment 4 Florian Reisinger 2012-08-14 14:03:56 UTC
Dear bug submitter!

Due to the fact, that there are a lot of NEEDINFO bugs with no answer within the last six months, we close all of these bugs.

To keep this message short, more infos are available @ https://wiki.documentfoundation.org/QA/NeedinfoClosure#Statement

Thanks for understanding and hopefully updating your bug, so that everything is prepared for developers to fix your problem.

Yours!

Florian
Comment 5 Florian Reisinger 2012-08-14 14:08:30 UTC
Dear bug submitter!

Due to the fact, that there are a lot of NEEDINFO bugs with no answer within the last six months, we close all of these bugs.

To keep this message short, more infos are available @ https://wiki.documentfoundation.org/QA/NeedinfoClosure#Statement

Thanks for understanding and hopefully updating your bug, so that everything is prepared for developers to fix your problem.

Yours!

Florian
Comment 6 Florian Reisinger 2012-08-14 14:10:32 UTC
Dear bug submitter!

Due to the fact, that there are a lot of NEEDINFO bugs with no answer within the last six months, we close all of these bugs.

To keep this message short, more infos are available @ https://wiki.documentfoundation.org/QA/NeedinfoClosure#Statement

Thanks for understanding and hopefully updating your bug, so that everything is prepared for developers to fix your problem.

Yours!

Florian