From b94b86291e8aadea97d28381e63a57eddd1f6176 Mon Sep 17 00:00:00 2001 From: Yimgo Date: Tue, 21 Aug 2012 10:00:16 +0200 Subject: [PATCH] Shutted down warnings. --- plugins/cffadaptor/src/UBCFFAdaptor.cpp | 38 +++++++++----------- src/adaptors/UBImportImage.cpp | 47 +++++++++++++------------ src/gui/UBMessagesDialog.h | 2 +- src/gui/UBRubberBand.cpp | 2 +- 4 files changed, 43 insertions(+), 46 deletions(-) diff --git a/plugins/cffadaptor/src/UBCFFAdaptor.cpp b/plugins/cffadaptor/src/UBCFFAdaptor.cpp index e9dae78f..a0ea3216 100644 --- a/plugins/cffadaptor/src/UBCFFAdaptor.cpp +++ b/plugins/cffadaptor/src/UBCFFAdaptor.cpp @@ -654,29 +654,25 @@ QDomElement UBCFFAdaptor::UBToCFFConverter::parseSvgPageSection(const QDomElemen void UBCFFAdaptor::UBToCFFConverter::writeQDomElementToXML(const QDomNode &node) { - if (!node.isNull()) - if (node.isText()) - { - mIWBContentWriter->writeCharacters(node.nodeValue()); - } - else - { - mIWBContentWriter->writeStartElement(node.namespaceURI(), node.toElement().tagName()); + if (!node.isNull()) { + if (node.isText()) + mIWBContentWriter->writeCharacters(node.nodeValue()); + else { + mIWBContentWriter->writeStartElement(node.namespaceURI(), node.toElement().tagName()); + + for (int i = 0; i < node.toElement().attributes().count(); i++) { + QDomAttr attr = node.toElement().attributes().item(i).toAttr(); + mIWBContentWriter->writeAttribute(attr.name(), attr.value()); + } + QDomNode child = node.firstChild(); + while(!child.isNull()) { + writeQDomElementToXML(child); + child = child.nextSibling(); + } - for (int i = 0; i < node.toElement().attributes().count(); i++) - { - QDomAttr attr = node.toElement().attributes().item(i).toAttr(); - mIWBContentWriter->writeAttribute(attr.name(), attr.value()); + mIWBContentWriter->writeEndElement(); } - QDomNode child = node.firstChild(); - while(!child.isNull()) - { - writeQDomElementToXML(child); - child = child.nextSibling(); - } - - mIWBContentWriter->writeEndElement(); - } + } } bool UBCFFAdaptor::UBToCFFConverter::writeExtendedIwbSection() diff --git a/src/adaptors/UBImportImage.cpp b/src/adaptors/UBImportImage.cpp index 64a42fc1..6a2cf81b 100644 --- a/src/adaptors/UBImportImage.cpp +++ b/src/adaptors/UBImportImage.cpp @@ -74,31 +74,32 @@ QString UBImportImage::importFileFilter() return filter; } -QList UBImportImage::import(const QUuid& uuid, const QString& filePath) -{ - QList result; - - QPixmap pix(filePath); - if (pix.isNull()) - return result; - +QList UBImportImage::import(const QUuid& uuid, const QString& filePath) +{ + Q_UNUSED(uuid); + QList result; + + QPixmap pix(filePath); + if (pix.isNull()) + return result; + UBGraphicsPixmapItem* pixmapItem = new UBGraphicsPixmapItem(); pixmapItem->setPixmap(pix); - result << pixmapItem; - return result; -} - -void UBImportImage::placeImportedItemToScene(UBGraphicsScene* scene, UBGraphicsItem* item) -{ - UBGraphicsPixmapItem* pixmapItem = (UBGraphicsPixmapItem*)item; - - UBGraphicsPixmapItem* sceneItem = scene->addPixmap(pixmapItem->pixmap(), NULL, QPointF(0, 0)); - scene->setAsBackgroundObject(sceneItem, true); - - // Only stored pixmap, should be deleted now - delete pixmapItem; -} - + result << pixmapItem; + return result; +} + +void UBImportImage::placeImportedItemToScene(UBGraphicsScene* scene, UBGraphicsItem* item) +{ + UBGraphicsPixmapItem* pixmapItem = (UBGraphicsPixmapItem*)item; + + UBGraphicsPixmapItem* sceneItem = scene->addPixmap(pixmapItem->pixmap(), NULL, QPointF(0, 0)); + scene->setAsBackgroundObject(sceneItem, true); + + // Only stored pixmap, should be deleted now + delete pixmapItem; +} + const QString& UBImportImage::folderToCopy() { static QString f(""); diff --git a/src/gui/UBMessagesDialog.h b/src/gui/UBMessagesDialog.h index d5d3efaa..0aaf5ae1 100644 --- a/src/gui/UBMessagesDialog.h +++ b/src/gui/UBMessagesDialog.h @@ -34,4 +34,4 @@ private: int mMessagesFontSize; }; -#endif UB_MESSAGES_DIALOG_H_ \ No newline at end of file +#endif /* UB_MESSAGES_DIALOG_H_ */ \ No newline at end of file diff --git a/src/gui/UBRubberBand.cpp b/src/gui/UBRubberBand.cpp index 1ca224f3..6525159f 100644 --- a/src/gui/UBRubberBand.cpp +++ b/src/gui/UBRubberBand.cpp @@ -32,8 +32,8 @@ UBRubberBand::UBRubberBand(Shape s, QWidget * p) : QRubberBand(s, p) , mResizingMode(None) - , mMouseIsPressed(false) , mResizingBorderHeight(20) + , mMouseIsPressed(false) , mLastPressedPoint(QPoint()) { customStyle = NULL;