Commit f667123d authored by Stefan Nikolaus's avatar Stefan Nikolaus

constify d pointers

svn path=/trunk/koffice/; revision=629473
parent 83226b21
......@@ -101,7 +101,6 @@ KoShape::KoShape()
KoShape::~KoShape()
{
delete d;
d = 0;
}
void KoShape::paintDecorations(QPainter &painter, const KoViewConverter &converter, bool selected) {
......
......@@ -550,7 +550,7 @@ private:
void addShapeManager( KoShapeManager * manager );
void removeShapeManager( KoShapeManager * manager );
KoShapePrivate *d;
KoShapePrivate * const d;
};
#endif
......@@ -270,7 +270,7 @@ private:
KoTool(const KoTool&);
KoTool& operator=(const KoTool&);
KoToolPrivate *d;
KoToolPrivate * const d;
};
#endif /* KOTOOL_H */
......@@ -56,10 +56,9 @@ public:
};
KoApplication::KoApplication()
: KApplication( initHack() )
: KApplication( initHack() )
, d( new KoApplicationPrivate )
{
d = new KoApplicationPrivate;
// Tell the iconloader about share/apps/koffice/icons
KIconLoader::global()->addAppDir("koffice");
......
......@@ -76,7 +76,7 @@ public:
private:
bool initHack();
KoApplicationPrivate* d;
KoApplicationPrivate * const d;
static bool m_starting ; ///< is the application starting or not
class ResetStarting;
friend class ResetStarting;
......
......@@ -53,10 +53,9 @@ public:
};
KoChild::KoChild( QObject *parent, const char* /*name*/ )
: QObject( parent )
: QObject( parent )
, d( new KoChildPrivate )
{
d = new KoChildPrivate;
d->m_scaleX = d->m_scaleY = 1.0;
d->m_shearX = d->m_shearY = 0.0;
d->m_rotation = 0.0;
......
......@@ -308,7 +308,7 @@ protected:
private:
class KoChildPrivate;
KoChildPrivate *d;
KoChildPrivate * const d;
};
#endif
......@@ -76,16 +76,15 @@ public:
KoPartResizeHandler::KoPartResizeHandler( QWidget* widget, const QMatrix& matrix, KoView* view, KoChild* child,
KoChild::Gadget gadget, const QPoint& point )
: KoEventHandler( widget )
,d( new KoPartResizeHandlerPrivate(matrix, view, child, gadget, point) )
{
child->lock();
d=new KoPartResizeHandlerPrivate(matrix, view, child, gadget, point);
}
KoPartResizeHandler::~KoPartResizeHandler()
{
d->m_child->unlock();
delete d;
d=0L;
}
void KoPartResizeHandler::repaint(QRegion &rgn)
......@@ -235,16 +234,15 @@ public:
KoPartMoveHandler::KoPartMoveHandler( QWidget* widget, const QMatrix& matrix, KoView* view, KoChild* child,
const QPoint& point )
: KoEventHandler( widget )
, d( new KoPartMoveHandlerPrivate(matrix, view, child, point) )
{
child->lock();
d=new KoPartMoveHandlerPrivate(matrix, view, child, point);
}
KoPartMoveHandler::~KoPartMoveHandler()
{
d->m_dragChild->unlock();
delete d;
d=0L;
}
bool KoPartMoveHandler::eventFilter( QObject*, QEvent* ev )
......
......@@ -73,7 +73,7 @@ protected:
bool eventFilter( QObject*, QEvent* );
private:
KoPartResizeHandlerPrivate *d;
KoPartResizeHandlerPrivate * const d;
};
/**
......@@ -92,7 +92,7 @@ protected:
bool eventFilter( QObject*, QEvent* );
private:
KoPartMoveHandlerPrivate *d;
KoPartMoveHandlerPrivate * const d;
};
/**
......
......@@ -62,7 +62,7 @@ class KoDetailsPane : public QWidget, public Ui_KoDetailsPaneBase
void changePalette();
private:
KoDetailsPanePrivate* d;
KoDetailsPanePrivate * const d;
};
#endif //KODETAILSPANE_H
......@@ -252,12 +252,12 @@ void KoBrowserExtension::print()
KoDocument::KoDocument( QWidget * parentWidget, QObject* parent, bool singleViewMode )
: KParts::ReadWritePart( parent )
, d( new Private )
{
if(s_documentList==0L)
s_documentList=new Q3PtrList<KoDocument>;
s_documentList->append(this);
d = new Private;
m_bEmpty = true;
connect( &d->m_autoSaveTimer, SIGNAL( timeout() ), this, SLOT( slotAutoSave() ) );
setAutoSave( s_defaultAutoSave );
......
......@@ -1189,7 +1189,7 @@ private:
bool savePreview( KoStore* store );
bool saveOasisPreview( KoStore* store, KoXmlWriter* manifestWriter );
class Private;
Private *d;
Private * const d;
KService::Ptr m_nativeService;
bool m_bEmpty;
KoGridData m_gridData;
......
......@@ -68,8 +68,8 @@ public:
KoDocumentChild::KoDocumentChild( KoDocument* parent, KoDocument* doc, const QRect& geometry )
: KoChild( parent )
, d( new KoDocumentChildPrivate )
{
d = new KoDocumentChildPrivate;
d->m_parent = parent;
d->m_doc = doc;
setGeometry( geometry );
......@@ -80,8 +80,8 @@ KoDocumentChild::KoDocumentChild( KoDocument* parent, KoDocument* doc, const QRe
KoDocumentChild::KoDocumentChild( KoDocument* parent )
: KoChild( parent )
, d( new KoDocumentChildPrivate )
{
d = new KoDocumentChildPrivate;
d->m_parent = parent;
d->m_doc = 0L;
d->m_deleted = false;
......
......@@ -178,7 +178,7 @@ private:
bool finishLoadingDocument( KoStore* store, KoDocument* doc, bool doOpenURL, bool oasis );
private:
KoDocumentChildPrivate *d;
KoDocumentChildPrivate * const d;
};
#endif
......@@ -58,8 +58,8 @@ public:
KoDocumentInfoDlg::KoDocumentInfoDlg( QWidget* parent, KoDocumentInfo* docInfo )
: KPageDialog( parent )
, d( new KoDocumentInfoDlgPrivate )
{
d = new KoDocumentInfoDlgPrivate;
d->m_info = docInfo;
setCaption( i18n( "Document Information" ) );
......
......@@ -82,7 +82,7 @@ class KOFFICECORE_EXPORT KoDocumentInfoDlg : public KPageDialog
void saveAuthorData();
class KoDocumentInfoDlgPrivate;
KoDocumentInfoDlgPrivate *d;
KoDocumentInfoDlgPrivate * const d;
};
#endif
......@@ -50,9 +50,9 @@ public:
KoDocumentInfoPropsPage::KoDocumentInfoPropsPage( KPropertiesDialog *props,
const QStringList & )
: KPropertiesDialogPlugin( props )
: KPropertiesDialogPlugin( props )
, d( new KoDocumentInfoPropsPagePrivate )
{
d = new KoDocumentInfoPropsPagePrivate;
d->m_info = new KoDocumentInfo( this );
d->m_url = props->item()->url();
d->m_dlg = 0;
......
......@@ -40,7 +40,7 @@ public:
private:
void copy( const QString &path, const KArchiveEntry *entry );
class KoDocumentInfoPropsPagePrivate;
KoDocumentInfoPropsPagePrivate *d;
KoDocumentInfoPropsPagePrivate * const d;
};
#endif
......@@ -33,14 +33,14 @@ public:
KoFactory::KoFactory( QObject *parent, const char *name )
: KParts::Factory( parent )
, d( 0 )
{
setObjectName(name);
//d = new KoFactoryPrivate;
}
KoFactory::~KoFactory()
{
//delete d;
delete d;
}
#include <KoFactory.moc>
......@@ -33,7 +33,7 @@ public:
private:
class KoFactoryPrivate;
KoFactoryPrivate *d;
KoFactoryPrivate * const d;
};
#endif
......@@ -29,12 +29,21 @@
#include <KoFilterManager.h>
KoFilter::KoFilter( QObject* parent ) : QObject( parent ), m_chain( 0 )
class KoFilter::Private
{
};
class KoEmbeddingFilter::Private
{
};
KoFilter::KoFilter( QObject* parent ) : QObject( parent ), m_chain( 0 ), d( 0 )
{
}
KoFilter::~KoFilter()
{
delete d;
}
......@@ -43,6 +52,7 @@ KoEmbeddingFilter::~KoEmbeddingFilter()
if ( m_partStack.count() != 1 )
kWarning() << "Someone messed with the part stack" << endl;
delete m_partStack.pop();
delete d;
}
int KoEmbeddingFilter::lruPartIndex() const
......@@ -60,7 +70,7 @@ QString KoEmbeddingFilter::mimeTypeByExtension( const QString& extension )
return m->name();
}
KoEmbeddingFilter::KoEmbeddingFilter() : KoFilter()
KoEmbeddingFilter::KoEmbeddingFilter() : KoFilter(), d( 0 )
{
m_partStack.push( new PartState() );
}
......
......@@ -110,7 +110,7 @@ private:
KoFilter& operator=( const KoFilter& rhs );
class Private;
Private* d;
Private * const d;
};
......@@ -309,7 +309,7 @@ private:
Q3PtrStack<PartState> m_partStack;
class Private;
Private* d;
Private * const d;
};
#endif
......@@ -208,7 +208,7 @@ private:
KoFilter* m_filter;
class Private;
Private* d;
Private * const d;
};
// "A whole is that which has beginning, middle, and end" - Aristotle
......@@ -252,7 +252,7 @@ private:
QStringList m_internalEmbeddingDirectories;
class Private;
Private* d;
Private * const d;
};
......@@ -296,7 +296,7 @@ namespace KOffice
KoFilterEntry::Ptr m_filterEntry;
class Private;
Private* d;
Private * const d;
};
......@@ -355,7 +355,7 @@ namespace KOffice
int m_index; // position inside the queue, needed for a fast keyDecreased()
class Private;
Private* d;
Private * const d;
};
......@@ -400,7 +400,7 @@ namespace KOffice
bool m_graphValid;
class Private;
Private* d;
Private * const d;
};
} // namespace KOffice
......
......@@ -123,9 +123,8 @@ const int KoFilterManager::s_area = 30500;
KoFilterManager::KoFilterManager( KoDocument* document ) :
m_document( document ), m_parentChain( 0 ), m_graph( "" ), d( 0 )
m_document( document ), m_parentChain( 0 ), m_graph( "" ), d( new Private )
{
d = new KoFilterManager::Private;
d -> m_batch = false;
if ( document )
QObject::connect( this, SIGNAL( sigProgress( int ) ),
......@@ -136,9 +135,8 @@ KoFilterManager::KoFilterManager( KoDocument* document ) :
KoFilterManager::KoFilterManager( const QString& url, const QByteArray& mimetypeHint,
KoFilterChain* const parentChain ) :
m_document( 0 ), m_parentChain( parentChain ), m_importUrl( url ), m_importUrlMimetypeHint( mimetypeHint ),
m_graph( "" ), d( 0 )
m_graph( "" ), d( new Private )
{
d = new KoFilterManager::Private;
d -> m_batch = false;
}
......
......@@ -174,7 +174,7 @@ private:
static QMap<QString, bool> m_filterAvailable;
class Private;
Private *d;
Private * const d;
};
#endif // __koffice_filter_manager_h__
......@@ -55,8 +55,8 @@ public:
KoFrame::KoFrame( QWidget *parent, const char* /*name*/ )
: QWidget( parent )
, d( new KoFramePrivate )
{
d = new KoFramePrivate;
d->m_state = Inactive;
d->m_mode = -1;
d->m_view = 0;
......
......@@ -64,7 +64,7 @@ protected:
virtual bool eventFilter( QObject*, QEvent* );
private:
KoFramePrivate *d;
KoFramePrivate * const d;
};
#endif
......@@ -23,12 +23,18 @@
//Added by qt3to4:
#include <Q3ValueList>
class KoGenStyles::Private
{
};
KoGenStyles::KoGenStyles()
: d( 0 )
{
}
KoGenStyles::~KoGenStyles()
{
delete d;
}
QString KoGenStyles::lookup( const KoGenStyle& style, const QString& name, int flags )
......
......@@ -170,7 +170,7 @@ private:
StyleArray m_styleArray;
class Private;
Private *d;
Private * const d;
};
#endif /* KOGENSTYLES_H */
......@@ -198,11 +198,11 @@ public:
};
KoMainWindow::KoMainWindow( const KComponentData &componentData )
: KParts::MainWindow( )
: KParts::MainWindow()
, d( new KoMainWindowPrivate )
{
setStandardToolBarMenuEnabled(true);
Q_ASSERT(componentData.isValid());
d = new KoMainWindowPrivate;
d->m_manager = new KoPartManager( this );
......
......@@ -398,7 +398,7 @@ private slots:
void slotSaveCanceled(const QString &);
private:
KoMainWindowPrivate *d;
KoMainWindowPrivate * const d;
};
......
......@@ -24,10 +24,14 @@
#include <kdebug.h>
#include <KoDom.h>
class KoOasisLoadingContext::Private
{
};
KoOasisLoadingContext::KoOasisLoadingContext( KoDocument* doc,
KoOasisStyles& styles, KoStore* store )
: m_doc( doc ), m_store( store ), m_styles( styles ),
m_metaXmlParsed( false ), m_useStylesAutoStyles( false )
m_metaXmlParsed( false ), m_useStylesAutoStyles( false ), d( 0 )
{
// Ideally this should be done by KoDocument and passed as argument here...
KoOasisStore oasisStore( store );
......@@ -38,7 +42,7 @@ KoOasisLoadingContext::KoOasisLoadingContext( KoDocument* doc,
KoOasisLoadingContext::~KoOasisLoadingContext()
{
delete d;
}
void KoOasisLoadingContext::fillStyleStack( const KoXmlElement& object, const char* nsURI, const char* attrName, const char* family )
......
......@@ -116,7 +116,7 @@ private:
KoXmlDocument m_manifestDoc;
class Private;
Private *d;
Private * const d;
};
#endif /* KOOASISLOADINGCONTEXT_H */
......
......@@ -22,9 +22,14 @@
#include "KoDom.h"
#include <kdebug.h>
class KoOasisSettings::Private
{
};
KoOasisSettings::KoOasisSettings( const KoXmlDocument& doc )
: m_settingsElement( KoDom::namedItemNS( doc.documentElement(), KoXmlNS::office, "settings" ) ),
m_configNSURI( KoXmlNS::config )
, d( 0 )
{
const KoXmlElement contents = doc.documentElement();
if ( m_settingsElement.isNull() )
......@@ -34,12 +39,18 @@ KoOasisSettings::KoOasisSettings( const KoXmlDocument& doc )
KoOasisSettings::KoOasisSettings( const KoXmlDocument& doc, const char* officeNSURI, const char* configNSURI )
: m_settingsElement( KoDom::namedItemNS( doc.documentElement(), officeNSURI, "settings" ) ),
m_configNSURI( configNSURI )
, d( 0 )
{
const KoXmlElement contents = doc.documentElement();
if ( m_settingsElement.isNull() )
kDebug(30003) << " document doesn't have tag 'office:settings'\n";
}
KoOasisSettings::~KoOasisSettings()
{
delete d;
}
KoOasisSettings::Items KoOasisSettings::itemSet( const QString& itemSetName ) const
{
KoXmlElement e;
......
......@@ -81,6 +81,8 @@ public:
*/
KoOasisSettings( const KoXmlDocument& doc, const char* officeNSURI, const char* configNSURI );
~KoOasisSettings();
class Items;
/**
......@@ -174,7 +176,7 @@ private:
const char* m_configNSURI;
class Private;
Private* d;
Private * const d;
};
#endif
......@@ -101,8 +101,8 @@ class KoOpenPanePrivate : public Ui_KoOpenPaneBase
KoOpenPane::KoOpenPane(QWidget *parent, const KComponentData &componentData, const QString& templateType)
: QWidget(parent)
, d( new KoOpenPanePrivate )
{
d = new KoOpenPanePrivate;
d->m_componentData = componentData;
d->setupUi(this);
......
......@@ -89,7 +89,7 @@ class KoOpenPane : public QWidget
void updateSectionListMaxHeight();
private:
KoOpenPanePrivate* d;
KoOpenPanePrivate * const d;
};
#endif //KOOPENPANE_H
......@@ -32,6 +32,11 @@
//#define DEBUG_PICTURES
KoPictureCollection::KoPictureCollection()
: d( 0 )
{
}
KoPicture KoPictureCollection::findPicture(const KoPictureKey& key) const
{
#ifdef DEBUG_PICTURES
......
......@@ -50,6 +50,8 @@ public:
CollectionClipart
};
KoPictureCollection();
/**
* Looks for a clipart in the collection, returns a new KoPicture with that key if not found.
*/
......@@ -166,7 +168,7 @@ private:
QString getFileName(const Type pictureType, KoPicture& picture, int& counter);
class Private;