Commit 333e9fae authored by Martin Pfeiffer's avatar Martin Pfeiffer
Browse files

make it compile - remove deprecated warnings - how to make symbolaction.cc compile

svn path=/trunk/koffice/; revision=530156
parent 18b6d35d
......@@ -19,7 +19,7 @@
*/
#include <iostream>
#include <qpainter.h>
#include <QPainter>
//Added by qt3to4:
#include <QKeyEvent>
......@@ -274,7 +274,7 @@ bool FormulaElement::readContentFromDom(QDomNode& node)
void FormulaElement::convertNames( QDomNode node )
{
if ( node.isElement() && ( node.nodeName().upper() == "TEXT" ) ) {
if ( node.isElement() && ( node.nodeName().toUpper() == "TEXT" ) ) {
QDomNamedNodeMap attr = node.attributes();
QDomAttr ch = attr.namedItem( "CHAR" ).toAttr();
if ( ch.value() == "\\" ) {
......@@ -287,7 +287,7 @@ void FormulaElement::convertNames( QDomNode node )
while ( inName ) {
inName = false;
QDomNode n = nameseq.nextSibling();
if ( n.isElement() && ( n.nodeName().upper() == "TEXT" ) ) {
if ( n.isElement() && ( n.nodeName().toUpper() == "TEXT" ) ) {
attr = n.attributes();
ch = attr.namedItem( "CHAR" ).toAttr();
if ( ch.value().at( 0 ).isLetter() ) {
......
......@@ -18,7 +18,7 @@
* Boston, MA 02110-1301, USA.
*/
#include <qpainter.h>
#include <QPainter>
//Added by qt3to4:
#include <Q3PtrList>
......@@ -432,7 +432,7 @@ void IndexElement::calcSizes(const ContextStyle& style, ContextStyle::TextStyle
if (content->isTextOnly()) {
luPt mySize = style.getAdjustedSize( tstyle );
QFont font = style.getDefaultFont();
font.setPointSizeFloat( style.layoutUnitPtToPt( mySize ) );
font.setPointSizeF( style.layoutUnitPtToPt( mySize ) );
QFontMetrics fm(font);
LuPixelRect bound = fm.boundingRect('x');
......@@ -1264,32 +1264,32 @@ bool IndexElement::readContentFromDom(QDomNode& node)
!(upperLeftRead && upperMiddleRead && upperRightRead &&
lowerLeftRead && lowerMiddleRead && lowerRightRead)) {
if (!upperLeftRead && (node.nodeName().upper() == "UPPERLEFT")) {
if (!upperLeftRead && (node.nodeName().toUpper() == "UPPERLEFT")) {
upperLeftRead = buildChild( upperLeft=new SequenceElement( this ), node, "UPPERLEFT" );
if ( !upperLeftRead ) return false;
}
if (!upperMiddleRead && (node.nodeName().upper() == "UPPERMIDDLE")) {
if (!upperMiddleRead && (node.nodeName().toUpper() == "UPPERMIDDLE")) {
upperMiddleRead = buildChild( upperMiddle=new SequenceElement( this ), node, "UPPERMIDDLE" );
if ( !upperMiddleRead ) return false;
}
if (!upperRightRead && (node.nodeName().upper() == "UPPERRIGHT")) {
if (!upperRightRead && (node.nodeName().toUpper() == "UPPERRIGHT")) {
upperRightRead = buildChild( upperRight=new SequenceElement( this ), node, "UPPERRIGHT" );
if ( !upperRightRead ) return false;
}
if (!lowerLeftRead && (node.nodeName().upper() == "LOWERLEFT")) {
if (!lowerLeftRead && (node.nodeName().toUpper() == "LOWERLEFT")) {
lowerLeftRead = buildChild( lowerLeft=new SequenceElement( this ), node, "LOWERLEFT" );
if ( !lowerLeftRead ) return false;
}
if (!lowerMiddleRead && (node.nodeName().upper() == "LOWERMIDDLE")) {
if (!lowerMiddleRead && (node.nodeName().toUpper() == "LOWERMIDDLE")) {
lowerMiddleRead = buildChild( lowerMiddle=new SequenceElement( this ), node, "LOWERMIDDLE" );
if ( !lowerMiddleRead ) return false;
}
if (!lowerRightRead && (node.nodeName().upper() == "LOWERRIGHT")) {
if (!lowerRightRead && (node.nodeName().toUpper() == "LOWERRIGHT")) {
lowerRightRead = buildChild( lowerRight=new SequenceElement( this ), node, "LOWERRIGHT" );
if ( !lowerRightRead ) return false;
}
......
......@@ -20,8 +20,7 @@
#ifndef KFORMULACOMPATIBILITY_H
#define KFORMULACOMPATIBILITY_H
#include <qdom.h>
#include <qstring.h>
#include <QString>
KFORMULA_NAMESPACE_BEGIN
......@@ -66,7 +65,7 @@ private:
/**
* current pos
*/
uint pos;
int pos;
};
KFORMULA_NAMESPACE_END
......
......@@ -18,14 +18,13 @@
* Boston, MA 02110-1301, USA.
*/
#include <qapplication.h>
#include <qdom.h>
#include <qevent.h>
#include <qfile.h>
#include <qpainter.h>
#include <qpixmap.h>
#include <qstring.h>
#include <qtextstream.h>
#include <QApplication>
#include <QEvent>
#include <QFile>
#include <QPainter>
#include <QPixmap>
#include <QString>
#include <QTextStream>
//Added by qt3to4:
#include <Q3PtrList>
#include <QKeyEvent>
......@@ -295,9 +294,9 @@ const SymbolTable& Container::getSymbolTable() const
}
void Container::draw( QPainter& painter, const QRect& r, const QColorGroup& cg, bool edit )
void Container::draw( QPainter& painter, const QRect& r, const QPalette& palette, bool edit )
{
painter.fillRect( r, cg.base() );
painter.fillRect( r, palette.base() );
draw( painter, r, edit );
}
......@@ -343,9 +342,10 @@ void Container::paste()
if (!hasValidCursor())
return;
QClipboard* clipboard = QApplication::clipboard();
const QMimeSource* source = clipboard->data();
if (source->provides( MimeSource::selectionMimeType() )) {
QByteArray data = source->encodedData( MimeSource::selectionMimeType() );
const QMimeData* source = clipboard->mimeData();
if (source->hasFormat( MimeSource::selectionMimeType() ))
{
QByteArray data = source->data( MimeSource::selectionMimeType() );
QDomDocument formula;
formula.setContent(data);
paste( formula, i18n("Paste") );
......@@ -374,11 +374,14 @@ void Container::copy()
{
// read-only cursors are fine for copying.
FormulaCursor* cursor = activeCursor();
if (cursor != 0) {
if (cursor != 0)
{
QDomDocument formula = document()->createDomDocument();
cursor->copy( formula );
QClipboard* clipboard = QApplication::clipboard();
clipboard->setData(new MimeSource(document(), formula));
QMimeData* data = new QMimeData();
data->setData(MimeSource::selectionMimeType(), formula.toByteArray() );
clipboard->setMimeData( data );
}
}
......@@ -607,7 +610,7 @@ QImage Container::drawImage( int width, int height )
paint.end();
context.setZoomAndResolution( oldZoom, KoGlobal::dpiX(), KoGlobal::dpiY() );
//return pm.convertToImage().smoothScale( width, height );
return pm.convertToImage();
return pm.toImage();
}
QString Container::texString()
......
......@@ -21,13 +21,12 @@
#ifndef KFORMULACONTAINER_H
#define KFORMULACONTAINER_H
#include <qclipboard.h>
#include <qdom.h>
#include <qimage.h>
#include <QClipboard>
#include <QImage>
#include <q3ptrlist.h>
#include <qobject.h>
#include <QObject>
#include <q3ptrstack.h>
#include <qstring.h>
#include <QString>
//Added by qt3to4:
#include <QTextStream>
#include <QKeyEvent>
......@@ -174,7 +173,7 @@ public:
* Draws the whole thing.
*/
void draw( QPainter& painter, const QRect& r,
const QColorGroup& cg, bool edit=false );
const QPalette& palette, bool edit=false );
/**
* Draws the whole thing.
......
......@@ -19,7 +19,7 @@
*/
#include <q3ptrlist.h>
#include <qstringlist.h>
#include <QStringList>
//Added by qt3to4:
#include <Q3ValueList>
#include <Q3MemArray>
......@@ -70,9 +70,9 @@ int FormulaList::compareItems( Q3PtrCollection::Item a, Q3PtrCollection::Item b
}
Document::Document( QObject *parent, const char *name,
Document::Document( QObject *parent, const char* /*name*/,
const QStringList &/*args*/ )
: QObject( parent, name ), m_wrapper( 0 ), m_formula( 0 )
: QObject( parent ), m_wrapper( 0 ), m_formula( 0 )
{
m_contextStyle = new ContextStyle;
SequenceElement::setCreationStrategy( &creationStrategy );
......@@ -1035,7 +1035,7 @@ void DocumentWrapper::textItalic()
void DocumentWrapper::delimiterLeft()
{
QString left = m_leftBracket->currentText();
switch ( left.at(0).latin1() ) {
switch ( left.at(0).toLatin1() ) {
case '[':
case ']':
case '{':
......@@ -1046,7 +1046,7 @@ void DocumentWrapper::delimiterLeft()
case ')':
case '/':
case '\\':
m_leftBracketChar = static_cast<SymbolType>( left.at(0).latin1() );
m_leftBracketChar = static_cast<SymbolType>( left.at(0).toLatin1() );
break;
case '|':
m_leftBracketChar = LeftLineBracket;
......@@ -1060,7 +1060,7 @@ void DocumentWrapper::delimiterLeft()
void DocumentWrapper::delimiterRight()
{
QString right = m_rightBracket->currentText();
switch ( right.at(0).latin1() ) {
switch ( right.at(0).toLatin1() ) {
case '[':
case ']':
case '{':
......@@ -1071,7 +1071,7 @@ void DocumentWrapper::delimiterRight()
case ')':
case '/':
case '\\':
m_rightBracketChar = static_cast<SymbolType>( right.at(0).latin1() );
m_rightBracketChar = static_cast<SymbolType>( right.at(0).toLatin1() );
break;
case '|':
m_rightBracketChar = RightLineBracket;
......
......@@ -21,11 +21,11 @@
#ifndef KFORMULADOCUMENT_H
#define KFORMULADOCUMENT_H
#include <qdom.h>
#include <qobject.h>
#include <QObject>
#include <QDomDocument>
#include <q3ptrlist.h>
#include <qstring.h>
#include <qstringlist.h>
#include <QString>
#include <QStringList>
#include <kaction.h>
#include <kcommand.h>
......
......@@ -20,8 +20,8 @@
#include <iostream>
#include <qpainter.h>
#include <qtimer.h>
#include <QPainter>
#include <QTimer>
//Added by qt3to4:
#include <QMouseEvent>
#include <QFocusEvent>
......@@ -258,14 +258,14 @@ void View::wheelEvent( QWheelEvent* event, const PtPoint& pos )
void View::mousePressEvent( QMouseEvent* event, const LuPixelPoint& pos )
{
int flags = movementFlag( event->state() );
int flags = movementFlag( event->modifiers() );
cursor()->mousePress( pos, flags );
emitCursorChanged();
}
void View::mouseReleaseEvent( QMouseEvent* event, const LuPixelPoint& pos )
{
int flags = movementFlag( event->state() );
int flags = movementFlag( event->modifiers() );
cursor()->mouseRelease( pos, flags );
emitCursorChanged();
}
......@@ -279,7 +279,7 @@ void View::mouseDoubleClickEvent( QMouseEvent*, const LuPixelPoint& )
void View::mouseMoveEvent( QMouseEvent* event, const LuPixelPoint& pos )
{
int flags = movementFlag( event->state() );
int flags = movementFlag( event->modifiers() );
cursor()->mouseMove( pos, flags );
emitCursorChanged();
}
......
......@@ -21,8 +21,8 @@
#include <stdlib.h>
#include <math.h>
#include <qpainter.h>
#include <qpaintdevice.h>
#include <QPainter>
#include <QPaintDevice>
#include <q3valuestack.h>
//Added by qt3to4:
#include <QKeyEvent>
......@@ -899,7 +899,7 @@ KCommand* SequenceElement::buildCommand( Container* container, Request* request
case req_addText: {
KFCReplace* command = new KFCReplace( i18n("Add Text"), container );
TextRequest* tr = static_cast<TextRequest*>( request );
for ( uint i = 0; i < tr->text().length(); i++ ) {
for ( int i = 0; i < tr->text().length(); i++ ) {
command->addElement( creationStrategy->createTextElement( tr->text()[i] ) );
}
return command;
......@@ -1104,7 +1104,7 @@ KCommand* SequenceElement::buildCommand( Container* container, Request* request
if ((element != 0) && !element->isSymbol()) {
cursor->selectActiveElement();
const SymbolTable& table = container->document()->getSymbolTable();
if (table.greekLetters().find(element->getCharacter()) != -1) {
if (table.greekLetters().contains(element->getCharacter())) {
KFCReplace* command = new KFCReplace( i18n( "Change Char to Symbol" ), container );
TextElement* symbol = creationStrategy->createTextElement( table.unicodeFromSymbolFont( element->getCharacter() ), true );
command->addElement( symbol );
......@@ -1162,7 +1162,7 @@ KCommand* SequenceElement::input( Container* container, QKeyEvent* event )
}
else {
int action = event->key();
int state = event->state();
int state = event->modifiers();
MoveFlag flag = movementFlag(state);
switch ( action ) {
......@@ -1333,7 +1333,7 @@ bool SequenceElement::buildChildrenFromDom(Q3PtrList<BasicElement>& list, QDomNo
if (n.isElement()) {
QDomElement e = n.toElement();
BasicElement* child = 0;
QString tag = e.tagName().upper();
QString tag = e.tagName().toUpper();
child = createElement(tag);
if (child != 0) {
......@@ -1665,7 +1665,7 @@ BasicElement* NameSequence::replaceElement( const SymbolTable& table )
return new TextElement( ch, true );
}
else {
ch = table.unicode( i18n( name.latin1() ) );
ch = table.unicode( i18n( name.toLatin1() ) );
if ( !ch.isNull() ) {
return new TextElement( ch, true );
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment