Subversion Repositories Scribus

Compare Revisions

Ignore whitespace Rev 24718 → Rev 24717

/trunk/Scribus/scribus/ui/customfdialog.cpp
135,7 → 135,7
updatePix();
if (name.isEmpty())
return;
QFileInfo fi(name);
QFileInfo fi = QFileInfo(name);
if (fi.isDir())
return;
int w = pixmap()->width();
283,9 → 283,7
}
 
CustomFDialog::CustomFDialog(QWidget *parent, const QString& wDir, const QString& caption, const QString& filter, int flags)
: QDialog(parent),
m_optionFlags(flags),
m_previewIsShown(true)
: QDialog(parent), m_optionFlags(flags)
{
m_fileDialogPrefs = PrefsManager::instance().prefsFile->getContext("customfdialog", false);
 
321,6 → 319,7
showPreview->setText( tr("Show Preview"));
showPreview->setToolTip( tr("Show a preview and information for the selected file"));
showPreview->setChecked(true);
m_previewIsShown = true;
hboxLayout1->addWidget(showPreview);
QSpacerItem *spacerItem = new QSpacerItem(2, 2, QSizePolicy::Expanding, QSizePolicy::Minimum);
hboxLayout1->addItem(spacerItem);
491,6 → 490,10
resize(minimumSizeHint());
}
 
CustomFDialog::~CustomFDialog()
{
}
 
