[Libreoffice-commits] core.git: cui/source include/i18nutil sw/source vcl/source

Caolán McNamara (via logerrit) logerrit at kemper.freedesktop.org
Wed Nov 4 14:12:33 UTC 2020


 cui/source/options/optsave.cxx                 |    2 +-
 include/i18nutil/paper.hxx                     |    2 +-
 sw/source/ui/fldui/DropDownFormFieldDialog.cxx |    2 +-
 vcl/source/window/builder.cxx                  |    2 +-
 4 files changed, 4 insertions(+), 4 deletions(-)

New commits:
commit 6427bf87360a97f41ae351feaa35975c868260ec
Author:     Caolán McNamara <caolanm at redhat.com>
AuthorDate: Wed Nov 4 09:55:53 2020 +0000
Commit:     Caolán McNamara <caolanm at redhat.com>
CommitDate: Wed Nov 4 15:11:56 2020 +0100

    negative returns
    
    Change-Id: I6f710f1aecc2e242b6006a3360e31bf2a9438fe7
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/105286
    Tested-by: Jenkins
    Reviewed-by: Caolán McNamara <caolanm at redhat.com>

diff --git a/cui/source/options/optsave.cxx b/cui/source/options/optsave.cxx
index 564fabb730f6..74b6f408d249 100644
--- a/cui/source/options/optsave.cxx
+++ b/cui/source/options/optsave.cxx
@@ -375,7 +375,7 @@ void SvxSaveTabPage::Reset( const SfxItemSet* )
             {
                 for (sal_Int32 n = 0, nEntryCount = m_xDocTypeLB->get_count(); n < nEntryCount; ++n)
                 {
-                    int nData = m_xDocTypeLB->get_id(n).toInt32();
+                    unsigned int nData = m_xDocTypeLB->get_id(n).toUInt32();
                     OUString sCommand = "getSortedFilterList():module=%1:iflags=" +
                                OUString::number(static_cast<int>(SfxFilterFlags::IMPORT|SfxFilterFlags::EXPORT)) +
                                ":eflags=" +
diff --git a/include/i18nutil/paper.hxx b/include/i18nutil/paper.hxx
index 415fc452d112..5c64d646d7f7 100644
--- a/include/i18nutil/paper.hxx
+++ b/include/i18nutil/paper.hxx
@@ -29,7 +29,7 @@ namespace com::sun::star::lang { struct Locale; }
 //!! The values of the following enumerators must correspond to the array position
 //!! of the respective paper size in the file i18nutil/source/utility/paper.cxx
 //!! Thus don't reorder the enum values here without changing the code there as well.
-enum Paper
+enum Paper : unsigned
 {
     PAPER_A0,
     PAPER_A1,
diff --git a/sw/source/ui/fldui/DropDownFormFieldDialog.cxx b/sw/source/ui/fldui/DropDownFormFieldDialog.cxx
index a70488e46f19..a6d19972c529 100644
--- a/sw/source/ui/fldui/DropDownFormFieldDialog.cxx
+++ b/sw/source/ui/fldui/DropDownFormFieldDialog.cxx
@@ -119,7 +119,7 @@ void DropDownFormFieldDialog::InitControls()
             {
                 sal_Int32 nSelection = -1;
                 pResult->second >>= nSelection;
-                if (vListEntries.getLength() > nSelection)
+                if (nSelection >= 0 && nSelection < vListEntries.getLength())
                     m_xListItemsTreeView->select_text(vListEntries[nSelection]);
             }
         }
diff --git a/vcl/source/window/builder.cxx b/vcl/source/window/builder.cxx
index 7bd21299e16b..73a6532c0949 100644
--- a/vcl/source/window/builder.cxx
+++ b/vcl/source/window/builder.cxx
@@ -3052,7 +3052,7 @@ void VclBuilder::handleRow(xmlreader::XmlReader &reader, const OString &rID)
                     if (name == "id")
                     {
                         name = reader.getAttributeValue(false);
-                        nId = OString(name.begin, name.length).toInt32();
+                        nId = OString(name.begin, name.length).toUInt32();
                     }
                     else if (nId == 0 && name == "translatable" && reader.getAttributeValue(false) == "yes")
                     {


More information about the Libreoffice-commits mailing list