From 0ed378dfb21fd3796f44a5ee0cd5542ca88e7af6 Mon Sep 17 00:00:00 2001 From: Marc Zinnschlag Date: Tue, 11 Dec 2012 11:24:30 +0100 Subject: [PATCH] changed sub view factory method signature --- apps/opencs/view/doc/view.cpp | 2 +- apps/opencs/view/world/subview.hpp | 18 +++++++++--------- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/apps/opencs/view/doc/view.cpp b/apps/opencs/view/doc/view.cpp index 539b149cb2..c1659b388e 100644 --- a/apps/opencs/view/doc/view.cpp +++ b/apps/opencs/view/doc/view.cpp @@ -191,7 +191,7 @@ void CSVDoc::View::addSubView (const CSMWorld::UniversalId& id) if (iter==mSubViewFactories.end()) throw std::logic_error ("can't create subview for " + id.toString()); - CSVWorld::SubView *view = iter->second->makeSubView (id, mDocument->getData(), mDocument->getUndoStack()); + CSVWorld::SubView *view = iter->second->makeSubView (id, *mDocument); addDockWidget (Qt::TopDockWidgetArea, view); view->show(); } diff --git a/apps/opencs/view/world/subview.hpp b/apps/opencs/view/world/subview.hpp index 95448cb47b..ff130828b6 100644 --- a/apps/opencs/view/world/subview.hpp +++ b/apps/opencs/view/world/subview.hpp @@ -1,6 +1,8 @@ #ifndef CSV_WORLD_SUBVIEW_H #define CSV_WORLD_SUBVIEW_H +#include "../../model/doc/document.hpp" + #include "../../model/world/universalid.hpp" #include @@ -35,21 +37,20 @@ namespace CSVWorld struct SubViewFactoryBase { - virtual SubView *makeSubView (const CSMWorld::UniversalId& id, CSMWorld::Data& data, QUndoStack& undoStack) + virtual SubView *makeSubView (const CSMWorld::UniversalId& id, CSMDoc::Document& document) = 0; }; template struct SubViewFactory : public SubViewFactoryBase { - virtual SubView *makeSubView (const CSMWorld::UniversalId& id, CSMWorld::Data& data, QUndoStack& undoStack); + virtual SubView *makeSubView (const CSMWorld::UniversalId& id, CSMDoc::Document& document); }; template - SubView *SubViewFactory::makeSubView (const CSMWorld::UniversalId& id, CSMWorld::Data& data, - QUndoStack& undoStack) + SubView *SubViewFactory::makeSubView (const CSMWorld::UniversalId& id, CSMDoc::Document& document) { - return new SubViewT (id, data, undoStack); + return new SubViewT (id, document.getData(), document.getUndoStack()); } template @@ -59,7 +60,7 @@ namespace CSVWorld SubViewFactoryWithCreateFlag (bool createAndDelete); - virtual SubView *makeSubView (const CSMWorld::UniversalId& id, CSMWorld::Data& data, QUndoStack& undoStack); + virtual SubView *makeSubView (const CSMWorld::UniversalId& id, CSMDoc::Document& document); }; template @@ -69,10 +70,9 @@ namespace CSVWorld template SubView *SubViewFactoryWithCreateFlag::makeSubView (const CSMWorld::UniversalId& id, - CSMWorld::Data& data, - QUndoStack& undoStack) + CSMDoc::Document& document) { - return new SubViewT (id, data, undoStack, mCreateAndDelete); + return new SubViewT (id, document.getData(), document.getUndoStack(), mCreateAndDelete); } }