Skip to content

Commit

Permalink
Merge branch 'master' into master
Browse files Browse the repository at this point in the history
  • Loading branch information
LyzardKing authored Jan 20, 2019
2 parents 2398c83 + 78a3663 commit 3d54814
Show file tree
Hide file tree
Showing 18 changed files with 633 additions and 606 deletions.
30 changes: 21 additions & 9 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,27 +26,38 @@ matrix:

before_install:
# Linux
- if [ $TRAVIS_OS_NAME == linux ]; then
- if [ $TRAVIS_OS_NAME == linux ]; then
sudo apt-add-repository ppa:beineri/opt-qt595-xenial -y;
sudo apt-add-repository ppa:as-bahanta/raqm -y;
sudo apt-add-repository ppa:ricotz/testing -y;
sudo apt-get update -qq;
fi
# OSX
- if [ $TRAVIS_OS_NAME == osx ]; then
brew update;
fi

install:
# Linux
- if [ $TRAVIS_OS_NAME == linux ]; then
sudo apt-get install --force-yes cmake libboost-python-dev libcups2-dev libhunspell-dev
libhyphen-dev liblcms2-dev libpodofo-dev libtiff-dev libxml2-dev
python-all-dev zlib1g-dev qt59base qt59declarative
qt59tools libgraphicsmagick++1-dev
libopenscenegraph-dev libpoppler-dev libpoppler-cpp-dev libcairo2-dev libwpg-dev
libmspub-dev libcdr-dev libvisio-dev libharfbuzz-dev libharfbuzz-icu0
coreutils binutils python-tk;
wget http://poppler.freedesktop.org/poppler-0.73.0.tar.xz;
unxz poppler-0.73.0.tar.xz;
tar xfv poppler-0.73.0.tar;
cd poppler-0.73.0;
mkdir build; cd build; cmake ..; make; make install;
# Build a more recent poppler than Ubuntu Xenial's poppler 0.41.0
mkdir deps && pushd deps;
sudo apt-get install --force-yes libopenjpeg-dev;
wget https://poppler.freedesktop.org/poppler-data-0.4.9.tar.gz && tar -xf poppler-data-0.4.9.tar.gz;
pushd poppler-data-0.4.9 && cmake -DCMAKE_BUILD_TYPE=Release && sudo make install && popd;
wget https://poppler.freedesktop.org/poppler-0.58.0.tar.xz && tar -xf poppler-0.58.0.tar.xz;
pushd poppler-0.58.0 && cmake -DCMAKE_BUILD_TYPE=Release -DENABLE_XPDF_HEADERS=1 && sudo make install && popd;
popd;
fi
# OSX
# - if [ $TRAVIS_OS_NAME == osx ]; then brew --env && brew config && brew list; fi
- if [ $TRAVIS_OS_NAME == osx ]; then brew update;
- if [ $TRAVIS_OS_NAME == osx ]; then
brew outdated cmake --verbose || brew upgrade cmake;
brew tap homebrew/dupes && brew install homebrew/dupes/zlib && brew link --force zlib;
brew install icu4c && brew link --force icu4c;
Expand All @@ -62,7 +73,7 @@ before_install:
fi
# - export LDFLAGS+=-L/usr/local/opt/zlib/lib:-L/usr/local/opt/gettext/lib:-L/usr/local/opt/libffi/lib:-L/usr/local/opt/qt5/lib:-L/usr/local/opt/sqlite/lib:-L/usr/local/opt/openssl/lib:-L/usr/local/opt/icu4c/lib
# - export CXXFLAGS+=-I/usr/local/opt/zlib/include:-I/usr/local/opt/gettext/include:-I/usr/local/opt/qt5/include:-I/usr/local/opt/sqlite/include:-I/usr/local/opt/openssl/include:-I/usr/local/opt/icu4c/include

