View Issue Details

IDProjectCategoryView StatusLast Update
0002525ScribusGeneralpublic2005-09-12 18:27
Reportermlo Assigned Tomalex  
PrioritynormalSeveritymajorReproducibilityalways
Status closedResolutionfixed 
Platformi386OSDebian GNU/LinuxOS Version2.6.12.4
Product Version1.3.1cvs 
Fixed in Version1.2.3cvs 
Summary0002525: Strange behavior with number 13 (sic!)
DescriptionWhat is wrong with the number 13?

Whenever I enter a parameter, that contains the number 13 or 130 scribus behaves REALLY strange

one example: when I create a textfield and change the width of it i can
make it '129 mm' or '131 mm' but when entering 130 it immediately changes
to '0.353 mm' as soon as I hit return

another one: enter "130" in the rotation field it changes to "12:.00" on return

a third one: x (or y - the same) position of an image within its frame: it goes up to 12, but as soon as it exceeds 13 it goes back to 0 immediately

no idea what causes this, but it is REALLY BAD
it makes working impossible
Steps To Reproducegiven above
Additional InformationQt 3.3.4
TagsNo tags attached.
Patch

Activities

mlo

2005-09-03 15:07

reporter   ~0006369

BTW: its the same with 1.2.2.99 (no other canges)

mlo

2005-09-03 15:36

reporter   ~0006370

another hint:
i tried and changed the unit from mm to in and it still is the number 130 or 13

plinnell

2005-09-03 16:08

viewer   ~0006371

Block is for releases.

mlo

2005-09-03 16:11

reporter   ~0006372

sorry

cbradney

2005-09-03 18:16

administrator   ~0006373

Not here....

fschmid

2005-09-03 22:34

developer   ~0006374

Just tested it, can't confirm here, the 13 or 130 acts as any other number.

fschmid

2005-09-03 22:35

developer   ~0006375

BTW: do you work on Suse 9.3?

2005-09-03 23:20

 

screenshots.tar.gz (1,143,652 bytes)

mlo

2005-09-03 23:23

reporter   ~0006377

No, Debian

the screenshots show (1) I draw some arbitraty frame, (2) I set its width to 129.9 -> nothing happens, (3) I set its width to 130.01 -> nothing happens, (4) I set its width to 130 exact -> Width AND Height are reduced to almost zero

what can I provide to enlighten this strange thing?

~ >ldd `which scribus`
        linux-gate.so.1 => (0xffffe000)
        libart_lgpl_2.so.2 => /usr/lib/libart_lgpl_2.so.2 (0x41b87000)
        libfreetype.so.6 => /usr/lib/libfreetype.so.6 (0x428df000)
        libfontconfig.so.1 => /usr/lib/libfontconfig.so.1 (0x40034000)
        libcups.so.2 => /usr/lib/libcups.so.2 (0x40063000)
        liblcms.so.1 => /usr/lib/liblcms.so.1 (0x4007f000)
        libdl.so.2 => /lib/tls/libdl.so.2 (0x400ae000)
        libtiff.so.4 => /usr/lib/libtiff.so.4 (0x400b2000)
        libjpeg.so.62 => /usr/lib/libjpeg.so.62 (0x40105000)
        libqt-mt.so.3 => /usr/lib/libqt-mt.so.3 (0x40123000)
        libpng12.so.0 => /usr/lib/libpng12.so.0 (0x407de000)
        libz.so.1 => /usr/lib/libz.so.1 (0x41c3f000)
        libXext.so.6 => /usr/X11R6/lib/libXext.so.6 (0x40804000)
        libSM.so.6 => /usr/X11R6/lib/libSM.so.6 (0x40812000)
        libICE.so.6 => /usr/X11R6/lib/libICE.so.6 (0x4081b000)
        libpthread.so.0 => /lib/tls/libpthread.so.0 (0x40832000)
        libX11.so.6 => /usr/X11R6/lib/libX11.so.6 (0x40844000)
        libnsl.so.1 => /lib/tls/libnsl.so.1 (0x4090f000)
        libstdc++.so.6 => /usr/lib/libstdc++.so.6 (0x40926000)
        libm.so.6 => /lib/tls/libm.so.6 (0x40a0c000)
        libc.so.6 => /lib/tls/libc.so.6 (0x40a32000)
        libgcc_s.so.1 => /lib/libgcc_s.so.1 (0x4154b000)
        libexpat.so.1 => /usr/lib/libexpat.so.1 (0x40b6a000)
        libgnutls.so.12 => /usr/lib/libgnutls.so.12 (0x40b8a000)
        /lib/ld-linux.so.2 (0x40000000)
        libaudio.so.2 => /usr/lib/libaudio.so.2 (0x40bf0000)
        libXt.so.6 => /usr/X11R6/lib/libXt.so.6 (0x40c05000)
        libXrender.so.1 => /usr/lib/libXrender.so.1 (0x40c54000)
        libXrandr.so.2 => /usr/X11R6/lib/libXrandr.so.2 (0x40c5c000)
        libXcursor.so.1 => /usr/lib/libXcursor.so.1 (0x40c60000)
        libXinerama.so.1 => /usr/X11R6/lib/libXinerama.so.1 (0x40c6a000)
        libXft.so.2 => /usr/lib/libXft.so.2 (0x40c6d000)
        libtasn1.so.2 => /usr/lib/libtasn1.so.2 (0x41c6a000)
        libgcrypt.so.11 => /usr/lib/libgcrypt.so.11 (0x41ad1000)
        libgpg-error.so.0 => /usr/lib/libgpg-error.so.0 (0x41c95000)

