https://bugs.freedesktop.org/show_bug.cgi?id=46165
Bug #: 46165
Summary: getDataArray fails in LO 3.4.4, 3.4.5, 3.5.0
Classification: Unclassified
Product: LibreOffice
Version: LibO 3.5.0 Release
Platform: x86 (IA32)
OS/Version: Windows (All)
Status: NEW
Severity: major
Priority: medium
Component: Spreadsheet
AssignedTo: [email protected]
ReportedBy: [email protected]
Created attachment 57152
--> https://bugs.freedesktop.org/attachment.cgi?id=57152
C# source code
Calling method getDataArray fails in LibreOffice 3.4.4, 3.4.5, 3.5.0
but succeeds in LibreOffice 3.3.3, 3.4.1, 3.4.2, 3.4.3.
I am using this C# code:
---------------------------
Type tServiceManager = Type.GetTypeFromProgID("com.sun.star.ServiceManager",
true);
object servicemanager = System.Activator.CreateInstance(tServiceManager);
object desktop = servicemanager.GetType().InvokeMember("createinstance",
BindingFlags.InvokeMethod, null, servicemanager, new object[] {
"com.sun.star.frame.Desktop" });
object doc = desktop.GetType().InvokeMember("getCurrentComponent",
BindingFlags.InvokeMethod, null, desktop, new object[] { });
object sheets = doc.GetType().InvokeMember("getSheets",
BindingFlags.InvokeMethod, null, doc, new object[] { });
object sheet = sheets.GetType().InvokeMember("getByIndex",
BindingFlags.InvokeMethod, null, sheets, new object[] { 0 });
object crange = sheet.GetType().InvokeMember("getCellRangeByPosition",
BindingFlags.InvokeMethod, null, sheet, new object[] { 0, 0, 1, 1 });
object cursor = sheet.GetType().InvokeMember("createCursorByRange",
BindingFlags.InvokeMethod, null, sheet, new object[] { crange });
object data = cursor.GetType().InvokeMember("getDataArray",
BindingFlags.InvokeMethod, null, cursor, new object[] { });
---------------------------
The last call ("getDataArray") fails in 3.4.4 and newer.
Steps to reproduce:
1) Open LibreOffice Calc; new workbook is created
2) Write something in cells of first sheet or leave it empty - it does
not matter
3) Leave this workbook open in Calc - but it does not matter if it is
saved or not
4) Run the C# code (or attached Lo344dataread.exe) - it tries to read
cells (0;0)..(1;1) od first sheet of active workbook
5) See the result: 3.4.4 and newer raises exception; 3.4.3 and older
succeeds
Attaching Lo344dataread.exe and complete C# source zip.
--
Configure bugmail: https://bugs.freedesktop.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.
_______________________________________________
Libreoffice-bugs mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/libreoffice-bugs