r17199 by fschmid - Replaced the old non working IDML importer by a new working one.
scribus-commit
scribus-commit at lists.scribus.net
Sat Jan 14 10:15:48 UTC 2012
Author: fschmid
Date: Sat Jan 14 10:15:48 2012
New Revision: 17199
URL: http://scribus.net/websvn/listing.php?repname=Scribus&sc=1&rev=17199
Log:
Replaced the old non working IDML importer by a new working one.
Added:
trunk/Scribus/scribus/plugins/import/idml/CMakeLists.txt
trunk/Scribus/scribus/plugins/import/idml/importidml.cpp
trunk/Scribus/scribus/plugins/import/idml/importidml.h
trunk/Scribus/scribus/plugins/import/idml/importidmlplugin.cpp
trunk/Scribus/scribus/plugins/import/idml/importidmlplugin.h
Modified:
trunk/Scribus/scribus/pageitem_textframe.cpp
trunk/Scribus/scribus/ui/paintmanager.cpp
trunk/Scribus/scribus/util_math.cpp
trunk/Scribus/scribus/util_math.h
Modified: trunk/Scribus/scribus/pageitem_textframe.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=17199&path=/trunk/Scribus/scribus/pageitem_textframe.cpp
==============================================================================
--- trunk/Scribus/scribus/pageitem_textframe.cpp (original)
+++ trunk/Scribus/scribus/pageitem_textframe.cpp Sat Jan 14 10:15:48 2012
@@ -1536,11 +1536,16 @@
chs = (10 * ((DropCapDrop + fontAscent) / realCharAscent));
hl->setEffects(hl->effects() | ScStyle_DropCap);
hl->glyph.yoffset -= DropCapDrop;
+ if ((hl->ch == SpecialChars::OBJECT) && (hl->embedded.hasItem()))
+ {
+ chs = qRound((hl->embedded.getItem()->height() + hl->embedded.getItem()->lineWidth()) * 10);
+ chsd = qRound((hl->embedded.getItem()->height() + hl->embedded.getItem()->lineWidth()) * 10);
+ }
}
else // ! dropCapMode
{
if ((hl->ch == SpecialChars::OBJECT) && (hl->embedded.hasItem()))
- chs = qRound((hl->embedded.getItem()->gHeight + hl->embedded.getItem()->lineWidth()) * 10);
+ chs = qRound((hl->embedded.getItem()->height() + hl->embedded.getItem()->lineWidth()) * 10);
else
chs = charStyle.fontSize();
}
@@ -1560,7 +1565,7 @@
// find out width, ascent and descent of char
if ((hl->ch == SpecialChars::OBJECT) && (hl->embedded.hasItem()))
{
- wide = hl->embedded.getItem()->gWidth + hl->embedded.getItem()->lineWidth();
+ wide = hl->embedded.getItem()->width() + hl->embedded.getItem()->lineWidth();
hl->glyph.xadvance = wide * hl->glyph.scaleH;
}
else
@@ -1580,10 +1585,11 @@
// drop caps are wider...
if ((hl->ch == SpecialChars::OBJECT) && (hl->embedded.hasItem()))
{
- double itemHeight = hl->embedded.getItem()->gHeight + hl->embedded.getItem()->lineWidth();
+ double itemHeight = hl->embedded.getItem()->height() + hl->embedded.getItem()->lineWidth();
if (itemHeight == 0)
itemHeight = charStyle.font().height(style.charStyle().fontSize() / 10.0);
- wide = hl->embedded.getItem()->gWidth + hl->embedded.getItem()->lineWidth();
+ wide = hl->embedded.getItem()->width() + hl->embedded.getItem()->lineWidth();
+ asce = hl->embedded.getItem()->height() + hl->embedded.getItem()->lineWidth();
realAsce = calculateLineSpacing (style, this) * DropLines;
hl->glyph.scaleH /= hl->glyph.scaleV;
hl->glyph.scaleV = (realAsce / itemHeight);
@@ -1623,8 +1629,16 @@
realDesc = charStyle.font().realCharDescent(chstr[0], hlcsize10) * scaleV - offset;
current.rememberShrinkStretch(hl->ch, wide, style);
}
- asce = charStyle.font().ascent(hlcsize10);
- realAsce = charStyle.font().realCharAscent(chstr[0], hlcsize10) * scaleV + offset;
+ if ((hl->ch == SpecialChars::OBJECT) && (hl->embedded.hasItem()))
+ {
+ asce = hl->embedded.getItem()->height() + hl->embedded.getItem()->lineWidth();
+ realAsce = asce * scaleV + offset;
+ }
+ else
+ {
+ asce = charStyle.font().ascent(hlcsize10);
+ realAsce = charStyle.font().realCharAscent(chstr[0], hlcsize10) * scaleV + offset;
+ }
}
//check for Y position at beginning of line
@@ -1936,7 +1950,7 @@
// remember y pos
if (DropCmode)
hl->glyph.yoffset -= charStyle.font().realCharHeight(chstr[0], chsd / 10.0) - charStyle.font().realCharAscent(chstr[0], chsd / 10.0);
-
+
// remember x pos
double breakPos = current.xPos;
Modified: trunk/Scribus/scribus/ui/paintmanager.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=17199&path=/trunk/Scribus/scribus/ui/paintmanager.cpp
==============================================================================
--- trunk/Scribus/scribus/ui/paintmanager.cpp (original)
+++ trunk/Scribus/scribus/ui/paintmanager.cpp Sat Jan 14 10:15:48 2012
@@ -1029,6 +1029,8 @@
}
else if ((it->parent() == colorItems) || (it == colorItems))
{
+ // QStringList allFormatsV = LoadSavePlugin::getExtensionsForColors();
+ // qDebug() << allFormatsV;
QString fileName;
PrefsContext* dirs = PrefsManager::instance()->prefsFile->getContext("dirs");
QString wdir = dirs->get("colors", ".");
Modified: trunk/Scribus/scribus/util_math.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=17199&path=/trunk/Scribus/scribus/util_math.cpp
==============================================================================
--- trunk/Scribus/scribus/util_math.cpp (original)
+++ trunk/Scribus/scribus/util_math.cpp Sat Jan 14 10:15:48 2012
@@ -529,3 +529,16 @@
scX = lineX.length();
scY = lineY.length();
}
+
+void getTransformValuesFromMatrix(QTransform &matrix, double &scX, double &scY, double &rot, double &dx, double &dy)
+{
+ QLineF lineX = QLineF(0.0, 0.0, 1.0, 0.0);
+ QLineF lineY = QLineF(0.0, 0.0, 0.0, 1.0);
+ lineX = matrix.map(lineX);
+ lineY = matrix.map(lineY);
+ scX = lineX.length();
+ scY = lineY.length();
+ rot = lineX.angle();
+ dx = lineX.x1();
+ dy = lineX.y1();
+}
Modified: trunk/Scribus/scribus/util_math.h
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=17199&path=/trunk/Scribus/scribus/util_math.h
==============================================================================
--- trunk/Scribus/scribus/util_math.h (original)
+++ trunk/Scribus/scribus/util_math.h Sat Jan 14 10:15:48 2012
@@ -63,6 +63,7 @@
*/
double SCRIBUS_API getRotationDFromMatrix(QTransform& matrix);
void SCRIBUS_API getScaleFromMatrix(QTransform &matrix, double &scX, double &scY);
+void SCRIBUS_API getTransformValuesFromMatrix(QTransform &matrix, double &scX, double &scY, double &rot, double &dx, double &dy);
// IMPLEMENTATION
More information about the scribus-commit
mailing list