r16614 by jghali - merge trunk revisions up to r16612
scribus-commit
scribus-commit at lists.scribus.net
Sun May 8 17:42:57 UTC 2011
Author: jghali
Date: Sun May 8 17:42:57 2011
New Revision: 16614
URL: http://scribus.info/websvn/listing.php?repname=Scribus&sc=1&rev=16614
Log:
merge trunk revisions up to r16612
Added:
branches/ScribusOIF/scribus/tests/
- copied from r16612, trunk/Scribus/scribus/tests/
Modified:
branches/ScribusOIF/config.h.cmake
branches/ScribusOIF/scribus/CMakeLists.txt
branches/ScribusOIF/scribus/pageitem.cpp
branches/ScribusOIF/scribus/pageitem.h
branches/ScribusOIF/scribus/pageitem_textframe.cpp
branches/ScribusOIF/scribus/pdflib_core.cpp
branches/ScribusOIF/scribus/plugins/fileloader/scribus12format/scribus12format.cpp
branches/ScribusOIF/scribus/plugins/fileloader/scribus134format/scribus134format.cpp
branches/ScribusOIF/scribus/plugins/fileloader/scribus13format/scribus13format.cpp
branches/ScribusOIF/scribus/plugins/fileloader/scribus150format/scribus150format.cpp
branches/ScribusOIF/scribus/plugins/import/ai/importai.cpp
branches/ScribusOIF/scribus/plugins/scripter/python/autoload/fullscreen.spy
branches/ScribusOIF/scribus/plugins/scripter/python/autoload/runfile.spy
branches/ScribusOIF/scribus/plugins/scripter/python/autoload/sceditor.spy
branches/ScribusOIF/scribus/plugins/scripter/python/scribusscript.py
branches/ScribusOIF/scribus/plugins/svgexplugin/svgexplugin.cpp
branches/ScribusOIF/scribus/plugins/tools/spellcheck/aspellplugin.cpp
branches/ScribusOIF/scribus/plugins/tools/spellcheck/aspellpluginimpl.cpp
branches/ScribusOIF/scribus/pslib.cpp
branches/ScribusOIF/scribus/scpageoutput.cpp
branches/ScribusOIF/scribus/scribus.cpp
branches/ScribusOIF/scribus/scribusapp.cpp
branches/ScribusOIF/scribus/scribusdoc.cpp
branches/ScribusOIF/scribus/scribusdoc.h
branches/ScribusOIF/scribus/sctextstruct.cpp
branches/ScribusOIF/scribus/sctextstruct.h
branches/ScribusOIF/scribus/text/storytext.cpp
branches/ScribusOIF/scribus/text/storytext.h
branches/ScribusOIF/scribus/ui/about.cpp
branches/ScribusOIF/scribus/ui/prefs_guides.cpp
branches/ScribusOIF/scribus/ui/propertywidget_textcolor.cpp
branches/ScribusOIF/scribus/ui/scdockpalette.cpp
branches/ScribusOIF/scribus/ui/smlinestyle.cpp
branches/ScribusOIF/scribus/ui/smtextstyles.cpp
branches/ScribusOIF/scribus/util.cpp
branches/ScribusOIF/scribus/util.h
Modified: branches/ScribusOIF/config.h.cmake
URL: http://scribus.info/websvn/diff.php?repname=Scribus&rev=16614&path=/branches/ScribusOIF/config.h.cmake
==============================================================================
--- branches/ScribusOIF/config.h.cmake (original)
+++ branches/ScribusOIF/config.h.cmake Sun May 8 17:42:57 2011
@@ -38,3 +38,4 @@
#cmakedefine COMPILE_PYTHON 1
#cmakedefine WORDS_BIGENDIAN 1
#cmakedefine GMAGICK_FOUND 1
+#cmakedefine WITH_TESTS 1
Modified: branches/ScribusOIF/scribus/CMakeLists.txt
URL: http://scribus.info/websvn/diff.php?repname=Scribus&rev=16614&path=/branches/ScribusOIF/scribus/CMakeLists.txt
==============================================================================
--- branches/ScribusOIF/scribus/CMakeLists.txt (original)
+++ branches/ScribusOIF/scribus/CMakeLists.txt Sun May 8 17:42:57 2011
@@ -9,6 +9,9 @@
ADD_SUBDIRECTORY(fonts)
ADD_SUBDIRECTORY(styles)
ADD_SUBDIRECTORY(text)
+IF(WITH_TESTS)
+ ADD_SUBDIRECTORY(tests)
+ENDIF(WITH_TESTS)
ADD_SUBDIRECTORY(unicodemap)
IF (WANT_DESIGNER)
ADD_SUBDIRECTORY(designer)
@@ -893,6 +896,10 @@
${CMAKE_CURRENT_BINARY_DIR}/third_party/pgf
)
+IF(WITH_TESTS)
+ LINK_DIRECTORIES( ${CMAKE_CURRENT_BINARY_DIR}/tests )
+ENDIF(WITH_TESTS)
+
IF(HAVE_OSG)
LINK_DIRECTORIES( ${CMAKE_CURRENT_BINARY_DIR}/third_party/prc )
ENDIF (HAVE_OSG)
@@ -903,6 +910,11 @@
SET(SCRIBUS_COLORMGMT_LIB "scribus_colormgmt_lib")
SET(SCRIBUS_TEXT_LIB "scribus_text_lib")
+IF(WITH_TESTS)
+ SET(SCRIBUS_TESTS_LIB "scribus_tests_lib")
+ELSE(WITH_TESTS)
+ SET(SCRIBUS_TESTS_LIB "")
+ENDIF(WITH_TESTS)
SET(SCRIBUS_STYLES_LIB "scribus_styles_lib")
SET(SCRIBUS_FONTS_LIB "scribus_fonts_lib")
SET(SCRIBUS_DESAXE_LIB "scribus_desaxe_lib")
@@ -1091,6 +1103,13 @@
${LCMS_LIBRARIES}
)
+IF(WITH_TESTS)
+ TARGET_LINK_LIBRARIES(${EXE_NAME}
+ ${QT_QTTEST_LIBRARY}
+ ${SCRIBUS_TESTS_LIB}
+ )
+ENDIF(WITH_TESTS)
+
IF(HAVE_PODOFO)
TARGET_LINK_LIBRARIES(${EXE_NAME}
${LIBPODOFO_LIBRARY}
Modified: branches/ScribusOIF/scribus/pageitem.cpp
URL: http://scribus.info/websvn/diff.php?repname=Scribus&rev=16614&path=/branches/ScribusOIF/scribus/pageitem.cpp
==============================================================================
--- branches/ScribusOIF/scribus/pageitem.cpp (original)
+++ branches/ScribusOIF/scribus/pageitem.cpp Sun May 8 17:42:57 2011
@@ -1046,6 +1046,12 @@
void PageItem::setReversed(bool newReversed)
{
+ if (UndoManager::undoEnabled())
+ {
+ SimpleState *ss = new SimpleState(Um::FlipH, 0, Um::IFlipH);
+ ss->set("REVERSE_TEXT", "REVERSE_TEXT");
+ undoManager->action(this, ss);
+ }
Reverse=newReversed;
}
@@ -1081,6 +1087,18 @@
//#endif
}
+bool PageItem::testLinkCandidate(PageItem* nxt)
+{
+ if (this->nextInChain() )
+ return false;
+ if (nxt->prevInChain() )
+ return false;
+ for (PageItem* ff=nxt; ff; ff=ff->nextInChain())
+ {
+ if (ff == this) return false;
+ }
+ return true;
+}
void PageItem::link(PageItem* nxt)
{
@@ -5141,8 +5159,8 @@
{
*x1 = Xpos;
*y1 = Ypos;
- *x2 = Xpos + qMax(Width, m_lineWidth);
- *y2 = Ypos + qMax(Height, m_lineWidth);
+ *x2 = Xpos + qMax(1.0, qMax(Width, m_lineWidth));
+ *y2 = Ypos + qMax(1.0, qMax(Height, m_lineWidth));
}
QRectF totalRect = QRectF(QPointF(*x1, *y1), QPointF(*x2, *y2));
if (m_startArrowIndex != 0)
Modified: branches/ScribusOIF/scribus/pageitem.h
URL: http://scribus.info/websvn/diff.php?repname=Scribus&rev=16614&path=/branches/ScribusOIF/scribus/pageitem.h
==============================================================================
--- branches/ScribusOIF/scribus/pageitem.h (original)
+++ branches/ScribusOIF/scribus/pageitem.h Sun May 8 17:42:57 2011
@@ -521,6 +521,8 @@
PageItem* nextInChain() { return NextBox; }
const PageItem* prevInChain() const { return BackBox; }
const PageItem* nextInChain() const { return NextBox; }
+
+ bool testLinkCandidate(PageItem* nextFrame);
void unlink();
void link(PageItem* nextFrame);
void dropLinks();
Modified: branches/ScribusOIF/scribus/pageitem_textframe.cpp
URL: http://scribus.info/websvn/diff.php?repname=Scribus&rev=16614&path=/branches/ScribusOIF/scribus/pageitem_textframe.cpp
==============================================================================
--- branches/ScribusOIF/scribus/pageitem_textframe.cpp (original)
+++ branches/ScribusOIF/scribus/pageitem_textframe.cpp Sun May 8 17:42:57 2011
@@ -409,7 +409,7 @@
asce = charStyleS.font().ascent(charStyleS.fontSize() / 10.0);
wide = hls->glyph.wide();
QRectF scr;
- if (hls->ch == SpecialChars::OBJECT)
+ if ((hls->ch == SpecialChars::OBJECT) && (hls->embedded.hasItem()))
{
double ww = (hls->embedded.getItem()->gWidth + hls->embedded.getItem()->lineWidth()) * hls->glyph.scaleH;
double hh = (hls->embedded.getItem()->gHeight + hls->embedded.getItem()->lineWidth()) * hls->glyph.scaleV;
@@ -423,7 +423,7 @@
}
}
// Unneeded now that glyph xadvance is set appropriately for inline objects by layout() - JG
- /*if (hls->ch == SpecialChars::OBJECT)
+ /*if ((hls->ch == SpecialChars::OBJECT) && (hls->embedded.hasItem()))
selX += (hls->embedded.getItem()->gWidth + hls->embedded.getItem()->lineWidth()) * hls->glyph.scaleH;
else*/
selX += hls->glyph.wide();
@@ -521,14 +521,14 @@
{
p->save();//SA4
p->translate(CurX, ls.y);
- if (hl->ch == SpecialChars::OBJECT)
+ if ((hl->ch == SpecialChars::OBJECT) && (hl->embedded.hasItem()))
DrawObj_Embedded(p, cullingArea, charStyle, hl->embedded.getItem());
else
drawGlyphs(p, charStyle, hl->glyph);
p->restore();//RE4
}
// Unneeded now that glyph xadvance is set appropriately for inline objects by layout() - JG
- /*if (hl->ch == SpecialChars::OBJECT)
+ /*if ((hl->ch == SpecialChars::OBJECT) && (hl->embedded.hasItem()))
CurX += (hl->embedded.getItem()->gWidth + hl->embedded.getItem()->lineWidth()) * hl->glyph.scaleH;
else*/
CurX += hl->glyph.wide();
Modified: branches/ScribusOIF/scribus/pdflib_core.cpp
URL: http://scribus.info/websvn/diff.php?repname=Scribus&rev=16614&path=/branches/ScribusOIF/scribus/pdflib_core.cpp
==============================================================================
--- branches/ScribusOIF/scribus/pdflib_core.cpp (original)
+++ branches/ScribusOIF/scribus/pdflib_core.cpp Sun May 8 17:42:57 2011
@@ -5052,7 +5052,7 @@
}
*/
InlineFrame& embedded(const_cast<InlineFrame&>(hl->embedded));
- if ((hl->ch == SpecialChars::OBJECT) && (embedded.hasItem()))
+ if (hl->hasObject())
{
if (!ite->asPathText())
{
Modified: branches/ScribusOIF/scribus/plugins/fileloader/scribus12format/scribus12format.cpp
URL: http://scribus.info/websvn/diff.php?repname=Scribus&rev=16614&path=/branches/ScribusOIF/scribus/plugins/fileloader/scribus12format/scribus12format.cpp
==============================================================================
--- branches/ScribusOIF/scribus/plugins/fileloader/scribus12format/scribus12format.cpp (original)
+++ branches/ScribusOIF/scribus/plugins/fileloader/scribus12format/scribus12format.cpp Sun May 8 17:42:57 2011
@@ -1245,7 +1245,7 @@
PageItem *Itn = m_Doc->Items->at(itemRemap[lc.value()]);
assert(Its && Its->asTextFrame());
assert(Itn && Itn->asTextFrame());
- if (Itn->prevInChain() || Its->nextInChain())
+ if (!Its->testLinkCandidate(Itn))
{
qDebug("scribus12format: corruption in linked textframes detected");
continue;
@@ -1988,7 +1988,7 @@
PageItem *Itn = m_Doc->Items->at(itemRemap[lc.value()]);
assert(Its && Its->asTextFrame());
assert(Itn && Itn->asTextFrame());
- if (Itn->prevInChain() || Its->nextInChain())
+ if (!Its->testLinkCandidate(Itn))
{
qDebug("scribus12format: corruption in linked textframes detected");
continue;
Modified: branches/ScribusOIF/scribus/plugins/fileloader/scribus134format/scribus134format.cpp
URL: http://scribus.info/websvn/diff.php?repname=Scribus&rev=16614&path=/branches/ScribusOIF/scribus/plugins/fileloader/scribus134format/scribus134format.cpp
==============================================================================
--- branches/ScribusOIF/scribus/plugins/fileloader/scribus134format/scribus134format.cpp (original)
+++ branches/ScribusOIF/scribus/plugins/fileloader/scribus134format/scribus134format.cpp Sun May 8 17:42:57 2011
@@ -594,7 +594,7 @@
{
PageItem * Its = m_Doc->DocItems.at(lc.key());
PageItem * Itn = m_Doc->DocItems.at(lc.value());
- if (Itn->prevInChain() || Its->nextInChain())
+ if (!Its->testLinkCandidate(Itn))
{
qDebug() << "scribus134format: corruption in linked textframes detected";
continue;
@@ -613,7 +613,7 @@
{
PageItem * Its = m_Doc->MasterItems.at(lc.key());
PageItem * Itn = m_Doc->MasterItems.at(lc.value());
- if (Itn->prevInChain() || Its->nextInChain())
+ if (!Its->testLinkCandidate(Itn))
{
qDebug() << "scribus134format: corruption in linked textframes detected";
continue;
@@ -3521,7 +3521,7 @@
{
PageItem * Its = m_Doc->DocItems.at(lc.key());
PageItem * Itn = m_Doc->DocItems.at(itemRemap[lc.value()]);
- if (Itn->prevInChain() || Its->nextInChain())
+ if (!Its->testLinkCandidate(Itn))
{
qDebug() << "scribus134format: corruption in linked textframes detected";
continue;
@@ -3542,7 +3542,7 @@
{
PageItem * Its = m_Doc->MasterItems.at(lc.key());
PageItem * Itn = m_Doc->MasterItems.at(itemRemapM[lc.value()]);
- if (Itn->prevInChain() || Its->nextInChain())
+ if (!Its->testLinkCandidate(Itn))
{
qDebug() << "scribus134format: corruption in linked textframes detected";
continue;
Modified: branches/ScribusOIF/scribus/plugins/fileloader/scribus13format/scribus13format.cpp
URL: http://scribus.info/websvn/diff.php?repname=Scribus&rev=16614&path=/branches/ScribusOIF/scribus/plugins/fileloader/scribus13format/scribus13format.cpp
==============================================================================
--- branches/ScribusOIF/scribus/plugins/fileloader/scribus13format/scribus13format.cpp (original)
+++ branches/ScribusOIF/scribus/plugins/fileloader/scribus13format/scribus13format.cpp Sun May 8 17:42:57 2011
@@ -1069,7 +1069,7 @@
{
PageItem * Its = m_Doc->Items->at(lc.key());
PageItem * Itn = m_Doc->Items->at(itemRemap[lc.value()]);
- if (Itn->prevInChain() || Its->nextInChain())
+ if (!Its->testLinkCandidate(Itn))
{
qDebug("scribus13format: corruption in linked textframes detected");
continue;
@@ -2461,7 +2461,7 @@
{
PageItem * Its = m_Doc->Items->at(lc.key());
PageItem * Itn = m_Doc->Items->at(itemRemap[lc.value()]);
- if (Itn->prevInChain() || Its->nextInChain())
+ if (!Its->testLinkCandidate(Itn))
{
qDebug("scribus13format: corruption in linked textframes detected");
continue;
Modified: branches/ScribusOIF/scribus/plugins/fileloader/scribus150format/scribus150format.cpp
URL: http://scribus.info/websvn/diff.php?repname=Scribus&rev=16614&path=/branches/ScribusOIF/scribus/plugins/fileloader/scribus150format/scribus150format.cpp
==============================================================================
--- branches/ScribusOIF/scribus/plugins/fileloader/scribus150format/scribus150format.cpp (original)
+++ branches/ScribusOIF/scribus/plugins/fileloader/scribus150format/scribus150format.cpp Sun May 8 17:42:57 2011
@@ -428,7 +428,7 @@
{
PageItem * Its = m_Doc->DocItems.at(lc.key());
PageItem * Itn = m_Doc->DocItems.at(lc.value());
- if (Itn->prevInChain() || Its->nextInChain())
+ if (!Its->testLinkCandidate(Itn))
{
qDebug() << "scribus150format: corruption in linked textframes detected";
continue;
@@ -802,7 +802,7 @@
{
PageItem * Its = m_Doc->DocItems.at(lc.key());
PageItem * Itn = m_Doc->DocItems.at(lc.value());
- if (Itn->prevInChain() || Its->nextInChain())
+ if (!Its->testLinkCandidate(Itn))
{
qDebug() << "scribus150format: corruption in linked textframes detected";
continue;
@@ -820,7 +820,7 @@
{
PageItem * Its = m_Doc->MasterItems.at(lc.key());
PageItem * Itn = m_Doc->MasterItems.at(lc.value());
- if (Itn->prevInChain() || Its->nextInChain())
+ if (!Its->testLinkCandidate(Itn))
{
qDebug() << "scribus150format: corruption in linked textframes detected";
continue;
@@ -1346,7 +1346,7 @@
{
PageItem * Its = m_Doc->DocItems.at(lc.key());
PageItem * Itn = m_Doc->DocItems.at(lc.value());
- if (Itn->prevInChain() || Its->nextInChain())
+ if (!Its->testLinkCandidate(Itn))
{
qDebug() << "scribus150format: corruption in linked textframes detected";
continue;
@@ -1364,7 +1364,7 @@
{
PageItem * Its = m_Doc->MasterItems.at(lc.key());
PageItem * Itn = m_Doc->MasterItems.at(lc.value());
- if (Itn->prevInChain() || Its->nextInChain())
+ if (!Its->testLinkCandidate(Itn))
{
qDebug() << "scribus150format: corruption in linked textframes detected";
continue;
@@ -4295,7 +4295,7 @@
{
PageItem * Its = m_Doc->DocItems.at(lc.key());
PageItem * Itn = m_Doc->DocItems.at(itemRemap[lc.value()]);
- if (Itn->prevInChain() || Its->nextInChain())
+ if (!Its->testLinkCandidate(Itn))
{
qDebug() << "scribus150format: corruption in linked textframes detected";
continue;
@@ -4316,7 +4316,7 @@
{
PageItem * Its = m_Doc->MasterItems.at(lc.key());
PageItem * Itn = m_Doc->MasterItems.at(itemRemapM[lc.value()]);
- if (Itn->prevInChain() || Its->nextInChain())
+ if (!Its->testLinkCandidate(Itn))
{
qDebug() << "scribus150format: corruption in linked textframes detected";
continue;
Modified: branches/ScribusOIF/scribus/plugins/import/ai/importai.cpp
URL: http://scribus.info/websvn/diff.php?repname=Scribus&rev=16614&path=/branches/ScribusOIF/scribus/plugins/import/ai/importai.cpp
==============================================================================
--- branches/ScribusOIF/scribus/plugins/import/ai/importai.cpp (original)
+++ branches/ScribusOIF/scribus/plugins/import/ai/importai.cpp Sun May 8 17:42:57 2011
@@ -2981,6 +2981,7 @@
ite->setLineJoin(JoinStyle);
uchar *p;
uint yCount = 0;
+ quint16 eTag = EXTRASAMPLE_UNASSALPHA;
ite->tempImageFile = new QTemporaryFile(QDir::tempPath() + "/scribus_temp_ai_XXXXXX.tif");
ite->tempImageFile->open();
QString imgName = getLongPathName(ite->tempImageFile->fileName());
@@ -2993,6 +2994,8 @@
TIFFSetField(tif, TIFFTAG_IMAGELENGTH, h);
TIFFSetField(tif, TIFFTAG_BITSPERSAMPLE, 8);
TIFFSetField(tif, TIFFTAG_SAMPLESPERPIXEL, m_image.channels());
+ if (alpha == 1)
+ TIFFSetField(tif, TIFFTAG_EXTRASAMPLES, 1, &eTag);
TIFFSetField(tif, TIFFTAG_PLANARCONFIG, PLANARCONFIG_CONTIG);
if (type == 4)
TIFFSetField(tif, TIFFTAG_PHOTOMETRIC, PHOTOMETRIC_SEPARATED);
Modified: branches/ScribusOIF/scribus/plugins/scripter/python/autoload/fullscreen.spy
URL: http://scribus.info/websvn/diff.php?repname=Scribus&rev=16614&path=/branches/ScribusOIF/scribus/plugins/scripter/python/autoload/fullscreen.spy
==============================================================================
--- branches/ScribusOIF/scribus/plugins/scripter/python/autoload/fullscreen.spy (original)
+++ branches/ScribusOIF/scribus/plugins/scripter/python/autoload/fullscreen.spy Sun May 8 17:42:57 2011
@@ -1,6 +1,6 @@
## name = fullscreen
## title = Toggle fullscreen
-## shortcut = Esc, f
+## shortcut = Ctrl+r,f
mainWin = Scripter.dialogs.mainWindow
if mainWin.fullScreen:
Modified: branches/ScribusOIF/scribus/plugins/scripter/python/autoload/runfile.spy
URL: http://scribus.info/websvn/diff.php?repname=Scribus&rev=16614&path=/branches/ScribusOIF/scribus/plugins/scripter/python/autoload/runfile.spy
==============================================================================
--- branches/ScribusOIF/scribus/plugins/scripter/python/autoload/runfile.spy (original)
+++ branches/ScribusOIF/scribus/plugins/scripter/python/autoload/runfile.spy Sun May 8 17:42:57 2011
@@ -1,5 +1,6 @@
## title = &Run script from file
-## shortcut = Esc,r
+## shortcut = Esc,t
+## shortcut = Ctrl+r,t
## subroutine = run
import os
from PyQt4.QtCore import *
Modified: branches/ScribusOIF/scribus/plugins/scripter/python/autoload/sceditor.spy
URL: http://scribus.info/websvn/diff.php?repname=Scribus&rev=16614&path=/branches/ScribusOIF/scribus/plugins/scripter/python/autoload/sceditor.spy
==============================================================================
--- branches/ScribusOIF/scribus/plugins/scripter/python/autoload/sceditor.spy (original)
+++ branches/ScribusOIF/scribus/plugins/scripter/python/autoload/sceditor.spy Sun May 8 17:42:57 2011
@@ -1,5 +1,5 @@
## title = Script &Editor and Console
-## shortcut = Esc,e
+## shortcut = Ctrl+r,e
import sceditor
sceditor.launch(Scripter.dialogs.mainWindow.qt)
Modified: branches/ScribusOIF/scribus/plugins/scripter/python/scribusscript.py
URL: http://scribus.info/websvn/diff.php?repname=Scribus&rev=16614&path=/branches/ScribusOIF/scribus/plugins/scripter/python/scribusscript.py
==============================================================================
--- branches/ScribusOIF/scribus/plugins/scripter/python/scribusscript.py (original)
+++ branches/ScribusOIF/scribus/plugins/scripter/python/scribusscript.py Sun May 8 17:42:57 2011
@@ -190,6 +190,7 @@
else:
print >> sys.stderr, "Icon %r not found" % icon_filename
if self.shortcut:
+ print >> sys.stdout, "Shortcut %r." % self.shortcut
self.action.setShortcut(QKeySequence(self.shortcut))
Modified: branches/ScribusOIF/scribus/plugins/svgexplugin/svgexplugin.cpp
URL: http://scribus.info/websvn/diff.php?repname=Scribus&rev=16614&path=/branches/ScribusOIF/scribus/plugins/svgexplugin/svgexplugin.cpp
==============================================================================
--- branches/ScribusOIF/scribus/plugins/svgexplugin/svgexplugin.cpp (original)
+++ branches/ScribusOIF/scribus/plugins/svgexplugin/svgexplugin.cpp Sun May 8 17:42:57 2011
@@ -791,7 +791,7 @@
sca.translate(Item->xPos(), Item->yPos());
finalMat *= sca;
}
- if ((hl->ch == SpecialChars::OBJECT) && (hl->embedded.hasItem()))
+ if (hl->hasObject())
{
ob.appendChild(processInlineItem(CurX + hl->glyph.xoffset, ls.y + hl->glyph.yoffset, finalMat, hl, false, trans));
InlineFrame& embedded(const_cast<InlineFrame&>(hl->embedded));
@@ -1026,7 +1026,7 @@
else
trafo *= QTransform( a, 6 * b, 0, -1, hl->PtransX, hl->PtransY );
}
- if ((hl->ch == SpecialChars::OBJECT) && (hl->embedded.hasItem()))
+ if (hl->hasObject())
{
QTransform finalMat = chma * chma2 * chma3 * chma4 * chma6 * trafo;
ob.appendChild(processInlineItem(0, 0, finalMat, hl, true, trans));
Modified: branches/ScribusOIF/scribus/plugins/tools/spellcheck/aspellplugin.cpp
URL: http://scribus.info/websvn/diff.php?repname=Scribus&rev=16614&path=/branches/ScribusOIF/scribus/plugins/tools/spellcheck/aspellplugin.cpp
==============================================================================
--- branches/ScribusOIF/scribus/plugins/tools/spellcheck/aspellplugin.cpp (original)
+++ branches/ScribusOIF/scribus/plugins/tools/spellcheck/aspellplugin.cpp Sun May 8 17:42:57 2011
@@ -87,19 +87,19 @@
bool AspellPlugin::run(ScribusDoc* doc, QString target)
{
- AspellPluginImpl *myPluginImpl = new AspellPluginImpl( doc );
- Q_CHECK_PTR(myPluginImpl);
+ AspellPluginImpl *aspellPluginImpl = new AspellPluginImpl( doc );
+ Q_CHECK_PTR(aspellPluginImpl);
// The spellcheck is disabled when there are no available
// dictionaries.
- if (myPluginImpl->errorMessage().isEmpty())
- myPluginImpl->exec();
+ if (aspellPluginImpl->errorMessage().isEmpty())
+ aspellPluginImpl->exec();
else
{
doc->scMW()->scrActions[m_actionInfo.name]->setEnabled(false);
doc->scMW()->scrActions[m_actionInfo.name]->setVisible(false);
- QMessageBox::warning(doc->scMW(), tr("Aspell Plugin Error"), myPluginImpl->errorMessage());
+ QMessageBox::warning(doc->scMW(), tr("Aspell Plugin Error"), aspellPluginImpl->errorMessage());
}
- delete myPluginImpl;
+ delete aspellPluginImpl;
return true;
}
Modified: branches/ScribusOIF/scribus/plugins/tools/spellcheck/aspellpluginimpl.cpp
URL: http://scribus.info/websvn/diff.php?repname=Scribus&rev=16614&path=/branches/ScribusOIF/scribus/plugins/tools/spellcheck/aspellpluginimpl.cpp
==============================================================================
--- branches/ScribusOIF/scribus/plugins/tools/spellcheck/aspellpluginimpl.cpp (original)
+++ branches/ScribusOIF/scribus/plugins/tools/spellcheck/aspellpluginimpl.cpp Sun May 8 17:42:57 2011
@@ -16,6 +16,7 @@
#include "text/specialchars.h"
#include "util.h"
+#include <QDebug>
#include <QMessageBox>
#include <QProgressBar>
@@ -29,6 +30,7 @@
// Initialize members here, if any
AspellPluginImpl::AspellPluginImpl(ScribusDoc* doc, QWidget* parent) :
QDialog( parent ),
+ fsuggest(0),
fdoc( doc ),
m_docIsChanged(false),
fpos(0),
@@ -45,6 +47,7 @@
getPreferences();
QString text = tr( "Loaded " ) + (fentry == kDEF_ASPELL_ENTRY ? tr( "default " ) : "") + fentry + tr( " Aspell dictionary." );
doc->scMW()->setStatusBarInfoText( text );
+ bool dictCount=0;
try
{
// Deactivate GUI elements in spell-checking tab until an
@@ -59,65 +62,85 @@
// Get list of available aspell dictionaries
std::vector<std::string> entries;
fsuggest->listDicts( entries );
- for( std::vector<std::string>::const_iterator i = entries.begin(); i != entries.end(); ++i )
- {
- // FIXME: Handle encodings other than UTF-8.
- flistDicts->addItem(i->c_str());
-// qDebug() << i->c_str();
+ dictCount=entries.size();
+ if (!entries.empty())
+ {
+ //qDebug()<<"Listing dictionaries";
+ for( std::vector<std::string>::const_iterator i = entries.begin(); i != entries.end(); ++i )
+ {
+ // FIXME: Handle encodings other than UTF-8.
+ flistDicts->addItem(i->c_str());
+// qDebug() << i->c_str();
+ }
}
// check the availability of any dict. If == 0 then the plugin
// is disabled in all GUI.
- if (flistDicts->count() == 0)
+ if (entries.empty() || flistDicts->count() == 0)
+ {
+ //qDebug() << "Dictionaries found:"<<flistDicts->count();
m_errorMessage = tr("No available Aspell dictionaries found. Install some, please.");
- // use dict for system local if there are no preferences set before
- QString locale(QLocale::system().name().left(2));
- if (fentry.isEmpty())
- {
- int ix = flistDicts->findText(locale, Qt::MatchStartsWith);
- if (ix != -1)
- flistDicts->setCurrentIndex(ix);
+ qWarning()<<m_errorMessage.toUtf8().data();
+ }
+ else
+ {
+ // use dict for system local if there are no preferences set before
+ QString locale(QLocale::system().name().left(2));
+ if (fentry.isEmpty())
+ {
+ int ix = flistDicts->findText(locale, Qt::MatchStartsWith);
+ if (ix != -1)
+ flistDicts->setCurrentIndex(ix);
+ else
+ {
+ fentry = kDEF_ASPELL_ENTRY;
+ setCurrentComboItem(flistDicts, fentry);
+ }
+ }
else
- {
- fentry = kDEF_ASPELL_ENTRY;
setCurrentComboItem(flistDicts, fentry);
- }
- }
- else
- setCurrentComboItem(flistDicts, fentry);
- handleSpellConfig(flistDicts->currentText());
+ handleSpellConfig(flistDicts->currentText());
+ }
}
catch( const std::invalid_argument& err )
{
- QString warn = tr( "aspellplugin (AspellPluginImpl::"
- "AspellPluginImpl): Error in Aspell "
- "speller configuration." );
- qWarning( "%s", warn.toUtf8().data() );
+ QString warn = tr( "Spell Checker Plugin Failed to Initialise.\nConfiguration invalid" );
+ qWarning()<<warn.toUtf8().data();
+ if (m_errorMessage.isEmpty())
+ m_errorMessage=warn;
}
catch( const std::runtime_error& err )
{
- QString warn = tr( "aspellplugin (AspellPluginImpl::"
- "AspellPluginImpl): Error in creating "
- "Aspell speller." );
- qWarning( "%s", warn.toUtf8().data() );
- }
- activateSpellGUI(true);
- parseSelection();
+ QString warn = tr( "Spell Checker Plugin Failed to Initialise.");
+ if (dictCount==0)
+ warn+="\n"+tr( "No Aspell dictionaries could be found." );
+ qWarning()<<warn.toUtf8().data();
+ if (m_errorMessage.isEmpty())
+ m_errorMessage=warn;
+ }
+ if (m_errorMessage.isEmpty())
+ {
+ activateSpellGUI(true);
+ parseSelection();
+ }
}
//__________________________________________________________________________
AspellPluginImpl::~AspellPluginImpl()
{
- // Destructor
- try
- {
- fsuggest->saveLists();
- }
- catch( const std::runtime_error& err )
- {
- qWarning( "aspellplugin (AspellPluginImpl::~AspellPlugin"
- "Impl): Error in saving Aspell word lists." );
- }
-
- delete fsuggest;
+ if (m_errorMessage.isEmpty())
+ {
+ // Destructor
+ try
+ {
+ fsuggest->saveLists();
+ }
+ catch( const std::runtime_error& err )
+ {
+ qWarning( "aspellplugin (AspellPluginImpl::~AspellPlugin"
+ "Impl): Error in saving aspell word lists." );
+ }
+ }
+ if (fsuggest)
+ delete fsuggest;
}
//__________________________________________________________________________
void AspellPluginImpl::activateSpellGUI(bool active)
@@ -263,7 +286,8 @@
{
// Called when the "Close" button is clicked. Makes any pending
// replacements and closes the spell-checking window.
- spellCheckDone(); // Also closes spell-checking window.
+ if (m_errorMessage.isEmpty())
+ spellCheckDone(); // Also closes spell-checking window.
}
//__________________________________________________________________________
void AspellPluginImpl::on_fchangeBtn_clicked()
Modified: branches/ScribusOIF/scribus/pslib.cpp
URL: http://scribus.info/websvn/diff.php?repname=Scribus&rev=16614&path=/branches/ScribusOIF/scribus/pslib.cpp
==============================================================================
--- branches/ScribusOIF/scribus/pslib.cpp (original)
+++ branches/ScribusOIF/scribus/pslib.cpp Sun May 8 17:42:57 2011
@@ -2230,7 +2230,7 @@
SetColor(style.fillColor(), style.fillShade(), &h, &s, &v, &k, gcr);
PS_setcmykcolor_stroke(h / 255.0, s / 255.0, v / 255.0, k / 255.0);
}
- if ((hl->ch == SpecialChars::OBJECT) && (hl->embedded.hasItem()))
+ if (hl->hasObject())
{
PS_save();
PutStream( MatrixToStr(1.0, 0.0, 0.0, -1.0, -hl->PDx, 0.0) + "\n");
@@ -4246,7 +4246,7 @@
}
}
*/
- if ((hl->ch == SpecialChars::OBJECT) && (hl->embedded.hasItem()))
+ if (hl->hasObject())
{
QList<PageItem*> emG = hl->embedded.getGroupedItems();
for (int em = 0; em < emG.count(); ++em)
Modified: branches/ScribusOIF/scribus/scpageoutput.cpp
URL: http://scribus.info/websvn/diff.php?repname=Scribus&rev=16614&path=/branches/ScribusOIF/scribus/scpageoutput.cpp
==============================================================================
--- branches/ScribusOIF/scribus/scpageoutput.cpp (original)
+++ branches/ScribusOIF/scribus/scpageoutput.cpp Sun May 8 17:42:57 2011
@@ -958,7 +958,7 @@
hl->glyph.yadvance = 0;
item->layoutGlyphs(itemText.charStyle(a), chstr, hl->glyph);
hl->glyph.shrink();
- if (hl->ch == SpecialChars::OBJECT)
+ if (hl->hasObject())
totalTextLen += (hl->embedded.getItem()->gWidth + hl->embedded.getItem()->lineWidth()) * hl->glyph.scaleH;
else
totalTextLen += hl->glyph.wide()+hl->fontSize() * hl->tracking() / 10000.0;
@@ -999,7 +999,7 @@
item->layoutGlyphs(itemText.charStyle(a), chstr, hl->glyph);
hl->glyph.shrink(); // HACK
// Unneeded now that glyph xadvance is set appropriately for inline objects by PageItem_TextFrame::layout() - JG
- /*if (hl->ch == SpecialChars::OBJECT)
+ /*if (hl->hasObject())
dx = (hl->embedded.getItem()->gWidth + hl->embedded.getItem()->lineWidth()) * hl->glyph.scaleH / 2.0;
else*/
dx = hl->glyph.wide() / 2.0;
@@ -1076,7 +1076,7 @@
painter->setWorldMatrix(savWM);
painter->restore();
CurX -= dx;
- if (hl->ch == SpecialChars::OBJECT)
+ if (hl->hasObject())
CurX += (hl->embedded.getItem()->gWidth + hl->embedded.getItem()->lineWidth()) * hl->glyph.scaleH;
else
CurX += hl->glyph.wide()+hl->fontSize() * hl->tracking() / 10000.0 + extraOffset;
@@ -1312,7 +1312,7 @@
painter->restore();
}
// Unneeded now that glyph xadvance is set appropriately for inline objects by PageItem_TextFrame::layout() - JG
- /*if (hl->ch == SpecialChars::OBJECT)
+ /*if (hl->hasObject())
CurX += (hl->embedded.getItem()->gWidth + hl->embedded.getItem()->lineWidth());
else*/
CurX += hl->glyph.wide();
Modified: branches/ScribusOIF/scribus/scribus.cpp
URL: http://scribus.info/websvn/diff.php?repname=Scribus&rev=16614&path=/branches/ScribusOIF/scribus/scribus.cpp
==============================================================================
--- branches/ScribusOIF/scribus/scribus.cpp (original)
+++ branches/ScribusOIF/scribus/scribus.cpp Sun May 8 17:42:57 2011
@@ -307,7 +307,7 @@
setAttribute(Qt::WA_KeyCompression, false);
setAttribute(Qt::WA_InputMethodEnabled, true);
setWindowIcon(loadIcon("AppIcon.png"));
- setDockNestingEnabled(true);
+ setObjectName("MainWindow");
scrActionGroups.clear();
scrActions.clear();
scrRecentFileActions.clear();
Modified: branches/ScribusOIF/scribus/scribusapp.cpp
URL: http://scribus.info/websvn/diff.php?repname=Scribus&rev=16614&path=/branches/ScribusOIF/scribus/scribusapp.cpp
==============================================================================
--- branches/ScribusOIF/scribus/scribusapp.cpp (original)
+++ branches/ScribusOIF/scribus/scribusapp.cpp Sun May 8 17:42:57 2011
@@ -21,7 +21,6 @@
* *
***************************************************************************/
-
#include <iostream>
#include <cstdlib>
@@ -43,6 +42,10 @@
#include "prefsmanager.h"
#include "commonstrings.h"
#include "upgradechecker.h"
+
+#ifdef WITH_TESTS
+#include "tests/runtests.h"
+#endif
#if defined(_WIN32)
#include <windows.h>
@@ -61,6 +64,7 @@
#define ARG_SWAPDIABUTTONS "--swap-buttons"
#define ARG_PREFS "--prefs"
#define ARG_UPGRADECHECK "--upgradecheck"
+#define ARG_TESTS "--tests"
#define ARG_VERSION_SHORT "-v"
#define ARG_HELP_SHORT "-h"
@@ -75,6 +79,7 @@
#define ARG_SWAPDIABUTTONS_SHORT "-sb"
#define ARG_PREFS_SHORT "-pr"
#define ARG_UPGRADECHECK_SHORT "-u"
+#define ARG_TESTS_SHORT "-T"
// Qt wants -display not --display or -d
#define ARG_DISPLAY_QT "-display"
@@ -118,6 +123,11 @@
bool availlangs=false;
bool version=false;
bool runUpgradeCheck=false;
+#ifdef WITH_TESTS
+ bool runtests = false;
+ char** testargsv;
+ int testargsc;
+#endif
showFontInfo=false;
showProfileInfo=false;
swapDialogButtonOrder=false;
@@ -136,7 +146,17 @@
} else if (arg == ARG_HELP || arg == ARG_HELP_SHORT) {
header=true;
usage=true;
- } else if (arg == ARG_AVAILLANG || arg == ARG_AVAILLANG_SHORT) {
+ }
+#ifdef WITH_TESTS
+ else if (arg == ARG_TESTS || arg == ARG_TESTS_SHORT) {
+ header=true;
+ runtests=true;
+ testargsc = argc() - i;
+ testargsv = argv() + i;
+ break;
+ }
+#endif
+ else if (arg == ARG_AVAILLANG || arg == ARG_AVAILLANG_SHORT) {
header=true;
availlangs=true;
} else if (arg == ARG_UPGRADECHECK || arg == ARG_UPGRADECHECK_SHORT) {
@@ -155,6 +175,10 @@
showAvailLangs();
if (usage)
showUsage();
+#ifdef WITH_TESTS
+ if (runtests)
+ RunTests::runTests(testargsc, testargsv);
+#endif
if (runUpgradeCheck)
{
UpgradeChecker uc;
@@ -424,6 +448,11 @@
#if defined(_WIN32) && !defined(_CONSOLE)
printArgLine(ts, ARG_CONSOLE_SHORT, ARG_CONSOLE, tr("Display a console window") );
#endif
+
+#if WITH_TESTS
+ printArgLine(ts, ARG_TESTS_SHORT, ARG_TESTS, tr("Run unit tests and exit") );
+#endif
+
/* Delete me?
std::cout << "-file|-- name Open file 'name'" ; endl(ts);
std::cout << "name Open file 'name', the file name must not begin with '-'" ; endl(ts);
Modified: branches/ScribusOIF/scribus/scribusdoc.cpp
URL: http://scribus.info/websvn/diff.php?repname=Scribus&rev=16614&path=/branches/ScribusOIF/scribus/scribusdoc.cpp
==============================================================================
--- branches/ScribusOIF/scribus/scribusdoc.cpp (original)
+++ branches/ScribusOIF/scribus/scribusdoc.cpp Sun May 8 17:42:57 2011
@@ -632,6 +632,27 @@
ret += embedded->getItemList();
}
return ret;
+}
+
+QList<PageItem*> *ScribusDoc::parentGroup(PageItem* item, QList<PageItem*> *list)
+{
+ QList<PageItem*> *retList = NULL;
+ if (list->contains(item))
+ retList = list;
+ else
+ {
+ for (int a = 0; a < list->count(); ++a)
+ {
+ PageItem* embedded = list->at(a);
+ if (embedded->isGroup())
+ {
+ retList = parentGroup(item, &embedded->asGroupFrame()->groupItemList);
+ if (retList != NULL)
+ break;
+ }
+ }
+ }
+ return retList;
}
void ScribusDoc::setup(const int unitIndex, const int fp, const int firstLeft, const int orientation, const int firstPageNumber, const QString& defaultPageSize, const QString& documentName)
@@ -9044,6 +9065,22 @@
changed();
}
+void ScribusDoc::itemSelection_SetItemTextReversed(bool reversed)
+{
+ uint selectedItemCount=m_Selection->count();
+ if (selectedItemCount != 0)
+ {
+ for (uint i = 0; i < selectedItemCount; ++i)
+ {
+ PageItem *currItem = m_Selection->itemAt(i);
+ currItem->setImageFlippedH(reversed);
+ currItem->setReversed(reversed);
+ }
+ regionsChanged()->update(QRectF());
+ changed();
+ }
+}
+
void ScribusDoc::itemSelection_SetItemFillTransparency(double t)
{
@@ -12386,8 +12423,10 @@
for (int b = 0; b < toDelete.count(); b++)
{
currItem = toDelete.at(b);
- int d = Items->indexOf(currItem);
- Items->removeAt(d);
+ QList<PageItem*> *list = Items;
+ list = parentGroup(currItem, Items);
+ int d = list->indexOf(currItem);
+ list->removeAt(d);
itemSelection->removeItem(currItem);
Selection tempSelection(this, false);
tempSelection.delaySignalsOn();
@@ -12396,7 +12435,7 @@
{
PageItem* gItem = currItem->groupItemList.at(c);
gItem->setXYPos(currItem->xPos() + gItem->gXpos, currItem->yPos() + gItem->gYpos, true);
- Items->insert(d, gItem);
+ list->insert(d, gItem);
itemSelection->addItem(currItem->groupItemList.at(gcount - c));
tempSelection.addItem(currItem->groupItemList.at(gcount - c));
}
Modified: branches/ScribusOIF/scribus/scribusdoc.h
URL: http://scribus.info/websvn/diff.php?repname=Scribus&rev=16614&path=/branches/ScribusOIF/scribus/scribusdoc.h
==============================================================================
--- branches/ScribusOIF/scribus/scribusdoc.h (original)
+++ branches/ScribusOIF/scribus/scribusdoc.h Sun May 8 17:42:57 2011
@@ -119,6 +119,7 @@
~ScribusDoc();
void init();
QList<PageItem*> getAllItems(QList<PageItem*> &items);
+ QList<PageItem*> *parentGroup(PageItem* item, QList<PageItem*> *list);
void setup(const int, const int, const int, const int, const int, const QString&, const QString&);
void setLoading(const bool);
bool isLoading() const;
@@ -1255,6 +1256,7 @@
void itemSelection_ClearItem(Selection* customSelection=0);
//! Delete the items in the current selection. When force is true, we do not warn the user and make SE happy too. Force is used from @sa Page::restorePageItemCreation
void itemSelection_DeleteItem(Selection* customSelection=0, bool forceDeletion=false);
+ void itemSelection_SetItemTextReversed(bool reversed);
void itemSelection_SetItemFillTransparency(double t);
void itemSelection_SetItemLineTransparency(double t);
void itemSelection_SetItemFillBlend(int t);
Modified: branches/ScribusOIF/scribus/sctextstruct.cpp
URL: http://scribus.info/websvn/diff.php?repname=Scribus&rev=16614&path=/branches/ScribusOIF/scribus/sctextstruct.cpp
==============================================================================
--- branches/ScribusOIF/scribus/sctextstruct.cpp (original)
+++ branches/ScribusOIF/scribus/sctextstruct.cpp Sun May 8 17:42:57 2011
@@ -71,12 +71,12 @@
delete d;
}
-bool InlineFrame::hasItem()
+bool InlineFrame::hasItem() const
{
return d->item != NULL;
}
-bool InlineFrame::isShared()
+bool InlineFrame::isShared() const
{
return d->refs > 1;
}
@@ -99,3 +99,4 @@
}
return result;
}
+
Modified: branches/ScribusOIF/scribus/sctextstruct.h
URL: http://scribus.info/websvn/diff.php?repname=Scribus&rev=16614&path=/branches/ScribusOIF/scribus/sctextstruct.h
==============================================================================
--- branches/ScribusOIF/scribus/sctextstruct.h (original)
+++ branches/ScribusOIF/scribus/sctextstruct.h Sun May 8 17:42:57 2011
@@ -74,8 +74,8 @@
InlineFrame& operator= (const InlineFrame& other);
virtual ~InlineFrame();
- bool hasItem();
- bool isShared();
+ bool hasItem() const;
+ bool isShared() const;
PageItem* getItem();
QList<PageItem*> getGroupedItems();
private:
@@ -91,6 +91,8 @@
PathData() : PtransX(0.0f), PtransY(0.0f), PRot(0.0f), PDx(0.0f) {}
PathData(const PathData& other) : PtransX(other.PtransX), PtransY(other.PtransY), PRot(other.PRot), PDx(other.PDx) {}
+
+ bool hasObject() const;
};
Modified: branches/ScribusOIF/scribus/text/storytext.cpp
URL: http://scribus.info/websvn/diff.php?repname=Scribus&rev=16614&path=/branches/ScribusOIF/scribus/text/storytext.cpp
==============================================================================
--- branches/ScribusOIF/scribus/text/storytext.cpp (original)
+++ branches/ScribusOIF/scribus/text/storytext.cpp Sun May 8 17:42:57 2011
@@ -172,6 +172,7 @@
else if (other.text(i) == SpecialChars::OBJECT) {
insertChars(pos, SpecialChars::OBJECT);
// item(pos)->embedded = other.item(i)->embedded;
+ applyCharStyle(pos, 1, other.charStyle(i));
cstyleStart = i+1;
pos += 1;
}
@@ -504,6 +505,19 @@
const TextFlags& StoryText::charAttributes(int pos) const
{
return data->charAttributes(pos);
+}
+
+bool StoryText::hasObject(int pos) const
+{
+ if (pos < 0)
+ pos += length();
+
+ assert(pos >= 0);
+ assert(pos < length());
+
+ if (data->text(pos) == SpecialChars::OBJECT)
+ return (data->object(pos).hasItem());
+ return false;
}
InlineFrame StoryText::object(int pos) const
Modified: branches/ScribusOIF/scribus/text/storytext.h
URL: http://scribus.info/websvn/diff.php?repname=Scribus&rev=16614&path=/branches/ScribusOIF/scribus/text/storytext.h
==============================================================================
--- branches/ScribusOIF/scribus/text/storytext.h (original)
+++ branches/ScribusOIF/scribus/text/storytext.h Sun May 8 17:42:57 2011
@@ -117,6 +117,7 @@
virtual TextFlags& charAttributes(int pos);
virtual const TextFlags& charAttributes(int pos) const;
+ bool hasObject(int pos) const;
InlineFrame object(int pos) const;
/*int nextCharPos(int c);
Modified: branches/ScribusOIF/scribus/ui/about.cpp
URL: http://scribus.info/websvn/diff.php?repname=Scribus&rev=16614&path=/branches/ScribusOIF/scribus/ui/about.cpp
==============================================================================
--- branches/ScribusOIF/scribus/ui/about.cpp (original)
+++ branches/ScribusOIF/scribus/ui/about.cpp Sun May 8 17:42:57 2011
@@ -112,7 +112,7 @@
buildID = new QLabel( tab );
buildID->setAlignment(Qt::AlignCenter);
buildID->setTextInteractionFlags(Qt::TextSelectableByMouse);
- QString BUILD_DAY = "16";
+ QString BUILD_DAY = "30";
QString BUILD_MONTH = CommonStrings::april;
QString BUILD_YEAR = "2011";
QString BUILD_TIME = "";
Modified: branches/ScribusOIF/scribus/ui/prefs_guides.cpp
URL: http://scribus.info/websvn/diff.php?repname=Scribus&rev=16614&path=/branches/ScribusOIF/scribus/ui/prefs_guides.cpp
==============================================================================
--- branches/ScribusOIF/scribus/ui/prefs_guides.cpp (original)
+++ branches/ScribusOIF/scribus/ui/prefs_guides.cpp Sun May 8 17:42:57 2011
@@ -62,7 +62,7 @@
minorGridSpacingSpinBox->setNewUnit(unitIndex);
majorGridSpacingSpinBox->setMinimum(10 * unitRatio);
- minorGridSpacingSpinBox->setMinimum(10 * unitRatio);
+ minorGridSpacingSpinBox->setMinimum(unitRatio);
majorGridSpacingSpinBox->setMaximum(1000 * unitRatio);
minorGridSpacingSpinBox->setMaximum(1000 * unitRatio);
}
Modified: branches/ScribusOIF/scribus/ui/propertywidget_textcolor.cpp
URL: http://scribus.info/websvn/diff.php?repname=Scribus&rev=16614&path=/branches/ScribusOIF/scribus/ui/propertywidget_textcolor.cpp
==============================================================================
--- branches/ScribusOIF/scribus/ui/propertywidget_textcolor.cpp (original)
+++ branches/ScribusOIF/scribus/ui/propertywidget_textcolor.cpp Sun May 8 17:42:57 2011
@@ -318,11 +318,7 @@
{
if (!m_doc || !m_item || !m_ScMW || m_ScMW->scriptIsRunning())
return;
- bool setter = revertButton->isChecked();
- m_item->setImageFlippedH(setter);
- m_item->setReversed(setter);
- m_item->update();
- //emit DocChanged();
+ m_doc->itemSelection_SetItemTextReversed(revertButton->isChecked());
}
void PropertyWidget_TextColor::handleTextFill()
@@ -402,4 +398,4 @@
strokeShade->setToolTip( tr("Saturation of color of text stroke"));
revertButton->setToolTip( tr("Right to Left Writing"));
-}
+}
Modified: branches/ScribusOIF/scribus/ui/scdockpalette.cpp
URL: http://scribus.info/websvn/diff.php?repname=Scribus&rev=16614&path=/branches/ScribusOIF/scribus/ui/scdockpalette.cpp
==============================================================================
--- branches/ScribusOIF/scribus/ui/scdockpalette.cpp (original)
+++ branches/ScribusOIF/scribus/ui/scdockpalette.cpp Sun May 8 17:42:57 2011
@@ -68,6 +68,7 @@
setAllowedAreas(Qt::LeftDockWidgetArea | Qt::RightDockWidgetArea);
setWindowIcon(loadIcon("AppIcon.png"));
setPrefsContext(prefsContext);
+ setObjectName(prefsContext);
connect(PrefsManager::instance(), SIGNAL(prefsChanged()), this, SLOT(setFontSize()));
}
Modified: branches/ScribusOIF/scribus/ui/smlinestyle.cpp
URL: http://scribus.info/websvn/diff.php?repname=Scribus&rev=16614&path=/branches/ScribusOIF/scribus/ui/smlinestyle.cpp
==============================================================================
--- branches/ScribusOIF/scribus/ui/smlinestyle.cpp (original)
+++ branches/ScribusOIF/scribus/ui/smlinestyle.cpp Sun May 8 17:42:57 2011
@@ -230,7 +230,11 @@
doc_->MLineStyles = tmpLines;
QMap<QString, QString> replacement;
for (int i = 0; i < deleted_.count(); ++i)
+ {
+ if (deleted_[i].first == deleted_[i].second)
+ continue;
replacement[deleted_[i].first] = deleted_[i].second;
+ }
deleted_.clear();
@@ -350,7 +354,7 @@
QList<RemoveItem>::iterator it;
for (it = deleted_.begin(); it != deleted_.end(); ++it)
{
- if ((*it).second == oldName)
+ if (it->second == oldName)
{
oldName = (*it).first;
deleted_.erase(it);
@@ -358,7 +362,8 @@
}
}
- deleted_.append(RemoveItem(oldName, newName));
+ if (oldName != newName)
+ deleted_.append(RemoveItem(oldName, newName));
}
void SMLineStyle::changeEvent(QEvent *e)
Modified: branches/ScribusOIF/scribus/ui/smtextstyles.cpp
URL: http://scribus.info/websvn/diff.php?repname=Scribus&rev=16614&path=/branches/ScribusOIF/scribus/ui/smtextstyles.cpp
==============================================================================
--- branches/ScribusOIF/scribus/ui/smtextstyles.cpp (original)
+++ branches/ScribusOIF/scribus/ui/smtextstyles.cpp Sun May 8 17:42:57 2011
@@ -122,6 +122,7 @@
tmpList << StyleName(styleName, parentName);
}
}
+ qSort(tmpList.begin(), tmpList.end(), sortingQPairOfStrings);
return tmpList;
}
@@ -294,7 +295,11 @@
QMap<QString, QString> replacement;
for (int i = 0; i < deleted_.count(); ++i)
+ {
+ if (deleted_[i].first == deleted_[i].second)
+ continue;
replacement[deleted_[i].first] = deleted_[i].second;
+ }
doc_->redefineStyles(tmpStyles_, false);
doc_->replaceStyles(replacement);
@@ -433,7 +438,7 @@
QList<RemoveItem>::iterator it;
for (it = deleted_.begin(); it != deleted_.end(); ++it)
{
- if ((*it).second == oldName)
+ if (it->second == oldName)
{
oldName = (*it).first;
deleted_.erase(it);
@@ -441,7 +446,8 @@
}
}
- deleted_.append(RemoveItem(oldName, newName));
+ if (oldName != newName)
+ deleted_.append(RemoveItem(oldName, newName));
if (!selectionIsDirty_)
{
@@ -1654,7 +1660,11 @@
QMap<QString, QString> replacement;
for (int i = 0; i < deleted_.count(); ++i)
+ {
+ if (deleted_[i].first == deleted_[i].second)
+ continue;
replacement[deleted_[i].first] = deleted_[i].second;
+ }
doc_->redefineCharStyles(tmpStyles_, false);
doc_->replaceCharStyles(replacement);
@@ -1790,7 +1800,7 @@
QList<RemoveItem>::iterator it;
for (it = deleted_.begin(); it != deleted_.end(); ++it)
{
- if ((*it).second == oldName)
+ if (it->second == oldName)
{
oldName = (*it).first;
deleted_.erase(it);
@@ -1798,7 +1808,8 @@
}
}
- deleted_.append(RemoveItem(oldName, newName));
+ if (oldName != newName)
+ deleted_.append(RemoveItem(oldName, newName));
if (!selectionIsDirty_)
{
Modified: branches/ScribusOIF/scribus/util.cpp
URL: http://scribus.info/websvn/diff.php?repname=Scribus&rev=16614&path=/branches/ScribusOIF/scribus/util.cpp
==============================================================================
--- branches/ScribusOIF/scribus/util.cpp (original)
+++ branches/ScribusOIF/scribus/util.cpp Sun May 8 17:42:57 2011
@@ -497,6 +497,13 @@
for(uint i = 0; i < sortList.size(); i++)
retList.append(sortList[i]);
return retList;
+}
+
+bool sortingQPairOfStrings( QPair<QString, QString> aP, QPair<QString, QString> bP)
+{
+ if (aP.first == bP.first)
+ return (aP.second < bP.second);
+ return (aP.first < bP.first);
}
QString checkFileExtension(const QString &currName, const QString &extension)
Modified: branches/ScribusOIF/scribus/util.h
URL: http://scribus.info/websvn/diff.php?repname=Scribus&rev=16614&path=/branches/ScribusOIF/scribus/util.h
==============================================================================
--- branches/ScribusOIF/scribus/util.h (original)
+++ branches/ScribusOIF/scribus/util.h Sun May 8 17:42:57 2011
@@ -16,6 +16,7 @@
#include <QDir>
#include <QList>
#include <QPainterPath>
+#include <QPair>
#include <QPixmap>
#include <QString>
#include <QStringList>
@@ -50,6 +51,7 @@
\retval QStringList sorted string list
*/
QStringList SCRIBUS_API sortQStringList(QStringList aList);
+bool SCRIBUS_API sortingQPairOfStrings( QPair<QString, QString> aP, QPair<QString, QString> bP);
void SCRIBUS_API ReOrderText(ScribusDoc *currentDoc, ScribusView *view);
void SCRIBUS_API WordAndPara(PageItem *currItem, int *w, int *p, int *c, int *wN, int *pN, int *cN);
bool SCRIBUS_API overwrite(QWidget *parent, QString filename);
More information about the scribus-commit
mailing list