*/
void CMergeEditView::OnEditCut()
{
- if (IsReadOnly(m_nThisPane) || m_bDetailView)
+ if (!QueryEditable())
return;
CPoint ptSelStart, ptSelEnd;
*/
void CMergeEditView::OnUpdateEditCut(CCmdUI* pCmdUI)
{
- if (!IsReadOnly(m_nThisPane) && !m_bDetailView)
+ if (QueryEditable())
CCrystalEditViewEx::OnUpdateEditCut(pCmdUI);
else
pCmdUI->Enable(false);
*/
void CMergeEditView::OnEditPaste()
{
- if (IsReadOnly(m_nThisPane) && !m_bDetailView)
+ if (!QueryEditable())
return;
CCrystalEditViewEx::Paste();
*/
void CMergeEditView::OnUpdateEditPaste(CCmdUI* pCmdUI)
{
- if (!IsReadOnly(m_nThisPane) && !m_bDetailView)
+ if (QueryEditable())
CCrystalEditViewEx::OnUpdateEditPaste(pCmdUI);
else
pCmdUI->Enable(false);
CMergeEditView *tgt = pDoc->GetView(m_nThisGroup, *(pDoc->curUndo-1));
if(tgt==this)
{
- if (IsReadOnly(m_nThisPane))
+ if (!QueryEditable())
return;
GetParentFrame()->SetActiveView(this, true);
void CMergeEditView::OnAutoMerge()
{
// Check current pane is not readonly
- if (GetDocument()->IsModified() || GetDocument()->GetAutoMerged() || IsReadOnly(m_nThisPane))
+ if (GetDocument()->IsModified() || GetDocument()->GetAutoMerged() || !QueryEditable())
return;
CWaitCursor waitstatus;
pCmdUI->Enable(GetDocument()->m_nBuffers == 3 &&
!GetDocument()->IsModified() &&
!GetDocument()->GetAutoMerged() &&
- !IsReadOnly(m_nThisPane));
+ QueryEditable());
}
/**
*/
void CMergeEditView::OnEditOperation(int nAction, LPCTSTR pszText, size_t cchText)
{
- if (IsReadOnly(m_nThisPane))
+ if (!QueryEditable())
{
// We must not arrive here, and assert helps detect troubles
ASSERT(false);
CMergeEditView *tgt = pDoc->GetView(m_nThisGroup, *(pDoc->curUndo));
if(tgt==this)
{
- if (IsReadOnly(m_nThisPane))
+ if (!QueryEditable())
return;
GetParentFrame()->SetActiveView(this, true);
*/
bool CMergeEditView::IsReadOnly(int pane) const
{
- return GetDocument()->m_ptBuf[pane]->GetReadOnly() != false;
+ return m_bDetailView ? true : (GetDocument()->m_ptBuf[pane]->GetReadOnly() != false);
}
/**
pCmdUI->SetRadio(false);
// Don't allow selecting other EOL style for protected pane
- if (IsReadOnly(m_nThisPane))
+ if (!QueryEditable())
pCmdUI->Enable(false);
}
else
}
}
+bool CMergeEditView::QueryEditable()
+{
+ return m_bDetailView ? false : !GetDocument()->m_ptBuf[m_nThisPane]->GetReadOnly();
+}
+
/**
* @brief Called when user selects View/Zoom In from menu.
*/