Commit 752ab03d authored by Jarosław Staniek's avatar Jarosław Staniek

KOffice Libs

-complation fixes for msvc
-one fix for gcc 3.3.x.


svn path=/trunk/koffice/; revision=684826
parent b93fd82b
......@@ -23,10 +23,10 @@
#define KOINTERACTIONSTRATEGY_H
#include <QList>
#include <QPainter>
#include <KoSelection.h>
class QPainter;
class KoPointerEvent;
class QUndoCommand;
class KoCanvasBase;
......
......@@ -22,6 +22,7 @@
#include "KoLineBorder.h"
#include "KoViewConverter.h"
#include "KoShape.h"
#include "KoShapeSavingContext.h"
#include <QPainterPath>
......
......@@ -112,7 +112,7 @@ void KoPathPoint::setControlPoint2( const QPointF & point )
void KoPathPoint::setProperties( KoPointProperties properties )
{
if( properties & HasControlPoint1 == 0 || properties & HasControlPoint2 == 0 )
if( (properties & HasControlPoint1) == 0 || (properties & HasControlPoint2) == 0 )
{
// strip smooth and symmetric flags if points has not two control points
properties &= ~IsSmooth;
......@@ -138,7 +138,7 @@ void KoPathPoint::setProperty( KoPointProperty property )
return;
break;
case HasControlPoint1:
if( d->properties & CanHaveControlPoint1 == 0 )
if( (d->properties & CanHaveControlPoint1) == 0 )
return;
break;
case CanHaveControlPoint2:
......@@ -146,16 +146,16 @@ void KoPathPoint::setProperty( KoPointProperty property )
return;
break;
case HasControlPoint2:
if( d->properties & CanHaveControlPoint2 == 0 )
if( (d->properties & CanHaveControlPoint2) == 0 )
return;
break;
case IsSmooth:
if( d->properties & HasControlPoint1 == 0 && d->properties & HasControlPoint2 == 0 )
if( (d->properties & HasControlPoint1) == 0 && (d->properties & HasControlPoint2) == 0 )
return;
d->properties &= ~IsSymmetric;
break;
case IsSymmetric:
if( d->properties & HasControlPoint1 == 0 && d->properties & HasControlPoint2 == 0 )
if( (d->properties & HasControlPoint1) == 0 && (d->properties & HasControlPoint2) == 0 )
return;
d->properties &= ~IsSmooth;
break;
......
......@@ -385,7 +385,7 @@ void KoPathTool::mousePressEvent( KoPointerEvent *event ) {
{
if( event->button() & Qt::LeftButton )
{
if( event->modifiers() & Qt::ControlModifier == 0 )
if( (event->modifiers() & Qt::ControlModifier) == 0 )
{
m_pointSelection.clear();
}
......
......@@ -445,10 +445,10 @@ double KoShape::rotation() const {
// check if the matrix has shearing mixed in
if( fabs( fabs(d->localMatrix.m12()) - fabs(d->localMatrix.m21()) ) > 1e-10 )
return nan("");
return NAN;
// check if the matrix has scaling mixed in
if( fabs( d->localMatrix.m11() - d->localMatrix.m22() ) > 1e-10 )
return nan("");
return NAN;
// calculate the angle from the matrix elements
double angle = atan2( d->localMatrix.m21(), d->localMatrix.m11() ) * 180.0 / M_PI;
......
......@@ -23,6 +23,8 @@
#include "KoShapeSavingContext.h"
#include "KoXmlWriter.h"
#include <QPainter>
KoShapeGroup::KoShapeGroup()
: KoShapeContainer(new SimpleShapeContainerModel())
{
......
......@@ -25,11 +25,11 @@
#include <KoGenericRegistry.h>
#include <KoXmlReader.h>
#include <KoShapeFactory.h>
#include <flake_export.h>
class KoShape;
class KoShapeFactory;
class KoShapeLoadingContext;
......
......@@ -23,40 +23,16 @@
/* needed for KDE_EXPORT and KDE_IMPORT macros */
#include <kdemacros.h>
/* We use _WIN32/_WIN64 instead of Q_OS_WIN so that this header can be used from C files too */
#if defined _WIN32 || defined _WIN64
#ifndef FLAKE_EXPORT
# if defined(MAKE_FLAKE_LIB)
/* We are building this library */
# define FLAKE_EXPORT KDE_EXPORT
# define FLAKE_TEST_EXPORT KDE_EXPORT
# else
/* We are using this library */
# define FLAKE_EXPORT KDE_IMPORT
# define FLAKE_TEST_EXPORT KDE_IMPORT
# endif
#endif
#else /* UNIX */
#define FLAKE_EXPORT KDE_EXPORT
#endif
/* Now the same for FLAKE_TEST_EXPORT, if compiling with unit tests enabled */
#ifdef COMPILING_TESTS
#if defined _WIN32 || defined _WIN64
# if defined( MAKE_FLAKE_LIB )
# define FLAKE_TEST_EXPORT KDE_EXPORT
# else
# define FLAKE_TEST_EXPORT KDE_IMPORT
# endif
# else /* not windows */
# define FLAKE_TEST_EXPORT KDE_EXPORT
# endif
#else /* not compiling tests */
# define FLAKE_TEST_EXPORT
#endif
#endif
......@@ -49,7 +49,7 @@ public:
* @param character will be filled when the user pressed Ok with the selected character.
* @param parent the parent widget this dialog will be associated with.
*/
KOGUIUTILS_EXPORT static bool selectChar( QString &font, QChar &character, QWidget* parent = 0, const char* name = 0);
static bool selectChar( QString &font, QChar &character, QWidget* parent = 0, const char* name = 0);
signals:
/**
......
......@@ -60,15 +60,6 @@ class KOGUIUTILS_EXPORT KoDualColorButton : public QWidget
Background
};
/**
* Constructs a new KoDualColorButton using the default black and white
* colors.
*
* @param parent The parent widget of the KoDualColorButton.
* @param dialogParent The parent widget of the color selection dialog.
*/
explicit KoDualColorButton( QWidget *parent = 0, QWidget* dialogParent = 0 );
/**
* Constructs a new KoDualColorButton with the supplied foreground and
* background colors.
......
......@@ -74,7 +74,7 @@ protected:
virtual bool viewportEvent(QEvent * e);
private:
class Private;
struct Private;
Private* const d;
};
......
......@@ -63,7 +63,7 @@ class KoTCDIconViewItem : public QListWidgetItem
: QListWidgetItem ( parent )
{}
explicit KoTCDIconViewItem(QListWidget *parent=0, const QString &text=0, const QPixmap &icon=0,
explicit KoTCDIconViewItem(QListWidget *parent, const QString &text=0, const QPixmap &icon=0,
const QString &descr=0, const QString &fullname=0)
: QListWidgetItem(text, parent)
{
......@@ -78,7 +78,6 @@ class KoTCDIconViewItem : public QListWidgetItem
private :
QString m_descr;
QString m_full;
};
class KoTemplateChooseDiaPrivate;
......
......@@ -22,6 +22,7 @@
#include "KoPAStyles.h"
#include <QDebug>
#include <QPainter>
#include <KoShapeSavingContext.h>
#include <KoShapeLayer.h>
......
......@@ -26,12 +26,12 @@
#include <KoShapeContainer.h>
#include <KoXmlReader.h>
#include <KoPASavingContext.h>
#include "kopageapp_export.h"
class KoPageLayout;
struct KoPageLayout;
class KoOasisLoadingContext;
class KoPASavingContext;
class KoGenStyle;
class KoShape;
......
......@@ -23,40 +23,16 @@
/* needed for KDE_EXPORT and KDE_IMPORT macros */
#include <kdemacros.h>
/* We use _WIN32/_WIN64 instead of Q_OS_WIN so that this header can be used from C files too */
#if defined _WIN32 || defined _WIN64
#ifndef KOPAGEAPP_EXPORT
# if defined(MAKE_KOPAGEAPP_LIB)
/* We are building this library */
# define KOPAGEAPP_EXPORT KDE_EXPORT
# define KOPAGEAPP_TEST_EXPORT KDE_EXPORT
# else
/* We are using this library */
# define KOPAGEAPP_EXPORT KDE_IMPORT
# define KOPAGEAPP_TEST_EXPORT KDE_IMPORT
# endif
#endif
#else /* UNIX */
#define KOPAGEAPP_EXPORT KDE_EXPORT
#endif
/* Now the same for KOPAGEAPP_TEST_EXPORT, if compiling with unit tests enabled */
#ifdef COMPILING_TESTS
#if defined _WIN32 || defined _WIN64
# if defined( MAKE_KOPAGEAPP_LIB )
# define KOPAGEAPP_TEST_EXPORT KDE_EXPORT
# else
# define KOPAGEAPP_TEST_EXPORT KDE_IMPORT
# endif
# else /* not windows */
# define KOPAGEAPP_TEST_EXPORT KDE_EXPORT
# endif
#else /* not compiling tests */
# define KOPAGEAPP_TEST_EXPORT
#endif
#endif
......@@ -25,6 +25,7 @@
#include <QTextInlineObject>
#include <QFontMetricsF>
#include <QPainter>
#include <KDebug>
class KoTextAnchor::Private {
......
......@@ -21,11 +21,9 @@
#define KOTEXTEDITINGREGISTRY_H
#include <KoGenericRegistry.h>
#include <kotext_export.h>
#include <KoTextEditingFactory.h>
#include <QObject>
class KoTextEditingFactory;
/**
* This singleton class keeps a register of all available text editing plugins.
* The text editing plugins are all about handling user input while (s)he
......
......@@ -137,7 +137,7 @@ void KoTextShapeContainerModel::proposeMove(KoShape *child, QPointF &move) {
//relation->anchor->setOffset(offset);
} */
if(qAbs(newPosition.y() < 10)) // TopOfFrame
if(qAbs(newPosition.y()) < 10.0) // TopOfFrame
{//kDebug() << " TopOfFrame\n";
relation->anchor->setAlignment(KoTextAnchor::TopOfFrame);
}
......
......@@ -1183,8 +1183,8 @@ void KoWmfReadPrivate::xyToAngle( int xStart, int yStart, int xEnd, int yEnd, in
{
double aStart, aLength;
aStart = atan2( yStart, xStart );
aLength = atan2( yEnd, xEnd ) - aStart;
aStart = atan2( (double)yStart, (double)xStart );
aLength = atan2( (double)yEnd, (double)xEnd ) - aStart;
angleStart = (int)((aStart * 2880) / 3.14166);
angleLength = (int)((aLength * 2880) / 3.14166);
......
......@@ -752,7 +752,7 @@ void QWinMetaFile::extTextOut( long num, short* parm )
else
ptStr = (char*)&parm[ 4 ];
Q3CString text( ptStr, parm[ 2 ] + 1 );
QByteArray text( ptStr, parm[ 2 ] + 1 );
QFontMetrics fm( mPainter.font() );
width = fm.width( text ) + fm.descent(); // because fm.width(text) isn't rigth with Italic text
......@@ -1141,8 +1141,8 @@ void QWinMetaFile::xyToAngle( int xStart, int yStart, int xEnd, int yEnd, int& a
{
float aStart, aLength;
aStart = atan2( yStart, xStart );
aLength = atan2( yEnd, xEnd ) - aStart;
aStart = atan2( (double)yStart, (double)xStart );
aLength = atan2( (double)yEnd, (double)xEnd ) - aStart;
angleStart = (int)(aStart * 2880 / 3.14166);
angleLength = (int)(aLength * 2880 / 3.14166);
......
......@@ -38,6 +38,10 @@ public:
/// @return the id of the dock widget
virtual QString id() const = 0;
/// @return the name the dock widget (actually a null string);
/// needed only when used with KoGenericRegistry.
QString name() const { return QString(); }
/// @return the dock widget area the widget should appear in by default
virtual Qt::DockWidgetArea defaultDockWidgetArea() const = 0;
......
......@@ -2868,7 +2868,7 @@ void KoDocument::deleteOpenPaneDelayed()
d->m_startUpWidget = 0;
}
QWidget* KoDocument::createCustomDocumentWidget(QWidget */*parent*/) {
QWidget* KoDocument::createCustomDocumentWidget(QWidget * /*parent*/) {
return 0;
}
......
......@@ -111,18 +111,18 @@ void KoFileDialog::setSpecialMimeFilter( QStringList& mimeFilter,
slotChangedfilter( filterWidget()->currentIndex() );
}
// [Mainly KWord] Tell MS Office users that they can save in RTF!
int i = 0;
int itemIndex = 0;
QString tmpString;
QString compatString;
foreach( tmpString, mimeFilter )
{
KMimeType::Ptr mime = KMimeType::mimeType( tmpString );
if ( ! mime )
if ( ! mime )
mime = KMimeType::defaultMimeTypePtr();
compatString = mime->property ("X-KDE-CompatibleApplication").toString ();
if (!compatString.isEmpty ())
filterWidget()->setItemText( i, i18n ("%1 (%2 Compatible)", mime->comment (), compatString) );
i++;
filterWidget()->setItemText( itemIndex, i18n ("%1 (%2 Compatible)", mime->comment (), compatString) );
itemIndex++;
}
}
......
......@@ -102,7 +102,7 @@ public:
* information here.
* Optionally, @p extraNativeMimeTypes are added after the native mimetype.
*/
KOMAIN_EXPORT static QStringList mimeFilter( const QByteArray& mimetype, Direction direction,
static QStringList mimeFilter( const QByteArray& mimetype, Direction direction,
const QStringList& extraNativeMimeTypes = QStringList() );
/**
......
......@@ -119,8 +119,10 @@ public:
QList<KoID> listKeys() const
{
QList<KoID> answer;
foreach(QString key, m_hash.keys())
answer.append(KoID(key, value(key)->name()));
QList<QString> keys(m_hash.keys());
// we do not use foreach() here because of GCC 3.3.x bug
for (QList<QString>::const_iterator it(keys.constBegin()); it!=keys.constEnd(); ++it)
answer.append(KoID(*it, value(*it)->name()));
return answer;
}
......
......@@ -63,6 +63,14 @@ public:
*/
KoPicture& operator=(const KoPicture& other);
/**
* Comparison operator
*/
bool operator==(const KoPicture& other) const { return m_key==other.m_key; }
/**
* Returns type of the picture.
*/
KoPictureType::Type getType(void) const;
/**
......
......@@ -40,7 +40,7 @@
* This class implements a R-tree as described in
* "R-TREES. A DYNAMIC INDEX STRUCTURE FOR SPATIAL SEARCHING" by Antomn Guttman
*
* It only supports 2 dimentional bounding boxes which are repesented by a QRectF.
* It only supports 2 dimensional bounding boxes which are repesented by a QRectF.
* For node splitting the Quadratic-Cost Algorithm is used as descibed by Guttman.
*/
template <typename T>
......@@ -480,7 +480,7 @@ void KoRTree<T>::debug() const
#endif
template <typename T>
QPair< typename KoRTree<T>::Node*, typename KoRTree<T>::Node* > KoRTree<T>::splitNode( KoRTree<T>::Node* node )
QPair< typename KoRTree<T>::Node*, typename KoRTree<T>::Node* > KoRTree<T>::splitNode( typename KoRTree<T>::Node* node )
{
//qDebug() << "KoRTree::splitNode" << node;
Node * n1;
......
......@@ -43,7 +43,7 @@ QStringList KoUnit::listOfUnitName(bool hidePixel)
uint KoUnit::indexInList(bool hidePixel)
{
if(hidePixel and m_unit > Pixel)
if(hidePixel && m_unit > Pixel)
return m_unit-1;
else
return m_unit;
......
......@@ -23,9 +23,6 @@
/* needed for KDE_EXPORT and KDE_IMPORT macros */
#include <kdemacros.h>
/* We use _WIN32/_WIN64 instead of Q_OS_WIN so that this header can be used from C files too */
#if defined _WIN32 || defined _WIN64
#ifndef KOMAIN_EXPORT
# if defined(MAKE_KOMAIN_LIB)
/* We are building this library */
......@@ -36,10 +33,4 @@
# endif
#endif
#else /* UNIX */
#define KOMAIN_EXPORT KDE_EXPORT
#endif
#endif
......@@ -41,7 +41,7 @@ static const char* const keys[] = { "one", "two", "three", "four", "five",
"six", "seven", "eight", "nine", "ten",
"eleven", "twelve", 0 };
int main( int /*argc*/, char **/*argv*/ )
int main( int /*argc*/, char ** /*argv*/ )
{
Q3PtrList<Node> list;
list.setAutoDelete( true );
......
/*
* Copyright (C) 2006-2007 Thomas Zander <zander@kde.org>
*
......@@ -18,7 +19,7 @@
*/
#ifndef TW_ACTIONJOB_H
#define TW_ACTIONJOB_H
#include <Job.h>
#include <threadweaver/Job.h>
#include <QSemaphore>
#include <QVariant>
......
......@@ -21,7 +21,7 @@
#include "KoExecutePolicy.h"
#include "ActionJob_p.h"
#include <WeaverInterface.h>
#include <threadweaver/WeaverInterface.h>
class KoAction::Private {
public:
......
......@@ -19,7 +19,7 @@
#ifndef KO_ACTION_H
#define KO_ACTION_H
#include <ThreadWeaver.h>
#include <threadweaver/ThreadWeaver.h>
#include "kofficecore_export.h"
......
......@@ -23,7 +23,7 @@
#include "ActionJob_p.h"
#include "KoJobsListPolicy.h"
#include <WeaverInterface.h>
#include <threadweaver/WeaverInterface.h>
#include <KDebug>
using namespace ThreadWeaver;
......
......@@ -17,7 +17,7 @@
* Boston, MA 02110-1301, USA.
*/
#include "KoJobsListPolicy.h"
#include <Job.h>
#include <threadweaver/Job.h>
using namespace ThreadWeaver;
......
......@@ -18,7 +18,7 @@
*/
#ifndef TW_JOBSLISTPOLICY_H
#define TW_JOBSLISTPOLICY_H
#include <QueuePolicy.h>
#include <threadweaver/QueuePolicy.h>
#include <QMutex>
#include <QList>
......
......@@ -612,7 +612,7 @@ private:
*/
QVector<quint8> * threadLocalConversionCache(quint32 size) const;
class Private;
struct Private;
Private * const d;
};
......
......@@ -225,7 +225,7 @@ KoColorSpace * KoColorSpaceRegistry::colorSpace(const QString &csID, const QStri
}
KoColorProfile *p = profileByName(profileName);
if(not p and not profileName.isEmpty())
if(!p && !profileName.isEmpty())
{
kDebug() << "Profile not found : " << profileName << endl;
return 0;
......
......@@ -171,7 +171,7 @@ private:
void init();
private:
class Private;
struct Private;
Private * const d;
};
......
......@@ -219,7 +219,7 @@ class KoLcmsColorSpace : public KoColorSpaceAbstract<_CSTraits>, public KoLcmsIn
virtual bool profileIsCompatible(KoColorProfile* profile) const
{
KoLcmsColorProfile* p = dynamic_cast<KoLcmsColorProfile*>(profile);
return (p and p->colorSpaceSignature() == colorSpaceSignature());
return (p && p->colorSpaceSignature() == colorSpaceSignature());
}
virtual void fromQColor(const QColor& color, quint8 *dst, KoColorProfile * koprofile=0) const
......@@ -647,7 +647,7 @@ class KoLcmsColorSpaceFactory : public KoColorSpaceFactory, private KoLcmsInfo {
virtual bool profileIsCompatible(KoColorProfile* profile) const
{
KoLcmsColorProfile* p = dynamic_cast<KoLcmsColorProfile*>(profile);
return p and p->colorSpaceSignature() == colorSpaceSignature();
return p && p->colorSpaceSignature() == colorSpaceSignature();
}
};
......
......@@ -295,7 +295,7 @@ void KoAlphaColorSpace::alpha(const quint8 *pixel, quint8 *alpha) const
*alpha = *pixel;
}
void KoAlphaColorSpace::toQColor(const quint8 */*src*/, QColor *c, KoColorProfile * /*profile*/) const
void KoAlphaColorSpace::toQColor(const quint8 * /*src*/, QColor *c, KoColorProfile * /*profile*/) const
{
c->setRgb(255, 255, 255);
}
......
......@@ -42,7 +42,7 @@ struct KoColorSetEntry {
* Open Gimp, Photoshop or RIFF palette files. This is a straight port
* from the Gimp.
*/
class KORESOURCE_EXPORT KoColorSet : public KoResource {
class KORESOURCES_EXPORT KoColorSet : public KoResource {
typedef KoResource super;
Q_OBJECT
......
......@@ -30,7 +30,7 @@
*
* This replaces the KisKrayon facility that used to be present in Krayon.
*/
class KORESOURCE_EXPORT KoResource : public QObject {
class KORESOURCES_EXPORT KoResource : public QObject {
typedef QObject super;
Q_OBJECT
......
......@@ -17,29 +17,20 @@
Boston, MA 02110-1301, USA.
*/
#ifndef KORESOURCE_EXPORT_H
#define KORESOURCE_EXPORT_H
#ifndef KORESOURCES_EXPORT_H
#define KORESOURCES_EXPORT_H
/* needed for KDE_EXPORT and KDE_IMPORT macros */
#include <kdemacros.h>
/* We use _WIN32/_WIN64 instead of Q_OS_WIN so that this header can be used from C files too */
#if defined _WIN32 || defined _WIN64
#ifndef KORESOURCE_EXPORT
# if defined(MAKE_KORESOURCE_LIB)