cui/source/options/personalization.cxx |    6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

New commits:
commit 454e1ebcfc589ce82c8c2d5585e22bea1ea5fc79
Author: Julien Nabet <serval2...@yahoo.fr>
Date:   Sun Aug 21 10:36:45 2016 +0200

    tdf#101629: fix https://addons.mozilla.org/ case
    
    Don't call copy function if its argument is -1 because "firefox" isn't 
present in searchTerm
    
    There's still at least 1 other case to deal (eg: ../en-US/ as indicated in 
bugreport)
    
    Change-Id: Id78ec6c174abecd9cc101ac730f5e83b5acd167d
    Reviewed-on: https://gerrit.libreoffice.org/28271
    Reviewed-by: Susobhan Ghosh <susobhan...@gmail.com>
    Tested-by: Julien Nabet <serval2...@yahoo.fr>
    Reviewed-by: Julien Nabet <serval2...@yahoo.fr>

diff --git a/cui/source/options/personalization.cxx 
b/cui/source/options/personalization.cxx
index ea7a49a..17ae2d7 100644
--- a/cui/source/options/personalization.cxx
+++ b/cui/source/options/personalization.cxx
@@ -160,9 +160,11 @@ IMPL_LINK_TYPED( SelectPersonaDialog, SearchPersonas, 
Button*, pButton, void )
     // 15 results so that invalid and duplicate search results whose names 
can't be retrieved can be skipped
     OUString rSearchURL = 
"https://services.addons.mozilla.org/en-US/firefox/api/1.5/search/"; + 
searchTerm + "/9/15";
 
-    if ( searchTerm.startsWith( "https://addons.mozilla.org/"; ) )
+    sal_Int32 nIndexOfFirefox = searchTerm.indexOf( "firefox" );
+
+    if ( searchTerm.startsWith( "https://addons.mozilla.org/"; ) && 
nIndexOfFirefox != -1 )
     {
-        searchTerm = "https://addons.mozilla.org/en-US/"; + searchTerm.copy( 
searchTerm.indexOf( "firefox" ) );
+        searchTerm = "https://addons.mozilla.org/en-US/"; + searchTerm.copy( 
nIndexOfFirefox );
         m_pSearchThread = new SearchAndParseThread( this, searchTerm, true );
     }
     else
_______________________________________________
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

Reply via email to