fix crash with empty booknames

Change-Id: Ifadb2129be53530720cb2023cdc0782b6e737f18
(cherry picked from commit 11e73a0880f64c99aec5059ff6122b831bc1de74)
Reviewed-on: https://gerrit.libreoffice.org/17944
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: David Tardon <dtardon@redhat.com>
Tested-by: David Tardon <dtardon@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;
}