Kaydet (Commit) 2c91fc19 authored tarafından Caolán McNamara's avatar Caolán McNamara

replace localresource of strings and keys with StringArray

Change-Id: I402f5485af0c1e60677b8291c879bc7ca14633d3
üst 41ae2675
......@@ -19,6 +19,7 @@
#include "sb.hxx"
#include <tools/rcid.h>
#include <tools/resary.hxx>
#include <tools/stream.hxx>
#include <tools/errinf.hxx>
#include <comphelper/solarmutex.hxx>
......@@ -1584,39 +1585,22 @@ void StarBASIC::SetErrorData( SbError nCode, sal_uInt16 nLine,
aGlobals.nCol2 = nCol2;
}
// help class for access to string SubResource of a Resource.
// Source: sfx2\source\doc\docfile.cxx (TLX)
struct BasicStringList_Impl : private Resource
{
ResId aResId;
BasicStringList_Impl( ResId& rErrIdP, sal_uInt16 nId)
: Resource( rErrIdP ),aResId(nId, *rErrIdP.GetResMgr() ){}
~BasicStringList_Impl() { FreeResource(); }
OUString GetString(){ return aResId.toString(); }
bool IsErrorTextAvailable()
{ return IsAvailableRes(aResId.SetRT(RSC_STRING)); }
};
void StarBASIC::MakeErrorText( SbError nId, const OUString& aMsg )
{
SolarMutexGuard aSolarGuard;
sal_uInt16 nOldID = GetVBErrorCode( nId );
// instantiate the help class
BasResId aId( RID_BASIC_START );
BasicStringList_Impl aMyStringList( aId, sal_uInt16(nId & ERRCODE_RES_MASK) );
if( aMyStringList.IsErrorTextAvailable() )
ResStringArray aMyStringList(BasResId(RID_BASIC_START));
sal_uInt32 nErrIdx = aMyStringList.FindIndex(sal_uInt16(nId & ERRCODE_RES_MASK));
if (nErrIdx != RESARRAY_INDEX_NOTFOUND)
{
// merge message with additional text
OUStringBuffer aMsg1(aMyStringList.GetString());
OUString sError = aMyStringList.GetString(nErrIdx);
OUStringBuffer aMsg1(sError);
// replace argument placeholder with %s
OUString aSrgStr( "$(ARG1)" );
sal_Int32 nResult = aMyStringList.GetString().indexOf( aSrgStr );
sal_Int32 nResult = sError.indexOf(aSrgStr);
if( nResult >= 0 )
{
......
This diff is collapsed.
This diff is collapsed.
......@@ -348,19 +348,16 @@ String STR_SAVE_DOC
#define ERR_CODE( class, err ) (class | (err - ERROR_SD_BASE))
#define WARN_CODE( class, err ) (class | ( err - WARN_SD_BASE))
Resource RID_SD_ERRHDL
StringArray RID_SD_ERRHDL
{
String ERR_CODE ( ERRCODE_CLASS_READ , ERR_FORMAT_ROWCOL )
ItemList [ en-US ] =
{
Text [ en-US ] = "File format error found at $(ARG1)(row,col)." ;
};
String ERR_CODE ( ERRCODE_CLASS_READ , ERR_FORMAT_FILE_ROWCOL )
{
Text [ en-US ] = "Format error discovered in the file in sub-document $(ARG1) at position $(ARG2)(row,col).";
};
String ERR_CODE ( ERRCODE_CLASS_READ , WARN_FORMAT_FILE_ROWCOL )
{
Text [ en-US ] = "Format error discovered in the file in sub-document $(ARG1) at position $(ARG2)(row,col).";
< "File format error found at $(ARG1)(row,col)." ;
ERR_CODE ( ERRCODE_CLASS_READ , ERR_FORMAT_ROWCOL ) ; >;
< "Format error discovered in the file in sub-document $(ARG1) at position $(ARG2)(row,col).";
ERR_CODE ( ERRCODE_CLASS_READ , ERR_FORMAT_FILE_ROWCOL ) ; >;
< "Format error discovered in the file in sub-document $(ARG1) at position $(ARG2)(row,col).";
ERR_CODE ( ERRCODE_CLASS_READ , WARN_FORMAT_FILE_ROWCOL ) ; >;
};
};
......
......@@ -22,152 +22,89 @@
#include <svtools/soerr.hxx>
#define S_MAX 0x7fff
Resource RID_SO_ERROR_HANDLER
StringArray RID_SO_ERROR_HANDLER
{
String ERRCODE_SO_GENERALERROR&S_MAX
{
Text [ en-US ] = "General OLE error." ;
};
String ERRCODE_SO_CANT_BINDTOSOURCE&S_MAX
{
Text [ en-US ] = "The connection to the object cannot be established." ;
};
String ERRCODE_SO_NOCACHE_UPDATED&S_MAX
{
Text [ en-US ] = "No cache files were updated." ;
};
String ERRCODE_SO_SOMECACHES_NOTUPDATED&S_MAX
{
Text [ en-US ] = "Some cache files were not updated." ;
};
String ERRCODE_SO_MK_UNAVAILABLE&S_MAX
{
Text [ en-US ] = "Status of object cannot be determined in a timely manner." ;
};
String ERRCODE_SO_E_CLASSDIFF&S_MAX
{
Text [ en-US ] = "Source of the OLE link has been converted." ;
};
String ERRCODE_SO_MK_NO_OBJECT&S_MAX
{
Text [ en-US ] = "The object could not be found." ;
};
String ERRCODE_SO_MK_EXCEEDED_DEADLINE&S_MAX
{
Text [ en-US ] = "The process could not be completed within the specified time period." ;
};
String ERRCODE_SO_MK_CONNECT_MANUALLY&S_MAX
{
Text [ en-US ] = "OLE could not connect to a network device (server)." ;
};
String ERRCODE_SO_MK_INTERMEDIATE_INTERFACE_NOT_SUPPORTED&S_MAX
{
Text [ en-US ] = "The object found does not support the interface required for the desired operation." ;
};
String ERRCODE_SO_NO_INTERFACE&S_MAX
{
Text [ en-US ] = "Interface not supported." ;
};
String ERRCODE_SO_OUT_OF_MEMORY&S_MAX
{
Text [ en-US ] = "Insufficient memory." ;
};
String ERRCODE_SO_MK_SYNTAX&S_MAX
{
Text [ en-US ] = "The connection name could not be processed." ;
};
String ERRCODE_SO_MK_REDUCED_TO_SELF&S_MAX
{
Text [ en-US ] = "The connection name could not be reduced further." ;
};
String ERRCODE_SO_MK_NO_INVERSE&S_MAX
{
Text [ en-US ] = "The connection name has no inverse." ;
};
String ERRCODE_SO_MK_NO_PREFIX&S_MAX
{
Text [ en-US ] = "No common prefix exists." ;
};
String ERRCODE_SO_MK_HIM&S_MAX
{
Text [ en-US ] = "The connection name is contained in the other one." ;
};
String ERRCODE_SO_MK_US&S_MAX
{
Text [ en-US ] = "The connection names (the receiver and the other moniker) are identical." ;
};
String ERRCODE_SO_MK_ME&S_MAX
{
Text [ en-US ] = "The connection name is contained in the other one." ;
};
String ERRCODE_SO_MK_NOT_BINDABLE&S_MAX
{
Text [ en-US ] = "The connection name cannot be connected. This is a relative name." ;
};
String ERRCODE_SO_NOT_IMPLEMENTED&S_MAX
{
Text [ en-US ] = "Operation not implemented." ;
};
String ERRCODE_SO_MK_NO_STORAGE&S_MAX
{
Text [ en-US ] = "No storage." ;
};
String ERRCODE_SO_FALSE&S_MAX
{
Text [ en-US ] = "False." ;
};
String ERRCODE_SO_MK_NEED_GENERIC&S_MAX
{
Text [ en-US ] = "Monikers must be composed generically." ;
};
String ERRCODE_SO_PENDING&S_MAX
{
Text [ en-US ] = "Data not available at this time." ;
};
String ERRCODE_SO_NOT_INPLACEACTIVE & S_MAX
{
Text [ en-US ] = "Object could not be activated InPlace." ;
};
String ERRCODE_SO_LINDEX & S_MAX
{
Text [ en-US ] = "Invalid index." ;
};
String ERRCODE_SO_CANNOT_DOVERB_NOW & S_MAX
{
Text [ en-US ] = "The action cannot be executed in the object's current state." ;
};
String ERRCODE_SO_OLEOBJ_INVALIDHWND & S_MAX
{
Text [ en-US ] = "An invalid window was passed when activated." ;
};
String ERRCODE_SO_NOVERBS & S_MAX
{
Text [ en-US ] = "The object does not support any actions." ;
};
String ERRCODE_SO_INVALIDVERB & S_MAX
{
Text [ en-US ] = "The action is not defined. The default action will be executed." ;
};
String ERRCODE_SO_MK_CONNECT & S_MAX
{
Text [ en-US ] = "A link to the network could not be re-established." ;
};
String ERRCODE_SO_NOTIMPL & S_MAX
{
Text [ en-US ] = "Object does not support this action." ;
};
String ERRCODE_SO_MK_CANTOPENFILE & S_MAX
{
Text [ en-US ] = "The specified file could not be opened." ;
ItemList [ en-US ] =
{
< "General OLE error." ;
ERRCODE_SO_GENERALERROR&S_MAX ; >;
< "The connection to the object cannot be established." ;
ERRCODE_SO_CANT_BINDTOSOURCE&S_MAX ; >;
< "No cache files were updated." ;
ERRCODE_SO_NOCACHE_UPDATED&S_MAX ; >;
< "Some cache files were not updated." ;
ERRCODE_SO_SOMECACHES_NOTUPDATED&S_MAX ; >;
< "Status of object cannot be determined in a timely manner." ;
ERRCODE_SO_MK_UNAVAILABLE&S_MAX ; >;
< "Source of the OLE link has been converted." ;
ERRCODE_SO_E_CLASSDIFF&S_MAX ; >;
< "The object could not be found." ;
ERRCODE_SO_MK_NO_OBJECT&S_MAX ; >;
< "The process could not be completed within the specified time period." ;
ERRCODE_SO_MK_EXCEEDED_DEADLINE&S_MAX ; >;
< "OLE could not connect to a network device (server)." ;
ERRCODE_SO_MK_CONNECT_MANUALLY&S_MAX ; >;
< "The object found does not support the interface required for the desired operation." ;
ERRCODE_SO_MK_INTERMEDIATE_INTERFACE_NOT_SUPPORTED&S_MAX ; >;
< "Interface not supported." ;
ERRCODE_SO_NO_INTERFACE&S_MAX ; >;
< "Insufficient memory." ;
ERRCODE_SO_OUT_OF_MEMORY&S_MAX ; >;
< "The connection name could not be processed." ;
ERRCODE_SO_MK_SYNTAX&S_MAX ; >;
< "The connection name could not be reduced further." ;
ERRCODE_SO_MK_REDUCED_TO_SELF&S_MAX ; >;
< "The connection name has no inverse." ;
ERRCODE_SO_MK_NO_INVERSE&S_MAX ; >;
< "No common prefix exists." ;
ERRCODE_SO_MK_NO_PREFIX&S_MAX ; >;
< "The connection name is contained in the other one." ;
ERRCODE_SO_MK_HIM&S_MAX ; >;
< "The connection names (the receiver and the other moniker) are identical." ;
ERRCODE_SO_MK_US&S_MAX ; >;
< "The connection name is contained in the other one." ;
ERRCODE_SO_MK_ME&S_MAX ; >;
< "The connection name cannot be connected. This is a relative name." ;
ERRCODE_SO_MK_NOT_BINDABLE&S_MAX ; >;
< "Operation not implemented." ;
ERRCODE_SO_NOT_IMPLEMENTED&S_MAX ; >;
< "No storage." ;
ERRCODE_SO_MK_NO_STORAGE&S_MAX ; >;
< "False." ;
ERRCODE_SO_FALSE&S_MAX ; >;
< "Monikers must be composed generically." ;
ERRCODE_SO_MK_NEED_GENERIC&S_MAX ; >;
< "Data not available at this time." ;
ERRCODE_SO_PENDING&S_MAX ; >;
< "Object could not be activated InPlace." ;
ERRCODE_SO_NOT_INPLACEACTIVE & S_MAX ; >;
< "Invalid index." ;
ERRCODE_SO_LINDEX & S_MAX ; >;
< "The action cannot be executed in the object's current state." ;
ERRCODE_SO_CANNOT_DOVERB_NOW & S_MAX ; >;
< "An invalid window was passed when activated." ;
ERRCODE_SO_OLEOBJ_INVALIDHWND & S_MAX ; >;
< "The object does not support any actions." ;
ERRCODE_SO_NOVERBS & S_MAX ; >;
< "The action is not defined. The default action will be executed." ;
ERRCODE_SO_INVALIDVERB & S_MAX ; >;
< "A link to the network could not be re-established." ;
ERRCODE_SO_MK_CONNECT & S_MAX ; >;
< "Object does not support this action." ;
ERRCODE_SO_NOTIMPL & S_MAX ; >;
< "The specified file could not be opened." ;
ERRCODE_SO_MK_CANTOPENFILE & S_MAX ; >;
};
};
Resource RID_SO_ERRCTX
StringArray RID_SO_ERRCTX
{
String ERRCTX_SO_DOVERB
ItemList [ en-US ] =
{
Text [ en-US ] = "$(ERR) activating object" ;
< "$(ERR) activating object" ; ERRCTX_SO_DOVERB ; >;
};
};
String STR_ERROR_OBJNOCREATE
{
Text [ en-US ] = "Object % could not be inserted." ;
......
......@@ -19,6 +19,7 @@
#include <osl/mutex.hxx>
#include <tools/rcid.h>
#include <tools/resary.hxx>
#include <tools/wintypes.hxx>
#include <vcl/msgbox.hxx>
#include <vcl/svapp.hxx>
......@@ -218,26 +219,6 @@ ResString::ResString(ResId & rId)
pResMgr->PopContext();
}
struct ErrorResource_Impl : private Resource
/* [Description]
Helpclass for access to string sub-resources of a resource
*/
{
ResId aResId;
ErrorResource_Impl(ResId& rErrIdP, sal_uInt16 nId)
: Resource(rErrIdP),aResId(nId,*rErrIdP.GetResMgr()){}
~ErrorResource_Impl() { FreeResource(); }
ResString GetResString() { return ResString( aResId ); }
operator bool() { return IsAvailableRes(aResId.SetRT(RSC_STRING)); }
};
void SfxErrorHandler::GetClassString(sal_uLong lClassId, OUString &rStr)
/* [Description]
......@@ -251,11 +232,11 @@ void SfxErrorHandler::GetClassString(sal_uLong lClassId, OUString &rStr)
std::unique_ptr<ResMgr> pResMgr(ResMgr::CreateResMgr("ofa", Application::GetSettings().GetUILanguageTag() ));
if( pResMgr )
{
ResId aId(RID_ERRHDL, *pResMgr );
ErrorResource_Impl aEr(aId, (sal_uInt16)lClassId);
if(aEr)
ResStringArray aEr(ResId(RID_ERRHDL, *pResMgr));
sal_uInt32 nErrIdx = aEr.FindIndex((sal_uInt16)lClassId);
if (nErrIdx != RESARRAY_INDEX_NOTFOUND)
{
rStr = aEr.GetResString().GetString();
rStr = aEr.GetString(nErrIdx);
}
}
}
......@@ -274,19 +255,16 @@ bool SfxErrorHandler::GetErrorString(sal_uLong lErrId, OUString &rStr) const
bool bRet = false;
rStr = SvtResId(RID_ERRHDL_CLASS).toString();
ResId aResId(nId, *pMgr);
ResStringArray aEr(ResId(nId, *pMgr));
sal_uInt32 nErrIdx = aEr.FindIndex((sal_uInt16)lErrId);
if (nErrIdx != RESARRAY_INDEX_NOTFOUND)
{
ErrorResource_Impl aEr(aResId, (sal_uInt16)lErrId);
if(aEr)
{
ResString aErrorString(aEr.GetResString());
rStr = rStr.replaceAll("$(ERROR)", aErrorString.GetString());
bRet = true;
}
else
bRet = false;
rStr = rStr.replaceAll("$(ERROR)", aEr.GetString(nErrIdx));
bRet = true;
}
else
bRet = false;
if( bRet )
{
......@@ -339,12 +317,11 @@ bool SfxErrorContext::GetString(sal_uLong nErrId, OUString &rStr)
{
SolarMutexGuard aGuard;
ResId aResId( nResId, *pMgr );
ErrorResource_Impl aTestEr( aResId, nCtxId );
if ( aTestEr )
ResStringArray aTestEr(ResId(nResId, *pMgr));
sal_uInt32 nErrIdx = aTestEr.FindIndex(nCtxId);
if (nErrIdx != RESARRAY_INDEX_NOTFOUND)
{
rStr = aTestEr.GetResString().GetString();
rStr = aTestEr.GetString(nErrIdx);
rStr = rStr.replaceAll("$(ARG1)", aArg1);
bRet = true;
}
......@@ -357,9 +334,8 @@ bool SfxErrorContext::GetString(sal_uLong nErrId, OUString &rStr)
if ( bRet )
{
sal_uInt16 nId = ( nErrId & ERRCODE_WARNING_MASK ) ? ERRCTX_WARNING : ERRCTX_ERROR;
ResId aSfxResId( RID_ERRCTX, *pMgr );
ErrorResource_Impl aEr( aSfxResId, nId );
rStr = rStr.replaceAll("$(ERR)", aEr.GetResString().GetString());
ResStringArray aEr(ResId(RID_ERRCTX, *pMgr));
rStr = rStr.replaceAll("$(ERR)", aEr.GetString(nId));
}
}
......
......@@ -23,121 +23,76 @@
#include <editeng/editerr.hxx>
// Error-Context ---------------------------------------------------------
Resource RID_SVXERRCTX
StringArray RID_SVXERRCTX
{
String ERRCTX_SVX_LINGU_THESAURUS&ERRCODE_RES_MASK
{
Text [ en-US ] = "$(ERR) executing the thesaurus." ;
};
String ERRCTX_SVX_LINGU_SPELLING&ERRCODE_RES_MASK
{
Text [ en-US ] = "$(ERR) executing the spellcheck." ;
};
String ERRCTX_SVX_LINGU_HYPHENATION&ERRCODE_RES_MASK
{
Text [ en-US ] = "$(ERR) executing the hyphenation." ;
};
String ERRCTX_SVX_LINGU_DICTIONARY&ERRCODE_RES_MASK
{
Text [ en-US ] = "$(ERR) creating a dictionary." ;
};
String ERRCTX_SVX_BACKGROUND&ERRCODE_RES_MASK
{
Text [ en-US ] = "$(ERR) setting background attribute." ;
};
String ERRCTX_SVX_IMPORT_GRAPHIC&ERRCODE_RES_MASK
{
Text [ en-US ] = "$(ERR) loading the graphics." ;
ItemList [ en-US ] =
{
< "$(ERR) executing the thesaurus." ;
ERRCTX_SVX_LINGU_THESAURUS&ERRCODE_RES_MASK ; >;
< "$(ERR) executing the spellcheck." ;
ERRCTX_SVX_LINGU_SPELLING&ERRCODE_RES_MASK ; >;
< "$(ERR) executing the hyphenation." ;
ERRCTX_SVX_LINGU_HYPHENATION&ERRCODE_RES_MASK ; >;
< "$(ERR) creating a dictionary." ;
ERRCTX_SVX_LINGU_DICTIONARY&ERRCODE_RES_MASK ; >;
< "$(ERR) setting background attribute." ;
ERRCTX_SVX_BACKGROUND&ERRCODE_RES_MASK ; >;
< "$(ERR) loading the graphics." ;
ERRCTX_SVX_IMPORT_GRAPHIC&ERRCODE_RES_MASK ; >;
};
};
// Error-Code ------------------------------------------------------------
Resource RID_SVXERRCODE
StringArray RID_SVXERRCODE
{
String ERRCODE_SVX_LINGU_THESAURUSNOTEXISTS&ERRCODE_RES_MASK
{
Text [ en-US ] = "No thesaurus available for the current language.\nPlease check your installation and install the desired language." ;
};
String ERRCODE_SVX_LINGU_LANGUAGENOTEXISTS&ERRCODE_RES_MASK
{
Text [ en-US ] = "$(ARG1) is not supported by the spellcheck function or is not presently active.\nPlease check your installation and, if necessary, install the required language module\n or activate it under 'Tools - Options - Language Settings - Writing Aids'.";
};
String ERRCODE_SVX_LINGU_LINGUNOTEXISTS&ERRCODE_RES_MASK
{
Text [ en-US ] = "Spellcheck is not available." ;
};
String ERRCODE_SVX_LINGU_HYPHENNOTEXISTS&ERRCODE_RES_MASK
{
Text [ en-US ] = "Hyphenation not available." ;
};
String ERRCODE_SVX_LINGU_DICT_NOTREADABLE&ERRCODE_RES_MASK
{
Text [ en-US ] = "The custom dictionary $(ARG1) cannot be read." ;
};
String ERRCODE_SVX_LINGU_DICT_NOTWRITEABLE&ERRCODE_RES_MASK
{
Text [ en-US ] = "The custom dictionary $(ARG1) cannot be created." ;
};
String ERRCODE_SVX_GRAPHIC_NOTREADABLE&ERRCODE_RES_MASK
{
Text [ en-US ] = "The graphic $(ARG1) could not be found." ;
};
String ERRCODE_SVX_GRAPHIC_WRONG_FILEFORMAT&ERRCODE_RES_MASK
{
Text [ en-US ] = "An unlinked graphic could not be loaded.";
};
String ERRCODE_SVX_LINGU_NOLANGUAGE&ERRCODE_RES_MASK
{
Text [ en-US ] = "A language has not been fixed for the selected term.";
};
String (ERRCODE_SVX_FORMS_NOIOSERVICES | ERRCODE_CLASS_READ) & ERRCODE_RES_MASK
{
Text [ en-US ] = "The form layer wasn't loaded as the required IO-services (com.sun.star.io.*) could not be instantiated.";
};
String (ERRCODE_SVX_FORMS_NOIOSERVICES | ERRCODE_CLASS_WRITE) & ERRCODE_RES_MASK
{
Text [ en-US ] = "The form layer wasn't written as the required IO services (com.sun.star.io.*) could not be instantiated.";
};
String (ERRCODE_SVX_FORMS_READWRITEFAILED | ERRCODE_CLASS_READ) & ERRCODE_RES_MASK
{
Text [ en-US ] = "An error occurred while reading the form controls. The form layer has not been loaded.";
};
String (ERRCODE_SVX_FORMS_READWRITEFAILED | ERRCODE_CLASS_WRITE) & ERRCODE_RES_MASK
{
Text [ en-US ] = "An error occurred while writing the form controls. The form layer has not been saved.";
};
String (ERRCODE_SVX_BULLETITEM_NOBULLET | ERRCODE_CLASS_READ) & ERRCODE_RES_MASK
{
Text [ en-US ] = "An error occurred while reading one of the bullets. Not all of the bullets were loaded.";
};
ItemList [ en-US ] =
{
< "No thesaurus available for the current language.\nPlease check your installation and install the desired language." ;
ERRCODE_SVX_LINGU_THESAURUSNOTEXISTS&ERRCODE_RES_MASK ; >;
< "$(ARG1) is not supported by the spellcheck function or is not presently active.\nPlease check your installation and, if necessary, install the required language module\n or activate it under 'Tools - Options - Language Settings - Writing Aids'.";
ERRCODE_SVX_LINGU_LANGUAGENOTEXISTS&ERRCODE_RES_MASK ; >;
< "Spellcheck is not available." ;
ERRCODE_SVX_LINGU_LINGUNOTEXISTS&ERRCODE_RES_MASK ; >;
< "Hyphenation not available." ;
ERRCODE_SVX_LINGU_HYPHENNOTEXISTS&ERRCODE_RES_MASK ; >;
< "The custom dictionary $(ARG1) cannot be read." ;
ERRCODE_SVX_LINGU_DICT_NOTREADABLE&ERRCODE_RES_MASK ; >;
< "The custom dictionary $(ARG1) cannot be created." ;
ERRCODE_SVX_LINGU_DICT_NOTWRITEABLE&ERRCODE_RES_MASK ; >;
< "The graphic $(ARG1) could not be found." ;
ERRCODE_SVX_GRAPHIC_NOTREADABLE&ERRCODE_RES_MASK ; >;
< "An unlinked graphic could not be loaded.";
ERRCODE_SVX_GRAPHIC_WRONG_FILEFORMAT&ERRCODE_RES_MASK ; >;
< "A language has not been fixed for the selected term.";
ERRCODE_SVX_LINGU_NOLANGUAGE&ERRCODE_RES_MASK ; >;
< "The form layer wasn't loaded as the required IO-services (com.sun.star.io.*) could not be instantiated.";
(ERRCODE_SVX_FORMS_NOIOSERVICES | ERRCODE_CLASS_READ) & ERRCODE_RES_MASK ; >;
< "The form layer wasn't written as the required IO services (com.sun.star.io.*) could not be instantiated.";
(ERRCODE_SVX_FORMS_NOIOSERVICES | ERRCODE_CLASS_WRITE) & ERRCODE_RES_MASK ; >;
< "An error occurred while reading the form controls. The form layer has not been loaded.";
(ERRCODE_SVX_FORMS_READWRITEFAILED | ERRCODE_CLASS_READ) & ERRCODE_RES_MASK ; >;
< "An error occurred while writing the form controls. The form layer has not been saved.";
(ERRCODE_SVX_FORMS_READWRITEFAILED | ERRCODE_CLASS_WRITE) & ERRCODE_RES_MASK ; >;
< "An error occurred while reading one of the bullets. Not all of the bullets were loaded.";
(ERRCODE_SVX_BULLETITEM_NOBULLET | ERRCODE_CLASS_READ) & ERRCODE_RES_MASK ; >;
String ERRCODE_SVX_MODIFIED_VBASIC_STORAGE & ERRCODE_RES_MASK
{
Text [ en-US ] = "All changes to the Basic Code are lost. The original VBA Macro Code is saved instead.";
};
< "All changes to the Basic Code are lost. The original VBA Macro Code is saved instead.";
ERRCODE_SVX_MODIFIED_VBASIC_STORAGE & ERRCODE_RES_MASK ; >;
String ERRCODE_SVX_VBASIC_STORAGE_EXIST & ERRCODE_RES_MASK
{
Text [ en-US ] = "The original VBA Basic Code contained in the document will not be saved.";
};
< "The original VBA Basic Code contained in the document will not be saved.";
ERRCODE_SVX_VBASIC_STORAGE_EXIST & ERRCODE_RES_MASK ; >;
String ERRCODE_SVX_WRONGPASS & ERRCODE_RES_MASK
{
Text [ en-US ] = "The password is incorrect. The document cannot be opened.";
};
< "The password is incorrect. The document cannot be opened.";
ERRCODE_SVX_WRONGPASS & ERRCODE_RES_MASK ; >;
String ERRCODE_SVX_READ_FILTER_CRYPT & ERRCODE_RES_MASK
{
Text [ en-US ] = "The encryption method used in this document is not supported. Only Microsoft Office 97/2000 compatible password encryption is supported.";
};
< "The encryption method used in this document is not supported. Only Microsoft Office 97/2000 compatible password encryption is supported.";
ERRCODE_SVX_READ_FILTER_CRYPT & ERRCODE_RES_MASK ; >;
String ERRCODE_SVX_READ_FILTER_PPOINT & ERRCODE_RES_MASK
{
Text [ en-US ] = "The loading of password-encrypted Microsoft PowerPoint presentations is not supported.";
};
< "The loading of password-encrypted Microsoft PowerPoint presentations is not supported.";
ERRCODE_SVX_READ_FILTER_PPOINT & ERRCODE_RES_MASK ; >;
String ERRCODE_SVX_EXPORT_FILTER_CRYPT & ERRCODE_RES_MASK
{
Text [ en-US ] = "Password protection is not supported when documents are saved in a Microsoft Office format.\nDo you want to save the document without password protection?";
< "Password protection is not supported when documents are saved in a Microsoft Office format.\nDo you want to save the document without password protection?";
ERRCODE_SVX_EXPORT_FILTER_CRYPT & ERRCODE_RES_MASK ; >;
};
};
......
This diff is collapsed.
......@@ -41,143 +41,47 @@ String STR_ERROR_CLPBRD_READ
#define ERR_CODE( class, err ) (class | (err - ERROR_SW_BASE))
#define WARN_CODE( class, err ) (class | ( err - WARN_SW_BASE))
Resource RID_SW_ERRHDL
StringArray RID_SW_ERRHDL
{
// Import-Errors
String ERR_CODE ( ERRCODE_CLASS_READ , ERR_SWG_FILE_FORMAT_ERROR )
{
Text [ en-US ] = "File format error found." ;
};
String ERR_CODE ( ERRCODE_CLASS_READ , ERR_SWG_READ_ERROR )
{
Text [ en-US ] = "Error reading file." ;
};
String ERR_CODE ( ERRCODE_CLASS_READ , ERR_SW6_INPUT_FILE )
{
Text [ en-US ] = "Input file error." ;
};
String ERR_CODE ( ERRCODE_CLASS_READ , ERR_SW6_NOWRITER_FILE )
{
Text [ en-US ] = "This is not a %PRODUCTNAME Writer file." ;
};
String ERR_CODE ( ERRCODE_CLASS_READ , ERR_SW6_UNEXPECTED_EOF )
{
Text [ en-US ] = "Unexpected end of file." ;
};
String ERR_CODE ( ERRCODE_CLASS_READ , ERR_SW6_PASSWD )
{
Text [ en-US ] = "Password-protected files cannot be opened." ;
};
String ERR_CODE ( ERRCODE_CLASS_READ , ERR_WW6_NO_WW6_FILE_ERR )
{
Text [ en-US ] = "This is not a valid WinWord6 file." ;
};
String ERR_CODE ( ERRCODE_CLASS_READ , ERR_WW6_FASTSAVE_ERR )
{
Text [ en-US ] = "This file was saved with WinWord in 'Fast Save' mode. Please unmark the WinWord option 'Allow Fast Saves' and save the file again." ;
};
String ERR_CODE ( ERRCODE_CLASS_READ , ERR_FORMAT_ROWCOL )
{
Text [ en-US ] = "File format error found at $(ARG1)(row,col)." ;
};
String ERR_CODE ( ERRCODE_CLASS_READ , ERR_SWG_NEW_VERSION )
{
Text [ en-US ] = "File has been written in a newer version." ;
};
String ERR_CODE ( ERRCODE_CLASS_READ , ERR_WW8_NO_WW8_FILE_ERR )
{
Text [ en-US ] = "This is not a valid WinWord97 file.";
};
String ERR_CODE ( ERRCODE_CLASS_READ , ERR_FORMAT_FILE_ROWCOL )
{
Text [ en-US ] = "Format error discovered in the file in sub-document $(ARG1) at $(ARG2)(row,col).";
};
// Export-Errors
String ERR_CODE ( ERRCODE_CLASS_WRITE , ERR_SWG_WRITE_ERROR )
{
Text [ en-US ] = "Error writing file." ;
};
String ERR_CODE ( ERRCODE_CLASS_WRITE , ERR_SWG_OLD_GLOSSARY )
{
Text [ en-US ] = "Wrong AutoText document version." ;
};
String ERR_CODE ( ERRCODE_CLASS_WRITE , ERR_WRITE_ERROR_FILE )
{
Text [ en-US ] = "Error in writing sub-document $(ARG1).";
};
// Import-/Export-Errors
String ERR_CODE ( ERRCODE_CLASS_READ , ERR_SWG_INTERNAL_ERROR )
{
Text [ en-US ] = "Internal error in %PRODUCTNAME Writer file format." ;
};
String ERR_CODE ( ERRCODE_CLASS_WRITE , ERR_SWG_INTERNAL_ERROR )
{
Text [ en-US ] = "Internal error in %PRODUCTNAME Writer file format." ;
};
String ERR_CODE ( ERRCODE_CLASS_LOCKING , ERR_TXTBLOCK_NEWFILE_ERROR )
{
Text [ en-US ] = "$(ARG1) has changed." ;
};
String ERR_CODE ( ERRCODE_CLASS_PATH , ERR_AUTOPATH_ERROR )
{
Text [ en-US ] = "$(ARG1) does not exist." ;
};
String ERR_CODE ( ERRCODE_CLASS_NONE , ERR_TBLSPLIT_ERROR )
{
Text [ en-US ] = "Cells cannot be further split." ;
};
String ERR_CODE ( ERRCODE_CLASS_NONE , ERR_TBLINSCOL_ERROR )
{
Text [ en-US ] = "Additional columns cannot be inserted." ;
};
String ERR_CODE ( ERRCODE_CLASS_NONE , ERR_TBLDDECHG_ERROR )
{
Text [ en-US ] = "The structure of a linked table cannot be modified." ;
};
ItemList [ en-US ] =
{
// Import-Errors
< "File format error found." ; ERR_CODE ( ERRCODE_CLASS_READ , ERR_SWG_FILE_FORMAT_ERROR ) ; >;
< "Error reading file." ; ERR_CODE ( ERRCODE_CLASS_READ , ERR_SWG_READ_ERROR ) ; >;
< "Input file error." ; ERR_CODE ( ERRCODE_CLASS_READ , ERR_SW6_INPUT_FILE ) ; >;
< "This is not a %PRODUCTNAME Writer file." ; ERR_CODE ( ERRCODE_CLASS_READ , ERR_SW6_NOWRITER_FILE ) ; >;
< "Unexpected end of file." ; ERR_CODE ( ERRCODE_CLASS_READ , ERR_SW6_UNEXPECTED_EOF ) ; >;
< "Password-protected files cannot be opened." ; ERR_CODE ( ERRCODE_CLASS_READ , ERR_SW6_PASSWD ) ; >;
< "This is not a valid WinWord6 file." ; ERR_CODE ( ERRCODE_CLASS_READ , ERR_WW6_NO_WW6_FILE_ERR ) ; >;
< "This file was saved with WinWord in 'Fast Save' mode. Please unmark the WinWord option 'Allow Fast Saves' and save the file again." ; ERR_CODE ( ERRCODE_CLASS_READ , ERR_WW6_FASTSAVE_ERR ) ; >;
< "File format error found at $(ARG1)(row,col)." ; ERR_CODE ( ERRCODE_CLASS_READ , ERR_FORMAT_ROWCOL ) ; >;
< "File has been written in a newer version." ; ERR_CODE ( ERRCODE_CLASS_READ , ERR_SWG_NEW_VERSION ) ; >;
< "This is not a valid WinWord97 file."; ERR_CODE ( ERRCODE_CLASS_READ , ERR_WW8_NO_WW8_FILE_ERR ) ; >;
< "Format error discovered in the file in sub-document $(ARG1) at $(ARG2)(row,col)."; ERR_CODE ( ERRCODE_CLASS_READ , ERR_FORMAT_FILE_ROWCOL ) ; >;
// Export-Errors
< "Error writing file." ; ERR_CODE ( ERRCODE_CLASS_WRITE , ERR_SWG_WRITE_ERROR ) ; >;
< "Wrong AutoText document version." ; ERR_CODE ( ERRCODE_CLASS_WRITE , ERR_SWG_OLD_GLOSSARY ) ; >;
< "Error in writing sub-document $(ARG1)."; ERR_CODE ( ERRCODE_CLASS_WRITE , ERR_WRITE_ERROR_FILE ) ; >;
// Import-/Export-Errors
< "Internal error in %PRODUCTNAME Writer file format." ; ERR_CODE ( ERRCODE_CLASS_READ , ERR_SWG_INTERNAL_ERROR ) ; >;
< "Internal error in %PRODUCTNAME Writer file format." ; ERR_CODE ( ERRCODE_CLASS_WRITE , ERR_SWG_INTERNAL_ERROR ) ; >;
< "$(ARG1) has changed." ; ERR_CODE ( ERRCODE_CLASS_LOCKING , ERR_TXTBLOCK_NEWFILE_ERROR ) ; >;
< "$(ARG1) does not exist." ; ERR_CODE ( ERRCODE_CLASS_PATH , ERR_AUTOPATH_ERROR ) ; >;
< "Cells cannot be further split." ; ERR_CODE ( ERRCODE_CLASS_NONE , ERR_TBLSPLIT_ERROR ) ; >;
< "Additional columns cannot be inserted." ; ERR_CODE ( ERRCODE_CLASS_NONE , ERR_TBLINSCOL_ERROR ) ; >;
< "The structure of a linked table cannot be modified." ; ERR_CODE ( ERRCODE_CLASS_NONE , ERR_TBLDDECHG_ERROR ) ; >;
String WARN_CODE ( ERRCODE_CLASS_READ , WARN_SWG_NO_DRAWINGS )
{
Text [ en-US ] = "No drawings could be read." ;
};
String WARN_CODE ( ERRCODE_CLASS_READ , WARN_WW6_FASTSAVE_ERR )
{
Text [ en-US ] = "This file was saved with WinWord in 'Fast Save' mode. Please unmark the WinWord option 'Allow Fast Saves' and save the file again." ;
};
String WARN_CODE ( ERRCODE_CLASS_READ , WARN_SWG_FEATURES_LOST )
{
Text [ en-US ] = "Not all attributes could be read." ;
};
String WARN_CODE ( ERRCODE_CLASS_WRITE , WARN_SWG_FEATURES_LOST )
{
Text [ en-US ] = "Not all attributes could be recorded." ;
};
String WARN_CODE ( ERRCODE_CLASS_READ , WARN_SWG_OLE )
{
Text [ en-US ] = "Some OLE objects could only be loaded as images." ;
};
String WARN_CODE ( ERRCODE_CLASS_WRITE , WARN_SWG_OLE )
{
Text [ en-US ] = "Some OLE objects could only be saved as images." ;
};
String WARN_CODE ( ERRCODE_CLASS_READ , WARN_SWG_POOR_LOAD )
{
Text [ en-US ] = "Document could not be completely loaded." ;
};
String WARN_CODE ( ERRCODE_CLASS_WRITE , WARN_SWG_POOR_LOAD )
{
Text [ en-US ] = "Document could not be completely saved." ;
};
String WARN_CODE ( ERRCODE_CLASS_WRITE , WARN_SWG_HTML_NO_MACROS)
{
Text [ en-US ] = "This HTML document contains %PRODUCTNAME Basic macros.\nThey were not saved with the current export settings.";
};
String ERR_CODE ( ERRCODE_CLASS_WRITE , WARN_WRITE_ERROR_FILE )
{
Text [ en-US ] = "Error in writing sub-document $(ARG1).";
};
String ERR_CODE ( ERRCODE_CLASS_WRITE , WARN_FORMAT_FILE_ROWCOL )
{
Text [ en-US ] = "Format error discovered in the file in sub-document $(ARG1) at $(ARG2)(row,col).";
< "No drawings could be read." ; WARN_CODE ( ERRCODE_CLASS_READ , WARN_SWG_NO_DRAWINGS ) ; >;
< "This file was saved with WinWord in 'Fast Save' mode. Please unmark the WinWord option 'Allow Fast Saves' and save the file again." ; WARN_CODE ( ERRCODE_CLASS_READ , WARN_WW6_FASTSAVE_ERR ) ; >;
< "Not all attributes could be read." ; WARN_CODE ( ERRCODE_CLASS_READ , WARN_SWG_FEATURES_LOST ) ; >;
< "Not all attributes could be recorded." ; WARN_CODE ( ERRCODE_CLASS_WRITE , WARN_SWG_FEATURES_LOST ) ; >;
< "Some OLE objects could only be loaded as images." ; WARN_CODE ( ERRCODE_CLASS_READ , WARN_SWG_OLE ) ; >;
< "Some OLE objects could only be saved as images." ; WARN_CODE ( ERRCODE_CLASS_WRITE , WARN_SWG_OLE ) ; >;
< "Document could not be completely loaded." ; WARN_CODE ( ERRCODE_CLASS_READ , WARN_SWG_POOR_LOAD ) ; >;
< "Document could not be completely saved." ; WARN_CODE ( ERRCODE_CLASS_WRITE , WARN_SWG_POOR_LOAD ) ; >;
< "This HTML document contains %PRODUCTNAME Basic macros.\nThey were not saved with the current export settings."; WARN_CODE ( ERRCODE_CLASS_WRITE , WARN_SWG_HTML_NO_MACROS) ; >;
< "Error in writing sub-document $(ARG1)."; ERR_CODE ( ERRCODE_CLASS_WRITE , WARN_WRITE_ERROR_FILE ) ; >;
< "Format error discovered in the file in sub-document $(ARG1) at $(ARG2)(row,col)."; ERR_CODE ( ERRCODE_CLASS_WRITE , WARN_FORMAT_FILE_ROWCOL ) ; >;
};
};
......
......@@ -1298,14 +1298,10 @@ bool
ErrorResource::getString(ErrCode nErrorCode, OUString &rString)
const
{
ResId aResId(static_cast< sal_uInt16 >(nErrorCode & ERRCODE_RES_MASK),
*m_pResMgr);
aResId.SetRT(RSC_STRING);
if (!IsAvailableRes(aResId))
sal_uInt32 nIdx = m_aStringArray.FindIndex(nErrorCode & ERRCODE_RES_MASK);
if (nIdx == RESARRAY_INDEX_NOTFOUND)
return false;
aResId.SetAutoRelease(false);
rString = aResId.toString();
m_pResMgr->PopContext();
rString = m_aStringArray.GetString(nIdx);
return true;
}
......
......@@ -32,6 +32,7 @@
#include <tools/errcode.hxx>
#include <tools/rc.hxx>
#include <tools/resary.hxx>
#include <tools/wintypes.hxx>
#include <unordered_map>
......@@ -247,12 +248,11 @@ private:
css::uno::Sequence< css::uno::Reference< css::task::XInteractionContinuation > > const & rContinuations );
};
class ErrorResource: private Resource
class ErrorResource
{
ResStringArray m_aStringArray;
public:
explicit ErrorResource(ResId & rResId): Resource(rResId) {}
~ErrorResource() { FreeResource(); }
explicit ErrorResource(ResId& rResId) : m_aStringArray(rResId) {}
bool getString(ErrCode nErrorCode, OUString &rString) const;
};
......
This diff is collapsed.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment