File fix-build.patch of Package kreenshot-editor

diff --git a/src/lib/kreenshoteditor/core/document.cpp b/src/lib/kreenshoteditor/core/document.cpp
index e6fe9a0..999c8cc 100644
--- a/src/lib/kreenshoteditor/core/document.cpp
+++ b/src/lib/kreenshoteditor/core/document.cpp
@@ -239,10 +239,10 @@ void Document::contentChangedNotificationGroupBegin(bool recordUndo, QString und
 
 void Document::contentChangedNotificationGroupEnd()
 {
-    Q_ASSERT(d->contentChangedNotificationGroupDepth > 0);
-
     Q_D();
 
+    Q_ASSERT(d->contentChangedNotificationGroupDepth > 0);
+
     d->contentChangedNotificationGroupDepth--;
 
     if (d->contentChangedNotificationGroupRecordUndo) {
@@ -297,11 +297,11 @@ void Document::addItem(KreenItemPtr item, bool recordUndo)
 
 void Document::deleteItem(KreenItemPtr item, bool recordUndo)
 {
+    Q_D();
+
     //d->contentChangedNotificationGroupMethodEnter(recordUndo);
     Q_ASSERT(d->itemMap.contains(item->id()));
 
-    Q_D();
-
     if (recordUndo) {
         d->undoStack.push(new DeleteItemCmd(this, item));
     }
@@ -330,6 +330,7 @@ void Document::deleteItem(KreenItemPtr item, bool recordUndo)
  */
 void Document::itemStackLowerStep(KreenItemPtr item_in)
 {
+    Q_D();
     Q_ASSERT(d->itemMap.contains(item_in->id()));
 
     KreenItemPtr prev_item = nullptr;
@@ -355,16 +355,16 @@ void Document::itemStackLowerStep(KreenItemPtr item_in)
 
 bool Document::hasItemPropertiesChanged(KreenItemPtr item)
 {
-    Q_ASSERT(d->itemMap.contains(item->id()));
     Q_D();
+    Q_ASSERT(d->itemMap.contains(item->id()));
     auto docItem = d->itemMap[item->id()];
     return !item->deepEquals(docItem);
 }
 
 bool Document::applyItemPropertyChanges(KreenItemPtr item, bool recordUndo)
 {
-    Q_ASSERT(d->itemMap.contains(item->id()));
     Q_D();
+    Q_ASSERT(d->itemMap.contains(item->id()));
 
     if (!hasItemPropertiesChanged(item)) {
         qDebug() << "[INFO] Document::applyItemPropertyChanges items are equal. Return false";
diff --git a/src/lib/kreenshoteditor/ui/selectionhandles/selectionhandlesmgr.cpp b/src/lib/kreenshoteditor/ui/selectionhandles/selectionhandlesmgr.cpp
index e6fe9a0..999c8cc 100644
--- a/src/lib/kreenshoteditor/ui/selectionhandles/selectionhandlesmgr.cpp
+++ b/src/lib/kreenshoteditor/ui/selectionhandles/selectionhandlesmgr.cpp
@@ -29,6 +29,7 @@
 #include <QGraphicsSceneMouseEvent>
 #include "selectionhandlegraphicsitem.h"
 #include "selectionhandlebase.h"
+#include <cmath>
 
 namespace kreen {
 namespace ui {
openSUSE Build Service is sponsored by