Package Details: dia-git 6883.78c75625d-1

Git Clone URL: https://aur.archlinux.org/dia-git.git (read-only, click to copy)
Package Base: dia-git
Description: A GTK+ based diagram creation program
Upstream URL: https://gitlab.gnome.org/GNOME/dia
Licenses: GPL-2.0-or-later
Conflicts: dia
Provides: dia
Submitter: lilac
Maintainer: a821
Last Packager: a821
Votes: 2
Popularity: 0.012055
First Submitted: 2019-05-08 01:07 (UTC)
Last Updated: 2024-11-10 14:29 (UTC)

Latest Comments

« First ‹ Previous 1 2 3 4

yoshi3 commented on 2022-06-01 23:52 (UTC) (edited on 2022-06-01 23:54 (UTC) by yoshi3)

From Poppler> 22.03, the PDF function is only possible with "expanded" patch.

With Poppler 22.06 and Patch, import/export of PDF is possible without crash.

Import of VDX kills Dia :(

Patch for PDF


--- pdf-import.orig 2022-05-25 17:35:28.000000000 +0200
+++ plug-ins/pdf/pdf-import.cpp 2022-06-01 20:31:16.409645162 +0200
@@ -318,10 +318,10 @@
     //FIXME: Dia is really unhappy about zero size fonts
     if (!(state->getFontSize() > 0.0))
       return;
-    GfxFont *f = state->getFont();
-
+   const std::shared_ptr<GfxFont> f = state->getFont();  // poppler 22.05 ... header changed
+   gconstpointer f1 = &f;  // GLib typedef const void * gconstpointer;
     // instead of building the same font over and over again
-    if (g_hash_table_lookup (this->font_map, f)) {
+    if (g_hash_table_lookup (this->font_map, f1)) {
       ++font_map_hits;
       return;
     }
@@ -333,8 +333,8 @@
     gchar *family = g_strdup (f->getFamily() ? f->getFamily()->c_str() : "sans");

     // we are (not anymore) building the same font over and over again
-    g_print ("Font 0x%x: '%s' size=%g (* %g)\n",
-        GPOINTER_TO_INT (f), family, state->getTransformedFontSize(), scale);
+   f1  = &f;
+    g_print ("Font 0x%x: '%s' size=%g (* %g)\n", GPOINTER_TO_INT (f1), family, state->getTransformedFontSize(), scale);

     // now try to make a fontname Dia/Pango can cope with
     // strip style postfix - we already have extracted the style bits above
@@ -353,8 +353,9 @@
     if (fm[0] != 0)
       fsize *= fabs(fm[3] / fm[0]);
     font = dia_font_new (family, style, fsize * scale / 0.8);
-
-    g_hash_table_insert (this->font_map, f, font);
+   f1  = &f;
+   gpointer f2 = (gpointer)f1;  // GLib typedef void* gpointer;
+    g_hash_table_insert (this->font_map, f2, font);
     g_free (family);
   }
   void updateTextShift(GfxState *state, double shift)
@@ -721,11 +722,12 @@
     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()));

   // we have to decode the string data first
   {
-    GfxFont *f = state->getFont();
+//    GfxFont *f = state->getFont();
+   const std::shared_ptr<GfxFont> f = state->getFont();      
     const char *p = s->c_str();
     CharCode code;
     int   j = 0, m, n;
@@ -870,8 +872,10 @@
   std::unique_ptr<PDFDoc> doc;
   GooString *fileName = new GooString(filename);
   // no passwords yet
-  GooString *ownerPW = NULL;
-  GooString *userPW = NULL;
+  //GooString *ownerPW = NULL;
+  //GooString *userPW = NULL;
+  const std::optional<GooString> ownerPW;
+  const std::optional<GooString> userPW;
   gboolean ret = FALSE;

   // without this we will get strange crashes (at least with /O2 build)
@@ -899,7 +903,8 @@
     delete diaOut;
     ret = TRUE;
   }
-  delete fileName;
+ doc.reset();
+ delete fileName;

   return ret;
 }

haawda commented on 2022-01-20 20:15 (UTC)

Seems to be a problem with meson: See https://github.com/mesonbuild/meson/issues/9441

Downgrading meson to 0.60.3-1 fixes this for me.

tatsumaru commented on 2022-01-19 20:33 (UTC) (edited on 2022-01-19 20:36 (UTC) by tatsumaru)

@haawda This build didn't work for me, help would be appreciated:

sheets/meson.build:47:4: ERROR: Function does not take positional arguments.

A full log can be found at https://paste.rs/Yt2

heavysink commented on 2021-03-18 02:56 (UTC) (edited on 2021-03-18 02:57 (UTC) by heavysink)

@haawda

Need to replace

PDFDoc *doc

to

std::unique_ptr<PDFDoc> doc

and

delete doc

to

doc.reset()

in plug-ins/pdf/pdf-import.cpp to build with poppler 21.3.0

haawda commented on 2021-03-08 15:23 (UTC)

Won't build with recently updated poppler library 21.3.0. Downgrade to 21.2.0. I filed a bugreport upstream.

Popolon commented on 2020-10-20 12:15 (UTC)

need to replace 'libpoppler' by 'poppler' in dependencies.

sirocco commented on 2020-08-02 05:17 (UTC)

==> Starting build()...
usage: meson [-h] {setup,configure,dist,install,introspect,init,test,wrap,subprojects,help,rewrite,compile} ...
meson: error: unrecognized arguments: --with-python=NO
==> ERROR: A failure occurred in build().
    Aborting...

trougnouf commented on 2019-06-09 11:53 (UTC)

This might need an update, I think they moved the headers around.