create merged document and open a view for it (document is still empty at this point)
parent
d8655f2ff8
commit
1b663f01af
@ -0,0 +1,18 @@
|
||||
|
||||
#include "mergestages.hpp"
|
||||
|
||||
#include "mergestate.hpp"
|
||||
|
||||
CSMTools::FinishMergedDocumentStage::FinishMergedDocumentStage (MergeState& state)
|
||||
: mState (state)
|
||||
{}
|
||||
|
||||
int CSMTools::FinishMergedDocumentStage::setup()
|
||||
{
|
||||
return 1;
|
||||
}
|
||||
|
||||
void CSMTools::FinishMergedDocumentStage::perform (int stage, CSMDoc::Messages& messages)
|
||||
{
|
||||
mState.mCompleted = true;
|
||||
}
|
@ -0,0 +1,26 @@
|
||||
#ifndef CSM_TOOLS_MERGESTAGES_H
|
||||
#define CSM_TOOLS_MERGESTAGES_H
|
||||
|
||||
#include "../doc/stage.hpp"
|
||||
|
||||
namespace CSMTools
|
||||
{
|
||||
struct MergeState;
|
||||
|
||||
class FinishMergedDocumentStage : public CSMDoc::Stage
|
||||
{
|
||||
MergeState& mState;
|
||||
|
||||
public:
|
||||
|
||||
FinishMergedDocumentStage (MergeState& state);
|
||||
|
||||
virtual int setup();
|
||||
///< \return number of steps
|
||||
|
||||
virtual void perform (int stage, CSMDoc::Messages& messages);
|
||||
///< Messages resulting from this stage will be appended to \a messages.
|
||||
};
|
||||
}
|
||||
|
||||
#endif
|
@ -0,0 +1,20 @@
|
||||
#ifndef CSM_TOOLS_MERGESTATE_H
|
||||
#define CSM_TOOLS_MERGESTATE_H
|
||||
|
||||
#include <memory>
|
||||
|
||||
#include "../doc/document.hpp"
|
||||
|
||||
namespace CSMTools
|
||||
{
|
||||
struct MergeState
|
||||
{
|
||||
std::auto_ptr<CSMDoc::Document> mTarget;
|
||||
CSMDoc::Document& mSource;
|
||||
bool mCompleted;
|
||||
|
||||
MergeState (CSMDoc::Document& source) : mSource (source), mCompleted (false) {}
|
||||
};
|
||||
}
|
||||
|
||||
#endif
|
Loading…
Reference in New Issue