diff -ur abi/src/af/util/xp/ut_types.h abi-change/src/af/util/xp/ut_types.h --- abi/src/af/util/xp/ut_types.h Thu Jan 13 02:36:59 2000 +++ abi-change/src/af/util/xp/ut_types.h Thu Jan 13 12:24:06 2000 @@ -63,6 +63,8 @@ typedef UT_sint32 UT_ErrorCode; #define UT_OK ((UT_ErrorCode) 0) #define UT_OUTOFMEM ((UT_ErrorCode) -100) +#define UT_SaveWriteError ((UT_ErrorCode) -201) +#define UT_SaveOtherError ((UT_ErrorCode) -200) // This should eventually dissapear. /* diff -ur abi/src/af/xap/xp/xav_View.h abi-change/src/af/xap/xp/xav_View.h --- abi/src/af/xap/xp/xav_View.h Thu Jan 13 02:36:59 2000 +++ abi-change/src/af/xap/xp/xav_View.h Thu Jan 13 11:55:52 2000 @@ -91,8 +91,8 @@ virtual UT_Bool canDo(UT_Bool bUndo) const = 0; virtual void cmdUndo(UT_uint32 count) = 0; virtual void cmdRedo(UT_uint32 count) = 0; - virtual UT_Bool cmdSave(void) = 0; - virtual UT_Bool cmdSaveAs(const char * szFilename, int ieft) = 0; + virtual UT_ErrorCode cmdSave(void) = 0; + virtual UT_ErrorCode cmdSaveAs(const char * szFilename, int ieft) = 0; virtual EV_EditMouseContext getMouseContext(UT_sint32 xPos, UT_sint32 yPos) = 0; virtual UT_Bool isSelectionEmpty(void) const = 0; diff -ur abi/src/text/fmt/xp/fv_View.cpp abi-change/src/text/fmt/xp/fv_View.cpp --- abi/src/text/fmt/xp/fv_View.cpp Thu Jan 13 02:36:59 2000 +++ abi-change/src/text/fmt/xp/fv_View.cpp Thu Jan 13 11:58:24 2000 @@ -4046,23 +4046,25 @@ } } -UT_Bool FV_View::cmdSave(void) +UT_ErrorCode FV_View::cmdSave(void) { - if (!m_pDoc->save()) - return UT_FALSE; - - notifyListeners(AV_CHG_SAVE); - return UT_TRUE; + UT_ErrorCode tmpVar; + tmpVar = m_pDoc->save(); + if (!tmpVar) + notifyListeners(AV_CHG_SAVE); + return tmpVar; } -UT_Bool FV_View::cmdSaveAs(const char * szFilename, int ieft) + +UT_ErrorCode FV_View::cmdSaveAs(const char * szFilename, int ieft) { - if (!m_pDoc->saveAs(szFilename, ieft)) - return UT_FALSE; - - notifyListeners(AV_CHG_SAVE); - return UT_TRUE; + UT_ErrorCode tmpVar; + tmpVar = m_pDoc->saveAs(szFilename, ieft); + if (!tmpVar) + notifyListeners(AV_CHG_SAVE); + return tmpVar; } + void FV_View::cmdCut(void) { diff -ur abi/src/text/fmt/xp/fv_View.h abi-change/src/text/fmt/xp/fv_View.h --- abi/src/text/fmt/xp/fv_View.h Thu Jan 13 02:36:59 2000 +++ abi-change/src/text/fmt/xp/fv_View.h Thu Jan 13 11:59:20 2000 @@ -106,8 +106,8 @@ virtual UT_Bool canDo(UT_Bool bUndo) const; virtual void cmdUndo(UT_uint32 count); virtual void cmdRedo(UT_uint32 count); - virtual UT_Bool cmdSave(void); - virtual UT_Bool cmdSaveAs(const char * szFilename, int ieft); + virtual UT_ErrorCode cmdSave(void); + virtual UT_ErrorCode cmdSaveAs(const char * szFilename, int ieft); UT_Bool cmdInsertGraphic(FG_Graphic*, const char*); diff -ur abi/src/text/ptbl/xp/pd_Document.cpp abi-change/src/text/ptbl/xp/pd_Document.cpp --- abi/src/text/ptbl/xp/pd_Document.cpp Thu Jan 13 02:36:59 2000 +++ abi-change/src/text/ptbl/xp/pd_Document.cpp Thu Jan 13 12:02:20 2000 @@ -146,10 +146,10 @@ return UT_TRUE; } -UT_Bool PD_Document::saveAs(const char * szFilename, int ieft) +UT_ErrorCode PD_Document::saveAs(const char * szFilename, int ieft) { if (!szFilename) - return UT_FALSE; + return UT_SaveOtherError; IE_Exp * pie = NULL; IEStatus ies; @@ -158,7 +158,7 @@ if (ies != IES_OK) { UT_DEBUGMSG(("PD_Document::Save -- could not construct exporter\n")); - return UT_FALSE; + return UT_SaveOtherError; } ies = pie->writeFile(szFilename); @@ -167,7 +167,7 @@ if (ies != IES_OK) { UT_DEBUGMSG(("PD_Document::Save -- could not write file\n")); - return UT_FALSE; + return UT_SaveWriteError; } // no file name currently set - make this filename the filename @@ -180,20 +180,20 @@ char * szFilenameCopy = NULL; if (!UT_cloneString(szFilenameCopy,szFilename)) - return UT_FALSE; + return UT_SaveOtherError; m_szFilename = szFilenameCopy; // save the type we just saved as m_lastSavedAsType = (IEFileType) ieft; _setClean(); - return UT_TRUE; + return UT_OK; } -UT_Bool PD_Document::save(void) +UT_ErrorCode PD_Document::save(void) { if (!m_szFilename || !*m_szFilename) - return UT_FALSE; + return UT_SaveOtherError; IE_Exp * pie = NULL; IEStatus ies; @@ -202,7 +202,7 @@ if (ies != IES_OK) { UT_DEBUGMSG(("PD_Document::Save -- could not construct exporter\n")); - return UT_FALSE; + return UT_SaveOtherError; } ies = pie->writeFile(m_szFilename); @@ -211,11 +211,11 @@ if (ies != IES_OK) { UT_DEBUGMSG(("PD_Document::Save -- could not write file\n")); - return UT_FALSE; + return UT_SaveWriteError; } _setClean(); - return UT_TRUE; + return UT_OK; } ////////////////////////////////////////////////////////////////// diff -ur abi/src/text/ptbl/xp/pd_Document.h abi-change/src/text/ptbl/xp/pd_Document.h --- abi/src/text/ptbl/xp/pd_Document.h Thu Jan 13 02:36:59 2000 +++ abi-change/src/text/ptbl/xp/pd_Document.h Thu Jan 13 12:02:48 2000 @@ -67,8 +67,8 @@ virtual UT_Bool undoCmd(UT_uint32 repeatCount); virtual UT_Bool redoCmd(UT_uint32 repeatCount); - UT_Bool saveAs(const char * szFilename, int ieft); - UT_Bool save(void); + UT_ErrorCode saveAs(const char * szFilename, int ieft); + UT_ErrorCode save(void); void beginUserAtomicGlob(void); void endUserAtomicGlob(void); diff -ur abi/src/wp/ap/xp/ap_EditMethods.cpp abi-change/src/wp/ap/xp/ap_EditMethods.cpp --- abi/src/wp/ap/xp/ap_EditMethods.cpp Thu Jan 13 02:36:59 2000 +++ abi-change/src/wp/ap/xp/ap_EditMethods.cpp Thu Jan 13 12:22:39 2000 @@ -749,7 +749,7 @@ // TODO we want to abstract things further and make us think about // TODO localization of the question strings.... -static void s_TellSaveFailed(XAP_Frame * pFrame, const char * fileName) +static void s_TellSaveFailed(XAP_Frame * pFrame, const char * fileName, UT_ErrorCode errorCode) { pFrame->raise(); @@ -764,7 +764,12 @@ const XAP_StringSet * pSS = pFrame->getApp()->getStringSet(); - pDialog->setMessage(pSS->getValue(AP_STRING_ID_MSG_SaveFailed), fileName); + if (errorCode == -201) // We have a write error + pDialog->setMessage(pSS->getValue(AP_STRING_ID_MSG_SaveFailedWrite), fileName); + + else // The generic case - should be eliminated eventually + pDialog->setMessage(pSS->getValue(AP_STRING_ID_MSG_SaveFailed), fileName); + pDialog->setButtons(XAP_Dialog_MessageBox::b_O); pDialog->setDefaultAnswer(XAP_Dialog_MessageBox::a_OK); @@ -1296,10 +1301,12 @@ if (!pFrame->getFilename()) return EX(fileSaveAs); - if (!pAV_View->cmdSave()) + UT_ErrorCode bSaved; + bSaved = pAV_View->cmdSave(); + if (bSaved) { // throw up a dialog - s_TellSaveFailed(pFrame, pFrame->getFilename()); + s_TellSaveFailed(pFrame, pFrame->getFilename(), bSaved); return UT_FALSE; } @@ -1327,13 +1334,13 @@ return UT_FALSE; UT_DEBUGMSG(("fileSaveAs: saving as [%s]\n",pNewFile)); - - UT_Bool bSaved = pAV_View->cmdSaveAs(pNewFile,(int) ieft); - - if (!bSaved) + + UT_ErrorCode bSaved; + bSaved = pAV_View->cmdSaveAs(pNewFile, (int) ieft); + if (bSaved) { // throw up a dialog - s_TellSaveFailed(pFrame, pNewFile); + s_TellSaveFailed(pFrame, pNewFile, bSaved); free(pNewFile); return UT_FALSE; } diff -ur abi/src/wp/ap/xp/ap_String_Id.h abi-change/src/wp/ap/xp/ap_String_Id.h --- abi/src/wp/ap/xp/ap_String_Id.h Thu Jan 13 02:36:59 2000 +++ abi-change/src/wp/ap/xp/ap_String_Id.h Thu Jan 13 12:11:14 2000 @@ -26,6 +26,7 @@ // Message Boxes used in AP_EditMethods dcl(MSG_SaveFailed, "Could not write to the file %s.") +dcl(MSG_SaveFailedWrite, "Writing error when attempting to save %s") dcl(MSG_RevertBuffer, "Revert to saved copy of %s?") dcl(MSG_QueryExit, "Close all windows and exit?") dcl(MSG_ConfirmSave, "Save changes to %s?") diff -ur abi/user/wp/strings/CaES.strings abi-change/user/wp/strings/CaES.strings --- abi/user/wp/strings/CaES.strings Thu Jan 13 02:36:59 2000 +++ abi-change/user/wp/strings/CaES.strings Thu Jan 13 12:12:10 2000 @@ -77,6 +77,7 @@