[Libreoffice-commits] core.git: Branch 'libreoffice-7-0' - writerfilter/source
Caolán McNamara (via logerrit)
logerrit at kemper.freedesktop.org
Fri Dec 11 11:30:53 UTC 2020
writerfilter/source/dmapper/DomainMapper_Impl.cxx | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
New commits:
commit 3b5b96ecdb7b9a1daabbc0b40c3fe9c598a1bd5b
Author: Caolán McNamara <caolanm at redhat.com>
AuthorDate: Wed Dec 9 09:57:11 2020 +0000
Commit: Michael Stahl <michael.stahl at cib.de>
CommitDate: Fri Dec 11 12:30:18 2020 +0100
negative return passed to parameter that cannot be negative
Change-Id: I4b39a2130e961c6f2ca97695e4625df5a95e00b8
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/107461
Tested-by: Jenkins
Reviewed-by: Michael Stahl <michael.stahl at cib.de>
diff --git a/writerfilter/source/dmapper/DomainMapper_Impl.cxx b/writerfilter/source/dmapper/DomainMapper_Impl.cxx
index 12aa623de2b2..ba2fa918f82f 100644
--- a/writerfilter/source/dmapper/DomainMapper_Impl.cxx
+++ b/writerfilter/source/dmapper/DomainMapper_Impl.cxx
@@ -75,6 +75,7 @@
#include <com/sun/star/lang/XMultiServiceFactory.hpp>
#include <editeng/flditem.hxx>
#include <editeng/unotext.hxx>
+#include <o3tl/safeint.hxx>
#include <o3tl/temporary.hxx>
#include <oox/mathml/import.hxx>
#include <xmloff/odffields.hxx>
@@ -148,7 +149,7 @@ static void lcl_handleDropdownField( const uno::Reference< beans::XPropertySet >
rxFieldProps->setPropertyValue( "Items", uno::makeAny( sItems ) );
sal_Int32 nResult = pFFDataHandler->getDropDownResult().toInt32();
- if ( nResult )
+ if (nResult > 0 && o3tl::make_unsigned(nResult) < sItems.size())
rxFieldProps->setPropertyValue( "SelectedItem", uno::makeAny( sItems[ nResult ] ) );
if ( !pFFDataHandler->getHelpText().isEmpty() )
rxFieldProps->setPropertyValue( "Help", uno::makeAny( pFFDataHandler->getHelpText() ) );
More information about the Libreoffice-commits
mailing list