Bug 96223 - SearchDescriptor Properties cannot be set in 5.1
Summary: SearchDescriptor Properties cannot be set in 5.1
Status: VERIFIED FIXED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: BASIC (show other bugs)
Version:
(earliest affected)
5.1.0.0.beta1
Hardware: All All
: medium normal
Assignee: Not Assigned
URL:
Whiteboard: target:5.2.0 target:5.1.0.3
Keywords: bibisected, bisected, regression
: 97205 (view as bug list)
Depends on:
Blocks:
 
Reported: 2015-12-03 10:04 UTC by Iandol
Modified: 2016-10-25 19:11 UTC (History)
9 users (show)

See Also:
Crash report or crash signature:


Attachments
Test ODT with macro makeURLs (12.44 KB, application/vnd.oasis.opendocument.text)
2015-12-03 10:59 UTC, Iandol
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Iandol 2015-12-03 10:04:55 UTC
I have a macro which searches through text to find unlinked URLs and linkify them. It uses a SearchDescriptor and regular expressions:

	oSearch = oDocument.createSearchDescriptor
	oSearch.SearchRegularExpression = TRUE

This creates a new descriptor and then enables regex mode. This FAILS in 5.1, and looking at the object it does not expose the SearchRegularExpression property to modify. Is this an API change undocumented in https://wiki.documentfoundation.org/ReleaseNotes/5.1#API_changes or a bug?

The full macro is below, which works fine in 5.0.3:


Sub makeURLs()
	Dim oDocument As Object
	Dim oSearch As Object, oFound As Object
	Dim oFoundCursor As Object
	Dim reURL As String
	Dim doistring as String
	Dim URL as String

	reURL = "(https?://([-\w\.]+)+(:\d+)?(/([\w/_\.]*(\?\S+)?)?)?)"
	URL = ""
	doistring = "dx.doi.org"
	oDocument = ThisComponent
	oSearch = oDocument.createSearchDescriptor
	oSearch.SearchRegularExpression = TRUE
	oSearch.SearchString = reURL
	oFound = oDocument.findFirst(oSearch)
	While NOT IsNull(oFound)
		URL = oFound.String
		If InStr(URL, doistring) Then
			oFound.HyperlinkName = "DOI"
			REM	oFound.String = "DOI"
		Else
			oFound.HyperlinkName = "URL"
		End If
		oFound.HyperlinkTarget = ""
		oFound.HyperlinkURL = URL
		oFound = oDocument.findNext(oFound, oSearch)
		URL=""
	Wend
	
End Sub
Comment 1 Iandol 2015-12-03 10:59:21 UTC
Created attachment 120988 [details]
Test ODT with macro makeURLs

A simple doc with some links and the macro which works in 5.0.3 and breaks in 5.1
Comment 2 Buovjaga 2015-12-05 17:07:16 UTC
Confirmed.

Win 7 Pro 64-bit, Version: 5.0.3.2 (x64)
Build ID: e5f16313668ac592c1bfb310f4390624e3dbfb75
Locale: fi-FI (fi_FI)

Version: 5.2.0.0.alpha0+
Build ID: 81fa5340191baf8687f9c82f1f414f5afc86b529
Threads 4; Ver: Windows 6.1; Render: default; 
TinderBox: Win-x86@62-merge-TDF, Branch:MASTER, Time: 2015-12-03_21:19:19
Locale: fi-FI (fi_FI)
Comment 3 raal 2015-12-07 14:23:06 UTC
This seems to have begun at the below commit.
Adding Cc: to Matthew J. Francis ; Could you possibly take a look at this one? Thanks
 bc0b2085d043ff9bb2d891b55e4a7f45a9dd4bf7 is the first bad commit
commit bc0b2085d043ff9bb2d891b55e4a7f45a9dd4bf7
Author: Norbert Thiebaud <nthiebaud@gmail.com>
Date:   Sun Jul 26 14:49:20 2015 -0700

    source 61b1697069c50ff72339d4592add42ab72b03243

    source 61b1697069c50ff72339d4592add42ab72b03243

    author    Matthew J. Francis <mjay.francis@gmail.com>    2015-07-06 00:09:24 (GMT)
committer    Stephan Bergmann <sbergman@redhat.com>    2015-07-08 14:51:54 (GMT)
commit    61b1697069c50ff72339d4592add42ab72b03243 (patch)
Reduce the amount of up front work in performing introspection   
   
    bibisect-win32-5.1
