Ticket #31153: patch-ipe-uilua.cpp.diff

File patch-ipe-uilua.cpp.diff, 737 bytes (added by m.thon@…, 13 years ago)
  • ipe/uilua.cpp

    old new  
    3636
    3737#include <cstdio>
    3838#include <cstdlib>
     39#include <vector>
    3940
    4041#ifdef IPEUI_QT
    4142#include "ipeselector_qt.h"
     
    543544  AppUiBase **ui = check_appui(L, 1);
    544545  luaL_argcheck(L, lua_istable(L, 2), 2, "argument is not a table");
    545546  int no = lua_objlen(L, 2);
    546   String bm[no];
     547  std::vector<String> bm(no);
    547548  for (int i = 1; i <= no; ++i) {
    548549    lua_rawgeti(L, 2, i);
    549550    luaL_argcheck(L, lua_isstring(L, -1), 2, "item is not a string");
    550551    bm[i-1] = String(lua_tostring(L, -1));
    551552    lua_pop(L, 1);
    552553  }
    553   (*ui)->setBookmarks(no, bm);
     554  (*ui)->setBookmarks(no, &bm[0]);
    554555  return 0;
    555556}
    556557