summaryrefslogtreecommitdiff
path: root/xmloff
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2022-12-08 16:25:24 +0000
committerCaolán McNamara <caolanm@redhat.com>2022-12-10 10:08:35 +0000
commit1c0cd3c732298f86f60479dd088f914bf1aca54a (patch)
tree6084f0480cf2992a5f78bd1a1c7a85811e33b2c1 /xmloff
parente75e427d3ffed3b3a29a6c987d24b7796f4d10cb (diff)
tdf#152266 only warn about script:event-listener with non-empty targets
Change-Id: I19518c4872b522686b3df1881ccee02d840c3db4 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/143829 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com> (cherry picked from commit 8a33bde5288a4a652de35846aa34354044b872c3) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/143732
Diffstat (limited to 'xmloff')
-rw-r--r--xmloff/source/script/XMLEventImportHelper.cxx2
-rw-r--r--xmloff/source/script/XMLScriptContextFactory.cxx3
-rw-r--r--xmloff/source/script/XMLStarBasicContextFactory.cxx3
3 files changed, 6 insertions, 2 deletions
diff --git a/xmloff/source/script/XMLEventImportHelper.cxx b/xmloff/source/script/XMLEventImportHelper.cxx
index aa409e77765d..aebfd13dc7ee 100644
--- a/xmloff/source/script/XMLEventImportHelper.cxx
+++ b/xmloff/source/script/XMLEventImportHelper.cxx
@@ -102,8 +102,6 @@ SvXMLImportContext* XMLEventImportHelper::CreateContext(
const OUString& rXmlEventName,
const OUString& rLanguage)
{
- rImport.NotifyMacroEventRead();
-
SvXMLImportContext* pContext = nullptr;
// translate event name from xml to api
diff --git a/xmloff/source/script/XMLScriptContextFactory.cxx b/xmloff/source/script/XMLScriptContextFactory.cxx
index c5d7cb2d0d05..3ebc45c1c98a 100644
--- a/xmloff/source/script/XMLScriptContextFactory.cxx
+++ b/xmloff/source/script/XMLScriptContextFactory.cxx
@@ -53,6 +53,9 @@ SvXMLImportContext* XMLScriptContextFactory::CreateContext(
// else: ignore
}
+ if (!sURLVal.isEmpty())
+ rImport.NotifyMacroEventRead();
+
Sequence<PropertyValue> aValues{ comphelper::makePropertyValue(gsEventType, OUString(gsScript)),
comphelper::makePropertyValue(gsURL, sURLVal) };
diff --git a/xmloff/source/script/XMLStarBasicContextFactory.cxx b/xmloff/source/script/XMLStarBasicContextFactory.cxx
index e26198978596..bab59a0d7505 100644
--- a/xmloff/source/script/XMLStarBasicContextFactory.cxx
+++ b/xmloff/source/script/XMLStarBasicContextFactory.cxx
@@ -81,6 +81,9 @@ SvXMLImportContext* XMLStarBasicContextFactory::CreateContext(
sMacroNameVal = sMacroNameVal.copy( rDoc.getLength()+1 );
}
+ if (!sMacroNameVal.isEmpty())
+ rImport.NotifyMacroEventRead();
+
Sequence<PropertyValue> aValues
{
comphelper::makePropertyValue(gsEventType, OUString(gsStarBasic)),