Commit 54162141 authored by David Faure's avatar David Faure

perl $KDESRC/4/kdesdk/scripts/qt4/adapt-to-kde4-api.pl

svn path=/trunk/koffice/; revision=649645
parent 0fc3b409
......@@ -242,7 +242,7 @@ bool BracketElement::readAttributesFromMathMLDom(const QDomElement& element)
else { // mfenced, see attributes in section 3.3.8.2
leftType = LeftRoundBracket;
rightType = RightRoundBracket;
QString openStr = element.attribute( "open" ).stripWhiteSpace();
QString openStr = element.attribute( "open" ).trimmed();
if ( !openStr.isNull() ) {
m_customLeft = true;
if ( openStr == "[" )
......@@ -268,7 +268,7 @@ bool BracketElement::readAttributesFromMathMLDom(const QDomElement& element)
else // TODO: Check for entity references
leftType = LeftRoundBracket;
}
QString closeStr = element.attribute( "close" ).stripWhiteSpace();
QString closeStr = element.attribute( "close" ).trimmed();
if ( !closeStr.isNull() ) {
m_customRight = true;
if ( closeStr == "[" )
......@@ -294,7 +294,7 @@ bool BracketElement::readAttributesFromMathMLDom(const QDomElement& element)
else // TODO: Check for entity references
rightType = LeftRoundBracket;
}
m_separators = element.attribute( "separators" ).simplifyWhiteSpace();
m_separators = element.attribute( "separators" ).simplified();
}
return true;
}
......@@ -322,7 +322,7 @@ int BracketElement::readContentFromMathMLDom(QDomNode& node)
empty = true;
}
if ( nodeNum > 1 ) { // More than two elements inside, infer a mrow
kdWarning() << "NodeNum: " << nodeNum << endl;
kWarning() << "NodeNum: " << nodeNum << endl;
QDomDocument doc = node.ownerDocument();
QDomElement de = doc.createElement( "mrow" );
int i = 0;
......@@ -333,7 +333,7 @@ int BracketElement::readContentFromMathMLDom(QDomNode& node)
} while ( ++i < nodeNum );
parent.insertAfter( de, open );
node = de;
kdWarning() << doc.toString() << endl;
kWarning() << doc.toString() << endl;
}
}
else {
......@@ -451,11 +451,11 @@ int BracketElement::searchOperator( const QDomNode& node )
QString form = e.attribute( "form" );
QString f;
if ( ! form.isNull() ) {
f = form.stripWhiteSpace().lower();
f = form.trimmed().lower();
}
QString fence = e.attribute( "fence" );
if ( ! fence.isNull() ) {
if ( fence.stripWhiteSpace().lower() == "false" ) {
if ( fence.trimmed().lower() == "false" ) {
continue;
}
if ( ! f.isNull() ) {
......@@ -472,7 +472,7 @@ int BracketElement::searchOperator( const QDomNode& node )
QDomNode child = e.firstChild();
QString name;
if ( child.isText() )
name = child.toText().data().stripWhiteSpace();
name = child.toText().data().trimmed();
else if ( child.isEntityReference() )
name = child.nodeName();
else
......
......@@ -55,7 +55,7 @@ bool OperatorElement::readAttributesFromMathMLDom( const QDomElement &element )
return false;
}
QString formStr = element.attribute( "form" ).stripWhiteSpace().lower();
QString formStr = element.attribute( "form" ).trimmed().lower();
if ( ! formStr.isNull() ) {
m_customForm = true;
if ( formStr == "prefix" ) {
......@@ -72,7 +72,7 @@ bool OperatorElement::readAttributesFromMathMLDom( const QDomElement &element )
m_customForm = false;
}
}
QString fenceStr = element.attribute( "fence" ).stripWhiteSpace().lower();
QString fenceStr = element.attribute( "fence" ).trimmed().lower();
if ( ! fenceStr.isNull() ) {
m_customFence = true;
if ( fenceStr == "true" ) {
......@@ -86,7 +86,7 @@ bool OperatorElement::readAttributesFromMathMLDom( const QDomElement &element )
m_customFence = false;
}
}
QString separatorStr = element.attribute( "separator" ).stripWhiteSpace().lower();
QString separatorStr = element.attribute( "separator" ).trimmed().lower();
if ( ! separatorStr.isNull() ) {
m_customSeparator = true;
if ( separatorStr == "true" ) {
......@@ -100,7 +100,7 @@ bool OperatorElement::readAttributesFromMathMLDom( const QDomElement &element )
m_customSeparator = false;
}
}
QString lspaceStr = element.attribute( "lspace" ).stripWhiteSpace().lower();
QString lspaceStr = element.attribute( "lspace" ).trimmed().lower();
if ( ! lspaceStr.isNull() ) {
m_customLSpace = true;
m_lspace = getSize( lspaceStr, &m_lspaceType );
......@@ -108,7 +108,7 @@ bool OperatorElement::readAttributesFromMathMLDom( const QDomElement &element )
m_lspaceType = getSpace( lspaceStr );
}
}
QString rspaceStr = element.attribute( "rspace" ).stripWhiteSpace().lower();
QString rspaceStr = element.attribute( "rspace" ).trimmed().lower();
if ( ! rspaceStr.isNull() ) {
m_customRSpace = true;
m_rspace = getSize( rspaceStr, &m_rspaceType );
......@@ -116,7 +116,7 @@ bool OperatorElement::readAttributesFromMathMLDom( const QDomElement &element )
m_rspaceType = getSpace( rspaceStr );
}
}
QString stretchyStr = element.attribute( "stretchy" ).stripWhiteSpace().lower();
QString stretchyStr = element.attribute( "stretchy" ).trimmed().lower();
if ( ! stretchyStr.isNull() ) {
m_customStretchy = true;
if ( stretchyStr == "true" ) {
......@@ -130,7 +130,7 @@ bool OperatorElement::readAttributesFromMathMLDom( const QDomElement &element )
m_customStretchy = false;
}
}
QString symmetricStr = element.attribute( "symmetric" ).stripWhiteSpace().lower();
QString symmetricStr = element.attribute( "symmetric" ).trimmed().lower();
if ( ! symmetricStr.isNull() ) {
m_customSymmetric = true;
if ( symmetricStr == "true" ) {
......@@ -144,7 +144,7 @@ bool OperatorElement::readAttributesFromMathMLDom( const QDomElement &element )
m_customSymmetric = false;
}
}
QString maxsizeStr = element.attribute( "maxsize" ).stripWhiteSpace().lower();
QString maxsizeStr = element.attribute( "maxsize" ).trimmed().lower();
if ( ! maxsizeStr.isNull() ) {
m_customMaxSize = true;
if ( maxsizeStr == "infinity" ) {
......@@ -157,7 +157,7 @@ bool OperatorElement::readAttributesFromMathMLDom( const QDomElement &element )
}
}
}
QString minsizeStr = element.attribute( "minsize" ).stripWhiteSpace().lower();
QString minsizeStr = element.attribute( "minsize" ).trimmed().lower();
if ( ! minsizeStr.isNull() ) {
m_customMinSize = true;
m_minSize = getSize( minsizeStr, &m_minSizeType );
......@@ -165,7 +165,7 @@ bool OperatorElement::readAttributesFromMathMLDom( const QDomElement &element )
m_minSizeType = getSpace( minsizeStr );
}
}
QString largeopStr = element.attribute( "largeop" ).stripWhiteSpace().lower();
QString largeopStr = element.attribute( "largeop" ).trimmed().lower();
if ( ! largeopStr.isNull() ) {
m_customLargeOp = true;
if ( largeopStr == "true" ) {
......@@ -179,7 +179,7 @@ bool OperatorElement::readAttributesFromMathMLDom( const QDomElement &element )
m_customLargeOp = false;
}
}
QString movablelimitsStr = element.attribute( "movablelimits" ).stripWhiteSpace().lower();
QString movablelimitsStr = element.attribute( "movablelimits" ).trimmed().lower();
if ( ! movablelimitsStr.isNull() ) {
m_customMovableLimits = true;
if ( movablelimitsStr == "true" ) {
......@@ -193,7 +193,7 @@ bool OperatorElement::readAttributesFromMathMLDom( const QDomElement &element )
m_customMovableLimits = false;
}
}
QString accentStr = element.attribute( "accent" ).stripWhiteSpace().lower();
QString accentStr = element.attribute( "accent" ).trimmed().lower();
if ( ! accentStr.isNull() ) {
m_customAccent = true;
if ( accentStr == "true" ) {
......
......@@ -118,19 +118,19 @@ bool PaddedElement::readAttributesFromMathMLDom(const QDomElement& element)
return false;
}
QString widthStr = element.attribute( "width" ).stripWhiteSpace().lower();
QString widthStr = element.attribute( "width" ).trimmed().lower();
if ( ! widthStr.isNull() ) {
m_width = readSizeAttribute( widthStr, &m_widthType, &m_widthRelative );
}
QString lspaceStr = element.attribute( "lspace" ).stripWhiteSpace().lower();
QString lspaceStr = element.attribute( "lspace" ).trimmed().lower();
if ( ! lspaceStr.isNull() ) {
m_lspace = readSizeAttribute( lspaceStr, &m_lspaceType, &m_lspaceRelative );
}
QString heightStr = element.attribute( "height" ).stripWhiteSpace().lower();
QString heightStr = element.attribute( "height" ).trimmed().lower();
if ( ! heightStr.isNull() ) {
m_height = readSizeAttribute( heightStr, &m_heightType, &m_heightRelative );
}
QString depthStr = element.attribute( "depth" ).stripWhiteSpace().lower();
QString depthStr = element.attribute( "depth" ).trimmed().lower();
if ( ! depthStr.isNull() ) {
m_depth = readSizeAttribute( depthStr, &m_depthType, &m_depthRelative );
}
......@@ -158,53 +158,53 @@ double PaddedElement::readSizeAttribute( const QString& str, SizeType* st, bool*
if ( index != -1 ) {
int index2 = str.find( "%" );
if ( index2 != -1 ) {
return str2size( str.left( index2 ).stripWhiteSpace(), st, WidthRelativeSize ) / 100.0;
return str2size( str.left( index2 ).trimmed(), st, WidthRelativeSize ) / 100.0;
}
return str2size( str.left( index ).stripWhiteSpace(), st, WidthRelativeSize );
return str2size( str.left( index ).trimmed(), st, WidthRelativeSize );
}
index = str.find( "height" );
if ( index != -1 ) {
int index2 = str.find( "%" );
if ( index2 != -1 ) {
return str2size( str.left( index2 ).stripWhiteSpace(), st, HeightRelativeSize ) / 100.0;
return str2size( str.left( index2 ).trimmed(), st, HeightRelativeSize ) / 100.0;
}
return str2size( str.left( index ).stripWhiteSpace(), st, HeightRelativeSize );
return str2size( str.left( index ).trimmed(), st, HeightRelativeSize );
}
index = str.find( "%" );
if ( index != -1 ) {
return str2size( str.left( index ).stripWhiteSpace(), st, RelativeSize ) / 100.0;
return str2size( str.left( index ).trimmed(), st, RelativeSize ) / 100.0;
}
index = str.find( "pt", 0, false );
if ( index != -1 ) {
return str2size( str.left( index ).stripWhiteSpace(), st, AbsoluteSize );
return str2size( str.left( index ).trimmed(), st, AbsoluteSize );
}
index = str.find( "mm", 0, false );
if ( index != -1 ) {
return str2size( str.left( index ).stripWhiteSpace(), st, AbsoluteSize ) * 72.0 / 20.54;
return str2size( str.left( index ).trimmed(), st, AbsoluteSize ) * 72.0 / 20.54;
}
index = str.find( "cm", 0, false );
if ( index != -1 ) {
return str2size( str.left( index ).stripWhiteSpace(), st, AbsoluteSize ) * 72.0 / 2.54;
return str2size( str.left( index ).trimmed(), st, AbsoluteSize ) * 72.0 / 2.54;
}
index = str.find( "in", 0, false );
if ( index != -1 ) {
return str2size( str.left( index ).stripWhiteSpace(), st, AbsoluteSize ) * 72.0;
return str2size( str.left( index ).trimmed(), st, AbsoluteSize ) * 72.0;
}
index = str.find( "em", 0, false );
if ( index != -1 ) {
return str2size( str.left( index ).stripWhiteSpace(), st, RelativeSize );
return str2size( str.left( index ).trimmed(), st, RelativeSize );
}
index = str.find( "ex", 0, false );
if ( index != -1 ) {
return str2size( str.left( index ).stripWhiteSpace(), st, RelativeSize );
return str2size( str.left( index ).trimmed(), st, RelativeSize );
}
index = str.find( "pc", 0, false );
if ( index != -1 ) {
return str2size( str.left( index ).stripWhiteSpace(), st, AbsoluteSize ) * 12.0;
return str2size( str.left( index ).trimmed(), st, AbsoluteSize ) * 12.0;
}
index = str.find( "px", 0, false );
if ( index != -1 ) {
return str2size( str.left( index ).stripWhiteSpace(), st, PixelSize );
return str2size( str.left( index ).trimmed(), st, PixelSize );
}
// If there's no unit, assume 'pt'
return str2size( str, st, AbsoluteSize );
......
......@@ -44,7 +44,7 @@ int TokenElement::buildChildrenFromMathMLDom(QList<BasicElement*>& list, QDomNod
while ( ! n.isNull() ) {
if ( n.isText() ) {
QString textelements = n.toText().data();
textelements = textelements.stripWhiteSpace();
textelements = textelements.trimmed();
for (uint i = 0; i < textelements.length(); i++) {
TextElement* child = new TextElement(textelements[i]);
......
......@@ -54,10 +54,10 @@ bool UnderOverElement::readAttributesFromMathMLDom( const QDomElement& element )
return false;
}
QString tag = element.tagName().stripWhiteSpace().lower();
QString tag = element.tagName().trimmed().lower();
if ( tag == "munder" || tag == "munderover" ) {
QString accentunderStr = element.attribute( "accentunder" ).stripWhiteSpace().lower();
QString accentunderStr = element.attribute( "accentunder" ).trimmed().lower();
if ( ! accentunderStr.isNull() ) {
if ( accentunderStr == "true" ) {
m_customAccentUnder = true;
......@@ -74,7 +74,7 @@ bool UnderOverElement::readAttributesFromMathMLDom( const QDomElement& element )
}
}
if ( tag == "mover" || tag == "munderover" ) {
QString accentStr = element.attribute( "accent" ).stripWhiteSpace().lower();
QString accentStr = element.attribute( "accent" ).trimmed().lower();
if ( ! accentStr.isNull() ) {
if ( accentStr == "true" ) {
m_customAccent = true;
......
......@@ -256,7 +256,7 @@ void KoHelpView::mouseMoveEvent( QMouseEvent* e )
if ( !currentText->anchorAt( e->pos() ).isEmpty() )
setCursor( Qt::PointingHandCursor );
else
setCursor( KCursor::arrowCursor() );
setCursor( Qt::ArrowCursor );
} // KoHelpView::mouseMove
bool KoHelpView::eventFilter( QObject*, QEvent* e )
......
......@@ -151,7 +151,7 @@ class GroupWidgetBase : public QWidget
f.setBold(true);
p.setFont(f);
p.drawText(indent+8, 0, width()-(indent+8),
height(), Qt::AlignLeft | Qt::AlignVCenter | Qt::SingleLine,
height(), Qt::AlignLeft | Qt::AlignVCenter | Qt::TextSingleLine,
m_titleStr);
}
// p.setPen(palette().active().mid());
......@@ -580,7 +580,7 @@ EditorGroupItem::paintCell(QPainter *p, const QColorGroup & cg, int column, int
K3ListViewItem::paintCell(p, cg, column, width, align);
p->setPen(cg.text());
p->drawText(QRect(0,0, totalWidth, height()),
Qt::AlignLeft | Qt::AlignVCenter | Qt::SingleLine, text(0));*/
Qt::AlignLeft | Qt::AlignVCenter | Qt::TextSingleLine, text(0));*/
}
void
......
......@@ -218,7 +218,7 @@ DoubleSpinBox::eventFilter(QObject *o, QEvent *e)
if(e->type() == QEvent::KeyPress)
{
QKeyEvent* ev = static_cast<QKeyEvent*>(e);
if((ev->key()==Qt::Key_Up || ev->key()==Qt::Key_Down) && ev->modifiers()!=Qt::ControlButton)
if((ev->key()==Qt::Key_Up || ev->key()==Qt::Key_Down) && ev->modifiers()!=Qt::ControlModifier)
{
parentWidget()->eventFilter(o, e);
return true;
......
......@@ -129,13 +129,13 @@ Widget::eventFilter(QObject*, QEvent* e)
/* moved in Editor
if (item) {
if(ev->key() == Qt::Key_Up && ev->state() != Qt::ControlButton)
if(ev->key() == Qt::Key_Up && ev->state() != Qt::ControlModifier)
{
if(item->itemAbove())
list->setCurrentItem(item->itemAbove());
return true;
}
else if(ev->key() == Qt::Key_Down && ev->state() != Qt::ControlButton)
else if(ev->key() == Qt::Key_Down && ev->state() != Qt::ControlModifier)
{
if(item->itemBelow())
list->setCurrentItem(item->itemBelow());
......
......@@ -795,7 +795,7 @@ void KoParagraphStyle::loadOasis(KoStyleStack& styleStack) {
KoTabulatorList tabList;
if ( styleStack.hasChildNodeNS( KoXmlNS::style, "tab-stops" ) ) { // 3.11.10
QDomElement tabStops = styleStack.childNodeNS( KoXmlNS::style, "tab-stops" );
//kdDebug(30519) << k_funcinfo << tabStops.childNodes().count() << " tab stops in layout." << endl;
//kDebug(30519) << k_funcinfo << tabStops.childNodes().count() << " tab stops in layout." << endl;
QDomElement tabStop;
forEachElement( tabStop, tabStops )
{
......
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