summaryrefslogtreecommitdiff
path: root/sw/inc
diff options
context:
space:
mode:
Diffstat (limited to 'sw/inc')
-rw-r--r--sw/inc/docsh.hxx4
-rw-r--r--sw/inc/shellio.hxx38
-rw-r--r--sw/inc/swerror.h70
3 files changed, 51 insertions, 61 deletions
diff --git a/sw/inc/docsh.hxx b/sw/inc/docsh.hxx
index 801ef8324840..60b25f9c2918 100644
--- a/sw/inc/docsh.hxx
+++ b/sw/inc/docsh.hxx
@@ -277,8 +277,8 @@ public:
void ToggleLayoutMode(SwView* pView);
- sal_uLong LoadStylesFromFile( const OUString& rURL, SwgReaderOption& rOpt,
- bool bUnoCall );
+ ErrCode LoadStylesFromFile( const OUString& rURL, SwgReaderOption& rOpt,
+ bool bUnoCall );
void InvalidateModel();
void ReactivateModel();
diff --git a/sw/inc/shellio.hxx b/sw/inc/shellio.hxx
index a84c73c568fd..0a48eabafb61 100644
--- a/sw/inc/shellio.hxx
+++ b/sw/inc/shellio.hxx
@@ -162,7 +162,7 @@ public:
SwReader( const css::uno::Reference < css::embed::XStorage >&, const OUString& rFilename, SwPaM& );
// The only export interface is SwReader::Read(...)!!!
- sal_uLong Read( const Reader& );
+ ErrCode Read( const Reader& );
// Ask for glossaries.
bool HasGlossaries( const Reader& );
@@ -257,7 +257,7 @@ public:
void setSotStorageRef(const tools::SvRef<SotStorage>& pStgRef) { pStg = pStgRef; };
private:
- virtual sal_uLong Read(SwDoc &, const OUString& rBaseURL, SwPaM &, const OUString &)=0;
+ virtual ErrCode Read(SwDoc &, const OUString& rBaseURL, SwPaM &, const OUString &)=0;
// Everyone who does not need the streams / storages open
// has to override the method (W4W!!).
@@ -267,7 +267,7 @@ private:
class AsciiReader: public Reader
{
friend class SwReader;
- virtual sal_uLong Read( SwDoc &, const OUString& rBaseURL, SwPaM &, const OUString &) override;
+ virtual ErrCode Read( SwDoc &, const OUString& rBaseURL, SwPaM &, const OUString &) override;
public:
AsciiReader(): Reader() {}
};
@@ -290,7 +290,7 @@ class SwImpBlocks;
class SW_DLLPUBLIC SwTextBlocks
{
std::unique_ptr<SwImpBlocks> pImp;
- sal_uLong nErr;
+ ErrCode nErr;
public:
SwTextBlocks( const OUString& );
@@ -300,7 +300,7 @@ public:
void ClearDoc(); // Delete Doc-contents.
OUString GetName();
void SetName( const OUString& );
- sal_uLong GetError() const { return nErr; }
+ ErrCode GetError() const { return nErr; }
OUString GetBaseURL() const;
void SetBaseURL( const OUString& rURL );
@@ -315,7 +315,7 @@ public:
bool Delete( sal_uInt16 );
void Rename( sal_uInt16, const OUString*, const OUString* );
- sal_uLong CopyBlock( SwTextBlocks& rSource, OUString& rSrcShort,
+ ErrCode CopyBlock( SwTextBlocks& rSource, OUString& rSrcShort,
const OUString& rLong );
bool BeginGetDoc( sal_uInt16 ); // Read text modules.
@@ -379,7 +379,7 @@ protected:
void PutNumFormatFontsInAttrPool();
void PutEditEngFontsInAttrPool();
- virtual sal_uLong WriteStream() = 0;
+ virtual ErrCode WriteStream() = 0;
void SetBaseURL( const OUString& rURL ) { sBaseURL = rURL; }
IDocumentSettingAccess& getIDocumentSettingAccess();
@@ -407,10 +407,10 @@ public:
Writer();
virtual ~Writer() override;
- virtual sal_uLong Write( SwPaM&, SfxMedium&, const OUString* );
- sal_uLong Write( SwPaM&, SvStream&, const OUString* );
- virtual sal_uLong Write( SwPaM&, const css::uno::Reference < css::embed::XStorage >&, const OUString*, SfxMedium* = nullptr );
- virtual sal_uLong Write( SwPaM&, SotStorage&, const OUString* );
+ virtual ErrCode Write( SwPaM&, SfxMedium&, const OUString* );
+ ErrCode Write( SwPaM&, SvStream&, const OUString* );
+ virtual ErrCode Write( SwPaM&, const css::uno::Reference < css::embed::XStorage >&, const OUString*, SfxMedium* = nullptr );
+ virtual ErrCode Write( SwPaM&, SotStorage&, const OUString* );
virtual void SetupFilterOptions(SfxMedium& rMedium);
@@ -464,9 +464,9 @@ protected:
css::uno::Reference < css::embed::XStorage > xStg;
// Create error at call.
- virtual sal_uLong WriteStream() override;
- virtual sal_uLong WriteStorage() = 0;
- virtual sal_uLong WriteMedium( SfxMedium& ) = 0;
+ virtual ErrCode WriteStream() override;
+ virtual ErrCode WriteStorage() = 0;
+ virtual ErrCode WriteMedium( SfxMedium& ) = 0;
using Writer::Write;
@@ -475,8 +475,8 @@ public:
virtual bool IsStgWriter() const override;
- virtual sal_uLong Write( SwPaM&, const css::uno::Reference < css::embed::XStorage >&, const OUString*, SfxMedium* = nullptr ) override;
- virtual sal_uLong Write( SwPaM&, SotStorage&, const OUString* ) override;
+ virtual ErrCode Write( SwPaM&, const css::uno::Reference < css::embed::XStorage >&, const OUString*, SfxMedium* = nullptr ) override;
+ virtual ErrCode Write( SwPaM&, SotStorage&, const OUString* ) override;
SotStorage& GetStorage() const { return *pStg; }
};
@@ -497,7 +497,7 @@ class SW_DLLPUBLIC SwWriter
bool bWriteAll;
public:
- sal_uLong Write( WriterRef& rxWriter, const OUString* = nullptr);
+ ErrCode Write( WriterRef& rxWriter, const OUString* = nullptr);
SwWriter( SvStream&, SwCursorShell &, bool bWriteAll = false );
SwWriter( SvStream&, SwDoc & );
@@ -511,8 +511,8 @@ public:
typedef Reader* (*FnGetReader)();
typedef void (*FnGetWriter)(const OUString&, const OUString& rBaseURL, WriterRef&);
-sal_uLong SaveOrDelMSVBAStorage( SfxObjectShell&, SotStorage&, bool, const OUString& );
-sal_uLong GetSaveWarningOfMSVBAStorage( SfxObjectShell &rDocS );
+ErrCode SaveOrDelMSVBAStorage( SfxObjectShell&, SotStorage&, bool, const OUString& );
+ErrCode GetSaveWarningOfMSVBAStorage( SfxObjectShell &rDocS );
struct SwReaderWriterEntry
{
diff --git a/sw/inc/swerror.h b/sw/inc/swerror.h
index a49663312051..4ecd4ac21f56 100644
--- a/sw/inc/swerror.h
+++ b/sw/inc/swerror.h
@@ -22,9 +22,8 @@
#include <vcl/errcode.hxx>
-#define ERROR_SW_BASE (ERRCODE_AREA_SW)
-#define ERROR_SW_READ_BASE (ERROR_SW_BASE | ERRCODE_CLASS_READ)
-#define ERROR_SW_WRITE_BASE (ERROR_SW_BASE | ERRCODE_CLASS_WRITE)
+#define ERROR_SW_READ_BASE (ERRCODE_AREA_SW | ERRCODE_CLASS_READ)
+#define ERROR_SW_WRITE_BASE (ERRCODE_AREA_SW | ERRCODE_CLASS_WRITE)
#define WARN_SW_BASE (ERRCODE_AREA_SW | ERRCODE_WARNING_MASK)
#define WARN_SW_READ_BASE (WARN_SW_BASE | ERRCODE_CLASS_READ )
@@ -32,65 +31,56 @@
// Import Errors
-#define ERR_SWG_FILE_FORMAT_ERROR (ERROR_SW_READ_BASE | 1 )
-#define ERR_SWG_READ_ERROR (ERROR_SW_READ_BASE | 2 )
+#define ERR_SWG_FILE_FORMAT_ERROR ErrCode(ERROR_SW_READ_BASE | 1 )
+#define ERR_SWG_READ_ERROR ErrCode(ERROR_SW_READ_BASE | 2 )
-#define ERR_SW6_INPUT_FILE (ERROR_SW_READ_BASE | 4 )
-#define ERR_SW6_NOWRITER_FILE (ERROR_SW_READ_BASE | 5 )
-#define ERR_SW6_UNEXPECTED_EOF (ERROR_SW_READ_BASE | 6 )
-#define ERR_SW6_PASSWD (ERROR_SW_READ_BASE | 7 )
+#define ERR_SW6_INPUT_FILE ErrCode(ERROR_SW_READ_BASE | 4 )
+#define ERR_SW6_NOWRITER_FILE ErrCode(ERROR_SW_READ_BASE | 5 )
+#define ERR_SW6_UNEXPECTED_EOF ErrCode(ERROR_SW_READ_BASE | 6 )
+#define ERR_SW6_PASSWD ErrCode(ERROR_SW_READ_BASE | 7 )
-#define ERR_WW6_NO_WW6_FILE_ERR (ERROR_SW_READ_BASE | 8 )
-#define ERR_WW6_FASTSAVE_ERR (ERROR_SW_READ_BASE | 9 )
+#define ERR_WW6_NO_WW6_FILE_ERR ErrCode(ERROR_SW_READ_BASE | 8 )
+#define ERR_WW6_FASTSAVE_ERR ErrCode(ERROR_SW_READ_BASE | 9 )
-#define ERR_FORMAT_ROWCOL (ERROR_SW_READ_BASE | 12)
+#define ERR_FORMAT_ROWCOL ErrCode(ERROR_SW_READ_BASE | 12)
-#define ERR_SWG_NEW_VERSION (ERROR_SW_READ_BASE | 13)
-#define ERR_WW8_NO_WW8_FILE_ERR (ERROR_SW_READ_BASE | 14)
+#define ERR_SWG_NEW_VERSION ErrCode(ERROR_SW_READ_BASE | 13)
+#define ERR_WW8_NO_WW8_FILE_ERR ErrCode(ERROR_SW_READ_BASE | 14)
-#define ERR_FORMAT_FILE_ROWCOL (ERROR_SW_READ_BASE | 15)
+#define ERR_FORMAT_FILE_ROWCOL ErrCode(ERROR_SW_READ_BASE | 15)
// Export errors
-#define ERR_SWG_WRITE_ERROR (ERROR_SW_WRITE_BASE | 30 )
-#define ERR_SWG_OLD_GLOSSARY (ERROR_SW_WRITE_BASE | 31 )
-#define ERR_WRITE_ERROR_FILE (ERROR_SW_WRITE_BASE | 35 )
+#define ERR_SWG_WRITE_ERROR ErrCode(ERROR_SW_WRITE_BASE | 30 )
+#define ERR_SWG_OLD_GLOSSARY ErrCode(ERROR_SW_WRITE_BASE | 31 )
+#define ERR_WRITE_ERROR_FILE ErrCode(ERROR_SW_WRITE_BASE | 35 )
// Import/Export errors
-#define ERR_SWG_INTERNAL_ERROR (ERROR_SW_BASE | 50 )
+#define ERR_SWG_INTERNAL_ERROR ErrCode(ERRCODE_AREA_SW | 50 )
-#define ERR_TXTBLOCK_NEWFILE_ERROR (ERROR_SW_BASE|ERRCODE_CLASS_LOCKING | 55 )
+#define ERR_TXTBLOCK_NEWFILE_ERROR ErrCode(ERRCODE_AREA_SW|ERRCODE_CLASS_LOCKING | 55 )
// other errors and errorclasses
-#define ERR_AUTOPATH_ERROR (ERROR_SW_BASE|ERRCODE_CLASS_PATH | 55 )
-#define ERR_TBLSPLIT_ERROR (ERROR_SW_BASE|ERRCODE_CLASS_NONE| 56 )
-#define ERR_TBLINSCOL_ERROR (ERROR_SW_BASE|ERRCODE_CLASS_NONE| 57 )
-#define ERR_TBLDDECHG_ERROR (ERROR_SW_BASE|ERRCODE_CLASS_NONE| 58 )
+#define ERR_AUTOPATH_ERROR ErrCode(ERRCODE_AREA_SW|ERRCODE_CLASS_PATH | 55 )
+#define ERR_TBLSPLIT_ERROR ErrCode(ERRCODE_AREA_SW|ERRCODE_CLASS_NONE| 56 )
+#define ERR_TBLINSCOL_ERROR ErrCode(ERRCODE_AREA_SW|ERRCODE_CLASS_NONE| 57 )
+#define ERR_TBLDDECHG_ERROR ErrCode(ERRCODE_AREA_SW|ERRCODE_CLASS_NONE| 58 )
// Import - Warnings
-#define WARN_SWG_NO_DRAWINGS (WARN_SW_READ_BASE | 70 )
-#define WARN_WW6_FASTSAVE_ERR (WARN_SW_READ_BASE | 71 )
+#define WARN_SWG_NO_DRAWINGS ErrCode(WARN_SW_READ_BASE | 70 )
+#define WARN_WW6_FASTSAVE_ERR ErrCode(WARN_SW_READ_BASE | 71 )
// continued below
// Import & Export - Warnings
-#define WARN_SWG_FEATURES_LOST (WARN_SW_BASE | 72 )
-#define WARN_SWG_OLE (WARN_SW_BASE | 73 )
+#define WARN_SWG_FEATURES_LOST ErrCode(WARN_SW_BASE | 72 )
+#define WARN_SWG_OLE ErrCode(WARN_SW_BASE | 73 )
#define WARN_SWG_POOR_LOAD (WARN_SW_BASE | 74 )
// Export warnings
-#define WARN_SWG_HTML_NO_MACROS (WARN_SW_WRITE_BASE |75)
-#define WARN_WRITE_ERROR_FILE (WARN_SW_WRITE_BASE |76)
+#define WARN_SWG_HTML_NO_MACROS ErrCode(WARN_SW_WRITE_BASE |75)
+#define WARN_WRITE_ERROR_FILE ErrCode(WARN_SW_WRITE_BASE |76)
// More Import & Export - Warnings
-#define WARN_FORMAT_FILE_ROWCOL (WARN_SW_READ_BASE | 77)
-
-#ifndef __RSC
-
-inline bool IsError( sal_uLong nErr )
-{
- return nErr && 0 == ( ERRCODE_WARNING_MASK & nErr );
-}
-
-#endif
+#define WARN_FORMAT_FILE_ROWCOL ErrCode(WARN_SW_READ_BASE | 77)
#endif