mlo

2005-09-03 23:24

reporter   ~0006378

could it be a Qt bug?

mlo

2005-09-04 00:04

reporter   ~0006379

I just installs scribus on my laptop which basicly has the same setup as my desktop computer but a much cleaner systm as i don't install and upgrad that often on it

i could rebproduce the phenomnon just as describd above

mlo

2005-09-04 00:24

reporter   ~0006380

i played a bit and found out that there are more numbers that leat to this phenomenon: 13, 14, 18, 21, 23, 26, 28, 31, 33, 36, 38, 41, 42, 46, 47, 51, 52, 56, 57, 61, 62, 66, 67, 71, 72, 76, 77, 82, 84, 87, 89, 92, 94, 97, 99, 130, 140, 180, 210 , 230, 260, AND SO ON

mlo

2005-09-04 10:07

reporter   ~0006381

Can you tell me, why I can't debug scribus?
I called configure with --enable-debug=full --program-suffix=_cvs but neither does it compile a binary with the '_cvs' suffix nor does it include debug symbols

cbradney

2005-09-04 10:53

administrator   ~0006385

export CVSROOT=:pserver:anoncvs:@scribus.info:/cvs
cvs login
cvs -z3 co -r Version13x Scribus
cd Scribus
make -f Makefile.cvs
./configure --prefix=/your/install/prefix --enable-debug
make && make install

mlo

2005-09-04 11:20

reporter   ~0006386

I allready have an idea:

int MSpinBox::mapTextToValue(bool *)

when entering a value <> 130 (thats my test case :-)
it goes through the function twice
when entering 130 it does so three times

I have not yet grasped the idea of this FunvtionParser construct

maybe its in there

cbradney

2005-09-04 11:28

administrator   ~0006387

It might be, but why are you the only person to report this in almost 2 years of using the function parser code?

mlo

2005-09-04 11:38

reporter   ~0006388

I have no idea at all

in fparser.cpp line 431 Function.c_str() is called and on the second invocation returns '12:.000'

mlo

2005-09-04 12:40

reporter   ~0006389

in MSpinBox::mapTextToValue(Bool *)

in the end qRound(erg*Decimals) returns 130000, which is correct
but why the hell does it come back with 12:.000 as function string?

mlo

2005-09-04 13:28

reporter   ~0006390

here is the bad guy:

142 QString MSpinBox::mapValueToText(int value)
 143 {
 144 double in = static_cast<double>(value);
 145
 146 in = in / Decimals;
 147
 148 QString text = QString::number(in, 'f', Width);
 149
 150 const char *proof = text.latin1();
 151

at this point - when my input was '130' 'in' correctly is 130 but 'proof' is '12:.000'

 152
 153
 154 return text; //QString::number(static_cast<double>(value) / Decimals, 'f', Width);
 155 }

mlo

2005-09-04 13:49

reporter   ~0006391

not the nice way, but it works

