[Libreoffice-commits] core.git: Branch 'libreoffice-5-0' - sw/source

Caolán McNamara caolanm at redhat.com
Mon Aug 24 03:09:01 PDT 2015


 sw/source/filter/ww8/ww8scan.cxx |    7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

New commits:
commit 8578df9017ab3786f7c40929220c4db36b090a06
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Mon Aug 24 09:36:42 2015 +0100

    fix crash with empty booknames
    
    Change-Id: Ifadb2129be53530720cb2023cdc0782b6e737f18
    (cherry picked from commit 11e73a0880f64c99aec5059ff6122b831bc1de74)
    Reviewed-on: https://gerrit.libreoffice.org/17944
    Tested-by: Jenkins <ci at libreoffice.org>
    Reviewed-by: David Tardon <dtardon at redhat.com>
    Tested-by: David Tardon <dtardon at redhat.com>

diff --git a/sw/source/filter/ww8/ww8scan.cxx b/sw/source/filter/ww8/ww8scan.cxx
index 1595f50..857e4e2 100644
--- a/sw/source/filter/ww8/ww8scan.cxx
+++ b/sw/source/filter/ww8/ww8scan.cxx
@@ -4202,17 +4202,18 @@ bool WW8PLCFx_Book::MapName(OUString& rName)
         return false;
 
     bool bFound = false;
-    sal_uInt16 i = 0;
-    do
+
+    size_t i = 0;
+    while (i < aBookNames.size())
     {
         if (rName.equalsIgnoreAsciiCase(aBookNames[i]))
         {
             rName = aBookNames[i];
             bFound = true;
+            break;
         }
         ++i;
     }
-    while (!bFound && i < pBook[0]->GetIMax());
     return bFound;
 }
 


More information about the Libreoffice-commits mailing list