View Issue Details
ID | Project | Category | View Status | Date Submitted | Last Update |
---|---|---|---|---|---|
0002395 | Scribus | Internal | public | 2005-08-08 02:26 | 2005-09-07 21:00 |
Reporter | Assigned To | fschmid | |||
Priority | normal | Severity | major | Reproducibility | always |
Status | closed | Resolution | fixed | ||
Platform | x86 Linux | OS | Fedora Core | OS Version | 3 |
Fixed in Version | 1.3.1cvs | ||||
Summary | 0002395: Portability: Casting between pointer and int | ||||
Description | We cast between pointer and int types in Scribus, it seems. This is unsafe, especially on 64 bit architectures, and it's rather ugly anyway. It also renders Scribus unbuildable with --enable-debug with gcc4 on AMD64. ScribusDoc::FrameItems is the main culprit I've found so far. The first case I ran into was in fileloader.cpp:220: ScText *hl = it->itemText.at(e); if ((hl->ch == QChar(25)) && ((int)hl->cembedded != -1)) hl->cembedded = app->doc->FrameItems.at((int)hl->cembedded); but I suspect this is all over the place. I really don't know how to fix this. I don't even understand the design behind it, or exactly what it's for. | ||||
Tags | No tags attached. | ||||
Patch | |||||
|
Sending this your way franz... I suspect you're the only person likely to know what this does and why. |
|
Correction: Building fails even without --enable-debug or even the default KDE warnings: [craig@wallace scribus]$ g++ -DHAVE_CONFIG_H -I. -I. -I.. -I/usr/include/libart-2.0 -I/usr/include/freetype2 -I/usr/lib64/qt-3.3/include -I/usr/X11R6/include -DDOCDIR=\"/home/craig/scribus/amd64/scribus13cvs_amd64/share/scribus/doc/\" -DICONDIR=\"/home/craig/scribus/amd64/scribus13cvs_amd64/share/scribus/icons/\" -DSAMPLESDIR=\"/home/craig/scribus/amd64/scribus13cvs_amd64/share/scribus/samples/\" -DSCRIPTSDIR=\"/home/craig/scribus/amd64/scribus13cvs_amd64/share/scribus/scripts/\" -DTEMPLATEDIR=\"/home/craig/scribus/amd64/scribus13cvs_amd64/share/scribus/templates/\" -DLIBDIR=\"/home/craig/scribus/amd64/scribus13cvs_amd64/lib/scribus/\" -DPLUGINDIR=\"/home/craig/scribus/amd64/scribus13cvs_amd64/lib/scribus/plugins/\" -DSHAREDIR=\"/home/craig/scribus/amd64/scribus13cvs_amd64/share/scribus/\" -DQT_THREAD_SUPPORT -D_REENTRANT -fno-exceptions -fno-check-new -fno-common -MT fileloader.o -MD -MP -MF ".deps/fileloader.Tpo" -c -o fileloader.o fileloader.cpp fileloader.cpp: In member function ‘bool FileLoader::LoadFile(ScribusApp*)’: fileloader.cpp:220: error: cast from ‘PageItem*’ to ‘int’ loses precision fileloader.cpp:221: error: cast from ‘PageItem*’ to ‘int’ loses precision fileloader.cpp:235: error: cast from ‘PageItem*’ to ‘int’ loses precision fileloader.cpp:236: error: cast from ‘PageItem*’ to ‘int’ loses precision |
|
I know that this is not very portable, but this casting is somewhat needed to get the inline Objects working. Will see if i can find another solution. |
|
OK, inline objects. Am I correct in guessing then that this is to build a "containment graph" - ie what objects are contained within other objects? |
|
Have fixed that now, but this fix makes it impossible that inline Objects can also have inline Objects in them (No big matter given the fact that even Quark can't do that). A bigger drawback is that all older docs using inline Objects aren't working anymore. You have to move all <FRAMEOBJECT> marked items after the last </PAGE> tag by hand with a texteditor to keep them. |
|
That's great. I made a few build fixes and it's now running happily on AMD64 with gcc4 . If we're going to use inline frames for bullets, drop caps, etc as Andreas is talking about, then we'll probably need to be able to support nesting in future. This does the job for now though, and a cleaner data structure can be built to keep track of things when needed. Thanks Franz. |
Date Modified | Username | Field | Change |
---|---|---|---|
2005-08-08 02:26 |
|
New Issue | |
2005-08-08 02:27 |
|
Status | new => assigned |
2005-08-08 02:27 |
|
Assigned To | => fschmid |
2005-08-08 02:28 |
|
Note Added: 0005923 | |
2005-08-08 03:14 |
|
Note Added: 0005924 | |
2005-08-08 05:51 | fschmid | Note Added: 0005925 | |
2005-08-08 05:53 |
|
Note Added: 0005926 | |
2005-08-08 23:05 | fschmid | Note Added: 0005952 | |
2005-08-08 23:06 | fschmid | Note Edited: 0005952 | |
2005-08-08 23:07 | fschmid | Status | assigned => resolved |
2005-08-08 23:07 | fschmid | Fixed in Version | => 1.3.1cvs |
2005-08-08 23:07 | fschmid | Resolution | open => fixed |
2005-08-09 17:11 |
|
Note Added: 0005993 | |
2005-08-09 17:13 |
|
Relationship added | related to 0002098 |
2005-08-09 17:13 |
|
Relationship added | related to 0001099 |
2005-09-07 21:00 | cbradney | Status | resolved => closed |