summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJulien Nabet <serval2412@yahoo.fr>2016-08-21 10:36:45 +0200
committerJulien Nabet <serval2412@yahoo.fr>2016-08-21 10:49:43 +0000
commit454e1ebcfc589ce82c8c2d5585e22bea1ea5fc79 (patch)
treebf4b1642147746dffce7cdd80dc846a8f595aaeb
parent6431e91eca9e44684066a32ed3d6411509dac781 (diff)
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 <susobhang70@gmail.com> Tested-by: Julien Nabet <serval2412@yahoo.fr> Reviewed-by: Julien Nabet <serval2412@yahoo.fr>
-rw-r--r--cui/source/options/personalization.cxx6
1 files changed, 4 insertions, 2 deletions
diff --git a/cui/source/options/personalization.cxx b/cui/source/options/personalization.cxx
index ea7a49af3907..17ae2d78d952 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