Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code

Side by Side Diff: compiled/storage/FilterStorage.cpp

Issue 29721753: Issue 6180 - use ABP_TEXT everywhere in order to let String be a UTF-8 string (Closed) Base URL: https://github.com/adblockplus/adblockpluscore.git@adb2678354813ce5b6de095072954c5a784a7bc4
Patch Set: rebase Created March 15, 2018, 1:53 p.m.
Left:
Right:
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View unified diff | Download patch
« no previous file with comments | « compiled/library.cpp ('k') | compiled/subscription/DownloadableSubscription.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * This file is part of Adblock Plus <https://adblockplus.org/>, 2 * This file is part of Adblock Plus <https://adblockplus.org/>,
3 * Copyright (C) 2006-present eyeo GmbH 3 * Copyright (C) 2006-present eyeo GmbH
4 * 4 *
5 * Adblock Plus is free software: you can redistribute it and/or modify 5 * Adblock Plus is free software: you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License version 3 as 6 * it under the terms of the GNU General Public License version 3 as
7 * published by the Free Software Foundation. 7 * published by the Free Software Foundation.
8 * 8 *
9 * Adblock Plus is distributed in the hope that it will be useful, 9 * Adblock Plus is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of 10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
(...skipping 96 matching lines...) Expand 10 before | Expand all | Expand 10 after
107 FilterNotifier::Topic::SUBSCRIPTION_REMOVED, 107 FilterNotifier::Topic::SUBSCRIPTION_REMOVED,
108 subscription 108 subscription
109 ); 109 );
110 return true; 110 return true;
111 } 111 }
112 112
113 bool FilterStorage::MoveSubscription(Subscription& subscription, 113 bool FilterStorage::MoveSubscription(Subscription& subscription,
114 const Subscription* insertBefore) 114 const Subscription* insertBefore)
115 { 115 {
116 int oldPos = IndexOfSubscription(subscription); 116 int oldPos = IndexOfSubscription(subscription);
117 assert2(oldPos >= 0, u"Attempt to move a subscription that is not in the list" _str); 117 assert2(oldPos >= 0, ABP_TEXT("Attempt to move a subscription that is not in t he list"_str));
118 if (oldPos == -1) 118 if (oldPos == -1)
119 return false; 119 return false;
120 120
121 int newPos = -1; 121 int newPos = -1;
122 if (insertBefore) 122 if (insertBefore)
123 newPos = IndexOfSubscription(*insertBefore); 123 newPos = IndexOfSubscription(*insertBefore);
124 if (newPos == -1) 124 if (newPos == -1)
125 newPos = mSubscriptions.size(); 125 newPos = mSubscriptions.size();
126 126
127 if (newPos > oldPos) 127 if (newPos > oldPos)
128 newPos--; 128 newPos--;
129 129
130 if (newPos == oldPos) 130 if (newPos == oldPos)
131 return false; 131 return false;
132 132
133 mSubscriptions.erase(mSubscriptions.begin() + oldPos); 133 mSubscriptions.erase(mSubscriptions.begin() + oldPos);
134 mSubscriptions.emplace(mSubscriptions.begin() + newPos, &subscription); 134 mSubscriptions.emplace(mSubscriptions.begin() + newPos, &subscription);
135 135
136 FilterNotifier::SubscriptionChange( 136 FilterNotifier::SubscriptionChange(
137 FilterNotifier::Topic::SUBSCRIPTION_MOVED, 137 FilterNotifier::Topic::SUBSCRIPTION_MOVED,
138 subscription 138 subscription
139 ); 139 );
140 return true; 140 return true;
141 } 141 }
OLDNEW
« no previous file with comments | « compiled/library.cpp ('k') | compiled/subscription/DownloadableSubscription.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld