diff options
Diffstat (limited to 'src/dxfdim.cc')
-rw-r--r-- | src/dxfdim.cc | 22 |
1 files changed, 11 insertions, 11 deletions
diff --git a/src/dxfdim.cc b/src/dxfdim.cc index 4c53d86..666b53d 100644 --- a/src/dxfdim.cc +++ b/src/dxfdim.cc @@ -51,15 +51,15 @@ Value builtin_dxf_dim(const Context *ctx, const QVector<QString> &argnames, cons for (int i = 0; i < argnames.count() && i < args.count(); i++) { if (argnames[i] == "file") - filename = ctx->get_absolute_path(args[i].text); + filename = ctx->get_absolute_path(QString::fromStdString(args[i].text)); if (argnames[i] == "layer") - layername = args[i].text; + layername = QString::fromStdString(args[i].text); if (argnames[i] == "origin") args[i].getv2(xorigin, yorigin); if (argnames[i] == "scale") args[i].getnum(scale); if (argnames[i] == "name") - name = args[i].text; + name = QString::fromStdString(args[i].text); } QFileInfo fileInfo(filename); @@ -133,9 +133,9 @@ Value builtin_dxf_cross(const Context *ctx, const QVector<QString> &argnames, co for (int i = 0; i < argnames.count() && i < args.count(); i++) { if (argnames[i] == "file") - filename = ctx->get_absolute_path(args[i].text); + filename = ctx->get_absolute_path(QString::fromStdString(args[i].text)); if (argnames[i] == "layer") - layername = args[i].text; + layername = QString::fromStdString(args[i].text); if (argnames[i] == "origin") args[i].getv2(xorigin, yorigin); if (argnames[i] == "scale") @@ -157,10 +157,10 @@ Value builtin_dxf_cross(const Context *ctx, const QVector<QString> &argnames, co for (int i = 0, j = 0; i < dxf.paths.count(); i++) { if (dxf.paths[i].points.count() != 2) continue; - coords[j][0] = dxf.paths[i].points[0]->x; - coords[j++][1] = dxf.paths[i].points[0]->y; - coords[j][0] = dxf.paths[i].points[1]->x; - coords[j++][1] = dxf.paths[i].points[1]->y; + coords[j][0] = (*dxf.paths[i].points[0])[0]; + coords[j++][1] = (*dxf.paths[i].points[0])[1]; + coords[j][0] = (*dxf.paths[i].points[1])[0]; + coords[j++][1] = (*dxf.paths[i].points[1])[1]; if (j == 4) { double x1 = coords[0][0], y1 = coords[0][1]; @@ -176,8 +176,8 @@ Value builtin_dxf_cross(const Context *ctx, const QVector<QString> &argnames, co double y = y1 + ua*(y2 - y1); Value ret; ret.type = Value::VECTOR; - ret.vec.append(new Value(x)); - ret.vec.append(new Value(y)); + ret.append(new Value(x)); + ret.append(new Value(y)); return dxf_cross_cache[key] = ret; } } |