QString MSpinBox::mapValueToText(int value)
{
  double in = static_cast<double>(value);
  char s[Width];
  char form[10] = "";

  sprintf(form,"%%.%df", Width);

  in = in / Decimals;

  sprintf(s, form, in);
  
  // QString text = QString::number(in, 'f', Width);
  QString text = QString(s);
 
  const char *proof = text.latin1();
  
  QString text2 = QString(proof);

  return text; //QString::number(static_cast<double>(value) / Decimals, 'f', Width);
}

2005-09-04 14:12

 

diff (1,324 bytes)   
Index: scribus/mspinbox.cpp
===================================================================
RCS file: /cvsroot/scribus/Scribus/scribus/mspinbox.cpp,v
retrieving revision 1.21
diff -u -r1.21 mspinbox.cpp
--- scribus/mspinbox.cpp	6 Aug 2004 22:01:39 -0000	1.21
+++ scribus/mspinbox.cpp	4 Sep 2005 14:10:29 -0000
@@ -141,7 +141,20 @@
 
 QString MSpinBox::mapValueToText(int value)
 {
-	return QString::number(static_cast<double>(value) / Decimals, 'f', Width);
+  double in = static_cast<double>(value);
+  char s[Width];
+  char form[10] = "";
+  sprintf(form,"%%.%df", Width);
+  in = in / Decimals;
+  sprintf(s, form, in);
+  //  QString text = QString::number(in, 'f', Width);
+  QString text = QString(s);
+ 
+//   const char *proof = text.latin1();
+  
+//   QString text2 = QString(proof);
+
+  return text; //QString::number(static_cast<double>(value) / Decimals, 'f', Width);
 }
 
 /*!
@@ -153,7 +166,7 @@
  \retval The Value
  */
 
-int MSpinBox::mapTextToValue(bool *)
+int MSpinBox::mapTextToValue(bool *ok)
 {
 	FunctionParser fp;
 	QString ts = text();
@@ -197,7 +210,8 @@
 	if (ret >= 0)
 		return 0;
 	double erg = fp.Eval(NULL);
-	return qRound(erg*Decimals);
+	erg = qRound(erg*Decimals);
+	return erg; //qRound(erg*Decimals);
 }
 
 void MSpinBox::setValues(double min, double max, int deci, double val)
diff (1,324 bytes)   

2005-09-05 07:42

 

diff.mlo (1,116 bytes)

mlo

2005-09-05 07:45

reporter   ~0006417

just uploaded a new diff because I made a fatal mistake yesterday which I just found
the Width parameter oly gives the precision AFTER the decimal point...
I thought it would be the total width of the field.
mea culpa

morido

2005-09-06 17:53

reporter   ~0006430

In a "worst case scenario" this weird number thing can even produce corrupt PDF-Files (acroread says something like "Wrong Number Format: 12:.000").

malex

2005-09-06 19:25

administrator   ~0006432

I'm seeing it on my Debian/sid system. If I start going up from 1.00 pt I see:

In 1.2.99cvs:

1.00 pt through 12.00 pt, then it goes either to 1.00 pt again, or to 12.:0 pt, 13.:0 pt, 15.00 pt, 16.00 pt, 17.00 pt, 17.:0 pt, 19.00 pt, 20.00 pt, 20.:0 pt, 22.00 pt, 22.:0 pt, 24.00 pt, 25.00 pt, 25.:0 pt, 27.00 pt, 27.:0 pt, 29.00 pt,30.00 pt, 30.:0 pt, 30.:0 pt, 32.00 pt, 32.:0 pt, 34.00 pt, 35.00 pt, 35.:0 pt, 37.00 pt, 37.:0 pt, 39.00 pt, 40.00 pt, 40.:0 pt, 41.:0 pt, 43.00 pt, 44.00 pt, 45.00 pt, 45.:0 pt, 46.:0 pt, 48.00 pt, 49.00 pt, 50.00 pt, 50.:0 pt, 51.:0 pt, 53.00 pt, 54.00 pt, 55.00 pt, 55.:0 pt, 56.:0 pt, 58.00 pt, 59.00 pt, 60.00 pt, 60.:0 pt, 61.:0 pt, and so on.

It's prone to switching to 1.00 pt instead of going to one of those weird .:x pt numbers, too.

mlo

2005-09-06 21:50

reporter   ~0006434

