summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorOswald Buddenhagen <oswald.buddenhagen@digia.com>2014-01-15 22:17:52 +0100
committerThe Qt Project <gerrit-noreply@qt-project.org>2014-01-20 13:10:01 +0100
commitb29f51357b4d18f33f5d522994aeff149737b358 (patch)
tree4c71185e39afc5a30b483b56cc1c96136196396f
parent6e55d96d899b78d17de022f2e1d93f210ff7a1d0 (diff)
whitespace fixes
expand tabs, fix indentation, remove trailing whitespace. Change-Id: Ibec1bbad9e8faff81671ce9d1c7bb4fb9b340bb9 Reviewed-by: Joerg Bornemann <joerg.bornemann@digia.com>
-rw-r--r--examples/activeqt/hierarchy/hierarchy.pro6
-rw-r--r--examples/activeqt/hierarchy/objects.cpp2
-rw-r--r--examples/activeqt/hierarchy/objects.h2
-rw-r--r--examples/activeqt/menus/main.cpp14
-rw-r--r--examples/activeqt/menus/menus.cpp6
-rw-r--r--examples/activeqt/menus/menus.pro6
-rw-r--r--examples/activeqt/multiple/ax1.h14
-rw-r--r--examples/activeqt/multiple/ax2.h22
-rw-r--r--examples/activeqt/multiple/multiple.pro6
-rw-r--r--examples/activeqt/opengl/glbox.cpp44
-rw-r--r--examples/activeqt/opengl/glbox.h16
-rw-r--r--examples/activeqt/opengl/main.cpp24
-rw-r--r--examples/activeqt/opengl/opengl.pro12
-rw-r--r--examples/activeqt/qutlook/addressview.cpp8
-rw-r--r--examples/activeqt/qutlook/qutlook.pro2
-rw-r--r--examples/activeqt/simple/main.cpp70
-rw-r--r--examples/activeqt/simple/simple.pro4
-rw-r--r--examples/activeqt/webbrowser/main.cpp20
-rw-r--r--examples/activeqt/webbrowser/webaxwidget.h4
-rw-r--r--examples/activeqt/webbrowser/webbrowser.pro4
-rw-r--r--examples/activeqt/wrapper/main.cpp112
-rw-r--r--examples/activeqt/wrapper/wrapper.pro6
-rw-r--r--src/activeqt/container/qaxbase.cpp28
-rw-r--r--src/activeqt/container/qaxbase.h28
-rw-r--r--src/activeqt/container/qaxdump.cpp212
-rw-r--r--src/activeqt/container/qaxobject.cpp6
-rw-r--r--src/activeqt/container/qaxobject.h2
-rw-r--r--src/activeqt/container/qaxscript.cpp8
-rw-r--r--src/activeqt/container/qaxscript.h70
-rw-r--r--src/activeqt/container/qaxwidget.cpp4
-rw-r--r--src/activeqt/container/qaxwidget.h6
-rw-r--r--src/activeqt/control/control.pro2
-rw-r--r--src/activeqt/control/qaxaggregated.h2
-rw-r--r--src/activeqt/control/qaxfactory.cpp2
-rw-r--r--src/activeqt/control/qaxfactory.h38
-rw-r--r--src/activeqt/control/qaxserver.cpp306
-rw-r--r--src/activeqt/control/qaxserverbase.cpp2170
-rw-r--r--src/activeqt/control/qaxserverdll.cpp14
-rw-r--r--src/activeqt/control/qaxservermain.cpp28
-rw-r--r--src/activeqt/doc/snippets/doc_src_qaxserver.cpp2
-rw-r--r--src/activeqt/doc/snippets/src_activeqt_container_qaxbase.cpp20
-rw-r--r--src/activeqt/doc/snippets/src_activeqt_control_qaxfactory.cpp8
-rw-r--r--src/activeqt/shared/qaxtypes.cpp162
-rw-r--r--tools/dumpcpp/main.cpp30
-rw-r--r--tools/dumpdoc/main.cpp22
-rw-r--r--tools/testcon/ambientproperties.cpp4
-rw-r--r--tools/testcon/changeproperties.cpp268
-rw-r--r--tools/testcon/controlinfo.cpp16
-rw-r--r--tools/testcon/docuwindow.cpp14
-rw-r--r--tools/testcon/invokemethod.cpp52
-rw-r--r--tools/testcon/main.cpp12
-rw-r--r--tools/testcon/mainwindow.cpp116
-rw-r--r--tools/testcon/scripts/javascript.js12
-rw-r--r--tools/testcon/scripts/perlscript.pl12
-rw-r--r--tools/testcon/scripts/vbscript.vbs12
-rw-r--r--tools/testcon/testcon.pro6
-rw-r--r--tools/tools.pro2
57 files changed, 2050 insertions, 2050 deletions
diff --git a/examples/activeqt/hierarchy/hierarchy.pro b/examples/activeqt/hierarchy/hierarchy.pro
index ba8765a..c0d534f 100644
--- a/examples/activeqt/hierarchy/hierarchy.pro
+++ b/examples/activeqt/hierarchy/hierarchy.pro
@@ -1,11 +1,11 @@
TEMPLATE = lib
-TARGET = hierarchyax
+TARGET = hierarchyax
CONFIG += warn_off dll
QT += widgets axserver
-SOURCES = objects.cpp main.cpp
-HEADERS = objects.h
+SOURCES = objects.cpp main.cpp
+HEADERS = objects.h
RC_FILE = hierarchy.rc
DEF_FILE = hierarchy.def
diff --git a/examples/activeqt/hierarchy/objects.cpp b/examples/activeqt/hierarchy/objects.cpp
index f9af4b0..84237b2 100644
--- a/examples/activeqt/hierarchy/objects.cpp
+++ b/examples/activeqt/hierarchy/objects.cpp
@@ -47,7 +47,7 @@
QParentWidget::QParentWidget(QWidget *parent)
: QWidget(parent)
{
- vbox = new QVBoxLayout(this);
+ vbox = new QVBoxLayout(this);
}
//! [0] //! [1]
diff --git a/examples/activeqt/hierarchy/objects.h b/examples/activeqt/hierarchy/objects.h
index 5cd47ce..1112984 100644
--- a/examples/activeqt/hierarchy/objects.h
+++ b/examples/activeqt/hierarchy/objects.h
@@ -79,7 +79,7 @@ class QSubWidget : public QWidget
Q_CLASSINFO("ClassID", "{850652f4-8f71-4f69-b745-bce241ccdc30}");
Q_CLASSINFO("InterfaceID", "{2d76cc2f-3488-417a-83d6-debff88b3c3f}");
Q_CLASSINFO("ToSuperClass", "QSubWidget");
-
+
public:
QSubWidget(QWidget *parent = 0, const QString &name = QString());
diff --git a/examples/activeqt/menus/main.cpp b/examples/activeqt/menus/main.cpp
index 332f06d..6255e57 100644
--- a/examples/activeqt/menus/main.cpp
+++ b/examples/activeqt/menus/main.cpp
@@ -43,11 +43,11 @@
#include <QAxFactory>
QAXFACTORY_DEFAULT(QMenus,
- "{4dc3f340-a6f7-44e4-a79b-3e9217695fbd}",
- "{9ee49617-7d5c-441a-b833-4b068d40d751}",
- "{13eca64b-ee2a-4f3c-aa04-5d9d975979a7}",
- "{ce947ee3-0403-4fdc-895a-4fe779394b46}",
- "{8de435ce-8d2a-46ac-b3b3-cb800d0847c7}");
+ "{4dc3f340-a6f7-44e4-a79b-3e9217695fbd}",
+ "{9ee49617-7d5c-441a-b833-4b068d40d751}",
+ "{13eca64b-ee2a-4f3c-aa04-5d9d975979a7}",
+ "{ce947ee3-0403-4fdc-895a-4fe779394b46}",
+ "{8de435ce-8d2a-46ac-b3b3-cb800d0847c7}");
int main( int argc, char **argv )
{
@@ -55,8 +55,8 @@ int main( int argc, char **argv )
QWidget *window = 0;
if ( !QAxFactory::isServer() ) {
- window = new QMenus();
- window->show();
+ window = new QMenus();
+ window->show();
}
return a.exec();
diff --git a/examples/activeqt/menus/menus.cpp b/examples/activeqt/menus/menus.cpp
index 1311963..908c88c 100644
--- a/examples/activeqt/menus/menus.cpp
+++ b/examples/activeqt/menus/menus.cpp
@@ -49,7 +49,7 @@
#include "fileopen.xpm"
#include "filesave.xpm"
-QMenus::QMenus(QWidget *parent)
+QMenus::QMenus(QWidget *parent)
: QMainWindow(parent, 0) // QMainWindow's default flag is WType_TopLevel
{
QAction *action;
@@ -167,8 +167,8 @@ void QMenus::editAdvancedStyle()
void QMenus::helpAbout()
{
- QMessageBox::about(this, "About QMenus",
- "This example implements an in-place ActiveX control with menus and status messages.");
+ QMessageBox::about(this, "About QMenus",
+ "This example implements an in-place ActiveX control with menus and status messages.");
}
void QMenus::helpAboutQt()
diff --git a/examples/activeqt/menus/menus.pro b/examples/activeqt/menus/menus.pro
index 9be1688..be5d75d 100644
--- a/examples/activeqt/menus/menus.pro
+++ b/examples/activeqt/menus/menus.pro
@@ -1,11 +1,11 @@
TEMPLATE = app
-TARGET = menusax
+TARGET = menusax
CONFIG += warn_off
QT += widgets axserver
-SOURCES = main.cpp menus.cpp
-HEADERS = menus.h
+SOURCES = main.cpp menus.cpp
+HEADERS = menus.h
RC_FILE = menus.rc
# install
diff --git a/examples/activeqt/multiple/ax1.h b/examples/activeqt/multiple/ax1.h
index 7f502ab..72bbe5d 100644
--- a/examples/activeqt/multiple/ax1.h
+++ b/examples/activeqt/multiple/ax1.h
@@ -61,21 +61,21 @@ public:
QColor fillColor() const
{
- return fill_color;
+ return fill_color;
}
void setFillColor(const QColor &fc)
{
- fill_color = fc;
- repaint();
+ fill_color = fc;
+ repaint();
}
protected:
void paintEvent(QPaintEvent *e)
{
- QPainter paint(this);
- QRect r = rect();
- r.adjust(10, 10, -10, -10);
- paint.fillRect(r, fill_color);
+ QPainter paint(this);
+ QRect r = rect();
+ r.adjust(10, 10, -10, -10);
+ paint.fillRect(r, fill_color);
}
private:
diff --git a/examples/activeqt/multiple/ax2.h b/examples/activeqt/multiple/ax2.h
index 5efeee9..239e93e 100644
--- a/examples/activeqt/multiple/ax2.h
+++ b/examples/activeqt/multiple/ax2.h
@@ -58,31 +58,31 @@ class QAxWidget2 : public QWidget
Q_PROPERTY( int lineWidth READ lineWidth WRITE setLineWidth )
public:
QAxWidget2(QWidget *parent = 0)
- : QWidget(parent), line_width( 1 )
+ : QWidget(parent), line_width( 1 )
{
}
int lineWidth() const
{
- return line_width;
+ return line_width;
}
void setLineWidth( int lw )
{
- line_width = lw;
- repaint();
+ line_width = lw;
+ repaint();
}
protected:
void paintEvent( QPaintEvent *e )
{
- QPainter paint( this );
- QPen pen = paint.pen();
- pen.setWidth( line_width );
- paint.setPen( pen );
+ QPainter paint( this );
+ QPen pen = paint.pen();
+ pen.setWidth( line_width );
+ paint.setPen( pen );
- QRect r = rect();
- r.adjust( 10, 10, -10, -10 );
- paint.drawEllipse( r );
+ QRect r = rect();
+ r.adjust( 10, 10, -10, -10 );
+ paint.drawEllipse( r );
}
private:
diff --git a/examples/activeqt/multiple/multiple.pro b/examples/activeqt/multiple/multiple.pro
index 56e413d..3254c0e 100644
--- a/examples/activeqt/multiple/multiple.pro
+++ b/examples/activeqt/multiple/multiple.pro
@@ -1,11 +1,11 @@
TEMPLATE = lib
-TARGET = multipleax
+TARGET = multipleax
CONFIG += warn_off dll
QT += widgets axserver
-SOURCES = main.cpp
-HEADERS = ax1.h ax2.h
+SOURCES = main.cpp
+HEADERS = ax1.h ax2.h
RC_FILE = multipleax.rc
DEF_FILE = multipleax.def
diff --git a/examples/activeqt/opengl/glbox.cpp b/examples/activeqt/opengl/glbox.cpp
index 01ac4f3..69285fa 100644
--- a/examples/activeqt/opengl/glbox.cpp
+++ b/examples/activeqt/opengl/glbox.cpp
@@ -65,8 +65,8 @@
GLBox::GLBox( QWidget* parent, const char* name )
: QGLWidget( parent )
{
- xRot = yRot = zRot = 0.0; // default object rotation
- scale = 1.25; // default object scale
+ xRot = yRot = zRot = 0.0; // default object rotation
+ scale = 1.25; // default object scale
object = 0;
}
@@ -95,8 +95,8 @@ void GLBox::paintGL()
glTranslatef( 0.0, 0.0, -10.0 );
glScalef( scale, scale, scale );
- glRotatef( xRot, 1.0, 0.0, 0.0 );
- glRotatef( yRot, 0.0, 1.0, 0.0 );
+ glRotatef( xRot, 1.0, 0.0, 0.0 );
+ glRotatef( yRot, 0.0, 1.0, 0.0 );
glRotatef( zRot, 0.0, 0.0, 1.0 );
glCallList( object );
@@ -109,8 +109,8 @@ void GLBox::paintGL()
void GLBox::initializeGL()
{
- qglClearColor(Qt::black); // Let OpenGL clear to black
- object = makeObject(); // Generate an OpenGL display list
+ qglClearColor(Qt::black); // Let OpenGL clear to black
+ object = makeObject(); // Generate an OpenGL display list
glShadeModel( GL_FLAT );
}
@@ -135,14 +135,14 @@ void GLBox::resizeGL( int w, int h )
*/
GLuint GLBox::makeObject()
-{
+{
GLuint list;
list = glGenLists( 1 );
glNewList( list, GL_COMPILE );
- qglColor(Qt::white); // Shorthand for glColor3f or glIndex
+ qglColor(Qt::white); // Shorthand for glColor3f or glIndex
glLineWidth( 2.0 );
@@ -206,8 +206,8 @@ void GLBox::setZRotation( int degrees )
}
//! [1]
-class ObjectSafetyImpl : public QAxAggregated,
- public IObjectSafety
+class ObjectSafetyImpl : public QAxAggregated,
+ public IObjectSafety
{
public:
//! [1] //! [2]
@@ -215,14 +215,14 @@ public:
long queryInterface( const QUuid &iid, void **iface )
{
- *iface = 0;
- if ( iid == IID_IObjectSafety )
- *iface = (IObjectSafety*)this;
- else
- return E_NOINTERFACE;
-
- AddRef();
- return S_OK;
+ *iface = 0;
+ if ( iid == IID_IObjectSafety )
+ *iface = (IObjectSafety*)this;
+ else
+ return E_NOINTERFACE;
+
+ AddRef();
+ return S_OK;
}
//! [2] //! [3]
@@ -231,13 +231,13 @@ public:
//! [3] //! [4]
HRESULT WINAPI GetInterfaceSafetyOptions( REFIID riid, DWORD *pdwSupportedOptions, DWORD *pdwEnabledOptions )
{
- *pdwSupportedOptions = INTERFACESAFE_FOR_UNTRUSTED_DATA | INTERFACESAFE_FOR_UNTRUSTED_CALLER;
- *pdwEnabledOptions = INTERFACESAFE_FOR_UNTRUSTED_DATA | INTERFACESAFE_FOR_UNTRUSTED_CALLER;
- return S_OK;
+ *pdwSupportedOptions = INTERFACESAFE_FOR_UNTRUSTED_DATA | INTERFACESAFE_FOR_UNTRUSTED_CALLER;
+ *pdwEnabledOptions = INTERFACESAFE_FOR_UNTRUSTED_DATA | INTERFACESAFE_FOR_UNTRUSTED_CALLER;
+ return S_OK;
}
HRESULT WINAPI SetInterfaceSafetyOptions( REFIID riid, DWORD pdwSupportedOptions, DWORD pdwEnabledOptions )
{
- return S_OK;
+ return S_OK;
}
};
//! [4] //! [5]
diff --git a/examples/activeqt/opengl/glbox.h b/examples/activeqt/opengl/glbox.h
index fd62e94..b356056 100644
--- a/examples/activeqt/opengl/glbox.h
+++ b/examples/activeqt/opengl/glbox.h
@@ -52,7 +52,7 @@
#include <QAxBindable>
class GLBox : public QGLWidget,
- public QAxBindable
+ public QAxBindable
{
Q_OBJECT
//! [0] //! [1]
@@ -66,18 +66,18 @@ public:
public slots:
- void setXRotation( int degrees );
+ void setXRotation( int degrees );
//! [1]
- void setYRotation( int degrees );
- void setZRotation( int degrees );
+ void setYRotation( int degrees );
+ void setZRotation( int degrees );
protected:
- void initializeGL();
- void paintGL();
- void resizeGL( int w, int h );
+ void initializeGL();
+ void paintGL();
+ void resizeGL( int w, int h );
- virtual GLuint makeObject();
+ virtual GLuint makeObject();
private:
diff --git a/examples/activeqt/opengl/main.cpp b/examples/activeqt/opengl/main.cpp
index f834a1b..8f62d59 100644
--- a/examples/activeqt/opengl/main.cpp
+++ b/examples/activeqt/opengl/main.cpp
@@ -55,12 +55,12 @@
#include <QAxFactory>
QAXFACTORY_DEFAULT( GLBox,
- "{5fd9c22e-ed45-43fa-ba13-1530bb6b03e0}",
- "{33b051af-bb25-47cf-a390-5cfd2987d26a}",
- "{8c996c29-eafa-46ac-a6f9-901951e765b5}",
- "{2c3c183a-eeda-41a4-896e-3d9c12c3577d}",
- "{83e16271-6480-45d5-aaf1-3f40b7661ae4}"
- )
+ "{5fd9c22e-ed45-43fa-ba13-1530bb6b03e0}",
+ "{33b051af-bb25-47cf-a390-5cfd2987d26a}",
+ "{8c996c29-eafa-46ac-a6f9-901951e765b5}",
+ "{2c3c183a-eeda-41a4-896e-3d9c12c3577d}",
+ "{83e16271-6480-45d5-aaf1-3f40b7661ae4}"
+ )
//! [0] //! [1]
/*
@@ -73,15 +73,15 @@ int main( int argc, char **argv )
QApplication a(argc,argv);
if ( !QGLFormat::hasOpenGL() ) {
- qWarning( "This system has no OpenGL support. Exiting." );
- return -1;
+ qWarning( "This system has no OpenGL support. Exiting." );
+ return -1;
}
if ( !QAxFactory::isServer() ) {
- GLObjectWindow w;
- w.resize( 400, 350 );
- w.show();
- return a.exec();
+ GLObjectWindow w;
+ w.resize( 400, 350 );
+ w.show();
+ return a.exec();
//! [1] //! [2]
}
return a.exec();
diff --git a/examples/activeqt/opengl/opengl.pro b/examples/activeqt/opengl/opengl.pro
index 1cdd707..47693f4 100644
--- a/examples/activeqt/opengl/opengl.pro
+++ b/examples/activeqt/opengl/opengl.pro
@@ -1,14 +1,14 @@
TEMPLATE = app
-TARGET = openglax
+TARGET = openglax
CONFIG += warn_off
QT += widgets axserver opengl
-HEADERS = glbox.h \
- globjwin.h
-SOURCES = glbox.cpp \
- globjwin.cpp \
- main.cpp
+HEADERS = glbox.h \
+ globjwin.h
+SOURCES = glbox.cpp \
+ globjwin.cpp \
+ main.cpp
RC_FILE = opengl.rc
diff --git a/examples/activeqt/qutlook/addressview.cpp b/examples/activeqt/qutlook/addressview.cpp
index c9adc85..ef26ce0 100644
--- a/examples/activeqt/qutlook/addressview.cpp
+++ b/examples/activeqt/qutlook/addressview.cpp
@@ -74,9 +74,9 @@ AddressBookModel::AddressBookModel(AddressView *parent)
session.Logon();
Outlook::MAPIFolder *folder = session.GetDefaultFolder(Outlook::olFolderContacts);
contactItems = new Outlook::Items(folder->Items());
- connect(contactItems, SIGNAL(ItemAdd(IDispatch*)), parent, SLOT(updateOutlook()));
- connect(contactItems, SIGNAL(ItemChange(IDispatch*)), parent, SLOT(updateOutlook()));
- connect(contactItems, SIGNAL(ItemRemove()), parent, SLOT(updateOutlook()));
+ connect(contactItems, SIGNAL(ItemAdd(IDispatch*)), parent, SLOT(updateOutlook()));
+ connect(contactItems, SIGNAL(ItemChange(IDispatch*)), parent, SLOT(updateOutlook()));
+ connect(contactItems, SIGNAL(ItemRemove()), parent, SLOT(updateOutlook()));
delete folder;
}
@@ -277,7 +277,7 @@ void AddressView::changeEntry()
void AddressView::itemSelected(const QModelIndex &index)
{
if (!index.isValid())
- return;
+ return;
QAbstractItemModel *model = treeView->model();
iFirstName->setText(model->data(model->index(index.row(), 0)).toString());
diff --git a/examples/activeqt/qutlook/qutlook.pro b/examples/activeqt/qutlook/qutlook.pro
index 30d5bc5..3482e1c 100644
--- a/examples/activeqt/qutlook/qutlook.pro
+++ b/examples/activeqt/qutlook/qutlook.pro
@@ -1,6 +1,6 @@
#! [0] #! [1]
TEMPLATE = app
-TARGET = qutlook
+TARGET = qutlook
QT += widgets axcontainer
TYPELIBS = $$system(dumpcpp -getfile {00062FFF-0000-0000-C000-000000000046})
diff --git a/examples/activeqt/simple/main.cpp b/examples/activeqt/simple/main.cpp
index 9348e94..487ccfa 100644
--- a/examples/activeqt/simple/main.cpp
+++ b/examples/activeqt/simple/main.cpp
@@ -57,27 +57,27 @@ public:
QSimpleAX(QWidget *parent = 0)
: QWidget(parent)
{
- QVBoxLayout *vbox = new QVBoxLayout( this );
+ QVBoxLayout *vbox = new QVBoxLayout( this );
slider = new QSlider( Qt::Horizontal, this );
- LCD = new QLCDNumber( 3, this );
- edit = new QLineEdit( this );
+ LCD = new QLCDNumber( 3, this );
+ edit = new QLineEdit( this );
- connect( slider, SIGNAL(valueChanged(int)), this, SLOT(setValue(int)) );
- connect( edit, SIGNAL(textChanged(QString)), this, SLOT(setText(QString)) );
+ connect( slider, SIGNAL(valueChanged(int)), this, SLOT(setValue(int)) );
+ connect( edit, SIGNAL(textChanged(QString)), this, SLOT(setText(QString)) );
- vbox->addWidget( slider );
- vbox->addWidget( LCD );
- vbox->addWidget( edit );
+ vbox->addWidget( slider );
+ vbox->addWidget( LCD );
+ vbox->addWidget( edit );
}
- QString text() const
- {
- return edit->text();
+ QString text() const
+ {
+ return edit->text();
}
int value() const
{
- return slider->value();
+ return slider->value();
}
signals:
@@ -88,33 +88,33 @@ signals:
public slots:
void setText( const QString &string )
{
- if ( !requestPropertyChange( "text" ) )
- return;
+ if ( !requestPropertyChange( "text" ) )
+ return;
- edit->blockSignals( true );
- edit->setText( string );
- edit->blockSignals( false );
- emit someSignal();
- emit textChanged( string );
+ edit->blockSignals( true );
+ edit->setText( string );
+ edit->blockSignals( false );
+ emit someSignal();
+ emit textChanged( string );
- propertyChanged( "text" );
+ propertyChanged( "text" );
}
void about()
{
- QMessageBox::information( this, "About QSimpleAX", "This is a Qt widget, and this slot has been\n"
- "called through ActiveX/OLE automation!" );
+ QMessageBox::information( this, "About QSimpleAX", "This is a Qt widget, and this slot has been\n"
+ "called through ActiveX/OLE automation!" );
}
void setValue( int i )
{
- if ( !requestPropertyChange( "value" ) )
- return;
- slider->blockSignals( true );
- slider->setValue( i );
- slider->blockSignals( false );
- LCD->display( i );
- emit valueChanged( i );
+ if ( !requestPropertyChange( "value" ) )
+ return;
+ slider->blockSignals( true );
+ slider->setValue( i );
+ slider->blockSignals( false );
+ LCD->display( i );
+ emit valueChanged( i );
- propertyChanged( "value" );
+ propertyChanged( "value" );
}
private:
@@ -128,9 +128,9 @@ private:
//! [1]
QAXFACTORY_DEFAULT(QSimpleAX,
- "{DF16845C-92CD-4AAB-A982-EB9840E74669}",
- "{616F620B-91C5-4410-A74E-6B81C76FFFE0}",
- "{E1816BBA-BF5D-4A31-9855-D6BA432055FF}",
- "{EC08F8FC-2754-47AB-8EFE-56A54057F34E}",
- "{A095BA0C-224F-4933-A458-2DD7F6B85D8F}")
+ "{DF16845C-92CD-4AAB-A982-EB9840E74669}",
+ "{616F620B-91C5-4410-A74E-6B81C76FFFE0}",
+ "{E1816BBA-BF5D-4A31-9855-D6BA432055FF}",
+ "{EC08F8FC-2754-47AB-8EFE-56A54057F34E}",
+ "{A095BA0C-224F-4933-A458-2DD7F6B85D8F}")
//! [1]
diff --git a/examples/activeqt/simple/simple.pro b/examples/activeqt/simple/simple.pro
index da8a317..a512c81 100644
--- a/examples/activeqt/simple/simple.pro
+++ b/examples/activeqt/simple/simple.pro
@@ -1,10 +1,10 @@
TEMPLATE = app
-TARGET = simpleax
+TARGET = simpleax
CONFIG += warn_off
QT += widgets axserver
-SOURCES = main.cpp
+SOURCES = main.cpp
RC_FILE = simple.rc
# install
diff --git a/examples/activeqt/webbrowser/main.cpp b/examples/activeqt/webbrowser/main.cpp
index 1e4efb5..51a9dce 100644
--- a/examples/activeqt/webbrowser/main.cpp
+++ b/examples/activeqt/webbrowser/main.cpp
@@ -106,8 +106,8 @@ void MainWindow::on_WebBrowser_TitleChange(const QString &title)
void MainWindow::on_WebBrowser_ProgressChange(int a, int b)
{
if (a <= 0 || b <= 0) {
- pb->hide();
- return;
+ pb->hide();
+ return;
}
pb->show();
pb->setRange(0, b);
@@ -118,11 +118,11 @@ void MainWindow::on_WebBrowser_CommandStateChange(int cmd, bool on)
{
switch (cmd) {
case 1:
- actionForward->setEnabled(on);
- break;
+ actionForward->setEnabled(on);
+ break;
case 2:
- actionBack->setEnabled(on);
- break;
+ actionBack->setEnabled(on);
+ break;
}
}
@@ -147,7 +147,7 @@ void MainWindow::on_actionNewWindow_triggered()
MainWindow *window = new MainWindow;
window->show();
if (addressEdit->text().isEmpty())
- return;
+ return;
window->addressEdit->setText(addressEdit->text());
window->actionStop->setEnabled(true);
window->on_actionGo_triggered();
@@ -156,9 +156,9 @@ void MainWindow::on_actionNewWindow_triggered()
void MainWindow::on_actionAbout_triggered()
{
QMessageBox::about(this, tr("About WebBrowser"),
- tr("This Example has been created using the ActiveQt integration into Qt Designer.\n"
- "It demonstrates the use of QAxWidget to embed the Internet Explorer ActiveX\n"
- "control into a Qt application."));
+ tr("This Example has been created using the ActiveQt integration into Qt Designer.\n"
+ "It demonstrates the use of QAxWidget to embed the Internet Explorer ActiveX\n"
+ "control into a Qt application."));
}
void MainWindow::on_actionAboutQt_triggered()
diff --git a/examples/activeqt/webbrowser/webaxwidget.h b/examples/activeqt/webbrowser/webaxwidget.h
index a5382d0..4a34a12 100644
--- a/examples/activeqt/webbrowser/webaxwidget.h
+++ b/examples/activeqt/webbrowser/webaxwidget.h
@@ -47,8 +47,8 @@
class WebAxWidget : public QAxWidget
{
public:
-
- WebAxWidget(QWidget* parent = 0, Qt::WindowFlags f = 0)
+
+ WebAxWidget(QWidget* parent = 0, Qt::WindowFlags f = 0)
: QAxWidget(parent, f)
{
}
diff --git a/examples/activeqt/webbrowser/webbrowser.pro b/examples/activeqt/webbrowser/webbrowser.pro
index 995906f..9fa342b 100644
--- a/examples/activeqt/webbrowser/webbrowser.pro
+++ b/examples/activeqt/webbrowser/webbrowser.pro
@@ -3,8 +3,8 @@ TEMPLATE = app
QT += widgets axcontainer
HEADERS = webaxwidget.h
-SOURCES = main.cpp
-FORMS = mainwindow.ui
+SOURCES = main.cpp
+FORMS = mainwindow.ui
wincewm*: FORMS = mainwindow_windowsmobile.ui
diff --git a/examples/activeqt/wrapper/main.cpp b/examples/activeqt/wrapper/main.cpp
index 3f0cfb5..5c16f92 100644
--- a/examples/activeqt/wrapper/main.cpp
+++ b/examples/activeqt/wrapper/main.cpp
@@ -73,85 +73,85 @@ static const char *fileopen[] = {
class ActiveQtFactory : public QAxFactory
{
public:
- ActiveQtFactory( const QUuid &lib, const QUuid &app )
- : QAxFactory( lib, app )
+ ActiveQtFactory( const QUuid &lib, const QUuid &app )
+ : QAxFactory( lib, app )
{}
QStringList featureList() const
{
- QStringList list;
- list << "QCheckBox";
- list << "QRadioButton";
- list << "QPushButton";
- list << "QToolButton";
- return list;
+ QStringList list;
+ list << "QCheckBox";
+ list << "QRadioButton";
+ list << "QPushButton";
+ list << "QToolButton";
+ return list;
}
QObject *createObject(const QString &key)
{
- if ( key == "QCheckBox" )
- return new QCheckBox(0);
- if ( key == "QRadioButton" )
- return new QRadioButton(0);
- if ( key == "QPushButton" )
- return new QPushButton(0 );
- if ( key == "QToolButton" ) {
- QToolButton *tb = new QToolButton(0);
-// tb->setIcon( QPixmap(fileopen) );
- return tb;
- }
+ if ( key == "QCheckBox" )
+ return new QCheckBox(0);
+ if ( key == "QRadioButton" )
+ return new QRadioButton(0);
+ if ( key == "QPushButton" )
+ return new QPushButton(0 );
+ if ( key == "QToolButton" ) {
+ QToolButton *tb = new QToolButton(0);
+// tb->setIcon( QPixmap(fileopen) );
+ return tb;
+ }
- return 0;
+ return 0;
}
const QMetaObject *metaObject( const QString &key ) const
{
- if ( key == "QCheckBox" )
- return &QCheckBox::staticMetaObject;
- if ( key == "QRadioButton" )
- return &QRadioButton::staticMetaObject;
- if ( key == "QPushButton" )
- return &QPushButton::staticMetaObject;
- if ( key == "QToolButton" )
- return &QToolButton::staticMetaObject;
+ if ( key == "QCheckBox" )
+ return &QCheckBox::staticMetaObject;
+ if ( key == "QRadioButton" )
+ return &QRadioButton::staticMetaObject;
+ if ( key == "QPushButton" )
+ return &QPushButton::staticMetaObject;
+ if ( key == "QToolButton" )
+ return &QToolButton::staticMetaObject;
- return 0;
+ return 0;
}
QUuid classID( const QString &key ) const
{
- if ( key == "QCheckBox" )
- return "{6E795DE9-872D-43CF-A831-496EF9D86C68}";
- if ( key == "QRadioButton" )
- return "{AFCF78C8-446C-409A-93B3-BA2959039189}";
- if ( key == "QPushButton" )
- return "{2B262458-A4B6-468B-B7D4-CF5FEE0A7092}";
- if ( key == "QToolButton" )
- return "{7c0ffe7a-60c3-4666-bde2-5cf2b54390a1}";
+ if ( key == "QCheckBox" )
+ return "{6E795DE9-872D-43CF-A831-496EF9D86C68}";
+ if ( key == "QRadioButton" )
+ return "{AFCF78C8-446C-409A-93B3-BA2959039189}";
+ if ( key == "QPushButton" )
+ return "{2B262458-A4B6-468B-B7D4-CF5FEE0A7092}";
+ if ( key == "QToolButton" )
+ return "{7c0ffe7a-60c3-4666-bde2-5cf2b54390a1}";
- return QUuid();
+ return QUuid();
}
QUuid interfaceID( const QString &key ) const
{
- if ( key == "QCheckBox" )
- return "{4FD39DD7-2DE0-43C1-A8C2-27C51A052810}";
- if ( key == "QRadioButton" )
- return "{7CC8AE30-206C-48A3-A009-B0A088026C2F}";
- if ( key == "QPushButton" )
- return "{06831CC9-59B6-436A-9578-6D53E5AD03D3}";
- if ( key == "QToolButton" )
- return "{6726080f-d63d-4950-a366-9bf33e5cdf84}";
+ if ( key == "QCheckBox" )
+ return "{4FD39DD7-2DE0-43C1-A8C2-27C51A052810}";
+ if ( key == "QRadioButton" )
+ return "{7CC8AE30-206C-48A3-A009-B0A088026C2F}";
+ if ( key == "QPushButton" )
+ return "{06831CC9-59B6-436A-9578-6D53E5AD03D3}";
+ if ( key == "QToolButton" )
+ return "{6726080f-d63d-4950-a366-9bf33e5cdf84}";
- return QUuid();
+ return QUuid();
}
QUuid eventsID( const QString &key ) const
{
- if ( key == "QCheckBox" )
- return "{FDB6FFBE-56A3-4E90-8F4D-198488418B3A}";
- if ( key == "QRadioButton" )
- return "{73EE4860-684C-4A66-BF63-9B9EFFA0CBE5}";
- if ( key == "QPushButton" )
- return "{3CC3F17F-EA59-4B58-BBD3-842D467131DD}";
- if ( key == "QToolButton" )
- return "{f4d421fd-4ead-4fd9-8a25-440766939639}";
+ if ( key == "QCheckBox" )
+ return "{FDB6FFBE-56A3-4E90-8F4D-198488418B3A}";
+ if ( key == "QRadioButton" )
+ return "{73EE4860-684C-4A66-BF63-9B9EFFA0CBE5}";
+ if ( key == "QPushButton" )
+ return "{3CC3F17F-EA59-4B58-BBD3-842D467131DD}";
+ if ( key == "QToolButton" )
+ return "{f4d421fd-4ead-4fd9-8a25-440766939639}";
- return QUuid();
+ return QUuid();
}
};
//! [0] //! [1]
diff --git a/examples/activeqt/wrapper/wrapper.pro b/examples/activeqt/wrapper/wrapper.pro
index 8b59eb9..229f790 100644
--- a/examples/activeqt/wrapper/wrapper.pro
+++ b/examples/activeqt/wrapper/wrapper.pro
@@ -1,11 +1,11 @@
TEMPLATE = lib
-TARGET = wrapperax
+TARGET = wrapperax
CONFIG += warn_off dll
QT += widgets axserver
-SOURCES = main.cpp
-RC_FILE = wrapperax.rc
+SOURCES = main.cpp
+RC_FILE = wrapperax.rc
DEF_FILE = wrapperax.def
# install
diff --git a/src/activeqt/container/qaxbase.cpp b/src/activeqt/container/qaxbase.cpp
index 0d5ab65..11c943c 100644
--- a/src/activeqt/container/qaxbase.cpp
+++ b/src/activeqt/container/qaxbase.cpp
@@ -239,7 +239,7 @@ static const char *const type_conversion[][2] =
\class QAxEventSink
\brief The QAxEventSink class implements the event sink for all
- IConnectionPoints implemented in the COM object.
+ IConnectionPoints implemented in the COM object.
*/
class QAxEventSink : public IDispatch, public IPropertyNotifySink
@@ -292,14 +292,14 @@ public:
void addSignal(DISPID memid, const char *name)
{
- QByteArray signalname = name;
- int pi = signalname.indexOf('(');
+ QByteArray signalname = name;
+ int pi = signalname.indexOf('(');
int i = 0;
while (type_conversion[i][0]) {
int ti = pi;
int len = int(strlen(type_conversion[i][0]));
while ((ti = signalname.indexOf(type_conversion[i][0], ti)) != -1)
- signalname.replace(ti, len, type_conversion[i][1]);
+ signalname.replace(ti, len, type_conversion[i][1]);
++i;
}
@@ -627,12 +627,12 @@ public:
QString ctrl;
QHash<QUuid, QAxEventSink*> eventSink;
- uint useEventSink :1;
- uint useMetaObject :1;
- uint useClassInfo :1;
+ uint useEventSink :1;
+ uint useMetaObject :1;
+ uint useClassInfo :1;
uint cachedMetaObject :1;
- uint initialized :1;
- uint tryCache :1;
+ uint initialized :1;
+ uint tryCache :1;
IUnknown *ptr;
mutable IDispatch *disp;
@@ -1089,9 +1089,9 @@ void QAxBase::disableEventSink()
*/
void QAxBase::disableMetaObject()
{
- d->useMetaObject = false;
- d->useEventSink = false;
- d->useClassInfo = false;
+ d->useMetaObject = false;
+ d->useEventSink = false;
+ d->useClassInfo = false;
}
/*!
@@ -2925,8 +2925,8 @@ void MetaObjectGenerator::readEventInfo()
if (cpoint) cpoint->Release();
epoints->Release();
} else if (classInfo) { // no enumeration - search source interfaces and ask for those
- TYPEATTR *typeattr = 0;
- classInfo->GetTypeAttr(&typeattr);
+ TYPEATTR *typeattr = 0;
+ classInfo->GetTypeAttr(&typeattr);
if (typeattr) {
for (int i = 0; i < typeattr->cImplTypes; ++i) {
int flags = 0;
diff --git a/src/activeqt/container/qaxbase.h b/src/activeqt/container/qaxbase.h
index 58efb85..16e8f50 100644
--- a/src/activeqt/container/qaxbase.h
+++ b/src/activeqt/container/qaxbase.h
@@ -63,15 +63,15 @@ class QAxBase
public:
typedef QMap<QString, QVariant> PropertyBag;
-
+
QAxBase(IUnknown *iface = 0);
virtual ~QAxBase();
-
+
QString control() const;
-
+
long queryInterface(const QUuid &, void**) const;
-
- QVariant dynamicCall(const char *name, const QVariant &v1 = QVariant(),
+
+ QVariant dynamicCall(const char *name, const QVariant &v1 = QVariant(),
const QVariant &v2 = QVariant(),
const QVariant &v3 = QVariant(),
const QVariant &v4 = QVariant(),
@@ -96,21 +96,21 @@ public:
virtual QObject *qObject() const = 0;
virtual const char *className() const = 0;
-
+
PropertyBag propertyBag() const;
void setPropertyBag(const PropertyBag&);
-
+
QString generateDocumentation();
-
+
virtual bool propertyWritable(const char*) const;
virtual void setPropertyWritable(const char*, bool);
-
+
bool isNull() const;
QStringList verbs() const;
-
+
QVariant asVariant() const;
-
+
#ifdef qdoc
Q_SIGNALS:
void signal(const QString&,int,void*);
@@ -153,7 +153,7 @@ private:
bool initializeLicensedHelper(void *factory, const QString &key, IUnknown **ptr);
QAxBasePrivate *d;
QAxMetaObject *internalMetaObject() const;
-
+
virtual const QMetaObject *parentMetaObject() const = 0;
int internalProperty(QMetaObject::Call, int index, void **v);
int internalInvoke(QMetaObject::Call, int index, void **v);
@@ -198,7 +198,7 @@ inline QDataStream &operator >>(QDataStream &s, QAxBase &c)
s >> bag;
c.setPropertyBag(bag);
c.qObject()->blockSignals(false);
-
+
return s;
}
@@ -207,7 +207,7 @@ inline QDataStream &operator <<(QDataStream &s, const QAxBase &c)
QAxBase::PropertyBag bag = c.propertyBag();
s << c.control();
s << bag;
-
+
return s;
}
#endif // QT_NO_DATASTREAM
diff --git a/src/activeqt/container/qaxdump.cpp b/src/activeqt/container/qaxdump.cpp
index bad02cb..8bbca6c 100644
--- a/src/activeqt/container/qaxdump.cpp
+++ b/src/activeqt/container/qaxdump.cpp
@@ -94,7 +94,7 @@ static QByteArray namedPrototype(const QList<QByteArray> &parameterTypes, const
if (p < parameterNames.count())
prototype += ' ' + parameterNames.at(p);
-
+
if (numDefArgs >= parameterTypes.count() - p)
prototype += " = 0";
if (p < parameterTypes.count() - 1)
@@ -111,7 +111,7 @@ static QByteArray toType(const QByteArray &t)
int vartype = QVariant::nameToType(type);
if (vartype == QVariant::Invalid)
type = "int";
-
+
if (type.at(0) == 'Q')
type = type.mid(1);
type[0] = toupper(type.at(0));
@@ -121,7 +121,7 @@ static QByteArray toType(const QByteArray &t)
type = "Map";
else if (type == "Uint")
type = "UInt";
-
+
return "to" + type + "()";
}
@@ -130,13 +130,13 @@ QString qax_generateDocumentation(QAxBase *that)
that->metaObject();
if (that->isNull())
- return QString();
+ return QString();
ITypeInfo *typeInfo = 0;
IDispatch *dispatch = 0;
that->queryInterface(IID_IDispatch, (void**)&dispatch);
if (dispatch)
- dispatch->GetTypeInfo(0, LOCALE_SYSTEM_DEFAULT, &typeInfo);
+ dispatch->GetTypeInfo(0, LOCALE_SYSTEM_DEFAULT, &typeInfo);
QString docu;
QTextStream stream(&docu, QIODevice::WriteOnly);
@@ -153,17 +153,17 @@ QString qax_generateDocumentation(QAxBase *that)
const char *inter = 0;
int interCount = 1;
while ((inter = mo->classInfo(mo->indexOfClassInfo("Interface " + QByteArray::number(interCount))).value())) {
- stream << "<li>" << inter << endl;
- interCount++;
+ stream << "<li>" << inter << endl;
+ interCount++;
}
stream << "</ul>" << endl;
stream << "<h3>Event Interfaces</h3>" << endl;
stream << "<ul>" << endl;
- interCount = 1;
+ interCount = 1;
while ((inter = mo->classInfo(mo->indexOfClassInfo("Event Interface " + QByteArray::number(interCount))).value())) {
- stream << "<li>" << inter << endl;
- interCount++;
+ stream << "<li>" << inter << endl;
+ interCount++;
}
stream << "</ul>" << endl;
@@ -171,12 +171,12 @@ QString qax_generateDocumentation(QAxBase *that)
const int slotCount = mo->methodCount();
if (slotCount) {
- stream << "<h2>Public Slots:</h2>" << endl;
- stream << "<ul>" << endl;
+ stream << "<h2>Public Slots:</h2>" << endl;
+ stream << "<ul>" << endl;
int defArgCount = 0;
- for (int islot = mo->methodOffset(); islot < slotCount; ++islot) {
- const QMetaMethod slot = mo->method(islot);
+ for (int islot = mo->methodOffset(); islot < slotCount; ++islot) {
+ const QMetaMethod slot = mo->method(islot);
if (slot.methodType() != QMetaMethod::Slot)
continue;
@@ -185,26 +185,26 @@ QString qax_generateDocumentation(QAxBase *that)
continue;
}
- QByteArray returntype(slot.typeName());
+ QByteArray returntype(slot.typeName());
if (returntype.isEmpty())
returntype = "void";
QByteArray prototype = namedPrototype(slot.parameterTypes(), slot.parameterNames(), defArgCount);
QByteArray signature = slot.methodSignature();
- QByteArray name = signature.left(signature.indexOf('('));
- stream << "<li>" << returntype << " <a href=\"#" << name << "\"><b>" << name << "</b></a>" << prototype << ";</li>" << endl;
-
+ QByteArray name = signature.left(signature.indexOf('('));
+ stream << "<li>" << returntype << " <a href=\"#" << name << "\"><b>" << name << "</b></a>" << prototype << ";</li>" << endl;
+
prototype = namedPrototype(slot.parameterTypes(), slot.parameterNames());
- QString detail = QString::fromLatin1("<h3><a name=") + QString::fromLatin1(name.constData()) + QLatin1String("></a>") +
+ QString detail = QString::fromLatin1("<h3><a name=") + QString::fromLatin1(name.constData()) + QLatin1String("></a>") +
QLatin1String(returntype.constData()) + QLatin1Char(' ') +
QLatin1String(name.constData()) + QLatin1Char(' ') +
QString::fromLatin1(prototype.constData()) + QLatin1String("<tt> [slot]</tt></h3>\n");
prototype = namedPrototype(slot.parameterTypes(), QList<QByteArray>());
- detail += docuFromName(typeInfo, QString::fromLatin1(name.constData()));
- detail += QLatin1String("<p>Connect a signal to this slot:<pre>\n");
- detail += QString::fromLatin1("\tQObject::connect(sender, SIGNAL(someSignal") + QString::fromLatin1(prototype.constData()) +
+ detail += docuFromName(typeInfo, QString::fromLatin1(name.constData()));
+ detail += QLatin1String("<p>Connect a signal to this slot:<pre>\n");
+ detail += QString::fromLatin1("\tQObject::connect(sender, SIGNAL(someSignal") + QString::fromLatin1(prototype.constData()) +
QLatin1String("), object, SLOT(") + QString::fromLatin1(name.constData()) +
QString::fromLatin1(prototype.constData()) + QLatin1String("));");
- detail += QLatin1String("</pre>\n");
+ detail += QLatin1String("</pre>\n");
if (1) {
detail += QLatin1String("<p>Or call the function directly:<pre>\n");
@@ -227,16 +227,16 @@ QString qax_generateDocumentation(QAxBase *that)
detail += QLatin1Char(')');
if (returntype != "void" && returntype != "QAxObject *" && returntype != "QVariant")
detail += QLatin1Char('.') + QLatin1String(toType(returntype));
- detail += QLatin1String(";</pre>\n");
- } else {
- detail += QLatin1String("<p>This function has parameters of unsupported types and cannot be called directly.");
- }
+ detail += QLatin1String(";</pre>\n");
+ } else {
+ detail += QLatin1String("<p>This function has parameters of unsupported types and cannot be called directly.");
+ }
- methodDetails << detail;
+ methodDetails << detail;
defArgCount = 0;
- }
+ }
- stream << "</ul>" << endl;
+ stream << "</ul>" << endl;
}
int signalCount = mo->methodCount();
if (signalCount) {
@@ -248,18 +248,18 @@ QString qax_generateDocumentation(QAxBase *that)
}
typeInfo = 0;
- stream << "<h2>Signals:</h2>" << endl;
- stream << "<ul>" << endl;
+ stream << "<h2>Signals:</h2>" << endl;
+ stream << "<ul>" << endl;
- for (int isignal = mo->methodOffset(); isignal < signalCount; ++isignal) {
- const QMetaMethod signal(mo->method(isignal));
+ for (int isignal = mo->methodOffset(); isignal < signalCount; ++isignal) {
+ const QMetaMethod signal(mo->method(isignal));
if (signal.methodType() != QMetaMethod::Signal)
continue;
QByteArray prototype = namedPrototype(signal.parameterTypes(), signal.parameterNames());
QByteArray signature = signal.methodSignature();
- QByteArray name = signature.left(signature.indexOf('('));
- stream << "<li>void <a href=\"#" << name << "\"><b>" << name << "</b></a>" << prototype << ";</li>" << endl;
+ QByteArray name = signature.left(signature.indexOf('('));
+ stream << "<li>void <a href=\"#" << name << "\"><b>" << name << "</b></a>" << prototype << ";</li>" << endl;
QString detail = QLatin1String("<h3><a name=") + QLatin1String(name.constData()) + QLatin1String("></a>void ") +
QLatin1String(name.constData()) + QLatin1Char(' ') +
@@ -279,18 +279,18 @@ QString qax_generateDocumentation(QAxBase *that)
} while (typeInfo);
}
prototype = namedPrototype(signal.parameterTypes(), QList<QByteArray>());
- detail += QLatin1String("<p>Connect a slot to this signal:<pre>\n");
- detail += QLatin1String("\tQObject::connect(object, SIGNAL(") + QString::fromLatin1(name.constData()) +
+ detail += QLatin1String("<p>Connect a slot to this signal:<pre>\n");
+ detail += QLatin1String("\tQObject::connect(object, SIGNAL(") + QString::fromLatin1(name.constData()) +
QString::fromLatin1(prototype.constData()) +
QLatin1String("), receiver, SLOT(someSlot") + QString::fromLatin1(prototype.constData()) + QLatin1String("));");
- detail += QLatin1String("</pre>\n");
+ detail += QLatin1String("</pre>\n");
- methodDetails << detail;
+ methodDetails << detail;
if (typeInfo)
typeInfo->Release();
typeInfo = 0;
- }
- stream << "</ul>" << endl;
+ }
+ stream << "</ul>" << endl;
if (typeLib)
typeLib->Release();
@@ -299,97 +299,97 @@ QString qax_generateDocumentation(QAxBase *that)
const int propCount = mo->propertyCount();
if (propCount) {
if (dispatch)
- dispatch->GetTypeInfo(0, LOCALE_SYSTEM_DEFAULT, &typeInfo);
- stream << "<h2>Properties:</h2>" << endl;
- stream << "<ul>" << endl;
+ dispatch->GetTypeInfo(0, LOCALE_SYSTEM_DEFAULT, &typeInfo);
+ stream << "<h2>Properties:</h2>" << endl;
+ stream << "<ul>" << endl;
- for (int iprop = 0; iprop < propCount; ++iprop) {
- const QMetaProperty prop = mo->property(iprop);
- QByteArray name(prop.name());
- QByteArray type(prop.typeName());
+ for (int iprop = 0; iprop < propCount; ++iprop) {
+ const QMetaProperty prop = mo->property(iprop);
+ QByteArray name(prop.name());
+ QByteArray type(prop.typeName());
- stream << "<li>" << type << " <a href=\"#" << name << "\"><b>" << name << "</b></a>;</li>" << endl;
- QString detail = QLatin1String("<h3><a name=") + QString::fromLatin1(name.constData()) + QLatin1String("></a>") +
+ stream << "<li>" << type << " <a href=\"#" << name << "\"><b>" << name << "</b></a>;</li>" << endl;
+ QString detail = QLatin1String("<h3><a name=") + QString::fromLatin1(name.constData()) + QLatin1String("></a>") +
QLatin1String(type.constData()) +
- QLatin1Char(' ') + QLatin1String(name.constData()) + QLatin1String("</h3>\n");
- detail += docuFromName(typeInfo, QString::fromLatin1(name));
- QVariant::Type vartype = QVariant::nameToType(type);
- if (!prop.isReadable())
- continue;
+ QLatin1Char(' ') + QLatin1String(name.constData()) + QLatin1String("</h3>\n");
+ detail += docuFromName(typeInfo, QString::fromLatin1(name));
+ QVariant::Type vartype = QVariant::nameToType(type);
+ if (!prop.isReadable())
+ continue;
- if (prop.isEnumType())
- vartype = QVariant::Int;
+ if (prop.isEnumType())
+ vartype = QVariant::Int;
if (vartype != QVariant::Invalid) {
- detail += QLatin1String("<p>Read this property's value using QObject::property:<pre>\n");
+ detail += QLatin1String("<p>Read this property's value using QObject::property:<pre>\n");
if (prop.isEnumType())
- detail += QLatin1String("\tint val = ");
+ detail += QLatin1String("\tint val = ");
else
detail += QLatin1Char('\t') + QLatin1String(type.constData()) + QLatin1String(" val = ");
- detail += QLatin1String("object->property(\"") + QLatin1String(name.constData()) +
+ detail += QLatin1String("object->property(\"") + QLatin1String(name.constData()) +
QLatin1String("\").") + QLatin1String(toType(type).constData()) + QLatin1String(";\n");
- detail += QLatin1String("</pre>\n");
- } else if (type == "IDispatch*" || type == "IUnknown*") {
- detail += QLatin1String("<p>Get the subobject using querySubObject:<pre>\n");
- detail += QLatin1String("\tQAxObject *") + QLatin1String(name.constData()) +
+ detail += QLatin1String("</pre>\n");
+ } else if (type == "IDispatch*" || type == "IUnknown*") {
+ detail += QLatin1String("<p>Get the subobject using querySubObject:<pre>\n");
+ detail += QLatin1String("\tQAxObject *") + QLatin1String(name.constData()) +
QLatin1String(" = object->querySubObject(\"") + QLatin1String(name.constData()) + QLatin1String("\");\n");
- detail += QLatin1String("</pre>\n");
- } else {
- detail += QLatin1String("<p>This property is of an unsupported type.\n");
- }
- if (prop.isWritable()) {
- detail += QLatin1String("Set this property' value using QObject::setProperty:<pre>\n");
+ detail += QLatin1String("</pre>\n");
+ } else {
+ detail += QLatin1String("<p>This property is of an unsupported type.\n");
+ }
+ if (prop.isWritable()) {
+ detail += QLatin1String("Set this property' value using QObject::setProperty:<pre>\n");
if (prop.isEnumType()) {
detail += QLatin1String("\tint newValue = ... // string representation of values also supported\n");
} else {
- detail += QLatin1String("\t") + QString::fromLatin1(type.constData()) + QLatin1String(" newValue = ...\n");
+ detail += QLatin1String("\t") + QString::fromLatin1(type.constData()) + QLatin1String(" newValue = ...\n");
}
- detail += QLatin1String("\tobject->setProperty(\"") + QString::fromLatin1(name) + QLatin1String("\", newValue);\n");
- detail += QLatin1String("</pre>\n");
- detail += QLatin1String("Or using the ");
- QByteArray setterSlot;
+ detail += QLatin1String("\tobject->setProperty(\"") + QString::fromLatin1(name) + QLatin1String("\", newValue);\n");
+ detail += QLatin1String("</pre>\n");
+ detail += QLatin1String("Or using the ");
+ QByteArray setterSlot;
if (isupper(name.at(0))) {
- setterSlot = "Set" + name;
- } else {
- QByteArray nameUp = name;
- nameUp[0] = toupper(nameUp.at(0));
- setterSlot = "set" + nameUp;
- }
- detail += QLatin1String("<a href=\"#") + QString::fromLatin1(setterSlot) + QLatin1String("\">") +
+ setterSlot = "Set" + name;
+ } else {
+ QByteArray nameUp = name;
+ nameUp[0] = toupper(nameUp.at(0));
+ setterSlot = "set" + nameUp;
+ }
+ detail += QLatin1String("<a href=\"#") + QString::fromLatin1(setterSlot) + QLatin1String("\">") +
QString::fromLatin1(setterSlot.constData()) + QLatin1String("</a> slot.\n");
- }
- if (prop.isEnumType()) {
- detail += QLatin1String("<p>See also <a href=\"#") + QString::fromLatin1(type) +
+ }
+ if (prop.isEnumType()) {
+ detail += QLatin1String("<p>See also <a href=\"#") + QString::fromLatin1(type) +
QLatin1String("\">") + QString::fromLatin1(type) + QLatin1String("</a>.\n");
- }
+ }
- propDetails << detail;
- }
- stream << "</ul>" << endl;
+ propDetails << detail;
+ }
+ stream << "</ul>" << endl;
}
const int enumCount = mo->enumeratorCount();
if (enumCount) {
- stream << "<hr><h2>Member Type Documentation</h2>" << endl;
- for (int i = 0; i < enumCount; ++i) {
- const QMetaEnum enumdata = mo->enumerator(i);
- stream << "<h3><a name=" << enumdata.name() << "></a>" << enumdata.name() << "</h3>" << endl;
- stream << "<ul>" << endl;
- for (int e = 0; e < enumdata.keyCount(); ++e) {
- stream << "<li>" << enumdata.key(e) << "\t=" << enumdata.value(e) << "</li>" << endl;
- }
- stream << "</ul>" << endl;
- }
+ stream << "<hr><h2>Member Type Documentation</h2>" << endl;
+ for (int i = 0; i < enumCount; ++i) {
+ const QMetaEnum enumdata = mo->enumerator(i);
+ stream << "<h3><a name=" << enumdata.name() << "></a>" << enumdata.name() << "</h3>" << endl;
+ stream << "<ul>" << endl;
+ for (int e = 0; e < enumdata.keyCount(); ++e) {
+ stream << "<li>" << enumdata.key(e) << "\t=" << enumdata.value(e) << "</li>" << endl;
+ }
+ stream << "</ul>" << endl;
+ }
}
if (methodDetails.count()) {
- stream << "<hr><h2>Member Function Documentation</h2>" << endl;
- for (int i = 0; i < methodDetails.count(); ++i)
- stream << methodDetails.at(i) << endl;
+ stream << "<hr><h2>Member Function Documentation</h2>" << endl;
+ for (int i = 0; i < methodDetails.count(); ++i)
+ stream << methodDetails.at(i) << endl;
}
if (propDetails.count()) {
- stream << "<hr><h2>Property Documentation</h2>" << endl;
- for (int i = 0; i < propDetails.count(); ++i)
- stream << propDetails.at(i) << endl;
+ stream << "<hr><h2>Property Documentation</h2>" << endl;
+ for (int i = 0; i < propDetails.count(); ++i)
+ stream << propDetails.at(i) << endl;
}
if (typeInfo)
diff --git a/src/activeqt/container/qaxobject.cpp b/src/activeqt/container/qaxobject.cpp
index d0b2674..7303e74 100644
--- a/src/activeqt/container/qaxobject.cpp
+++ b/src/activeqt/container/qaxobject.cpp
@@ -72,9 +72,9 @@ QT_BEGIN_NAMESPACE
\warning
You can subclass QAxObject, but you cannot use the Q_OBJECT macro
in the subclass (the generated moc-file will not compile), so you
- cannot add further signals, slots or properties. This limitation is
- due to the metaobject information generated in runtime.
- To work around this problem, aggregate the QAxObject as a member of
+ cannot add further signals, slots or properties. This limitation is
+ due to the metaobject information generated in runtime.
+ To work around this problem, aggregate the QAxObject as a member of
the QObject subclass.
\sa QAxBase, QAxWidget, QAxScript, {ActiveQt Framework}
diff --git a/src/activeqt/container/qaxobject.h b/src/activeqt/container/qaxobject.h
index 8ec2358..ceb96ca 100644
--- a/src/activeqt/container/qaxobject.h
+++ b/src/activeqt/container/qaxobject.h
@@ -57,7 +57,7 @@ public:
QAxObject(const QString &c, QObject *parent = 0);
QAxObject(IUnknown *iface, QObject *parent = 0);
~QAxObject();
-
+
bool doVerb(const QString &verb);
protected:
diff --git a/src/activeqt/container/qaxscript.cpp b/src/activeqt/container/qaxscript.cpp
index 431a82a..c56474d 100644
--- a/src/activeqt/container/qaxscript.cpp
+++ b/src/activeqt/container/qaxscript.cpp
@@ -232,10 +232,10 @@ HRESULT WINAPI QAxScriptSite::OnScriptTerminate(const VARIANT *result, const EXC
emit script->finished(VARIANTToQVariant(*result, 0));
if (exception)
emit script->finished(exception->wCode,
- QString::fromWCharArray(exception->bstrSource),
- QString::fromWCharArray(exception->bstrDescription),
- QString::fromWCharArray(exception->bstrHelpFile)
- );
+ QString::fromWCharArray(exception->bstrSource),
+ QString::fromWCharArray(exception->bstrDescription),
+ QString::fromWCharArray(exception->bstrHelpFile)
+ );
return S_OK;
}
diff --git a/src/activeqt/container/qaxscript.h b/src/activeqt/container/qaxscript.h
index 6885541..84a6702 100644
--- a/src/activeqt/container/qaxscript.h
+++ b/src/activeqt/container/qaxscript.h
@@ -65,55 +65,55 @@ public:
Disconnected = 3,
Closed = 4
};
-
+
QAxScriptEngine(const QString &language, QAxScript *script);
~QAxScriptEngine();
-
+
bool isValid() const;
bool hasIntrospection() const;
-
+
QString scriptLanguage() const;
-
+
State state() const;
void setState(State st);
-
+
void addItem(const QString &name);
-
+
long queryInterface(const QUuid &, void**) const;
-
+
protected:
bool initialize(IUnknown** ptr);
-
+
private:
QAxScript *script_code;
IActiveScript *engine;
-
+
QString script_language;
};
class QAxScript : public QObject
{
Q_OBJECT
-
+
public:
enum FunctionFlags {
FunctionNames = 0,
- FunctionSignatures
+ FunctionSignatures
};
-
+
QAxScript(const QString &name, QAxScriptManager *manager);
~QAxScript();
-
+
bool load(const QString &code, const QString &language = QString());
-
+
QStringList functions(FunctionFlags = FunctionNames) const;
-
+
QString scriptCode() const;
QString scriptName() const;
QAxScriptEngine *scriptEngine() const;
-
- QVariant call(const QString &function, const QVariant &v1 = QVariant(),
- const QVariant &v2 = QVariant(),
+
+ QVariant call(const QString &function, const QVariant &v1 = QVariant(),
+ const QVariant &v2 = QVariant(),
const QVariant &v3 = QVariant(),
const QVariant &v4 = QVariant(),
const QVariant &v5 = QVariant(),
@@ -121,7 +121,7 @@ public:
const QVariant &v7 = QVariant(),
const QVariant &v8 = QVariant());
QVariant call(const QString &function, QList<QVariant> &arguments);
-
+
Q_SIGNALS:
void entered();
void finished();
@@ -129,14 +129,14 @@ Q_SIGNALS:
void finished(int code, const QString &source,const QString &description, const QString &help);
void stateChanged(int state);
void error(int code, const QString &description, int sourcePosition, const QString &sourceText);
-
+
private:
friend class QAxScriptSite;
friend class QAxScriptEngine;
-
+
void updateObjects();
QAxBase *findObject(const QString &name);
-
+
QString script_name;
QString script_code;
QAxScriptManager *script_manager;
@@ -147,23 +147,23 @@ private:
class QAxScriptManager : public QObject
{
Q_OBJECT
-
+
public:
QAxScriptManager(QObject *parent = 0);
~QAxScriptManager();
-
+
void addObject(QAxBase *object);
void addObject(QObject *object);
-
+
QStringList functions(QAxScript::FunctionFlags = QAxScript::FunctionNames) const;
QStringList scriptNames() const;
QAxScript *script(const QString &name) const;
-
+
QAxScript* load(const QString &code, const QString &name, const QString &language);
QAxScript* load(const QString &file, const QString &name);
-
- QVariant call(const QString &function, const QVariant &v1 = QVariant(),
- const QVariant &v2 = QVariant(),
+
+ QVariant call(const QString &function, const QVariant &v1 = QVariant(),
+ const QVariant &v2 = QVariant(),
const QVariant &v3 = QVariant(),
const QVariant &v4 = QVariant(),
const QVariant &v5 = QVariant(),
@@ -171,21 +171,21 @@ public:
const QVariant &v7 = QVariant(),
const QVariant &v8 = QVariant());
QVariant call(const QString &function, QList<QVariant> &arguments);
-
+
static bool registerEngine(const QString &name, const QString &extension, const QString &code = QString());
static QString scriptFileFilter();
-
+
Q_SIGNALS:
void error(QAxScript *script, int code, const QString &description, int sourcePosition, const QString &sourceText);
-
+
private Q_SLOTS:
void objectDestroyed(QObject *o);
void scriptError(int code, const QString &description, int sourcePosition, const QString &sourceText);
-
+
private:
friend class QAxScript;
QAxScriptManagerPrivate *d;
-
+
void updateScript(QAxScript*);
QAxScript *scriptForFunction(const QString &function) const;
};
@@ -228,7 +228,7 @@ inline void QAxScriptManager::addObject(QObject *object)
{
QAxBase *wrapper = qax_create_object_wrapper(object);
if (!wrapper) {
- qWarning("QAxScriptMananger::addObject: Class %s not exposed through the QAxFactory",
+ qWarning("QAxScriptMananger::addObject: Class %s not exposed through the QAxFactory",
object->metaObject()->className());
Q_ASSERT(wrapper);
}
diff --git a/src/activeqt/container/qaxwidget.cpp b/src/activeqt/container/qaxwidget.cpp
index 88f3da9..7c3a0a8 100644
--- a/src/activeqt/container/qaxwidget.cpp
+++ b/src/activeqt/container/qaxwidget.cpp
@@ -1545,9 +1545,9 @@ HRESULT WINAPI QAxClientSite::SetBorderSpace(LPCBORDERWIDTHS pborderwidths)
HRESULT WINAPI QAxClientSite::SetActiveObject(IOleInPlaceActiveObject *pActiveObject, LPCOLESTR pszObjName)
{
AX_DEBUG(QAxClientSite::SetActiveObject);
-
+
Q_UNUSED(pszObjName);
- // we are ignoring the name of the object, as suggested by MSDN documentation
+ // we are ignoring the name of the object, as suggested by MSDN documentation
// for IOleInPlaceUIWindow::SetActiveObject().
if (m_spInPlaceActiveObject) {
diff --git a/src/activeqt/container/qaxwidget.h b/src/activeqt/container/qaxwidget.h
index a4ca3f9..2c8817b 100644
--- a/src/activeqt/container/qaxwidget.h
+++ b/src/activeqt/container/qaxwidget.h
@@ -58,12 +58,12 @@ class QAxWidget : public QWidget, public QAxBase
public:
QObject* qObject() const { return (QWidget*)this; }
const char *className() const;
-
+
QAxWidget(QWidget* parent = 0, Qt::WindowFlags f = 0);
QAxWidget(const QString &c, QWidget *parent = 0, Qt::WindowFlags f = 0);
QAxWidget(IUnknown *iface, QWidget *parent = 0, Qt::WindowFlags f = 0);
~QAxWidget();
-
+
void clear();
bool doVerb(const QString &verb);
@@ -76,7 +76,7 @@ protected:
bool initialize(IUnknown**);
virtual bool createHostWindow(bool);
bool createHostWindow(bool, const QByteArray&);
-
+
void changeEvent(QEvent *e);
void resizeEvent(QResizeEvent *);
diff --git a/src/activeqt/control/control.pro b/src/activeqt/control/control.pro
index dfe86ea..3f43f5d 100644
--- a/src/activeqt/control/control.pro
+++ b/src/activeqt/control/control.pro
@@ -3,7 +3,7 @@ TARGET = QtAxServer
QT += core-private gui-private widgets axbase
CONFIG += static
-DEFINES += QAX_SERVER
+DEFINES += QAX_SERVER
HEADERS = qaxaggregated.h \
qaxbindable.h \
diff --git a/src/activeqt/control/qaxaggregated.h b/src/activeqt/control/qaxaggregated.h
index 5fdc9df..90c8f5a 100644
--- a/src/activeqt/control/qaxaggregated.h
+++ b/src/activeqt/control/qaxaggregated.h
@@ -62,7 +62,7 @@ protected:
inline IUnknown *controllingUnknown() const
{ return controlling_unknown; }
- inline QWidget *widget() const
+ inline QWidget *widget() const
{
return qobject_cast<QWidget*>(the_object);
}
diff --git a/src/activeqt/control/qaxfactory.cpp b/src/activeqt/control/qaxfactory.cpp
index 2a4184f..b510f18 100644
--- a/src/activeqt/control/qaxfactory.cpp
+++ b/src/activeqt/control/qaxfactory.cpp
@@ -493,7 +493,7 @@ bool QAxFactory::registerActiveObject(QObject *object)
return false;
if (!QString::fromWCharArray(qAxModuleFilename).toLower().endsWith(QLatin1String(".exe")))
- return false;
+ return false;
ActiveObject *active = new ActiveObject(object, qAxFactory());
if (!active->wrapper || !active->cookie) {
diff --git a/src/activeqt/control/qaxfactory.h b/src/activeqt/control/qaxfactory.h
index 8cf385c..eaf5757 100644
--- a/src/activeqt/control/qaxfactory.h
+++ b/src/activeqt/control/qaxfactory.h
@@ -60,35 +60,35 @@ class QAxFactory : public QObject
public:
QAxFactory(const QUuid &libId, const QUuid &appId);
virtual ~QAxFactory();
-
+
virtual QStringList featureList() const = 0;
virtual QObject *createObject(const QString &key) = 0;
virtual const QMetaObject *metaObject(const QString &key) const = 0;
virtual bool createObjectWrapper(QObject *object, IDispatch **wrapper);
-
+
virtual QUuid classID(const QString &key) const;
virtual QUuid interfaceID(const QString &key) const;
virtual QUuid eventsID(const QString &key) const;
-
+
virtual QUuid typeLibID() const;
virtual QUuid appID() const;
-
+
virtual void registerClass(const QString &key, QSettings *) const;
virtual void unregisterClass(const QString &key, QSettings *) const;
-
+
virtual bool validateLicenseKey(const QString &key, const QString &licenseKey) const;
-
+
virtual QString exposeToSuperClass(const QString &key) const;
virtual bool stayTopLevel(const QString &key) const;
virtual bool hasStockEvents(const QString &key) const;
virtual bool isService() const;
-
+
enum ServerType {
SingleInstance,
MultipleInstances
};
-
+
static bool isServer();
static QString serverDirPath();
static QString serverFilePath();
@@ -96,7 +96,7 @@ public:
static bool stopServer();
static bool registerActiveObject(QObject *object);
-
+
private:
QUuid typelib;
QUuid app;
@@ -120,12 +120,12 @@ inline bool QAxFactory::stopServer()
return qax_stopServer();
}
-#define QAXFACTORY_EXPORT(IMPL, TYPELIB, APPID) \
+#define QAXFACTORY_EXPORT(IMPL, TYPELIB, APPID) \
QT_BEGIN_NAMESPACE \
- QAxFactory *qax_instantiate() \
- { \
- IMPL *impl = new IMPL(QUuid(TYPELIB), QUuid(APPID)); \
- return impl; \
+ QAxFactory *qax_instantiate() \
+ { \
+ IMPL *impl = new IMPL(QUuid(TYPELIB), QUuid(APPID)); \
+ return impl; \
} \
QT_END_NAMESPACE
@@ -185,7 +185,7 @@ public:
QAxClass(const QString &libId, const QString &appId)
: QAxFactory(libId, appId)
{}
-
+
const QMetaObject *metaObject(const QString &) const { return &T::staticMetaObject; }
QStringList featureList() const { return QStringList(QString(T::staticMetaObject.className())); }
QObject *createObject(const QString &key)
@@ -281,10 +281,10 @@ public:
return f ? f->hasStockEvents(key) : false; \
} \
}; \
- QAxFactory *qax_instantiate() \
- { \
- QAxFactoryList *impl = new QAxFactoryList(); \
- return impl; \
+ QAxFactory *qax_instantiate() \
+ { \
+ QAxFactoryList *impl = new QAxFactoryList(); \
+ return impl; \
} \
QT_END_NAMESPACE
diff --git a/src/activeqt/control/qaxserver.cpp b/src/activeqt/control/qaxserver.cpp
index 97a7446..58b3faf 100644
--- a/src/activeqt/control/qaxserver.cpp
+++ b/src/activeqt/control/qaxserver.cpp
@@ -113,9 +113,9 @@ QString qAxInit()
if (initCount++)
return libFile;
-
+
InitializeCriticalSection(&qAxModuleSection);
-
+
libFile = QString::fromWCharArray(qAxModuleFilename);
libFile = libFile.toLower();
if (LoadTypeLibEx((wchar_t*)libFile.utf16(), REGKIND_NONE, &qAxTypeLibrary) == S_OK)
@@ -139,18 +139,18 @@ void qAxCleanup()
{
if (!initCount)
qWarning("qAxInit/qAxCleanup mismatch");
-
+
if (--initCount)
return;
delete qax_factory;
qax_factory = 0;
-
+
if (qAxTypeLibrary) {
qAxTypeLibrary->Release();
qAxTypeLibrary = 0;
}
-
+
DeleteCriticalSection(&qAxModuleSection);
}
@@ -170,7 +170,7 @@ unsigned long qAxUnlock()
EnterCriticalSection(&qAxModuleSection);
unsigned long ref = --qAxModuleRef;
LeaveCriticalSection(&qAxModuleSection);
-
+
if (!ref)
qax_shutDown();
return ref;
@@ -211,10 +211,10 @@ HRESULT UpdateRegistry(BOOL bRegister)
QString path = file.left(file.lastIndexOf(QLatin1Char('\\'))+1);
QString module = file.right(file.length() - path.length());
module = module.left(module.lastIndexOf(QLatin1Char('.')));
-
+
const QString appId = qAxFactory()->appID().toString().toUpper();
const QString libId = qAxFactory()->typeLibID().toString().toUpper();
-
+
QString libFile = qAxInit();
QString typeLibVersion;
@@ -246,7 +246,7 @@ HRESULT UpdateRegistry(BOOL bRegister)
keyPath = QLatin1String("HKEY_CURRENT_USER\\Software\\Classes");
QSettings settings(keyPath, QSettings::NativeFormat);
-
+
// we try to create the ActiveX widgets later on...
bool delete_qApp = false;
if (!qApp) {
@@ -254,7 +254,7 @@ HRESULT UpdateRegistry(BOOL bRegister)
(void)new QApplication(argc, 0);
delete_qApp = true;
}
-
+
if (bRegister) {
if (qAxOutProcServer) {
settings.setValue(QLatin1String("/AppID/") + appId + QLatin1String("/."), module);
@@ -286,16 +286,16 @@ HRESULT UpdateRegistry(BOOL bRegister)
olemisc |= OLEMISC_INVISIBLEATRUNTIME;
else if (object->findChild<QMenuBar*>() && !qax_disable_inplaceframe)
olemisc |= OLEMISC_WANTSTOMENUMERGE;
-
+
settings.setValue(QLatin1Char('/') + module + QLatin1Char('.') + className + QLatin1Char('.') + classMajorVersion + QLatin1String("/."), className + QLatin1String(" Class"));
settings.setValue(QLatin1Char('/') + module + QLatin1Char('.') + className + QLatin1Char('.') + classMajorVersion + QLatin1String("/CLSID/."), classId);
if (insertable)
settings.setValue(QLatin1Char('/') + module + QLatin1Char('.') + className + QLatin1Char('.') + classMajorVersion + QLatin1String("/Insertable/."), QVariant(QLatin1String("")));
-
+
settings.setValue(QLatin1Char('/') + module + QLatin1Char('.') + className + QLatin1String("/."), className + QLatin1String(" Class"));
settings.setValue(QLatin1Char('/') + module + QLatin1Char('.') + className + QLatin1String("/CLSID/."), classId);
settings.setValue(QLatin1Char('/') + module + QLatin1Char('.') + className + QLatin1String("/CurVer/."), module + QLatin1Char('.') + className + QLatin1Char('.') + classMajorVersion);
-
+
settings.setValue(QLatin1String("/CLSID/") + classId + QLatin1String("/."), className + QLatin1String(" Class"));
if (file.endsWith(QLatin1String("exe"), Qt::CaseInsensitive))
settings.setValue(QLatin1String("/CLSID/") + classId + QLatin1String("/AppID"), appId);
@@ -361,31 +361,31 @@ HRESULT UpdateRegistry(BOOL bRegister)
const QMetaObject *mo = qAxFactory()->metaObject(className);
const QString classId = qAxFactory()->classID(className).toString().toUpper();
className = qax_clean_type(className, mo);
-
+
QString classVersion = mo ? QString::fromLatin1(mo->classInfo(mo->indexOfClassInfo("Version")).value()) : QString();
if (classVersion.isNull())
classVersion = QLatin1String("1.0");
const QString classMajorVersion = classVersion.left(classVersion.indexOf(QLatin1Char('.')));
-
+
qAxFactory()->unregisterClass(*key, &settings);
-
+
settings.remove(QLatin1Char('/') + module + QLatin1Char('.') + className + QLatin1Char('.') + classMajorVersion + QLatin1String("/CLSID/."));
settings.remove(QLatin1Char('/') + module + QLatin1Char('.') + className + QLatin1Char('.') + classMajorVersion + QLatin1String("/Insertable/."));
settings.remove(QLatin1Char('/') + module + QLatin1Char('.') + className + QLatin1Char('.') + classMajorVersion + QLatin1String("/."));
settings.remove(QLatin1Char('/') + module + QLatin1Char('.') + className + QLatin1Char('.') + classMajorVersion);
-
+
settings.remove(QLatin1Char('/') + module + QLatin1Char('.') + className + QLatin1String("/CLSID/."));
settings.remove(QLatin1Char('/') + module + QLatin1Char('.') + className + QLatin1String("/CurVer/."));
settings.remove(QLatin1Char('/') + module + QLatin1Char('.') + className + QLatin1String("/."));
settings.remove(QLatin1Char('/') + module + QLatin1Char('.') + className);
-
+
settings.remove(QLatin1String("/CLSID/") + classId + QLatin1String("/AppID"));
settings.remove(QLatin1String("/CLSID/") + classId + QLatin1String("/Control/."));
settings.remove(QLatin1String("/CLSID/") + classId + QLatin1String("/Insertable/."));
settings.remove(QLatin1String("/CLSID/") + classId + QLatin1String("/InProcServer32/."));
settings.remove(QLatin1String("/CLSID/") + classId + QLatin1String("/LocalServer32/."));
settings.remove(QLatin1String("/CLSID/") + classId + QLatin1String("/MiscStatus/1/."));
- settings.remove(QLatin1String("/CLSID/") + classId + QLatin1String("/MiscStatus/."));
+ settings.remove(QLatin1String("/CLSID/") + classId + QLatin1String("/MiscStatus/."));
settings.remove(QLatin1String("/CLSID/") + classId + QLatin1String("/Programmable/."));
settings.remove(QLatin1String("/CLSID/") + classId + QLatin1String("/ToolboxBitmap32/."));
settings.remove(QLatin1String("/CLSID/") + classId + QLatin1String("/TypeLib/."));
@@ -425,7 +425,7 @@ HRESULT UpdateRegistry(BOOL bRegister)
}
}
}
-
+
if (delete_qApp)
delete qApp;
@@ -446,49 +446,49 @@ static QList<QByteArray> subtypes;
static const char* const type_map[][2] =
{
// QVariant/Qt Value data types
- { "QString", "BSTR" },
- { "QCString", "BSTR" },
- { "bool", "VARIANT_BOOL" },
- { "int", "int" },
- { "void", "void" },
- { "uint", "unsigned int" },
- { "double", "double" },
- { "QColor", "OLE_COLOR" },
- { "QDate", "DATE" },
- { "QTime", "DATE" },
- { "QDateTime", "DATE" },
- { "QFont", "IFontDisp*" },
- { "QPixmap", "IPictureDisp*" },
- { "QVariant", "VARIANT" },
- { "QVariantList", "SAFEARRAY(VARIANT)" },
+ { "QString", "BSTR" },
+ { "QCString", "BSTR" },
+ { "bool", "VARIANT_BOOL" },
+ { "int", "int" },
+ { "void", "void" },
+ { "uint", "unsigned int" },
+ { "double", "double" },
+ { "QColor", "OLE_COLOR" },
+ { "QDate", "DATE" },
+ { "QTime", "DATE" },
+ { "QDateTime", "DATE" },
+ { "QFont", "IFontDisp*" },
+ { "QPixmap", "IPictureDisp*" },
+ { "QVariant", "VARIANT" },
+ { "QVariantList", "SAFEARRAY(VARIANT)" },
{ "QList<QVariant>", "SAFEARRAY(VARIANT)" },
- { "quint64", "CY" },
- { "qint64", "CY" },
- { "qulonglong", "CY" },
- { "qlonglong", "CY" },
- { "QByteArray", "SAFEARRAY(BYTE)" },
- { "QStringList", "SAFEARRAY(BSTR)" },
+ { "quint64", "CY" },
+ { "qint64", "CY" },
+ { "qulonglong", "CY" },
+ { "qlonglong", "CY" },
+ { "QByteArray", "SAFEARRAY(BYTE)" },
+ { "QStringList", "SAFEARRAY(BSTR)" },
// Userdefined Qt datatypes - some not on Borland though
{ "QCursor", "enum MousePointer" },
{ "Qt::FocusPolicy", "enum FocusPolicy" },
#ifndef Q_CC_BOR
# if __REQUIRED_RPCNDR_H_VERSION__ >= Q_REQUIRED_RPCNDR_H_VERSION
- { "QRect", "struct QRect" },
- { "QSize", "struct QSize" },
- { "QPoint", "struct QPoint" },
+ { "QRect", "struct QRect" },
+ { "QSize", "struct QSize" },
+ { "QPoint", "struct QPoint" },
# endif
#endif
// And we support COM data types
- { "BOOL", "BOOL" },
- { "BSTR", "BSTR" },
- { "OLE_COLOR", "OLE_COLOR" },
- { "DATE", "DATE" },
- { "VARIANT", "VARIANT" },
- { "IDispatch", "IDispatch*" },
- { "IUnknown", "IUnknown*" },
- { "IDispatch*", "IDispatch*" },
- { "IUnknown*", "IUnknown*" },
- { 0, 0 }
+ { "BOOL", "BOOL" },
+ { "BSTR", "BSTR" },
+ { "OLE_COLOR", "OLE_COLOR" },
+ { "DATE", "DATE" },
+ { "VARIANT", "VARIANT" },
+ { "IDispatch", "IDispatch*" },
+ { "IUnknown", "IUnknown*" },
+ { "IDispatch*", "IDispatch*" },
+ { "IUnknown*", "IUnknown*" },
+ { 0, 0 }
};
static QByteArray convertTypes(const QByteArray &qtype, bool *ok)
@@ -497,12 +497,12 @@ static QByteArray convertTypes(const QByteArray &qtype, bool *ok)
qRegisterMetaType<IUnknown *>("IUnknown*");
*ok = false;
-
+
int i = 0;
while (type_map[i][0]) {
if (qtype == type_map[i][0] && type_map[i][1]) {
*ok = true;
- return type_map[i][1];
+ return type_map[i][1];
}
++i;
}
@@ -528,39 +528,39 @@ static QByteArray convertTypes(const QByteArray &qtype, bool *ok)
static const char* const keyword_map[][2] =
{
- { "aggregatable", "aggregating" },
- { "allocate", "alloc" },
- { "appobject", "appObject" },
- { "arrays", "array" },
- { "async", "asynchronous" },
- { "bindable", "binding" },
- { "Boolean", "boolval" },
- { "boolean", "boolval" },
- { "broadcast", "broadCast" },
- { "callback", "callBack" },
- { "decode", "deCode" },
- { "default", "defaulted" },
- { "defaultbind", "defaultBind" },
- { "defaultvalue", "defaultValue" },
- { "encode" "enCode" },
- { "endpoint", "endPoint" },
- { "hidden", "isHidden" },
- { "ignore", "ignore_" },
- { "local", "local_" },
- { "notify", "notify_" },
- { "object", "object_" },
- { "optimize", "optimize_" },
- { "optional", "optional_" },
- { "out", "out_" },
- { "pipe", "pipe_" },
- { "proxy", "proxy_" },
- { "ptr", "pointer" },
- { "readonly", "readOnly" },
- { "small", "small_" },
- { "source", "source_" },
- { "string", "string_" },
- { "uuid", "uuid_" },
- { 0, 0 }
+ { "aggregatable", "aggregating" },
+ { "allocate", "alloc" },
+ { "appobject", "appObject" },
+ { "arrays", "array" },
+ { "async", "asynchronous" },
+ { "bindable", "binding" },
+ { "Boolean", "boolval" },
+ { "boolean", "boolval" },
+ { "broadcast", "broadCast" },
+ { "callback", "callBack" },
+ { "decode", "deCode" },
+ { "default", "defaulted" },
+ { "defaultbind", "defaultBind" },
+ { "defaultvalue", "defaultValue" },
+ { "encode" "enCode" },
+ { "endpoint", "endPoint" },
+ { "hidden", "isHidden" },
+ { "ignore", "ignore_" },
+ { "local", "local_" },
+ { "notify", "notify_" },
+ { "object", "object_" },
+ { "optimize", "optimize_" },
+ { "optional", "optional_" },
+ { "out", "out_" },
+ { "pipe", "pipe_" },
+ { "proxy", "proxy_" },
+ { "ptr", "pointer" },
+ { "readonly", "readOnly" },
+ { "small", "small_" },
+ { "source", "source_" },
+ { "string", "string_" },
+ { "uuid", "uuid_" },
+ { 0, 0 }
};
static QByteArray replaceKeyword(const QByteArray &name)
@@ -579,7 +579,7 @@ static QMap<QByteArray, int> mapping;
static QByteArray renameOverloads(const QByteArray &name)
{
QByteArray newName = name;
-
+
if (mapping.contains(name)) {
int n = mapping.value(name);
newName = name + '_' + QByteArray::number(n);
@@ -587,7 +587,7 @@ static QByteArray renameOverloads(const QByteArray &name)
} else {
mapping.insert(name, 1);
}
-
+
return newName;
}
@@ -684,12 +684,12 @@ bool ignoreProps(const char *test)
static QByteArray prototype(const QList<QByteArray> &parameterTypes, const QList<QByteArray> &parameterNames, bool *ok)
{
QByteArray prototype;
-
+
for (int p = 0; p < parameterTypes.count() && *ok; ++p) {
bool out = false;
QByteArray type(parameterTypes.at(p));
QByteArray name(parameterNames.at(p));
-
+
if (type.endsWith('&')) {
out = true;
type.truncate(type.length() - 1);
@@ -708,18 +708,18 @@ static QByteArray prototype(const QList<QByteArray> &parameterTypes, const QList
prototype += "[in] " + type + ' ';
else
prototype += "[in,out] " + type + ' ';
-
+
if (out)
prototype += '*';
if (name.isEmpty())
prototype += 'p' + QByteArray::number(p);
else
prototype += "p_" + replaceKeyword(name);
-
+
if (p < parameterTypes.count() - 1)
prototype += ", ";
}
-
+
return prototype;
}
@@ -753,32 +753,32 @@ static HRESULT classIDL(QObject *o, const QMetaObject *mo, const QString &classN
int i = 0;
if (!mo)
return 3;
-
+
QString topclass = qAxFactory()->exposeToSuperClass(className);
if (topclass.isEmpty())
topclass = QLatin1String("QObject");
bool hasStockEvents = qAxFactory()->hasStockEvents(className);
-
+
const QMetaObject *pmo = mo;
do {
pmo = pmo->superClass();
} while (pmo && topclass != QString::fromLatin1(pmo->className()));
-
+
int enumoff = pmo ? pmo->enumeratorOffset() : mo->enumeratorOffset();
int methodoff = pmo ? pmo->methodOffset() : mo->methodOffset();
int propoff = pmo ? pmo->propertyOffset() : mo->propertyOffset();
-
+
int qtProps = 0;
int qtSlots = 0;
bool control = false;
-
+
if (o && o->isWidgetType()) {
qtProps = QWidget::staticMetaObject.propertyCount();
qtSlots = QWidget::staticMetaObject.methodCount();
control = true;
}
-
+
QString classID = qAxFactory()->classID(className).toString().toUpper();
if (QUuid(classID).isNull())
return 4;
@@ -790,20 +790,20 @@ static HRESULT classIDL(QObject *o, const QMetaObject *mo, const QString &classN
QString eventsID = qAxFactory()->eventsID(className).toString().toUpper();
bool hasEvents = !QUuid(eventsID).isNull();
STRIPCB(eventsID);
-
+
QString cleanClassName = qax_clean_type(className, mo);
QString defProp(QLatin1String(mo->classInfo(mo->indexOfClassInfo("DefaultProperty")).value()));
QString defSignal(QLatin1String(mo->classInfo(mo->indexOfClassInfo("DefaultSignal")).value()));
-
+
for (i = enumoff; i < mo->enumeratorCount(); ++i) {
const QMetaEnum enumerator = mo->enumerator(i);
if (enums.contains(enumerator.name()))
continue;
-
+
enums.append(enumerator.name());
-
+
out << "\tenum " << enumerator.name() << " {" << endl;
-
+
for (int j = 0; j < enumerator.keyCount(); ++j) {
QByteArray key(enumerator.key(j));
while (enumValues.contains(key)) {
@@ -865,24 +865,24 @@ static HRESULT classIDL(QObject *o, const QMetaObject *mo, const QString &classN
out << "\t]" << endl;
out << "\tdispinterface I" << cleanClassName << endl;
out << "\t{" << endl;
-
+
out << "\tproperties:" << endl;
for (i = propoff; i < mo->propertyCount(); ++i) {
const QMetaProperty property = mo->property(i);
- /* if (property.testFlags(QMetaProperty::Override))
- continue;*/
+ /* if (property.testFlags(QMetaProperty::Override))
+ continue;*/
if (i <= qtProps && ignoreProps(property.name()))
continue;
if (!property.name() || mo->indexOfProperty(property.name()) > i)
continue;
-
+
bool ok = true;
QByteArray type(convertTypes(property.typeName(), &ok));
QByteArray name(replaceKeyword(property.name()));
-
+
if (!ok)
out << "\t/****** Property is of unsupported datatype" << endl;
-
+
out << "\t\t[id(" << id << ')';
if (!property.isWritable())
out << ", readonly";
@@ -895,7 +895,7 @@ static HRESULT classIDL(QObject *o, const QMetaObject *mo, const QString &classN
if (defProp == QLatin1String(name))
out << ", uidefault";
out << "] " << type << ' ' << name << ';' << endl;
-
+
if (!ok)
out << "\t******/" << endl;
++id;
@@ -919,7 +919,7 @@ static HRESULT classIDL(QObject *o, const QMetaObject *mo, const QString &classN
out << outBuffer;
outBuffer = QByteArray();
}
-
+
QByteArray signature(slot.methodSignature());
QByteArray name(signature.left(signature.indexOf('(')));
if (i <= qtSlots && ignoreSlots(name))
@@ -933,20 +933,20 @@ static HRESULT classIDL(QObject *o, const QMetaObject *mo, const QString &classN
QList<QByteArray> parameterTypes(slot.parameterTypes());
QList<QByteArray> parameterNames(slot.parameterNames());
-
+
bool ok = true;
QByteArray type = slot.typeName();
if (type.isEmpty())
type = "void";
else
type = convertTypes(type, &ok);
-
+
QByteArray ptype(prototype(parameterTypes, parameterNames, &ok));
if (!ok)
outBuffer += "\t/****** Slot parameter uses unsupported datatype\n";
-
+
outBuffer += "\t\t[id(" + QString::number(id).toLatin1() + ")] " + type + ' ' + name + '(' + ptype + ");\n";
-
+
if (!ok)
outBuffer += "\t******/\n";
++id;
@@ -961,7 +961,7 @@ static HRESULT classIDL(QObject *o, const QMetaObject *mo, const QString &classN
mapping.clear();
id = 1;
-
+
if (hasEvents) {
out << "\t[" << endl;
out << "\t\tuuid(" << eventsID << ")," << endl;
@@ -971,7 +971,7 @@ static HRESULT classIDL(QObject *o, const QMetaObject *mo, const QString &classN
out << "\t{" << endl;
out << "\tproperties:" << endl;
out << "\tmethods:" << endl;
-
+
if (hasStockEvents) {
out << "\t/****** Stock events ******/" << endl;
out << "\t\t[id(DISPID_CLICK)] void Click();" << endl;
@@ -983,12 +983,12 @@ static HRESULT classIDL(QObject *o, const QMetaObject *mo, const QString &classN
out << "\t\t[id(DISPID_MOUSEMOVE)] void MouseMove(short Button, short Shift, OLE_XPOS_PIXELS x, OLE_YPOS_PIXELS y);" << endl;
out << "\t\t[id(DISPID_MOUSEUP)] void MouseUp(short Button, short Shift, OLE_XPOS_PIXELS x, OLE_YPOS_PIXELS y);" << endl << endl;
}
-
+
for (i = methodoff; i < mo->methodCount(); ++i) {
const QMetaMethod signal = mo->method(i);
if (signal.methodType() != QMetaMethod::Signal)
continue;
-
+
QByteArray signature(signal.methodSignature());
QByteArray name(signature.left(signature.indexOf('(')));
signature = signature.mid(name.length() + 1);
@@ -996,33 +996,33 @@ static HRESULT classIDL(QObject *o, const QMetaObject *mo, const QString &classN
QList<QByteArray> parameterTypes(signal.parameterTypes());
QList<QByteArray> parameterNames(signal.parameterNames());
-
+
bool isDefault = defSignal == QLatin1String(name);
name = renameOverloads(replaceKeyword(name));
bool ok = true;
-
+
QByteArray type = signal.typeName();
if (!type.isEmpty() && type != "void") // signals with return value not supported
continue;
-
+
QByteArray ptype(prototype(parameterTypes, parameterNames, &ok));
if (!ok)
out << "\t/****** Signal parameter uses unsupported datatype" << endl;
-
+
out << "\t\t[id(" << id << ')';
if (isDefault)
out << ", uidefault";
out << "] void " << name << '(' << ptype << ");" << endl;
-
+
if (!ok)
out << "\t******/" << endl;
++id;
}
out << "\t};" << endl << endl;
}
-
+
out << "\t[" << endl;
-
+
if (qstricmp(mo->classInfo(mo->indexOfClassInfo("Aggregatable")).value(), "no"))
out << "\t\taggregatable," << endl;
if (!qstricmp(mo->classInfo(mo->indexOfClassInfo("RegisterObject")).value(), "yes"))
@@ -1053,7 +1053,7 @@ static HRESULT classIDL(QObject *o, const QMetaObject *mo, const QString &classN
if (hasEvents)
out << "\t\t[default, source] dispinterface I" << cleanClassName << "Events;" << endl;
out << "\t};" << endl;
-
+
return S_OK;
}
@@ -1072,10 +1072,10 @@ extern "C" HRESULT __stdcall DumpIDL(const QString &outfile, const QString &ver)
}
QFile file(outfile);
file.remove();
-
+
QString filebase = QString::fromWCharArray(qAxModuleFilename);
filebase = filebase.left(filebase.lastIndexOf(QLatin1Char('.')));
-
+
QString appID = qAxFactory()->appID().toString().toUpper();
if (QUuid(appID).isNull())
return 1;
@@ -1085,12 +1085,12 @@ extern "C" HRESULT __stdcall DumpIDL(const QString &outfile, const QString &ver)
return 2;
STRIPCB(typeLibID);
QString typelib = filebase.right(filebase.length() - filebase.lastIndexOf(QLatin1String("\\"))-1);
-
+
if (!file.open(QIODevice::WriteOnly))
return -1;
-
+
out.setDevice(&file);
-
+
QString version(ver.unicode(), ver.length());
while (version.count(QLatin1Char('.')) > 1) {
int lastdot = version.lastIndexOf(QLatin1Char('.'));
@@ -1098,14 +1098,14 @@ extern "C" HRESULT __stdcall DumpIDL(const QString &outfile, const QString &ver)
}
if (version.isEmpty())
version = QLatin1String("1.0");
-
+
QString idQRect(QUuid(CLSID_QRect).toString());
STRIPCB(idQRect);
QString idQSize(QUuid(CLSID_QSize).toString());
STRIPCB(idQSize);
QString idQPoint(QUuid(CLSID_QPoint).toString());
STRIPCB(idQPoint);
-
+
out << "/****************************************************************************" << endl;
out << "** Interface definition generated for ActiveQt project" << endl;
out << "**" << endl;
@@ -1115,10 +1115,10 @@ extern "C" HRESULT __stdcall DumpIDL(const QString &outfile, const QString &ver)
out << "**" << endl;
out << "** WARNING! All changes made in this file will be lost!" << endl;
out << "****************************************************************************/" << endl << endl;
-
+
out << "import \"ocidl.idl\";" << endl;
out << "#include <olectl.h>" << endl << endl;
-
+
// dummy application to create widgets
bool delete_qApp = false;
if (!qApp) {
@@ -1126,7 +1126,7 @@ extern "C" HRESULT __stdcall DumpIDL(const QString &outfile, const QString &ver)
(void)new QApplication(argc, 0);
delete_qApp = true;
}
-
+
out << '[' << endl;
out << "\tuuid(" << typeLibID << ")," << endl;
out << "\tversion(" << version << ")," << endl;
@@ -1136,17 +1136,17 @@ extern "C" HRESULT __stdcall DumpIDL(const QString &outfile, const QString &ver)
out << '{' << endl;
out << "\timportlib(\"stdole32.tlb\");" << endl;
out << "\timportlib(\"stdole2.tlb\");" << endl << endl;
-
+
QStringList keys = qAxFactory()->featureList();
QStringList::ConstIterator key;
-
+
out << "\t/************************************************************************" << endl;
out << "\t** If this causes a compile error in MIDL you need to upgrade the" << endl;
out << "\t** Platform SDK you are using. Download the SDK from msdn.microsoft.com" << endl;
out << "\t** and make sure that both the system and the Visual Studio environment" << endl;
out << "\t** use the correct files." << endl;
out << "\t**" << endl;
-
+
#ifndef Q_CC_BOR
#if __REQUIRED_RPCNDR_H_VERSION__ < Q_REQUIRED_RPCNDR_H_VERSION
out << "\t** Required version of MIDL could not be verified. QRect, QSize and QPoint" << endl;
@@ -1155,7 +1155,7 @@ extern "C" HRESULT __stdcall DumpIDL(const QString &outfile, const QString &ver)
#else
out << "\t************************************************************************/" << endl;
#endif
-
+
out << endl;
out << "\t[uuid(" << idQRect << ")]" << endl;
out << "\tstruct QRect {" << endl;
@@ -1164,13 +1164,13 @@ extern "C" HRESULT __stdcall DumpIDL(const QString &outfile, const QString &ver)
out << "\t\tint right;" << endl;
out << "\t\tint bottom;" << endl;
out << "\t};" << endl << endl;
-
+
out << "\t[uuid(" << idQSize << ")]" << endl;
out << "\tstruct QSize {" << endl;
out << "\t\tint width;" << endl;
out << "\t\tint height;" << endl;
out << "\t};" << endl << endl;
-
+
out << "\t[uuid(" << idQPoint << ")]" << endl;
out << "\tstruct QPoint {" << endl;
out << "\t\tint x;" << endl;
@@ -1184,9 +1184,9 @@ extern "C" HRESULT __stdcall DumpIDL(const QString &outfile, const QString &ver)
out << "\t*************************************************************************" << endl;
#endif
out << endl;
-
+
out << "\t/* Forward declaration of classes that might be used as parameters */" << endl << endl;
-
+
int res = S_OK;
for (key = keys.begin(); key != keys.end(); ++key) {
QByteArray className = (*key).toLatin1();
@@ -1222,7 +1222,7 @@ extern "C" HRESULT __stdcall DumpIDL(const QString &outfile, const QString &ver)
out << endl;
if (res != S_OK)
goto ErrorInClass;
-
+
for (key = keys.begin(); key != keys.end(); ++key) {
QByteArray className = (*key).toLatin1();
QObject *o = qAxFactory()->createObject(QString::fromLatin1(className.constData()));
@@ -1240,10 +1240,10 @@ extern "C" HRESULT __stdcall DumpIDL(const QString &outfile, const QString &ver)
if (res != S_OK)
break;
}
-
+
out << "};" << endl;
out.flush();
-
+
ErrorInClass:
if (delete_qApp)
delete qApp;
@@ -1252,7 +1252,7 @@ ErrorInClass:
file.close();
file.remove();
}
-
+
return res;
}
diff --git a/src/activeqt/control/qaxserverbase.cpp b/src/activeqt/control/qaxserverbase.cpp
index ee49deb..ce57bf1 100644
--- a/src/activeqt/control/qaxserverbase.cpp
+++ b/src/activeqt/control/qaxserverbase.cpp
@@ -108,7 +108,7 @@ extern bool qax_ownQApp;
struct QAxExceptInfo
{
QAxExceptInfo(int c, const QString &s, const QString &d, const QString &x)
- : code(c), src(s), desc(d), context(x)
+ : code(c), src(s), desc(d), context(x)
{
}
int code;
@@ -176,15 +176,15 @@ public:
// IUnknown
unsigned long WINAPI AddRef()
{
- if (m_outerUnknown)
- return m_outerUnknown->AddRef();
+ if (m_outerUnknown)
+ return m_outerUnknown->AddRef();
return InterlockedIncrement(&ref);
}
unsigned long WINAPI Release()
{
- if (m_outerUnknown)
- return m_outerUnknown->Release();
+ if (m_outerUnknown)
+ return m_outerUnknown->Release();
LONG refCount = InterlockedDecrement(&ref);
if (!refCount)
@@ -198,14 +198,14 @@ public:
// IAxServerBase
IUnknown *clientSite() const
{
- return m_spClientSite;
+ return m_spClientSite;
}
void emitPropertyChanged(const char*);
bool emitRequestPropertyChange(const char*);
QObject *qObject() const
{
- return theObject;
+ return theObject;
}
void ensureMetaData();
bool isPropertyExposed(int index);
@@ -222,8 +222,8 @@ public:
STDMETHOD(GetTypeInfo)(UINT itinfo, LCID lcid, ITypeInfo** pptinfo);
STDMETHOD(GetIDsOfNames)(REFIID riid, LPOLESTR* rgszNames, UINT cNames, LCID lcid, DISPID* rgdispid);
STDMETHOD(Invoke)(DISPID dispidMember, REFIID riid,
- LCID lcid, WORD wFlags, DISPPARAMS* pdispparams, VARIANT* pvarResult,
- EXCEPINFO* pexcepinfo, UINT* puArgErr);
+ LCID lcid, WORD wFlags, DISPPARAMS* pdispparams, VARIANT* pvarResult,
+ EXCEPINFO* pexcepinfo, UINT* puArgErr);
// IProvideClassInfo
STDMETHOD(GetClassInfo)(ITypeInfo** pptinfo);
@@ -256,10 +256,10 @@ public:
// IViewObject
STDMETHOD(Draw)(DWORD dwAspect, LONG lIndex, void *pvAspect, DVTARGETDEVICE *ptd,
- HDC hicTargetDevice, HDC hdcDraw, LPCRECTL lprcBounds, LPCRECTL lprcWBounds,
- BOOL(__stdcall*pfnContinue)(ULONG_PTR), ULONG_PTR dwContinue);
+ HDC hicTargetDevice, HDC hdcDraw, LPCRECTL lprcBounds, LPCRECTL lprcWBounds,
+ BOOL(__stdcall*pfnContinue)(ULONG_PTR), ULONG_PTR dwContinue);
STDMETHOD(GetColorSet)(DWORD dwDrawAspect, LONG lindex, void *pvAspect, DVTARGETDEVICE *ptd,
- HDC hicTargetDev, LOGPALETTE **ppColorSet);
+ HDC hicTargetDev, LOGPALETTE **ppColorSet);
STDMETHOD(Freeze)(DWORD dwAspect, LONG lindex, void *pvAspect, DWORD *pdwFreeze);
STDMETHOD(Unfreeze)(DWORD dwFreeze);
STDMETHOD(SetAdvise)(DWORD aspects, DWORD advf, IAdviseSink *pAdvSink);
@@ -299,8 +299,8 @@ public:
// IPersist
STDMETHOD(GetClassID)(GUID*clsid)
{
- *clsid = qAxFactory()->classID(class_name);
- return S_OK;
+ *clsid = qAxFactory()->classID(class_name);
+ return S_OK;
}
// IPersistStreamInit
@@ -359,21 +359,21 @@ private:
ConnectionPoints points;
union {
- QWidget *widget;
- QObject *object;
+ QWidget *widget;
+ QObject *object;
} qt;
QPointer<QObject> theObject;
- unsigned isWidget :1;
- unsigned ownObject :1;
- unsigned initNewCalled :1;
- unsigned dirtyflag :1;
- unsigned hasStockEvents :1;
- unsigned stayTopLevel :1;
- unsigned isInPlaceActive :1;
- unsigned isUIActive :1;
- unsigned wasUIActive :1;
- unsigned inDesignMode :1;
- unsigned canTakeFocus :1;
+ unsigned isWidget :1;
+ unsigned ownObject :1;
+ unsigned initNewCalled :1;
+ unsigned dirtyflag :1;
+ unsigned hasStockEvents :1;
+ unsigned stayTopLevel :1;
+ unsigned isInPlaceActive :1;
+ unsigned isUIActive :1;
+ unsigned wasUIActive :1;
+ unsigned inDesignMode :1;
+ unsigned canTakeFocus :1;
short freezeEvents;
HWND m_hWnd;
@@ -415,20 +415,20 @@ class QAxServerAggregate : public IUnknown
{
public:
QAxServerAggregate(const QString &className, IUnknown *outerUnknown)
- : m_outerUnknown(outerUnknown), ref(0)
+ : m_outerUnknown(outerUnknown), ref(0)
{
- object = new QAxServerBase(className, outerUnknown);
- object->registerActiveObject(this);
+ object = new QAxServerBase(className, outerUnknown);
+ object->registerActiveObject(this);
- InitializeCriticalSection(&refCountSection);
- InitializeCriticalSection(&createWindowSection);
+ InitializeCriticalSection(&refCountSection);
+ InitializeCriticalSection(&createWindowSection);
}
~QAxServerAggregate()
{
- DeleteCriticalSection(&refCountSection);
- DeleteCriticalSection(&createWindowSection);
+ DeleteCriticalSection(&refCountSection);
+ DeleteCriticalSection(&createWindowSection);
- delete object;
+ delete object;
}
// IUnknown
@@ -446,14 +446,14 @@ public:
}
HRESULT WINAPI QueryInterface(REFIID iid, void **iface)
{
- *iface = 0;
-
- if (iid == IID_IUnknown) {
- *iface = (IUnknown*)this;
- AddRef();
- return S_OK;
- }
- return object->InternalQueryInterface(iid, iface);
+ *iface = 0;
+
+ if (iid == IID_IUnknown) {
+ *iface = (IUnknown*)this;
+ AddRef();
+ return S_OK;
+ }
+ return object->InternalQueryInterface(iid, iface);
}
private:
@@ -471,7 +471,7 @@ bool QAxFactory::createObjectWrapper(QObject *object, IDispatch **wrapper)
QAxServerBase *obj = new QAxServerBase(object);
obj->QueryInterface(IID_IDispatch, (void**)wrapper);
if (*wrapper)
- return true;
+ return true;
delete obj;
return false;
@@ -489,7 +489,7 @@ public:
, current(0)
, ref(0)
{
- InitializeCriticalSection(&refCountSection);
+ InitializeCriticalSection(&refCountSection);
const int count = cpoints.count();
for (int i = 0; i < count; ++i)
cpoints.at(i)->AddRef();
@@ -498,8 +498,8 @@ public:
: cpoints(old.cpoints)
, current(old.current)
{
- InitializeCriticalSection(&refCountSection);
- ref = 0;
+ InitializeCriticalSection(&refCountSection);
+ ref = 0;
const int count = cpoints.count();
for (int i = 0; i < count; ++i)
cpoints.at(i)->AddRef();
@@ -510,7 +510,7 @@ public:
for (int i = 0; i < count; ++i)
cpoints.at(i)->Release();
- DeleteCriticalSection(&refCountSection);
+ DeleteCriticalSection(&refCountSection);
}
unsigned long __stdcall AddRef()
@@ -529,16 +529,16 @@ public:
{
if (!iface)
return E_POINTER;
- *iface = 0;
- if (iid == IID_IUnknown)
- *iface = this;
- else if (iid == IID_IEnumConnectionPoints)
- *iface = this;
- else
- return E_NOINTERFACE;
-
- AddRef();
- return S_OK;
+ *iface = 0;
+ if (iid == IID_IUnknown)
+ *iface = this;
+ else if (iid == IID_IEnumConnectionPoints)
+ *iface = this;
+ else
+ return E_NOINTERFACE;
+
+ AddRef();
+ return S_OK;
}
STDMETHOD(Next)(ULONG cConnections, IConnectionPoint **cpoint, ULONG *pcFetched)
{
@@ -549,43 +549,43 @@ public:
return E_POINTER;
const int count = cpoints.count();
- unsigned long i;
- for (i = 0; i < cConnections; i++) {
- if (current==count)
- break;
- IConnectionPoint *cp = cpoints.at(current);
- cp->AddRef();
- cpoint[i] = cp;
- ++current;
- }
+ unsigned long i;
+ for (i = 0; i < cConnections; i++) {
+ if (current==count)
+ break;
+ IConnectionPoint *cp = cpoints.at(current);
+ cp->AddRef();
+ cpoint[i] = cp;
+ ++current;
+ }
if (pcFetched)
- *pcFetched = i;
- return i == cConnections ? S_OK : S_FALSE;
+ *pcFetched = i;
+ return i == cConnections ? S_OK : S_FALSE;
}
STDMETHOD(Skip)(ULONG cConnections)
{
const int count = cpoints.count();
- while (cConnections) {
- if (current == count)
- return S_FALSE;
- ++current;
- --cConnections;
- }
- return S_OK;
+ while (cConnections) {
+ if (current == count)
+ return S_FALSE;
+ ++current;
+ --cConnections;
+ }
+ return S_OK;
}
STDMETHOD(Reset)()
{
current = 0;
- return S_OK;
+ return S_OK;
}
STDMETHOD(Clone)(IEnumConnectionPoints **ppEnum)
{
if (!ppEnum)
return E_POINTER;
- *ppEnum = new QAxSignalVec(*this);
- (*ppEnum)->AddRef();
+ *ppEnum = new QAxSignalVec(*this);
+ (*ppEnum)->AddRef();
- return S_OK;
+ return S_OK;
}
QList<IConnectionPoint*> cpoints;
@@ -601,7 +601,7 @@ private:
Helper class to store and enumerate all connected event listeners.
*/
class QAxConnection : public IConnectionPoint,
- public IEnumConnections
+ public IEnumConnections
{
public:
typedef QList<CONNECTDATA> Connections;
@@ -610,26 +610,26 @@ public:
QAxConnection(QAxServerBase *parent, const QUuid &uuid)
: that(parent), iid(uuid), current(0), ref(1)
{
- InitializeCriticalSection(&refCountSection);
+ InitializeCriticalSection(&refCountSection);
}
QAxConnection(const QAxConnection &old)
: current(old.current)
{
- InitializeCriticalSection(&refCountSection);
- ref = 0;
- connections = old.connections;
- that = old.that;
- iid = old.iid;
- QList<CONNECTDATA>::Iterator it = connections.begin();
- while (it != connections.end()) {
- CONNECTDATA connection = *it;
- ++it;
- connection.pUnk->AddRef();
- }
+ InitializeCriticalSection(&refCountSection);
+ ref = 0;
+ connections = old.connections;
+ that = old.that;
+ iid = old.iid;
+ QList<CONNECTDATA>::Iterator it = connections.begin();
+ while (it != connections.end()) {
+ CONNECTDATA connection = *it;
+ ++it;
+ connection.pUnk->AddRef();
+ }
}
~QAxConnection()
{
- DeleteCriticalSection(&refCountSection);
+ DeleteCriticalSection(&refCountSection);
}
unsigned long __stdcall AddRef()
@@ -648,48 +648,48 @@ public:
{
if (!iface)
return E_POINTER;
- *iface = 0;
- if (iid == IID_IUnknown)
- *iface = (IConnectionPoint*)this;
- else if (iid == IID_IConnectionPoint)
- *iface = this;
- else if (iid == IID_IEnumConnections)
- *iface = this;
- else
- return E_NOINTERFACE;
-
- AddRef();
- return S_OK;
+ *iface = 0;
+ if (iid == IID_IUnknown)
+ *iface = (IConnectionPoint*)this;
+ else if (iid == IID_IConnectionPoint)
+ *iface = this;
+ else if (iid == IID_IEnumConnections)
+ *iface = this;
+ else
+ return E_NOINTERFACE;
+
+ AddRef();
+ return S_OK;
}
STDMETHOD(GetConnectionInterface)(IID *pIID)
{
- *pIID = iid;
- return S_OK;
+ *pIID = iid;
+ return S_OK;
}
STDMETHOD(GetConnectionPointContainer)(IConnectionPointContainer **ppCPC)
{
- return that->QueryInterface(IID_IConnectionPointContainer, (void**)ppCPC);
+ return that->QueryInterface(IID_IConnectionPointContainer, (void**)ppCPC);
}
STDMETHOD(Advise)(IUnknown*pUnk, DWORD *pdwCookie)
{
if (!pUnk || !pdwCookie)
return E_POINTER;
- {
- IDispatch *checkImpl = 0;
- pUnk->QueryInterface(iid, (void**)&checkImpl);
- if (!checkImpl)
- return CONNECT_E_CANNOTCONNECT;
- checkImpl->Release();
- }
-
- CONNECTDATA cd;
- cd.dwCookie = connections.count()+1;
- cd.pUnk = pUnk;
- cd.pUnk->AddRef();
- connections.append(cd);
- *pdwCookie = cd.dwCookie;
- return S_OK;
+ {
+ IDispatch *checkImpl = 0;
+ pUnk->QueryInterface(iid, (void**)&checkImpl);
+ if (!checkImpl)
+ return CONNECT_E_CANNOTCONNECT;
+ checkImpl->Release();
+ }
+
+ CONNECTDATA cd;
+ cd.dwCookie = connections.count()+1;
+ cd.pUnk = pUnk;
+ cd.pUnk->AddRef();
+ connections.append(cd);
+ *pdwCookie = cd.dwCookie;
+ return S_OK;
}
STDMETHOD(Unadvise)(DWORD dwCookie)
{
@@ -702,16 +702,16 @@ public:
return S_OK;
}
}
- return CONNECT_E_NOCONNECTION;
+ return CONNECT_E_NOCONNECTION;
}
STDMETHOD(EnumConnections)(IEnumConnections **ppEnum)
{
if (!ppEnum)
return E_POINTER;
- *ppEnum = this;
- AddRef();
+ *ppEnum = this;
+ AddRef();
- return S_OK;
+ return S_OK;
}
STDMETHOD(Next)(ULONG cConnections, CONNECTDATA *cd, ULONG *pcFetched)
{
@@ -723,42 +723,42 @@ public:
const int count = connections.count();
- unsigned long i;
- for (i = 0; i < cConnections; i++) {
- if (current == count)
- break;
- cd[i] = connections.at(current);
- cd[i].pUnk->AddRef();
- ++current;
- }
- if (pcFetched)
- *pcFetched = i;
- return i == cConnections ? S_OK : S_FALSE;
+ unsigned long i;
+ for (i = 0; i < cConnections; i++) {
+ if (current == count)
+ break;
+ cd[i] = connections.at(current);
+ cd[i].pUnk->AddRef();
+ ++current;
+ }
+ if (pcFetched)
+ *pcFetched = i;
+ return i == cConnections ? S_OK : S_FALSE;
}
STDMETHOD(Skip)(ULONG cConnections)
{
const int count = connections.count();
- while (cConnections) {
- if (current == count)
- return S_FALSE;
- ++current;
- --cConnections;
- }
- return S_OK;
+ while (cConnections) {
+ if (current == count)
+ return S_FALSE;
+ ++current;
+ --cConnections;
+ }
+ return S_OK;
}
STDMETHOD(Reset)()
{
current = 0;
- return S_OK;
+ return S_OK;
}
STDMETHOD(Clone)(IEnumConnections **ppEnum)
{
if (!ppEnum)
return E_POINTER;
- *ppEnum = new QAxConnection(*this);
- (*ppEnum)->AddRef();
+ *ppEnum = new QAxConnection(*this);
+ (*ppEnum)->AddRef();
- return S_OK;
+ return S_OK;
}
private:
@@ -792,12 +792,12 @@ bool QAxWinEventFilter::nativeEventFilter(const QByteArray &, void *message, lon
{
MSG *pMsg = (MSG*)message;
if (pMsg->message < WM_KEYFIRST || pMsg->message > WM_KEYLAST)
- return false;
+ return false;
bool ret = false;
QWidget *aqt = QWidget::find(reinterpret_cast<WId>(pMsg->hwnd));
if (!aqt)
- return ret;
+ return ret;
// FIXME: 4.10.211: was '::GetParent(hwndForWidget(aqt));'
HWND baseHwnd = hwndForWidget(aqt);
@@ -809,10 +809,10 @@ bool QAxWinEventFilter::nativeEventFilter(const QByteArray &, void *message, lon
axbase = (QAxServerBase*)GetWindowLong(baseHwnd, GWL_USERDATA);
#endif
- baseHwnd = ::GetParent(baseHwnd);
+ baseHwnd = ::GetParent(baseHwnd);
}
if (!axbase)
- return ret;
+ return ret;
HRESULT hres = axbase->TranslateAcceleratorW(pMsg);
return hres == S_OK;
@@ -826,29 +826,29 @@ class QClassFactory : public IClassFactory2
{
public:
QClassFactory(CLSID clsid)
- : ref(0), licensed(false)
+ : ref(0), licensed(false)
{
- InitializeCriticalSection(&refCountSection);
-
- // COM only knows the CLSID, but QAxFactory is class name based...
- QStringList keys = qAxFactory()->featureList();
- for (QStringList::Iterator key = keys.begin(); key != keys.end(); ++key) {
- if (qAxFactory()->classID(*key) == clsid) {
- className = *key;
- break;
- }
- }
-
- const QMetaObject *mo = qAxFactory()->metaObject(className);
- if (mo) {
- classKey = QLatin1String(mo->classInfo(mo->indexOfClassInfo("LicenseKey")).value());
- licensed = !classKey.isEmpty();
- }
+ InitializeCriticalSection(&refCountSection);
+
+ // COM only knows the CLSID, but QAxFactory is class name based...
+ QStringList keys = qAxFactory()->featureList();
+ for (QStringList::Iterator key = keys.begin(); key != keys.end(); ++key) {
+ if (qAxFactory()->classID(*key) == clsid) {
+ className = *key;
+ break;
+ }
+ }
+
+ const QMetaObject *mo = qAxFactory()->metaObject(className);
+ if (mo) {
+ classKey = QLatin1String(mo->classInfo(mo->indexOfClassInfo("LicenseKey")).value());
+ licensed = !classKey.isEmpty();
+ }
}
~QClassFactory()
{
- DeleteCriticalSection(&refCountSection);
+ DeleteCriticalSection(&refCountSection);
}
// IUnknown
@@ -866,31 +866,31 @@ public:
}
HRESULT WINAPI QueryInterface(REFIID iid, LPVOID *iface)
{
- *iface = 0;
- if (iid == IID_IUnknown)
- *iface = (IUnknown*)this;
- else if (iid == IID_IClassFactory)
- *iface = (IClassFactory*)this;
- else if (iid == IID_IClassFactory2 && licensed)
- *iface = (IClassFactory2*)this;
- else
- return E_NOINTERFACE;
-
- AddRef();
- return S_OK;
+ *iface = 0;
+ if (iid == IID_IUnknown)
+ *iface = (IUnknown*)this;
+ else if (iid == IID_IClassFactory)
+ *iface = (IClassFactory*)this;
+ else if (iid == IID_IClassFactory2 && licensed)
+ *iface = (IClassFactory2*)this;
+ else
+ return E_NOINTERFACE;
+
+ AddRef();
+ return S_OK;
}
HRESULT WINAPI CreateInstanceHelper(IUnknown *pUnkOuter, REFIID iid, void **ppObject)
{
- if (pUnkOuter) {
- if (iid != IID_IUnknown)
- return CLASS_E_NOAGGREGATION;
- const QMetaObject *mo = qAxFactory()->metaObject(className);
- if (mo && !qstricmp(mo->classInfo(mo->indexOfClassInfo("Aggregatable")).value(), "no"))
- return CLASS_E_NOAGGREGATION;
- }
-
- // Make sure a QApplication instance is present (inprocess case)
+ if (pUnkOuter) {
+ if (iid != IID_IUnknown)
+ return CLASS_E_NOAGGREGATION;
+ const QMetaObject *mo = qAxFactory()->metaObject(className);
+ if (mo && !qstricmp(mo->classInfo(mo->indexOfClassInfo("Aggregatable")).value(), "no"))
+ return CLASS_E_NOAGGREGATION;
+ }
+
+ // Make sure a QApplication instance is present (inprocess case)
if (!qApp) {
qax_ownQApp = true;
int argc = 0;
@@ -913,81 +913,81 @@ public:
if (qax_ownQApp)
qApp->processEvents();
- HRESULT res;
- // Create the ActiveX wrapper - aggregate if requested
- if (pUnkOuter) {
- QAxServerAggregate *aggregate = new QAxServerAggregate(className, pUnkOuter);
- res = aggregate->QueryInterface(iid, ppObject);
- if (FAILED(res))
- delete aggregate;
- } else {
- QAxServerBase *activeqt = new QAxServerBase(className, pUnkOuter);
- res = activeqt->QueryInterface(iid, ppObject);
- if (FAILED(res))
- delete activeqt;
- else
- activeqt->registerActiveObject((IUnknown*)(IDispatch*)activeqt);
- }
- return res;
+ HRESULT res;
+ // Create the ActiveX wrapper - aggregate if requested
+ if (pUnkOuter) {
+ QAxServerAggregate *aggregate = new QAxServerAggregate(className, pUnkOuter);
+ res = aggregate->QueryInterface(iid, ppObject);
+ if (FAILED(res))
+ delete aggregate;
+ } else {
+ QAxServerBase *activeqt = new QAxServerBase(className, pUnkOuter);
+ res = activeqt->QueryInterface(iid, ppObject);
+ if (FAILED(res))
+ delete activeqt;
+ else
+ activeqt->registerActiveObject((IUnknown*)(IDispatch*)activeqt);
+ }
+ return res;
}
// IClassFactory
HRESULT WINAPI CreateInstance(IUnknown *pUnkOuter, REFIID iid, void **ppObject)
{
- // class is licensed
- if (licensed && !qAxFactory()->validateLicenseKey(className, QString()))
- return CLASS_E_NOTLICENSED;
+ // class is licensed
+ if (licensed && !qAxFactory()->validateLicenseKey(className, QString()))
+ return CLASS_E_NOTLICENSED;
- return CreateInstanceHelper(pUnkOuter, iid, ppObject);
+ return CreateInstanceHelper(pUnkOuter, iid, ppObject);
}
HRESULT WINAPI LockServer(BOOL fLock)
{
- if (fLock)
- qAxLock();
- else
- qAxUnlock();
+ if (fLock)
+ qAxLock();
+ else
+ qAxUnlock();
- return S_OK;
+ return S_OK;
}
// IClassFactory2
HRESULT WINAPI RequestLicKey(DWORD, BSTR *pKey)
{
- if (!pKey)
- return E_POINTER;
- *pKey = 0;
+ if (!pKey)
+ return E_POINTER;
+ *pKey = 0;
- // This of course works only on fully licensed machines
- if (!qAxFactory()->validateLicenseKey(className, QString()))
- return CLASS_E_NOTLICENSED;
+ // This of course works only on fully licensed machines
+ if (!qAxFactory()->validateLicenseKey(className, QString()))
+ return CLASS_E_NOTLICENSED;
- *pKey = QStringToBSTR(classKey);
- return S_OK;
+ *pKey = QStringToBSTR(classKey);
+ return S_OK;
}
HRESULT WINAPI GetLicInfo(LICINFO *pLicInfo)
{
- if (!pLicInfo)
- return E_POINTER;
- pLicInfo->cbLicInfo = sizeof(LICINFO);
+ if (!pLicInfo)
+ return E_POINTER;
+ pLicInfo->cbLicInfo = sizeof(LICINFO);
- // class specific license key?
- const QMetaObject *mo = qAxFactory()->metaObject(className);
- const char *key = mo->classInfo(mo->indexOfClassInfo("LicenseKey")).value();
- pLicInfo->fRuntimeKeyAvail = key && key[0];
+ // class specific license key?
+ const QMetaObject *mo = qAxFactory()->metaObject(className);
+ const char *key = mo->classInfo(mo->indexOfClassInfo("LicenseKey")).value();
+ pLicInfo->fRuntimeKeyAvail = key && key[0];
- // machine fully licensed?
- pLicInfo->fLicVerified = qAxFactory()->validateLicenseKey(className, QString());
+ // machine fully licensed?
+ pLicInfo->fLicVerified = qAxFactory()->validateLicenseKey(className, QString());
- return S_OK;
+ return S_OK;
}
HRESULT WINAPI CreateInstanceLic(IUnknown *pUnkOuter, IUnknown * /* pUnkReserved */, REFIID iid, BSTR bKey, PVOID *ppObject)
{
QString licenseKey = QString::fromWCharArray(bKey);
- if (!qAxFactory()->validateLicenseKey(className, licenseKey))
- return CLASS_E_NOTLICENSED;
- return CreateInstanceHelper(pUnkOuter, iid, ppObject);
+ if (!qAxFactory()->validateLicenseKey(className, licenseKey))
+ return CLASS_E_NOTLICENSED;
+ return CreateInstanceHelper(pUnkOuter, iid, ppObject);
}
QString className;
@@ -1004,14 +1004,14 @@ HRESULT GetClassObject(REFIID clsid, REFIID iid, void **ppUnk)
{
QClassFactory *factory = new QClassFactory(clsid);
if (!factory)
- return E_OUTOFMEMORY;
+ return E_OUTOFMEMORY;
if (factory->className.isEmpty()) {
- delete factory;
- return E_NOINTERFACE;
+ delete factory;
+ return E_NOINTERFACE;
}
HRESULT res = factory->QueryInterface(iid, ppUnk);
if (res != S_OK)
- delete factory;
+ delete factory;
return res;
}
@@ -1050,9 +1050,9 @@ QAxServerBase::QAxServerBase(QObject *o)
qt.object = o;
if (o) {
- theObject = o;
- isWidget = false;
- class_name = QLatin1String(o->metaObject()->className());
+ theObject = o;
+ isWidget = false;
+ class_name = QLatin1String(o->metaObject()->className());
}
internalBind();
internalConnect();
@@ -1064,17 +1064,17 @@ QAxServerBase::QAxServerBase(QObject *o)
void QAxServerBase::init()
{
qt.object = 0;
- isWidget = false;
- ownObject = false;
- initNewCalled = false;
- dirtyflag = false;
- hasStockEvents = false;
- stayTopLevel = false;
- isInPlaceActive = false;
- isUIActive = false;
- wasUIActive = false;
- inDesignMode = false;
- canTakeFocus = false;
+ isWidget = false;
+ ownObject = false;
+ initNewCalled = false;
+ dirtyflag = false;
+ hasStockEvents = false;
+ stayTopLevel = false;
+ isInPlaceActive = false;
+ isUIActive = false;
+ wasUIActive = false;
+ inDesignMode = false;
+ canTakeFocus = false;
freezeEvents = 0;
exception = 0;
@@ -1114,17 +1114,17 @@ QAxServerBase::~QAxServerBase()
revokeActiveObject();
for (QAxServerBase::ConnectionPointsIterator it = points.begin(); it != points.end(); ++it) {
- if (it.value())
- (*it)->Release();
+ if (it.value())
+ (*it)->Release();
}
delete aggregatedObject;
aggregatedObject = 0;
if (theObject) {
- qt.object->disconnect(this);
- QObject *aqt = qt.object;
- qt.object = 0;
- if (ownObject)
- delete aqt;
+ qt.object->disconnect(this);
+ QObject *aqt = qt.object;
+ qt.object = 0;
+ if (ownObject)
+ delete aqt;
}
if (m_spAdviseSink) m_spAdviseSink->Release();
@@ -1155,17 +1155,17 @@ QAxServerBase::~QAxServerBase()
void QAxServerBase::registerActiveObject(IUnknown *object)
{
if (ole_ref || !qt.object || !qAxOutProcServer)
- return;
+ return;
const QMetaObject *mo = qt.object->metaObject();
if (!qstricmp(mo->classInfo(mo->indexOfClassInfo("RegisterObject")).value(), "yes"))
- RegisterActiveObject(object, qAxFactory()->classID(class_name), ACTIVEOBJECT_WEAK, &ole_ref);
+ RegisterActiveObject(object, qAxFactory()->classID(class_name), ACTIVEOBJECT_WEAK, &ole_ref);
}
void QAxServerBase::revokeActiveObject()
{
if (!ole_ref)
- return;
+ return;
RevokeActiveObject(ole_ref, 0);
ole_ref = 0;
@@ -1177,7 +1177,7 @@ void QAxServerBase::revokeActiveObject()
HRESULT WINAPI QAxServerBase::QueryInterface(REFIID iid, void **iface)
{
if (m_outerUnknown)
- return m_outerUnknown->QueryInterface(iid, iface);
+ return m_outerUnknown->QueryInterface(iid, iface);
return InternalQueryInterface(iid, iface);
}
@@ -1187,62 +1187,62 @@ HRESULT QAxServerBase::InternalQueryInterface(REFIID iid, void **iface)
*iface = 0;
if (iid == IID_IUnknown) {
- *iface = (IUnknown*)(IDispatch*)this;
+ *iface = (IUnknown*)(IDispatch*)this;
} else {
- HRESULT res = S_OK;
- if (aggregatedObject)
- res = aggregatedObject->queryInterface(iid, iface);
- if (*iface)
- return res;
+ HRESULT res = S_OK;
+ if (aggregatedObject)
+ res = aggregatedObject->queryInterface(iid, iface);
+ if (*iface)
+ return res;
}
if (!(*iface)) {
- if (iid == qAxFactory()->interfaceID(class_name))
- *iface = (IDispatch*)this;
- if (iid == IID_IDispatch)
- *iface = (IDispatch*)this;
- else if (iid == IID_IAxServerBase)
- *iface = (IAxServerBase*)this;
- else if (iid == IID_IOleObject)
- *iface = (IOleObject*)this;
- else if (iid == IID_IConnectionPointContainer)
- *iface = (IConnectionPointContainer*)this;
- else if (iid == IID_IProvideClassInfo)
- *iface = (IProvideClassInfo*)this;
- else if (iid == IID_IProvideClassInfo2)
- *iface = (IProvideClassInfo2*)this;
- else if (iid == IID_IPersist)
- *iface = (IPersist*)(IPersistStream*)this;
- else if (iid == IID_IPersistStream)
- *iface = (IPersistStream*)this;
- else if (iid == IID_IPersistStreamInit)
- *iface = (IPersistStreamInit*)this;
- else if (iid == IID_IPersistStorage)
- *iface = (IPersistStorage*)this;
- else if (iid == IID_IPersistPropertyBag)
- *iface = (IPersistPropertyBag*)this;
+ if (iid == qAxFactory()->interfaceID(class_name))
+ *iface = (IDispatch*)this;
+ if (iid == IID_IDispatch)
+ *iface = (IDispatch*)this;
+ else if (iid == IID_IAxServerBase)
+ *iface = (IAxServerBase*)this;
+ else if (iid == IID_IOleObject)
+ *iface = (IOleObject*)this;
+ else if (iid == IID_IConnectionPointContainer)
+ *iface = (IConnectionPointContainer*)this;
+ else if (iid == IID_IProvideClassInfo)
+ *iface = (IProvideClassInfo*)this;
+ else if (iid == IID_IProvideClassInfo2)
+ *iface = (IProvideClassInfo2*)this;
+ else if (iid == IID_IPersist)
+ *iface = (IPersist*)(IPersistStream*)this;
+ else if (iid == IID_IPersistStream)
+ *iface = (IPersistStream*)this;
+ else if (iid == IID_IPersistStreamInit)
+ *iface = (IPersistStreamInit*)this;
+ else if (iid == IID_IPersistStorage)
+ *iface = (IPersistStorage*)this;
+ else if (iid == IID_IPersistPropertyBag)
+ *iface = (IPersistPropertyBag*)this;
else if (iid == IID_IPersistFile &&
qAxFactory()->metaObject(class_name)->indexOfClassInfo("MIME") != -1)
*iface = (IPersistFile*)this;
- else if (iid == IID_IViewObject)
- *iface = (IViewObject*)this;
- else if (iid == IID_IViewObject2)
- *iface = (IViewObject2*)this;
- else if (isWidget) {
- if (iid == IID_IOleControl)
- *iface = (IOleControl*)this;
- else if (iid == IID_IOleWindow)
- *iface = (IOleWindow*)(IOleInPlaceObject*)this;
- else if (iid == IID_IOleInPlaceObject)
- *iface = (IOleInPlaceObject*)this;
- else if (iid == IID_IOleInPlaceActiveObject)
- *iface = (IOleInPlaceActiveObject*)this;
- else if (iid == IID_IDataObject)
- *iface = (IDataObject*)this;
- }
+ else if (iid == IID_IViewObject)
+ *iface = (IViewObject*)this;
+ else if (iid == IID_IViewObject2)
+ *iface = (IViewObject2*)this;
+ else if (isWidget) {
+ if (iid == IID_IOleControl)
+ *iface = (IOleControl*)this;
+ else if (iid == IID_IOleWindow)
+ *iface = (IOleWindow*)(IOleInPlaceObject*)this;
+ else if (iid == IID_IOleInPlaceObject)
+ *iface = (IOleInPlaceObject*)this;
+ else if (iid == IID_IOleInPlaceActiveObject)
+ *iface = (IOleInPlaceActiveObject*)this;
+ else if (iid == IID_IDataObject)
+ *iface = (IDataObject*)this;
+ }
}
if (!*iface)
- return E_NOINTERFACE;
+ return E_NOINTERFACE;
AddRef();
return S_OK;
@@ -1255,14 +1255,14 @@ void QAxServerBase::internalBind()
{
QAxBindable *axb = (QAxBindable*)qt.object->qt_metacast("QAxBindable");
if (axb) {
- // no addref; this is aggregated
- axb->activex = this;
- if (!aggregatedObject)
- aggregatedObject = axb->createAggregate();
- if (aggregatedObject) {
- aggregatedObject->controlling_unknown = (IUnknown*)(IDispatch*)this;
- aggregatedObject->the_object = qt.object;
- }
+ // no addref; this is aggregated
+ axb->activex = this;
+ if (!aggregatedObject)
+ aggregatedObject = axb->createAggregate();
+ if (aggregatedObject) {
+ aggregatedObject->controlling_unknown = (IUnknown*)(IDispatch*)this;
+ aggregatedObject->the_object = qt.object;
+ }
}
}
@@ -1273,14 +1273,14 @@ void QAxServerBase::internalConnect()
{
QUuid eventsID = qAxFactory()->eventsID(class_name);
if (!eventsID.isNull()) {
- if (!points[eventsID])
- points[eventsID] = new QAxConnection(this, eventsID);
+ if (!points[eventsID])
+ points[eventsID] = new QAxConnection(this, eventsID);
- // connect the generic slot to all signals of qt.object
- const QMetaObject *mo = qt.object->metaObject();
+ // connect the generic slot to all signals of qt.object
+ const QMetaObject *mo = qt.object->metaObject();
for (int isignal = mo->methodCount()-1; isignal >= 0; --isignal) {
if (mo->method(isignal).methodType() == QMetaMethod::Signal)
- QMetaObject::connect(qt.object, isignal, this, isignal);
+ QMetaObject::connect(qt.object, isignal, this, isignal);
}
}
}
@@ -1294,12 +1294,12 @@ void QAxServerBase::internalConnect()
bool QAxServerBase::internalCreate()
{
if (qt.object)
- return true;
+ return true;
qt.object = qAxFactory()->createObject(class_name);
Q_ASSERT(qt.object);
if (!qt.object)
- return false;
+ return false;
theObject = qt.object;
ownObject = true;
@@ -1398,20 +1398,20 @@ LRESULT QT_WIN_CALLBACK QAxServerBase::ActiveXProc(HWND hWnd, UINT uMsg, WPARAM
switch (uMsg) {
case WM_NCDESTROY:
- that->m_hWnd = 0;
- break;
+ that->m_hWnd = 0;
+ break;
case WM_QUERYENDSESSION:
case WM_DESTROY:
if (that->qt.widget) {
that->qt.widget->hide();
}
- break;
+ break;
case WM_SHOWWINDOW:
- if(wParam) {
- that->internalCreate();
- if (!that->stayTopLevel) {
+ if (wParam) {
+ that->internalCreate();
+ if (!that->stayTopLevel) {
// Set this property on window to pass the native handle to platform plugin,
// so that it can create the window with proper flags instead of thinking
// it is toplevel.
@@ -1433,31 +1433,31 @@ LRESULT QT_WIN_CALLBACK QAxServerBase::ActiveXProc(HWND hWnd, UINT uMsg, WPARAM
}
that->qt.widget->raise();
that->qt.widget->move(0, 0);
- }
- that->qt.widget->show();
- } else if (that->qt.widget) {
- that->qt.widget->hide();
- }
- break;
+ }
+ that->qt.widget->show();
+ } else if (that->qt.widget) {
+ that->qt.widget->hide();
+ }
+ break;
case WM_ERASEBKGND:
- that->updateMask();
- break;
+ that->updateMask();
+ break;
case WM_SIZE:
that->resize(QSize(LOWORD(lParam), HIWORD(lParam)));
- break;
+ break;
case WM_SETFOCUS:
- if (that->isInPlaceActive && that->m_spClientSite && !that->inDesignMode && that->canTakeFocus) {
- that->DoVerb(OLEIVERB_UIACTIVATE, NULL, that->m_spClientSite, 0, that->m_hWnd, &rcPos);
- if (that->isUIActive) {
- IOleControlSite *spSite = 0;
- that->m_spClientSite->QueryInterface(IID_IOleControlSite, (void**)&spSite);
- if (spSite) {
- spSite->OnFocus(true);
- spSite->Release();
- }
+ if (that->isInPlaceActive && that->m_spClientSite && !that->inDesignMode && that->canTakeFocus) {
+ that->DoVerb(OLEIVERB_UIACTIVATE, NULL, that->m_spClientSite, 0, that->m_hWnd, &rcPos);
+ if (that->isUIActive) {
+ IOleControlSite *spSite = 0;
+ that->m_spClientSite->QueryInterface(IID_IOleControlSite, (void**)&spSite);
+ if (spSite) {
+ spSite->OnFocus(true);
+ spSite->Release();
+ }
QWidget *candidate = that->qt.widget;
while (!(candidate->focusPolicy() & Qt::TabFocus)) {
candidate = candidate->nextInFocusChain();
@@ -1472,85 +1472,85 @@ LRESULT QT_WIN_CALLBACK QAxServerBase::ActiveXProc(HWND hWnd, UINT uMsg, WPARAM
if (::GetKeyState(VK_SHIFT) < 0)
widget->focusNextPrevChild(false);
}
- }
- }
- break;
+ }
+ }
+ break;
case WM_KILLFOCUS:
- if (that->isInPlaceActive && that->isUIActive && that->m_spClientSite) {
- IOleControlSite *spSite = 0;
- that->m_spClientSite->QueryInterface(IID_IOleControlSite, (void**)&spSite);
- if (spSite) {
- if (!::IsChild(that->m_hWnd, ::GetFocus()))
- spSite->OnFocus(false);
- spSite->Release();
- }
- }
- break;
+ if (that->isInPlaceActive && that->isUIActive && that->m_spClientSite) {
+ IOleControlSite *spSite = 0;
+ that->m_spClientSite->QueryInterface(IID_IOleControlSite, (void**)&spSite);
+ if (spSite) {
+ if (!::IsChild(that->m_hWnd, ::GetFocus()))
+ spSite->OnFocus(false);
+ spSite->Release();
+ }
+ }
+ break;
case WM_MOUSEACTIVATE:
- that->DoVerb(OLEIVERB_UIACTIVATE, NULL, that->m_spClientSite, 0, that->m_hWnd, &rcPos);
- break;
+ that->DoVerb(OLEIVERB_UIACTIVATE, NULL, that->m_spClientSite, 0, that->m_hWnd, &rcPos);
+ break;
case WM_INITMENUPOPUP:
- if (that->qt.widget) {
- that->currentPopup = that->menuMap[(HMENU)wParam];
- if (!that->currentPopup)
- break;
- const QMetaObject *mo = that->currentPopup->metaObject();
- int index = mo->indexOfSignal("aboutToShow()");
- if (index < 0)
- break;
-
- that->currentPopup->qt_metacall(QMetaObject::InvokeMetaMethod, index, 0);
- that->createPopup(that->currentPopup, (HMENU)wParam);
- return 0;
- }
- break;
+ if (that->qt.widget) {
+ that->currentPopup = that->menuMap[(HMENU)wParam];
+ if (!that->currentPopup)
+ break;
+ const QMetaObject *mo = that->currentPopup->metaObject();
+ int index = mo->indexOfSignal("aboutToShow()");
+ if (index < 0)
+ break;
+
+ that->currentPopup->qt_metacall(QMetaObject::InvokeMetaMethod, index, 0);
+ that->createPopup(that->currentPopup, (HMENU)wParam);
+ return 0;
+ }
+ break;
case WM_MENUSELECT:
case WM_COMMAND:
- if (that->qt.widget) {
- QMenuBar *menuBar = that->menuBar;
- if (!menuBar)
- break;
+ if (that->qt.widget) {
+ QMenuBar *menuBar = that->menuBar;
+ if (!menuBar)
+ break;
QObject *menuObject = 0;
- bool menuClosed = false;
+ bool menuClosed = false;
if (uMsg == WM_COMMAND) {
- menuObject = that->actionMap.value(wParam);
+ menuObject = that->actionMap.value(wParam);
} else if (!lParam) {
- menuClosed = true;
+ menuClosed = true;
menuObject = that->currentPopup;
} else {
menuObject = that->actionMap.value(LOWORD(wParam));
}
- if (menuObject) {
- const QMetaObject *mo = menuObject->metaObject();
- int index = -1;
+ if (menuObject) {
+ const QMetaObject *mo = menuObject->metaObject();
+ int index = -1;
- if (uMsg == WM_COMMAND)
- index = mo->indexOfSignal("activated()");
- else if (menuClosed)
- index = mo->indexOfSignal("aboutToHide()");
- else
- index = mo->indexOfSignal("hovered()");
+ if (uMsg == WM_COMMAND)
+ index = mo->indexOfSignal("activated()");
+ else if (menuClosed)
+ index = mo->indexOfSignal("aboutToHide()");
+ else
+ index = mo->indexOfSignal("hovered()");
- if (index < 0)
- break;
+ if (index < 0)
+ break;
- menuObject->qt_metacall(QMetaObject::InvokeMetaMethod, index, 0);
+ menuObject->qt_metacall(QMetaObject::InvokeMetaMethod, index, 0);
if (menuClosed || uMsg == WM_COMMAND)
that->currentPopup = 0;
- return 0;
- }
- }
- break;
+ return 0;
+ }
+ }
+ break;
default:
- break;
+ break;
}
}
@@ -1586,7 +1586,7 @@ HWND QAxServerBase::create(HWND hWndParent, RECT& rcPos)
}
LeaveCriticalSection(&createWindowSection);
if (!atom && GetLastError() != ERROR_CLASS_ALREADY_EXISTS)
- return 0;
+ return 0;
Q_ASSERT(!m_hWnd);
HWND hWnd = ::CreateWindow((wchar_t*)cn.utf16(), 0,
@@ -1611,7 +1611,7 @@ HMENU QAxServerBase::createPopup(QMenu *popup, HMENU oldMenu)
menuMap.insert(popupMenu, popup);
if (oldMenu) while (GetMenuItemCount(oldMenu)) {
- DeleteMenu(oldMenu, 0, MF_BYPOSITION);
+ DeleteMenu(oldMenu, 0, MF_BYPOSITION);
}
const QList<QAction*> actions = popup->actions();
@@ -1628,7 +1628,7 @@ HMENU QAxServerBase::createPopup(QMenu *popup, HMENU oldMenu)
if (action->isChecked())
flags |= MF_CHECKED;
- ushort itemId;
+ ushort itemId;
if (flags & MF_POPUP) {
itemId = static_cast<ushort>(
reinterpret_cast<quintptr>(createPopup(action->menu()))
@@ -1661,21 +1661,21 @@ void QAxServerBase::createMenu(QMenuBar *menuBar)
QAction *action = actions.at(i);
uint flags = action->isEnabled() ? MF_ENABLED : MF_GRAYED;
- if (action->isSeparator())
- flags |= MF_SEPARATOR;
- else if (action->menu())
- flags |= MF_POPUP;
- else
- flags |= MF_STRING;
-
- if (action->text() == QCoreApplication::translate(qt.widget->metaObject()->className(), "&Edit"))
- edit++;
- else if (action->text() == QCoreApplication::translate(qt.widget->metaObject()->className(), "&Help"))
- help++;
- else
- object++;
-
- ushort itemId;
+ if (action->isSeparator())
+ flags |= MF_SEPARATOR;
+ else if (action->menu())
+ flags |= MF_POPUP;
+ else
+ flags |= MF_STRING;
+
+ if (action->text() == QCoreApplication::translate(qt.widget->metaObject()->className(), "&Edit"))
+ edit++;
+ else if (action->text() == QCoreApplication::translate(qt.widget->metaObject()->className(), "&Help"))
+ help++;
+ else
+ object++;
+
+ ushort itemId;
if (flags & MF_POPUP) {
itemId = static_cast<ushort>(
reinterpret_cast<quintptr>(createPopup(action->menu()))
@@ -1690,9 +1690,9 @@ void QAxServerBase::createMenu(QMenuBar *menuBar)
OLEMENUGROUPWIDTHS menuWidths = { { 0,edit,0,object,0,help } };
HRESULT hres = m_spInPlaceFrame->InsertMenus(hmenuShared, &menuWidths);
if (FAILED(hres)) {
- ::DestroyMenu(hmenuShared);
- hmenuShared = 0;
- return;
+ ::DestroyMenu(hmenuShared);
+ hmenuShared = 0;
+ return;
}
m_spInPlaceFrame->GetWindow(&hwndMenuOwner);
@@ -1700,9 +1700,9 @@ void QAxServerBase::createMenu(QMenuBar *menuBar)
holemenu = OleCreateMenuDescriptor(hmenuShared, &menuWidths);
hres = m_spInPlaceFrame->SetMenu(hmenuShared, holemenu, m_hWnd);
if (FAILED(hres)) {
- ::DestroyMenu(hmenuShared);
- hmenuShared = 0;
- OleDestroyMenuDescriptor(holemenu);
+ ::DestroyMenu(hmenuShared);
+ hmenuShared = 0;
+ OleDestroyMenuDescriptor(holemenu);
}
}
@@ -1712,13 +1712,13 @@ void QAxServerBase::createMenu(QMenuBar *menuBar)
void QAxServerBase::removeMenu()
{
if (hmenuShared)
- m_spInPlaceFrame->RemoveMenus(hmenuShared);
+ m_spInPlaceFrame->RemoveMenus(hmenuShared);
holemenu = 0;
m_spInPlaceFrame->SetMenu(0, 0, m_hWnd);
if (hmenuShared) {
- DestroyMenu(hmenuShared);
- hmenuShared = 0;
- menuMap.clear();
+ DestroyMenu(hmenuShared);
+ hmenuShared = 0;
+ menuMap.clear();
}
hwndMenuOwner = 0;
}
@@ -1732,8 +1732,8 @@ extern bool ignoreProps(const char *test);
void QAxServerBase::ensureMetaData()
{
if (!m_spTypeInfo) {
- qAxTypeLibrary->GetTypeInfoOfGuid(qAxFactory()->interfaceID(class_name), &m_spTypeInfo);
- m_spTypeInfo->AddRef();
+ qAxTypeLibrary->GetTypeInfoOfGuid(qAxFactory()->interfaceID(class_name), &m_spTypeInfo);
+ m_spTypeInfo->AddRef();
}
}
@@ -1745,17 +1745,17 @@ void QAxServerBase::ensureMetaData()
bool QAxServerBase::isPropertyExposed(int index)
{
if (!theObject)
- return false;
+ return false;
bool result = false;
const QMetaObject *mo = theObject->metaObject();
int qtProps = 0;
if (theObject->isWidgetType())
- qtProps = QWidget::staticMetaObject.propertyCount();
+ qtProps = QWidget::staticMetaObject.propertyCount();
QMetaProperty property = mo->property(index);
if (index <= qtProps && ignoreProps(property.name()))
- return result;
+ return result;
BSTR bstrNames = QStringToBSTR(QLatin1String(property.name()));
DISPID dispId;
@@ -1774,14 +1774,14 @@ bool QAxServerBase::isPropertyExposed(int index)
void QAxServerBase::update()
{
if (isInPlaceActive) {
- if (m_hWnd)
- ::InvalidateRect(m_hWnd, 0, true);
- else if (m_spInPlaceSite)
- m_spInPlaceSite->InvalidateRect(NULL, true);
+ if (m_hWnd)
+ ::InvalidateRect(m_hWnd, 0, true);
+ else if (m_spInPlaceSite)
+ m_spInPlaceSite->InvalidateRect(NULL, true);
} else if (m_spAdviseSink) {
m_spAdviseSink->OnViewChange(DVASPECT_CONTENT, -1);
for (int i = 0; i < adviseSinks.count(); ++i) {
- adviseSinks.at(i).pAdvSink->OnViewChange(DVASPECT_CONTENT, -1);
+ adviseSinks.at(i).pAdvSink->OnViewChange(DVASPECT_CONTENT, -1);
}
}
}
@@ -1816,7 +1816,7 @@ void QAxServerBase::resize(const QSize &size)
void QAxServerBase::updateGeometry()
{
if (!isWidget || !qt.widget)
- return;
+ return;
const QSize sizeHint = qt.widget->sizeHint();
const QSize size = qt.widget->size();
@@ -1827,11 +1827,11 @@ void QAxServerBase::updateGeometry()
} else { // according to sizePolicy rules if already resized
QSizePolicy sizePolicy = qt.widget->sizePolicy();
if (sizeHint.width() > size.width() && !(sizePolicy.horizontalPolicy() & QSizePolicy::ShrinkFlag))
- newSize.setWidth(sizeHint.width());
+ newSize.setWidth(sizeHint.width());
if (sizeHint.width() < size.width() && !(sizePolicy.horizontalPolicy() & QSizePolicy::GrowFlag))
newSize.setWidth(sizeHint.width());
if (sizeHint.height() > size.height() && !(sizePolicy.verticalPolicy() & QSizePolicy::ShrinkFlag))
- newSize.setHeight(sizeHint.height());
+ newSize.setHeight(sizeHint.height());
if (sizeHint.height() < size.height() && !(sizePolicy.verticalPolicy() & QSizePolicy::GrowFlag))
newSize.setHeight(sizeHint.height());
}
@@ -1852,7 +1852,7 @@ void QAxServerBase::updateGeometry()
void QAxServerBase::updateMask()
{
if (!isWidget || !qt.widget || qt.widget->mask().isEmpty())
- return;
+ return;
QRegion rgn = qt.widget->mask();
HRGN hrgn = qaxHrgnFromQRegion(rgn);
@@ -1869,7 +1869,7 @@ static inline QByteArray paramType(const QByteArray &ptype, bool *out)
*out = ptype.endsWith('&') || ptype.endsWith("**");
if (*out) {
QByteArray res(ptype);
- res.truncate(res.length() - 1);
+ res.truncate(res.length() - 1);
return res;
}
@@ -2081,38 +2081,38 @@ bool QAxServerBase::emitRequestPropertyChange(const char *property)
IConnectionPoint *cpoint = 0;
FindConnectionPoint(IID_IPropertyNotifySink, &cpoint);
if (cpoint) {
- IEnumConnections *clist = 0;
- cpoint->EnumConnections(&clist);
- if (clist) {
- clist->Reset();
- ULONG cc = 1;
- CONNECTDATA c[1];
- clist->Next(cc, (CONNECTDATA*)&c, &cc);
- if (cc) {
- if (dispId == -1) {
- BSTR bstr = QStringToBSTR(QLatin1String(property));
- GetIDsOfNames(IID_NULL, &bstr, 1, LOCALE_USER_DEFAULT, &dispId);
- SysFreeString(bstr);
- }
- if (dispId != -1) while (cc) {
- if (c->pUnk) {
- IPropertyNotifySink *sink = 0;
- c->pUnk->QueryInterface(IID_IPropertyNotifySink, (void**)&sink);
- bool disallows = sink && sink->OnRequestEdit(dispId) == S_FALSE;
- sink->Release();
- c->pUnk->Release();
- if (disallows) { // a client disallows the property to change
- clist->Release();
- cpoint->Release();
- return false;
- }
- }
- clist->Next(cc, (CONNECTDATA*)&c, &cc);
- }
- }
- clist->Release();
- }
- cpoint->Release();
+ IEnumConnections *clist = 0;
+ cpoint->EnumConnections(&clist);
+ if (clist) {
+ clist->Reset();
+ ULONG cc = 1;
+ CONNECTDATA c[1];
+ clist->Next(cc, (CONNECTDATA*)&c, &cc);
+ if (cc) {
+ if (dispId == -1) {
+ BSTR bstr = QStringToBSTR(QLatin1String(property));
+ GetIDsOfNames(IID_NULL, &bstr, 1, LOCALE_USER_DEFAULT, &dispId);
+ SysFreeString(bstr);
+ }
+ if (dispId != -1) while (cc) {
+ if (c->pUnk) {
+ IPropertyNotifySink *sink = 0;
+ c->pUnk->QueryInterface(IID_IPropertyNotifySink, (void**)&sink);
+ bool disallows = sink && sink->OnRequestEdit(dispId) == S_FALSE;
+ sink->Release();
+ c->pUnk->Release();
+ if (disallows) { // a client disallows the property to change
+ clist->Release();
+ cpoint->Release();
+ return false;
+ }
+ }
+ clist->Next(cc, (CONNECTDATA*)&c, &cc);
+ }
+ }
+ clist->Release();
+ }
+ cpoint->Release();
}
dirtyflag = true;
return true;
@@ -2129,35 +2129,35 @@ void QAxServerBase::emitPropertyChanged(const char *property)
IConnectionPoint *cpoint = 0;
FindConnectionPoint(IID_IPropertyNotifySink, &cpoint);
if (cpoint) {
- IEnumConnections *clist = 0;
- cpoint->EnumConnections(&clist);
- if (clist) {
- clist->Reset();
- ULONG cc = 1;
- CONNECTDATA c[1];
- clist->Next(cc, (CONNECTDATA*)&c, &cc);
- if (cc) {
- if (dispId == -1) {
- BSTR bstr = QStringToBSTR(QLatin1String(property));
- GetIDsOfNames(IID_NULL, &bstr, 1, LOCALE_USER_DEFAULT, &dispId);
- SysFreeString(bstr);
- }
- if (dispId != -1) while (cc) {
- if (c->pUnk) {
- IPropertyNotifySink *sink = 0;
- c->pUnk->QueryInterface(IID_IPropertyNotifySink, (void**)&sink);
- if (sink) {
- sink->OnChanged(dispId);
- sink->Release();
- }
- c->pUnk->Release();
- }
- clist->Next(cc, (CONNECTDATA*)&c, &cc);
- }
- }
- clist->Release();
- }
- cpoint->Release();
+ IEnumConnections *clist = 0;
+ cpoint->EnumConnections(&clist);
+ if (clist) {
+ clist->Reset();
+ ULONG cc = 1;
+ CONNECTDATA c[1];
+ clist->Next(cc, (CONNECTDATA*)&c, &cc);
+ if (cc) {
+ if (dispId == -1) {
+ BSTR bstr = QStringToBSTR(QLatin1String(property));
+ GetIDsOfNames(IID_NULL, &bstr, 1, LOCALE_USER_DEFAULT, &dispId);
+ SysFreeString(bstr);
+ }
+ if (dispId != -1) while (cc) {
+ if (c->pUnk) {
+ IPropertyNotifySink *sink = 0;
+ c->pUnk->QueryInterface(IID_IPropertyNotifySink, (void**)&sink);
+ if (sink) {
+ sink->OnChanged(dispId);
+ sink->Release();
+ }
+ c->pUnk->Release();
+ }
+ clist->Next(cc, (CONNECTDATA*)&c, &cc);
+ }
+ }
+ clist->Release();
+ }
+ cpoint->Release();
}
dirtyflag = true;
}
@@ -2169,11 +2169,11 @@ void QAxServerBase::emitPropertyChanged(const char *property)
HRESULT WINAPI QAxServerBase::GetClassInfo(ITypeInfo** pptinfo)
{
if (!pptinfo)
- return E_POINTER;
+ return E_POINTER;
*pptinfo = 0;
if (!qAxTypeLibrary)
- return DISP_E_BADINDEX;
+ return DISP_E_BADINDEX;
return qAxTypeLibrary->GetTypeInfoOfGuid(qAxFactory()->classID(class_name), pptinfo);
}
@@ -2185,11 +2185,11 @@ HRESULT WINAPI QAxServerBase::GetClassInfo(ITypeInfo** pptinfo)
HRESULT WINAPI QAxServerBase::GetGUID(DWORD dwGuidKind, GUID* pGUID)
{
if (!pGUID)
- return E_POINTER;
+ return E_POINTER;
if (dwGuidKind == GUIDKIND_DEFAULT_SOURCE_DISP_IID) {
- *pGUID = qAxFactory()->eventsID(class_name);
- return S_OK;
+ *pGUID = qAxFactory()->eventsID(class_name);
+ return S_OK;
}
*pGUID = GUID_NULL;
return E_FAIL;
@@ -2202,7 +2202,7 @@ HRESULT WINAPI QAxServerBase::GetGUID(DWORD dwGuidKind, GUID* pGUID)
HRESULT WINAPI QAxServerBase::GetTypeInfoCount(UINT* pctinfo)
{
if (!pctinfo)
- return E_POINTER;
+ return E_POINTER;
*pctinfo = qAxTypeLibrary ? 1 : 0;
return S_OK;
@@ -2214,10 +2214,10 @@ HRESULT WINAPI QAxServerBase::GetTypeInfoCount(UINT* pctinfo)
HRESULT WINAPI QAxServerBase::GetTypeInfo(UINT /* itinfo */, LCID /*lcid*/, ITypeInfo** pptinfo)
{
if (!pptinfo)
- return E_POINTER;
+ return E_POINTER;
if (!qAxTypeLibrary)
- return DISP_E_BADINDEX;
+ return DISP_E_BADINDEX;
ensureMetaData();
@@ -2231,17 +2231,17 @@ HRESULT WINAPI QAxServerBase::GetTypeInfo(UINT /* itinfo */, LCID /*lcid*/, ITyp
Provides the names of the methods implemented in this IDispatch implementation.
*/
HRESULT WINAPI QAxServerBase::GetIDsOfNames(REFIID /* riid */, LPOLESTR* rgszNames, UINT cNames,
- LCID /*lcid*/, DISPID* rgdispid)
+ LCID /*lcid*/, DISPID* rgdispid)
{
if (!rgszNames || !rgdispid)
- return E_POINTER;
+ return E_POINTER;
if (!qAxTypeLibrary)
- return DISP_E_UNKNOWNNAME;
+ return DISP_E_UNKNOWNNAME;
ensureMetaData();
if (!m_spTypeInfo)
- return DISP_E_UNKNOWNNAME;
+ return DISP_E_UNKNOWNNAME;
return m_spTypeInfo->GetIDsOfNames(rgszNames, cNames, rgdispid);
}
@@ -2250,13 +2250,13 @@ HRESULT WINAPI QAxServerBase::GetIDsOfNames(REFIID /* riid */, LPOLESTR* rgszNam
Map the COM call to the Qt slot/property for \a dispidMember.
*/
HRESULT WINAPI QAxServerBase::Invoke(DISPID dispidMember, REFIID riid,
- LCID /*lcid*/, WORD wFlags, DISPPARAMS* pDispParams, VARIANT* pvarResult,
- EXCEPINFO* pexcepinfo, UINT* puArgErr)
+ LCID /*lcid*/, WORD wFlags, DISPPARAMS* pDispParams, VARIANT* pvarResult,
+ EXCEPINFO* pexcepinfo, UINT* puArgErr)
{
if (riid != IID_NULL)
- return DISP_E_UNKNOWNINTERFACE;
+ return DISP_E_UNKNOWNINTERFACE;
if (!theObject)
- return E_UNEXPECTED;
+ return E_UNEXPECTED;
HRESULT res = DISP_E_MEMBERNOTFOUND;
@@ -2265,7 +2265,7 @@ HRESULT WINAPI QAxServerBase::Invoke(DISPID dispidMember, REFIID riid,
int index = uniqueIndex ? indexCache.value(dispidMember, -1) : -1;
QByteArray name;
if (index == -1) {
- ensureMetaData();
+ ensureMetaData();
// This property or method is invoked when an ActiveX client specifies
// the object name without a property or method. We only support property.
@@ -2277,75 +2277,75 @@ HRESULT WINAPI QAxServerBase::Invoke(DISPID dispidMember, REFIID riid,
index = mo->indexOfProperty(name);
}
} else {
- BSTR bname;
- UINT cname = 0;
- if (m_spTypeInfo)
- m_spTypeInfo->GetNames(dispidMember, &bname, 1, &cname);
- if (!cname)
- return res;
+ BSTR bname;
+ UINT cname = 0;
+ if (m_spTypeInfo)
+ m_spTypeInfo->GetNames(dispidMember, &bname, 1, &cname);
+ if (!cname)
+ return res;
name = QString::fromWCharArray(bname).toLatin1();
- SysFreeString(bname);
+ SysFreeString(bname);
}
}
const QMetaObject *mo = qt.object->metaObject();
QSize oldSizeHint;
if (isWidget)
- oldSizeHint = qt.widget->sizeHint();
+ oldSizeHint = qt.widget->sizeHint();
switch (wFlags) {
case DISPATCH_PROPERTYGET|DISPATCH_METHOD:
case DISPATCH_PROPERTYGET:
- {
- if (index == -1) {
- index = mo->indexOfProperty(name);
- if (index == -1 && wFlags == DISPATCH_PROPERTYGET)
- return res;
- }
-
- QMetaProperty property;
+ {
+ if (index == -1) {
+ index = mo->indexOfProperty(name);
+ if (index == -1 && wFlags == DISPATCH_PROPERTYGET)
+ return res;
+ }
+
+ QMetaProperty property;
if (index < mo->propertyCount())
property = mo->property(index);
- if (property.isReadable()) {
- if (!pvarResult)
- return DISP_E_PARAMNOTOPTIONAL;
- if (pDispParams->cArgs ||
- pDispParams->cNamedArgs)
- return DISP_E_BADPARAMCOUNT;
-
- QVariant var = qt.object->property(property.name());
- if (!var.isValid())
- res = DISP_E_MEMBERNOTFOUND;
- else if (!QVariantToVARIANT(var, *pvarResult))
- res = DISP_E_TYPEMISMATCH;
- else
- res = S_OK;
- break;
- } else if (wFlags == DISPATCH_PROPERTYGET) {
- break;
- }
- }
- // FALLTHROUGH if wFlags == DISPATCH_PROPERTYGET|DISPATCH_METHOD AND not a property.
+ if (property.isReadable()) {
+ if (!pvarResult)
+ return DISP_E_PARAMNOTOPTIONAL;
+ if (pDispParams->cArgs ||
+ pDispParams->cNamedArgs)
+ return DISP_E_BADPARAMCOUNT;
+
+ QVariant var = qt.object->property(property.name());
+ if (!var.isValid())
+ res = DISP_E_MEMBERNOTFOUND;
+ else if (!QVariantToVARIANT(var, *pvarResult))
+ res = DISP_E_TYPEMISMATCH;
+ else
+ res = S_OK;
+ break;
+ } else if (wFlags == DISPATCH_PROPERTYGET) {
+ break;
+ }
+ }
+ // FALLTHROUGH if wFlags == DISPATCH_PROPERTYGET|DISPATCH_METHOD AND not a property.
case DISPATCH_METHOD:
- {
+ {
int nameLength = 0;
- if (index == -1) {
- nameLength = name.length();
- name += '(';
- // no parameter - shortcut
- if (!pDispParams->cArgs)
- index = mo->indexOfSlot((name + ')'));
- // search
- if (index == -1) {
- for (int i = 0; i < mo->methodCount(); ++i) {
+ if (index == -1) {
+ nameLength = name.length();
+ name += '(';
+ // no parameter - shortcut
+ if (!pDispParams->cArgs)
+ index = mo->indexOfSlot((name + ')'));
+ // search
+ if (index == -1) {
+ for (int i = 0; i < mo->methodCount(); ++i) {
const QMetaMethod slot(mo->method(i));
if (slot.methodType() == QMetaMethod::Slot && slot.methodSignature().startsWith(name)) {
- index = i;
- break;
- }
- }
+ index = i;
+ break;
+ }
+ }
// resolve overloads
if (index == -1) {
QRegExp regexp(QLatin1String("_([0-9])\\("));
@@ -2364,27 +2364,27 @@ HRESULT WINAPI QAxServerBase::Invoke(DISPID dispidMember, REFIID riid,
}
}
}
- if (index == -1)
- return res;
- }
- }
+ if (index == -1)
+ return res;
+ }
+ }
int lookupIndex = index;
- // get slot info
- QMetaMethod slot(mo->method(index));
- Q_ASSERT(slot.methodType() == QMetaMethod::Slot || slot.methodType() == QMetaMethod::Method);
- QByteArray type = slot.typeName();
+ // get slot info
+ QMetaMethod slot(mo->method(index));
+ Q_ASSERT(slot.methodType() == QMetaMethod::Slot || slot.methodType() == QMetaMethod::Method);
+ QByteArray type = slot.typeName();
name = slot.methodSignature();
nameLength = name.indexOf('(');
- QByteArray prototype = name.mid(nameLength + 1);
- prototype.truncate(prototype.length() - 1);
- QList<QByteArray> ptypes;
- if (!prototype.isEmpty())
- ptypes = prototype.split(',');
- UINT pcount = ptypes.count();
-
- // verify parameter count
+ QByteArray prototype = name.mid(nameLength + 1);
+ prototype.truncate(prototype.length() - 1);
+ QList<QByteArray> ptypes;
+ if (!prototype.isEmpty())
+ ptypes = prototype.split(',');
+ UINT pcount = ptypes.count();
+
+ // verify parameter count
if (pcount > pDispParams->cArgs) {
// count cloned slots immediately following the real thing
while (index < mo->methodCount()) {
@@ -2399,13 +2399,13 @@ HRESULT WINAPI QAxServerBase::Invoke(DISPID dispidMember, REFIID riid,
}
// still wrong :(
if (pcount > pDispParams->cArgs)
- return DISP_E_PARAMNOTOPTIONAL;
+ return DISP_E_PARAMNOTOPTIONAL;
} else if (pcount < pDispParams->cArgs) {
- return DISP_E_BADPARAMCOUNT;
+ return DISP_E_BADPARAMCOUNT;
}
- // setup parameters (pcount + return)
- bool ok = true;
+ // setup parameters (pcount + return)
+ bool ok = true;
void *static_argv[QAX_NUM_PARAMS + 1];
QVariant static_varp[QAX_NUM_PARAMS + 1];
void *static_argv_pointer[QAX_NUM_PARAMS + 1];
@@ -2414,9 +2414,9 @@ HRESULT WINAPI QAxServerBase::Invoke(DISPID dispidMember, REFIID riid,
if (!type.isEmpty())
++totalParam;
- void **argv = 0; // the actual array passed into qt_metacall
+ void **argv = 0; // the actual array passed into qt_metacall
void **argv_pointer = 0; // in case we need an additional level of indirection
- QVariant *varp = 0; // QVariants to hold the temporary Qt data object for us
+ QVariant *varp = 0; // QVariants to hold the temporary Qt data object for us
if (totalParam) {
if (totalParam <= QAX_NUM_PARAMS) {
@@ -2432,13 +2432,13 @@ HRESULT WINAPI QAxServerBase::Invoke(DISPID dispidMember, REFIID riid,
argv_pointer[0] = 0;
}
- for (UINT p = 0; p < pcount; ++p) {
- // map the VARIANT to the void*
- bool out;
- QByteArray ptype = paramType(ptypes.at(p), &out);
- varp[p + 1] = VARIANTToQVariant(pDispParams->rgvarg[pcount - p - 1], ptype);
+ for (UINT p = 0; p < pcount; ++p) {
+ // map the VARIANT to the void*
+ bool out;
+ QByteArray ptype = paramType(ptypes.at(p), &out);
+ varp[p + 1] = VARIANTToQVariant(pDispParams->rgvarg[pcount - p - 1], ptype);
argv_pointer[p + 1] = 0;
- if (varp[p + 1].isValid()) {
+ if (varp[p + 1].isValid()) {
if (varp[p + 1].type() == QVariant::UserType) {
argv[p + 1] = varp[p + 1].data();
} else if (ptype == "QVariant") {
@@ -2452,15 +2452,15 @@ HRESULT WINAPI QAxServerBase::Invoke(DISPID dispidMember, REFIID riid,
}
} else if (ptype == "QVariant") {
argv[p + 1] = varp + p + 1;
- } else {
- if (puArgErr)
- *puArgErr = pcount-p-1;
- ok = false;
- }
- }
+ } else {
+ if (puArgErr)
+ *puArgErr = pcount-p-1;
+ ok = false;
+ }
+ }
// return value
- if (!type.isEmpty() && type != "void") {
+ if (!type.isEmpty() && type != "void") {
QVariant::Type vt = QVariant::nameToType(type);
if (vt == QVariant::UserType)
vt = QVariant::Invalid;
@@ -2480,46 +2480,46 @@ HRESULT WINAPI QAxServerBase::Invoke(DISPID dispidMember, REFIID riid,
argv_pointer[0] = argv[0];
argv[0] = argv_pointer;
}
- }
-
- // call the slot if everthing went fine.
- if (ok) {
- ++invokeCount;
- qt.object->qt_metacall(QMetaObject::InvokeMetaMethod, index, argv);
- if (--invokeCount < 0)
- invokeCount = 0;
-
- // update reference parameters and return value
- for (UINT p = 0; p < pcount; ++p) {
- bool out;
- QByteArray ptype = paramType(ptypes.at(p), &out);
- if (out) {
- if (!QVariantToVARIANT(varp[p + 1], pDispParams->rgvarg[pcount - p - 1], ptype, out))
- ok = false;
- }
- }
+ }
+
+ // call the slot if everthing went fine.
+ if (ok) {
+ ++invokeCount;
+ qt.object->qt_metacall(QMetaObject::InvokeMetaMethod, index, argv);
+ if (--invokeCount < 0)
+ invokeCount = 0;
+
+ // update reference parameters and return value
+ for (UINT p = 0; p < pcount; ++p) {
+ bool out;
+ QByteArray ptype = paramType(ptypes.at(p), &out);
+ if (out) {
+ if (!QVariantToVARIANT(varp[p + 1], pDispParams->rgvarg[pcount - p - 1], ptype, out))
+ ok = false;
+ }
+ }
if (!type.isEmpty() && type != "void" && pvarResult) {
if (!varp[0].isValid() && type != "QVariant")
varp[0] = QVariant(QMetaType::type(type), argv_pointer);
// varp[0].setValue(argv_pointer[0], type);
- ok = QVariantToVARIANT(varp[0], *pvarResult, type);
+ ok = QVariantToVARIANT(varp[0], *pvarResult, type);
}
- }
+ }
if (argv && argv != static_argv) {
delete []argv;
delete []argv_pointer;
delete []varp;
}
- res = ok ? S_OK : DISP_E_TYPEMISMATCH;
+ res = ok ? S_OK : DISP_E_TYPEMISMATCH;
// reset in case index changed for default-arg handling
index = lookupIndex;
- }
- break;
+ }
+ break;
case DISPATCH_PROPERTYPUT:
case DISPATCH_PROPERTYPUT|DISPATCH_PROPERTYPUTREF:
- {
+ {
if (index == -1) {
index = mo->indexOfProperty(name);
if (index == -1)
@@ -2551,11 +2551,11 @@ HRESULT WINAPI QAxServerBase::Invoke(DISPID dispidMember, REFIID riid,
}
res = S_OK;
- }
- break;
+ }
+ break;
default:
- break;
+ break;
}
// maybe calling a setter? Notify client about changes
@@ -2592,46 +2592,46 @@ HRESULT WINAPI QAxServerBase::Invoke(DISPID dispidMember, REFIID riid,
}
if (index != -1 && uniqueIndex)
- indexCache.insert(dispidMember, index);
+ indexCache.insert(dispidMember, index);
if (exception) {
- if (pexcepinfo) {
- memset(pexcepinfo, 0, sizeof(EXCEPINFO));
-
- pexcepinfo->wCode = exception->code;
- if (!exception->src.isNull())
- pexcepinfo->bstrSource = QStringToBSTR(exception->src);
- if (!exception->desc.isNull())
- pexcepinfo->bstrDescription = QStringToBSTR(exception->desc);
- if (!exception->context.isNull()) {
- QString context = exception->context;
- int contextID = 0;
- int br = context.indexOf(QLatin1Char('['));
- if (br != -1) {
- context = context.mid(br+1);
- context = context.left(context.length() - 1);
- contextID = context.toInt();
-
- context = exception->context;
- context = context.left(br-1);
- }
- pexcepinfo->bstrHelpFile = QStringToBSTR(context);
- pexcepinfo->dwHelpContext = contextID;
- }
- }
- delete exception;
- exception = 0;
- return DISP_E_EXCEPTION;
+ if (pexcepinfo) {
+ memset(pexcepinfo, 0, sizeof(EXCEPINFO));
+
+ pexcepinfo->wCode = exception->code;
+ if (!exception->src.isNull())
+ pexcepinfo->bstrSource = QStringToBSTR(exception->src);
+ if (!exception->desc.isNull())
+ pexcepinfo->bstrDescription = QStringToBSTR(exception->desc);
+ if (!exception->context.isNull()) {
+ QString context = exception->context;
+ int contextID = 0;
+ int br = context.indexOf(QLatin1Char('['));
+ if (br != -1) {
+ context = context.mid(br+1);
+ context = context.left(context.length() - 1);
+ contextID = context.toInt();
+
+ context = exception->context;
+ context = context.left(br-1);
+ }
+ pexcepinfo->bstrHelpFile = QStringToBSTR(context);
+ pexcepinfo->dwHelpContext = contextID;
+ }
+ }
+ delete exception;
+ exception = 0;
+ return DISP_E_EXCEPTION;
} else if (isWidget) {
- QSize sizeHint = qt.widget->sizeHint();
- if (oldSizeHint != sizeHint) {
- updateGeometry();
- if (m_spInPlaceSite) {
+ QSize sizeHint = qt.widget->sizeHint();
+ if (oldSizeHint != sizeHint) {
+ updateGeometry();
+ if (m_spInPlaceSite) {
RECT rect = {0, 0, sizeHint.width(), sizeHint.height()};
- m_spInPlaceSite->OnPosRectChange(&rect);
- }
- }
- updateMask();
+ m_spInPlaceSite->OnPosRectChange(&rect);
+ }
+ }
+ updateMask();
}
return res;
@@ -2644,7 +2644,7 @@ HRESULT WINAPI QAxServerBase::Invoke(DISPID dispidMember, REFIID riid,
HRESULT WINAPI QAxServerBase::EnumConnectionPoints(IEnumConnectionPoints **epoints)
{
if (!epoints)
- return E_POINTER;
+ return E_POINTER;
*epoints = new QAxSignalVec(points);
(*epoints)->AddRef();
return S_OK;
@@ -2656,13 +2656,13 @@ HRESULT WINAPI QAxServerBase::EnumConnectionPoints(IEnumConnectionPoints **epoin
HRESULT WINAPI QAxServerBase::FindConnectionPoint(REFIID iid, IConnectionPoint **cpoint)
{
if (!cpoint)
- return E_POINTER;
+ return E_POINTER;
IConnectionPoint *cp = points[iid];
*cpoint = cp;
if (cp) {
- cp->AddRef();
- return S_OK;
+ cp->AddRef();
+ return S_OK;
}
return CONNECT_E_NOCONNECTION;
}
@@ -2688,12 +2688,12 @@ HRESULT WINAPI QAxServerBase::Load(IStream *pStm)
QString streamName = QString::fromWCharArray(stat.pwcsName);
CoTaskMemFree(stat.pwcsName);
openAsText = streamName == QLatin1String("SomeStreamName");
- if (stat.cbSize.HighPart) // more than 4GB - too large!
- return S_FALSE;
+ if (stat.cbSize.HighPart) // more than 4GB - too large!
+ return S_FALSE;
- qtarray.resize(stat.cbSize.LowPart);
+ qtarray.resize(stat.cbSize.LowPart);
ULONG read;
- pStm->Read(qtarray.data(), stat.cbSize.LowPart, &read);
+ pStm->Read(qtarray.data(), stat.cbSize.LowPart, &read);
} else if (hres == E_NOTIMPL) {
ULONG read = 0;
while (hres != S_FALSE) {
@@ -2730,18 +2730,18 @@ HRESULT WINAPI QAxServerBase::Load(IStream *pStm)
qtstream >> more;
while (!qtbuffer.atEnd() && more) {
- QString propname;
- QVariant value;
- qtstream >> propname;
- if (propname.isEmpty())
- break;
- qtstream >> value;
- qtstream >> more;
-
- int idx = mo->indexOfProperty(propname.toLatin1());
- QMetaProperty property = mo->property(idx);
- if (property.isWritable())
- qt.object->setProperty(propname.toLatin1(), value);
+ QString propname;
+ QVariant value;
+ qtstream >> propname;
+ if (propname.isEmpty())
+ break;
+ qtstream >> value;
+ qtstream >> more;
+
+ int idx = mo->indexOfProperty(propname.toLatin1());
+ QMetaProperty property = mo->property(idx);
+ if (property.isWritable())
+ qt.object->setProperty(propname.toLatin1(), value);
}
return S_OK;
}
@@ -2765,18 +2765,18 @@ HRESULT WINAPI QAxServerBase::Save(IStream *pStm, BOOL clearDirty)
qtstream << qtstream.version();
for (int prop = 0; prop < mo->propertyCount(); ++prop) {
- if (!isPropertyExposed(prop))
- continue;
- QMetaProperty metaprop = mo->property(prop);
+ if (!isPropertyExposed(prop))
+ continue;
+ QMetaProperty metaprop = mo->property(prop);
if (QByteArray(metaprop.typeName()).endsWith('*'))
continue;
- QString property = QLatin1String(metaprop.name());
- QVariant qvar = qt.object->property(metaprop.name());
- if (qvar.isValid()) {
- qtstream << int(1);
- qtstream << property;
- qtstream << qvar;
- }
+ QString property = QLatin1String(metaprop.name());
+ QVariant qvar = qt.object->property(metaprop.name());
+ if (qvar.isValid()) {
+ qtstream << int(1);
+ qtstream << property;
+ qtstream << qvar;
+ }
}
qtstream << int(0);
@@ -2814,21 +2814,21 @@ HRESULT WINAPI QAxServerBase::GetSizeMax(ULARGE_INTEGER *pcbSize)
HRESULT WINAPI QAxServerBase::InitNew(IStorage *pStg)
{
if (initNewCalled)
- return CO_E_ALREADYINITIALIZED;
+ return CO_E_ALREADYINITIALIZED;
dirtyflag = false;
initNewCalled = true;
m_spStorage = pStg;
if (m_spStorage)
- m_spStorage->AddRef();
+ m_spStorage->AddRef();
return S_OK;
}
HRESULT WINAPI QAxServerBase::Load(IStorage *pStg)
{
if (InitNew(pStg) != S_OK)
- return CO_E_ALREADYINITIALIZED;
+ return CO_E_ALREADYINITIALIZED;
IStream *spStream = 0;
QString streamName = QLatin1String(qt.object->metaObject()->className());
@@ -2843,7 +2843,7 @@ HRESULT WINAPI QAxServerBase::Load(IStorage *pStg)
if (!spStream) // support for streams saved with 4.1 and earlier
pStg->OpenStream(L"SomeStreamName", 0, STGM_READ | STGM_SHARE_EXCLUSIVE, 0, &spStream);
if (!spStream)
- return E_FAIL;
+ return E_FAIL;
Load(spStream);
spStream->Release();
@@ -2864,7 +2864,7 @@ HRESULT WINAPI QAxServerBase::Save(IStorage *pStg, BOOL /* fSameAsLoad */)
pStg->CreateStream((const wchar_t *)streamName.utf16(), STGM_CREATE | STGM_WRITE | STGM_SHARE_EXCLUSIVE, 0, 0, &spStream);
if (!spStream)
- return E_FAIL;
+ return E_FAIL;
Save(spStream, true);
@@ -2875,10 +2875,10 @@ HRESULT WINAPI QAxServerBase::Save(IStorage *pStg, BOOL /* fSameAsLoad */)
HRESULT WINAPI QAxServerBase::SaveCompleted(IStorage *pStgNew)
{
if (pStgNew) {
- if (m_spStorage)
- m_spStorage->Release();
- m_spStorage = pStgNew;
- m_spStorage->AddRef();
+ if (m_spStorage)
+ m_spStorage->Release();
+ m_spStorage = pStgNew;
+ m_spStorage->AddRef();
}
return S_OK;
}
@@ -2898,7 +2898,7 @@ HRESULT WINAPI QAxServerBase::HandsOffStorage()
HRESULT WINAPI QAxServerBase::InitNew()
{
if (initNewCalled)
- return CO_E_ALREADYINITIALIZED;
+ return CO_E_ALREADYINITIALIZED;
dirtyflag = false;
initNewCalled = true;
@@ -2911,27 +2911,27 @@ HRESULT WINAPI QAxServerBase::InitNew()
HRESULT WINAPI QAxServerBase::Load(IPropertyBag *bag, IErrorLog * /*log*/)
{
if (!bag)
- return E_POINTER;
+ return E_POINTER;
if (InitNew() != S_OK)
- return E_UNEXPECTED;
+ return E_UNEXPECTED;
bool error = false;
const QMetaObject *mo = qt.object->metaObject();
for (int prop = 0; prop < mo->propertyCount(); ++prop) {
- if (!isPropertyExposed(prop))
- continue;
- QMetaProperty property = mo->property(prop);
- const char* pname = property.name();
- BSTR bstr = QStringToBSTR(QLatin1String(pname));
- VARIANT var;
- var.vt = VT_EMPTY;
- HRESULT res = bag->Read(bstr, &var, 0);
- if (property.isWritable() && var.vt != VT_EMPTY) {
- if (res != S_OK || !qt.object->setProperty(pname, VARIANTToQVariant(var, property.typeName(), property.type())))
- error = true;
- }
- SysFreeString(bstr);
+ if (!isPropertyExposed(prop))
+ continue;
+ QMetaProperty property = mo->property(prop);
+ const char* pname = property.name();
+ BSTR bstr = QStringToBSTR(QLatin1String(pname));
+ VARIANT var;
+ var.vt = VT_EMPTY;
+ HRESULT res = bag->Read(bstr, &var, 0);
+ if (property.isWritable() && var.vt != VT_EMPTY) {
+ if (res != S_OK || !qt.object->setProperty(pname, VARIANTToQVariant(var, property.typeName(), property.type())))
+ error = true;
+ }
+ SysFreeString(bstr);
}
updateGeometry();
@@ -2946,27 +2946,27 @@ HRESULT WINAPI QAxServerBase::Load(IPropertyBag *bag, IErrorLog * /*log*/)
HRESULT WINAPI QAxServerBase::Save(IPropertyBag *bag, BOOL clearDirty, BOOL /*saveAll*/)
{
if (!bag)
- return E_POINTER;
+ return E_POINTER;
if (clearDirty)
- dirtyflag = false;
+ dirtyflag = false;
bool error = false;
const QMetaObject *mo = qt.object->metaObject();
for (int prop = 0; prop < mo->propertyCount(); ++prop) {
- if (!isPropertyExposed(prop))
- continue;
- QMetaProperty property = mo->property(prop);
+ if (!isPropertyExposed(prop))
+ continue;
+ QMetaProperty property = mo->property(prop);
if (QByteArray(property.typeName()).endsWith('*'))
continue;
- BSTR bstr = QStringToBSTR(QLatin1String(property.name()));
- QVariant qvar = qt.object->property(property.name());
- if (!qvar.isValid())
- error = true;
- VARIANT var;
- QVariantToVARIANT(qvar, var);
- bag->Write(bstr, &var);
- SysFreeString(bstr);
+ BSTR bstr = QStringToBSTR(QLatin1String(property.name()));
+ QVariant qvar = qt.object->property(property.name());
+ if (!qvar.isValid())
+ error = true;
+ VARIANT var;
+ QVariantToVARIANT(qvar, var);
+ bag->Write(bstr, &var);
+ SysFreeString(bstr);
}
Q_UNUSED(error)
return /*error ? E_FAIL :*/ S_OK;
@@ -3098,31 +3098,31 @@ HRESULT WINAPI QAxServerBase::Save(LPCOLESTR fileName, BOOL fRemember)
Draws the widget into the provided device context.
*/
HRESULT WINAPI QAxServerBase::Draw(DWORD dwAspect, LONG /* lindex */, void * /* pvAspect */, DVTARGETDEVICE *ptd,
- HDC hicTargetDev, HDC hdcDraw, LPCRECTL lprcBounds, LPCRECTL /*lprcWBounds*/,
- BOOL(__stdcall* /*pfnContinue*/)(ULONG_PTR), ULONG_PTR /*dwContinue*/)
+ HDC hicTargetDev, HDC hdcDraw, LPCRECTL lprcBounds, LPCRECTL /*lprcWBounds*/,
+ BOOL(__stdcall* /*pfnContinue*/)(ULONG_PTR), ULONG_PTR /*dwContinue*/)
{
if (!lprcBounds)
- return E_INVALIDARG;
+ return E_INVALIDARG;
internalCreate();
if (!isWidget || !qt.widget)
- return OLE_E_BLANK;
+ return OLE_E_BLANK;
switch (dwAspect) {
case DVASPECT_CONTENT:
case DVASPECT_OPAQUE:
case DVASPECT_TRANSPARENT:
- break;
+ break;
default:
- return DV_E_DVASPECT;
+ return DV_E_DVASPECT;
}
if (!ptd)
- hicTargetDev = 0;
+ hicTargetDev = 0;
bool bDeleteDC = false;
if (!hicTargetDev) {
- hicTargetDev = ::CreateDC(L"DISPLAY", NULL, NULL, NULL);
- bDeleteDC = (hicTargetDev != hdcDraw);
+ hicTargetDev = ::CreateDC(L"DISPLAY", NULL, NULL, NULL);
+ bDeleteDC = (hicTargetDev != hdcDraw);
}
RECTL rc = *lprcBounds;
@@ -3139,7 +3139,7 @@ HRESULT WINAPI QAxServerBase::Draw(DWORD dwAspect, LONG /* lindex */, void * /*
DeleteObject(hbm);
if (bDeleteDC)
- DeleteDC(hicTargetDev);
+ DeleteDC(hicTargetDev);
return S_OK;
}
@@ -3187,11 +3187,11 @@ HRESULT WINAPI QAxServerBase::SetAdvise(DWORD /*aspects*/, DWORD /*advf*/, IAdvi
HRESULT WINAPI QAxServerBase::GetAdvise(DWORD* /*aspects*/, DWORD* /*advf*/, IAdviseSink **ppAdvSink)
{
if (!ppAdvSink)
- return E_POINTER;
+ return E_POINTER;
*ppAdvSink = m_spAdviseSink;
if (*ppAdvSink)
- (*ppAdvSink)->AddRef();
+ (*ppAdvSink)->AddRef();
return S_OK;
}
@@ -3223,9 +3223,9 @@ HRESULT WINAPI QAxServerBase::FreezeEvents(BOOL bFreeze)
{
// member of CComControl
if (bFreeze)
- freezeEvents++;
+ freezeEvents++;
else
- freezeEvents--;
+ freezeEvents--;
return S_OK;
}
@@ -3244,12 +3244,12 @@ HRESULT WINAPI QAxServerBase::OnMnemonic(LPMSG)
HRESULT WINAPI QAxServerBase::OnAmbientPropertyChange(DISPID dispID)
{
if (!m_spClientSite || !theObject)
- return S_OK;
+ return S_OK;
IDispatch *disp = 0;
m_spClientSite->QueryInterface(IID_IDispatch, (void**)&disp);
if (!disp)
- return S_OK;
+ return S_OK;
VARIANT var;
VariantInit(&var);
@@ -3260,78 +3260,78 @@ HRESULT WINAPI QAxServerBase::OnAmbientPropertyChange(DISPID dispID)
switch(dispID) {
case DISPID_AMBIENT_APPEARANCE:
- break;
+ break;
case DISPID_AMBIENT_AUTOCLIP:
- break;
+ break;
case DISPID_AMBIENT_BACKCOLOR:
case DISPID_AMBIENT_FORECOLOR:
- if (isWidget) {
- long rgb;
- if (var.vt == VT_UI4)
- rgb = var.ulVal;
- else if (var.vt == VT_I4)
- rgb = var.lVal;
- else
- break;
- QPalette pal = qt.widget->palette();
- pal.setColor(dispID == DISPID_AMBIENT_BACKCOLOR ? QPalette::Window : QPalette::WindowText,
- OLEColorToQColor(rgb));
- qt.widget->setPalette(pal);
- }
- break;
+ if (isWidget) {
+ long rgb;
+ if (var.vt == VT_UI4)
+ rgb = var.ulVal;
+ else if (var.vt == VT_I4)
+ rgb = var.lVal;
+ else
+ break;
+ QPalette pal = qt.widget->palette();
+ pal.setColor(dispID == DISPID_AMBIENT_BACKCOLOR ? QPalette::Window : QPalette::WindowText,
+ OLEColorToQColor(rgb));
+ qt.widget->setPalette(pal);
+ }
+ break;
case DISPID_AMBIENT_DISPLAYASDEFAULT:
- break;
+ break;
case DISPID_AMBIENT_DISPLAYNAME:
- if (var.vt != VT_BSTR || !isWidget)
- break;
- qt.widget->setWindowTitle(QString::fromWCharArray(var.bstrVal));
- break;
+ if (var.vt != VT_BSTR || !isWidget)
+ break;
+ qt.widget->setWindowTitle(QString::fromWCharArray(var.bstrVal));
+ break;
case DISPID_AMBIENT_FONT:
- if (var.vt != VT_DISPATCH || !isWidget)
- break;
- {
+ if (var.vt != VT_DISPATCH || !isWidget)
+ break;
+ {
QVariant qvar = VARIANTToQVariant(var, "QFont", QVariant::Font);
QFont qfont = qvariant_cast<QFont>(qvar);
qt.widget->setFont(qfont);
- }
- break;
+ }
+ break;
case DISPID_AMBIENT_LOCALEID:
- break;
+ break;
case DISPID_AMBIENT_MESSAGEREFLECT:
- if (var.vt != VT_BOOL)
- break;
- if (var.boolVal)
- qt.widget->installEventFilter(this);
- else
- qt.widget->removeEventFilter(this);
- break;
+ if (var.vt != VT_BOOL)
+ break;
+ if (var.boolVal)
+ qt.widget->installEventFilter(this);
+ else
+ qt.widget->removeEventFilter(this);
+ break;
case DISPID_AMBIENT_PALETTE:
- break;
+ break;
case DISPID_AMBIENT_SCALEUNITS:
- break;
+ break;
case DISPID_AMBIENT_SHOWGRABHANDLES:
- break;
+ break;
case DISPID_AMBIENT_SHOWHATCHING:
- break;
+ break;
case DISPID_AMBIENT_SUPPORTSMNEMONICS:
- break;
+ break;
case DISPID_AMBIENT_TEXTALIGN:
- break;
+ break;
case DISPID_AMBIENT_UIDEAD:
- if (var.vt != VT_BOOL || !isWidget)
- break;
- qt.widget->setEnabled(!var.boolVal);
- break;
+ if (var.vt != VT_BOOL || !isWidget)
+ break;
+ qt.widget->setEnabled(!var.boolVal);
+ break;
case DISPID_AMBIENT_USERMODE:
- if (var.vt != VT_BOOL)
- break;
- inDesignMode = !var.boolVal;
- break;
+ if (var.vt != VT_BOOL)
+ break;
+ inDesignMode = !var.boolVal;
+ break;
case DISPID_AMBIENT_RIGHTTOLEFT:
- if (var.vt != VT_BOOL)
- break;
- qApp->setLayoutDirection(var.boolVal?Qt::RightToLeft:Qt::LeftToRight);
- break;
+ if (var.vt != VT_BOOL)
+ break;
+ qApp->setLayoutDirection(var.boolVal?Qt::RightToLeft:Qt::LeftToRight);
+ break;
}
return S_OK;
@@ -3344,7 +3344,7 @@ HRESULT WINAPI QAxServerBase::OnAmbientPropertyChange(DISPID dispID)
HRESULT WINAPI QAxServerBase::GetWindow(HWND *pHwnd)
{
if (!pHwnd)
- return E_POINTER;
+ return E_POINTER;
*pHwnd = m_hWnd;
return S_OK;
}
@@ -3355,9 +3355,9 @@ HRESULT WINAPI QAxServerBase::GetWindow(HWND *pHwnd)
HRESULT WINAPI QAxServerBase::ContextSensitiveHelp(BOOL fEnterMode)
{
if (fEnterMode)
- QWhatsThis::enterWhatsThisMode();
+ QWhatsThis::enterWhatsThisMode();
else
- QWhatsThis::leaveWhatsThisMode();
+ QWhatsThis::leaveWhatsThisMode();
return S_OK;
}
@@ -3368,20 +3368,20 @@ HRESULT WINAPI QAxServerBase::ContextSensitiveHelp(BOOL fEnterMode)
HRESULT WINAPI QAxServerBase::InPlaceDeactivate()
{
if (!isInPlaceActive)
- return S_OK;
+ return S_OK;
UIDeactivate();
isInPlaceActive = false;
// if we have a window, tell it to go away.
if (m_hWnd) {
- if (::IsWindow(m_hWnd))
- ::DestroyWindow(m_hWnd);
- m_hWnd = 0;
+ if (::IsWindow(m_hWnd))
+ ::DestroyWindow(m_hWnd);
+ m_hWnd = 0;
}
if (m_spInPlaceSite)
- m_spInPlaceSite->OnInPlaceDeactivate();
+ m_spInPlaceSite->OnInPlaceDeactivate();
return S_OK;
}
@@ -3393,41 +3393,41 @@ HRESULT WINAPI QAxServerBase::UIDeactivate()
{
// if we're not UIActive, not much to do.
if (!isUIActive || !m_spInPlaceSite)
- return S_OK;
+ return S_OK;
isUIActive = false;
// notify frame windows, if appropriate, that we're no longer ui-active.
HWND hwndParent;
if (m_spInPlaceSite->GetWindow(&hwndParent) == S_OK) {
- if (m_spInPlaceFrame) m_spInPlaceFrame->Release();
- m_spInPlaceFrame = 0;
- IOleInPlaceUIWindow *spInPlaceUIWindow = 0;
+ if (m_spInPlaceFrame) m_spInPlaceFrame->Release();
+ m_spInPlaceFrame = 0;
+ IOleInPlaceUIWindow *spInPlaceUIWindow = 0;
RECT rcPos, rcClip;
OLEINPLACEFRAMEINFO frameInfo;
frameInfo.cb = sizeof(OLEINPLACEFRAMEINFO);
- m_spInPlaceSite->GetWindowContext(&m_spInPlaceFrame, &spInPlaceUIWindow, &rcPos, &rcClip, &frameInfo);
- if (spInPlaceUIWindow) {
- spInPlaceUIWindow->SetActiveObject(0, 0);
- spInPlaceUIWindow->Release();
- }
- if (m_spInPlaceFrame) {
- removeMenu();
+ m_spInPlaceSite->GetWindowContext(&m_spInPlaceFrame, &spInPlaceUIWindow, &rcPos, &rcClip, &frameInfo);
+ if (spInPlaceUIWindow) {
+ spInPlaceUIWindow->SetActiveObject(0, 0);
+ spInPlaceUIWindow->Release();
+ }
+ if (m_spInPlaceFrame) {
+ removeMenu();
if (menuBar) {
menuBar->removeEventFilter(this);
menuBar = 0;
}
if (statusBar) {
statusBar->removeEventFilter(this);
- const int index = statusBar->metaObject()->indexOfSignal("messageChanged(QString)");
+ const int index = statusBar->metaObject()->indexOfSignal("messageChanged(QString)");
QMetaObject::disconnect(statusBar, index, this, STATUSBAR_MESSAGE_CHANGED_SLOT_INDEX);
- statusBar = 0;
+ statusBar = 0;
}
- m_spInPlaceFrame->SetActiveObject(0, 0);
- m_spInPlaceFrame->Release();
- m_spInPlaceFrame = 0;
- }
+ m_spInPlaceFrame->SetActiveObject(0, 0);
+ m_spInPlaceFrame->Release();
+ m_spInPlaceFrame = 0;
+ }
}
// we don't need to explicitly release the focus here since somebody
// else grabbing the focus is usually why we are getting called at all
@@ -3442,22 +3442,22 @@ HRESULT WINAPI QAxServerBase::UIDeactivate()
HRESULT WINAPI QAxServerBase::SetObjectRects(LPCRECT prcPos, LPCRECT prcClip)
{
if (prcPos == 0 || prcClip == 0)
- return E_POINTER;
+ return E_POINTER;
if (m_hWnd) {
- // the container wants us to clip, so figure out if we really need to
- RECT rcIXect;
- BOOL b = IntersectRect(&rcIXect, prcPos, prcClip);
- HRGN tempRgn = 0;
- if (b && !EqualRect(&rcIXect, prcPos)) {
- OffsetRect(&rcIXect, -(prcPos->left), -(prcPos->top));
- tempRgn = CreateRectRgnIndirect(&rcIXect);
- }
-
- ::SetWindowRgn(m_hWnd, tempRgn, true);
- ::SetWindowPos(m_hWnd, 0, prcPos->left, prcPos->top,
+ // the container wants us to clip, so figure out if we really need to
+ RECT rcIXect;
+ BOOL b = IntersectRect(&rcIXect, prcPos, prcClip);
+ HRGN tempRgn = 0;
+ if (b && !EqualRect(&rcIXect, prcPos)) {
+ OffsetRect(&rcIXect, -(prcPos->left), -(prcPos->top));
+ tempRgn = CreateRectRgnIndirect(&rcIXect);
+ }
+
+ ::SetWindowRgn(m_hWnd, tempRgn, true);
+ ::SetWindowPos(m_hWnd, 0, prcPos->left, prcPos->top,
prcPos->right - prcPos->left, prcPos->bottom - prcPos->top,
- SWP_NOZORDER | SWP_NOACTIVATE);
+ SWP_NOZORDER | SWP_NOACTIVATE);
}
//Save the new extent.
@@ -3486,11 +3486,11 @@ HRESULT WINAPI QAxServerBase::TranslateAcceleratorW(MSG *pMsg)
DWORD dwKeyMod = 0;
if (::GetKeyState(VK_SHIFT) < 0)
- dwKeyMod |= 1; // KEYMOD_SHIFT
+ dwKeyMod |= 1; // KEYMOD_SHIFT
if (::GetKeyState(VK_CONTROL) < 0)
- dwKeyMod |= 2; // KEYMOD_CONTROL
+ dwKeyMod |= 2; // KEYMOD_CONTROL
if (::GetKeyState(VK_MENU) < 0)
- dwKeyMod |= 4; // KEYMOD_ALT
+ dwKeyMod |= 4; // KEYMOD_ALT
switch (LOWORD(pMsg->wParam)) {
case VK_TAB:
@@ -3614,10 +3614,10 @@ HRESULT WINAPI QAxServerBase::TranslateAcceleratorA(MSG *pMsg)
HRESULT WINAPI QAxServerBase::OnFrameWindowActivate(BOOL fActivate)
{
if (fActivate) {
- if (wasUIActive)
- ::SetFocus(m_hWnd);
+ if (wasUIActive)
+ ::SetFocus(m_hWnd);
} else {
- wasUIActive = isUIActive;
+ wasUIActive = isUIActive;
}
return S_OK;
}
@@ -3635,7 +3635,7 @@ HRESULT WINAPI QAxServerBase::ResizeBorder(LPCRECT /* prcBorder */, IOleInPlaceU
HRESULT WINAPI QAxServerBase::EnableModeless(BOOL fEnable)
{
if (!isWidget)
- return S_OK;
+ return S_OK;
// FIXME: 4.10.2011 Does this work with the parent's HWND?
EnableWindow(hwndForWidget(qt.widget), fEnable);
@@ -3660,21 +3660,21 @@ static inline LPOLESTR QStringToOLESTR(const QString &qstring)
HRESULT WINAPI QAxServerBase::GetUserType(DWORD dwFormOfType, LPOLESTR *pszUserType)
{
if (!pszUserType)
- return E_POINTER;
+ return E_POINTER;
switch (dwFormOfType) {
case USERCLASSTYPE_FULL:
- *pszUserType = QStringToOLESTR(class_name);
- break;
+ *pszUserType = QStringToOLESTR(class_name);
+ break;
case USERCLASSTYPE_SHORT:
- if (!qt.widget || !isWidget || qt.widget->windowTitle().isEmpty())
- *pszUserType = QStringToOLESTR(class_name);
- else
- *pszUserType = QStringToOLESTR(qt.widget->windowTitle());
- break;
+ if (!qt.widget || !isWidget || qt.widget->windowTitle().isEmpty())
+ *pszUserType = QStringToOLESTR(class_name);
+ else
+ *pszUserType = QStringToOLESTR(qt.widget->windowTitle());
+ break;
case USERCLASSTYPE_APPNAME:
- *pszUserType = QStringToOLESTR(qApp->objectName());
- break;
+ *pszUserType = QStringToOLESTR(qApp->objectName());
+ break;
}
return S_OK;
@@ -3706,25 +3706,25 @@ HRESULT WINAPI QAxServerBase::Advise(IAdviseSink* pAdvSink, DWORD* pdwConnection
HRESULT WINAPI QAxServerBase::Close(DWORD dwSaveOption)
{
if (dwSaveOption != OLECLOSE_NOSAVE && m_spClientSite)
- m_spClientSite->SaveObject();
+ m_spClientSite->SaveObject();
if (isInPlaceActive) {
- HRESULT hr = InPlaceDeactivate();
- if (FAILED(hr))
- return hr;
+ HRESULT hr = InPlaceDeactivate();
+ if (FAILED(hr))
+ return hr;
}
if (m_hWnd) {
- if (IsWindow(m_hWnd))
- DestroyWindow(m_hWnd);
- m_hWnd = 0;
- if (m_spClientSite)
- m_spClientSite->OnShowWindow(false);
+ if (IsWindow(m_hWnd))
+ DestroyWindow(m_hWnd);
+ m_hWnd = 0;
+ if (m_spClientSite)
+ m_spClientSite->OnShowWindow(false);
}
if (m_spInPlaceSite) m_spInPlaceSite->Release();
m_spInPlaceSite = 0;
if (m_spAdviseSink)
- m_spAdviseSink->OnClose();
+ m_spAdviseSink->OnClose();
for (int i = 0; i < adviseSinks.count(); ++i) {
adviseSinks.at(i).pAdvSink->OnClose();
}
@@ -3740,20 +3740,20 @@ bool qax_disable_inplaceframe = true;
HRESULT QAxServerBase::internalActivate()
{
if (!m_spClientSite)
- return S_OK;
+ return S_OK;
if (!m_spInPlaceSite)
m_spClientSite->QueryInterface(IID_IOleInPlaceSite, (void**)&m_spInPlaceSite);
if (!m_spInPlaceSite)
- return E_FAIL;
+ return E_FAIL;
HRESULT hr = E_FAIL;
if (!isInPlaceActive) {
- hr = m_spInPlaceSite->CanInPlaceActivate();
- if (FAILED(hr))
- return hr;
- if (hr != S_OK)
- return E_FAIL;
- m_spInPlaceSite->OnInPlaceActivate();
+ hr = m_spInPlaceSite->CanInPlaceActivate();
+ if (FAILED(hr))
+ return hr;
+ if (hr != S_OK)
+ return E_FAIL;
+ m_spInPlaceSite->OnInPlaceActivate();
}
isInPlaceActive = true;
@@ -3779,57 +3779,57 @@ HRESULT QAxServerBase::internalActivate()
}
}
- // Gone active by now, take care of UIACTIVATE
- canTakeFocus = qt.widget->focusPolicy() != Qt::NoFocus && !inDesignMode;
- if (!canTakeFocus && !inDesignMode) {
- QList<QWidget*> widgets = qt.widget->findChildren<QWidget*>();
- for (int w = 0; w < widgets.count(); ++w) {
- QWidget *widget = widgets[w];
- canTakeFocus = widget->focusPolicy() != Qt::NoFocus;
+ // Gone active by now, take care of UIACTIVATE
+ canTakeFocus = qt.widget->focusPolicy() != Qt::NoFocus && !inDesignMode;
+ if (!canTakeFocus && !inDesignMode) {
+ QList<QWidget*> widgets = qt.widget->findChildren<QWidget*>();
+ for (int w = 0; w < widgets.count(); ++w) {
+ QWidget *widget = widgets[w];
+ canTakeFocus = widget->focusPolicy() != Qt::NoFocus;
if (canTakeFocus)
break;
- }
- }
- if (!isUIActive && canTakeFocus) {
- isUIActive = true;
- hr = m_spInPlaceSite->OnUIActivate();
- if (FAILED(hr)) {
- if (m_spInPlaceFrame) m_spInPlaceFrame->Release();
- m_spInPlaceFrame = 0;
- if (spInPlaceUIWindow) spInPlaceUIWindow->Release();
- return hr;
- }
-
- if (isInPlaceActive) {
- if (!::IsChild(m_hWnd, ::GetFocus()))
- ::SetFocus(m_hWnd);
- }
-
- if (m_spInPlaceFrame) {
+ }
+ }
+ if (!isUIActive && canTakeFocus) {
+ isUIActive = true;
+ hr = m_spInPlaceSite->OnUIActivate();
+ if (FAILED(hr)) {
+ if (m_spInPlaceFrame) m_spInPlaceFrame->Release();
+ m_spInPlaceFrame = 0;
+ if (spInPlaceUIWindow) spInPlaceUIWindow->Release();
+ return hr;
+ }
+
+ if (isInPlaceActive) {
+ if (!::IsChild(m_hWnd, ::GetFocus()))
+ ::SetFocus(m_hWnd);
+ }
+
+ if (m_spInPlaceFrame) {
hr = m_spInPlaceFrame->SetActiveObject(this, (wchar_t*)class_name.utf16());
- if (!FAILED(hr)) {
- menuBar = (qt.widget && !qax_disable_inplaceframe) ? qt.widget->findChild<QMenuBar*>() : 0;
- if (menuBar && !menuBar->isVisible()) {
- createMenu(menuBar);
- menuBar->hide();
- menuBar->installEventFilter(this);
- }
- statusBar = qt.widget ? qt.widget->findChild<QStatusBar*>() : 0;
- if (statusBar && !statusBar->isVisible()) {
- const int index = statusBar->metaObject()->indexOfSignal("messageChanged(QString)");
- QMetaObject::connect(statusBar, index, this, STATUSBAR_MESSAGE_CHANGED_SLOT_INDEX);
- statusBar->hide();
- statusBar->installEventFilter(this);
- }
- }
- }
- if (spInPlaceUIWindow) {
+ if (!FAILED(hr)) {
+ menuBar = (qt.widget && !qax_disable_inplaceframe) ? qt.widget->findChild<QMenuBar*>() : 0;
+ if (menuBar && !menuBar->isVisible()) {
+ createMenu(menuBar);
+ menuBar->hide();
+ menuBar->installEventFilter(this);
+ }
+ statusBar = qt.widget ? qt.widget->findChild<QStatusBar*>() : 0;
+ if (statusBar && !statusBar->isVisible()) {
+ const int index = statusBar->metaObject()->indexOfSignal("messageChanged(QString)");
+ QMetaObject::connect(statusBar, index, this, STATUSBAR_MESSAGE_CHANGED_SLOT_INDEX);
+ statusBar->hide();
+ statusBar->installEventFilter(this);
+ }
+ }
+ }
+ if (spInPlaceUIWindow) {
spInPlaceUIWindow->SetActiveObject(this, (wchar_t*)class_name.utf16());
- spInPlaceUIWindow->SetBorderSpace(0);
- }
- }
+ spInPlaceUIWindow->SetBorderSpace(0);
+ }
+ }
if (spInPlaceUIWindow) spInPlaceUIWindow->Release();
- ShowWindow(m_hWnd, SW_NORMAL);
+ ShowWindow(m_hWnd, SW_NORMAL);
}
m_spClientSite->ShowObject();
@@ -3841,43 +3841,43 @@ HRESULT QAxServerBase::internalActivate()
Executes the "verb" \a iVerb.
*/
HRESULT WINAPI QAxServerBase::DoVerb(LONG iVerb, LPMSG /*lpmsg*/, IOleClientSite* /*pActiveSite*/, LONG /*lindex*/,
- HWND /*hwndParent*/, LPCRECT /*prcPosRect*/)
+ HWND /*hwndParent*/, LPCRECT /*prcPosRect*/)
{
HRESULT hr = E_NOTIMPL;
switch (iVerb)
{
case OLEIVERB_SHOW:
- hr = internalActivate();
- if (SUCCEEDED(hr))
- hr = S_OK;
- break;
+ hr = internalActivate();
+ if (SUCCEEDED(hr))
+ hr = S_OK;
+ break;
case OLEIVERB_PRIMARY:
case OLEIVERB_INPLACEACTIVATE:
- hr = internalActivate();
- if (SUCCEEDED(hr)) {
- hr = S_OK;
- update();
- }
- break;
+ hr = internalActivate();
+ if (SUCCEEDED(hr)) {
+ hr = S_OK;
+ update();
+ }
+ break;
case OLEIVERB_UIACTIVATE:
- if (!isUIActive) {
- hr = internalActivate();
- if (SUCCEEDED(hr))
- hr = S_OK;
- }
- break;
+ if (!isUIActive) {
+ hr = internalActivate();
+ if (SUCCEEDED(hr))
+ hr = S_OK;
+ }
+ break;
case OLEIVERB_HIDE:
- UIDeactivate();
- if (m_hWnd)
- ::ShowWindow(m_hWnd, SW_HIDE);
- hr = S_OK;
- return hr;
+ UIDeactivate();
+ if (m_hWnd)
+ ::ShowWindow(m_hWnd, SW_HIDE);
+ hr = S_OK;
+ return hr;
default:
- break;
+ break;
}
return hr;
}
@@ -3896,7 +3896,7 @@ HRESULT WINAPI QAxServerBase::EnumAdvise(IEnumSTATDATA** /*ppenumAdvise*/)
HRESULT WINAPI QAxServerBase::EnumVerbs(IEnumOLEVERB** ppEnumOleVerb)
{
if (!ppEnumOleVerb)
- return E_POINTER;
+ return E_POINTER;
return OleRegEnumVerbs(qAxFactory()->classID(class_name), ppEnumOleVerb);
}
@@ -3906,10 +3906,10 @@ HRESULT WINAPI QAxServerBase::EnumVerbs(IEnumOLEVERB** ppEnumOleVerb)
HRESULT WINAPI QAxServerBase::GetClientSite(IOleClientSite** ppClientSite)
{
if (!ppClientSite)
- return E_POINTER;
+ return E_POINTER;
*ppClientSite = m_spClientSite;
if (*ppClientSite)
- (*ppClientSite)->AddRef();
+ (*ppClientSite)->AddRef();
return S_OK;
}
@@ -3927,9 +3927,9 @@ HRESULT WINAPI QAxServerBase::GetClipboardData(DWORD, IDataObject**)
HRESULT WINAPI QAxServerBase::GetExtent(DWORD dwDrawAspect, SIZEL* psizel)
{
if (dwDrawAspect != DVASPECT_CONTENT || !isWidget || !qt.widget)
- return E_FAIL;
+ return E_FAIL;
if (!psizel)
- return E_POINTER;
+ return E_POINTER;
psizel->cx = MAP_PIX_TO_LOGHIM(m_currentExtent.width(), qt.widget->logicalDpiX());
psizel->cy = MAP_PIX_TO_LOGHIM(m_currentExtent.height(), qt.widget->logicalDpiY());
@@ -3950,7 +3950,7 @@ HRESULT WINAPI QAxServerBase::GetMoniker(DWORD, DWORD, IMoniker** )
HRESULT WINAPI QAxServerBase::GetUserClassID(CLSID* pClsid)
{
if (!pClsid)
- return E_POINTER;
+ return E_POINTER;
*pClsid = qAxFactory()->classID(class_name);
return S_OK;
}
@@ -3986,7 +3986,7 @@ HRESULT WINAPI QAxServerBase::SetClientSite(IOleClientSite* pClientSite)
m_spClientSite = pClientSite;
if (m_spClientSite) {
m_spClientSite->AddRef();
- m_spClientSite->QueryInterface(IID_IOleInPlaceSite, (void **)&m_spInPlaceSite);
+ m_spClientSite->QueryInterface(IID_IOleInPlaceSite, (void **)&m_spInPlaceSite);
}
return S_OK;
@@ -4014,12 +4014,12 @@ bool qt_sendSpontaneousEvent(QObject *o, QEvent *e)
HRESULT WINAPI QAxServerBase::SetExtent(DWORD dwDrawAspect, SIZEL* psizel)
{
if (dwDrawAspect != DVASPECT_CONTENT)
- return DV_E_DVASPECT;
+ return DV_E_DVASPECT;
if (!psizel)
- return E_POINTER;
+ return E_POINTER;
if (!isWidget || !qt.widget) // nothing to do
- return S_OK;
+ return S_OK;
QSize proposedSize(MAP_LOGHIM_TO_PIX(psizel->cx, qt.widget->logicalDpiX()),
MAP_LOGHIM_TO_PIX(psizel->cy, qt.widget->logicalDpiY()));
@@ -4082,22 +4082,22 @@ HRESULT WINAPI QAxServerBase::Update()
HRESULT WINAPI QAxServerBase::GetData(FORMATETC *pformatetcIn, STGMEDIUM *pmedium)
{
if (!pmedium)
- return E_POINTER;
+ return E_POINTER;
if ((pformatetcIn->tymed & TYMED_MFPICT) == 0)
- return DATA_E_FORMATETC;
+ return DATA_E_FORMATETC;
internalCreate();
if (!isWidget || !qt.widget)
- return E_UNEXPECTED;
+ return E_UNEXPECTED;
// Container wants to draw, but the size is not defined yet - ask container
if (m_spInPlaceSite && !qt.widget->testAttribute(Qt::WA_Resized)) {
- IOleInPlaceUIWindow *spInPlaceUIWindow = 0;
+ IOleInPlaceUIWindow *spInPlaceUIWindow = 0;
RECT rcPos, rcClip;
OLEINPLACEFRAMEINFO frameInfo;
frameInfo.cb = sizeof(OLEINPLACEFRAMEINFO);
- HRESULT hres = m_spInPlaceSite->GetWindowContext(&m_spInPlaceFrame, &spInPlaceUIWindow, &rcPos, &rcClip, &frameInfo);
+ HRESULT hres = m_spInPlaceSite->GetWindowContext(&m_spInPlaceFrame, &spInPlaceUIWindow, &rcPos, &rcClip, &frameInfo);
if (hres == S_OK) {
QSize size(rcPos.right - rcPos.left, rcPos.bottom - rcPos.top);
resize(size);
@@ -4121,12 +4121,12 @@ HRESULT WINAPI QAxServerBase::GetData(FORMATETC *pformatetcIn, STGMEDIUM *pmediu
RestoreDC(hdc, -1);
HMETAFILE hMF = CloseMetaFile(hdc);
if (!hMF)
- return E_UNEXPECTED;
+ return E_UNEXPECTED;
HGLOBAL hMem = GlobalAlloc(GMEM_SHARE | GMEM_MOVEABLE, sizeof(METAFILEPICT));
if (!hMem) {
- DeleteMetaFile(hMF);
- return ResultFromScode(STG_E_MEDIUMFULL);
+ DeleteMetaFile(hMF);
+ return ResultFromScode(STG_E_MEDIUMFULL);
}
LPMETAFILEPICT pMF = (LPMETAFILEPICT)GlobalLock(hMem);
@@ -4148,7 +4148,7 @@ HRESULT WINAPI QAxServerBase::GetData(FORMATETC *pformatetcIn, STGMEDIUM *pmediu
Not implemented.
*/
HRESULT WINAPI QAxServerBase::DAdvise(FORMATETC *pformatetc, DWORD advf,
- IAdviseSink *pAdvSink, DWORD *pdwConnection)
+ IAdviseSink *pAdvSink, DWORD *pdwConnection)
{
if (pformatetc->dwAspect != DVASPECT_CONTENT)
return E_FAIL;
@@ -4225,11 +4225,11 @@ static int mapModifiers(int state)
{
int ole = 0;
if (state & Qt::ShiftModifier)
- ole |= 1;
+ ole |= 1;
if (state & Qt::ControlModifier)
- ole |= 2;
+ ole |= 2;
if (state & Qt::AltModifier)
- ole |= 4;
+ ole |= 4;
return ole;
}
@@ -4240,128 +4240,128 @@ static int mapModifiers(int state)
bool QAxServerBase::eventFilter(QObject *o, QEvent *e)
{
if (!theObject)
- return QObject::eventFilter(o, e);
+ return QObject::eventFilter(o, e);
if ((e->type() == QEvent::Show || e->type() == QEvent::Hide) && (o == statusBar || o == menuBar)) {
- if (o == menuBar) {
- if (e->type() == QEvent::Hide) {
- createMenu(menuBar);
- } else if (e->type() == QEvent::Show) {
- removeMenu();
- }
- } else if (statusBar) {
- statusBar->setSizeGripEnabled(false);
- }
- updateGeometry();
- if (m_spInPlaceSite && qt.widget->sizeHint().isValid()) {
+ if (o == menuBar) {
+ if (e->type() == QEvent::Hide) {
+ createMenu(menuBar);
+ } else if (e->type() == QEvent::Show) {
+ removeMenu();
+ }
+ } else if (statusBar) {
+ statusBar->setSizeGripEnabled(false);
+ }
+ updateGeometry();
+ if (m_spInPlaceSite && qt.widget->sizeHint().isValid()) {
RECT rect = {0, 0, qt.widget->sizeHint().width(), qt.widget->sizeHint().height()};
- m_spInPlaceSite->OnPosRectChange(&rect);
- }
+ m_spInPlaceSite->OnPosRectChange(&rect);
+ }
}
switch (e->type()) {
case QEvent::ChildAdded:
- static_cast<QChildEvent*>(e)->child()->installEventFilter(this);
- break;
+ static_cast<QChildEvent*>(e)->child()->installEventFilter(this);
+ break;
case QEvent::ChildRemoved:
- static_cast<QChildEvent*>(e)->child()->removeEventFilter(this);
- break;
+ static_cast<QChildEvent*>(e)->child()->removeEventFilter(this);
+ break;
case QEvent::KeyPress:
- if (o == qt.object && hasStockEvents) {
- QKeyEvent *ke = (QKeyEvent*)e;
- int key = ke->key();
- int state = ke->modifiers();
- void *argv[] = {
- 0,
- &key,
- &state
- };
- qt_metacall(QMetaObject::InvokeMetaMethod, DISPID_KEYDOWN, argv);
- if (!ke->text().isEmpty())
- qt_metacall(QMetaObject::InvokeMetaMethod, DISPID_KEYPRESS, argv);
- }
- break;
+ if (o == qt.object && hasStockEvents) {
+ QKeyEvent *ke = (QKeyEvent*)e;
+ int key = ke->key();
+ int state = ke->modifiers();
+ void *argv[] = {
+ 0,
+ &key,
+ &state
+ };
+ qt_metacall(QMetaObject::InvokeMetaMethod, DISPID_KEYDOWN, argv);
+ if (!ke->text().isEmpty())
+ qt_metacall(QMetaObject::InvokeMetaMethod, DISPID_KEYPRESS, argv);
+ }
+ break;
case QEvent::KeyRelease:
- if (o == qt.object && hasStockEvents) {
- QKeyEvent *ke = (QKeyEvent*)e;
- int key = ke->key();
- int state = ke->modifiers();
- void *argv[] = {
- 0,
- &key,
- &state
- };
- qt_metacall(QMetaObject::InvokeMetaMethod, DISPID_KEYUP, argv);
- }
- break;
+ if (o == qt.object && hasStockEvents) {
+ QKeyEvent *ke = (QKeyEvent*)e;
+ int key = ke->key();
+ int state = ke->modifiers();
+ void *argv[] = {
+ 0,
+ &key,
+ &state
+ };
+ qt_metacall(QMetaObject::InvokeMetaMethod, DISPID_KEYUP, argv);
+ }
+ break;
case QEvent::MouseMove:
- if (o == qt.object && hasStockEvents) {
- QMouseEvent *me = (QMouseEvent*)e;
+ if (o == qt.object && hasStockEvents) {
+ QMouseEvent *me = (QMouseEvent*)e;
int button = me->buttons() & Qt::MouseButtonMask;
- int state = mapModifiers(me->modifiers());
- int x = me->x();
- int y = me->y();
- void *argv[] = {
- 0,
- &button,
- &state,
- &x,
- &y
- };
- qt_metacall(QMetaObject::InvokeMetaMethod, DISPID_MOUSEMOVE, argv);
- }
- break;
+ int state = mapModifiers(me->modifiers());
+ int x = me->x();
+ int y = me->y();
+ void *argv[] = {
+ 0,
+ &button,
+ &state,
+ &x,
+ &y
+ };
+ qt_metacall(QMetaObject::InvokeMetaMethod, DISPID_MOUSEMOVE, argv);
+ }
+ break;
case QEvent::MouseButtonRelease:
- if (o == qt.object && hasStockEvents) {
- QMouseEvent *me = (QMouseEvent*)e;
- int button = me->button();
- int state = mapModifiers(me->modifiers());
- int x = me->x();
- int y = me->y();
- void *argv[] = {
- 0,
- &button,
- &state,
- &x,
- &y
- };
- qt_metacall(QMetaObject::InvokeMetaMethod, DISPID_MOUSEUP, argv);
- qt_metacall(QMetaObject::InvokeMetaMethod, DISPID_CLICK, 0);
- }
- break;
+ if (o == qt.object && hasStockEvents) {
+ QMouseEvent *me = (QMouseEvent*)e;
+ int button = me->button();
+ int state = mapModifiers(me->modifiers());
+ int x = me->x();
+ int y = me->y();
+ void *argv[] = {
+ 0,
+ &button,
+ &state,
+ &x,
+ &y
+ };
+ qt_metacall(QMetaObject::InvokeMetaMethod, DISPID_MOUSEUP, argv);
+ qt_metacall(QMetaObject::InvokeMetaMethod, DISPID_CLICK, 0);
+ }
+ break;
case QEvent::MouseButtonDblClick:
- if (o == qt.object && hasStockEvents) {
- qt_metacall(QMetaObject::InvokeMetaMethod, DISPID_DBLCLICK, 0);
- }
- break;
+ if (o == qt.object && hasStockEvents) {
+ qt_metacall(QMetaObject::InvokeMetaMethod, DISPID_DBLCLICK, 0);
+ }
+ break;
case QEvent::MouseButtonPress:
if (m_spInPlaceSite && !isUIActive) {
internalActivate();
}
- if (o == qt.widget && hasStockEvents) {
- QMouseEvent *me = (QMouseEvent*)e;
- int button = me->button();
- int state = mapModifiers(me->modifiers());
- int x = me->x();
- int y = me->y();
- void *argv[] = {
- 0,
- &button,
- &state,
- &x,
- &y
- };
- qt_metacall(QMetaObject::InvokeMetaMethod, DISPID_MOUSEDOWN, argv);
- }
- break;
+ if (o == qt.widget && hasStockEvents) {
+ QMouseEvent *me = (QMouseEvent*)e;
+ int button = me->button();
+ int state = mapModifiers(me->modifiers());
+ int x = me->x();
+ int y = me->y();
+ void *argv[] = {
+ 0,
+ &button,
+ &state,
+ &x,
+ &y
+ };
+ qt_metacall(QMetaObject::InvokeMetaMethod, DISPID_MOUSEDOWN, argv);
+ }
+ break;
case QEvent::Show:
- if (m_hWnd && o == qt.widget)
- ShowWindow(m_hWnd, SW_SHOW);
- updateMask();
- break;
+ if (m_hWnd && o == qt.widget)
+ ShowWindow(m_hWnd, SW_SHOW);
+ updateMask();
+ break;
case QEvent::Hide:
- if (m_hWnd && o == qt.widget)
- ShowWindow(m_hWnd, SW_HIDE);
- break;
+ if (m_hWnd && o == qt.widget)
+ ShowWindow(m_hWnd, SW_HIDE);
+ break;
case QEvent::EnabledChange:
if (m_hWnd && o == qt.widget)
@@ -4373,22 +4373,22 @@ bool QAxServerBase::eventFilter(QObject *o, QEvent *e)
case QEvent::IconTextChange:
case QEvent::ModifiedChange:
case QEvent::Resize:
- updateMask();
- break;
+ updateMask();
+ break;
case QEvent::WindowBlocked: {
if (!m_spInPlaceFrame)
break;
m_spInPlaceFrame->EnableModeless(FALSE);
MSG msg;
// Visual Basic 6.0 posts the message WM_USER+3078 from the EnableModeless().
- // While handling this message, VB will disable all current top-levels. After
- // this we have to re-enable the Qt modal widget to receive input events.
+ // While handling this message, VB will disable all current top-levels. After
+ // this we have to re-enable the Qt modal widget to receive input events.
if (PeekMessage(&msg, 0, WM_USER+3078, WM_USER+3078, PM_REMOVE)) {
TranslateMessage(&msg);
DispatchMessage(&msg);
// FIXME: 4.10.2011 Does this work with the parent's HWND?
QWidget *modalWidget = QApplication::activeModalWidget();
- if (modalWidget && modalWidget->isVisible() && modalWidget->isEnabled()
+ if (modalWidget && modalWidget->isVisible() && modalWidget->isEnabled()
&& !IsWindowEnabled(hwndForWidget(modalWidget)))
EnableWindow(hwndForWidget(modalWidget), TRUE);
}
@@ -4400,7 +4400,7 @@ bool QAxServerBase::eventFilter(QObject *o, QEvent *e)
m_spInPlaceFrame->EnableModeless(TRUE);
break;
default:
- break;
+ break;
}
return QObject::eventFilter(o, e);
}
diff --git a/src/activeqt/control/qaxserverdll.cpp b/src/activeqt/control/qaxserverdll.cpp
index be854cc..f6145f5 100644
--- a/src/activeqt/control/qaxserverdll.cpp
+++ b/src/activeqt/control/qaxserverdll.cpp
@@ -78,7 +78,7 @@ STDAPI DllGetClassObject(const GUID &clsid, const GUID &iid, void** ppv)
if (!qAxThreadId)
qAxThreadId = GetCurrentThreadId();
else if (GetCurrentThreadId() != qAxThreadId)
- return E_FAIL;
+ return E_FAIL;
GetClassObject(clsid, iid, ppv);
if (!*ppv)
@@ -94,7 +94,7 @@ STDAPI DllCanUnloadNow()
return S_FALSE;
if (!qax_ownQApp)
return S_OK;
-
+
// check if qApp still runs widgets (in other DLLs)
QWidgetList widgets = qApp->allWidgets();
int count = widgets.count();
@@ -106,14 +106,14 @@ STDAPI DllCanUnloadNow()
}
if (count)
return S_FALSE;
-
+
// no widgets left - destroy qApp
if (qax_hhook)
UnhookWindowsHookEx(qax_hhook);
-
+
delete qApp;
qax_ownQApp = false;
-
+
// never allow unloading - safety net for Internet Explorer
return S_FALSE;
}
@@ -128,14 +128,14 @@ EXTERN_C BOOL WINAPI DllMain(HINSTANCE hInstance, DWORD dwReason, LPVOID /* lpvR
qAxInstance = hInstance;
qAxIsServer = true;
-
+
if (dwReason == DLL_PROCESS_ATTACH) {
DisableThreadLibraryCalls(hInstance);
qAxInit();
} else if (dwReason == DLL_PROCESS_DETACH) {
qAxCleanup();
}
-
+
return true;
}
diff --git a/src/activeqt/control/qaxservermain.cpp b/src/activeqt/control/qaxservermain.cpp
index fd8dc63..07156f4 100644
--- a/src/activeqt/control/qaxservermain.cpp
+++ b/src/activeqt/control/qaxservermain.cpp
@@ -96,7 +96,7 @@ static DWORD WINAPI MonitorProc(void* /* pv */)
CloseHandle(hEventShutdown);
PostThreadMessage(dwThreadID, WM_QUIT, 0, 0);
PostQuitMessage(0);
-
+
return 0;
}
@@ -126,20 +126,20 @@ bool qax_startServer(QAxFactory::ServerType type)
{
if (qAxIsServer)
return true;
-
+
const QStringList keys = qAxFactory()->featureList();
if (!keys.count())
return false;
-
+
if (!qAxFactory()->isService())
StartMonitor();
-
+
classRegistration = new DWORD[keys.count()];
int object = 0;
for (QStringList::ConstIterator key = keys.begin(); key != keys.end(); ++key, ++object) {
IUnknown* p = 0;
CLSID clsid = qAxFactory()->classID(*key);
-
+
// Create a QClassFactory (implemented in qaxserverbase.cpp)
HRESULT hRes = GetClassObject(clsid, IID_IClassFactory, (void**)&p);
if (SUCCEEDED(hRes))
@@ -161,19 +161,19 @@ bool qax_stopServer()
{
if (!qAxIsServer || !classRegistration)
return true;
-
+
qAxIsServer = false;
-
+
const QStringList keys = qAxFactory()->featureList();
int object = 0;
for (QStringList::ConstIterator key = keys.begin(); key != keys.end(); ++key, ++object)
CoRevokeClassObject(classRegistration[object]);
-
+
delete []classRegistration;
classRegistration = 0;
-
+
Sleep(dwPause); //wait for any threads to finish
-
+
return true;
}
@@ -199,7 +199,7 @@ extern "C" int main(int, char **);
EXTERN_C int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR, int nShowCmd)
{
- QT_USE_NAMESPACE
+ QT_USE_NAMESPACE
qAxOutProcServer = true;
GetModuleFileName(0, qAxModuleFilename, MAX_PATH);
@@ -237,7 +237,7 @@ EXTERN_C int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR,
else
version = "1.0";
}
-
+
nRet = DumpIDL(QString::fromLatin1(outfile.constData()), QString::fromLatin1(version.constData()));
} else {
qWarning("Wrong commandline syntax: <app> -dumpidl <idl file> [-version <x.y.z>]");
@@ -248,7 +248,7 @@ EXTERN_C int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR,
unprocessed += cmds.at(i) + ' ';
}
}
-
+
if (run) {
if (SUCCEEDED(CoInitialize(0))) {
int argc;
@@ -266,6 +266,6 @@ EXTERN_C int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR,
nRet = -1;
}
}
-
+
return nRet;
}
diff --git a/src/activeqt/doc/snippets/doc_src_qaxserver.cpp b/src/activeqt/doc/snippets/doc_src_qaxserver.cpp
index df6ef2b..e9ae716 100644
--- a/src/activeqt/doc/snippets/doc_src_qaxserver.cpp
+++ b/src/activeqt/doc/snippets/doc_src_qaxserver.cpp
@@ -121,7 +121,7 @@ MyFactory(const QUuid &, const QUuid &);
//! [11]
HMODULE dll = LoadLibrary("myserver.dll");
typedef HRESULT(__stdcall *DllRegisterServerProc)();
-DllRegisterServerProc DllRegisterServer =
+DllRegisterServerProc DllRegisterServer =
(DllRegisterServerProc)GetProcAddress(dll, "DllRegisterServer");
HRESULT res = E_FAIL;
diff --git a/src/activeqt/doc/snippets/src_activeqt_container_qaxbase.cpp b/src/activeqt/doc/snippets/src_activeqt_container_qaxbase.cpp
index a716bc3..23060b7 100644
--- a/src/activeqt/doc/snippets/src_activeqt_container_qaxbase.cpp
+++ b/src/activeqt/doc/snippets/src_activeqt_container_qaxbase.cpp
@@ -56,7 +56,7 @@ webBrowser->dynamicCall("GoHome()");
//! [3]
connect(webBrowser, SIGNAL(TitleChanged(QString)),
- this, SLOT(setCaption(QString)));
+ this, SLOT(setCaption(QString)));
//! [3]
@@ -175,8 +175,8 @@ QAxWidget outlook("Outlook.Application");
QAxObject *session = outlook.querySubObject("Session");
if (session) {
QAxObject *defFolder = session->querySubObject(
- "GetDefaultFolder(OlDefaultFolders)",
- "olFolderContacts");
+ "GetDefaultFolder(OlDefaultFolders)",
+ "olFolderContacts");
//...
}
//! [19]
@@ -187,13 +187,13 @@ void Receiver::slot(const QString &name, int argc, void *argv)
{
VARIANTARG *params = (VARIANTARG*)argv;
if (name.startsWith("BeforeNavigate2(")) {
- IDispatch *pDisp = params[argc-1].pdispVal;
- VARIANTARG URL = *params[argc-2].pvarVal;
- VARIANTARG Flags = *params[argc-3].pvarVal;
- VARIANTARG TargetFrameName = *params[argc-4].pvarVal;
- VARIANTARG PostData = *params[argc-5].pvarVal;
- VARIANTARG Headers = *params[argc-6].pvarVal;
- bool *Cancel = params[argc-7].pboolVal;
+ IDispatch *pDisp = params[argc-1].pdispVal;
+ VARIANTARG URL = *params[argc-2].pvarVal;
+ VARIANTARG Flags = *params[argc-3].pvarVal;
+ VARIANTARG TargetFrameName = *params[argc-4].pvarVal;
+ VARIANTARG PostData = *params[argc-5].pvarVal;
+ VARIANTARG Headers = *params[argc-6].pvarVal;
+ bool *Cancel = params[argc-7].pboolVal;
}
}
//! [20]
diff --git a/src/activeqt/doc/snippets/src_activeqt_control_qaxfactory.cpp b/src/activeqt/doc/snippets/src_activeqt_control_qaxfactory.cpp
index 7b4d6a2..67763cc 100644
--- a/src/activeqt/doc/snippets/src_activeqt_control_qaxfactory.cpp
+++ b/src/activeqt/doc/snippets/src_activeqt_control_qaxfactory.cpp
@@ -89,7 +89,7 @@ QUuid ActiveQtFactory::eventsID(const QString &key) const
}
QAXFACTORY_EXPORT(
- ActiveQtFactory, // factory class
+ ActiveQtFactory, // factory class
"{01234567-89AB-CDEF-0123-456789ABCDEF}", // type library ID
"{01234567-89AB-CDEF-0123-456789ABCDEF}" // application ID
)
@@ -114,7 +114,7 @@ QAXFACTORY_END()
#include "theactivex.h"
QAXFACTORY_DEFAULT(
- TheActiveX, // widget class
+ TheActiveX, // widget class
"{01234567-89AB-CDEF-0123-456789ABCDEF}", // class ID
"{01234567-89AB-CDEF-0123-456789ABCDEF}", // interface ID
"{01234567-89AB-CDEF-0123-456789ABCDEF}", // event interface ID
@@ -165,7 +165,7 @@ if (QAxFactory::isServer()) {
#include "theactivex.h"
QAXFACTORY_DEFAULT(
- TheActiveX, // widget class
+ TheActiveX, // widget class
"{01234567-89AB-CDEF-0123-456789ABCDEF}", // class ID
"{01234567-89AB-CDEF-0123-456789ABCDEF}", // interface ID
"{01234567-89AB-CDEF-0123-456789ABCDEF}", // event interface ID
@@ -177,7 +177,7 @@ QAXFACTORY_DEFAULT(
//! [8]
QAXFACTORY_EXPORT(
- MyFactory, // factory class
+ MyFactory, // factory class
"{01234567-89AB-CDEF-0123-456789ABCDEF}", // type library ID
"{01234567-89AB-CDEF-0123-456789ABCDEF}" // application ID
)
diff --git a/src/activeqt/shared/qaxtypes.cpp b/src/activeqt/shared/qaxtypes.cpp
index af14a29..364e680 100644
--- a/src/activeqt/shared/qaxtypes.cpp
+++ b/src/activeqt/shared/qaxtypes.cpp
@@ -91,7 +91,7 @@ static IFontDisp *QFontToIFont(const QFont &font)
fdesc.fUnderline = font.underline();
fdesc.lpstrName = QStringToBSTR(font.family());
fdesc.sWeight = font.weight() * 10;
-
+
IFontDisp *f;
HRESULT res = OleCreateFontIndirect(&fdesc, IID_IFontDisp, (void**)&f);
if (res != S_OK) {
@@ -128,7 +128,7 @@ static QFont IFontToQFont(IFont *f)
font.setStrikeOut(strike);
font.setUnderline(underline);
SysFreeString(name);
-
+
return font;
}
@@ -139,14 +139,14 @@ static IPictureDisp *QPixmapToIPicture(const QPixmap &pixmap)
return 0;
#else
IPictureDisp *pic = 0;
-
+
PICTDESC desc;
desc.cbSizeofstruct = sizeof(PICTDESC);
desc.picType = PICTYPE_BITMAP;
-
+
desc.bmp.hbitmap = 0;
desc.bmp.hpal = 0;
-
+
if (!pixmap.isNull()) {
desc.bmp.hbitmap = qaxPixmapToWinHBITMAP(pixmap);
Q_ASSERT(desc.bmp.hbitmap);
@@ -184,7 +184,7 @@ static QDateTime DATEToQDateTime(DATE ole)
SYSTEMTIME stime;
if (ole >= 949998 || VariantTimeToSystemTime(ole, &stime) == false)
return QDateTime();
-
+
QDate date(stime.wYear, stime.wMonth, stime.wDay);
QTime time(stime.wHour, stime.wMinute, stime.wSecond, stime.wMilliseconds);
return QDateTime(date, time);
@@ -194,7 +194,7 @@ static DATE QDateTimeToDATE(const QDateTime &dt)
{
if (!dt.isValid() || dt.isNull())
return 949998;
-
+
SYSTEMTIME stime;
memset(&stime, 0, sizeof(stime));
QDate date = dt.date();
@@ -210,10 +210,10 @@ static DATE QDateTimeToDATE(const QDateTime &dt)
stime.wMinute = time.minute();
stime.wHour = time.hour();
}
-
+
double vtime;
SystemTimeToVariantTime(&stime, &vtime);
-
+
return vtime;
}
@@ -285,7 +285,7 @@ bool QVariantToVARIANT(const QVariant &var, VARIANT &arg, const QByteArray &type
}
}
break;
-
+
case QVariant::Int:
if (out && arg.vt == (VT_I4|VT_BYREF)) {
*arg.plVal = qvar.toInt();
@@ -306,7 +306,7 @@ bool QVariantToVARIANT(const QVariant &var, VARIANT &arg, const QByteArray &type
}
}
break;
-
+
case QVariant::UInt:
if (out && (arg.vt == (VT_UINT|VT_BYREF) || arg.vt == (VT_I4|VT_BYREF))) {
*arg.puintVal = qvar.toUInt();
@@ -319,7 +319,7 @@ bool QVariantToVARIANT(const QVariant &var, VARIANT &arg, const QByteArray &type
}
}
break;
-
+
case QVariant::LongLong:
if (out && arg.vt == (VT_CY|VT_BYREF)) {
arg.pcyVal->int64 = qvar.toLongLong();
@@ -345,7 +345,7 @@ bool QVariantToVARIANT(const QVariant &var, VARIANT &arg, const QByteArray &type
}
#endif
break;
-
+
case QVariant::ULongLong:
if (out && arg.vt == (VT_CY|VT_BYREF)) {
arg.pcyVal->int64 = qvar.toULongLong();
@@ -373,7 +373,7 @@ bool QVariantToVARIANT(const QVariant &var, VARIANT &arg, const QByteArray &type
#endif
break;
-
+
case QVariant::Bool:
if (out && arg.vt == (VT_BOOL|VT_BYREF)) {
*arg.pboolVal = qvar.toBool() ? VARIANT_TRUE : VARIANT_FALSE;
@@ -396,7 +396,7 @@ bool QVariantToVARIANT(const QVariant &var, VARIANT &arg, const QByteArray &type
if (out) {
if (typeName == "float") {
arg.vt = VT_R4;
- arg.pfltVal = new float(arg.dblVal);
+ arg.pfltVal = new float(arg.dblVal);
} else {
arg.pdblVal = new double(arg.dblVal);
}
@@ -406,7 +406,7 @@ bool QVariantToVARIANT(const QVariant &var, VARIANT &arg, const QByteArray &type
break;
case QVariant::Color:
if (out && arg.vt == (VT_COLOR|VT_BYREF)) {
-
+
*arg.plVal = QColorToOLEColor(qvariant_cast<QColor>(qvar));
} else {
arg.vt = VT_COLOR;
@@ -417,7 +417,7 @@ bool QVariantToVARIANT(const QVariant &var, VARIANT &arg, const QByteArray &type
}
}
break;
-
+
case QVariant::Date:
case QVariant::Time:
case QVariant::DateTime:
@@ -446,7 +446,7 @@ bool QVariantToVARIANT(const QVariant &var, VARIANT &arg, const QByteArray &type
}
}
break;
-
+
case QVariant::Pixmap:
if (out && arg.vt == (VT_DISPATCH|VT_BYREF)) {
if (*arg.ppdispVal)
@@ -498,7 +498,7 @@ bool QVariantToVARIANT(const QVariant &var, VARIANT &arg, const QByteArray &type
#endif
}
break;
-
+
case QVariant::List:
{
const QList<QVariant> list = qvar.toList();
@@ -543,7 +543,7 @@ bool QVariantToVARIANT(const QVariant &var, VARIANT &arg, const QByteArray &type
}
SAFEARRAY *array = 0;
bool is2D = false;
- // If the first element in the array is a list the whole list is
+ // If the first element in the array is a list the whole list is
// treated as a 2D array. The column count is taken from the 1st element.
if (count) {
QVariantList col = list.at(0).toList();
@@ -597,7 +597,7 @@ bool QVariantToVARIANT(const QVariant &var, VARIANT &arg, const QByteArray &type
}
}
break;
-
+
case QVariant::StringList:
{
const QStringList list = qvar.toStringList();
@@ -609,7 +609,7 @@ bool QVariantToVARIANT(const QVariant &var, VARIANT &arg, const QByteArray &type
SafeArrayPutElement(array, &index, bstr);
SysFreeString(bstr);
}
-
+
if (out && arg.vt == (VT_ARRAY|VT_BSTR|VT_BYREF)) {
if (*arg.pparray)
SafeArrayDestroy(*arg.pparray);
@@ -624,12 +624,12 @@ bool QVariantToVARIANT(const QVariant &var, VARIANT &arg, const QByteArray &type
}
}
break;
-
+
case QVariant::ByteArray:
{
const QByteArray bytes = qvar.toByteArray();
const uint count = bytes.count();
- SAFEARRAY *array = SafeArrayCreateVector(VT_UI1, 0, count);
+ SAFEARRAY *array = SafeArrayCreateVector(VT_UI1, 0, count);
if (count) {
const char *data = bytes.constData();
char *dest;
@@ -637,7 +637,7 @@ bool QVariantToVARIANT(const QVariant &var, VARIANT &arg, const QByteArray &type
memcpy(dest, data, count);
SafeArrayUnaccessData(array);
}
-
+
if (out && arg.vt == (VT_ARRAY|VT_UI1|VT_BYREF)) {
if (*arg.pparray)
SafeArrayDestroy(*arg.pparray);
@@ -652,7 +652,7 @@ bool QVariantToVARIANT(const QVariant &var, VARIANT &arg, const QByteArray &type
}
}
break;
-
+
#ifdef QAX_SERVER
case QVariant::Rect:
case QVariant::Size:
@@ -668,7 +668,7 @@ bool QVariantToVARIANT(const QVariant &var, VARIANT &arg, const QByteArray &type
}
if (!pGetRecordInfoFromTypeInfo)
break;
-
+
ITypeInfo *typeInfo = 0;
IRecordInfo *recordInfo = 0;
CLSID clsid = qvar.type() == QVariant::Rect ? CLSID_QRect
@@ -681,7 +681,7 @@ bool QVariantToVARIANT(const QVariant &var, VARIANT &arg, const QByteArray &type
typeInfo->Release();
if (!recordInfo)
break;
-
+
void *record = 0;
switch (qvar.type()) {
case QVariant::Rect:
@@ -705,7 +705,7 @@ bool QVariantToVARIANT(const QVariant &var, VARIANT &arg, const QByteArray &type
default:
break;
}
-
+
arg.vt = VT_RECORD;
arg.pRecInfo = recordInfo,
arg.pvRecord = record;
@@ -792,11 +792,11 @@ bool QVariantToVARIANT(const QVariant &var, VARIANT &arg, const QByteArray &type
default:
return false;
}
-
+
Q_ASSERT(!out || (arg.vt & VT_BYREF));
return true;
}
-
+
/*!
Returns \a arg as a QVariant of type \a type.
@@ -968,7 +968,7 @@ QVariant VARIANTToQVariant(const VARIANT &arg, const QByteArray &typeName, uint
if (arg.pvarVal)
var = VARIANTToQVariant(*arg.pvarVal, typeName);
break;
-
+
case VT_DISPATCH:
case VT_DISPATCH|VT_BYREF:
{
@@ -1053,12 +1053,12 @@ QVariant VARIANTToQVariant(const VARIANT &arg, const QByteArray &typeName, uint
break;
case VT_ARRAY|VT_VARIANT:
case VT_ARRAY|VT_VARIANT|VT_BYREF:
- {
- SAFEARRAY *array = 0;
- if ( arg.vt & VT_BYREF )
- array = *arg.pparray;
- else
- array = arg.parray;
+ {
+ SAFEARRAY *array = 0;
+ if ( arg.vt & VT_BYREF )
+ array = *arg.pparray;
+ else
+ array = arg.parray;
UINT cDims = array ? SafeArrayGetDim(array) : 0;
switch(cDims) {
@@ -1066,19 +1066,19 @@ QVariant VARIANTToQVariant(const VARIANT &arg, const QByteArray &typeName, uint
{
QVariantList list;
- long lBound, uBound;
- SafeArrayGetLBound( array, 1, &lBound );
- SafeArrayGetUBound( array, 1, &uBound );
+ long lBound, uBound;
+ SafeArrayGetLBound( array, 1, &lBound );
+ SafeArrayGetUBound( array, 1, &uBound );
- for ( long i = lBound; i <= uBound; ++i ) {
- VARIANT var;
- VariantInit( &var );
- SafeArrayGetElement( array, &i, &var );
+ for ( long i = lBound; i <= uBound; ++i ) {
+ VARIANT var;
+ VariantInit( &var );
+ SafeArrayGetElement( array, &i, &var );
- QVariant qvar = VARIANTToQVariant( var, 0 );
- clearVARIANT( &var );
- list << qvar;
- }
+ QVariant qvar = VARIANTToQVariant( var, 0 );
+ clearVARIANT( &var );
+ list << qvar;
+ }
var = list;
}
@@ -1090,24 +1090,24 @@ QVariant VARIANTToQVariant(const VARIANT &arg, const QByteArray &typeName, uint
long dimIndices[2];
long xlBound, xuBound, ylBound, yuBound;
- SafeArrayGetLBound(array, 1, &xlBound);
- SafeArrayGetUBound(array, 1, &xuBound);
- SafeArrayGetLBound(array, 2, &ylBound);
- SafeArrayGetUBound(array, 2, &yuBound);
+ SafeArrayGetLBound(array, 1, &xlBound);
+ SafeArrayGetUBound(array, 1, &xuBound);
+ SafeArrayGetLBound(array, 2, &ylBound);
+ SafeArrayGetUBound(array, 2, &yuBound);
for (long x = xlBound; x <= xuBound; ++x) {
QVariantList list;
dimIndices[0] = x;
- for (long y = ylBound; y <= yuBound; ++y) {
- VARIANT var;
- VariantInit(&var);
+ for (long y = ylBound; y <= yuBound; ++y) {
+ VARIANT var;
+ VariantInit(&var);
dimIndices[1] = y;
- SafeArrayGetElement(array, dimIndices, &var);
+ SafeArrayGetElement(array, dimIndices, &var);
- QVariant qvar = VARIANTToQVariant(var, 0);
- clearVARIANT(&var);
- list << qvar;
+ QVariant qvar = VARIANTToQVariant(var, 0);
+ clearVARIANT(&var);
+ list << qvar;
}
listList << QVariant(list);
@@ -1119,9 +1119,9 @@ QVariant VARIANTToQVariant(const VARIANT &arg, const QByteArray &typeName, uint
var = QVariantList();
break;
}
- }
+ }
break;
-
+
case VT_ARRAY|VT_BSTR:
case VT_ARRAY|VT_BSTR|VT_BYREF:
{
@@ -1130,28 +1130,28 @@ QVariant VARIANTToQVariant(const VARIANT &arg, const QByteArray &typeName, uint
array = *arg.pparray;
else
array = arg.parray;
-
+
QStringList strings;
if (!array || array->cDims != 1) {
var = strings;
break;
}
-
+
long lBound, uBound;
SafeArrayGetLBound(array, 1, &lBound);
SafeArrayGetUBound(array, 1, &uBound);
-
+
for (long i = lBound; i <= uBound; ++i) {
BSTR bstr;
SafeArrayGetElement(array, &i, &bstr);
strings << QString::fromWCharArray(bstr);
SysFreeString(bstr);
}
-
+
var = strings;
}
break;
-
+
case VT_ARRAY|VT_UI1:
case VT_ARRAY|VT_UI1|VT_BYREF:
{
@@ -1160,17 +1160,17 @@ QVariant VARIANTToQVariant(const VARIANT &arg, const QByteArray &typeName, uint
array = *arg.pparray;
else
array = arg.parray;
-
+
QByteArray bytes;
if (!array || array->cDims != 1) {
var = bytes;
break;
}
-
+
long lBound, uBound;
SafeArrayGetLBound(array, 1, &lBound);
SafeArrayGetUBound(array, 1, &uBound);
-
+
if (uBound != -1) { // non-empty array
bytes.resize(uBound - lBound + 1);
char *data = bytes.data();
@@ -1179,11 +1179,11 @@ QVariant VARIANTToQVariant(const VARIANT &arg, const QByteArray &typeName, uint
memcpy(data, src, bytes.size());
SafeArrayUnaccessData(array);
}
-
+
var = bytes;
}
break;
-
+
#if defined(QAX_SERVER)
case VT_RECORD:
case VT_RECORD|VT_BYREF:
@@ -1192,7 +1192,7 @@ QVariant VARIANTToQVariant(const VARIANT &arg, const QByteArray &typeName, uint
void *record = arg.pvRecord;
GUID guid;
recordInfo->GetGuid(&guid);
-
+
if (guid == CLSID_QRect) {
QRect qrect;
recordInfo->RecordCopy(record, &qrect);
@@ -1211,7 +1211,7 @@ QVariant VARIANTToQVariant(const VARIANT &arg, const QByteArray &typeName, uint
#endif // QAX_SERVER
default:
#if !defined(Q_OS_WINCE)
- // support for any SAFEARRAY(Type) where Type can be converted to a QVariant
+ // support for any SAFEARRAY(Type) where Type can be converted to a QVariant
// -> QVariantList
if (arg.vt & VT_ARRAY) {
SAFEARRAY *array = 0;
@@ -1264,20 +1264,20 @@ QVariant VARIANTToQVariant(const VARIANT &arg, const QByteArray &typeName, uint
SafeArrayGetLBound( array, 1, &lBound );
SafeArrayGetUBound( array, 1, &uBound );
- for ( long i = lBound; i <= uBound; ++i ) {
+ for ( long i = lBound; i <= uBound; ++i ) {
variant.vt = vt;
- SafeArrayGetElement(array, &i, pElement);
- QVariant qvar = VARIANTToQVariant(variant, 0);
- clearVARIANT(&variant);
- list << qvar;
- }
+ SafeArrayGetElement(array, &i, pElement);
+ QVariant qvar = VARIANTToQVariant(variant, 0);
+ clearVARIANT(&variant);
+ list << qvar;
+ }
var = list;
}
#endif
break;
}
-
+
QVariant::Type proptype = (QVariant::Type)type;
if (proptype == QVariant::Invalid && !typeName.isEmpty()) {
if (typeName != "QVariant")
diff --git a/tools/dumpcpp/main.cpp b/tools/dumpcpp/main.cpp
index 0f90873..3ddb056 100644
--- a/tools/dumpcpp/main.cpp
+++ b/tools/dumpcpp/main.cpp
@@ -146,7 +146,7 @@ static QByteArray joinParameterNames(const QList<QByteArray> &parameterNames)
QByteArray constRefify(const QByteArray &type)
{
QByteArray ctype(type);
- if (type == "QString" || type == "QPixmap"
+ if (type == "QString" || type == "QPixmap"
|| type == "QVariant" || type == "QDateTime"
|| type == "QColor" || type == "QFont"
|| type == "QByteArray" || type == "QValueList<QVariant>"
@@ -260,7 +260,7 @@ void generateClassDecl(QTextStream &out, const QString &controlID, const QMetaOb
QMetaProperty property = mo->property(iprop);
if (!property.isReadable())
continue;
-
+
QByteArray propertyName(property.name());
if (propertyName == "control" || propertyName == className)
continue;
@@ -276,7 +276,7 @@ void generateClassDecl(QTextStream &out, const QString &controlID, const QMetaOb
}
// Check whether the new function conflicts with any of QAxBase public virtual functions.
- // If so, prepend the function name with '<classname>_'. Since all internal metaobject magic
+ // If so, prepend the function name with '<classname>_'. Since all internal metaobject magic
// remains the same, we have to use the original name when used with QObject::connect or QMetaObject
QByteArray propertyFunctionName(propertyName);
if (axBase_vfuncs.contains(propertyFunctionName)) {
@@ -292,7 +292,7 @@ void generateClassDecl(QTextStream &out, const QString &controlID, const QMetaOb
out << indent << "inline ";
bool foreignNamespace = true;
- if (!propertyType.contains("::") &&
+ if (!propertyType.contains("::") &&
(qax_qualified_usertypes.contains(simplePropType) || qax_qualified_usertypes.contains("enum "+ simplePropType))
) {
propertyType = nameSpace + "::" + propertyType;
@@ -339,7 +339,7 @@ void generateClassDecl(QTextStream &out, const QString &controlID, const QMetaOb
}
functions << propertyName;
-
+
if (property.isWritable()) {
QByteArray setter(propertyName);
if (isupper(setter.at(0))) {
@@ -348,12 +348,12 @@ void generateClassDecl(QTextStream &out, const QString &controlID, const QMetaOb
setter[0] = toupper(setter[0]);
setter = "set" + setter;
}
-
+
out << indent << "inline " << "void ";
if (category & OnlyInlines)
out << className << "::";
out << setter << "(" << constRefify(propertyType) << " value)";
-
+
if (!(category & NoInlines)) {
if (propertyType.endsWith('*')) {
out << "{" << endl;
@@ -429,7 +429,7 @@ void generateClassDecl(QTextStream &out, const QString &controlID, const QMetaOb
} else {
parameterSplit = slotParameters.split(',');
}
-
+
for (int i = 0; i < signatureSplit.count(); ++i) {
QByteArray parameterType = signatureSplit.at(i);
if (!parameterType.contains("::") && namespaceForType.contains(parameterType))
@@ -474,7 +474,7 @@ void generateClassDecl(QTextStream &out, const QString &controlID, const QMetaOb
} else {
out << endl;
out << indent << "{" << endl;
-
+
if (slotType != QByteArrayLiteral("void")) {
out << indent << " " << slotType << " qax_result";
if (slotType.endsWith('*'))
@@ -902,7 +902,7 @@ bool generateClass(QAxObject *object, const QByteArray &className, const QByteAr
if (!nameSpace.isEmpty() && !(category & NoDeclaration)) {
QFile outfile(QString::fromLatin1(nameSpace.toLower().constData()) + QLatin1String(".h"));
- if (!outfile.open(QIODevice::WriteOnly | QIODevice::Text)) {
+ if (!outfile.open(QIODevice::WriteOnly | QIODevice::Text)) {
qWarning("dumpcpp: Could not open output file '%s'", qPrintable(outfile.fileName()));
return false;
}
@@ -1285,8 +1285,8 @@ bool generateTypeLibrary(const QByteArray &typeLib, const QByteArray &outname, O
if (metaObject) {
currentTypeInfo = typeinfo;
QByteArray className(metaObject->className());
- if (!(typeattr->wTypeFlags & TYPEFLAG_FDUAL)
- && (metaObject->propertyCount() - metaObject->propertyOffset()) == 1
+ if (!(typeattr->wTypeFlags & TYPEFLAG_FDUAL)
+ && (metaObject->propertyCount() - metaObject->propertyOffset()) == 1
&& className.contains("Events")) {
declOut << "// skipping event interface " << className << endl << endl;
} else {
@@ -1508,10 +1508,10 @@ int main(int argc, char **argv)
GetTypeLib
} state;
state = Default;
-
+
QByteArray outname;
QByteArray typeLib;
-
+
for (int a = 1; a < argc; ++a) {
QByteArray arg(argv[a]);
const char first = arg[0];
@@ -1609,7 +1609,7 @@ int main(int argc, char **argv)
if (category == DoNothing)
return 0;
-
+
if (typeLib.isEmpty()) {
qWarning("dumpcpp: No object class or type library name provided.\n"
" Use -h for help.");
diff --git a/tools/dumpdoc/main.cpp b/tools/dumpdoc/main.cpp
index 7314086..cfa6f12 100644
--- a/tools/dumpdoc/main.cpp
+++ b/tools/dumpdoc/main.cpp
@@ -58,10 +58,10 @@ int main(int argc, char **argv)
OutOption
} state;
state = Default;
-
+
QByteArray outname;
QByteArray object;
-
+
for (int a = 1; a < argc; ++a) {
QByteArray arg(argv[a]);
const char first = arg[0];
@@ -90,12 +90,12 @@ int main(int argc, char **argv)
outname = arg;
state = Default;
break;
-
+
default:
break;
}
}
-
+
if (object.isEmpty()) {
qWarning("dumpdoc: No object name provided.\n"
" Use -h for help.");
@@ -111,19 +111,19 @@ int main(int argc, char **argv)
outfile.open(stdout, QIODevice::WriteOnly);
}
QTextStream out(&outfile);
-
+
QByteArray subobject = object;
int index = subobject.indexOf('/');
if (index != -1)
subobject = subobject.left(index);
-
+
QAxObject topobject(QString::fromLatin1(subobject.constData()));
-
+
if (topobject.isNull()) {
qWarning("dumpdoc: Could not instantiate COM object '%s'", subobject.data());
return -2;
}
-
+
QAxObject *axobject = &topobject;
while (index != -1 && axobject) {
index++;
@@ -131,18 +131,18 @@ int main(int argc, char **argv)
if (object.indexOf('/', index) != -1) {
int oldindex = index;
index = object.indexOf('/', index);
- subobject = object.mid(oldindex, index-oldindex);
+ subobject = object.mid(oldindex, index-oldindex);
} else {
index = -1;
}
-
+
axobject = axobject->querySubObject(subobject);
}
if (!axobject || axobject->isNull()) {
qWarning("dumpdoc: Subobject '%s' does not exist in '%s'", subobject.data(), object.data());
return -3;
}
-
+
QString docu = axobject->generateDocumentation();
out << docu;
return 0;
diff --git a/tools/testcon/ambientproperties.cpp b/tools/testcon/ambientproperties.cpp
index 0bf6544..d76753b 100644
--- a/tools/testcon/ambientproperties.cpp
+++ b/tools/testcon/ambientproperties.cpp
@@ -86,7 +86,7 @@ void AmbientProperties::on_buttonBackground_clicked()
p = widget->palette();
p.setColor(widget->backgroundRole(), c);
widget->setPalette(p);
- }
+ }
}
void AmbientProperties::on_buttonForeground_clicked()
@@ -113,7 +113,7 @@ void AmbientProperties::on_buttonFont_clicked()
bool ok;
QFont f = QFontDialog::getFont( &ok, fontSample->font(), this );
if ( !ok )
- return;
+ return;
fontSample->setFont( f );
container->setFont( f );
diff --git a/tools/testcon/changeproperties.cpp b/tools/testcon/changeproperties.cpp
index 41936ef..ed56759 100644
--- a/tools/testcon/changeproperties.cpp
+++ b/tools/testcon/changeproperties.cpp
@@ -75,9 +75,9 @@ void ChangeProperties::on_listProperties_currentItemChanged(QTreeWidgetItem *cur
editValue->setEnabled(current != 0);
buttonSet->setEnabled(current != 0);
valueLabel->setEnabled(current != 0);
-
+
if (!current)
- return;
+ return;
editValue->setText(current->text(2));
QString prop = current->text(0);
@@ -95,94 +95,94 @@ void ChangeProperties::on_buttonSet_clicked()
{
QTreeWidgetItem *item = listProperties->currentItem();
if (!item)
- return;
-
+ return;
+
QString prop = item->text(0);
QVariant value = activex->property(prop.toLatin1());
QVariant::Type type = value.type();
if (!value.isValid()) {
- const QMetaObject *mo = activex->metaObject();
- const QMetaProperty property = mo->property(mo->indexOfProperty(prop.toLatin1()));
- type = QVariant::nameToType(property.typeName());
+ const QMetaObject *mo = activex->metaObject();
+ const QMetaProperty property = mo->property(mo->indexOfProperty(prop.toLatin1()));
+ type = QVariant::nameToType(property.typeName());
}
switch (type) {
case QVariant::Color:
- {
- QColor col;
- col.setNamedColor(editValue->text());
- if (col.isValid()) {
- value = QVariant::fromValue(col);
- } else {
- QMessageBox::warning(this, tr("Can't parse input"),
- tr("Failed to create a color from %1\n"
- "The string has to be a valid color name (e.g. 'red')\n"
- "or a RGB triple of format '#rrggbb'."
- ).arg(editValue->text()));
- }
- }
- break;
+ {
+ QColor col;
+ col.setNamedColor(editValue->text());
+ if (col.isValid()) {
+ value = QVariant::fromValue(col);
+ } else {
+ QMessageBox::warning(this, tr("Can't parse input"),
+ tr("Failed to create a color from %1\n"
+ "The string has to be a valid color name (e.g. 'red')\n"
+ "or a RGB triple of format '#rrggbb'."
+ ).arg(editValue->text()));
+ }
+ }
+ break;
case QVariant::Font:
- {
- QFont fnt;
- if (fnt.fromString(editValue->text())) {
- value = QVariant::fromValue(fnt);
- } else {
- QMessageBox::warning(this, tr("Can't parse input"),
- tr("Failed to create a font from %1\n"
- "The string has to have a format family,<point size> or\n"
- "family,pointsize,stylehint,weight,italic,underline,strikeout,fixedpitch,rawmode."
- ).arg(editValue->text()));
- }
- }
- break;
+ {
+ QFont fnt;
+ if (fnt.fromString(editValue->text())) {
+ value = QVariant::fromValue(fnt);
+ } else {
+ QMessageBox::warning(this, tr("Can't parse input"),
+ tr("Failed to create a font from %1\n"
+ "The string has to have a format family,<point size> or\n"
+ "family,pointsize,stylehint,weight,italic,underline,strikeout,fixedpitch,rawmode."
+ ).arg(editValue->text()));
+ }
+ }
+ break;
case QVariant::Pixmap:
- {
- QString fileName = editValue->text();
- if (fileName.isEmpty())
- fileName = QFileDialog::getOpenFileName(this);
- QPixmap pm(fileName);
- if (pm.isNull())
- return;
+ {
+ QString fileName = editValue->text();
+ if (fileName.isEmpty())
+ fileName = QFileDialog::getOpenFileName(this);
+ QPixmap pm(fileName);
+ if (pm.isNull())
+ return;
- value = QVariant::fromValue(pm);
- }
- break;
+ value = QVariant::fromValue(pm);
+ }
+ break;
case QVariant::Bool:
- {
- QString txt = editValue->text().toLower();
- value = QVariant(txt != QLatin1String("0") && txt != QLatin1String("false"));
- }
- break;
+ {
+ QString txt = editValue->text().toLower();
+ value = QVariant(txt != QLatin1String("0") && txt != QLatin1String("false"));
+ }
+ break;
case QVariant::List:
- {
- QStringList txtList = editValue->text().split(QRegExp(QLatin1String("[,;]")));
- QList<QVariant> varList;
- for (int i = 0; i < txtList.count(); ++i) {
- QVariant svar(txtList.at(i));
- QString str = svar.toString();
- str = str.trimmed();
- bool ok;
- int n = str.toInt(&ok);
- if (ok) {
- varList << n;
- continue;
- }
- double d = str.toDouble(&ok);
- if (ok) {
- varList << d;
- continue;
- }
- varList << str;
- }
- value = varList;
- }
- break;
+ {
+ QStringList txtList = editValue->text().split(QRegExp(QLatin1String("[,;]")));
+ QList<QVariant> varList;
+ for (int i = 0; i < txtList.count(); ++i) {
+ QVariant svar(txtList.at(i));
+ QString str = svar.toString();
+ str = str.trimmed();
+ bool ok;
+ int n = str.toInt(&ok);
+ if (ok) {
+ varList << n;
+ continue;
+ }
+ double d = str.toDouble(&ok);
+ if (ok) {
+ varList << d;
+ continue;
+ }
+ varList << str;
+ }
+ value = varList;
+ }
+ break;
default:
- value = editValue->text();
- break;
+ value = editValue->text();
+ break;
}
-
+
Q_ASSERT(activex->setProperty(prop.toLatin1(), value));
updateProperties();
listProperties->setCurrentItem(listProperties->findItems(prop, Qt::MatchExactly).at(0));
@@ -191,7 +191,7 @@ void ChangeProperties::on_buttonSet_clicked()
void ChangeProperties::on_listEditRequests_itemChanged(QTreeWidgetItem *item)
{
if (!item)
- return;
+ return;
QString property = item->text(0);
activex->setPropertyWritable(property.toLatin1(), item->checkState(0) == Qt::Checked);
@@ -206,66 +206,66 @@ void ChangeProperties::updateProperties()
listProperties->clear();
listEditRequests->clear();
if (hasControl) {
- const QMetaObject *mo = activex->metaObject();
- const int numprops = mo->propertyCount();
- for (int i = mo->propertyOffset(); i < numprops; ++i) {
- const QMetaProperty property = mo->property(i);
- QTreeWidgetItem *item = new QTreeWidgetItem(listProperties);
- item->setText(0, QString::fromLatin1(property.name()));
- item->setText(1, QString::fromLatin1(property.typeName()));
+ const QMetaObject *mo = activex->metaObject();
+ const int numprops = mo->propertyCount();
+ for (int i = mo->propertyOffset(); i < numprops; ++i) {
+ const QMetaProperty property = mo->property(i);
+ QTreeWidgetItem *item = new QTreeWidgetItem(listProperties);
+ item->setText(0, QString::fromLatin1(property.name()));
+ item->setText(1, QString::fromLatin1(property.typeName()));
if (!property.isDesignable()) {
item->setTextColor(0, Qt::gray);
item->setTextColor(1, Qt::gray);
item->setTextColor(2, Qt::gray);
}
- QVariant var = activex->property(property.name());
-
- switch (var.type()) {
- case QVariant::Color:
- {
- QColor col = qvariant_cast<QColor>(var);
- item->setText(2, col.name());
- }
- break;
- case QVariant::Font:
- {
- QFont fnt = qvariant_cast<QFont>(var);
- item->setText(2, fnt.toString());
- }
- break;
- case QVariant::Bool:
- {
- item->setText(2, var.toBool() ? QLatin1String("true") : QLatin1String("false"));
- }
- break;
- case QVariant::Pixmap:
- {
- QPixmap pm = qvariant_cast<QPixmap>(var);
- item->setIcon(2, pm);
- }
- break;
- case QVariant::List:
- {
- QList<QVariant> varList = var.toList();
- QStringList strList;
- for (int i = 0; i < varList.count(); ++i) {
- QVariant var = varList.at(i);
- strList << var.toString();
- }
- item->setText(2, strList.join(QLatin1String(", ")));
- }
- break;
- case QVariant::Int:
- if (property.isEnumType()) {
- const QMetaEnum enumerator = mo->enumerator(mo->indexOfEnumerator(property.typeName()));
- item->setText(2, QString::fromLatin1(enumerator.valueToKey(var.toInt())));
- break;
- }
- //FALLTHROUGH
- default:
- item->setText(2, var.toString());
- break;
- }
+ QVariant var = activex->property(property.name());
+
+ switch (var.type()) {
+ case QVariant::Color:
+ {
+ QColor col = qvariant_cast<QColor>(var);
+ item->setText(2, col.name());
+ }
+ break;
+ case QVariant::Font:
+ {
+ QFont fnt = qvariant_cast<QFont>(var);
+ item->setText(2, fnt.toString());
+ }
+ break;
+ case QVariant::Bool:
+ {
+ item->setText(2, var.toBool() ? QLatin1String("true") : QLatin1String("false"));
+ }
+ break;
+ case QVariant::Pixmap:
+ {
+ QPixmap pm = qvariant_cast<QPixmap>(var);
+ item->setIcon(2, pm);
+ }
+ break;
+ case QVariant::List:
+ {
+ QList<QVariant> varList = var.toList();
+ QStringList strList;
+ for (int i = 0; i < varList.count(); ++i) {
+ QVariant var = varList.at(i);
+ strList << var.toString();
+ }
+ item->setText(2, strList.join(QLatin1String(", ")));
+ }
+ break;
+ case QVariant::Int:
+ if (property.isEnumType()) {
+ const QMetaEnum enumerator = mo->enumerator(mo->indexOfEnumerator(property.typeName()));
+ item->setText(2, QString::fromLatin1(enumerator.valueToKey(var.toInt())));
+ break;
+ }
+ //FALLTHROUGH
+ default:
+ item->setText(2, var.toString());
+ break;
+ }
bool requesting = false;
#if 0
@@ -275,11 +275,11 @@ void ChangeProperties::updateProperties()
}
#endif
if (requesting) {
- QTreeWidgetItem *check = new QTreeWidgetItem(listEditRequests);
+ QTreeWidgetItem *check = new QTreeWidgetItem(listEditRequests);
check->setText(0, QString::fromLatin1(property.name()));
check->setCheckState(0, activex->propertyWritable(property.name()) ? Qt::Checked : Qt::Unchecked);
- }
- }
+ }
+ }
listProperties->setCurrentItem(listProperties->topLevelItem(0));
} else {
editValue->clear();
diff --git a/tools/testcon/controlinfo.cpp b/tools/testcon/controlinfo.cpp
index bb7e0f2..645595f 100644
--- a/tools/testcon/controlinfo.cpp
+++ b/tools/testcon/controlinfo.cpp
@@ -68,8 +68,8 @@ void ControlInfo::setControl(QWidget *activex)
int i;
int count;
for (i = mo->classInfoOffset(); i < mo->classInfoCount(); ++i) {
- const QMetaClassInfo info = mo->classInfo(i);
- item = new QTreeWidgetItem(group);
+ const QMetaClassInfo info = mo->classInfo(i);
+ item = new QTreeWidgetItem(group);
item->setText(0, QString::fromLatin1(info.name()));
item->setText(1, QString::fromLatin1(info.value()));
}
@@ -78,10 +78,10 @@ void ControlInfo::setControl(QWidget *activex)
count = 0;
for (i = mo->methodOffset(); i < mo->methodCount(); ++i) {
- const QMetaMethod method = mo->method(i);
+ const QMetaMethod method = mo->method(i);
if (method.methodType() == QMetaMethod::Signal) {
++count;
- item = new QTreeWidgetItem(group);
+ item = new QTreeWidgetItem(group);
item->setText(0, QString::fromLatin1(method.methodSignature()));
}
}
@@ -92,10 +92,10 @@ void ControlInfo::setControl(QWidget *activex)
count = 0;
for (i = mo->methodOffset(); i < mo->methodCount(); ++i) {
- const QMetaMethod method = mo->method(i);
+ const QMetaMethod method = mo->method(i);
if (method.methodType() == QMetaMethod::Slot) {
++count;
- item = new QTreeWidgetItem(group);
+ item = new QTreeWidgetItem(group);
item->setText(0, QString::fromLatin1(method.methodSignature()));
}
}
@@ -107,8 +107,8 @@ void ControlInfo::setControl(QWidget *activex)
count = 0;
for (i = mo->propertyOffset(); i < mo->propertyCount(); ++i) {
++count;
- const QMetaProperty property = mo->property(i);
- item = new QTreeWidgetItem(group);
+ const QMetaProperty property = mo->property(i);
+ item = new QTreeWidgetItem(group);
item->setText(0, QString::fromLatin1(property.name()));
item->setText(1, QString::fromLatin1(property.typeName()));
if (!property.isDesignable()) {
diff --git a/tools/testcon/docuwindow.cpp b/tools/testcon/docuwindow.cpp
index cdeee74..54e4ef0 100644
--- a/tools/testcon/docuwindow.cpp
+++ b/tools/testcon/docuwindow.cpp
@@ -122,13 +122,13 @@ void DocuWindow::save()
QString filename = QFileDialog::getSaveFileName(this);
if (filename.isEmpty())
- return;
+ return;
QString text = browser->document()->toHtml();
QFile f(filename);
if (!f.open(QIODevice::WriteOnly)) {
- statusBar()->showMessage(tr("Could not write to %1").arg(filename), 2000);
- return;
+ statusBar()->showMessage(tr("Could not write to %1").arg(filename), 2000);
+ return;
}
QTextStream t(&f);
@@ -145,14 +145,14 @@ void DocuWindow::print()
#else
QPrinter printer;
if (printer.printerName().isEmpty()) {
- statusBar()->showMessage(tr("No printer installed"), 2000);
- return;
+ statusBar()->showMessage(tr("No printer installed"), 2000);
+ return;
}
QPrintDialog printDialog(&printer, this);
if (!printDialog.exec()) {
- statusBar()->showMessage(tr("Printing aborted"), 2000);
- return;
+ statusBar()->showMessage(tr("Printing aborted"), 2000);
+ return;
}
browser->document()->print(&printer);
diff --git a/tools/testcon/invokemethod.cpp b/tools/testcon/invokemethod.cpp
index a3f587e..82673c1 100644
--- a/tools/testcon/invokemethod.cpp
+++ b/tools/testcon/invokemethod.cpp
@@ -65,32 +65,32 @@ void InvokeMethod::setControl(QAxBase *ax)
comboMethods->setEnabled(hasControl);
buttonInvoke->setEnabled(hasControl);
boxParameters->setEnabled(hasControl);
-
+
comboMethods->clear();
listParameters->clear();
-
+
if (!hasControl) {
- editValue->clear();
- return;
+ editValue->clear();
+ return;
}
const QMetaObject *mo = activex->metaObject();
if (mo->methodCount()) {
- for (int i = mo->methodOffset(); i < mo->methodCount(); ++i) {
- const QMetaMethod method = mo->method(i);
+ for (int i = mo->methodOffset(); i < mo->methodCount(); ++i) {
+ const QMetaMethod method = mo->method(i);
if (method.methodType() == QMetaMethod::Slot)
comboMethods->addItem(QString::fromLatin1(method.methodSignature()));
- }
+ }
comboMethods->model()->sort(0);
- on_comboMethods_activated(comboMethods->currentText());
+ on_comboMethods_activated(comboMethods->currentText());
}
}
void InvokeMethod::on_buttonInvoke_clicked()
{
if (!activex)
- return;
+ return;
on_buttonSet_clicked();
QString method = comboMethods->currentText();
@@ -98,15 +98,15 @@ void InvokeMethod::on_buttonInvoke_clicked()
int itemCount = listParameters->topLevelItemCount();
for (int i = 0; i < itemCount; ++i) {
- QTreeWidgetItem *parameter = listParameters->topLevelItem(i);
- vars << parameter->text(2);
+ QTreeWidgetItem *parameter = listParameters->topLevelItem(i);
+ vars << parameter->text(2);
}
QVariant result = activex->dynamicCall(method.toLatin1(), vars);
int v = 0;
for (int i = 0; i < itemCount; ++i) {
- QTreeWidgetItem *parameter = listParameters->topLevelItem(i);
- parameter->setText(2, vars[v++].toString());
+ QTreeWidgetItem *parameter = listParameters->topLevelItem(i);
+ parameter->setText(2, vars[v++].toString());
}
QString resString = result.toString();
@@ -117,7 +117,7 @@ void InvokeMethod::on_buttonInvoke_clicked()
void InvokeMethod::on_comboMethods_activated(const QString &method)
{
if (!activex)
- return;
+ return;
listParameters->clear();
const QMetaObject *mo = activex->metaObject();
@@ -130,40 +130,40 @@ void InvokeMethod::on_comboMethods_activated(const QString &method)
QList<QByteArray> ptypes = slot.parameterTypes();
for (int p = 0; p < ptypes.count(); ++p) {
- QString ptype(QString::fromLatin1(ptypes.at(p)));
- if (ptype.isEmpty())
- continue;
- QString pname(QString::fromLatin1(pnames.at(p).constData()));
- if (pname.isEmpty())
- pname = QString::fromLatin1("<unnamed %1>").arg(p);
- QTreeWidgetItem *item = new QTreeWidgetItem(listParameters);
+ QString ptype(QString::fromLatin1(ptypes.at(p)));
+ if (ptype.isEmpty())
+ continue;
+ QString pname(QString::fromLatin1(pnames.at(p).constData()));
+ if (pname.isEmpty())
+ pname = QString::fromLatin1("<unnamed %1>").arg(p);
+ QTreeWidgetItem *item = new QTreeWidgetItem(listParameters);
item->setText(0, pname);
item->setText(1, ptype);
}
if (listParameters->topLevelItemCount())
- listParameters->setCurrentItem(listParameters->topLevelItem(0));
+ listParameters->setCurrentItem(listParameters->topLevelItem(0));
editReturn->setText(QString::fromLatin1(slot.typeName()));
}
void InvokeMethod::on_listParameters_currentItemChanged(QTreeWidgetItem *item)
{
if (!activex)
- return;
+ return;
editValue->setEnabled(item != 0);
buttonSet->setEnabled(item != 0);
if (!item)
- return;
+ return;
editValue->setText(item->text(2));
}
void InvokeMethod::on_buttonSet_clicked()
{
if (!activex)
- return;
+ return;
QTreeWidgetItem *item = listParameters->currentItem();
if (!item)
- return;
+ return;
item->setText(2, editValue->text());
}
diff --git a/tools/testcon/main.cpp b/tools/testcon/main.cpp
index bc3181c..1ecb0b4 100644
--- a/tools/testcon/main.cpp
+++ b/tools/testcon/main.cpp
@@ -45,15 +45,15 @@
#include <QAxFactory>
QAXFACTORY_DEFAULT(MainWindow,
- QLatin1String("{5f5ce700-48a8-47b1-9b06-3b7f79e41d7c}"),
- QLatin1String("{3fc86f5f-8b15-4428-8f6b-482bae91f1ae}"),
- QLatin1String("{02a268cd-24b4-4fd9-88ff-b01b683ef39d}"),
- QLatin1String("{4a43e44d-9d1d-47e5-a1e5-58fe6f7be0a4}"),
- QLatin1String("{16ee5998-77d2-412f-ad91-8596e29f123f}"))
+ QLatin1String("{5f5ce700-48a8-47b1-9b06-3b7f79e41d7c}"),
+ QLatin1String("{3fc86f5f-8b15-4428-8f6b-482bae91f1ae}"),
+ QLatin1String("{02a268cd-24b4-4fd9-88ff-b01b683ef39d}"),
+ QLatin1String("{4a43e44d-9d1d-47e5-a1e5-58fe6f7be0a4}"),
+ QLatin1String("{16ee5998-77d2-412f-ad91-8596e29f123f}"))
QT_USE_NAMESPACE
-int main( int argc, char **argv )
+int main( int argc, char **argv )
{
QApplication app( argc, argv );
diff --git a/tools/testcon/mainwindow.cpp b/tools/testcon/mainwindow.cpp
index cb3c00e..4f60d1f 100644
--- a/tools/testcon/mainwindow.cpp
+++ b/tools/testcon/mainwindow.cpp
@@ -136,12 +136,12 @@ void MainWindow::on_actionFileLoad_triggered()
{
QString fname = QFileDialog::getOpenFileName(this, tr("Load"), QString(), QLatin1String("*.qax"));
if (fname.isEmpty())
- return;
+ return;
QFile file(fname);
if (!file.open(QIODevice::ReadOnly)) {
- QMessageBox::information(this, tr("Error Loading File"), tr("The file could not be opened for reading.\n%1").arg(fname));
- return;
+ QMessageBox::information(this, tr("Error Loading File"), tr("The file could not be opened for reading.\n%1").arg(fname));
+ return;
}
QAxWidget *container = new QAxWidget(mdiArea);
@@ -164,12 +164,12 @@ void MainWindow::on_actionFileSave_triggered()
QString fname = QFileDialog::getSaveFileName(this, tr("Save"), QString(), QLatin1String("*.qax"));
if (fname.isEmpty())
- return;
+ return;
QFile file(fname);
if (!file.open(QIODevice::WriteOnly)) {
- QMessageBox::information(this, tr("Error Saving File"), tr("The file could not be opened for writing.\n%1").arg(fname));
- return;
+ QMessageBox::information(this, tr("Error Saving File"), tr("The file could not be opened for writing.\n%1").arg(fname));
+ return;
}
QDataStream d(&file);
d << *container;
@@ -184,7 +184,7 @@ void MainWindow::on_actionContainerSet_triggered()
QAxSelect select(this);
if (select.exec())
- container->setControl(select.clsid());
+ container->setControl(select.clsid());
updateGUI();
}
@@ -192,14 +192,14 @@ void MainWindow::on_actionContainerClear_triggered()
{
QAxWidget *container = activeAxWidget();
if (container)
- container->clear();
+ container->clear();
updateGUI();
}
void MainWindow::on_actionContainerProperties_triggered()
{
if (!dlgAmbient) {
- dlgAmbient = new AmbientProperties(this);
+ dlgAmbient = new AmbientProperties(this);
dlgAmbient->setControl(mdiArea);
}
dlgAmbient->show();
@@ -224,8 +224,8 @@ void MainWindow::on_actionControlProperties_triggered()
return;
if (!dlgProperties) {
- dlgProperties = new ChangeProperties(this);
- connect(container, SIGNAL(propertyChanged(QString)), dlgProperties, SLOT(updateProperties()));
+ dlgProperties = new ChangeProperties(this);
+ connect(container, SIGNAL(propertyChanged(QString)), dlgProperties, SLOT(updateProperties()));
}
dlgProperties->setControl(container);
dlgProperties->show();
@@ -238,7 +238,7 @@ void MainWindow::on_actionControlMethods_triggered()
return;
if (!dlgInvoke)
- dlgInvoke = new InvokeMethod(this);
+ dlgInvoke = new InvokeMethod(this);
dlgInvoke->setControl(container);
dlgInvoke->show();
}
@@ -275,10 +275,10 @@ void MainWindow::on_actionControlDocumentation_triggered()
QAxWidget *container = activeAxWidget();
if (!container)
return;
-
+
const QString docu = container->generateDocumentation();
if (docu.isEmpty())
- return;
+ return;
DocuWindow *docwindow = new DocuWindow(docu);
QMdiSubWindow *subWindow = mdiArea->addSubWindow(docwindow);
@@ -303,16 +303,16 @@ void MainWindow::on_actionScriptingRun_triggered()
{
#ifndef QT_NO_QAXSCRIPT
if (!scripts)
- return;
+ return;
// If we have only one script loaded we can use the cool dialog
QStringList scriptList = scripts->scriptNames();
if (scriptList.count() == 1) {
- InvokeMethod scriptInvoke(this);
- scriptInvoke.setWindowTitle(tr("Execute Script Function"));
- scriptInvoke.setControl(scripts->script(scriptList[0])->scriptEngine());
- scriptInvoke.exec();
- return;
+ InvokeMethod scriptInvoke(this);
+ scriptInvoke.setWindowTitle(tr("Execute Script Function"));
+ scriptInvoke.setControl(scripts->script(scriptList[0])->scriptEngine());
+ scriptInvoke.exec();
+ return;
}
bool ok = false;
@@ -320,11 +320,11 @@ void MainWindow::on_actionScriptingRun_triggered()
QString macro = QInputDialog::getItem(this, tr("Select Macro"), tr("Macro:"), macroList, 0, true, &ok);
if (!ok)
- return;
+ return;
QVariant result = scripts->call(macro);
if (result.isValid())
- logMacros->append(tr("Return value of %1: %2").arg(macro).arg(result.toString()));
+ logMacros->append(tr("Return value of %1: %2").arg(macro).arg(result.toString()));
#endif
}
@@ -334,11 +334,11 @@ void MainWindow::on_actionScriptingLoad_triggered()
QString file = QFileDialog::getOpenFileName(this, tr("Open Script"), QString(), QAxScriptManager::scriptFileFilter());
if (file.isEmpty())
- return;
+ return;
if (!scripts) {
- scripts = new QAxScriptManager(this);
- scripts->addObject(this);
+ scripts = new QAxScriptManager(this);
+ scripts->addObject(this);
}
foreach (QAxWidget *axWidget, axWidgets()) {
@@ -348,13 +348,13 @@ void MainWindow::on_actionScriptingLoad_triggered()
QAxScript *script = scripts->load(file, file);
if (script) {
- connect(script, SIGNAL(error(int,QString,int,QString)),
- this, SLOT(logMacro(int,QString,int,QString)));
- actionScriptingRun->setEnabled(true);
+ connect(script, SIGNAL(error(int,QString,int,QString)),
+ this, SLOT(logMacro(int,QString,int,QString)));
+ actionScriptingRun->setEnabled(true);
}
#else
QMessageBox::information(this, tr("Function not available"),
- tr("QAxScript functionality is not available with this compiler."));
+ tr("QAxScript functionality is not available with this compiler."));
#endif
}
@@ -375,24 +375,24 @@ void MainWindow::updateGUI()
actionControlPixmap->setEnabled(hasControl);
VerbMenu->setEnabled(hasControl);
if (dlgInvoke)
- dlgInvoke->setControl(hasControl ? container : 0);
+ dlgInvoke->setControl(hasControl ? container : 0);
if (dlgProperties)
- dlgProperties->setControl(hasControl ? container : 0);
+ dlgProperties->setControl(hasControl ? container : 0);
foreach (QAxWidget *container, axWidgets()) {
container->disconnect(SIGNAL(signal(QString,int,void*)));
- if (actionLogSignals->isChecked())
- connect(container, SIGNAL(signal(QString,int,void*)), this, SLOT(logSignal(QString,int,void*)));
-
- container->disconnect(SIGNAL(exception(int,QString,QString,QString)));
- connect(container, SIGNAL(exception(int,QString,QString,QString)),
- this, SLOT(logException(int,QString,QString,QString)));
-
- container->disconnect(SIGNAL(propertyChanged(QString)));
- if (actionLogProperties->isChecked())
- connect(container, SIGNAL(propertyChanged(QString)), this, SLOT(logPropertyChanged(QString)));
- container->blockSignals(actionFreezeEvents->isChecked());
- }
+ if (actionLogSignals->isChecked())
+ connect(container, SIGNAL(signal(QString,int,void*)), this, SLOT(logSignal(QString,int,void*)));
+
+ container->disconnect(SIGNAL(exception(int,QString,QString,QString)));
+ connect(container, SIGNAL(exception(int,QString,QString,QString)),
+ this, SLOT(logException(int,QString,QString,QString)));
+
+ container->disconnect(SIGNAL(propertyChanged(QString)));
+ if (actionLogProperties->isChecked())
+ connect(container, SIGNAL(propertyChanged(QString)), this, SLOT(logPropertyChanged(QString)));
+ container->blockSignals(actionFreezeEvents->isChecked());
+ }
}
void MainWindow::logPropertyChanged(const QString &prop)
@@ -414,17 +414,17 @@ void MainWindow::logSignal(const QString &signal, int argc, void *argv)
QString paramlist;
VARIANT *params = (VARIANT*)argv;
for (int a = argc-1; a >= 0; --a) {
- if (a == argc-1)
- paramlist = QLatin1String(" - {");
- QVariant qvar = VARIANTToQVariant(params[a], 0);
- paramlist += QLatin1String(" ") + qvar.toString();
- if (a > 0)
- paramlist += QLatin1String(",");
- else
- paramlist += QLatin1String(" ");
+ if (a == argc-1)
+ paramlist = QLatin1String(" - {");
+ QVariant qvar = VARIANTToQVariant(params[a], 0);
+ paramlist += QLatin1String(" ") + qvar.toString();
+ if (a > 0)
+ paramlist += QLatin1String(",");
+ else
+ paramlist += QLatin1String(" ");
}
if (argc)
- paramlist += QLatin1String("}");
+ paramlist += QLatin1String("}");
logSignals->append(container->windowTitle() + QLatin1String(": ") + signal + paramlist);
}
@@ -436,14 +436,14 @@ void MainWindow::logException(int code, const QString&source, const QString&desc
return;
QString str = tr("%1: Exception code %2 thrown by %3").
- arg(container->windowTitle()).arg(code).arg(source);
+ arg(container->windowTitle()).arg(code).arg(source);
logDebug->append(str);
logDebug->append(tr("\tDescription: %1").arg(desc));
if (!help.isEmpty())
- logDebug->append(tr("\tHelp available at %1").arg(help));
+ logDebug->append(tr("\tHelp available at %1").arg(help));
else
- logDebug->append(tr("\tNo help available."));
+ logDebug->append(tr("\tNo help available."));
}
void MainWindow::logMacro(int code, const QString &description, int sourcePosition, const QString &sourceText)
@@ -452,12 +452,12 @@ void MainWindow::logMacro(int code, const QString &description, int sourcePositi
* that it can be translated in a sane way. */
QString message = tr("Script: ");
if (code)
- message += QString::number(code) + QLatin1String(" ");
+ message += QString::number(code) + QLatin1String(" ");
message += QLatin1String("'") + description + QLatin1String("'");
if (sourcePosition)
- message += tr(" at position ") + QString::number(sourcePosition);
+ message += tr(" at position ") + QString::number(sourcePosition);
if (!sourceText.isEmpty())
- message += QLatin1String(" '") + sourceText + QLatin1String("'");
+ message += QLatin1String(" '") + sourceText + QLatin1String("'");
logMacros->append(message);
}
diff --git a/tools/testcon/scripts/javascript.js b/tools/testcon/scripts/javascript.js
index e2bd54b..afa3af9 100644
--- a/tools/testcon/scripts/javascript.js
+++ b/tools/testcon/scripts/javascript.js
@@ -1,25 +1,25 @@
function QAxWidget2::Click()
{
- QAxWidget2.lineWidth++;
- MainWindow.logMacro(0, "Hello from JavaScript: QAxWidget2::Click", 0, "");
+ QAxWidget2.lineWidth++;
+ MainWindow.logMacro(0, "Hello from JavaScript: QAxWidget2::Click", 0, "");
}
function fatLines()
{
- QAxWidget2.lineWidth = 25;
+ QAxWidget2.lineWidth = 25;
}
function thinLines()
{
- QAxWidget2.lineWidth = 1;
+ QAxWidget2.lineWidth = 1;
}
function setLineWidth(width)
{
- QAxWidget2.lineWidth = width;
+ QAxWidget2.lineWidth = width;
}
function getLineWidth()
{
- return(QAxWidget2.lineWidth)
+ return(QAxWidget2.lineWidth)
}
diff --git a/tools/testcon/scripts/perlscript.pl b/tools/testcon/scripts/perlscript.pl
index 87c3774..ffc36b8 100644
--- a/tools/testcon/scripts/perlscript.pl
+++ b/tools/testcon/scripts/perlscript.pl
@@ -40,26 +40,26 @@
#############################################################################
sub QAxWidget2_Click {
- $QAxWidget2->{'lineWidth'} = $QAxWidget2->{'lineWidth'} + 1;
- $MainWindow->logMacro(0, "Hello from Perl: QAxWidget2_Click", 0, "");
+ $QAxWidget2->{'lineWidth'} = $QAxWidget2->{'lineWidth'} + 1;
+ $MainWindow->logMacro(0, "Hello from Perl: QAxWidget2_Click", 0, "");
}
sub fatLines
{
- $QAxWidget2->{'lineWidth'} = 25;
+ $QAxWidget2->{'lineWidth'} = 25;
}
sub thinLines
{
- $QAxWidget2->{'lineWidth'} = 1;
+ $QAxWidget2->{'lineWidth'} = 1;
}
sub setLineWidth(width)
{
- $QAxWidget2->{'lineWidth'} = width;
+ $QAxWidget2->{'lineWidth'} = width;
}
sub getLineWidth()
{
- return $QAxWidget2->{'lineWidth'};
+ return $QAxWidget2->{'lineWidth'};
}
diff --git a/tools/testcon/scripts/vbscript.vbs b/tools/testcon/scripts/vbscript.vbs
index bd29f19..9554de9 100644
--- a/tools/testcon/scripts/vbscript.vbs
+++ b/tools/testcon/scripts/vbscript.vbs
@@ -1,20 +1,20 @@
Sub QAxWidget2_Click
- QAxWidget2.lineWidth = QAxWidget2.lineWidth + 1
- MainWindow.logMacro 0, "Hello from VBScript: QAxWidget2_Click", 0, ""
+ QAxWidget2.lineWidth = QAxWidget2.lineWidth + 1
+ MainWindow.logMacro 0, "Hello from VBScript: QAxWidget2_Click", 0, ""
End Sub
Sub fatLines
- QAxWidget2.lineWidth = 25
+ QAxWidget2.lineWidth = 25
End Sub
Sub thinLines
- QAxWidget2.lineWidth = 1
+ QAxWidget2.lineWidth = 1
End Sub
Sub setLineWidth(width)
- QAxWidget2.lineWidth = width
+ QAxWidget2.lineWidth = width
End Sub
Public Function getLineWidth
- getLineWidth = QAxWidget2.lineWidth
+ getLineWidth = QAxWidget2.lineWidth
End Function
diff --git a/tools/testcon/testcon.pro b/tools/testcon/testcon.pro
index 4c27638..a963c42 100644
--- a/tools/testcon/testcon.pro
+++ b/tools/testcon/testcon.pro
@@ -3,10 +3,10 @@ TEMPLATE = app
CONFIG += qaxserver_no_postlink
QT += widgets axserver axcontainer printsupport
-SOURCES = main.cpp docuwindow.cpp mainwindow.cpp invokemethod.cpp changeproperties.cpp ambientproperties.cpp controlinfo.cpp
-HEADERS = docuwindow.h mainwindow.h invokemethod.h changeproperties.h ambientproperties.h controlinfo.h
+SOURCES = main.cpp docuwindow.cpp mainwindow.cpp invokemethod.cpp changeproperties.cpp ambientproperties.cpp controlinfo.cpp
+HEADERS = docuwindow.h mainwindow.h invokemethod.h changeproperties.h ambientproperties.h controlinfo.h
FORMS = mainwindow.ui invokemethod.ui changeproperties.ui ambientproperties.ui controlinfo.ui
-RC_FILE = testcon.rc
+RC_FILE = testcon.rc
!win32-g++*:QMAKE_POST_LINK = midl $$shell_quote($$shell_path($$PWD/testcon.idl)) && move testcon.tlb $(TARGETDIR)
diff --git a/tools/tools.pro b/tools/tools.pro
index 5f900a9..4a83738 100644
--- a/tools/tools.pro
+++ b/tools/tools.pro
@@ -1,6 +1,6 @@
TEMPLATE = subdirs
-CONFIG += ordered
+CONFIG += ordered
SUBDIRS = dumpdoc \
dumpcpp \