summaryrefslogtreecommitdiff
path: root/sw/source
diff options
context:
space:
mode:
authorMichael Stahl <Michael.Stahl@cib.de>2018-10-12 16:37:32 +0200
committerMichael Meeks <michael.meeks@collabora.com>2018-10-25 10:33:30 +0200
commit18a388c696567e6ddbf8c997ee0a9a686e7d80ed (patch)
tree94c8ed1d046049eab3b56c58d9df4f4e6e0b2550 /sw/source
parent424454997a2a464d99c0e7125ea6b143716715b0 (diff)
editeng: do not throw from QueryValue implementation
None of the other QueryValue throw; in case of a problem they return false without initialising the Any. On the one hand, it would be useful to throw an exception for this special property that has now become Write-Only, so that API users get a better hint what is going wrong; on the other hand, it breaks various other things like the various multi-property interfaces that call QueryValue for multiple items (there are 3 such loops in SwAccessibleParagraph alone). (throw was introduced in 7a8ed362eb163ac15a000ba1cfc74b58315800a1) It turns out there is even a test for the exception on ToX. Change-Id: Id60ff43544f7399ce869227bfd6fb933dbaea3be Reviewed-on: https://gerrit.libreoffice.org/61719 Tested-by: Jenkins Reviewed-by: Toma┼ż Vajngerl <quikee@gmail.com> Signed-off-by: Michael Meeks <michael.meeks@collabora.com> Reviewed-on: https://gerrit.libreoffice.org/62331
Diffstat (limited to 'sw/source')
-rw-r--r--sw/source/core/unocore/unoidx.cxx6
1 files changed, 6 insertions, 0 deletions
diff --git a/sw/source/core/unocore/unoidx.cxx b/sw/source/core/unocore/unoidx.cxx
index f2550b36fa23..76f4faf3e09b 100644
--- a/sw/source/core/unocore/unoidx.cxx
+++ b/sw/source/core/unocore/unoidx.cxx
@@ -36,6 +36,7 @@
#include <cppuhelper/supportsservice.hxx>
#include <vcl/svapp.hxx>
#include <editeng/unolingu.hxx>
+#include <editeng/memberids.h>
#include <hints.hxx>
#include <cmdid.h>
#include <swtypes.hxx>
@@ -886,6 +887,11 @@ SwXDocumentIndex::getPropertyValue(const OUString& rPropertyName)
"Unknown property: " + rPropertyName,
static_cast< cppu::OWeakObject * >(this));
}
+ // TODO: is this the best approach to tell API clients about the change?
+ if (pEntry->nWID == RES_BACKGROUND && pEntry->nMemberId == MID_GRAPHIC_URL)
+ {
+ throw uno::RuntimeException("Getting GraphicURL property is not supported");
+ }
SwSectionFormat *const pSectionFormat( m_pImpl->GetSectionFormat() );
SwTOXBase* pTOXBase = nullptr;