Kaydet (Commit) 68e1eb77 authored tarafından Stephan Bergmann's avatar Stephan Bergmann

Clean up SvxSwFramePosString::GetString

...after 2687a5ac
"-Werror,-Wtautological-compare with latest clang".  Even with a compiler that
chose int as the underlying type of StringId, eId could only be negative after
UB has happened elsewhere, but nevertheless keep checking for it in the assert
(which is a macro in which -Wtautological-compare is apparently disabled with
recent Clang trunk at least).

Change-Id: I448c6d48e9f84ef84089f4735776b6a66599dc67
üst 033bb038
......@@ -17,19 +17,23 @@
* the License at http://www.apache.org/licenses/LICENSE-2.0 .
*/
#include <sal/config.h>
#include <cassert>
#include <svx/swframeposstrings.hxx>
#include <tools/resary.hxx>
#include <tools/debug.hxx>
#include <svx/dialmgr.hxx>
#include <svx/strings.hrc>
#include "swframeposstrings.hrc"
OUString SvxSwFramePosString::GetString(StringId eId)
{
assert(SAL_N_ELEMENTS(RID_SVXSW_FRAMEPOSITIONS) == SvxSwFramePosString::STR_MAX);
DBG_ASSERT(eId >= 0 && eId < STR_MAX, "invalid StringId");
if(!(eId < STR_MAX))
eId = LEFT;
static_assert(
(SAL_N_ELEMENTS(RID_SVXSW_FRAMEPOSITIONS)
== SvxSwFramePosString::STR_MAX),
"RID_SVXSW_FRAMEPOSITIONS too small");
assert(eId >= 0 && eId < STR_MAX);
return SvxResId(RID_SVXSW_FRAMEPOSITIONS[eId]);
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment