Bug 118026 - The Range property of a paragraph enumerated from an Automation client is not found
Summary: The Range property of a paragraph enumerated from an Automation client is not...
Status: RESOLVED FIXED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: LibreOffice (show other bugs)
Version:
(earliest affected)
6.2.0.0.alpha0+
Hardware: All All
: medium normal
Assignee: How can I remove my account?
URL:
Whiteboard: target:6.2.0
Keywords:
Depends on:
Blocks:
 
Reported: 2018-06-06 09:50 UTC by How can I remove my account?
Modified: 2018-06-06 18:25 UTC (History)
0 users

See Also:
Crash report or crash signature:


Attachments
Sample VBscript to exercise the problem (1.05 KB, text/plain)
2018-06-06 09:52 UTC, How can I remove my account?
Details

Note You need to log in before you can comment on or make changes to this bug.
Description How can I remove my account? 2018-06-06 09:50:01 UTC
Description:
See the attached VBscript.

The Range property is found in a paragraph object accessed another way.

Steps to Reproduce:
.

Actual Results:  
.

Expected Results:
.


Reproducible: Always


User Profile Reset: No



Additional Info:


User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_13_5) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/11.1.1 Safari/605.1.15
Comment 1 How can I remove my account? 2018-06-06 09:52:36 UTC
Created attachment 142554 [details]
Sample VBscript to exercise the problem

Output:

> $ cscript ../bugreport.vbs
> Microsoft (R) Windows Script Host Version 5.812
> Copyright (C) Microsoft Corporation. All rights reserved.
> 
> Creating Writer.Application
> Set d = w.Documents
> Opening u1.odt
> Getting a = w.ActiveDocument
> Trying Set r = x1.Paragraphs(1).Range
> Enumerating paragraphs in the document with For Each
> Paragpraph 1
> Trying Set range = i.Range
> C:\cygwin64\home\Tor\lo\bugreport.vbs(38, 5) Microsoft VBScript runtime error: Object doesn't support this property or method: 'i.Range'
Comment 2 How can I remove my account? 2018-06-06 10:31:10 UTC Comment hidden (off-topic)
Comment 3 How can I remove my account? 2018-06-06 13:11:46 UTC
The problem seems to be that when doing something like 

Set d = w.ActiveDocument
Set p = d.Paragraphs(1)

the p object corresponds to an InterfaceOleWrapper for a SwVbaParagraph, but when doing:

For Each i in d.Paragraphs
   ...
Next

the i object corresponds to an InterfaceOleWrapper for a SwXParagraph.

The handle of enumerations of collections in extensions/source/ole/unoobjw.cxx needs more work.
Comment 4 How can I remove my account? 2018-06-06 16:16:27 UTC
Suggested fix at https://gerrit.libreoffice.org/#/c/55392/
Comment 5 Commit Notification 2018-06-06 18:24:47 UTC
Tor Lillqvist committed a patch related to this issue.
It has been pushed to "master":

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

tdf#118026: Use ooo::vba::XCollection instead of css::container::XEnumeration

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.