Since commit 872dba61a1 (INTEGRATION:
CWS xmlfilter01 (1.1.2.3.2.1.16); FILE MERGED, 2003-04-04),
XMLFilterDetect service uses Clipboardformat field in filterdetect.
Thus, it detects any file starting with "<?xml" and having string
"pwi" as "writer_PocketWord_File", because writer_PocketWord_File.xcu
has the text "doctype:pwi" as the value of its ClipboardFormat.
The problem is: since commit 1e6e891016
(restore PocketWord filter, this time backed by libwps, 2020-09-27),
this format is not handled by XMLFilterDetect service. So the filter
mis-detects some else filter's data, which then isn't accepted there.
This change makes the code of FilterDetect::detect to make sure that
it only processes its own data, checking DetectService property, too.
I didn't remove the ClipboardFormat property value from the mentioned
XCU, because (1) I don't know if it may be used by other code; and
(2) because it allows to have the sensible unit test.
Change-Id: I02fafe8df10f64640305d45cf1461b0a37552630
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/174607
Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
Tested-by: Jenkins