Don't load embedded images from the current working directory.
authorAndrew den Exter <andrew.den-exter@nokia.com>
Mon, 16 Jan 2012 06:40:13 +0000 (16:40 +1000)
committerQt by Nokia <qt-info@nokia.com>
Thu, 19 Jan 2012 10:11:02 +0000 (11:11 +0100)
commitbab2eaf3da299c471dd898c89cf356984b077412
treed7c3bd0cef1e5b28635e71137b62fbca51d070d1
parent9a08d3e79fee46b33a75d17f76f0ff63687a648e
Don't load embedded images from the current working directory.

Override QTextImageHandler's image loading as it will attempt to resolve
relative paths and load the image itself if the document returns an
invalid image from loadResource, which we don't want as it bypasses the
pixmap cache and resolves against the application and current working
directory instead of the Text items context.

Change-Id: Ia1d3633036f96d902e1ac03dae5d5b203fba7ff1
Reviewed-by: Martin Jones <martin.jones@nokia.com>
14 files changed:
src/quick/items/qquicktext.cpp
src/quick/items/qquicktext_p.h
src/quick/items/qquicktext_p_p.h
src/quick/items/qquicktextedit.cpp
src/quick/items/qquicktextedit_p.h
src/quick/items/qquicktextedit_p_p.h
src/quick/items/qquicktextnode.cpp
tests/auto/qtquick2/qquicktext/tst_qquicktext.cpp
tests/auto/qtquick2/qquicktextedit/data/embeddedImagesLocal.qml [new file with mode: 0644]
tests/auto/qtquick2/qquicktextedit/data/embeddedImagesLocalError.qml [new file with mode: 0644]
tests/auto/qtquick2/qquicktextedit/data/embeddedImagesRemote.qml [new file with mode: 0644]
tests/auto/qtquick2/qquicktextedit/data/embeddedImagesRemoteError.qml [new file with mode: 0644]
tests/auto/qtquick2/qquicktextedit/data/http/exists.png [new file with mode: 0644]
tests/auto/qtquick2/qquicktextedit/tst_qquicktextedit.cpp