diff --git a/plug-ins/pdf/pdf-import.cpp b/plug-ins/pdf/pdf-import.cpp index 189737908102d1aff8853a754264c8ac213ae4ad..ed332d739fb0f8293a9e8388c6d0a5ac06c4ae18 100644 --- a/plug-ins/pdf/pdf-import.cpp +++ b/plug-ins/pdf/pdf-import.cpp @@ -152,11 +152,11 @@ public : void updateLineDash (GfxState *state) { - double *dashPattern; int dashLength; double dashStart; - state->getLineDash (&dashPattern, &dashLength, &dashStart); + std::vector dashPattern = state->getLineDash(&dashStart); + dashLength = dashPattern.size(); this->dash_length = dashLength ? dashPattern[0] * scale : 1.0; if (dashLength == 0) @@ -313,12 +313,12 @@ public : DiaFont *font; // without a font it wont make sense - if (!state->getFont()) + if (!state->getFont().get()) return; //FIXME: Dia is really unhappy about zero size fonts if (!(state->getFontSize() > 0.0)) return; - GfxFont *f = state->getFont(); + GfxFont *f = state->getFont().get(); // instead of building the same font over and over again if (g_hash_table_lookup (this->font_map, f)) { @@ -717,15 +717,15 @@ DiaOutputDev::drawString(GfxState *state, GooString *s) if (len == 0) return; // get the font - if (!state->getFont()) + if (!state->getFont().get()) return; if (!(state->getFontSize() > 0.0)) return; - font = (DiaFont *)g_hash_table_lookup (this->font_map, state->getFont()); + font = (DiaFont *)g_hash_table_lookup (this->font_map, state->getFont().get()); // we have to decode the string data first { - GfxFont *f = state->getFont(); + GfxFont *f = state->getFont().get(); const char *p = s->c_str(); CharCode code; int j = 0, m, n; @@ -870,8 +870,8 @@ import_pdf(const gchar *filename, DiagramData *dia, DiaContext *ctx, void* user_ std::unique_ptr doc; GooString *fileName = new GooString(filename); // no passwords yet - GooString *ownerPW = NULL; - GooString *userPW = NULL; + std::optional ownerPW; + std::optional userPW; gboolean ret = FALSE; // without this we will get strange crashes (at least with /O2 build)