diff -ur abi-0.7.7/src/af/util/xp/ut_types.h abi-change/src/af/util/xp/ut_types.h --- abi-0.7.7/src/af/util/xp/ut_types.h Sun Oct 17 10:28:09 1999 +++ abi-change/src/af/util/xp/ut_types.h Sun Jan 9 06:24:13 2000 @@ -63,7 +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. /* The MSVC debug runtime library can track leaks back to the diff -ur abi-0.7.7/src/text/fmt/xp/fv_View.cpp abi-change/src/text/fmt/xp/fv_View.cpp --- abi-0.7.7/src/text/fmt/xp/fv_View.cpp Wed Dec 8 17:14:31 1999 +++ abi-change/src/text/fmt/xp/fv_View.cpp Sun Jan 9 06:24:15 2000 @@ -4046,22 +4046,23 @@ } } -UT_Bool FV_View::cmdSave(void) -{ - if (!m_pDoc->save()) - return UT_FALSE; - notifyListeners(AV_CHG_SAVE); - return UT_TRUE; +UT_ErrorCode FV_View::cmdSave(void) +{ + UT_ErrorCode tmpVar; + tmpVar = m_pDoc->save(); + if (!tmpVar) + notifyListners(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->save(szFilename, ieft); + if (!tmpVar) + notifyListners(AV_CHG_SAVE); + return tmpVar; } void FV_View::cmdCut(void) diff -ur abi-0.7.7/src/text/ptbl/xp/pd_Document.cpp abi-change/src/text/ptbl/xp/pd_Document.cpp --- abi-0.7.7/src/text/ptbl/xp/pd_Document.cpp Sun Sep 26 13:17:31 1999 +++ abi-change/src/text/ptbl/xp/pd_Document.cpp Sun Jan 9 06:24:15 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) { 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-0.7.7/src/wp/ap/xp/ap_EditMethods.cpp abi-change/src/wp/ap/xp/ap_EditMethods.cpp --- abi-0.7.7/src/wp/ap/xp/ap_EditMethods.cpp Fri Dec 3 23:15:11 1999 +++ abi-change/src/wp/ap/xp/ap_EditMethods.cpp Tue Jan 11 01:47:54 2000 @@ -747,7 +747,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(); @@ -762,7 +762,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); @@ -1293,11 +1298,12 @@ // can only save without prompting if filename already known 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; } @@ -1325,13 +1331,13 @@ return UT_FALSE; UT_DEBUGMSG(("fileSaveAs: saving as [%s]\n",pNewFile)); + UT_ErrorCode bSaved; + bSaved = pAV_View->cmdSaveAs(pNewFile, (int) ieft); - UT_Bool bSaved = pAV_View->cmdSaveAs(pNewFile,(int) ieft); - - if (!bSaved) + if (bSaved) { // throw up a dialog - s_TellSaveFailed(pFrame, pNewFile); + s_TellSaveFailed(pFrame, pNewFile, bSaved); free(pNewFile); return UT_FALSE; } Only in abi-change/src/wp/ap/xp: ap_EditMethods.cpp~ diff -ur abi-0.7.7/src/wp/ap/xp/ap_String_Id.h abi-change/src/wp/ap/xp/ap_String_Id.h --- abi-0.7.7/src/wp/ap/xp/ap_String_Id.h Wed Nov 17 14:21:33 1999 +++ abi-change/src/wp/ap/xp/ap_String_Id.h Tue Jan 11 01:53:26 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?") Only in abi-change/src/wp/ap/xp: ap_String_Id.h~ diff -ur abi-0.7.7/user/wp/strings/CaES.strings abi-change/user/wp/strings/CaES.strings --- abi-0.7.7/user/wp/strings/CaES.strings Thu Dec 2 01:27:32 1999 +++ abi-change/user/wp/strings/CaES.strings Tue Jan 11 01:56:18 2000 @@ -77,6 +77,7 @@