script:
- if [ $TRAVIS_OS_NAME == linux ]; then
source /opt/qt59/bin/qt59-env.sh;
Expand All @@ -88,6 +99,7 @@ script:
./squashfs-root/usr/bin/linuxdeployqt -bundle-non-qt-libs appdir/usr/lib/_tkinter.so;
./linuxdeployqt-continuous-x86_64.AppImage appdir/usr/share/applications/*.desktop -appimage;
curl --upload-file "${TRAVIS_BUILD_DIR}/Scribus-${VERSION}-x86_64.AppImage" https://transfer.sh/"Scribus-${VERSION}-x86_64.AppImage";

fi

- if [ $TRAVIS_OS_NAME = osx -a $CC = clang ]; then
Expand Down
1 change: 1 addition & 0 deletions scribus/canvasmode_create.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -841,6 +841,7 @@ PageItem* CreateMode::doCreateNewObject()
SetupDrawNoResize(z);
newObject = m_doc->Items->at(z);
newObject->ContourLine = newObject->PoLine.copy();
m_doc->setRedrawBounding(newObject);
}
return newObject;
}
Expand Down
2 changes: 1 addition & 1 deletion scribus/canvasmode_magnifier.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -214,7 +214,7 @@ void CanvasMode_Magnifier::mouseReleaseEvent(QMouseEvent *m)
{
int mx = qRound(mousePointDoc.x());
int my = qRound(mousePointDoc.y());
m_view->Magnify ? m_view->slotZoomIn(mx, my) : m_view->slotZoomOut(mx, my);
m_view->Magnify ? m_view->slotZoomIn(mx, my, true) : m_view->slotZoomOut(mx, my, true);
if (sc == m_canvas->scale())
{
m_view->HaveSelRect = false;
Expand Down
4 changes: 3 additions & 1 deletion scribus/guidesmodel.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,8 @@ QVariant GuidesModel::data(const QModelIndex & index, int role) const
}
if (role == Qt::EditRole)
return pts2value(m_values.at(index.row()) - m_rule, m_docUnitIndex);
if (role == Qt::UserRole)
return m_values.at(index.row());

if (role == Qt::BackgroundColorRole && m_values.at(index.row()) == 0.0)
return QVariant(QColor(Qt::red));
Expand Down Expand Up @@ -91,7 +93,7 @@ void GuidesModel::removeValues(const Guides & guides)
{
beginResetModel();
for (double d : guides)
m_values.removeAll(value2pts(d, m_docUnitIndex));
m_values.removeAll(d);
endResetModel();
}

Expand Down
28 changes: 14 additions & 14 deletions scribus/pageitem.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -355,7 +355,7 @@ PageItem::PageItem(const PageItem & other)
m_imageXOffset(other.m_imageXOffset),
m_imageYOffset(other.m_imageYOffset),
m_imageRotation(other.m_imageRotation),
firstLineOffsetP(other.firstLineOffsetP),
m_firstLineOffset(other.m_firstLineOffset),
m_groupClips(other.m_groupClips),
hatchBackgroundQ(other.hatchBackgroundQ),
hatchForegroundQ(other.hatchForegroundQ)
Expand Down Expand Up @@ -832,7 +832,7 @@ PageItem::PageItem(ScribusDoc *pa, ItemType newType, double x, double y, double
meshGradientArray.append(mgList);
meshGradientPatches.append(patch);

firstLineOffsetP = FLOPRealGlyphHeight;
m_firstLineOffset = FLOPRealGlyphHeight;
Cols = m_Doc->itemToolPrefs().textColumns;
ColGap = m_Doc->itemToolPrefs().textColumnGap;
LeftLink = nullptr;
Expand Down Expand Up @@ -6631,9 +6631,9 @@ void PageItem::restoreFirstLineOffset(SimpleState *ss, bool isUndo)
if (!is)
qFatal("PageItem::restoreFirstLineOffset: dynamic cast failed");
if (isUndo)
firstLineOffsetP = is->getItem().first;
m_firstLineOffset = is->getItem().first;
else
firstLineOffsetP = is->getItem().second;
m_firstLineOffset = is->getItem().second;
update();
}

Expand Down Expand Up @@ -10508,22 +10508,22 @@ QString PageItem::infoDescription() const

FirstLineOffsetPolicy PageItem::firstLineOffset() const
{
return firstLineOffsetP;
return m_firstLineOffset;
}

void PageItem::setFirstLineOffset(FirstLineOffsetPolicy flop)
{
if (firstLineOffsetP != flop)
if (m_firstLineOffset == flop)
return;

if (UndoManager::undoEnabled())
{
if (UndoManager::undoEnabled())
{
ScItemState<QPair<FirstLineOffsetPolicy,FirstLineOffsetPolicy> > *is = new ScItemState<QPair <FirstLineOffsetPolicy,FirstLineOffsetPolicy> >(Um::FirstLineOffset);
is->set("FIRSTLINEOFFSET");
is->setItem(qMakePair(firstLineOffsetP, flop));
undoManager->action(this, is);
}
firstLineOffsetP = flop;
ScItemState<QPair<FirstLineOffsetPolicy,FirstLineOffsetPolicy> > *is = new ScItemState<QPair <FirstLineOffsetPolicy,FirstLineOffsetPolicy> >(Um::FirstLineOffset);
is->set("FIRSTLINEOFFSET");
is->setItem(qMakePair(m_firstLineOffset, flop));
undoManager->action(this, is);
}
m_firstLineOffset = flop;
}

void PageItem::setInlineData(const QString& data)
Expand Down
2 changes: 1 addition & 1 deletion scribus/pageitem.h
Original file line number Diff line number Diff line change
Expand Up @@ -1852,7 +1852,7 @@ class SCRIBUS_API PageItem : public QObject, public UndoObject, public SaxIO, pu
double m_imageXOffset; ///< Image X Offset to frame
double m_imageYOffset; ///< Image Y Offset to frame
double m_imageRotation; ///< Image rotation in frame
FirstLineOffsetPolicy firstLineOffsetP;
FirstLineOffsetPolicy m_firstLineOffset;
bool m_groupClips;
QColor hatchBackgroundQ;
QColor hatchForegroundQ;
Expand Down
4 changes: 2 additions & 2 deletions scribus/pageitem_textframe.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1677,7 +1677,7 @@ void PageItem_TextFrame::layout()
realCharHeight = font.height(style.charStyle().fontSize() / 10.0);
if (realCharAscent == 0.0)
realCharAscent = font.ascent(style.charStyle().fontSize() / 10.0);
if (current.startOfCol && (firstLineOffsetP == FLOPFontAscent))
if (current.startOfCol && (m_firstLineOffset == FLOPFontAscent))
realCharAscent = font.ascent(hlcsize10);
chsd = ((DropCapDrop + realCharAscent) / realCharHeight) * style.charStyle().fontSize();
chs = ((DropCapDrop + realCharAscent) / realCharAscent) * style.charStyle().fontSize();
Expand Down Expand Up @@ -1764,7 +1764,7 @@ void PageItem_TextFrame::layout()
if (realCharAscent == 0)
realCharAscent = font.ascent(style.charStyle().fontSize() / 10.0);
asce = realCharAscent;
if (current.startOfCol && (firstLineOffsetP == FLOPFontAscent))
if (current.startOfCol && (m_firstLineOffset == FLOPFontAscent))
asce = font.ascent(hlcsize10);
glyphCluster.setScaleH(glyphCluster.scaleH() / glyphCluster.scaleV());
glyphCluster.setScaleV(realAsce / realCharHeight);
Expand Down
7 changes: 7 additions & 0 deletions scribus/plugins/import/pdf/importpdfconfig.h
Original file line number Diff line number Diff line change
Expand Up @@ -37,4 +37,11 @@ for which a new license (GPL+exception) is in place.
#define getCString c_str
#endif

#if POPPLER_ENCODED_VERSION >= POPPLER_VERSION_ENCODE(0, 73, 0)
#define Guchar unsigned char
#define Gushort unsigned short
#define Guint unsigned int
#define Gulong unsigned long
#endif

#endif
2 changes: 2 additions & 0 deletions scribus/plugins/import/pdf/slaoutput.h
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,9 @@ for which a new license (GPL+exception) is in place.
#include "selection.h"
#include "vgradient.h"

#if POPPLER_ENCODED_VERSION < POPPLER_VERSION_ENCODE(0, 73, 0)
#include <poppler/goo/gtypes.h>
#endif
#include <poppler/Object.h>
#include <poppler/OutputDev.h>
#include <poppler/Gfx.h>
Expand Down
14 changes: 8 additions & 6 deletions scribus/scribus.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5864,6 +5864,7 @@ void ScribusMainWindow::toggleRulerMode()
currItem->emitAllToGUI();
}
//TODO emit from selection, handle group widths
guidePalette->setupPage();
view->DrawNew();
}

Expand Down Expand Up @@ -6570,7 +6571,7 @@ void ScribusMainWindow::selectItemsFromOutlines(PageItem* ite, bool single, int
}

QPointF point = itemTrans.map(QPointF(xOffset, yOffset));
view->SetCCPo(point.x(), point.y());
view->setCanvasCenterPos(point.x(), point.y());
}

void ScribusMainWindow::selectItemFromOutlines(PageItem *ite, bool single, int cPos)
Expand Down Expand Up @@ -7696,8 +7697,8 @@ void ScribusMainWindow::editMasterPagesStart(const QString& temp)
}

m_storedPageNum = doc->currentPageNumber();
m_storedViewXCoor = view->contentsX();
m_storedViewYCoor = view->contentsY();
m_storedViewXCoor = view->horizontalScrollBar()->value();
m_storedViewYCoor = view->verticalScrollBar()->value();
m_storedViewScale = view->scale();
doc->stored_minCanvasCoordinate = doc->minCanvasCoordinate;
doc->stored_maxCanvasCoordinate = doc->maxCanvasCoordinate;
Expand All @@ -7713,9 +7714,9 @@ void ScribusMainWindow::editMasterPagesStart(const QString& temp)

void ScribusMainWindow::editMasterPagesEnd()
{
view->setScale(m_storedViewScale);
doc->minCanvasCoordinate = doc->stored_minCanvasCoordinate;
doc->maxCanvasCoordinate = doc->stored_maxCanvasCoordinate;
view->setScale(m_storedViewScale);
view->hideMasterPage();
if (m_WasAutoSave)
{
Expand All @@ -7741,9 +7742,10 @@ void ScribusMainWindow::editMasterPagesEnd()
doc->setCurrentPage(doc->DocPages.at(m_storedPageNum));
doc->minCanvasCoordinate = doc->stored_minCanvasCoordinate;
doc->maxCanvasCoordinate = doc->stored_maxCanvasCoordinate;

doc->setLoading(true);
view->reformPages(false);
view->setContentsPos(static_cast<int>(m_storedViewXCoor * m_storedViewScale), static_cast<int>(m_storedViewYCoor * m_storedViewScale));
view->setContentsPos(m_storedViewXCoor, m_storedViewYCoor);
doc->setLoading(false);
view->DrawNew();
}
Expand Down Expand Up @@ -8247,7 +8249,7 @@ void ScribusMainWindow::setCurrentPage(int p)
if (scriptIsRunning())
return;
slotSetCurrentPage(p0);
doc->view()->SetCPo(doc->currentPage()->xOffset() - 10, doc->currentPage()->yOffset() - 10);
doc->view()->setCanvasPos(doc->currentPage()->xOffset() - 10, doc->currentPage()->yOffset() - 10);
HaveNewSel();
doc->view()->setFocus();
}
Expand Down
5 changes: 4 additions & 1 deletion scribus/scribusdoc.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -14101,7 +14101,10 @@ bool ScribusDoc::moveItem(double newX, double newY, PageItem* currItem)
if ((currItem->xPos() != oldx) || (currItem->yPos() != oldy))
retw = true;
setRedrawBounding(currItem);
currItem->OwnPage = OnPage(currItem);
if (currItem->isGroup())
GroupOnPage(currItem);
else
currItem->OwnPage = OnPage(currItem);
return retw;
}

Expand Down
Loading

0 comments on commit 3d54814

Please sign in to comment.