void CustomFDialog::closeEvent(QCloseEvent *closeEvent)
{
storeSize();
505,7 → 508,7
 
void CustomFDialog::showEvent(QShowEvent *showEvent)
{
const QScreen* dialogScreen = this->screen();
QScreen* dialogScreen = this->screen();
if (m_fileDialogPrefs && dialogScreen && !showEvent->spontaneous())
{
if (m_fileDialogPrefs->contains("width"))
565,12 → 568,12
filePreview->genPreview(QDir::fromNativeSeparators(sel[0]));
}
// #11856: Hack to avoid file dialog widget turning black with Qt5
QCoreApplication::processEvents();
qApp->processEvents();
filePreview->setVisible(!m_previewIsShown);
QCoreApplication::processEvents();
qApp->processEvents();
filePreview->setVisible(m_previewIsShown);
fileDialog->repaint();
QCoreApplication::processEvents();
qApp->processEvents();
repaint();
}
 
/trunk/Scribus/scribus/ui/customfdialog.h
102,7 → 102,7
\param flags combination of fdFlags, default to fdExistingFiles
*/
CustomFDialog(QWidget *parent, const QString& wDir, const QString& caption = "", const QString& filter = "", int flags = fdExistingFiles);
~CustomFDialog() = default;
~CustomFDialog();
 
void setSelection(const QString& fileName);
QString selectedFile() const;
/trunk/Scribus/scribus/ui/cmykfw.cpp
51,15 → 51,15
 
 
CMYKChoose::CMYKChoose( QWidget* parent, ScribusDoc* doc, ScColor orig, const QString& name, ColorList *Colors, bool newCol )
: QDialog( parent ),
Farbe(orig),
isNew(newCol),
EColors(Colors),
CurrSwatch(doc),
m_doc(doc)
: QDialog( parent ), CurrSwatch(doc)
{
setModal(true);
 
m_doc = doc;
isNew = newCol;
dynamic = true;
Wsave = false;
isHLC = false;
EColors = Colors;
CurrSwatch.clear();
alertIcon = IconManager::instance().loadPixmap("alert.png");
imageA = QPixmap(50,50);
70,6 → 70,7
imageN.fill( ScColorEngine::getDisplayColor(orig, m_doc) );
if ( ScColorEngine::isOutOfGamut(orig, m_doc) )
paintAlert(alertIcon, imageN, 2, 2, false);
Farbe = orig;
 
resize( 498, 306 );
setWindowTitle( tr( "Edit Color" ) );
/trunk/Scribus/scribus/ui/filedialogeventcatcher.cpp
64,17 → 64,20
}
else if (e->type() == QEvent::Drop)
{
auto *dropEvent = static_cast<QDropEvent *>(e);
if (dropEvent && dropEvent->mimeData()->hasFormat("text/uri-list"))
QDropEvent *dropEvent = static_cast<QDropEvent *>(e);
if (dropEvent)
{
QString fileUrl;
QList<QUrl> fileUrls = dropEvent->mimeData()->urls();
if (fileUrls.count() > 0)
if (dropEvent->mimeData()->hasFormat("text/uri-list"))
{
fileUrl = fileUrls[0].toLocalFile();
if (fileUrls[0].isLocalFile())
QString fileUrl;
QList<QUrl> fileUrls = dropEvent->mimeData()->urls();
if (fileUrls.count() > 0)
{
emit dropLocation(fileUrl);
fileUrl = fileUrls[0].toLocalFile();
if (fileUrls[0].isLocalFile())
{
emit dropLocation(fileUrl);
}
}
}
}
/trunk/Scribus/scribus/ui/cmykfw.h
34,12 → 34,12
QPixmap alertIcon;
ScColor Farbe;
 
bool Wsave { false };
bool dynamic { true };
bool isNew { false };
bool isRegistration { false };
int BlackComp { 0 };
ColorList *EColors { nullptr };
bool Wsave;
bool dynamic;
bool isNew;
bool isRegistration;
int BlackComp;
ColorList *EColors;
ColorList CurrSwatch;
QString Fnam;
 
59,14 → 59,14
 
protected:
ColorSetManager csm;
ScribusDoc* m_doc { nullptr };
QTreeWidgetItem *systemSwatches { nullptr };
QTreeWidgetItem *userSwatches { nullptr };
QTreeWidgetItem *hsvSelector { nullptr };
ScribusDoc* m_doc;
QTreeWidgetItem *systemSwatches;
QTreeWidgetItem *userSwatches;
QTreeWidgetItem *hsvSelector;
QStringList customColSet;
bool isHLC { false };
bool isHLC;
void showEvent(QShowEvent * event) override;
virtual void showEvent(QShowEvent * event);
 
QPalette sliderPix(int farbe);
QPalette sliderBlack();
/trunk/Scribus/scribus/text/boxes.h
41,7 → 41,16
D_Vertical
};
 
Box() = default;
Box()
{
m_type = T_Invalid;
m_direction = D_Horizontal;
m_x = m_y = m_width = m_ascent = m_descent = 0;
m_firstChar = 0;
m_lastChar = 0;
m_naturalAscent = 0;
m_naturalDescent = 0;
}
 
virtual ~Box()
{
98,7 → 107,7
int lastChar() const { return m_lastChar == INT_MIN ? 0 : m_lastChar; }
 
/// Sets the transformation matrix to applied to the box.
void setMatrix(const QTransform& x) { m_matrix = x; }
void setMatrix(QTransform x) { m_matrix = x; }
 
/// The transformation matrix applied to the box.
const QTransform& matrix() const { return m_matrix; }
134,19 → 143,19
BoxType type() const { return m_type; }
 
protected:
BoxType m_type { T_Invalid };
BoxDirection m_direction { D_Horizontal };
double m_x { 0.0 };
double m_y { 0.0 };
double m_width { 0.0 };
double m_descent { 0.0 };
double m_ascent { 0.0 };
BoxType m_type;
BoxDirection m_direction;
double m_x;
double m_y;
double m_width;
double m_descent;
double m_ascent;
QList<Box*> m_boxes;
int m_firstChar { 0 };
int m_lastChar { 0 };
int m_firstChar;
int m_lastChar;
QTransform m_matrix;
double m_naturalAscent { 0.0 };
double m_naturalDescent { 0.0 };
double m_naturalAscent;
double m_naturalDescent;
};
 
 
153,7 → 162,7
class GroupBox: public Box
{
public:
explicit GroupBox(BoxDirection direction)
GroupBox(BoxDirection direction)
{
m_type = T_Block;
m_direction = direction;
235,7 → 244,7
class GlyphBox: public Box
{
public:
explicit GlyphBox(const GlyphCluster& run)
GlyphBox(const GlyphCluster& run)
: m_glyphRun(run)
, m_effects(run.style().effects())
{
266,7 → 275,7
class ObjectBox: public GlyphBox
{
public:
ObjectBox(const GlyphCluster& run, const ITextContext* ctx)
ObjectBox(const GlyphCluster& run, ITextContext* ctx)
: GlyphBox(run)
, m_object(ctx->object(run.object()))
{
/trunk/Scribus/scribus/text/boxes.cpp
161,30 → 161,33
int LineBox::pointToPosition(QPointF coord, const StoryText &story) const
{
int position = GroupBox::pointToPosition(coord, story);
if (position < 0 && containsPoint(coord))
if (position < 0)
{
const ParagraphStyle& style = story.paragraphStyle(firstChar());
if (style.direction() == ParagraphStyle::RTL)
if (containsPoint(coord))
{
if (coord.x() < x())
position = lastChar();
const ParagraphStyle& style = story.paragraphStyle(firstChar());
if (style.direction() == ParagraphStyle::RTL)
{
if (coord.x() < x())
position = lastChar();
else
position = firstChar();
}
else
position = firstChar();
{
if (coord.x() < x())
position = firstChar();
else
position = lastChar();
}
if (position == story.length() - 1)
{
if (m_firstChar == m_lastChar)
position = m_lastChar;
else if (!SpecialChars::isBreak(story.text(position)))
position = story.length();
}
}
else
{
if (coord.x() < x())
position = firstChar();
else
position = lastChar();
}
if (position == story.length() - 1)
{
if (m_firstChar == m_lastChar)
position = m_lastChar;
else if (!SpecialChars::isBreak(story.text(position)))
position = story.length();
}
}
 
return position;
771,7 → 774,7
else
componentX = x() + (componentWidth * i);
 
if ((coord.x() >= componentX) && (coord.x() <= componentX + componentWidth))
if ((coord.x() >= componentX && coord.x() <= componentX + componentWidth))
{
if (coord.x() <= componentX + componentWidth / 2.0)
return rtlLayout ? (firstChar() + i + 1) : (firstChar() + i);
/trunk/Scribus/scribus/text/frect.h
77,10 → 77,10
void setX(qreal x);
void setY(qreal y);
 
void setTopLeft(const FPoint &p);
void setBottomRight(const FPoint &p);
void setTopRight(const FPoint &p);
void setBottomLeft(const FPoint &p);
void setTopLeft(FPoint &p);
void setBottomRight(FPoint &p);
void setTopRight(FPoint &p);
void setBottomLeft(FPoint &p);
 
FPoint topLeft() const;
FPoint bottomRight() const;
95,11 → 95,11
void moveTop(qreal pos);
void moveRight(qreal pos);
void moveBottom(qreal pos);
void moveTopLeft(const FPoint &p);
void moveBottomRight(const FPoint &p);
void moveTopRight(const FPoint &p);
void moveBottomLeft(const FPoint &p);
void moveCenter(const FPoint &p);
void moveTopLeft(FPoint &p);
void moveBottomRight(FPoint &p);
void moveTopRight(FPoint &p);
void moveBottomLeft(FPoint &p);
void moveCenter(FPoint &p);
void moveBy(qreal dx, qreal dy);
 
void setRect(qreal x, qreal y, qreal w, qreal h);
157,14 → 157,14
 
inline FRect::FRect(qreal left, qreal top, qreal width, qreal height)
{
x1 = left;
y1 = top;
x2 = (left + width - 1);
y2 = (top + height -1);
x1 = (qreal)left;
y1 = (qreal)top;
x2 = (qreal)(left+width-1);
y2 = (qreal)(top+height-1);
}
 
inline bool FRect::isNull() const
{ return x2 == x1 - 1 && y2 == y1 - 1; }
{ return x2 == x1-1 && y2 == y1-1; }
 
inline bool FRect::isEmpty() const
{ return x1 > x2 || y1 > y2; }
203,19 → 203,19
{ return y1; }
 
inline void FRect::setLeft(qreal pos)
{ x1 = pos; }
{ x1 = (qreal)pos; }
 
inline void FRect::setTop(qreal pos)
{ y1 = pos; }
{ y1 = (qreal)pos; }
 
inline void FRect::setRight(qreal pos)
{ x2 = pos; }
{ x2 = (qreal)pos; }
 
inline void FRect::setBottom(qreal pos)
{ y2 = pos; }
{ y2 = (qreal)pos; }
 
inline void FRect::setX(qreal x)
{ x1 = x; }
{ x1 = (qreal)x; }
 
inline void FRect::setY(qreal y)
{ y1 = (qreal)y; }
/trunk/Scribus/scribus/text/frect.cpp
105,10 → 105,10
 
FRect::FRect( FPoint &topLeft, FPoint &bottomRight )
{
x1 = topLeft.x();
y1 = topLeft.y();
x2 = bottomRight.x();
y2 = bottomRight.y();
x1 = (qreal)topLeft.x();
y1 = (qreal)topLeft.y();
x2 = (qreal)bottomRight.x();
y2 = (qreal)bottomRight.y();
}
 
/*!
118,10 → 118,10
 
FRect::FRect( FPoint &topLeft, FSize &size )
{
x1 = topLeft.x();
y1 = topLeft.y();
x2 = (x1 + size.width());
y2 = (y1 + size.height());
x1 = (qreal)topLeft.x();
y1 = (qreal)topLeft.y();
x2 = (qreal)(x1+size.width());
y2 = (qreal)(y1+size.height());
}
 
/*!
368,7 → 368,7
 
\sa topLeft(), moveTopLeft(), setBottomRight(), setTopRight(), setBottomLeft()
*/
void FRect::setTopLeft( const FPoint &p )
void FRect::setTopLeft( FPoint &p )
{
setLeft( p.x() );
setTop( p.y() );
381,7 → 381,7
 
\sa bottomRight(), moveBottomRight(), setTopLeft(), setTopRight(), setBottomLeft()
*/
void FRect::setBottomRight( const FPoint &p )
void FRect::setBottomRight( FPoint &p )
{
setRight( p.x() );
setBottom( p.y() );
394,7 → 394,7
 
\sa topRight(), moveTopRight(), setTopLeft(), setBottomRight(), setBottomLeft()
*/
void FRect::setTopRight( const FPoint &p )
void FRect::setTopRight( FPoint &p )
{
setRight( p.x() );
setTop( p.y() );
407,7 → 407,7
 
\sa bottomLeft(), moveBottomLeft(), setTopLeft(), setBottomRight(), setTopRight()
*/
void FRect::setBottomLeft( const FPoint &p )
void FRect::setBottomLeft( FPoint &p )
{
setLeft( p.x() );
setBottom( p.y() );
493,8 → 493,8
*/
void FRect::moveLeft( qreal pos )
{
x2 += (pos - x1);
x1 = pos;
x2 += (qreal)(pos - x1);
x1 = (qreal)pos;
}
 
/*!
506,8 → 506,8
 
void FRect::moveTop( qreal pos )
{
y2 += (pos - y1);
y1 = pos;
y2 += (qreal)(pos - y1);
y1 = (qreal)pos;
}
 
/*!
519,8 → 519,8
 
void FRect::moveRight( qreal pos )
{
x1 += (pos - x2);
x2 = pos;
x1 += (qreal)(pos - x2);
x2 = (qreal)pos;
}
 
/*!
532,8 → 532,8
 
void FRect::moveBottom( qreal pos )
{
y1 += (pos - y2);
y2 = pos;
y1 += (qreal)(pos - y2);
y2 = (qreal)pos;
}
 
/*!
543,7 → 543,7
\sa topLeft(), setTopLeft(), moveBottomRight(), moveTopRight(), moveBottomLeft()
*/
 
void FRect::moveTopLeft( const FPoint &p )
void FRect::moveTopLeft( FPoint &p )
{
moveLeft( p.x() );
moveTop( p.y() );
556,7 → 556,7
\sa bottomRight(), setBottomRight(), moveTopLeft(), moveTopRight(), moveBottomLeft()
*/
 
void FRect::moveBottomRight( const FPoint &p )
void FRect::moveBottomRight( FPoint &p )
{
moveRight( p.x() );
moveBottom( p.y() );
569,7 → 569,7
\sa topRight(), setTopRight(), moveTopLeft(), moveBottomRight(), moveBottomLeft()
*/
 
void FRect::moveTopRight( const FPoint &p )
void FRect::moveTopRight( FPoint &p )
{
moveRight( p.x() );
moveTop( p.y() );
582,7 → 582,7
\sa bottomLeft(), setBottomLeft(), moveTopLeft(), moveBottomRight(), moveTopRight()
*/
 
void FRect::moveBottomLeft( const FPoint &p )
void FRect::moveBottomLeft( FPoint &p )
{
moveLeft( p.x() );
moveBottom( p.y() );
596,12 → 596,12
\sa center(), moveTopLeft(), moveBottomRight(), moveTopRight(), moveBottomLeft()
*/
 
void FRect::moveCenter( const FPoint &p )
void FRect::moveCenter( FPoint &p )
{
qreal w = x2 - x1;
qreal h = y2 - y1;
x1 = (p.x() - w / 2);
y1 = (p.y() - h / 2);
x1 = (qreal)(p.x() - w/2);
y1 = (qreal)(p.y() - h/2);
x2 = x1 + w;
y2 = y1 + h;
}
617,10 → 617,10
 
void FRect::moveBy( qreal dx, qreal dy )
{
x1 += dx;
y1 -= dy;
x2 += dx;
y2 -= dy;
x1 += (qreal)dx;
y1 -= (qreal)dy;
x2 += (qreal)dx;
y2 -= (qreal)dy;
}
 
/*!
632,10 → 632,10
 
void FRect::setRect( qreal x, qreal y, qreal w, qreal h )
{
x1 = x;
y1 = y;
x2 = (x + w);
y2 = (y + h);
x1 = (qreal)x;
y1 = (qreal)y;
x2 = (qreal)(x+w);
y2 = (qreal)(y+h);
}
 
/*!
648,10 → 648,10
 
void FRect::setCoords(qreal xp1, qreal yp1, qreal xp2, qreal yp2 )
{
x1 = xp1;
y1 = yp1;
x2 = xp2;
y2 = yp2;
x1 = (qreal)xp1;
y1 = (qreal)yp1;
x2 = (qreal)xp2;
y2 = (qreal)yp2;
}
 
/*!
661,10 → 661,10
 
void FRect::addCoords( qreal xp1, qreal yp1, qreal xp2, qreal yp2 )
{
x1 += xp1;
y1 += yp1;
x2 += xp2;
y2 += yp2;
x1 += (qreal)xp1;
y1 += (qreal)yp1;
x2 += (qreal)xp2;
y2 += (qreal)yp2;
}
 
/*!
702,7 → 702,7
 
void FRect::setWidth( qreal w )
{
x2 = (x1 + w);
x2 = (qreal)(x1 + w);
}
 
/*!
714,7 → 714,7
 
void FRect::setHeight( qreal h )
{
y2 = (y1 + h);
y2 = (qreal)(y1 + h);
}
 
/*!
726,8 → 726,8
 
void FRect::setSize( const FSize &s )
{
x2 = (s.width() + x1);
y2 = (s.height() + y1);
x2 = (qreal)(s.width() +x1);
y2 = (qreal)(s.height()+y1);
}
 
/*!
/trunk/Scribus/scribus/text/glyphcluster.cpp
1,12 → 1,17
#include "glyphcluster.h"
 
GlyphCluster::GlyphCluster(const CharStyle* style, LayoutFlags flags, int first, int last, const InlineFrame& o, int i, const QString& str)
: m_style(style)
: extraWidth(0.0)
, xoffset(0.0)
, yoffset(0.0)
, m_style(style)
, m_flags(flags)
, m_object(o)
, m_firstChar(first)
, m_lastChar(last)
, m_visualIndex(i)
, m_scaleH(1.0)
, m_scaleV(1.0)
, m_str(str)
{}
 
/trunk/Scribus/scribus/text/glyphcluster.h
43,10 → 43,9
// get text out
QString getText() const;
 
double extraWidth { 0.0 };
double xoffset { 0.0 };
double yoffset { 0.0 };
 
double extraWidth;
double xoffset;
double yoffset;
private:
const CharStyle* m_style;
LayoutFlags m_flags;
55,8 → 54,8
int m_firstChar;
int m_lastChar;
int m_visualIndex;
double m_scaleH { 1.0 };
double m_scaleV { 1.0 };
double m_scaleH;
double m_scaleV;
QString m_str;
};
 
/trunk/Scribus/scribus/text/fsize.cpp
176,8 → 176,8
void FSize::scale( qreal w, qreal h, Qt::AspectRatioMode mode )
{
if ( mode == Qt::IgnoreAspectRatio ) {
m_wd = w;
m_ht = h;
m_wd = (qreal)w;
m_ht = (qreal)h;
} else {
bool useHeight = true;
qreal w0 = width();
191,11 → 191,11
}
 
if ( useHeight ) {
m_wd = rw;
m_ht = h;
m_wd = (qreal)rw;
m_ht = (qreal)h;
} else {
m_wd = w;
m_ht = ( w * h0 / w0 );
m_wd = (qreal)w;
m_ht = (qreal)( w * h0 / w0 );
}
}
}
/trunk/Scribus/scribus/text/fsize.h
84,14 → 84,14
 
friend inline bool operator==( const FSize &, const FSize & );
friend inline bool operator!=( const FSize &, const FSize & );
friend inline FSize operator+( const FSize &, const FSize & );
friend inline FSize operator-( const FSize &, const FSize & );
friend inline FSize operator*( const FSize &, int );
friend inline FSize operator*( int, const FSize & );
friend inline FSize operator*( const FSize &, qreal );
friend inline FSize operator*( qreal, const FSize & );
friend inline FSize operator/( const FSize &, int );
friend inline FSize operator/( const FSize &, qreal );
friend inline const FSize operator+( const FSize &, const FSize & );
friend inline const FSize operator-( const FSize &, const FSize & );
friend inline const FSize operator*( const FSize &, int );
friend inline const FSize operator*( int, const FSize & );
friend inline const FSize operator*( const FSize &, qreal );
friend inline const FSize operator*( qreal, const FSize & );
friend inline const FSize operator/( const FSize &, int );
friend inline const FSize operator/( const FSize &, qreal );
 
private:
static void warningDivByZero();
117,7 → 117,7
{ m_wd = m_ht = -1; }
 
inline FSize::FSize( qreal w, qreal h )
{ m_wd = w; m_ht = h; }
{ m_wd=(qreal)w; m_ht=(qreal)h; }
 
inline bool FSize::isNull() const
{ return m_wd==0 && m_ht==0; }
147,16 → 147,16
{ return m_ht; }
 
inline FSize &FSize::operator+=( const FSize &s )
{ m_wd+=s.m_wd; m_ht += s.m_ht; return *this; }
{ m_wd+=s.m_wd; m_ht+=s.m_ht; return *this; }
 
inline FSize &FSize::operator-=( const FSize &s )
{ m_wd-=s.m_wd; m_ht -= s.m_ht; return *this; }
{ m_wd-=s.m_wd; m_ht-=s.m_ht; return *this; }
 
inline FSize &FSize::operator*=( int c )
{ m_wd*=(qreal)c; m_ht*=(qreal)c; return *this; }
 
inline FSize &FSize::operator*=( qreal c )
{ m_wd = (m_wd * c); m_ht = (m_ht * c); return *this; }
{ m_wd=(qreal)(m_wd*c); m_ht=(qreal)(m_ht*c); return *this; }
 
inline bool operator==( const FSize &s1, const FSize &s2 )
{ return s1.m_wd == s2.m_wd && s1.m_ht == s2.m_ht; }
164,23 → 164,23
inline bool operator!=( const FSize &s1, const FSize &s2 )
{ return s1.m_wd != s2.m_wd || s1.m_ht != s2.m_ht; }
 
inline FSize operator+( const FSize & s1, const FSize & s2 )
inline const FSize operator+( const FSize & s1, const FSize & s2 )
{ return FSize(s1.m_wd+s2.m_wd, s1.m_ht+s2.m_ht); }
 
inline FSize operator-( const FSize &s1, const FSize &s2 )
inline const FSize operator-( const FSize &s1, const FSize &s2 )
{ return FSize(s1.m_wd-s2.m_wd, s1.m_ht-s2.m_ht); }
 
inline FSize operator*( const FSize &s, int c )
inline const FSize operator*( const FSize &s, int c )
{ return FSize(s.m_wd*c, s.m_ht*c); }
 
inline FSize operator*( int c, const FSize &s )
inline const FSize operator*( int c, const FSize &s )
{ return FSize(s.m_wd*c, s.m_ht*c); }
 
inline FSize operator*( const FSize &s, qreal c )
{ return FSize(s.m_wd * c, s.m_ht * c); }
inline const FSize operator*( const FSize &s, qreal c )
{ return FSize((qreal)(s.m_wd*c), (qreal)(s.m_ht*c)); }
 
inline FSize operator*( qreal c, const FSize &s )
{ return FSize(s.m_wd * c, s.m_ht * c); }
inline const FSize operator*( qreal c, const FSize &s )
{ return FSize((qreal)(s.m_wd*c), (qreal)(s.m_ht*c)); }
 
inline FSize &FSize::operator/=( int c )
{
202,7 → 202,7
return *this;
}
 
inline FSize operator/( const FSize &s, int c )
inline const FSize operator/( const FSize &s, int c )
{
#if defined(QT_CHECK_MATH)
if ( c == 0 )
211,23 → 211,23
return FSize(s.m_wd/c, s.m_ht/c);
}
 
inline FSize operator/( const FSize &s, qreal c )
inline const FSize operator/( const FSize &s, qreal c )
{
#if defined(QT_CHECK_MATH)
if ( c == 0.0 )
FSize::warningDivByZero();
#endif
return FSize(s.m_wd / c, s.m_ht / c);
return FSize((qreal)(s.m_wd/c), (qreal)(s.m_ht/c));
}
 
inline FSize FSize::expandedTo( const FSize & otherSize ) const
{
return FSize( qMax(m_wd, otherSize.m_wd), qMax(m_ht, otherSize.m_ht) );
return FSize( qMax(m_wd,otherSize.m_wd), qMax(m_ht,otherSize.m_ht) );
}
 
inline FSize FSize::boundedTo( const FSize & otherSize ) const
{
return FSize( qMin(m_wd, otherSize.m_wd), qMin(m_ht, otherSize.m_ht) );
return FSize( qMin(m_wd,otherSize.m_wd), qMin(m_ht,otherSize.m_ht) );
}
 
 
/trunk/Scribus/scribus/filewatcher.cpp
22,6 → 22,9
 
FileWatcher::FileWatcher( QObject* parent) : QObject(parent)
{
m_stateFlags = 0;
m_timeOut = 10000;
m_watchedFiles.clear();
m_watchTimer = new QTimer(this);
m_watchTimer->setSingleShot(true);
connect(m_watchTimer, SIGNAL(timeout()), this, SLOT(checkFiles()));
136,7 → 139,7
return m_watchedFiles.contains(qtFileName);
}
 
QList<QString> FileWatcher::files() const
QList<QString> FileWatcher::files()
{
return m_watchedFiles.keys();
}
/trunk/Scribus/scribus/filewatcher.h
33,8 → 33,7
void setTimeOut(const int newTimeOut, const bool restartTimer=false);
// Get the timer length
int timeOut() const;
// Get list of watched files and directories
QList<QString> files() const;
QList<QString> files();
public slots:
//Add a file to the watch list for monitoring
66,7 → 65,7
 
};
 
enum StateFlags
typedef enum
{
AddRemoveBlocked = 1,
FileCheckRunning = 2,
74,12 → 73,12
TimerStopped = 8,
Dying = 16,
FileCheckMustStop = 20 //StopRequested + Dying
};
} StateFlags;
 
QMap<QString, fileMod> m_watchedFiles;
QTimer* m_watchTimer { nullptr };
int m_stateFlags { 0 };
int m_timeOut { 10000 }; // milliseconds
QTimer* m_watchTimer;
int m_stateFlags;
int m_timeOut; // milliseconds
 
private slots:
void checkFiles();
/trunk/Scribus/scribus/fpoint.h
43,7 → 43,7
class SCRIBUS_API FPoint
{
public:
FPoint() = default;
FPoint() {}
FPoint(double x, double y) : xp(x), yp(y) {}
FPoint(const QPoint & p) : xp(p.x()), yp(p.y()) {}
FPoint(const QPointF & p) : xp(p.x()), yp(p.y()) {}
50,7 → 50,7
FPoint(const FPoint & p) : xp(p.xp), yp(p.yp) {}
//Creates a transformed point, replaces ScribusView::transformPoint()
FPoint(double x, double y, double dx, double dy, double rot, double sx, double sy, bool invert=false);
 
// ~FPoint() {};
FPoint& operator=(const FPoint & rhs);
double x() const;
double y() const;
61,10 → 61,10
bool operator!=(const FPoint &rhs) const;
FPoint &operator+=( const FPoint &p );
FPoint &operator-=( const FPoint &p );
friend inline FPoint operator+( const FPoint &, const FPoint & );
friend inline FPoint operator-( const FPoint &, const FPoint & );
friend inline FPoint operator*( const FPoint &, const double & );
friend inline FPoint operator*( const double &, const FPoint & );
friend inline const FPoint operator+( const FPoint &, const FPoint & );
friend inline const FPoint operator-( const FPoint &, const FPoint & );
friend inline const FPoint operator*( const FPoint &, const double & );
friend inline const FPoint operator*( const double &, const FPoint & );
friend inline double operator*( const FPoint &a, const FPoint &b );
//Transform an existing point
void transform(double dx, double dy, double rot, double sx, double sy, bool invert);
82,24 → 82,24
};
 
 
inline FPoint operator+( const FPoint &p1, const FPoint &p2 )
inline const FPoint operator+( const FPoint &p1, const FPoint &p2 )
{
return FPoint(p1.xp + p2.xp, p1.yp + p2.yp);
return FPoint(p1.xp+p2.xp, p1.yp+p2.yp);
}
 
inline FPoint operator-( const FPoint &p1, const FPoint &p2 )
inline const FPoint operator-( const FPoint &p1, const FPoint &p2 )
{
return FPoint(p1.xp - p2.xp, p1.yp - p2.yp);
return FPoint(p1.xp-p2.xp, p1.yp-p2.yp);
}
 
inline FPoint operator*( const FPoint &p, const double &c )
inline const FPoint operator*( const FPoint &p, const double &c )
{
return FPoint(p.xp * c, p.yp * c);
return FPoint(p.xp*c, p.yp*c);
}
 
inline FPoint operator*( const double &c, const FPoint &p )
inline const FPoint operator*( const double &c, const FPoint &p )
{
return FPoint(p.xp * c, p.yp * c);
return FPoint(p.xp*c, p.yp*c);
}
 
inline double operator*( const FPoint &a, const FPoint &b )
107,7 → 107,7
return a.xp * b.xp + a.yp * b.yp;
}
 
inline FPoint& FPoint::operator=(const FPoint & rhs)
inline FPoint & FPoint::operator=(const FPoint & rhs)
{
xp = rhs.xp;
yp = rhs.yp;