本文整理汇总了C++中PD_Document::isDirty方法的典型用法代码示例。如果您正苦于以下问题:C++ PD_Document::isDirty方法的具体用法?C++ PD_Document::isDirty怎么用?C++ PD_Document::isDirty使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类PD_Document
的用法示例。
在下文中一共展示了PD_Document::isDirty方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: _setupFrame
bool AbiCollabSessionManager::_setupFrame(XAP_Frame** pFrame, PD_Document* pDoc)
{
UT_return_val_if_fail(pFrame, false);
if (*pFrame)
{
UT_DEBUGMSG(("Frame is non-NULL, NOT loading document in the frame\n"));
return true;
}
// if the document doesn't belong to a frame already, then create a
// new frame for this session (except when the document in the current
// frame is not dirty, doesn't have a filename yet (which means it
// is a brand new empty document), and isn't being shared at the moment)
XAP_Frame* pCurFrame = XAP_App::getApp()->getLastFocussedFrame();
UT_return_val_if_fail(pCurFrame, false);
bool isNewFrame = false;
PD_Document * pFrameDoc = static_cast<PD_Document *>(pCurFrame->getCurrentDoc());
if (pFrameDoc != pDoc)
{
if (!pFrameDoc || (pFrameDoc->getFilename().empty() && !pFrameDoc->isDirty() && !isInSession(pFrameDoc)))
{
// we can replace the document in this frame safely, as it is
// brand new, and doesn't have any contents yet
}
else
{
// the current frame has already a document loaded, let's create
// a new frame
pCurFrame = XAP_App::getApp()->newFrame();
isNewFrame = true;
}
}
else
{
UT_DEBUGMSG(("This document is already in the current frame; using this frame\n"));
}
UT_return_val_if_fail(pCurFrame, false);
*pFrame = pCurFrame;
// load the document in the frame; this will also delete the old document (or at least, it should)
if (static_cast<PD_Document *>((*pFrame)->getCurrentDoc()) != pDoc)
{
UT_DEBUGMSG(("Loading the document in the frame\n"));
(*pFrame)->loadDocument(pDoc);
}
else
{
UT_DEBUGMSG(("Not loading the document in the frame, as the frame already has it\n"));
}
if (isNewFrame)
(*pFrame)->show();
return true;
}