OSDN Git Service

[denncoCreator] fixed a crash bug.
[dennco/denncoCreator.git] / Source / dccontent.cpp
index 4f54e87..898ed7d 100644 (file)
@@ -25,6 +25,8 @@
 #include "DNXMLElement.h"
 #include "DNUtils.h"
 #include "dccontainersaver.h"
+#include "uieditor/dcuieditor.h"
+#include "propertyeditor/dcpropertyeditor.h"
 
 #include <stdlib.h>
 #include <sstream>
@@ -81,6 +83,22 @@ DCContent::~DCContent()
     }
 }
 
+bool DCContent::getIsModified() const
+{
+    if (d_valid && d_container && d_container->getIsModified())
+    {
+        return true;
+    }
+
+    if (DCPropertyEditor::getEditor()->isVisible())
+        DCPropertyEditor::getEditor()->close();
+
+    if (DCUIEditor::getEditor()->isVisible())
+        DCUIEditor::getEditor()->close();
+
+    return false;
+}
+
 bool DCContent::parseSettingFile(const char *contentRoot)
 {
     bool valid = false;
@@ -176,3 +194,11 @@ bool DCContent::saveAll(const QString& contentRoot)
     QString containerRoot = contentRoot + "/Container";
     return containerSaver.saveAll(containerRoot);
 }
+
+bool DCContent::saveForPage(const QString &contentRoot, DCVCPage *page)
+{
+    DCContainerSaver containerSaver(d_container);
+
+    QString containerRoot = contentRoot + "/Container";
+    return containerSaver.saveForPage(containerRoot, page);
+}