I am going mad....
as morido said: scribus is producing corrupt PDFs

I am about to blame Qt for this
I will try and compile me a 3.3.5 snapshot and see if this fixes it.
otherwise I really have a problem: I must give a good and nice PDF to the printer thursday morning latest. and at the moment I can't even produce a clean PDF for myself

mlo

2005-09-06 23:37

reporter   ~0006439

I am happy - yea so happy!

it WAS Qt
took me some time to get the 3.3.5 snapshot working but it fixed all my problems
at least it seems so
it's 1:30AM and i ought to get up at 6 so i won't test it further now
i hope it'll work

ceers
mlo

fschmid

2005-09-06 23:45

developer   ~0006440

And maybe it wasn't only Qt it might be well the case that the Debian system is to blame too, as we never had any issue in the past years with that on Suse, Redhat or Gentoo to name a few.

cbradney

2005-09-07 00:03

administrator   ~0006441

Maybe theres a Qt patch in Debian thats breaking this.

malex

2005-09-07 14:18

administrator   ~0006446

This should be fixed in the next upload of qt3 packages into Debian Unstable. This issue is related to the transition to GCC 4.0. See http://lists.alioth.debian.org/pipermail/pkg-kde-commits/2005-September/001484.html for some details.

malex

2005-09-07 14:22

administrator   ~0006447

Install fixed qt3 packages from http://people.debian.org/~adeodato/tmp/2005-09-07/fixed-qt/ and new scribus and scribus-cvs packages from our repositories. You can temporarily add "deb http://people.debian.org/~adeodato/tmp/2005-09-07/fixed-qt ./" to your /etc/apt/sources.list then remove it once the fixed qt3 packages are in sid.

malex

2005-09-07 14:23

administrator   ~0006448

See my last note.

malex

2005-09-12 18:27

administrator   ~0006528

New qt3 packages are in Debian unstable.

Issue History

Date Modified Username Field Change
2005-09-03 14:50 mlo New Issue
2005-09-03 15:07 mlo Note Added: 0006369
2005-09-03 15:36 mlo Note Added: 0006370
2005-09-03 16:08 plinnell Note Added: 0006371
2005-09-03 16:08 plinnell Severity block => major
2005-09-03 16:11 mlo Note Added: 0006372
2005-09-03 18:16 cbradney Note Added: 0006373
2005-09-03 22:34 fschmid Note Added: 0006374
2005-09-03 22:35 fschmid Note Added: 0006375
2005-09-03 23:20 mlo File Added: screenshots.tar.gz
2005-09-03 23:23 mlo Note Added: 0006377
2005-09-03 23:24 mlo Note Added: 0006378
2005-09-04 00:04 mlo Note Added: 0006379
2005-09-04 00:24 mlo Note Added: 0006380
2005-09-04 10:07 mlo Note Added: 0006381
2005-09-04 10:53 cbradney Note Added: 0006385
2005-09-04 11:20 mlo Note Added: 0006386
2005-09-04 11:28 cbradney Note Added: 0006387
2005-09-04 11:38 mlo Note Added: 0006388
2005-09-04 12:40 mlo Note Added: 0006389
2005-09-04 13:28 mlo Note Added: 0006390
2005-09-04 13:49 mlo Note Added: 0006391
2005-09-04 14:12 mlo File Added: diff
2005-09-05 07:42 mlo File Added: diff.mlo
2005-09-05 07:45 mlo Note Added: 0006417
2005-09-06 17:53 morido Note Added: 0006430
2005-09-06 19:25 malex Note Added: 0006432
2005-09-06 21:50 mlo Note Added: 0006434
2005-09-06 23:37 mlo Note Added: 0006439
2005-09-06 23:45 fschmid Note Added: 0006440
2005-09-07 00:03 cbradney Note Added: 0006441
2005-09-07 14:18 malex Note Added: 0006446
2005-09-07 14:22 malex Note Added: 0006447
2005-09-07 14:23 malex Status new => resolved
2005-09-07 14:23 malex Resolution open => fixed
2005-09-07 14:23 malex Assigned To => malex
2005-09-07 14:23 malex Note Added: 0006448
2005-09-12 18:27 malex Status resolved => closed
2005-09-12 18:27 malex Note Added: 0006528
2005-09-12 18:27 malex Fixed in Version => 1.2.3cvs