return NULL;
}
-// stash away our view pointer
+/**
+ * @brief Stash away our view pointer.
+ */
void CDirDoc::SetDirView(CDirView * newView)
{
m_pDirView = newView;
ASSERT(temp == m_pDirView); // verify that our stashed pointer is the same as MFC's
}
-// a new merge doc has been opened
+/**
+ * @brief A new MergeDoc has been opened.
+ */
void CDirDoc::AddMergeDoc(CMergeDoc * pMergeDoc)
{
ASSERT(pMergeDoc);
m_MergeDocs.AddTail(pMergeDoc);
}
-// merge doc informs us it is closing
+/**
+ * @brief MergeDoc informs us it is closing.
+ */
void CDirDoc::MergeDocClosing(CMergeDoc * pMergeDoc)
{
ASSERT(pMergeDoc);
m_MergeDocs.RemoveAt(pos);
}
-// Prepare for reuse
-// Close all our merge docs (which gives them chance to save)
-// This may fail if user cancels a Save dialog
-// in which case this aborts and returns FALSE
-BOOL CDirDoc::ReusingDirDoc()
+/**
+ * @brief Close MergeDocs opened from DirDoc.
+ *
+ * Asks confirmation for docs containing unsaved data and then
+ * closes MergeDocs.
+ * @return TRUE if success, FALSE if user canceled or closing failed
+ */
+BOOL CDirDoc::CloseMergeDocs()
{
- // Inform all of our merge docs that we're closing
for (POSITION pos = m_MergeDocs.GetHeadPosition(); pos; )
{
CMergeDoc * pMergeDoc = m_MergeDocs.GetNext(pos);
if (!pMergeDoc->CloseNow())
return FALSE;
}
+ return TRUE;
+}
+
+/**
+ * @brief Prepare for reuse.
+ *
+ * Close all our merge docs (which gives them chance to save)
+ * This may fail if user cancels a Save dialog
+ * in which case this aborts and returns FALSE
+ */
+BOOL CDirDoc::ReusingDirDoc()
+{
+ // Inform all of our merge docs that we're closing
+ if (!CloseMergeDocs())
+ return FALSE;
// clear diff display
ASSERT(m_pDirView);
return TRUE;
}
-// Obtain a merge doc to display a difference in files
-// pNew is set to TRUE if a new doc is created, and FALSE if an existing one reused
+/**
+ * @brief Obtain a merge doc to display a difference in files.
+ * @param [out] pNew Set to TRUE if a new doc is created,
+ * and FALSE if an existing one reused.
+ */
CMergeDoc * CDirDoc::GetMergeDocForDiff(BOOL * pNew)
{
CMergeDoc * pMergeDoc = 0;
Fix for OptionsMgr bugs when loading string options from registry
UNICODE strings were not handled correctly, incorrect buffer lengths
Src/Common: OptionsMgr.cpp OptionsMgr.h
+ PATCH: [ 912754 ] Close open MergeDoc before opening new from DirDoc
+ Src: DirDoc.cpp DirDoc.h DirView.cpp
2004-03-09 Kimmo
PATCH: [ 912297 ] Splashscreen and syntax highlight options