$ git bisect log
# bad: [a2ca6bb70db1ba8f306a617d92070351d9a3a624] source 8b5182155b6d35a1be64d37136584e30ea6a6ef8
# good: [c1efd324c6ad448ac9edb030dc9738b9e6899e4d] source ab465b90f6c6da5595393a0ba73f33a1e71a2b65
git bisect start 'a2ca6bb70db1ba8f306a617d92070351d9a3a624' 'c1efd324c6ad448ac9edb030dc9738b9e6899e4d'
# bad: [1e602523875e23a7969d8c28276c82311eb2fa74] source 5b8e4f3d676eb0a026ce1eb4c1df2ec6e0736cb1
git bisect bad 1e602523875e23a7969d8c28276c82311eb2fa74
# bad: [1e602523875e23a7969d8c28276c82311eb2fa74] source 5b8e4f3d676eb0a026ce1eb4c1df2ec6e0736cb1
git bisect bad 1e602523875e23a7969d8c28276c82311eb2fa74
# good: [01eef57435e835a8bc484038bd81d1aa8a762920] source 064481201341d92af2ec1387bb53a9c4b480217f
git bisect good 01eef57435e835a8bc484038bd81d1aa8a762920
# bad: [6be5b8f118856a995c7d0c0db843167fbea1555d] source 69df701742a9c3946e2031488c377c18a5ec4de0
git bisect bad 6be5b8f118856a995c7d0c0db843167fbea1555d
# bad: [407159f8b3a4d483ad0952ab04de75fc78898852] source 71c6ee42d3311b31896e5a408d8f83f4e5d7726e
git bisect bad 407159f8b3a4d483ad0952ab04de75fc78898852
# bad: [05c15e6999ee21f035066da19ea13bac9d1c7e99] source 74f9d9808fce14f015d56a2aaa4ec5616ed7aa3e
git bisect bad 05c15e6999ee21f035066da19ea13bac9d1c7e99
# bad: [84e6f10a26c8d7b07ee2cfe851588f39ba21bd38] source f4b189df64cc6f6238a5bdf00390cd5dd5ac9e89
git bisect bad 84e6f10a26c8d7b07ee2cfe851588f39ba21bd38
# good: [eadbc73a5371ff74c3195ac072c190df917b02cf] source 1349c8356429279f6b6ff6d8fc7a1a51e5c7ee55
git bisect good eadbc73a5371ff74c3195ac072c190df917b02cf
# bad: [e2430741fe4593c03bfc45ede3435913b35ad969] source 64bc8b45b5c23efc5fe57585a69aa4263aaf4e83
git bisect bad e2430741fe4593c03bfc45ede3435913b35ad969
# good: [b5026025b18d7dba990482409a8f4846cac63dbb] source 4ec7f1d7a82e13532b07acb5da6bb17cfd550ee2
git bisect good b5026025b18d7dba990482409a8f4846cac63dbb
# good: [d266bb906464940b0d921b56fbf5aa2c9bf7bb9d] source ca55180d74d9e6f40071f453c4b0280ae768e5a0
git bisect good d266bb906464940b0d921b56fbf5aa2c9bf7bb9d
# good: [8c52c13c44f6b6232bdffba6a383f336c3707252] source c3c6bf235af32781e83d4fed2867a16bfeafa659
git bisect good 8c52c13c44f6b6232bdffba6a383f336c3707252
# bad: [bc0b2085d043ff9bb2d891b55e4a7f45a9dd4bf7] source 61b1697069c50ff72339d4592add42ab72b03243
git bisect bad bc0b2085d043ff9bb2d891b55e4a7f45a9dd4bf7
# good: [1f62c5a5e84bf22c1e4aec2448ab73a9c0dfd634] source b3e645cde951906d883f015d342f85fc0eedb2ec
git bisect good 1f62c5a5e84bf22c1e4aec2448ab73a9c0dfd634
# first bad commit: [bc0b2085d043ff9bb2d891b55e4a7f45a9dd4bf7] source 61b1697069c50ff72339d4592add42ab72b03243
Comment 4 Robinson Tryon (qubit) 2015-12-13 11:14:24 UTC Comment hidden (obsolete)
Comment 5 Cor Nouws 2015-12-18 12:47:22 UTC
@stephan: see comment #3
Comment 6 Commit Notification 2015-12-21 07:52:21 UTC
Oliver Specht committed a patch related to this issue.
It has been pushed to "master":

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

tdf#96223: introspection queries for XPropertySet again

It will be available in 5.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 7 Iandol 2015-12-28 21:34:32 UTC
This is fixed for me, thank you!
Comment 8 Maxim Monastirsky 2016-01-17 17:12:17 UTC
*** Bug 97205 has been marked as a duplicate of this bug. ***
Comment 9 Jean-Baptiste Faure 2016-01-17 17:27:38 UTC
(In reply to Commit Notification from comment #6)
> Oliver Specht committed a patch related to this issue.
> It has been pushed to "master":
> 
> http://cgit.freedesktop.org/libreoffice/core/commit/
> ?id=7b02cfef9507dd2f0e9bec61bb5b78b75dc852e9
> 
> tdf#96223: introspection queries for XPropertySet again
> 
> It will be available in 5.2.0.

Is a backport to 5.1 possible ?
See bug 97205.

Best regards. JBF
Comment 10 Oliver Specht (CIB) 2016-01-18 08:29:42 UTC
The patch has been cherry-picked to 5.1 and 5.1.0 and is now waiting for build & review
https://gerrit.libreoffice.org/21565
https://gerrit.libreoffice.org/21569
Comment 11 Commit Notification 2016-01-18 08:54:23 UTC
Oliver Specht committed a patch related to this issue.
It has been pushed to "libreoffice-5-1":

http://cgit.freedesktop.org/libreoffice/core/commit/?id=6183ae17b58ba747b529ad8c1b70ae5fd6e27e5a&h=libreoffice-5-1

tdf#96223: introspection queries for XPropertySet again

It will be available in 5.1.1.

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 12 Jean-Baptiste Faure 2016-01-18 09:27:09 UTC
(In reply to Commit Notification from comment #11)
> Oliver Specht committed a patch related to this issue.
> It has been pushed to "libreoffice-5-1":

Thank you very much !
Build and tested with Altsearch extension: works as expected now in LO 5.1.1.0.0+ :-)

Best regards. JBF
Comment 13 Commit Notification 2016-01-18 13:57:22 UTC
Oliver Specht committed a patch related to this issue.
It has been pushed to "libreoffice-5-1-0":

http://cgit.freedesktop.org/libreoffice/core/commit/?id=1f32dd6754bf72615be76885f722ced3efaa0342&h=libreoffice-5-1-0

tdf#96223: introspection queries for XPropertySet again

It will be available in 5.1.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.